From 9c24376593c44102bfa11991a912da4b56169a6c Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 8 Mar 2022 01:00:53 +0000 Subject: [PATCH 1/2] feat: Add Cloud_Resource Connection Support PiperOrigin-RevId: 433053270 Source-Link: https://github.com/googleapis/googleapis/commit/eb0700c6f29ca94f460307f201eb605744f055cb Source-Link: https://github.com/googleapis/googleapis-gen/commit/06782869ed2b853b2750ea2a78fc4b081a822de9 Copy-Tag: eyJwIjoiQmlnUXVlcnlDb25uZWN0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiIwNjc4Mjg2OWVkMmI4NTNiMjc1MGVhMmE3OGZjNGIwODFhODIyZGU5In0= --- .../Bigquery/Connection/V1/Connection.php | Bin 0 -> 5591 bytes .../BigQuery/Connection/V1/AwsAccessRole.php | 110 +++ .../Connection/V1/AwsCrossAccountRole.php | 148 ++++ .../BigQuery/Connection/V1/AwsProperties.php | 114 +++ .../Connection/V1/CloudResourceProperties.php | 96 +++ .../Connection/V1/CloudSpannerProperties.php | 101 +++ .../Connection/V1/CloudSqlCredential.php | 101 +++ .../Connection/V1/CloudSqlProperties.php | 179 +++++ .../V1/CloudSqlProperties/DatabaseType.php | 64 ++ .../V1/CloudSqlProperties_DatabaseType.php | 16 + .../BigQuery/Connection/V1/Connection.php | 383 ++++++++++ .../V1/ConnectionServiceGrpcClient.php | 167 +++++ .../Connection/V1/CreateConnectionRequest.php | 149 ++++ .../Connection/V1/DeleteConnectionRequest.php | 71 ++ .../Connection/V1/GetConnectionRequest.php | 71 ++ .../Connection/V1/ListConnectionsRequest.php | 139 ++++ .../Connection/V1/ListConnectionsResponse.php | 101 +++ .../Connection/V1/UpdateConnectionRequest.php | 159 ++++ .../v1/src/V1/ConnectionServiceClient.php | 34 + .../V1/Gapic/ConnectionServiceGapicClient.php | 697 ++++++++++++++++++ .../v1/src/V1/gapic_metadata.json | 58 ++ .../connection_service_client_config.json | 85 +++ .../connection_service_descriptor_config.php | 18 + .../connection_service_rest_client_config.php | 107 +++ .../Unit/V1/ConnectionServiceClientTest.php | 647 ++++++++++++++++ 25 files changed, 3815 insertions(+) create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Connection/V1/Connection.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsAccessRole.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsCrossAccountRole.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsProperties.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSpannerProperties.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlCredential.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties_DatabaseType.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/Connection.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ConnectionServiceGrpcClient.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CreateConnectionRequest.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/DeleteConnectionRequest.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/GetConnectionRequest.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsRequest.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsResponse.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/UpdateConnectionRequest.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/src/V1/ConnectionServiceClient.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/src/V1/Gapic/ConnectionServiceGapicClient.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/src/V1/gapic_metadata.json create mode 100644 owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_client_config.json create mode 100644 owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_descriptor_config.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_rest_client_config.php create mode 100644 owl-bot-staging/BigQueryConnection/v1/tests/Unit/V1/ConnectionServiceClientTest.php 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 0000000000000000000000000000000000000000..4636ba57cc04a69d500010a02dd61d3afdda0b59 GIT binary patch literal 5591 zcmcIoZ%-6Q8211z44`xrI5Dm3Vj>XS3)HlFh;@%UkQC$uq|uyimb(GA?(MESdmtsW zNxwqBMD0gt-}i-Wnx?)ZX<`~*H2nyD)n{h*-`#=kVe1>toq3*lp5OeQ-#jxnKXtYo zG%U>#i@3T+D$@F{u7r2LX}cWG5BwXZ^cC$P3H~{?b<-$I)YCoqbJ?JpVHuvG zo5q)r-?X%$o0Ncg^W2S^#Y2^t!ID)bBcqb=$>v^mY`|k$3Zg4Ahyb3_yyX$s(#=wy z(6Vbdp6wQ4YBsw`ybxISWn|P}mbo)Fq!AHgHro{BwB)%p5?@`CT;kPSYl_Fs9PEd` zN{3*lIz~ygESsTVTQr-Ea*A9WWjJFR#PV9RnKg)6$&oF6+pyi%OqYpIqQpVY>s8=D z3H}sq*zDcp>-m*TRaSDMx5gr%w)#mhDJeD5l^cDfw*8|Hqf4e;7S*GO#Q_WoI8`$X{s10A zy%BDjQAxLP5ACni6utur6)IM`9R|85Grp%cg0Dm&=D<^%{1Ba+BVP112t0>6n11?U zU*lmbXgt``X!XYUBUkd*XkfvhG3PY!{tmDVpe{$>BpLVRYsJc!O%fohD>K9`09E(NStLV*#qd4vY@#3cVydh(wg2t`D~J#jMPe$>0+f^1aG zU5#^;7Y06yx-0%638#`^0A4^{T#GdN)Z}dGp8O=p?M))3@cv-ssR;_}5Z5yZy>kMq zs9oQo=}r#!WFkN64y|*s3RTTo4-GmKXkXlPKX*2j$e9RA7}j}RL#Kt;Ko!#i-0jWe zZi9oe&M(s-rfdMH<{2OdC&6tyqd+^ph%huso>sLh254eMOgI%yxPVS?=~M#;6%asZ zlG5+NU?;cE(!W)wH95hz9oPN>8a|rY^MCDULK)5M1wZ#=tsqQ|ig`cR0~!(Tr~JGP z;pS~-JTffko}fo#sw-5X4|THcab2fG=rCSJ9p0`(IL}T`=92?mM=B-ndtC)zxCpWy zp~b|lRl34C`!5&I{9(9990*<*uakM5bb?^nI!c}e%_3Jgb@BsJ4S+7-zw`Eu4$LQ=Ki*w>Z z+rrk3h?fR7!bb*kT@TQXVFV5^emh_zEYdDsTk^*otSFYlJp=p(=Zd#0C@p89k73%> zECsCCA%blKY69TlfCsg~*PQ&N7rh@T_KKK`|4N}g;7i>xh!cuZgPGqt47J+k$mE-s zufJ`ZmNTp`+!Ni{bSNcbF$o!~la6ex#X3+g3d8Y8PGUa+fBYj*w62rFHxkjX&gR%j z-r`A4V38y%$Rkp$6UVXr1C_UV_}3IV)6gp6WM@)?RggilO>Qz4-I;v5E}i6icA)z0 zHhvAvYiz(0GOy7rNU3G!>4JHat!_#^^DeO6jFD|T)~@02AkD@`EMc0BWBx)!SpxG5vKBEj%-1`&1*Vn zdXiC|J)ML>WK&}YYG2@B+;;ej27|R{B{r=o*7)FCVtw>3vC>!&Jk~Q|tl|obU#1XV zg{vk@iMUmRQuZc;M;d@@o)UyTnqa11mRmfP&*a(T!0t5#$rCykB@~4}^wkUX(p&GE zzpI~bd7eYFnas}4j-N(&k!ELa_*gjpwu!ubzUr8|w_&^0+)pV~x&qhn02@Ah#DhjL z^>9&K;$gO_TbqjQZe})##S17C-S6M{fH@VNEZ?^c&+%7EaSKu4mGT~Y@r+&Gm9>c% x!K{-1n8{u<`8@a#J`R-NEo=Q0kL05(;WN*;cms?*86Npu$Y+XYy?wNg(7(X_eSrV~ literal 0 HcmV?d00001 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..21d6d75cf245 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsCrossAccountRole.php @@ -0,0 +1,148 @@ +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..f7c797c0f5c8 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsProperties.php @@ -0,0 +1,114 @@ +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. + * @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. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2; + * @return \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole|null + */ + public function getCrossAccountRole() + { + return $this->readOneof(2); + } + + public function hasCrossAccountRole() + { + return $this->hasOneof(2); + } + + /** + * Authentication using Google owned AWS IAM user's access key to assume + * into customer's AWS IAM Role. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2; + * @param \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole $var + * @return $this + */ + public function setCrossAccountRole($var) + { + 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/CloudResourceProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php new file mode 100644 index 000000000000..b28e1d8b3742 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php @@ -0,0 +1,96 @@ +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..30da9bbfb8eb --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSpannerProperties.php @@ -0,0 +1,101 @@ +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; + + /** + * 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 + * } + */ + 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; + } + +} + 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..435e79c45745 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties.php @@ -0,0 +1,179 @@ +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; + + /** + * 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. + * } + */ + 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; + } + +} + 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/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..13145b35da6c --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties_DatabaseType.php @@ -0,0 +1,16 @@ +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\CloudSpannerProperties $cloud_spanner + * Cloud Spanner properties. + * @type \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties $cloud_resource + * Cloud Resource properties. + * @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; + } + + /** + * 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; + } + + /** + * 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/ConnectionServiceGrpcClient.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ConnectionServiceGrpcClient.php new file mode 100644 index 000000000000..091e33423869 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ConnectionServiceGrpcClient.php @@ -0,0 +1,167 @@ +_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/CreateConnection', + $argument, + ['\Google\Cloud\BigQuery\Connection\V1\Connection', 'decode'], + $metadata, $options); + } + + /** + * Returns specified connection. + * @param \Google\Cloud\BigQuery\Connection\V1\GetConnectionRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetConnection(\Google\Cloud\BigQuery\Connection\V1\GetConnectionRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/GetConnection', + $argument, + ['\Google\Cloud\BigQuery\Connection\V1\Connection', 'decode'], + $metadata, $options); + } + + /** + * Returns a list of connections in the given project. + * @param \Google\Cloud\BigQuery\Connection\V1\ListConnectionsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function ListConnections(\Google\Cloud\BigQuery\Connection\V1\ListConnectionsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/ListConnections', + $argument, + ['\Google\Cloud\BigQuery\Connection\V1\ListConnectionsResponse', 'decode'], + $metadata, $options); + } + + /** + * Updates the specified connection. For security reasons, also resets + * credential if connection properties are in the update field mask. + * @param \Google\Cloud\BigQuery\Connection\V1\UpdateConnectionRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function UpdateConnection(\Google\Cloud\BigQuery\Connection\V1\UpdateConnectionRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/UpdateConnection', + $argument, + ['\Google\Cloud\BigQuery\Connection\V1\Connection', 'decode'], + $metadata, $options); + } + + /** + * Deletes connection and associated credential. + * @param \Google\Cloud\BigQuery\Connection\V1\DeleteConnectionRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function DeleteConnection(\Google\Cloud\BigQuery\Connection\V1\DeleteConnectionRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/DeleteConnection', + $argument, + ['\Google\Protobuf\GPBEmpty', 'decode'], + $metadata, $options); + } + + /** + * Gets the access control policy for a resource. + * Returns an empty policy if the resource exists and does not have a policy + * set. + * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/GetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * Sets the access control policy on the specified resource. Replaces any + * existing policy. + * + * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/SetIamPolicy', + $argument, + ['\Google\Cloud\Iam\V1\Policy', 'decode'], + $metadata, $options); + } + + /** + * 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. + * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument + * @param array $metadata metadata + * @param array $options call options + * @return \Grpc\UnaryCall + */ + public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, + $metadata = [], $options = []) { + return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/TestIamPermissions', + $argument, + ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], + $metadata, $options); + } + +} 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..896e3811db15 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CreateConnectionRequest.php @@ -0,0 +1,149 @@ +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; + + /** + * 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..292e0a743d3b --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/DeleteConnectionRequest.php @@ -0,0 +1,71 @@ +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 = ''; + + /** + * 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..f38c634b0bf2 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/GetConnectionRequest.php @@ -0,0 +1,71 @@ +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 = ''; + + /** + * 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..1921a33cd358 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsRequest.php @@ -0,0 +1,139 @@ +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 = ''; + + /** + * 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..7c67f3c0b887 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsResponse.php @@ -0,0 +1,101 @@ +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 \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 \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/UpdateConnectionRequest.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/UpdateConnectionRequest.php new file mode 100644 index 000000000000..ba24973470ab --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/UpdateConnectionRequest.php @@ -0,0 +1,159 @@ +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; + + /** + * 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/src/V1/ConnectionServiceClient.php b/owl-bot-staging/BigQueryConnection/v1/src/V1/ConnectionServiceClient.php new file mode 100644 index 000000000000..ea5a4240ffdf --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/src/V1/ConnectionServiceClient.php @@ -0,0 +1,34 @@ +locationName('[PROJECT]', '[LOCATION]'); + * $connection = new Connection(); + * $response = $connectionServiceClient->createConnection($formattedParent, $connection); + * } finally { + * $connectionServiceClient->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. + */ +class ConnectionServiceGapicClient +{ + use GapicClientTrait; + + /** + * The name of the service. + */ + const SERVICE_NAME = 'google.cloud.bigquery.connection.v1.ConnectionService'; + + /** + * The default address of the service. + */ + const SERVICE_ADDRESS = 'bigqueryconnection.googleapis.com'; + + /** + * 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 $connectionNameTemplate; + + private static $locationNameTemplate; + + private static $pathTemplateMap; + + private static function getClientDefaults() + { + return [ + 'serviceName' => self::SERVICE_NAME, + 'serviceAddress' => 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', + ], + ], + ]; + } + + private static function getConnectionNameTemplate() + { + if (self::$connectionNameTemplate == null) { + self::$connectionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/connections/{connection}'); + } + + return self::$connectionNameTemplate; + } + + 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 = [ + 'connection' => self::getConnectionNameTemplate(), + 'location' => self::getLocationNameTemplate(), + ]; + } + + return self::$pathTemplateMap; + } + + /** + * 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($project, $location, $connection) + { + return self::getConnectionNameTemplate()->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($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 + * - connection: projects/{project}/locations/{location}/connections/{connection} + * - 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($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 $serviceAddress + * 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 + * $serviceAddress 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 + */ + public function __construct(array $options = []) + { + $clientOptions = $this->buildClientOptions($options); + $this->setClientOptions($clientOptions); + } + + /** + * Creates a new connection. + * + * Sample code: + * ``` + * $connectionServiceClient = new ConnectionServiceClient(); + * try { + * $formattedParent = $connectionServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $connection = new Connection(); + * $response = $connectionServiceClient->createConnection($formattedParent, $connection); + * } finally { + * $connectionServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. Parent resource name. + * Must be in the format `projects/{project_id}/locations/{location_id}` + * @param Connection $connection Required. Connection to create. + * @param array $optionalArgs { + * Optional. + * + * @type string $connectionId + * Optional. Connection id that should be assigned to the created connection. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\BigQuery\Connection\V1\Connection + * + * @throws ApiException if the remote call fails + */ + public function createConnection($parent, $connection, array $optionalArgs = []) + { + $request = new CreateConnectionRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setConnection($connection); + $requestParamHeaders['parent'] = $parent; + if (isset($optionalArgs['connectionId'])) { + $request->setConnectionId($optionalArgs['connectionId']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('CreateConnection', Connection::class, $optionalArgs, $request)->wait(); + } + + /** + * Deletes connection and associated credential. + * + * Sample code: + * ``` + * $connectionServiceClient = new ConnectionServiceClient(); + * try { + * $formattedName = $connectionServiceClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + * $connectionServiceClient->deleteConnection($formattedName); + * } finally { + * $connectionServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the deleted connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + public function deleteConnection($name, array $optionalArgs = []) + { + $request = new DeleteConnectionRequest(); + $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('DeleteConnection', GPBEmpty::class, $optionalArgs, $request)->wait(); + } + + /** + * Returns specified connection. + * + * Sample code: + * ``` + * $connectionServiceClient = new ConnectionServiceClient(); + * try { + * $formattedName = $connectionServiceClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + * $response = $connectionServiceClient->getConnection($formattedName); + * } finally { + * $connectionServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the requested connection, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\BigQuery\Connection\V1\Connection + * + * @throws ApiException if the remote call fails + */ + public function getConnection($name, array $optionalArgs = []) + { + $request = new GetConnectionRequest(); + $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('GetConnection', Connection::class, $optionalArgs, $request)->wait(); + } + + /** + * Gets the access control policy for a resource. + * Returns an empty policy if the resource exists and does not have a policy + * set. + * + * Sample code: + * ``` + * $connectionServiceClient = new ConnectionServiceClient(); + * try { + * $resource = 'resource'; + * $response = $connectionServiceClient->getIamPolicy($resource); + * } finally { + * $connectionServiceClient->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`. This field is only used by Cloud IAM. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + 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(); + } + + /** + * Returns a list of connections in the given project. + * + * Sample code: + * ``` + * $connectionServiceClient = new ConnectionServiceClient(); + * try { + * $formattedParent = $connectionServiceClient->locationName('[PROJECT]', '[LOCATION]'); + * $pageSize = 0; + * // Iterate over pages of elements + * $pagedResponse = $connectionServiceClient->listConnections($formattedParent, $pageSize); + * foreach ($pagedResponse->iteratePages() as $page) { + * foreach ($page as $element) { + * // doSomethingWith($element); + * } + * } + * // Alternatively: + * // Iterate through all elements + * $pagedResponse = $connectionServiceClient->listConnections($formattedParent, $pageSize); + * foreach ($pagedResponse->iterateAllElements() as $element) { + * // doSomethingWith($element); + * } + * } finally { + * $connectionServiceClient->close(); + * } + * ``` + * + * @param string $parent Required. Parent resource name. + * Must be in the form: `projects/{project_id}/locations/{location_id}` + * @param 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. + * @param array $optionalArgs { + * Optional. + * + * @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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + public function listConnections($parent, $pageSize, array $optionalArgs = []) + { + $request = new ListConnectionsRequest(); + $requestParamHeaders = []; + $request->setParent($parent); + $request->setPageSize($pageSize); + $requestParamHeaders['parent'] = $parent; + 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('ListConnections', $optionalArgs, ListConnectionsResponse::class, $request); + } + + /** + * Sets the access control policy on the specified resource. Replaces any + * existing policy. + * + * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + * + * Sample code: + * ``` + * $connectionServiceClient = new ConnectionServiceClient(); + * try { + * $resource = 'resource'; + * $policy = new Policy(); + * $response = $connectionServiceClient->setIamPolicy($resource, $policy); + * } finally { + * $connectionServiceClient->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 RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + $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(); + } + + /** + * 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. + * + * Sample code: + * ``` + * $connectionServiceClient = new ConnectionServiceClient(); + * try { + * $resource = 'resource'; + * $permissions = []; + * $response = $connectionServiceClient->testIamPermissions($resource, $permissions); + * } finally { + * $connectionServiceClient->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 Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + 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 the specified connection. For security reasons, also resets + * credential if connection properties are in the update field mask. + * + * Sample code: + * ``` + * $connectionServiceClient = new ConnectionServiceClient(); + * try { + * $formattedName = $connectionServiceClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + * $connection = new Connection(); + * $updateMask = new FieldMask(); + * $response = $connectionServiceClient->updateConnection($formattedName, $connection, $updateMask); + * } finally { + * $connectionServiceClient->close(); + * } + * ``` + * + * @param string $name Required. Name of the connection to update, for example: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * @param Connection $connection Required. Connection containing the updated fields. + * @param FieldMask $updateMask Required. Update mask for the connection fields to be updated. + * @param array $optionalArgs { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry + * settings parameters. See the documentation on + * {@see Google\ApiCore\RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\BigQuery\Connection\V1\Connection + * + * @throws ApiException if the remote call fails + */ + public function updateConnection($name, $connection, $updateMask, array $optionalArgs = []) + { + $request = new UpdateConnectionRequest(); + $requestParamHeaders = []; + $request->setName($name); + $request->setConnection($connection); + $request->setUpdateMask($updateMask); + $requestParamHeaders['name'] = $name; + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('UpdateConnection', Connection::class, $optionalArgs, $request)->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..4f9dc8b27a66 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_descriptor_config.php @@ -0,0 +1,18 @@ + [ + 'google.cloud.bigquery.connection.v1.ConnectionService' => [ + 'ListConnections' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getConnections', + ], + ], + ], + ], +]; 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..1bef0392066c --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_rest_client_config.php @@ -0,0 +1,107 @@ + [ + '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', + ], + ], + ], + ], +]; diff --git a/owl-bot-staging/BigQueryConnection/v1/tests/Unit/V1/ConnectionServiceClientTest.php b/owl-bot-staging/BigQueryConnection/v1/tests/Unit/V1/ConnectionServiceClientTest.php new file mode 100644 index 000000000000..6e484bc165a0 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/tests/Unit/V1/ConnectionServiceClientTest.php @@ -0,0 +1,647 @@ +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(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + $response = $client->createConnection($formattedParent, $connection); + $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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + try { + $client->createConnection($formattedParent, $connection); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $client->deleteConnection($formattedName); + $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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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 = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + try { + $client->deleteConnection($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $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(); + $client = $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 = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $response = $client->getConnection($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.connection.v1.ConnectionService/GetConnection', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getConnectionExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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 = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + try { + $client->getConnection($formattedName); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $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(); + $client = $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 = $client->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.connection.v1.ConnectionService/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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 { + $client->getIamPolicy($resource); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $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(); + $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $pageSize = 883849137; + $response = $client->listConnections($formattedParent, $pageSize); + $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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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 = $client->locationName('[PROJECT]', '[LOCATION]'); + $pageSize = 883849137; + try { + $client->listConnections($formattedParent, $pageSize); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $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(); + $client = $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 = $client->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.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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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 { + $client->setIamPolicy($resource, $policy); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $client->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.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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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 { + $client->testIamPermissions($resource, $permissions); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $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(); + $client = $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 = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $updateMask = new FieldMask(); + $response = $client->updateConnection($formattedName, $connection, $updateMask); + $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(); + $client = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal 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 = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $updateMask = new FieldMask(); + try { + $client->updateConnection($formattedName, $connection, $updateMask); + // If the $client method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } +} From 01a67bcad099b6bb855e739c2275e3c72305944d Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 8 Mar 2022 01:02:21 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- BigQueryConnection/metadata/V1/Connection.php | Bin 5534 -> 5591 bytes .../src}/V1/CloudResourceProperties.php | 2 +- BigQueryConnection/src/V1/Connection.php | 33 + .../Bigquery/Connection/V1/Connection.php | Bin 5591 -> 0 bytes .../BigQuery/Connection/V1/AwsAccessRole.php | 110 --- .../Connection/V1/AwsCrossAccountRole.php | 148 ---- .../BigQuery/Connection/V1/AwsProperties.php | 114 --- .../Connection/V1/CloudSpannerProperties.php | 101 --- .../Connection/V1/CloudSqlCredential.php | 101 --- .../Connection/V1/CloudSqlProperties.php | 179 ----- .../V1/CloudSqlProperties/DatabaseType.php | 64 -- .../V1/CloudSqlProperties_DatabaseType.php | 16 - .../BigQuery/Connection/V1/Connection.php | 383 ---------- .../V1/ConnectionServiceGrpcClient.php | 167 ----- .../Connection/V1/CreateConnectionRequest.php | 149 ---- .../Connection/V1/DeleteConnectionRequest.php | 71 -- .../Connection/V1/GetConnectionRequest.php | 71 -- .../Connection/V1/ListConnectionsRequest.php | 139 ---- .../Connection/V1/ListConnectionsResponse.php | 101 --- .../Connection/V1/UpdateConnectionRequest.php | 159 ---- .../v1/src/V1/ConnectionServiceClient.php | 34 - .../V1/Gapic/ConnectionServiceGapicClient.php | 697 ------------------ .../v1/src/V1/gapic_metadata.json | 58 -- .../connection_service_client_config.json | 85 --- .../connection_service_descriptor_config.php | 18 - .../connection_service_rest_client_config.php | 107 --- .../Unit/V1/ConnectionServiceClientTest.php | 647 ---------------- 27 files changed, 34 insertions(+), 3720 deletions(-) rename {owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection => BigQueryConnection/src}/V1/CloudResourceProperties.php (99%) delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/GPBMetadata/Google/Cloud/Bigquery/Connection/V1/Connection.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsAccessRole.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsCrossAccountRole.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsProperties.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSpannerProperties.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlCredential.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties_DatabaseType.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/Connection.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ConnectionServiceGrpcClient.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CreateConnectionRequest.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/DeleteConnectionRequest.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/GetConnectionRequest.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsRequest.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsResponse.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/UpdateConnectionRequest.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/src/V1/ConnectionServiceClient.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/src/V1/Gapic/ConnectionServiceGapicClient.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/src/V1/gapic_metadata.json delete mode 100644 owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_client_config.json delete mode 100644 owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_descriptor_config.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_rest_client_config.php delete mode 100644 owl-bot-staging/BigQueryConnection/v1/tests/Unit/V1/ConnectionServiceClientTest.php diff --git a/BigQueryConnection/metadata/V1/Connection.php b/BigQueryConnection/metadata/V1/Connection.php index cb7f5103a1a116cefbc20c5fe08c86100693b485..4636ba57cc04a69d500010a02dd61d3afdda0b59 100644 GIT binary patch delta 148 zcmbQIeO-G)5A)>X%=#=Bl(|eMdYeqvWBIz-nKgu&@zLfP9QuqBVO)I4Ir*h2@kOb{ z`K3k4sS;uej2hfVlN|-sCKqtCas)xeH}B&7#cZQw#U<_xQV$ajD9SHLEh@=OEf$jJ n5-LtDD$7hxjZaKY&M(a?iO)=tU<4Y+>BRiNk$LkL-dF4ZZ(K23 delta 100 zcmcbvJx_Z>5A);zW?7E#qQruN)S}|a|Cz)l_b}@--BH@Smsy)pRZ1>BKR-PuRllGp xza&4YG)=!8s#FgwqO^;VOMJ3DpZI1LRtsjvuFbX_`iz^8aK2^U{Fe6>I{*p-BQO8} diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php b/BigQueryConnection/src/V1/CloudResourceProperties.php similarity index 99% rename from owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php rename to BigQueryConnection/src/V1/CloudResourceProperties.php index b28e1d8b3742..dd5c3948e0d4 100644 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php +++ b/BigQueryConnection/src/V1/CloudResourceProperties.php @@ -28,7 +28,7 @@ class CloudResourceProperties extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string service_account_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - protected $service_account_id = ''; + private $service_account_id = ''; /** * Constructor. diff --git a/BigQueryConnection/src/V1/Connection.php b/BigQueryConnection/src/V1/Connection.php index 0d1cd70666f1..5a21e2a21b4f 100644 --- a/BigQueryConnection/src/V1/Connection.php +++ b/BigQueryConnection/src/V1/Connection.php @@ -74,6 +74,8 @@ class Connection extends \Google\Protobuf\Internal\Message * Amazon Web Services (AWS) 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 int|string $creation_time * Output only. The creation timestamp of the connection. * @type int|string $last_modified_time @@ -260,6 +262,37 @@ public function setCloudSpanner($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; + } + /** * Output only. The creation timestamp of the connection. * 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 deleted file mode 100644 index 4636ba57cc04a69d500010a02dd61d3afdda0b59..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5591 zcmcIoZ%-6Q8211z44`xrI5Dm3Vj>XS3)HlFh;@%UkQC$uq|uyimb(GA?(MESdmtsW zNxwqBMD0gt-}i-Wnx?)ZX<`~*H2nyD)n{h*-`#=kVe1>toq3*lp5OeQ-#jxnKXtYo zG%U>#i@3T+D$@F{u7r2LX}cWG5BwXZ^cC$P3H~{?b<-$I)YCoqbJ?JpVHuvG zo5q)r-?X%$o0Ncg^W2S^#Y2^t!ID)bBcqb=$>v^mY`|k$3Zg4Ahyb3_yyX$s(#=wy z(6Vbdp6wQ4YBsw`ybxISWn|P}mbo)Fq!AHgHro{BwB)%p5?@`CT;kPSYl_Fs9PEd` zN{3*lIz~ygESsTVTQr-Ea*A9WWjJFR#PV9RnKg)6$&oF6+pyi%OqYpIqQpVY>s8=D z3H}sq*zDcp>-m*TRaSDMx5gr%w)#mhDJeD5l^cDfw*8|Hqf4e;7S*GO#Q_WoI8`$X{s10A zy%BDjQAxLP5ACni6utur6)IM`9R|85Grp%cg0Dm&=D<^%{1Ba+BVP112t0>6n11?U zU*lmbXgt``X!XYUBUkd*XkfvhG3PY!{tmDVpe{$>BpLVRYsJc!O%fohD>K9`09E(NStLV*#qd4vY@#3cVydh(wg2t`D~J#jMPe$>0+f^1aG zU5#^;7Y06yx-0%638#`^0A4^{T#GdN)Z}dGp8O=p?M))3@cv-ssR;_}5Z5yZy>kMq zs9oQo=}r#!WFkN64y|*s3RTTo4-GmKXkXlPKX*2j$e9RA7}j}RL#Kt;Ko!#i-0jWe zZi9oe&M(s-rfdMH<{2OdC&6tyqd+^ph%huso>sLh254eMOgI%yxPVS?=~M#;6%asZ zlG5+NU?;cE(!W)wH95hz9oPN>8a|rY^MCDULK)5M1wZ#=tsqQ|ig`cR0~!(Tr~JGP z;pS~-JTffko}fo#sw-5X4|THcab2fG=rCSJ9p0`(IL}T`=92?mM=B-ndtC)zxCpWy zp~b|lRl34C`!5&I{9(9990*<*uakM5bb?^nI!c}e%_3Jgb@BsJ4S+7-zw`Eu4$LQ=Ki*w>Z z+rrk3h?fR7!bb*kT@TQXVFV5^emh_zEYdDsTk^*otSFYlJp=p(=Zd#0C@p89k73%> zECsCCA%blKY69TlfCsg~*PQ&N7rh@T_KKK`|4N}g;7i>xh!cuZgPGqt47J+k$mE-s zufJ`ZmNTp`+!Ni{bSNcbF$o!~la6ex#X3+g3d8Y8PGUa+fBYj*w62rFHxkjX&gR%j z-r`A4V38y%$Rkp$6UVXr1C_UV_}3IV)6gp6WM@)?RggilO>Qz4-I;v5E}i6icA)z0 zHhvAvYiz(0GOy7rNU3G!>4JHat!_#^^DeO6jFD|T)~@02AkD@`EMc0BWBx)!SpxG5vKBEj%-1`&1*Vn zdXiC|J)ML>WK&}YYG2@B+;;ej27|R{B{r=o*7)FCVtw>3vC>!&Jk~Q|tl|obU#1XV zg{vk@iMUmRQuZc;M;d@@o)UyTnqa11mRmfP&*a(T!0t5#$rCykB@~4}^wkUX(p&GE zzpI~bd7eYFnas}4j-N(&k!ELa_*gjpwu!ubzUr8|w_&^0+)pV~x&qhn02@Ah#DhjL z^>9&K;$gO_TbqjQZe})##S17C-S6M{fH@VNEZ?^c&+%7EaSKu4mGT~Y@r+&Gm9>c% x!K{-1n8{u<`8@a#J`R-NEo=Q0kL05(;WN*;cms?*86Npu$Y+XYy?wNg(7(X_eSrV~ 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 deleted file mode 100644 index a8e30e4d6bc3..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsAccessRole.php +++ /dev/null @@ -1,110 +0,0 @@ -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 deleted file mode 100644 index 21d6d75cf245..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsCrossAccountRole.php +++ /dev/null @@ -1,148 +0,0 @@ -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 deleted file mode 100644 index f7c797c0f5c8..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsProperties.php +++ /dev/null @@ -1,114 +0,0 @@ -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. - * @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. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2; - * @return \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole|null - */ - public function getCrossAccountRole() - { - return $this->readOneof(2); - } - - public function hasCrossAccountRole() - { - return $this->hasOneof(2); - } - - /** - * Authentication using Google owned AWS IAM user's access key to assume - * into customer's AWS IAM Role. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2; - * @param \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole $var - * @return $this - */ - public function setCrossAccountRole($var) - { - 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/CloudSpannerProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSpannerProperties.php deleted file mode 100644 index 30da9bbfb8eb..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSpannerProperties.php +++ /dev/null @@ -1,101 +0,0 @@ -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; - - /** - * 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 - * } - */ - 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; - } - -} - 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 deleted file mode 100644 index 29199f24bfeb..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlCredential.php +++ /dev/null @@ -1,101 +0,0 @@ -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 deleted file mode 100644 index 435e79c45745..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties.php +++ /dev/null @@ -1,179 +0,0 @@ -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; - - /** - * 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. - * } - */ - 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; - } - -} - 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 deleted file mode 100644 index 8c0ea09de1f7..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php +++ /dev/null @@ -1,64 +0,0 @@ -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/CloudSqlProperties_DatabaseType.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties_DatabaseType.php deleted file mode 100644 index 13145b35da6c..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties_DatabaseType.php +++ /dev/null @@ -1,16 +0,0 @@ -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\CloudSpannerProperties $cloud_spanner - * Cloud Spanner properties. - * @type \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties $cloud_resource - * Cloud Resource properties. - * @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; - } - - /** - * 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; - } - - /** - * 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/ConnectionServiceGrpcClient.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ConnectionServiceGrpcClient.php deleted file mode 100644 index 091e33423869..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ConnectionServiceGrpcClient.php +++ /dev/null @@ -1,167 +0,0 @@ -_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/CreateConnection', - $argument, - ['\Google\Cloud\BigQuery\Connection\V1\Connection', 'decode'], - $metadata, $options); - } - - /** - * Returns specified connection. - * @param \Google\Cloud\BigQuery\Connection\V1\GetConnectionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetConnection(\Google\Cloud\BigQuery\Connection\V1\GetConnectionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/GetConnection', - $argument, - ['\Google\Cloud\BigQuery\Connection\V1\Connection', 'decode'], - $metadata, $options); - } - - /** - * Returns a list of connections in the given project. - * @param \Google\Cloud\BigQuery\Connection\V1\ListConnectionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function ListConnections(\Google\Cloud\BigQuery\Connection\V1\ListConnectionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/ListConnections', - $argument, - ['\Google\Cloud\BigQuery\Connection\V1\ListConnectionsResponse', 'decode'], - $metadata, $options); - } - - /** - * Updates the specified connection. For security reasons, also resets - * credential if connection properties are in the update field mask. - * @param \Google\Cloud\BigQuery\Connection\V1\UpdateConnectionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function UpdateConnection(\Google\Cloud\BigQuery\Connection\V1\UpdateConnectionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/UpdateConnection', - $argument, - ['\Google\Cloud\BigQuery\Connection\V1\Connection', 'decode'], - $metadata, $options); - } - - /** - * Deletes connection and associated credential. - * @param \Google\Cloud\BigQuery\Connection\V1\DeleteConnectionRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function DeleteConnection(\Google\Cloud\BigQuery\Connection\V1\DeleteConnectionRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/DeleteConnection', - $argument, - ['\Google\Protobuf\GPBEmpty', 'decode'], - $metadata, $options); - } - - /** - * Gets the access control policy for a resource. - * Returns an empty policy if the resource exists and does not have a policy - * set. - * @param \Google\Cloud\Iam\V1\GetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function GetIamPolicy(\Google\Cloud\Iam\V1\GetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/GetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * Sets the access control policy on the specified resource. Replaces any - * existing policy. - * - * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. - * @param \Google\Cloud\Iam\V1\SetIamPolicyRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function SetIamPolicy(\Google\Cloud\Iam\V1\SetIamPolicyRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/SetIamPolicy', - $argument, - ['\Google\Cloud\Iam\V1\Policy', 'decode'], - $metadata, $options); - } - - /** - * 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. - * @param \Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument input argument - * @param array $metadata metadata - * @param array $options call options - * @return \Grpc\UnaryCall - */ - public function TestIamPermissions(\Google\Cloud\Iam\V1\TestIamPermissionsRequest $argument, - $metadata = [], $options = []) { - return $this->_simpleRequest('/google.cloud.bigquery.connection.v1.ConnectionService/TestIamPermissions', - $argument, - ['\Google\Cloud\Iam\V1\TestIamPermissionsResponse', 'decode'], - $metadata, $options); - } - -} 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 deleted file mode 100644 index 896e3811db15..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CreateConnectionRequest.php +++ /dev/null @@ -1,149 +0,0 @@ -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; - - /** - * 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 deleted file mode 100644 index 292e0a743d3b..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/DeleteConnectionRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -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 = ''; - - /** - * 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 deleted file mode 100644 index f38c634b0bf2..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/GetConnectionRequest.php +++ /dev/null @@ -1,71 +0,0 @@ -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 = ''; - - /** - * 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 deleted file mode 100644 index 1921a33cd358..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsRequest.php +++ /dev/null @@ -1,139 +0,0 @@ -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 = ''; - - /** - * 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 deleted file mode 100644 index 7c67f3c0b887..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/ListConnectionsResponse.php +++ /dev/null @@ -1,101 +0,0 @@ -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 \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 \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/UpdateConnectionRequest.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/UpdateConnectionRequest.php deleted file mode 100644 index ba24973470ab..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/UpdateConnectionRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -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; - - /** - * 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/src/V1/ConnectionServiceClient.php b/owl-bot-staging/BigQueryConnection/v1/src/V1/ConnectionServiceClient.php deleted file mode 100644 index ea5a4240ffdf..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/src/V1/ConnectionServiceClient.php +++ /dev/null @@ -1,34 +0,0 @@ -locationName('[PROJECT]', '[LOCATION]'); - * $connection = new Connection(); - * $response = $connectionServiceClient->createConnection($formattedParent, $connection); - * } finally { - * $connectionServiceClient->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. - */ -class ConnectionServiceGapicClient -{ - use GapicClientTrait; - - /** - * The name of the service. - */ - const SERVICE_NAME = 'google.cloud.bigquery.connection.v1.ConnectionService'; - - /** - * The default address of the service. - */ - const SERVICE_ADDRESS = 'bigqueryconnection.googleapis.com'; - - /** - * 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 $connectionNameTemplate; - - private static $locationNameTemplate; - - private static $pathTemplateMap; - - private static function getClientDefaults() - { - return [ - 'serviceName' => self::SERVICE_NAME, - 'serviceAddress' => 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', - ], - ], - ]; - } - - private static function getConnectionNameTemplate() - { - if (self::$connectionNameTemplate == null) { - self::$connectionNameTemplate = new PathTemplate('projects/{project}/locations/{location}/connections/{connection}'); - } - - return self::$connectionNameTemplate; - } - - 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 = [ - 'connection' => self::getConnectionNameTemplate(), - 'location' => self::getLocationNameTemplate(), - ]; - } - - return self::$pathTemplateMap; - } - - /** - * 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($project, $location, $connection) - { - return self::getConnectionNameTemplate()->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($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 - * - connection: projects/{project}/locations/{location}/connections/{connection} - * - 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($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 $serviceAddress - * 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 - * $serviceAddress 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 - */ - public function __construct(array $options = []) - { - $clientOptions = $this->buildClientOptions($options); - $this->setClientOptions($clientOptions); - } - - /** - * Creates a new connection. - * - * Sample code: - * ``` - * $connectionServiceClient = new ConnectionServiceClient(); - * try { - * $formattedParent = $connectionServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $connection = new Connection(); - * $response = $connectionServiceClient->createConnection($formattedParent, $connection); - * } finally { - * $connectionServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Parent resource name. - * Must be in the format `projects/{project_id}/locations/{location_id}` - * @param Connection $connection Required. Connection to create. - * @param array $optionalArgs { - * Optional. - * - * @type string $connectionId - * Optional. Connection id that should be assigned to the created connection. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\BigQuery\Connection\V1\Connection - * - * @throws ApiException if the remote call fails - */ - public function createConnection($parent, $connection, array $optionalArgs = []) - { - $request = new CreateConnectionRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setConnection($connection); - $requestParamHeaders['parent'] = $parent; - if (isset($optionalArgs['connectionId'])) { - $request->setConnectionId($optionalArgs['connectionId']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('CreateConnection', Connection::class, $optionalArgs, $request)->wait(); - } - - /** - * Deletes connection and associated credential. - * - * Sample code: - * ``` - * $connectionServiceClient = new ConnectionServiceClient(); - * try { - * $formattedName = $connectionServiceClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * $connectionServiceClient->deleteConnection($formattedName); - * } finally { - * $connectionServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the deleted connection, for example: - * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - public function deleteConnection($name, array $optionalArgs = []) - { - $request = new DeleteConnectionRequest(); - $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('DeleteConnection', GPBEmpty::class, $optionalArgs, $request)->wait(); - } - - /** - * Returns specified connection. - * - * Sample code: - * ``` - * $connectionServiceClient = new ConnectionServiceClient(); - * try { - * $formattedName = $connectionServiceClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * $response = $connectionServiceClient->getConnection($formattedName); - * } finally { - * $connectionServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the requested connection, for example: - * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\BigQuery\Connection\V1\Connection - * - * @throws ApiException if the remote call fails - */ - public function getConnection($name, array $optionalArgs = []) - { - $request = new GetConnectionRequest(); - $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('GetConnection', Connection::class, $optionalArgs, $request)->wait(); - } - - /** - * Gets the access control policy for a resource. - * Returns an empty policy if the resource exists and does not have a policy - * set. - * - * Sample code: - * ``` - * $connectionServiceClient = new ConnectionServiceClient(); - * try { - * $resource = 'resource'; - * $response = $connectionServiceClient->getIamPolicy($resource); - * } finally { - * $connectionServiceClient->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`. This field is only used by Cloud IAM. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - 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(); - } - - /** - * Returns a list of connections in the given project. - * - * Sample code: - * ``` - * $connectionServiceClient = new ConnectionServiceClient(); - * try { - * $formattedParent = $connectionServiceClient->locationName('[PROJECT]', '[LOCATION]'); - * $pageSize = 0; - * // Iterate over pages of elements - * $pagedResponse = $connectionServiceClient->listConnections($formattedParent, $pageSize); - * foreach ($pagedResponse->iteratePages() as $page) { - * foreach ($page as $element) { - * // doSomethingWith($element); - * } - * } - * // Alternatively: - * // Iterate through all elements - * $pagedResponse = $connectionServiceClient->listConnections($formattedParent, $pageSize); - * foreach ($pagedResponse->iterateAllElements() as $element) { - * // doSomethingWith($element); - * } - * } finally { - * $connectionServiceClient->close(); - * } - * ``` - * - * @param string $parent Required. Parent resource name. - * Must be in the form: `projects/{project_id}/locations/{location_id}` - * @param 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. - * @param array $optionalArgs { - * Optional. - * - * @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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - public function listConnections($parent, $pageSize, array $optionalArgs = []) - { - $request = new ListConnectionsRequest(); - $requestParamHeaders = []; - $request->setParent($parent); - $request->setPageSize($pageSize); - $requestParamHeaders['parent'] = $parent; - 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('ListConnections', $optionalArgs, ListConnectionsResponse::class, $request); - } - - /** - * Sets the access control policy on the specified resource. Replaces any - * existing policy. - * - * Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. - * - * Sample code: - * ``` - * $connectionServiceClient = new ConnectionServiceClient(); - * try { - * $resource = 'resource'; - * $policy = new Policy(); - * $response = $connectionServiceClient->setIamPolicy($resource, $policy); - * } finally { - * $connectionServiceClient->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 RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - $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(); - } - - /** - * 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. - * - * Sample code: - * ``` - * $connectionServiceClient = new ConnectionServiceClient(); - * try { - * $resource = 'resource'; - * $permissions = []; - * $response = $connectionServiceClient->testIamPermissions($resource, $permissions); - * } finally { - * $connectionServiceClient->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 Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - 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 the specified connection. For security reasons, also resets - * credential if connection properties are in the update field mask. - * - * Sample code: - * ``` - * $connectionServiceClient = new ConnectionServiceClient(); - * try { - * $formattedName = $connectionServiceClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - * $connection = new Connection(); - * $updateMask = new FieldMask(); - * $response = $connectionServiceClient->updateConnection($formattedName, $connection, $updateMask); - * } finally { - * $connectionServiceClient->close(); - * } - * ``` - * - * @param string $name Required. Name of the connection to update, for example: - * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` - * @param Connection $connection Required. Connection containing the updated fields. - * @param FieldMask $updateMask Required. Update mask for the connection fields to be updated. - * @param array $optionalArgs { - * Optional. - * - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see Google\ApiCore\RetrySettings} object, or an associative array of retry - * settings parameters. See the documentation on - * {@see Google\ApiCore\RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\BigQuery\Connection\V1\Connection - * - * @throws ApiException if the remote call fails - */ - public function updateConnection($name, $connection, $updateMask, array $optionalArgs = []) - { - $request = new UpdateConnectionRequest(); - $requestParamHeaders = []; - $request->setName($name); - $request->setConnection($connection); - $request->setUpdateMask($updateMask); - $requestParamHeaders['name'] = $name; - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('UpdateConnection', Connection::class, $optionalArgs, $request)->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 deleted file mode 100644 index 184acd74f36e..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/src/V1/gapic_metadata.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "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 deleted file mode 100644 index 31abd111ed39..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_client_config.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "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 deleted file mode 100644 index 4f9dc8b27a66..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_descriptor_config.php +++ /dev/null @@ -1,18 +0,0 @@ - [ - 'google.cloud.bigquery.connection.v1.ConnectionService' => [ - 'ListConnections' => [ - 'pageStreaming' => [ - 'requestPageTokenGetMethod' => 'getPageToken', - 'requestPageTokenSetMethod' => 'setPageToken', - 'requestPageSizeGetMethod' => 'getPageSize', - 'requestPageSizeSetMethod' => 'setPageSize', - 'responsePageTokenGetMethod' => 'getNextPageToken', - 'resourcesGetMethod' => 'getConnections', - ], - ], - ], - ], -]; 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 deleted file mode 100644 index 1bef0392066c..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/src/V1/resources/connection_service_rest_client_config.php +++ /dev/null @@ -1,107 +0,0 @@ - [ - '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', - ], - ], - ], - ], -]; diff --git a/owl-bot-staging/BigQueryConnection/v1/tests/Unit/V1/ConnectionServiceClientTest.php b/owl-bot-staging/BigQueryConnection/v1/tests/Unit/V1/ConnectionServiceClientTest.php deleted file mode 100644 index 6e484bc165a0..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/tests/Unit/V1/ConnectionServiceClientTest.php +++ /dev/null @@ -1,647 +0,0 @@ -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(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - $connection = new Connection(); - $response = $client->createConnection($formattedParent, $connection); - $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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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 = $client->locationName('[PROJECT]', '[LOCATION]'); - $connection = new Connection(); - try { - $client->createConnection($formattedParent, $connection); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $client->deleteConnection($formattedName); - $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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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 = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $client->deleteConnection($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $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(); - $client = $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 = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $client->getConnection($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.connection.v1.ConnectionService/GetConnection', $actualFuncCall); - $actualValue = $actualRequestObject->getName(); - $this->assertProtobufEquals($formattedName, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getConnectionExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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 = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $client->getConnection($formattedName); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $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(); - $client = $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 = $client->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.connection.v1.ConnectionService/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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 { - $client->getIamPolicy($resource); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $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(); - $client = $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 = $client->locationName('[PROJECT]', '[LOCATION]'); - $pageSize = 883849137; - $response = $client->listConnections($formattedParent, $pageSize); - $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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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 = $client->locationName('[PROJECT]', '[LOCATION]'); - $pageSize = 883849137; - try { - $client->listConnections($formattedParent, $pageSize); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $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(); - $client = $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 = $client->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.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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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 { - $client->setIamPolicy($resource, $policy); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $client->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.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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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 { - $client->testIamPermissions($resource, $permissions); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $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(); - $client = $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 = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $connection = new Connection(); - $updateMask = new FieldMask(); - $response = $client->updateConnection($formattedName, $connection, $updateMask); - $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(); - $client = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal 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 = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $connection = new Connection(); - $updateMask = new FieldMask(); - try { - $client->updateConnection($formattedName, $connection, $updateMask); - // If the $client method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}