From 4159855199d882f3fb584767d31cdc3b91a7e115 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 27 Jul 2022 00:56:45 +0000 Subject: [PATCH 1/6] feat: Add service_account_id output field to CloudSQL properties Clients can now observe the Service Account that is being used when connecting to the CloudSQL from the BigQuery. PiperOrigin-RevId: 463445598 Source-Link: https://github.com/googleapis/googleapis/commit/fe833ddc7356b404547de4d3c2495ef3881c25d0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/73fad9a6502225fc64332b2f6fea8089cda6db55 Copy-Tag: eyJwIjoiQmlnUXVlcnlDb25uZWN0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiI3M2ZhZDlhNjUwMjIyNWZjNjQzMzJiMmY2ZmVhODA4OWNkYTZkYjU1In0= --- .../Bigquery/Connection/V1/Connection.php | Bin 0 -> 5624 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 | 225 ++++++ .../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 | 707 ++++++++++++++++++ .../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, 3871 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..6d160bf774f6030bb753374018cec441b741685a GIT binary patch literal 5624 zcmcIoPfr_16t97#FhD{l0UV+>n_1aV4%S`|hxunywZtAYC z8TuFC-@H`Q3`#(}eQ&K{a#JNHux3`s#H1v2vb~pV3*s>^`PSuGh#)+rWz!{&sTrj# zp%q8BUCYVC)^vJ{xItjqmx)R5Sf);|NfW}xbh^#RdC7GeBzn3eImB%^<{Y=1DL4pz zl@5uWYU?G{G%Xed%cSXa=u@cTD8U6oC#Kt(%%V<=YKClUJG$j`Cb~{M5XClfS*rsE zO7JIdL9+MapXW(-Di$OgLY=GIZU-j@qC7&Y8hw1YwH#kpZt5PI)M_;V&mxrGM38Ql z{LAR?adh=KHHXKAl)@`j@hepcD^=N<85{LfYqkz0&Cnn!cI-lAp~g~P-t=}60MOYR*L7#krMPXSTVl8&aKP1rT zfq-3zXK-j*>K?;f{Fhiv@HN& z$T%hd@Kw~`;D(kNq&+N+`B?H%uLJ}mVDk`-W{E-mC->w(dJqbMga@Kv#KUN?<^XL} zjlD9*C@&0r2K86HOA>A+fdIUM`ZyPr=@WyarGNHg-?!J1l*0Ri!V?1+)+Uat6MFj{ ztfFphmnM68xMySOQFm#RiXv1sYdy-)nLzvEB!{`Oxme1CQ9`gu>jpX{wEC==9N}tj z#8>NIluddW2Qg-YfRpX?Pd_@#upHVCdn<=t*Q>3SQQ&ih8xbKQ`;IXgMum$ zAT&wIcVV%YOQ-2ys@)l#;9It1eGUyDP3?QX4pIS)ruO}x2a#3~wuZ%gkQo4u2=XaE z>q59a%?wAn3EdO)XpD6QD-5At);(@&ln5Ti>!`=wvkAx9so8A&KsSL($$DCgpbO`L z*28Eqa_bbXa1VLGW?}AONutEr(ZLt3Qn4DQ%Y0&4?BjWm7tuhI3GbtGS+%HU)IzRY zyr0jN@7*cna|_Fh%em~(J5Y(e`L#lEX+2jMO5i?pV)cIE?#fV?d@YP+Xak0@HQ@a4 zCShM}XsvfG$Ggzv1vGLvuG!uo=pqfk+Mo|e+tCbz7&@)*J5Q0^er$AstDXV$O8u~qkf1a0mWRQxO-!B0q6ozp(-eL$_V&5gu0Dv7{(c%S-W&a=`ICwZJ(M8{w;g&r@RDQ%G zo0D(xn)bV*c#vnamB5H}V(NuDdHwM9%`K&fy5@Y)IITzIp5-!;C($C%=oqQDsQE*ptP zUiZqz%rk#i$(wevaVOsgAA;#Y35H#pC%GjbUJm9!(_%;%nJFGQPvkqr-0uJ#AoMTR CVTVxw 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..58f5901b75b5 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties.php @@ -0,0 +1,225 @@ +google.cloud.bigquery.connection.v1.CloudSqlProperties + */ +class CloudSqlProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud SQL instance ID in the form `project:location:instance`. + * + * Generated from protobuf field string instance_id = 1; + */ + protected $instance_id = ''; + /** + * Database name. + * + * Generated from protobuf field string database = 2; + */ + protected $database = ''; + /** + * Type of the Cloud SQL database. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + */ + protected $type = 0; + /** + * Input only. Cloud SQL credential. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $credential = null; + /** + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $service_account_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_id + * Cloud SQL instance ID in the form `project:location:instance`. + * @type string $database + * Database name. + * @type int $type + * Type of the Cloud SQL database. + * @type \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $credential + * Input only. Cloud SQL credential. + * @type string $service_account_id + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Cloud SQL instance ID in the form `project:location:instance`. + * + * Generated from protobuf field string instance_id = 1; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Cloud SQL instance ID in the form `project:location:instance`. + * + * Generated from protobuf field string instance_id = 1; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Database name. + * + * Generated from protobuf field string database = 2; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Database name. + * + * Generated from protobuf field string database = 2; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * Type of the Cloud SQL database. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Type of the Cloud SQL database. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties\DatabaseType::class); + $this->type = $var; + + return $this; + } + + /** + * Input only. Cloud SQL credential. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential|null + */ + public function getCredential() + { + return $this->credential; + } + + public function hasCredential() + { + return isset($this->credential); + } + + public function clearCredential() + { + unset($this->credential); + } + + /** + * Input only. Cloud SQL credential. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $var + * @return $this + */ + public function setCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential::class); + $this->credential = $var; + + return $this; + } + + /** + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServiceAccountId() + { + return $this->service_account_id; + } + + /** + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServiceAccountId($var) + { + GPBUtil::checkString($var, True); + $this->service_account_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php new file mode 100644 index 000000000000..8c0ea09de1f7 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php @@ -0,0 +1,64 @@ +google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType + */ +class DatabaseType +{ + /** + * Unspecified database type. + * + * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; + */ + const DATABASE_TYPE_UNSPECIFIED = 0; + /** + * Cloud SQL for PostgreSQL. + * + * Generated from protobuf enum POSTGRES = 1; + */ + const POSTGRES = 1; + /** + * Cloud SQL for MySQL. + * + * Generated from protobuf enum MYSQL = 2; + */ + const MYSQL = 2; + + private static $valueToName = [ + self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', + self::POSTGRES => 'POSTGRES', + self::MYSQL => 'MYSQL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DatabaseType::class, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties_DatabaseType::class); + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/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..9e906d2b1dcc --- /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 array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $connections + * List of connections. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 1; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 1; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * List of connections. + * + * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConnections() + { + return $this->connections; + } + + /** + * List of connections. + * + * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + * @param array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Connection\V1\Connection::class); + $this->connections = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/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`. + * @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 FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a + * {@see 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; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * 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..a89401d01dfa --- /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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $friendlyName = 'friendlyName1451097503'; + $description = 'description-1724546052'; + $creationTime = 1932333101; + $lastModifiedTime = 671513446; + $hasCredential = true; + $expectedResponse = new Connection(); + $expectedResponse->setName($name); + $expectedResponse->setFriendlyName($friendlyName); + $expectedResponse->setDescription($description); + $expectedResponse->setCreationTime($creationTime); + $expectedResponse->setLastModifiedTime($lastModifiedTime); + $expectedResponse->setHasCredential($hasCredential); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + $response = $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + try { + $gapicClient->createConnection($formattedParent, $connection); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + try { + $gapicClient->deleteConnection($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $friendlyName = 'friendlyName1451097503'; + $description = 'description-1724546052'; + $creationTime = 1932333101; + $lastModifiedTime = 671513446; + $hasCredential = true; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $expectedResponse->setFriendlyName($friendlyName); + $expectedResponse->setDescription($description); + $expectedResponse->setCreationTime($creationTime); + $expectedResponse->setLastModifiedTime($lastModifiedTime); + $expectedResponse->setHasCredential($hasCredential); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $response = $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + try { + $gapicClient->getConnection($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listConnectionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $connectionsElement = new Connection(); + $connections = [ + $connectionsElement, + ]; + $expectedResponse = new ListConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConnections($connections); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $pageSize = 883849137; + $response = $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $pageSize = 883849137; + try { + $gapicClient->listConnections($formattedParent, $pageSize); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $friendlyName = 'friendlyName1451097503'; + $description = 'description-1724546052'; + $creationTime = 1932333101; + $lastModifiedTime = 671513446; + $hasCredential = true; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $expectedResponse->setFriendlyName($friendlyName); + $expectedResponse->setDescription($description); + $expectedResponse->setCreationTime($creationTime); + $expectedResponse->setLastModifiedTime($lastModifiedTime); + $expectedResponse->setHasCredential($hasCredential); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $updateMask = new FieldMask(); + $response = $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateConnection($formattedName, $connection, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->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 cff35786afabfd966754d3d26b3516a4a1f637d0 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 27 Jul 2022 00:58:21 +0000 Subject: [PATCH 2/6] =?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 5591 -> 5624 bytes .../src/V1/CloudSqlProperties.php | 46 ++ .../src/V1/ListConnectionsResponse.php | 4 +- .../Unit/V1/ConnectionServiceClientTest.php | 100 +-- .../Bigquery/Connection/V1/Connection.php | Bin 5624 -> 0 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 | 225 ------ .../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 | 707 ------------------ .../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 ---------------- 29 files changed, 98 insertions(+), 3923 deletions(-) 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/CloudResourceProperties.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 4636ba57cc04a69d500010a02dd61d3afdda0b59..6d160bf774f6030bb753374018cec441b741685a 100644 GIT binary patch delta 59 zcmcbv{X=`hZf3@hoA)q3Wn(-wc@ftmMIm`Eq2kn{vdrYv_{8Mo{L;LV_{%}5m; delta 25 hcmeyNeO-IQZf3>{oA)q3Wn)}9c@fv6%}cq1xd5IZ3rzq3 diff --git a/BigQueryConnection/src/V1/CloudSqlProperties.php b/BigQueryConnection/src/V1/CloudSqlProperties.php index 8b080da96488..a788603c4a12 100644 --- a/BigQueryConnection/src/V1/CloudSqlProperties.php +++ b/BigQueryConnection/src/V1/CloudSqlProperties.php @@ -39,6 +39,15 @@ class CloudSqlProperties extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; */ private $credential = null; + /** + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $service_account_id = ''; /** * Constructor. @@ -54,6 +63,11 @@ class CloudSqlProperties extends \Google\Protobuf\Internal\Message * Type of the Cloud SQL database. * @type \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $credential * Input only. Cloud SQL credential. + * @type string $service_account_id + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. * } */ public function __construct($data = NULL) { @@ -175,5 +189,37 @@ public function setCredential($var) return $this; } + /** + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServiceAccountId() + { + return $this->service_account_id; + } + + /** + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServiceAccountId($var) + { + GPBUtil::checkString($var, True); + $this->service_account_id = $var; + + return $this; + } + } diff --git a/BigQueryConnection/src/V1/ListConnectionsResponse.php b/BigQueryConnection/src/V1/ListConnectionsResponse.php index 35f9dcca72a0..7ad9652c5e4b 100644 --- a/BigQueryConnection/src/V1/ListConnectionsResponse.php +++ b/BigQueryConnection/src/V1/ListConnectionsResponse.php @@ -36,7 +36,7 @@ class ListConnectionsResponse extends \Google\Protobuf\Internal\Message * * @type string $next_page_token * Next page token. - * @type \Google\Cloud\BigQuery\Connection\V1\Connection[]|\Google\Protobuf\Internal\RepeatedField $connections + * @type array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $connections * List of connections. * } */ @@ -86,7 +86,7 @@ public function getConnections() * 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 + * @param array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $var * @return $this */ public function setConnections($var) diff --git a/BigQueryConnection/tests/Unit/V1/ConnectionServiceClientTest.php b/BigQueryConnection/tests/Unit/V1/ConnectionServiceClientTest.php index d0225aec18fe..89b6e8e30012 100644 --- a/BigQueryConnection/tests/Unit/V1/ConnectionServiceClientTest.php +++ b/BigQueryConnection/tests/Unit/V1/ConnectionServiceClientTest.php @@ -78,7 +78,7 @@ private function createClient(array $options = []) public function createConnectionTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -98,9 +98,9 @@ public function createConnectionTest() $expectedResponse->setHasCredential($hasCredential); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $connection = new Connection(); - $response = $client->createConnection($formattedParent, $connection); + $response = $gapicClient->createConnection($formattedParent, $connection); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -120,7 +120,7 @@ public function createConnectionTest() public function createConnectionExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -135,11 +135,11 @@ public function createConnectionExceptionTest() ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $connection = new Connection(); try { - $client->createConnection($formattedParent, $connection); - // If the $client method call did not throw, fail the test + $gapicClient->createConnection($formattedParent, $connection); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); @@ -156,7 +156,7 @@ public function createConnectionExceptionTest() public function deleteConnectionTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -164,8 +164,8 @@ public function deleteConnectionTest() $expectedResponse = new GPBEmpty(); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $client->deleteConnection($formattedName); + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $gapicClient->deleteConnection($formattedName); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); @@ -182,7 +182,7 @@ public function deleteConnectionTest() public function deleteConnectionExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -197,10 +197,10 @@ public function deleteConnectionExceptionTest() ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request - $formattedName = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); try { - $client->deleteConnection($formattedName); - // If the $client method call did not throw, fail the test + $gapicClient->deleteConnection($formattedName); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); @@ -217,7 +217,7 @@ public function deleteConnectionExceptionTest() public function getConnectionTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -237,8 +237,8 @@ public function getConnectionTest() $expectedResponse->setHasCredential($hasCredential); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $client->getConnection($formattedName); + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $response = $gapicClient->getConnection($formattedName); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -256,7 +256,7 @@ public function getConnectionTest() public function getConnectionExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -271,10 +271,10 @@ public function getConnectionExceptionTest() ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request - $formattedName = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); try { - $client->getConnection($formattedName); - // If the $client method call did not throw, fail the test + $gapicClient->getConnection($formattedName); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); @@ -291,7 +291,7 @@ public function getConnectionExceptionTest() public function getIamPolicyTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -304,7 +304,7 @@ public function getIamPolicyTest() $transport->addResponse($expectedResponse); // Mock request $resource = 'resource-341064690'; - $response = $client->getIamPolicy($resource); + $response = $gapicClient->getIamPolicy($resource); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -322,7 +322,7 @@ public function getIamPolicyTest() public function getIamPolicyExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -339,8 +339,8 @@ public function getIamPolicyExceptionTest() // Mock request $resource = 'resource-341064690'; try { - $client->getIamPolicy($resource); - // If the $client method call did not throw, fail the test + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); @@ -357,7 +357,7 @@ public function getIamPolicyExceptionTest() public function listConnectionsTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -372,9 +372,9 @@ public function listConnectionsTest() $expectedResponse->setConnections($connections); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $pageSize = 883849137; - $response = $client->listConnections($formattedParent, $pageSize); + $response = $gapicClient->listConnections($formattedParent, $pageSize); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); @@ -397,7 +397,7 @@ public function listConnectionsTest() public function listConnectionsExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -412,11 +412,11 @@ public function listConnectionsExceptionTest() ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request - $formattedParent = $client->locationName('[PROJECT]', '[LOCATION]'); + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $pageSize = 883849137; try { - $client->listConnections($formattedParent, $pageSize); - // If the $client method call did not throw, fail the test + $gapicClient->listConnections($formattedParent, $pageSize); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); @@ -433,7 +433,7 @@ public function listConnectionsExceptionTest() public function setIamPolicyTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -447,7 +447,7 @@ public function setIamPolicyTest() // Mock request $resource = 'resource-341064690'; $policy = new Policy(); - $response = $client->setIamPolicy($resource, $policy); + $response = $gapicClient->setIamPolicy($resource, $policy); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -467,7 +467,7 @@ public function setIamPolicyTest() public function setIamPolicyExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -485,8 +485,8 @@ public function setIamPolicyExceptionTest() $resource = 'resource-341064690'; $policy = new Policy(); try { - $client->setIamPolicy($resource, $policy); - // If the $client method call did not throw, fail the test + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); @@ -503,7 +503,7 @@ public function setIamPolicyExceptionTest() public function testIamPermissionsTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -513,7 +513,7 @@ public function testIamPermissionsTest() // Mock request $resource = 'resource-341064690'; $permissions = []; - $response = $client->testIamPermissions($resource, $permissions); + $response = $gapicClient->testIamPermissions($resource, $permissions); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -533,7 +533,7 @@ public function testIamPermissionsTest() public function testIamPermissionsExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -551,8 +551,8 @@ public function testIamPermissionsExceptionTest() $resource = 'resource-341064690'; $permissions = []; try { - $client->testIamPermissions($resource, $permissions); - // If the $client method call did not throw, fail the test + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); @@ -569,7 +569,7 @@ public function testIamPermissionsExceptionTest() public function updateConnectionTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -589,10 +589,10 @@ public function updateConnectionTest() $expectedResponse->setHasCredential($hasCredential); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); $connection = new Connection(); $updateMask = new FieldMask(); - $response = $client->updateConnection($formattedName, $connection, $updateMask); + $response = $gapicClient->updateConnection($formattedName, $connection, $updateMask); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); @@ -614,7 +614,7 @@ public function updateConnectionTest() public function updateConnectionExceptionTest() { $transport = $this->createTransport(); - $client = $this->createClient([ + $gapicClient = $this->createClient([ 'transport' => $transport, ]); $this->assertTrue($transport->isExhausted()); @@ -629,12 +629,12 @@ public function updateConnectionExceptionTest() ], JSON_PRETTY_PRINT); $transport->addResponse(null, $status); // Mock request - $formattedName = $client->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $formattedName = $gapicClient->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 + $gapicClient->updateConnection($formattedName, $connection, $updateMask); + // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { $this->assertEquals($status->code, $ex->getCode()); 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 6d160bf774f6030bb753374018cec441b741685a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5624 zcmcIoPfr_16t97#FhD{l0UV+>n_1aV4%S`|hxunywZtAYC z8TuFC-@H`Q3`#(}eQ&K{a#JNHux3`s#H1v2vb~pV3*s>^`PSuGh#)+rWz!{&sTrj# zp%q8BUCYVC)^vJ{xItjqmx)R5Sf);|NfW}xbh^#RdC7GeBzn3eImB%^<{Y=1DL4pz zl@5uWYU?G{G%Xed%cSXa=u@cTD8U6oC#Kt(%%V<=YKClUJG$j`Cb~{M5XClfS*rsE zO7JIdL9+MapXW(-Di$OgLY=GIZU-j@qC7&Y8hw1YwH#kpZt5PI)M_;V&mxrGM38Ql z{LAR?adh=KHHXKAl)@`j@hepcD^=N<85{LfYqkz0&Cnn!cI-lAp~g~P-t=}60MOYR*L7#krMPXSTVl8&aKP1rT zfq-3zXK-j*>K?;f{Fhiv@HN& z$T%hd@Kw~`;D(kNq&+N+`B?H%uLJ}mVDk`-W{E-mC->w(dJqbMga@Kv#KUN?<^XL} zjlD9*C@&0r2K86HOA>A+fdIUM`ZyPr=@WyarGNHg-?!J1l*0Ri!V?1+)+Uat6MFj{ ztfFphmnM68xMySOQFm#RiXv1sYdy-)nLzvEB!{`Oxme1CQ9`gu>jpX{wEC==9N}tj z#8>NIluddW2Qg-YfRpX?Pd_@#upHVCdn<=t*Q>3SQQ&ih8xbKQ`;IXgMum$ zAT&wIcVV%YOQ-2ys@)l#;9It1eGUyDP3?QX4pIS)ruO}x2a#3~wuZ%gkQo4u2=XaE z>q59a%?wAn3EdO)XpD6QD-5At);(@&ln5Ti>!`=wvkAx9so8A&KsSL($$DCgpbO`L z*28Eqa_bbXa1VLGW?}AONutEr(ZLt3Qn4DQ%Y0&4?BjWm7tuhI3GbtGS+%HU)IzRY zyr0jN@7*cna|_Fh%em~(J5Y(e`L#lEX+2jMO5i?pV)cIE?#fV?d@YP+Xak0@HQ@a4 zCShM}XsvfG$Ggzv1vGLvuG!uo=pqfk+Mo|e+tCbz7&@)*J5Q0^er$AstDXV$O8u~qkf1a0mWRQxO-!B0q6ozp(-eL$_V&5gu0Dv7{(c%S-W&a=`ICwZJ(M8{w;g&r@RDQ%G zo0D(xn)bV*c#vnamB5H}V(NuDdHwM9%`K&fy5@Y)IITzIp5-!;C($C%=oqQDsQE*ptP zUiZqz%rk#i$(wevaVOsgAA;#Y35H#pC%GjbUJm9!(_%;%nJFGQPvkqr-0uJ#AoMTR CVTVxw 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/CloudResourceProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php deleted file mode 100644 index b28e1d8b3742..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php +++ /dev/null @@ -1,96 +0,0 @@ -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 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 58f5901b75b5..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties.php +++ /dev/null @@ -1,225 +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; - /** - * Output only. The account ID of the service used for the purpose of this connection. - * When the connection is used in the context of an operation in - * BigQuery, this service account will serve as identity being used for - * connecting to the CloudSQL instance specified in this connection. - * - * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $service_account_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $instance_id - * Cloud SQL instance ID in the form `project:location:instance`. - * @type string $database - * Database name. - * @type int $type - * Type of the Cloud SQL database. - * @type \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $credential - * Input only. Cloud SQL credential. - * @type string $service_account_id - * Output only. The account ID of the service used for the purpose of this connection. - * When the connection is used in the context of an operation in - * BigQuery, this service account will serve as identity being used for - * connecting to the CloudSQL instance specified in this connection. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); - parent::__construct($data); - } - - /** - * Cloud SQL instance ID in the form `project:location:instance`. - * - * Generated from protobuf field string instance_id = 1; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Cloud SQL instance ID in the form `project:location:instance`. - * - * Generated from protobuf field string instance_id = 1; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - - /** - * Database name. - * - * Generated from protobuf field string database = 2; - * @return string - */ - public function getDatabase() - { - return $this->database; - } - - /** - * Database name. - * - * Generated from protobuf field string database = 2; - * @param string $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkString($var, True); - $this->database = $var; - - return $this; - } - - /** - * Type of the Cloud SQL database. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Type of the Cloud SQL database. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties\DatabaseType::class); - $this->type = $var; - - return $this; - } - - /** - * Input only. Cloud SQL credential. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential|null - */ - public function getCredential() - { - return $this->credential; - } - - public function hasCredential() - { - return isset($this->credential); - } - - public function clearCredential() - { - unset($this->credential); - } - - /** - * Input only. Cloud SQL credential. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $var - * @return $this - */ - public function setCredential($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential::class); - $this->credential = $var; - - return $this; - } - - /** - * Output only. The account ID of the service used for the purpose of this connection. - * When the connection is used in the context of an operation in - * BigQuery, this service account will serve as identity being used for - * connecting to the CloudSQL instance specified in this connection. - * - * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getServiceAccountId() - { - return $this->service_account_id; - } - - /** - * Output only. The account ID of the service used for the purpose of this connection. - * When the connection is used in the context of an operation in - * BigQuery, this service account will serve as identity being used for - * connecting to the CloudSQL instance specified in this connection. - * - * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setServiceAccountId($var) - { - GPBUtil::checkString($var, True); - $this->service_account_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php 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 9e906d2b1dcc..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 array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $connections - * List of connections. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); - parent::__construct($data); - } - - /** - * Next page token. - * - * Generated from protobuf field string next_page_token = 1; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Next page token. - * - * Generated from protobuf field string next_page_token = 1; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * List of connections. - * - * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConnections() - { - return $this->connections; - } - - /** - * List of connections. - * - * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; - * @param array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConnections($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Connection\V1\Connection::class); - $this->connections = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/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`. - * @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 FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a - * {@see 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; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * 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 a89401d01dfa..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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $friendlyName = 'friendlyName1451097503'; - $description = 'description-1724546052'; - $creationTime = 1932333101; - $lastModifiedTime = 671513446; - $hasCredential = true; - $expectedResponse = new Connection(); - $expectedResponse->setName($name); - $expectedResponse->setFriendlyName($friendlyName); - $expectedResponse->setDescription($description); - $expectedResponse->setCreationTime($creationTime); - $expectedResponse->setLastModifiedTime($lastModifiedTime); - $expectedResponse->setHasCredential($hasCredential); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $connection = new Connection(); - $response = $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $connection = new Connection(); - try { - $gapicClient->createConnection($formattedParent, $connection); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $gapicClient->deleteConnection($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $friendlyName = 'friendlyName1451097503'; - $description = 'description-1724546052'; - $creationTime = 1932333101; - $lastModifiedTime = 671513446; - $hasCredential = true; - $expectedResponse = new Connection(); - $expectedResponse->setName($name2); - $expectedResponse->setFriendlyName($friendlyName); - $expectedResponse->setDescription($description); - $expectedResponse->setCreationTime($creationTime); - $expectedResponse->setLastModifiedTime($lastModifiedTime); - $expectedResponse->setHasCredential($hasCredential); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $gapicClient->getConnection($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listConnectionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $connectionsElement = new Connection(); - $connections = [ - $connectionsElement, - ]; - $expectedResponse = new ListConnectionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setConnections($connections); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageSize = 883849137; - $response = $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageSize = 883849137; - try { - $gapicClient->listConnections($formattedParent, $pageSize); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $friendlyName = 'friendlyName1451097503'; - $description = 'description-1724546052'; - $creationTime = 1932333101; - $lastModifiedTime = 671513446; - $hasCredential = true; - $expectedResponse = new Connection(); - $expectedResponse->setName($name2); - $expectedResponse->setFriendlyName($friendlyName); - $expectedResponse->setDescription($description); - $expectedResponse->setCreationTime($creationTime); - $expectedResponse->setLastModifiedTime($lastModifiedTime); - $expectedResponse->setHasCredential($hasCredential); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $connection = new Connection(); - $updateMask = new FieldMask(); - $response = $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $connection = new Connection(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateConnection($formattedName, $connection, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->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 6484a2adef0553fe189296c4195b9ae40c0b1e1e Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 27 Jul 2022 01:12:16 +0000 Subject: [PATCH 3/6] chore(bazel): update gapic-generator-php to v1.5.0 PiperOrigin-RevId: 463455928 Source-Link: https://github.com/googleapis/googleapis/commit/c5495962f71aece20a0960524a8307d7d7077c78 Source-Link: https://github.com/googleapis/googleapis-gen/commit/434d232411bbd8f0e41d7188c21783c1b6ef68f4 Copy-Tag: eyJwIjoiQmlnUXVlcnlDb25uZWN0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiI0MzRkMjMyNDExYmJkOGYwZTQxZDcxODhjMjE3ODNjMWI2ZWY2OGY0In0= --- .../Bigquery/Connection/V1/Connection.php | Bin 0 -> 5624 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 | 225 ++++++ .../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 | 699 ++++++++++++++++++ .../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, 3863 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..6d160bf774f6030bb753374018cec441b741685a GIT binary patch literal 5624 zcmcIoPfr_16t97#FhD{l0UV+>n_1aV4%S`|hxunywZtAYC z8TuFC-@H`Q3`#(}eQ&K{a#JNHux3`s#H1v2vb~pV3*s>^`PSuGh#)+rWz!{&sTrj# zp%q8BUCYVC)^vJ{xItjqmx)R5Sf);|NfW}xbh^#RdC7GeBzn3eImB%^<{Y=1DL4pz zl@5uWYU?G{G%Xed%cSXa=u@cTD8U6oC#Kt(%%V<=YKClUJG$j`Cb~{M5XClfS*rsE zO7JIdL9+MapXW(-Di$OgLY=GIZU-j@qC7&Y8hw1YwH#kpZt5PI)M_;V&mxrGM38Ql z{LAR?adh=KHHXKAl)@`j@hepcD^=N<85{LfYqkz0&Cnn!cI-lAp~g~P-t=}60MOYR*L7#krMPXSTVl8&aKP1rT zfq-3zXK-j*>K?;f{Fhiv@HN& z$T%hd@Kw~`;D(kNq&+N+`B?H%uLJ}mVDk`-W{E-mC->w(dJqbMga@Kv#KUN?<^XL} zjlD9*C@&0r2K86HOA>A+fdIUM`ZyPr=@WyarGNHg-?!J1l*0Ri!V?1+)+Uat6MFj{ ztfFphmnM68xMySOQFm#RiXv1sYdy-)nLzvEB!{`Oxme1CQ9`gu>jpX{wEC==9N}tj z#8>NIluddW2Qg-YfRpX?Pd_@#upHVCdn<=t*Q>3SQQ&ih8xbKQ`;IXgMum$ zAT&wIcVV%YOQ-2ys@)l#;9It1eGUyDP3?QX4pIS)ruO}x2a#3~wuZ%gkQo4u2=XaE z>q59a%?wAn3EdO)XpD6QD-5At);(@&ln5Ti>!`=wvkAx9so8A&KsSL($$DCgpbO`L z*28Eqa_bbXa1VLGW?}AONutEr(ZLt3Qn4DQ%Y0&4?BjWm7tuhI3GbtGS+%HU)IzRY zyr0jN@7*cna|_Fh%em~(J5Y(e`L#lEX+2jMO5i?pV)cIE?#fV?d@YP+Xak0@HQ@a4 zCShM}XsvfG$Ggzv1vGLvuG!uo=pqfk+Mo|e+tCbz7&@)*J5Q0^er$AstDXV$O8u~qkf1a0mWRQxO-!B0q6ozp(-eL$_V&5gu0Dv7{(c%S-W&a=`ICwZJ(M8{w;g&r@RDQ%G zo0D(xn)bV*c#vnamB5H}V(NuDdHwM9%`K&fy5@Y)IITzIp5-!;C($C%=oqQDsQE*ptP zUiZqz%rk#i$(wevaVOsgAA;#Y35H#pC%GjbUJm9!(_%;%nJFGQPvkqr-0uJ#AoMTR CVTVxw 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..58f5901b75b5 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties.php @@ -0,0 +1,225 @@ +google.cloud.bigquery.connection.v1.CloudSqlProperties + */ +class CloudSqlProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud SQL instance ID in the form `project:location:instance`. + * + * Generated from protobuf field string instance_id = 1; + */ + protected $instance_id = ''; + /** + * Database name. + * + * Generated from protobuf field string database = 2; + */ + protected $database = ''; + /** + * Type of the Cloud SQL database. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + */ + protected $type = 0; + /** + * Input only. Cloud SQL credential. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $credential = null; + /** + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $service_account_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_id + * Cloud SQL instance ID in the form `project:location:instance`. + * @type string $database + * Database name. + * @type int $type + * Type of the Cloud SQL database. + * @type \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $credential + * Input only. Cloud SQL credential. + * @type string $service_account_id + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Cloud SQL instance ID in the form `project:location:instance`. + * + * Generated from protobuf field string instance_id = 1; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Cloud SQL instance ID in the form `project:location:instance`. + * + * Generated from protobuf field string instance_id = 1; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Database name. + * + * Generated from protobuf field string database = 2; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Database name. + * + * Generated from protobuf field string database = 2; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * Type of the Cloud SQL database. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Type of the Cloud SQL database. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties\DatabaseType::class); + $this->type = $var; + + return $this; + } + + /** + * Input only. Cloud SQL credential. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential|null + */ + public function getCredential() + { + return $this->credential; + } + + public function hasCredential() + { + return isset($this->credential); + } + + public function clearCredential() + { + unset($this->credential); + } + + /** + * Input only. Cloud SQL credential. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $var + * @return $this + */ + public function setCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential::class); + $this->credential = $var; + + return $this; + } + + /** + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServiceAccountId() + { + return $this->service_account_id; + } + + /** + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServiceAccountId($var) + { + GPBUtil::checkString($var, True); + $this->service_account_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php new file mode 100644 index 000000000000..8c0ea09de1f7 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php @@ -0,0 +1,64 @@ +google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType + */ +class DatabaseType +{ + /** + * Unspecified database type. + * + * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; + */ + const DATABASE_TYPE_UNSPECIFIED = 0; + /** + * Cloud SQL for PostgreSQL. + * + * Generated from protobuf enum POSTGRES = 1; + */ + const POSTGRES = 1; + /** + * Cloud SQL for MySQL. + * + * Generated from protobuf enum MYSQL = 2; + */ + const MYSQL = 2; + + private static $valueToName = [ + self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', + self::POSTGRES => 'POSTGRES', + self::MYSQL => 'MYSQL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DatabaseType::class, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties_DatabaseType::class); + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/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..9e906d2b1dcc --- /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 array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $connections + * List of connections. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 1; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 1; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * List of connections. + * + * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConnections() + { + return $this->connections; + } + + /** + * List of connections. + * + * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + * @param array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Connection\V1\Connection::class); + $this->connections = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + 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 FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..a89401d01dfa --- /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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $friendlyName = 'friendlyName1451097503'; + $description = 'description-1724546052'; + $creationTime = 1932333101; + $lastModifiedTime = 671513446; + $hasCredential = true; + $expectedResponse = new Connection(); + $expectedResponse->setName($name); + $expectedResponse->setFriendlyName($friendlyName); + $expectedResponse->setDescription($description); + $expectedResponse->setCreationTime($creationTime); + $expectedResponse->setLastModifiedTime($lastModifiedTime); + $expectedResponse->setHasCredential($hasCredential); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + $response = $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + try { + $gapicClient->createConnection($formattedParent, $connection); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + try { + $gapicClient->deleteConnection($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $friendlyName = 'friendlyName1451097503'; + $description = 'description-1724546052'; + $creationTime = 1932333101; + $lastModifiedTime = 671513446; + $hasCredential = true; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $expectedResponse->setFriendlyName($friendlyName); + $expectedResponse->setDescription($description); + $expectedResponse->setCreationTime($creationTime); + $expectedResponse->setLastModifiedTime($lastModifiedTime); + $expectedResponse->setHasCredential($hasCredential); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $response = $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + try { + $gapicClient->getConnection($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listConnectionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $connectionsElement = new Connection(); + $connections = [ + $connectionsElement, + ]; + $expectedResponse = new ListConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConnections($connections); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $pageSize = 883849137; + $response = $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $pageSize = 883849137; + try { + $gapicClient->listConnections($formattedParent, $pageSize); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $friendlyName = 'friendlyName1451097503'; + $description = 'description-1724546052'; + $creationTime = 1932333101; + $lastModifiedTime = 671513446; + $hasCredential = true; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $expectedResponse->setFriendlyName($friendlyName); + $expectedResponse->setDescription($description); + $expectedResponse->setCreationTime($creationTime); + $expectedResponse->setLastModifiedTime($lastModifiedTime); + $expectedResponse->setHasCredential($hasCredential); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $updateMask = new FieldMask(); + $response = $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateConnection($formattedName, $connection, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->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 7a18c5ee8eaa945ec28fa9f8d62c0b8634da6759 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 27 Jul 2022 01:14:49 +0000 Subject: [PATCH 4/6] =?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 --- .../V1/Gapic/ConnectionServiceGapicClient.php | 56 +- .../Bigquery/Connection/V1/Connection.php | Bin 5624 -> 0 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 | 225 ------ .../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 | 699 ------------------ .../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 ---------------- 26 files changed, 24 insertions(+), 3895 deletions(-) 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/CloudResourceProperties.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/src/V1/Gapic/ConnectionServiceGapicClient.php b/BigQueryConnection/src/V1/Gapic/ConnectionServiceGapicClient.php index 5c4581a8c3a0..190bcee7cf25 100644 --- a/BigQueryConnection/src/V1/Gapic/ConnectionServiceGapicClient.php +++ b/BigQueryConnection/src/V1/Gapic/ConnectionServiceGapicClient.php @@ -339,10 +339,9 @@ public function __construct(array $options = []) * @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. + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. * } * * @return \Google\Cloud\BigQuery\Connection\V1\Connection @@ -397,10 +396,9 @@ public function createConnection( * 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. + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. * } * * @throws ApiException if the remote call fails @@ -445,10 +443,9 @@ public function deleteConnection($name, 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. + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. * } * * @return \Google\Cloud\BigQuery\Connection\V1\Connection @@ -500,10 +497,9 @@ public function getConnection($name, array $optionalArgs = []) * OPTIONAL: A `GetPolicyOptions` object for specifying options to * `GetIamPolicy`. * @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. + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. * } * * @return \Google\Cloud\Iam\V1\Policy @@ -575,10 +571,9 @@ public function getIamPolicy($resource, array $optionalArgs = []) * 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. + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. * } * * @return \Google\ApiCore\PagedListResponse @@ -647,10 +642,9 @@ public function listConnections( * * `paths: "bindings, etag"` * @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. + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. * } * * @return \Google\Cloud\Iam\V1\Policy @@ -713,10 +707,9 @@ public function setIamPolicy($resource, $policy, 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. + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. * } * * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse @@ -772,10 +765,9 @@ public function testIamPermissions( * 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. + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. * } * * @return \Google\Cloud\BigQuery\Connection\V1\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 6d160bf774f6030bb753374018cec441b741685a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5624 zcmcIoPfr_16t97#FhD{l0UV+>n_1aV4%S`|hxunywZtAYC z8TuFC-@H`Q3`#(}eQ&K{a#JNHux3`s#H1v2vb~pV3*s>^`PSuGh#)+rWz!{&sTrj# zp%q8BUCYVC)^vJ{xItjqmx)R5Sf);|NfW}xbh^#RdC7GeBzn3eImB%^<{Y=1DL4pz zl@5uWYU?G{G%Xed%cSXa=u@cTD8U6oC#Kt(%%V<=YKClUJG$j`Cb~{M5XClfS*rsE zO7JIdL9+MapXW(-Di$OgLY=GIZU-j@qC7&Y8hw1YwH#kpZt5PI)M_;V&mxrGM38Ql z{LAR?adh=KHHXKAl)@`j@hepcD^=N<85{LfYqkz0&Cnn!cI-lAp~g~P-t=}60MOYR*L7#krMPXSTVl8&aKP1rT zfq-3zXK-j*>K?;f{Fhiv@HN& z$T%hd@Kw~`;D(kNq&+N+`B?H%uLJ}mVDk`-W{E-mC->w(dJqbMga@Kv#KUN?<^XL} zjlD9*C@&0r2K86HOA>A+fdIUM`ZyPr=@WyarGNHg-?!J1l*0Ri!V?1+)+Uat6MFj{ ztfFphmnM68xMySOQFm#RiXv1sYdy-)nLzvEB!{`Oxme1CQ9`gu>jpX{wEC==9N}tj z#8>NIluddW2Qg-YfRpX?Pd_@#upHVCdn<=t*Q>3SQQ&ih8xbKQ`;IXgMum$ zAT&wIcVV%YOQ-2ys@)l#;9It1eGUyDP3?QX4pIS)ruO}x2a#3~wuZ%gkQo4u2=XaE z>q59a%?wAn3EdO)XpD6QD-5At);(@&ln5Ti>!`=wvkAx9so8A&KsSL($$DCgpbO`L z*28Eqa_bbXa1VLGW?}AONutEr(ZLt3Qn4DQ%Y0&4?BjWm7tuhI3GbtGS+%HU)IzRY zyr0jN@7*cna|_Fh%em~(J5Y(e`L#lEX+2jMO5i?pV)cIE?#fV?d@YP+Xak0@HQ@a4 zCShM}XsvfG$Ggzv1vGLvuG!uo=pqfk+Mo|e+tCbz7&@)*J5Q0^er$AstDXV$O8u~qkf1a0mWRQxO-!B0q6ozp(-eL$_V&5gu0Dv7{(c%S-W&a=`ICwZJ(M8{w;g&r@RDQ%G zo0D(xn)bV*c#vnamB5H}V(NuDdHwM9%`K&fy5@Y)IITzIp5-!;C($C%=oqQDsQE*ptP zUiZqz%rk#i$(wevaVOsgAA;#Y35H#pC%GjbUJm9!(_%;%nJFGQPvkqr-0uJ#AoMTR CVTVxw 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/CloudResourceProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php deleted file mode 100644 index b28e1d8b3742..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php +++ /dev/null @@ -1,96 +0,0 @@ -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 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 58f5901b75b5..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties.php +++ /dev/null @@ -1,225 +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; - /** - * Output only. The account ID of the service used for the purpose of this connection. - * When the connection is used in the context of an operation in - * BigQuery, this service account will serve as identity being used for - * connecting to the CloudSQL instance specified in this connection. - * - * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $service_account_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $instance_id - * Cloud SQL instance ID in the form `project:location:instance`. - * @type string $database - * Database name. - * @type int $type - * Type of the Cloud SQL database. - * @type \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $credential - * Input only. Cloud SQL credential. - * @type string $service_account_id - * Output only. The account ID of the service used for the purpose of this connection. - * When the connection is used in the context of an operation in - * BigQuery, this service account will serve as identity being used for - * connecting to the CloudSQL instance specified in this connection. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); - parent::__construct($data); - } - - /** - * Cloud SQL instance ID in the form `project:location:instance`. - * - * Generated from protobuf field string instance_id = 1; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Cloud SQL instance ID in the form `project:location:instance`. - * - * Generated from protobuf field string instance_id = 1; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - - /** - * Database name. - * - * Generated from protobuf field string database = 2; - * @return string - */ - public function getDatabase() - { - return $this->database; - } - - /** - * Database name. - * - * Generated from protobuf field string database = 2; - * @param string $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkString($var, True); - $this->database = $var; - - return $this; - } - - /** - * Type of the Cloud SQL database. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Type of the Cloud SQL database. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties\DatabaseType::class); - $this->type = $var; - - return $this; - } - - /** - * Input only. Cloud SQL credential. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential|null - */ - public function getCredential() - { - return $this->credential; - } - - public function hasCredential() - { - return isset($this->credential); - } - - public function clearCredential() - { - unset($this->credential); - } - - /** - * Input only. Cloud SQL credential. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $var - * @return $this - */ - public function setCredential($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential::class); - $this->credential = $var; - - return $this; - } - - /** - * Output only. The account ID of the service used for the purpose of this connection. - * When the connection is used in the context of an operation in - * BigQuery, this service account will serve as identity being used for - * connecting to the CloudSQL instance specified in this connection. - * - * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getServiceAccountId() - { - return $this->service_account_id; - } - - /** - * Output only. The account ID of the service used for the purpose of this connection. - * When the connection is used in the context of an operation in - * BigQuery, this service account will serve as identity being used for - * connecting to the CloudSQL instance specified in this connection. - * - * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setServiceAccountId($var) - { - GPBUtil::checkString($var, True); - $this->service_account_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php 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 9e906d2b1dcc..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 array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $connections - * List of connections. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); - parent::__construct($data); - } - - /** - * Next page token. - * - * Generated from protobuf field string next_page_token = 1; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Next page token. - * - * Generated from protobuf field string next_page_token = 1; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * List of connections. - * - * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConnections() - { - return $this->connections; - } - - /** - * List of connections. - * - * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; - * @param array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConnections($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Connection\V1\Connection::class); - $this->connections = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - 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 FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 a89401d01dfa..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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $friendlyName = 'friendlyName1451097503'; - $description = 'description-1724546052'; - $creationTime = 1932333101; - $lastModifiedTime = 671513446; - $hasCredential = true; - $expectedResponse = new Connection(); - $expectedResponse->setName($name); - $expectedResponse->setFriendlyName($friendlyName); - $expectedResponse->setDescription($description); - $expectedResponse->setCreationTime($creationTime); - $expectedResponse->setLastModifiedTime($lastModifiedTime); - $expectedResponse->setHasCredential($hasCredential); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $connection = new Connection(); - $response = $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $connection = new Connection(); - try { - $gapicClient->createConnection($formattedParent, $connection); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $gapicClient->deleteConnection($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $friendlyName = 'friendlyName1451097503'; - $description = 'description-1724546052'; - $creationTime = 1932333101; - $lastModifiedTime = 671513446; - $hasCredential = true; - $expectedResponse = new Connection(); - $expectedResponse->setName($name2); - $expectedResponse->setFriendlyName($friendlyName); - $expectedResponse->setDescription($description); - $expectedResponse->setCreationTime($creationTime); - $expectedResponse->setLastModifiedTime($lastModifiedTime); - $expectedResponse->setHasCredential($hasCredential); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $gapicClient->getConnection($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listConnectionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $connectionsElement = new Connection(); - $connections = [ - $connectionsElement, - ]; - $expectedResponse = new ListConnectionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setConnections($connections); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageSize = 883849137; - $response = $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageSize = 883849137; - try { - $gapicClient->listConnections($formattedParent, $pageSize); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $friendlyName = 'friendlyName1451097503'; - $description = 'description-1724546052'; - $creationTime = 1932333101; - $lastModifiedTime = 671513446; - $hasCredential = true; - $expectedResponse = new Connection(); - $expectedResponse->setName($name2); - $expectedResponse->setFriendlyName($friendlyName); - $expectedResponse->setDescription($description); - $expectedResponse->setCreationTime($creationTime); - $expectedResponse->setLastModifiedTime($lastModifiedTime); - $expectedResponse->setHasCredential($hasCredential); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $connection = new Connection(); - $updateMask = new FieldMask(); - $response = $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $connection = new Connection(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateConnection($formattedName, $connection, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->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 ffe5b207a9b51d3f45117357c0cc555ffeaf57bf Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 1 Aug 2022 19:54:27 +0000 Subject: [PATCH 5/6] chore: deprecate the AwsCrossAccountRole property feat: add Azure Properties to Connection Azure properties are used by BigQuery Omni in Azure regions. PiperOrigin-RevId: 464570667 Source-Link: https://github.com/googleapis/googleapis/commit/75905af5ab6cd89c354dcfb9d9ca0bfdd4d581b4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/8c3a2485bb35012ecb7a2ced0f94a11d2de253b2 Copy-Tag: eyJwIjoiQmlnUXVlcnlDb25uZWN0aW9uLy5Pd2xCb3QueWFtbCIsImgiOiI4YzNhMjQ4NWJiMzUwMTJlY2I3YTJjZWQwZjk0YTExZDJkZTI1M2IyIn0= --- .../Bigquery/Connection/V1/Connection.php | Bin 0 -> 5908 bytes .../BigQuery/Connection/V1/AwsAccessRole.php | 110 +++ .../Connection/V1/AwsCrossAccountRole.php | 148 ++++ .../BigQuery/Connection/V1/AwsProperties.php | 122 +++ .../Connection/V1/AzureProperties.php | 287 +++++++ .../Connection/V1/CloudResourceProperties.php | 96 +++ .../Connection/V1/CloudSpannerProperties.php | 101 +++ .../Connection/V1/CloudSqlCredential.php | 101 +++ .../Connection/V1/CloudSqlProperties.php | 225 ++++++ .../V1/CloudSqlProperties/DatabaseType.php | 64 ++ .../V1/CloudSqlProperties_DatabaseType.php | 16 + .../BigQuery/Connection/V1/Connection.php | 416 +++++++++++ .../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 | 699 ++++++++++++++++++ .../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 ++++++++++++++++ 26 files changed, 4191 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/AzureProperties.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..a6cc4b9bbb54e4c8a9c6e504d35a23643245378f GIT binary patch literal 5908 zcmcIo&2tn*6lW8HNhd&TAX!2w!$3($h1p7^6c(b)W;Y=v$dW`XsD-J?Zf`O&J2Oo8 z5&{*i^6brjLj4o;?t${7N^hyM%7X{XKf#l)yXSK^f!U~BvP}1T{XTy0*RS8T_q`1d zomCczLwu8whO)M$unnSkzRTRYYb$H*W|R0z-EDc6O?*vJ%D0sdZ?7tq^3v)V5T$P0 zualy(?z-zXDb#JZ-6*VC>yO*S-zwBy$02oQxlZB9OyYlz^ftHN%sU_1I% z+a-3oXVrAaad{M6hZc*mPqB)<1m|swIIK6B1&i2?64@}HSgzlj=rRdFl-bB7vjrHa z!Jn!N$==F-ULe`4Sd?rCb*1I89!`uzMTBmd^wI9t3VdCB&kE3_HyROm7NGPdqjdA+ zpGRN3g)Z%<=I~i5rHM+_!b;WRO4XjsOpFJrP0xao=4g-=J8?R((BvsM)`FY|8%`!R z_(5WWr8k2m%WQErfIo&O(if~xq}Nkxr-C)X8&Gux!m|(vhU611O3PXhYq>-HHiyRN zeF790^Tjd&j-m`-L5Dok2N&}>B{w-#y70T+_qTo)ow41ztR77s4#A)hr&i%+uz)Af z;W%!F)yVe=4gJ6CIeY^cDq^gBKP(K-76MH#4ZaqeSOQIb>V0&4k+Aq{Xm|-7MN^zCINrHTGv<*^M6>k*$>gx)xS zb<}Te()^$Z_iQFT`X)`OsGtG!S=%T1VWH$wHYHplrDhe#fp;(lG&s-&`S}w<-PKI$ zq;FC%rS&d4BDIF(njaHtuVq&o-nS{eoXR*sLS77J0jmsv+J26teta5X=(U*9avK&< zYeQ~06mK|%j%=9J00j-;QRubuufgJ=kS@}{bgws7!q+|D{RH|(T6iA(+Ac(FTzDS- z+)i|qur=m{?a~NPO#}<|MIXZ5XyI_Q9B9Iz)#KzX$z>D`@+Nf6q(ss=UPcGmmPZ6! zkIa^{2RemKtsH1w1zorbw?iB)&XK*M9*gVV!d6FpcpIG3FS+BcohjE{H7KcP0 z)CDw>GT{w$vaGM_C4Hr0tlq0ujE_ECsaEEf7M3dI(F0J>gVozBtBcE(mC+m?LIbz% zt=zde+NWNQV;S3kA#80pKfaLo7Y{o0P1g_ZMRgvH?T%}{HwwB;1CT%H1Mc@t+a|U} zTOu2S>d!fJI90LuKEie1r8M%}cWs%w;n~ZXvIY9)xdvSZZW-iDefb>F$r2idXcAB^ zl*(&7Gp&F=5asG_94L*W6J{G8S5P3buP|DKZMY5fAv(5;0Ro-SBJp!$bmjrF@R5f) z)o=7;Sb@t@yhQj4w=_unJ0f7QExT)m6j%aKY)j%^{V|7*>SDqCppXP;bQ7anA+aaMURYs0xWm*nK;``+#wZu zkS)nw!m_nhuczF}p0gc2c&p$)0C}C=YewXCiiIxqj672!Z?@N@q>*=uXEOn|=|r!K zzXCTqyV#6wc8Y~=j)ky=8W9s5O}yyU0Af?UdJ{tI>l_*Zu)~BwP8YBm9t4aHk7_Ns z7#ee;V~-S7ABxCU)a#itg=1+Y3LO=7$hx#x2#~X}!v{)!?Zf*u{L{kXfOhl8`=~rzOkA{n$ZL+58 zw@TmVQ0+X-GQ!x1google.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..9d0a58c34f8b --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsProperties.php @@ -0,0 +1,122 @@ +google.cloud.bigquery.connection.v1.AwsProperties + */ +class AwsProperties extends \Google\Protobuf\Internal\Message +{ + protected $authentication_method; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole $cross_account_role + * Authentication using Google owned AWS IAM user's access key to assume + * into customer's AWS IAM Role. + * Deprecated, do not use. + * @type \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole $access_role + * Authentication using Google owned service account to assume into + * customer's AWS IAM Role. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Authentication using Google owned AWS IAM user's access key to assume + * into customer's AWS IAM Role. + * Deprecated, do not use. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2 [deprecated = true]; + * @return \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole|null + * @deprecated + */ + public function getCrossAccountRole() + { + @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED); + return $this->readOneof(2); + } + + public function hasCrossAccountRole() + { + @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED); + return $this->hasOneof(2); + } + + /** + * Authentication using Google owned AWS IAM user's access key to assume + * into customer's AWS IAM Role. + * Deprecated, do not use. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2 [deprecated = true]; + * @param \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole $var + * @return $this + * @deprecated + */ + public function setCrossAccountRole($var) + { + @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED); + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Authentication using Google owned service account to assume into + * customer's AWS IAM Role. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsAccessRole access_role = 3; + * @return \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole|null + */ + public function getAccessRole() + { + return $this->readOneof(3); + } + + public function hasAccessRole() + { + return $this->hasOneof(3); + } + + /** + * Authentication using Google owned service account to assume into + * customer's AWS IAM Role. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsAccessRole access_role = 3; + * @param \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole $var + * @return $this + */ + public function setAccessRole($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getAuthenticationMethod() + { + return $this->whichOneof("authentication_method"); + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AzureProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AzureProperties.php new file mode 100644 index 000000000000..42961def9fa1 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AzureProperties.php @@ -0,0 +1,287 @@ +google.cloud.bigquery.connection.v1.AzureProperties + */ +class AzureProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The name of the Azure Active Directory Application. + * + * Generated from protobuf field string application = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $application = ''; + /** + * Output only. The client id of the Azure Active Directory Application. + * + * Generated from protobuf field string client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $client_id = ''; + /** + * Output only. The object id of the Azure Active Directory Application. + * + * Generated from protobuf field string object_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $object_id = ''; + /** + * The id of customer's directory that host the data. + * + * Generated from protobuf field string customer_tenant_id = 4; + */ + protected $customer_tenant_id = ''; + /** + * The URL user will be redirected to after granting consent during connection + * setup. + * + * Generated from protobuf field string redirect_uri = 5; + */ + protected $redirect_uri = ''; + /** + * The client id of the user's Azure Active Directory Application used for a + * federated connection. + * + * Generated from protobuf field string federated_application_client_id = 6; + */ + protected $federated_application_client_id = ''; + /** + * Output only. A unique Google-owned and Google-generated identity for the Connection. + * This identity will be used to access the user's Azure Active Directory + * Application. + * + * Generated from protobuf field string identity = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $identity = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $application + * Output only. The name of the Azure Active Directory Application. + * @type string $client_id + * Output only. The client id of the Azure Active Directory Application. + * @type string $object_id + * Output only. The object id of the Azure Active Directory Application. + * @type string $customer_tenant_id + * The id of customer's directory that host the data. + * @type string $redirect_uri + * The URL user will be redirected to after granting consent during connection + * setup. + * @type string $federated_application_client_id + * The client id of the user's Azure Active Directory Application used for a + * federated connection. + * @type string $identity + * Output only. A unique Google-owned and Google-generated identity for the Connection. + * This identity will be used to access the user's Azure Active Directory + * Application. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The name of the Azure Active Directory Application. + * + * Generated from protobuf field string application = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getApplication() + { + return $this->application; + } + + /** + * Output only. The name of the Azure Active Directory Application. + * + * Generated from protobuf field string application = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setApplication($var) + { + GPBUtil::checkString($var, True); + $this->application = $var; + + return $this; + } + + /** + * Output only. The client id of the Azure Active Directory Application. + * + * Generated from protobuf field string client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getClientId() + { + return $this->client_id; + } + + /** + * Output only. The client id of the Azure Active Directory Application. + * + * Generated from protobuf field string client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setClientId($var) + { + GPBUtil::checkString($var, True); + $this->client_id = $var; + + return $this; + } + + /** + * Output only. The object id of the Azure Active Directory Application. + * + * Generated from protobuf field string object_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getObjectId() + { + return $this->object_id; + } + + /** + * Output only. The object id of the Azure Active Directory Application. + * + * Generated from protobuf field string object_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setObjectId($var) + { + GPBUtil::checkString($var, True); + $this->object_id = $var; + + return $this; + } + + /** + * The id of customer's directory that host the data. + * + * Generated from protobuf field string customer_tenant_id = 4; + * @return string + */ + public function getCustomerTenantId() + { + return $this->customer_tenant_id; + } + + /** + * The id of customer's directory that host the data. + * + * Generated from protobuf field string customer_tenant_id = 4; + * @param string $var + * @return $this + */ + public function setCustomerTenantId($var) + { + GPBUtil::checkString($var, True); + $this->customer_tenant_id = $var; + + return $this; + } + + /** + * The URL user will be redirected to after granting consent during connection + * setup. + * + * Generated from protobuf field string redirect_uri = 5; + * @return string + */ + public function getRedirectUri() + { + return $this->redirect_uri; + } + + /** + * The URL user will be redirected to after granting consent during connection + * setup. + * + * Generated from protobuf field string redirect_uri = 5; + * @param string $var + * @return $this + */ + public function setRedirectUri($var) + { + GPBUtil::checkString($var, True); + $this->redirect_uri = $var; + + return $this; + } + + /** + * The client id of the user's Azure Active Directory Application used for a + * federated connection. + * + * Generated from protobuf field string federated_application_client_id = 6; + * @return string + */ + public function getFederatedApplicationClientId() + { + return $this->federated_application_client_id; + } + + /** + * The client id of the user's Azure Active Directory Application used for a + * federated connection. + * + * Generated from protobuf field string federated_application_client_id = 6; + * @param string $var + * @return $this + */ + public function setFederatedApplicationClientId($var) + { + GPBUtil::checkString($var, True); + $this->federated_application_client_id = $var; + + return $this; + } + + /** + * Output only. A unique Google-owned and Google-generated identity for the Connection. + * This identity will be used to access the user's Azure Active Directory + * Application. + * + * Generated from protobuf field string identity = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getIdentity() + { + return $this->identity; + } + + /** + * Output only. A unique Google-owned and Google-generated identity for the Connection. + * This identity will be used to access the user's Azure Active Directory + * Application. + * + * Generated from protobuf field string identity = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setIdentity($var) + { + GPBUtil::checkString($var, True); + $this->identity = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php new file mode 100644 index 000000000000..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..58f5901b75b5 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties.php @@ -0,0 +1,225 @@ +google.cloud.bigquery.connection.v1.CloudSqlProperties + */ +class CloudSqlProperties extends \Google\Protobuf\Internal\Message +{ + /** + * Cloud SQL instance ID in the form `project:location:instance`. + * + * Generated from protobuf field string instance_id = 1; + */ + protected $instance_id = ''; + /** + * Database name. + * + * Generated from protobuf field string database = 2; + */ + protected $database = ''; + /** + * Type of the Cloud SQL database. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + */ + protected $type = 0; + /** + * Input only. Cloud SQL credential. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $credential = null; + /** + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $service_account_id = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $instance_id + * Cloud SQL instance ID in the form `project:location:instance`. + * @type string $database + * Database name. + * @type int $type + * Type of the Cloud SQL database. + * @type \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $credential + * Input only. Cloud SQL credential. + * @type string $service_account_id + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Cloud SQL instance ID in the form `project:location:instance`. + * + * Generated from protobuf field string instance_id = 1; + * @return string + */ + public function getInstanceId() + { + return $this->instance_id; + } + + /** + * Cloud SQL instance ID in the form `project:location:instance`. + * + * Generated from protobuf field string instance_id = 1; + * @param string $var + * @return $this + */ + public function setInstanceId($var) + { + GPBUtil::checkString($var, True); + $this->instance_id = $var; + + return $this; + } + + /** + * Database name. + * + * Generated from protobuf field string database = 2; + * @return string + */ + public function getDatabase() + { + return $this->database; + } + + /** + * Database name. + * + * Generated from protobuf field string database = 2; + * @param string $var + * @return $this + */ + public function setDatabase($var) + { + GPBUtil::checkString($var, True); + $this->database = $var; + + return $this; + } + + /** + * Type of the Cloud SQL database. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Type of the Cloud SQL database. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties\DatabaseType::class); + $this->type = $var; + + return $this; + } + + /** + * Input only. Cloud SQL credential. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential|null + */ + public function getCredential() + { + return $this->credential; + } + + public function hasCredential() + { + return isset($this->credential); + } + + public function clearCredential() + { + unset($this->credential); + } + + /** + * Input only. Cloud SQL credential. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $var + * @return $this + */ + public function setCredential($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential::class); + $this->credential = $var; + + return $this; + } + + /** + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getServiceAccountId() + { + return $this->service_account_id; + } + + /** + * Output only. The account ID of the service used for the purpose of this connection. + * When the connection is used in the context of an operation in + * BigQuery, this service account will serve as identity being used for + * connecting to the CloudSQL instance specified in this connection. + * + * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setServiceAccountId($var) + { + GPBUtil::checkString($var, True); + $this->service_account_id = $var; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php new file mode 100644 index 000000000000..8c0ea09de1f7 --- /dev/null +++ b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php @@ -0,0 +1,64 @@ +google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType + */ +class DatabaseType +{ + /** + * Unspecified database type. + * + * Generated from protobuf enum DATABASE_TYPE_UNSPECIFIED = 0; + */ + const DATABASE_TYPE_UNSPECIFIED = 0; + /** + * Cloud SQL for PostgreSQL. + * + * Generated from protobuf enum POSTGRES = 1; + */ + const POSTGRES = 1; + /** + * Cloud SQL for MySQL. + * + * Generated from protobuf enum MYSQL = 2; + */ + const MYSQL = 2; + + private static $valueToName = [ + self::DATABASE_TYPE_UNSPECIFIED => 'DATABASE_TYPE_UNSPECIFIED', + self::POSTGRES => 'POSTGRES', + self::MYSQL => 'MYSQL', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(DatabaseType::class, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties_DatabaseType::class); + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/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\AzureProperties $azure + * Azure properties. + * @type \Google\Cloud\BigQuery\Connection\V1\CloudSpannerProperties $cloud_spanner + * Cloud Spanner properties. + * @type \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties $cloud_resource + * Cloud Resource properties. + * @type int|string $creation_time + * Output only. The creation timestamp of the connection. + * @type int|string $last_modified_time + * Output only. The last update timestamp of the connection. + * @type bool $has_credential + * Output only. True, if credential is configured for this connection. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * The resource name of the connection in the form of: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The resource name of the connection in the form of: + * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * User provided display name for the connection. + * + * Generated from protobuf field string friendly_name = 2; + * @return string + */ + public function getFriendlyName() + { + return $this->friendly_name; + } + + /** + * User provided display name for the connection. + * + * Generated from protobuf field string friendly_name = 2; + * @param string $var + * @return $this + */ + public function setFriendlyName($var) + { + GPBUtil::checkString($var, True); + $this->friendly_name = $var; + + return $this; + } + + /** + * User provided description. + * + * Generated from protobuf field string description = 3; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * User provided description. + * + * Generated from protobuf field string description = 3; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Cloud SQL properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + * @return \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties|null + */ + public function getCloudSql() + { + return $this->readOneof(4); + } + + public function hasCloudSql() + { + return $this->hasOneof(4); + } + + /** + * Cloud SQL properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; + * @param \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties $var + * @return $this + */ + public function setCloudSql($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Amazon Web Services (AWS) properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsProperties aws = 8; + * @return \Google\Cloud\BigQuery\Connection\V1\AwsProperties|null + */ + public function getAws() + { + return $this->readOneof(8); + } + + public function hasAws() + { + return $this->hasOneof(8); + } + + /** + * Amazon Web Services (AWS) properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsProperties aws = 8; + * @param \Google\Cloud\BigQuery\Connection\V1\AwsProperties $var + * @return $this + */ + public function setAws($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AwsProperties::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Azure properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AzureProperties azure = 11; + * @return \Google\Cloud\BigQuery\Connection\V1\AzureProperties|null + */ + public function getAzure() + { + return $this->readOneof(11); + } + + public function hasAzure() + { + return $this->hasOneof(11); + } + + /** + * Azure properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AzureProperties azure = 11; + * @param \Google\Cloud\BigQuery\Connection\V1\AzureProperties $var + * @return $this + */ + public function setAzure($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AzureProperties::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Cloud Spanner properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSpannerProperties cloud_spanner = 21; + * @return \Google\Cloud\BigQuery\Connection\V1\CloudSpannerProperties|null + */ + public function getCloudSpanner() + { + return $this->readOneof(21); + } + + public function hasCloudSpanner() + { + return $this->hasOneof(21); + } + + /** + * Cloud Spanner properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSpannerProperties cloud_spanner = 21; + * @param \Google\Cloud\BigQuery\Connection\V1\CloudSpannerProperties $var + * @return $this + */ + public function setCloudSpanner($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudSpannerProperties::class); + $this->writeOneof(21, $var); + + return $this; + } + + /** + * Cloud Resource properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudResourceProperties cloud_resource = 22; + * @return \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties|null + */ + public function getCloudResource() + { + return $this->readOneof(22); + } + + public function hasCloudResource() + { + return $this->hasOneof(22); + } + + /** + * Cloud Resource properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudResourceProperties cloud_resource = 22; + * @param \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties $var + * @return $this + */ + public function setCloudResource($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties::class); + $this->writeOneof(22, $var); + + return $this; + } + + /** + * 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..9e906d2b1dcc --- /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 array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $connections + * List of connections. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); + parent::__construct($data); + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 1; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Next page token. + * + * Generated from protobuf field string next_page_token = 1; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * List of connections. + * + * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getConnections() + { + return $this->connections; + } + + /** + * List of connections. + * + * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; + * @param array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setConnections($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Connection\V1\Connection::class); + $this->connections = $arr; + + return $this; + } + +} + diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @throws ApiException if the remote call fails + */ + 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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`. + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\ApiCore\PagedListResponse + * + * @throws ApiException if the remote call fails + */ + 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 FieldMask $updateMask + * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + * the fields in the mask will be modified. If no mask is provided, the + * following default mask is used: + * + * `paths: "bindings, etag"` + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\Policy + * + * @throws ApiException if the remote call fails + */ + public function setIamPolicy($resource, $policy, array $optionalArgs = []) + { + $request = new SetIamPolicyRequest(); + $requestParamHeaders = []; + $request->setResource($resource); + $request->setPolicy($policy); + $requestParamHeaders['resource'] = $resource; + if (isset($optionalArgs['updateMask'])) { + $request->setUpdateMask($optionalArgs['updateMask']); + } + + $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); + $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); + return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); + } + + /** + * 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse + * + * @throws ApiException if the remote call fails + */ + 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 RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see 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..a89401d01dfa --- /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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name = 'name3373707'; + $friendlyName = 'friendlyName1451097503'; + $description = 'description-1724546052'; + $creationTime = 1932333101; + $lastModifiedTime = 671513446; + $hasCredential = true; + $expectedResponse = new Connection(); + $expectedResponse->setName($name); + $expectedResponse->setFriendlyName($friendlyName); + $expectedResponse->setDescription($description); + $expectedResponse->setCreationTime($creationTime); + $expectedResponse->setLastModifiedTime($lastModifiedTime); + $expectedResponse->setHasCredential($hasCredential); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + $response = $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $connection = new Connection(); + try { + $gapicClient->createConnection($formattedParent, $connection); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function deleteConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new GPBEmpty(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + try { + $gapicClient->deleteConnection($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $friendlyName = 'friendlyName1451097503'; + $description = 'description-1724546052'; + $creationTime = 1932333101; + $lastModifiedTime = 671513446; + $hasCredential = true; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $expectedResponse->setFriendlyName($friendlyName); + $expectedResponse->setDescription($description); + $expectedResponse->setCreationTime($creationTime); + $expectedResponse->setLastModifiedTime($lastModifiedTime); + $expectedResponse->setHasCredential($hasCredential); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $response = $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + try { + $gapicClient->getConnection($formattedName); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $response = $gapicClient->getIamPolicy($resource); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/GetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function getIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + try { + $gapicClient->getIamPolicy($resource); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function listConnectionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $connectionsElement = new Connection(); + $connections = [ + $connectionsElement, + ]; + $expectedResponse = new ListConnectionsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setConnections($connections); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $pageSize = 883849137; + $response = $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $pageSize = 883849137; + try { + $gapicClient->listConnections($formattedParent, $pageSize); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function setIamPolicyTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $version = 351608024; + $etag = '21'; + $expectedResponse = new Policy(); + $expectedResponse->setVersion($version); + $expectedResponse->setEtag($etag); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + $response = $gapicClient->setIamPolicy($resource, $policy); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/SetIamPolicy', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPolicy(); + $this->assertProtobufEquals($policy, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function setIamPolicyExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $policy = new Policy(); + try { + $gapicClient->setIamPolicy($resource, $policy); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function testIamPermissionsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new TestIamPermissionsResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + $response = $gapicClient->testIamPermissions($resource, $permissions); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/TestIamPermissions', $actualFuncCall); + $actualValue = $actualRequestObject->getResource(); + $this->assertProtobufEquals($resource, $actualValue); + $actualValue = $actualRequestObject->getPermissions(); + $this->assertProtobufEquals($permissions, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function testIamPermissionsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $resource = 'resource-341064690'; + $permissions = []; + try { + $gapicClient->testIamPermissions($resource, $permissions); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** + * @test + */ + public function updateConnectionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $friendlyName = 'friendlyName1451097503'; + $description = 'description-1724546052'; + $creationTime = 1932333101; + $lastModifiedTime = 671513446; + $hasCredential = true; + $expectedResponse = new Connection(); + $expectedResponse->setName($name2); + $expectedResponse->setFriendlyName($friendlyName); + $expectedResponse->setDescription($description); + $expectedResponse->setCreationTime($creationTime); + $expectedResponse->setLastModifiedTime($lastModifiedTime); + $expectedResponse->setHasCredential($hasCredential); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $updateMask = new FieldMask(); + $response = $gapicClient->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(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode([ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], JSON_PRETTY_PRINT); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); + $connection = new Connection(); + $updateMask = new FieldMask(); + try { + $gapicClient->updateConnection($formattedName, $connection, $updateMask); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->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 059a7b3bef9bdac86c059c9bb32ba26884b567e6 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 1 Aug 2022 19:55:55 +0000 Subject: [PATCH 6/6] =?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 5624 -> 5908 bytes BigQueryConnection/src/V1/AwsProperties.php | 12 +- .../src}/V1/AzureProperties.php | 14 +- BigQueryConnection/src/V1/Connection.php | 33 + .../Bigquery/Connection/V1/Connection.php | Bin 5908 -> 0 bytes .../BigQuery/Connection/V1/AwsAccessRole.php | 110 --- .../Connection/V1/AwsCrossAccountRole.php | 148 ---- .../BigQuery/Connection/V1/AwsProperties.php | 122 --- .../Connection/V1/CloudResourceProperties.php | 96 --- .../Connection/V1/CloudSpannerProperties.php | 101 --- .../Connection/V1/CloudSqlCredential.php | 101 --- .../Connection/V1/CloudSqlProperties.php | 225 ------ .../V1/CloudSqlProperties/DatabaseType.php | 64 -- .../V1/CloudSqlProperties_DatabaseType.php | 16 - .../BigQuery/Connection/V1/Connection.php | 416 ----------- .../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 | 699 ------------------ .../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 ---------------- 29 files changed, 50 insertions(+), 3913 deletions(-) rename {owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection => BigQueryConnection/src}/V1/AzureProperties.php (97%) 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/CloudResourceProperties.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 6d160bf774f6030bb753374018cec441b741685a..a6cc4b9bbb54e4c8a9c6e504d35a23643245378f 100644 GIT binary patch delta 301 zcmeyNJwsgpqvQD<+xFO)m#hO@ET9himt-z?kZDca}A%_|ZNMJK3 zX9~0Mc}6Z?$MWKUqWpr?qLR$iVxg$X4Ll(%PD~PvldtgnuRqJk#qS7GkEBF`i#xHP zASW|9u_QA;Pl6F>GN%*s14m{dF)q&JoXpg`lK9LN2__Wr{G_bZWUx3hLR^YVD7mz_ zBtJK`D83{$FA<`V1*AYogo~#rH83T!2&ApFC{uzJEF7cGC7+g>l3J8llA02a}JP3{;aJ4ga(64kZY>5Egd; diff --git a/BigQueryConnection/src/V1/AwsProperties.php b/BigQueryConnection/src/V1/AwsProperties.php index f7c797c0f5c8..9d0a58c34f8b 100644 --- a/BigQueryConnection/src/V1/AwsProperties.php +++ b/BigQueryConnection/src/V1/AwsProperties.php @@ -26,6 +26,7 @@ class AwsProperties extends \Google\Protobuf\Internal\Message * @type \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole $cross_account_role * Authentication using Google owned AWS IAM user's access key to assume * into customer's AWS IAM Role. + * Deprecated, do not use. * @type \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole $access_role * Authentication using Google owned service account to assume into * customer's AWS IAM Role. @@ -39,30 +40,37 @@ public function __construct($data = NULL) { /** * Authentication using Google owned AWS IAM user's access key to assume * into customer's AWS IAM Role. + * Deprecated, do not use. * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2; + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2 [deprecated = true]; * @return \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole|null + * @deprecated */ public function getCrossAccountRole() { + @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED); return $this->readOneof(2); } public function hasCrossAccountRole() { + @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED); return $this->hasOneof(2); } /** * Authentication using Google owned AWS IAM user's access key to assume * into customer's AWS IAM Role. + * Deprecated, do not use. * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2; + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2 [deprecated = true]; * @param \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole $var * @return $this + * @deprecated */ public function setCrossAccountRole($var) { + @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED); GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole::class); $this->writeOneof(2, $var); diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AzureProperties.php b/BigQueryConnection/src/V1/AzureProperties.php similarity index 97% rename from owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AzureProperties.php rename to BigQueryConnection/src/V1/AzureProperties.php index 42961def9fa1..25b4443f9998 100644 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AzureProperties.php +++ b/BigQueryConnection/src/V1/AzureProperties.php @@ -20,39 +20,39 @@ class AzureProperties extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string application = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - protected $application = ''; + private $application = ''; /** * Output only. The client id of the Azure Active Directory Application. * * Generated from protobuf field string client_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - protected $client_id = ''; + private $client_id = ''; /** * Output only. The object id of the Azure Active Directory Application. * * Generated from protobuf field string object_id = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - protected $object_id = ''; + private $object_id = ''; /** * The id of customer's directory that host the data. * * Generated from protobuf field string customer_tenant_id = 4; */ - protected $customer_tenant_id = ''; + private $customer_tenant_id = ''; /** * The URL user will be redirected to after granting consent during connection * setup. * * Generated from protobuf field string redirect_uri = 5; */ - protected $redirect_uri = ''; + private $redirect_uri = ''; /** * The client id of the user's Azure Active Directory Application used for a * federated connection. * * Generated from protobuf field string federated_application_client_id = 6; */ - protected $federated_application_client_id = ''; + private $federated_application_client_id = ''; /** * Output only. A unique Google-owned and Google-generated identity for the Connection. * This identity will be used to access the user's Azure Active Directory @@ -60,7 +60,7 @@ class AzureProperties extends \Google\Protobuf\Internal\Message * * Generated from protobuf field string identity = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ - protected $identity = ''; + private $identity = ''; /** * Constructor. diff --git a/BigQueryConnection/src/V1/Connection.php b/BigQueryConnection/src/V1/Connection.php index 5a21e2a21b4f..5e09b59500f1 100644 --- a/BigQueryConnection/src/V1/Connection.php +++ b/BigQueryConnection/src/V1/Connection.php @@ -72,6 +72,8 @@ class Connection extends \Google\Protobuf\Internal\Message * Cloud SQL properties. * @type \Google\Cloud\BigQuery\Connection\V1\AwsProperties $aws * Amazon Web Services (AWS) properties. + * @type \Google\Cloud\BigQuery\Connection\V1\AzureProperties $azure + * Azure properties. * @type \Google\Cloud\BigQuery\Connection\V1\CloudSpannerProperties $cloud_spanner * Cloud Spanner properties. * @type \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties $cloud_resource @@ -231,6 +233,37 @@ public function setAws($var) return $this; } + /** + * Azure properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AzureProperties azure = 11; + * @return \Google\Cloud\BigQuery\Connection\V1\AzureProperties|null + */ + public function getAzure() + { + return $this->readOneof(11); + } + + public function hasAzure() + { + return $this->hasOneof(11); + } + + /** + * Azure properties. + * + * Generated from protobuf field .google.cloud.bigquery.connection.v1.AzureProperties azure = 11; + * @param \Google\Cloud\BigQuery\Connection\V1\AzureProperties $var + * @return $this + */ + public function setAzure($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AzureProperties::class); + $this->writeOneof(11, $var); + + return $this; + } + /** * Cloud Spanner properties. * 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 a6cc4b9bbb54e4c8a9c6e504d35a23643245378f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5908 zcmcIo&2tn*6lW8HNhd&TAX!2w!$3($h1p7^6c(b)W;Y=v$dW`XsD-J?Zf`O&J2Oo8 z5&{*i^6brjLj4o;?t${7N^hyM%7X{XKf#l)yXSK^f!U~BvP}1T{XTy0*RS8T_q`1d zomCczLwu8whO)M$unnSkzRTRYYb$H*W|R0z-EDc6O?*vJ%D0sdZ?7tq^3v)V5T$P0 zualy(?z-zXDb#JZ-6*VC>yO*S-zwBy$02oQxlZB9OyYlz^ftHN%sU_1I% z+a-3oXVrAaad{M6hZc*mPqB)<1m|swIIK6B1&i2?64@}HSgzlj=rRdFl-bB7vjrHa z!Jn!N$==F-ULe`4Sd?rCb*1I89!`uzMTBmd^wI9t3VdCB&kE3_HyROm7NGPdqjdA+ zpGRN3g)Z%<=I~i5rHM+_!b;WRO4XjsOpFJrP0xao=4g-=J8?R((BvsM)`FY|8%`!R z_(5WWr8k2m%WQErfIo&O(if~xq}Nkxr-C)X8&Gux!m|(vhU611O3PXhYq>-HHiyRN zeF790^Tjd&j-m`-L5Dok2N&}>B{w-#y70T+_qTo)ow41ztR77s4#A)hr&i%+uz)Af z;W%!F)yVe=4gJ6CIeY^cDq^gBKP(K-76MH#4ZaqeSOQIb>V0&4k+Aq{Xm|-7MN^zCINrHTGv<*^M6>k*$>gx)xS zb<}Te()^$Z_iQFT`X)`OsGtG!S=%T1VWH$wHYHplrDhe#fp;(lG&s-&`S}w<-PKI$ zq;FC%rS&d4BDIF(njaHtuVq&o-nS{eoXR*sLS77J0jmsv+J26teta5X=(U*9avK&< zYeQ~06mK|%j%=9J00j-;QRubuufgJ=kS@}{bgws7!q+|D{RH|(T6iA(+Ac(FTzDS- z+)i|qur=m{?a~NPO#}<|MIXZ5XyI_Q9B9Iz)#KzX$z>D`@+Nf6q(ss=UPcGmmPZ6! zkIa^{2RemKtsH1w1zorbw?iB)&XK*M9*gVV!d6FpcpIG3FS+BcohjE{H7KcP0 z)CDw>GT{w$vaGM_C4Hr0tlq0ujE_ECsaEEf7M3dI(F0J>gVozBtBcE(mC+m?LIbz% zt=zde+NWNQV;S3kA#80pKfaLo7Y{o0P1g_ZMRgvH?T%}{HwwB;1CT%H1Mc@t+a|U} zTOu2S>d!fJI90LuKEie1r8M%}cWs%w;n~ZXvIY9)xdvSZZW-iDefb>F$r2idXcAB^ zl*(&7Gp&F=5asG_94L*W6J{G8S5P3buP|DKZMY5fAv(5;0Ro-SBJp!$bmjrF@R5f) z)o=7;Sb@t@yhQj4w=_unJ0f7QExT)m6j%aKY)j%^{V|7*>SDqCppXP;bQ7anA+aaMURYs0xWm*nK;``+#wZu zkS)nw!m_nhuczF}p0gc2c&p$)0C}C=YewXCiiIxqj672!Z?@N@q>*=uXEOn|=|r!K zzXCTqyV#6wc8Y~=j)ky=8W9s5O}yyU0Af?UdJ{tI>l_*Zu)~BwP8YBm9t4aHk7_Ns z7#ee;V~-S7ABxCU)a#itg=1+Y3LO=7$hx#x2#~X}!v{)!?Zf*u{L{kXfOhl8`=~rzOkA{n$ZL+58 zw@TmVQ0+X-GQ!x1google.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 9d0a58c34f8b..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/AwsProperties.php +++ /dev/null @@ -1,122 +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. - * Deprecated, do not use. - * @type \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole $access_role - * Authentication using Google owned service account to assume into - * customer's AWS IAM Role. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); - parent::__construct($data); - } - - /** - * Authentication using Google owned AWS IAM user's access key to assume - * into customer's AWS IAM Role. - * Deprecated, do not use. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2 [deprecated = true]; - * @return \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole|null - * @deprecated - */ - public function getCrossAccountRole() - { - @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED); - return $this->readOneof(2); - } - - public function hasCrossAccountRole() - { - @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED); - return $this->hasOneof(2); - } - - /** - * Authentication using Google owned AWS IAM user's access key to assume - * into customer's AWS IAM Role. - * Deprecated, do not use. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsCrossAccountRole cross_account_role = 2 [deprecated = true]; - * @param \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole $var - * @return $this - * @deprecated - */ - public function setCrossAccountRole($var) - { - @trigger_error('cross_account_role is deprecated.', E_USER_DEPRECATED); - GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AwsCrossAccountRole::class); - $this->writeOneof(2, $var); - - return $this; - } - - /** - * Authentication using Google owned service account to assume into - * customer's AWS IAM Role. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsAccessRole access_role = 3; - * @return \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole|null - */ - public function getAccessRole() - { - return $this->readOneof(3); - } - - public function hasAccessRole() - { - return $this->hasOneof(3); - } - - /** - * Authentication using Google owned service account to assume into - * customer's AWS IAM Role. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsAccessRole access_role = 3; - * @param \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole $var - * @return $this - */ - public function setAccessRole($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AwsAccessRole::class); - $this->writeOneof(3, $var); - - return $this; - } - - /** - * @return string - */ - public function getAuthenticationMethod() - { - return $this->whichOneof("authentication_method"); - } - -} - diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php deleted file mode 100644 index b28e1d8b3742..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudResourceProperties.php +++ /dev/null @@ -1,96 +0,0 @@ -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 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 58f5901b75b5..000000000000 --- a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties.php +++ /dev/null @@ -1,225 +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; - /** - * Output only. The account ID of the service used for the purpose of this connection. - * When the connection is used in the context of an operation in - * BigQuery, this service account will serve as identity being used for - * connecting to the CloudSQL instance specified in this connection. - * - * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - */ - protected $service_account_id = ''; - - /** - * Constructor. - * - * @param array $data { - * Optional. Data for populating the Message object. - * - * @type string $instance_id - * Cloud SQL instance ID in the form `project:location:instance`. - * @type string $database - * Database name. - * @type int $type - * Type of the Cloud SQL database. - * @type \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $credential - * Input only. Cloud SQL credential. - * @type string $service_account_id - * Output only. The account ID of the service used for the purpose of this connection. - * When the connection is used in the context of an operation in - * BigQuery, this service account will serve as identity being used for - * connecting to the CloudSQL instance specified in this connection. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); - parent::__construct($data); - } - - /** - * Cloud SQL instance ID in the form `project:location:instance`. - * - * Generated from protobuf field string instance_id = 1; - * @return string - */ - public function getInstanceId() - { - return $this->instance_id; - } - - /** - * Cloud SQL instance ID in the form `project:location:instance`. - * - * Generated from protobuf field string instance_id = 1; - * @param string $var - * @return $this - */ - public function setInstanceId($var) - { - GPBUtil::checkString($var, True); - $this->instance_id = $var; - - return $this; - } - - /** - * Database name. - * - * Generated from protobuf field string database = 2; - * @return string - */ - public function getDatabase() - { - return $this->database; - } - - /** - * Database name. - * - * Generated from protobuf field string database = 2; - * @param string $var - * @return $this - */ - public function setDatabase($var) - { - GPBUtil::checkString($var, True); - $this->database = $var; - - return $this; - } - - /** - * Type of the Cloud SQL database. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; - * @return int - */ - public function getType() - { - return $this->type; - } - - /** - * Type of the Cloud SQL database. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties.DatabaseType type = 3; - * @param int $var - * @return $this - */ - public function setType($var) - { - GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties\DatabaseType::class); - $this->type = $var; - - return $this; - } - - /** - * Input only. Cloud SQL credential. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * @return \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential|null - */ - public function getCredential() - { - return $this->credential; - } - - public function hasCredential() - { - return isset($this->credential); - } - - public function clearCredential() - { - unset($this->credential); - } - - /** - * Input only. Cloud SQL credential. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlCredential credential = 4 [(.google.api.field_behavior) = INPUT_ONLY]; - * @param \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential $var - * @return $this - */ - public function setCredential($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlCredential::class); - $this->credential = $var; - - return $this; - } - - /** - * Output only. The account ID of the service used for the purpose of this connection. - * When the connection is used in the context of an operation in - * BigQuery, this service account will serve as identity being used for - * connecting to the CloudSQL instance specified in this connection. - * - * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @return string - */ - public function getServiceAccountId() - { - return $this->service_account_id; - } - - /** - * Output only. The account ID of the service used for the purpose of this connection. - * When the connection is used in the context of an operation in - * BigQuery, this service account will serve as identity being used for - * connecting to the CloudSQL instance specified in this connection. - * - * Generated from protobuf field string service_account_id = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; - * @param string $var - * @return $this - */ - public function setServiceAccountId($var) - { - GPBUtil::checkString($var, True); - $this->service_account_id = $var; - - return $this; - } - -} - diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php b/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/CloudSqlProperties/DatabaseType.php 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\AzureProperties $azure - * Azure properties. - * @type \Google\Cloud\BigQuery\Connection\V1\CloudSpannerProperties $cloud_spanner - * Cloud Spanner properties. - * @type \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties $cloud_resource - * Cloud Resource properties. - * @type int|string $creation_time - * Output only. The creation timestamp of the connection. - * @type int|string $last_modified_time - * Output only. The last update timestamp of the connection. - * @type bool $has_credential - * Output only. True, if credential is configured for this connection. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); - parent::__construct($data); - } - - /** - * The resource name of the connection in the form of: - * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` - * - * Generated from protobuf field string name = 1; - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The resource name of the connection in the form of: - * `projects/{project_id}/locations/{location_id}/connections/{connection_id}` - * - * Generated from protobuf field string name = 1; - * @param string $var - * @return $this - */ - public function setName($var) - { - GPBUtil::checkString($var, True); - $this->name = $var; - - return $this; - } - - /** - * User provided display name for the connection. - * - * Generated from protobuf field string friendly_name = 2; - * @return string - */ - public function getFriendlyName() - { - return $this->friendly_name; - } - - /** - * User provided display name for the connection. - * - * Generated from protobuf field string friendly_name = 2; - * @param string $var - * @return $this - */ - public function setFriendlyName($var) - { - GPBUtil::checkString($var, True); - $this->friendly_name = $var; - - return $this; - } - - /** - * User provided description. - * - * Generated from protobuf field string description = 3; - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * User provided description. - * - * Generated from protobuf field string description = 3; - * @param string $var - * @return $this - */ - public function setDescription($var) - { - GPBUtil::checkString($var, True); - $this->description = $var; - - return $this; - } - - /** - * Cloud SQL properties. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; - * @return \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties|null - */ - public function getCloudSql() - { - return $this->readOneof(4); - } - - public function hasCloudSql() - { - return $this->hasOneof(4); - } - - /** - * Cloud SQL properties. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSqlProperties cloud_sql = 4; - * @param \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties $var - * @return $this - */ - public function setCloudSql($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudSqlProperties::class); - $this->writeOneof(4, $var); - - return $this; - } - - /** - * Amazon Web Services (AWS) properties. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsProperties aws = 8; - * @return \Google\Cloud\BigQuery\Connection\V1\AwsProperties|null - */ - public function getAws() - { - return $this->readOneof(8); - } - - public function hasAws() - { - return $this->hasOneof(8); - } - - /** - * Amazon Web Services (AWS) properties. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.AwsProperties aws = 8; - * @param \Google\Cloud\BigQuery\Connection\V1\AwsProperties $var - * @return $this - */ - public function setAws($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AwsProperties::class); - $this->writeOneof(8, $var); - - return $this; - } - - /** - * Azure properties. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.AzureProperties azure = 11; - * @return \Google\Cloud\BigQuery\Connection\V1\AzureProperties|null - */ - public function getAzure() - { - return $this->readOneof(11); - } - - public function hasAzure() - { - return $this->hasOneof(11); - } - - /** - * Azure properties. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.AzureProperties azure = 11; - * @param \Google\Cloud\BigQuery\Connection\V1\AzureProperties $var - * @return $this - */ - public function setAzure($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\AzureProperties::class); - $this->writeOneof(11, $var); - - return $this; - } - - /** - * Cloud Spanner properties. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSpannerProperties cloud_spanner = 21; - * @return \Google\Cloud\BigQuery\Connection\V1\CloudSpannerProperties|null - */ - public function getCloudSpanner() - { - return $this->readOneof(21); - } - - public function hasCloudSpanner() - { - return $this->hasOneof(21); - } - - /** - * Cloud Spanner properties. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudSpannerProperties cloud_spanner = 21; - * @param \Google\Cloud\BigQuery\Connection\V1\CloudSpannerProperties $var - * @return $this - */ - public function setCloudSpanner($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudSpannerProperties::class); - $this->writeOneof(21, $var); - - return $this; - } - - /** - * Cloud Resource properties. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudResourceProperties cloud_resource = 22; - * @return \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties|null - */ - public function getCloudResource() - { - return $this->readOneof(22); - } - - public function hasCloudResource() - { - return $this->hasOneof(22); - } - - /** - * Cloud Resource properties. - * - * Generated from protobuf field .google.cloud.bigquery.connection.v1.CloudResourceProperties cloud_resource = 22; - * @param \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties $var - * @return $this - */ - public function setCloudResource($var) - { - GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Connection\V1\CloudResourceProperties::class); - $this->writeOneof(22, $var); - - return $this; - } - - /** - * 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 9e906d2b1dcc..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 array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $connections - * List of connections. - * } - */ - public function __construct($data = NULL) { - \GPBMetadata\Google\Cloud\Bigquery\Connection\V1\Connection::initOnce(); - parent::__construct($data); - } - - /** - * Next page token. - * - * Generated from protobuf field string next_page_token = 1; - * @return string - */ - public function getNextPageToken() - { - return $this->next_page_token; - } - - /** - * Next page token. - * - * Generated from protobuf field string next_page_token = 1; - * @param string $var - * @return $this - */ - public function setNextPageToken($var) - { - GPBUtil::checkString($var, True); - $this->next_page_token = $var; - - return $this; - } - - /** - * List of connections. - * - * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; - * @return \Google\Protobuf\Internal\RepeatedField - */ - public function getConnections() - { - return $this->connections; - } - - /** - * List of connections. - * - * Generated from protobuf field repeated .google.cloud.bigquery.connection.v1.Connection connections = 2; - * @param array<\Google\Cloud\BigQuery\Connection\V1\Connection>|\Google\Protobuf\Internal\RepeatedField $var - * @return $this - */ - public function setConnections($var) - { - $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Connection\V1\Connection::class); - $this->connections = $arr; - - return $this; - } - -} - diff --git a/owl-bot-staging/BigQueryConnection/v1/proto/src/Google/Cloud/BigQuery/Connection/V1/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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @throws ApiException if the remote call fails - */ - 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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`. - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\ApiCore\PagedListResponse - * - * @throws ApiException if the remote call fails - */ - 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 FieldMask $updateMask - * OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - * the fields in the mask will be modified. If no mask is provided, the - * following default mask is used: - * - * `paths: "bindings, etag"` - * @type RetrySettings|array $retrySettings - * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\Policy - * - * @throws ApiException if the remote call fails - */ - public function setIamPolicy($resource, $policy, array $optionalArgs = []) - { - $request = new SetIamPolicyRequest(); - $requestParamHeaders = []; - $request->setResource($resource); - $request->setPolicy($policy); - $requestParamHeaders['resource'] = $resource; - if (isset($optionalArgs['updateMask'])) { - $request->setUpdateMask($optionalArgs['updateMask']); - } - - $requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders); - $optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader(); - return $this->startCall('SetIamPolicy', Policy::class, $optionalArgs, $request)->wait(); - } - - /** - * 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see RetrySettings} for example usage. - * } - * - * @return \Google\Cloud\Iam\V1\TestIamPermissionsResponse - * - * @throws ApiException if the remote call fails - */ - 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 RetrySettings} object, or an - * associative array of retry settings parameters. See the documentation on - * {@see 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 a89401d01dfa..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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name = 'name3373707'; - $friendlyName = 'friendlyName1451097503'; - $description = 'description-1724546052'; - $creationTime = 1932333101; - $lastModifiedTime = 671513446; - $hasCredential = true; - $expectedResponse = new Connection(); - $expectedResponse->setName($name); - $expectedResponse->setFriendlyName($friendlyName); - $expectedResponse->setDescription($description); - $expectedResponse->setCreationTime($creationTime); - $expectedResponse->setLastModifiedTime($lastModifiedTime); - $expectedResponse->setHasCredential($hasCredential); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $connection = new Connection(); - $response = $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $connection = new Connection(); - try { - $gapicClient->createConnection($formattedParent, $connection); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function deleteConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new GPBEmpty(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $gapicClient->deleteConnection($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $friendlyName = 'friendlyName1451097503'; - $description = 'description-1724546052'; - $creationTime = 1932333101; - $lastModifiedTime = 671513446; - $hasCredential = true; - $expectedResponse = new Connection(); - $expectedResponse->setName($name2); - $expectedResponse->setFriendlyName($friendlyName); - $expectedResponse->setDescription($description); - $expectedResponse->setCreationTime($creationTime); - $expectedResponse->setLastModifiedTime($lastModifiedTime); - $expectedResponse->setHasCredential($hasCredential); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $response = $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - try { - $gapicClient->getConnection($formattedName); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $response = $gapicClient->getIamPolicy($resource); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/GetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function getIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - try { - $gapicClient->getIamPolicy($resource); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function listConnectionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $nextPageToken = ''; - $connectionsElement = new Connection(); - $connections = [ - $connectionsElement, - ]; - $expectedResponse = new ListConnectionsResponse(); - $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setConnections($connections); - $transport->addResponse($expectedResponse); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageSize = 883849137; - $response = $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageSize = 883849137; - try { - $gapicClient->listConnections($formattedParent, $pageSize); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function setIamPolicyTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $version = 351608024; - $etag = '21'; - $expectedResponse = new Policy(); - $expectedResponse->setVersion($version); - $expectedResponse->setEtag($etag); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - $response = $gapicClient->setIamPolicy($resource, $policy); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/SetIamPolicy', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPolicy(); - $this->assertProtobufEquals($policy, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function setIamPolicyExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $policy = new Policy(); - try { - $gapicClient->setIamPolicy($resource, $policy); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function testIamPermissionsTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new TestIamPermissionsResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - $response = $gapicClient->testIamPermissions($resource, $permissions); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.bigquery.connection.v1.ConnectionService/TestIamPermissions', $actualFuncCall); - $actualValue = $actualRequestObject->getResource(); - $this->assertProtobufEquals($resource, $actualValue); - $actualValue = $actualRequestObject->getPermissions(); - $this->assertProtobufEquals($permissions, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function testIamPermissionsExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $resource = 'resource-341064690'; - $permissions = []; - try { - $gapicClient->testIamPermissions($resource, $permissions); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** - * @test - */ - public function updateConnectionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $name2 = 'name2-1052831874'; - $friendlyName = 'friendlyName1451097503'; - $description = 'description-1724546052'; - $creationTime = 1932333101; - $lastModifiedTime = 671513446; - $hasCredential = true; - $expectedResponse = new Connection(); - $expectedResponse->setName($name2); - $expectedResponse->setFriendlyName($friendlyName); - $expectedResponse->setDescription($description); - $expectedResponse->setCreationTime($creationTime); - $expectedResponse->setLastModifiedTime($lastModifiedTime); - $expectedResponse->setHasCredential($hasCredential); - $transport->addResponse($expectedResponse); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $connection = new Connection(); - $updateMask = new FieldMask(); - $response = $gapicClient->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(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode([ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], JSON_PRETTY_PRINT); - $transport->addResponse(null, $status); - // Mock request - $formattedName = $gapicClient->connectionName('[PROJECT]', '[LOCATION]', '[CONNECTION]'); - $connection = new Connection(); - $updateMask = new FieldMask(); - try { - $gapicClient->updateConnection($formattedName, $connection, $updateMask); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } -}