Skip to content

Commit 7b41bdf

Browse files
yoshi-automationjdpedrie
authored andcommitted
feat: Add support for apiEndpoint and deprecate serviceAddress… (#2220)
1 parent bb41559 commit 7b41bdf

5 files changed

Lines changed: 39 additions & 17 deletions

File tree

Scheduler/src/V1/Gapic/CloudSchedulerGapicClient.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private static function getClientDefaults()
122122
{
123123
return [
124124
'serviceName' => self::SERVICE_NAME,
125-
'serviceAddress' => self::SERVICE_ADDRESS.':'.self::DEFAULT_SERVICE_PORT,
125+
'apiEndpoint' => self::SERVICE_ADDRESS.':'.self::DEFAULT_SERVICE_PORT,
126126
'clientConfig' => __DIR__.'/../resources/cloud_scheduler_client_config.json',
127127
'descriptorsConfigPath' => __DIR__.'/../resources/cloud_scheduler_descriptor_config.php',
128128
'gcpApiConfigPath' => __DIR__.'/../resources/cloud_scheduler_grpc_config.json',
@@ -277,6 +277,9 @@ public static function parseName($formattedName, $template = null)
277277
* Optional. Options for configuring the service API wrapper.
278278
*
279279
* @type string $serviceAddress
280+
* **Deprecated**. This option will be removed in a future major release. Please
281+
* utilize the `$apiEndpoint` option instead.
282+
* @type string $apiEndpoint
280283
* The address of the API remote host. May optionally include the port, formatted
281284
* as "<uri>:<port>". Default 'cloudscheduler.googleapis.com:443'.
282285
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
@@ -304,7 +307,7 @@ public static function parseName($formattedName, $template = null)
304307
* or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
305308
* *Advanced usage*: Additionally, it is possible to pass in an already instantiated
306309
* {@see \Google\ApiCore\Transport\TransportInterface} object. Note that when this
307-
* object is provided, any settings in $transportConfig, and any $serviceAddress
310+
* object is provided, any settings in $transportConfig, and any `$apiEndpoint`
308311
* setting, will be ignored.
309312
* @type array $transportConfig
310313
* Configuration options that will be used to construct the transport. Options for

Scheduler/src/V1beta1/Gapic/CloudSchedulerGapicClient.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private static function getClientDefaults()
126126
{
127127
return [
128128
'serviceName' => self::SERVICE_NAME,
129-
'serviceAddress' => self::SERVICE_ADDRESS.':'.self::DEFAULT_SERVICE_PORT,
129+
'apiEndpoint' => self::SERVICE_ADDRESS.':'.self::DEFAULT_SERVICE_PORT,
130130
'clientConfig' => __DIR__.'/../resources/cloud_scheduler_client_config.json',
131131
'descriptorsConfigPath' => __DIR__.'/../resources/cloud_scheduler_descriptor_config.php',
132132
'gcpApiConfigPath' => __DIR__.'/../resources/cloud_scheduler_grpc_config.json',
@@ -285,6 +285,9 @@ public static function parseName($formattedName, $template = null)
285285
* Optional. Options for configuring the service API wrapper.
286286
*
287287
* @type string $serviceAddress
288+
* **Deprecated**. This option will be removed in a future major release. Please
289+
* utilize the `$apiEndpoint` option instead.
290+
* @type string $apiEndpoint
288291
* The address of the API remote host. May optionally include the port, formatted
289292
* as "<uri>:<port>". Default 'cloudscheduler.googleapis.com:443'.
290293
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
@@ -312,7 +315,7 @@ public static function parseName($formattedName, $template = null)
312315
* or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
313316
* *Advanced usage*: Additionally, it is possible to pass in an already instantiated
314317
* {@see \Google\ApiCore\Transport\TransportInterface} object. Note that when this
315-
* object is provided, any settings in $transportConfig, and any $serviceAddress
318+
* object is provided, any settings in $transportConfig, and any `$apiEndpoint`
316319
* setting, will be ignored.
317320
* @type array $transportConfig
318321
* Configuration options that will be used to construct the transport. Options for

Scheduler/synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-05-14T23:21:20.820042Z",
2+
"updateTime": "2019-08-07T18:03:54.335266Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.19.0",
8-
"dockerImage": "googleapis/artman@sha256:d3df563538225ac6caac45d8ad86499500211d1bcb2536955a6dbda15e1b368e"
7+
"version": "0.29.1",
8+
"dockerImage": "googleapis/artman@sha256:b2a73f4dda03ef8fcaa973e3ba26d0cf34091f6c22c70add663af325931aef4d"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "275cdfcdc3188a60456f43acd139b8cc037379f4",
16-
"internalRef": "248217300"
15+
"sha": "3a1b46a6668194a527e532a2c355b404c79b0e6a",
16+
"internalRef": "262167956"
1717
}
1818
}
1919
],

Scheduler/tests/Unit/V1/CloudSchedulerClientTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
use stdClass;
3737

3838
/**
39-
* @group cloudscheduler
39+
* @group scheduler
4040
* @group gapic
4141
*/
4242
class CloudSchedulerClientTest extends GeneratedTest
@@ -49,15 +49,23 @@ private function createTransport($deserialize = null)
4949
return new MockTransport($deserialize);
5050
}
5151

52+
/**
53+
* @return CredentialsWrapper
54+
*/
55+
private function createCredentials()
56+
{
57+
return $this->getMockBuilder(CredentialsWrapper::class)
58+
->disableOriginalConstructor()
59+
->getMock();
60+
}
61+
5262
/**
5363
* @return CloudSchedulerClient
5464
*/
5565
private function createClient(array $options = [])
5666
{
5767
$options += [
58-
'credentials' => $this->getMockBuilder(CredentialsWrapper::class)
59-
->disableOriginalConstructor()
60-
->getMock(),
68+
'credentials' => $this->createCredentials(),
6169
];
6270

6371
return new CloudSchedulerClient($options);

Scheduler/tests/Unit/V1beta1/CloudSchedulerClientTest.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
use stdClass;
3636

3737
/**
38-
* @group cloudscheduler
38+
* @group scheduler
3939
* @group gapic
4040
*/
4141
class CloudSchedulerClientTest extends GeneratedTest
@@ -48,15 +48,23 @@ private function createTransport($deserialize = null)
4848
return new MockTransport($deserialize);
4949
}
5050

51+
/**
52+
* @return CredentialsWrapper
53+
*/
54+
private function createCredentials()
55+
{
56+
return $this->getMockBuilder(CredentialsWrapper::class)
57+
->disableOriginalConstructor()
58+
->getMock();
59+
}
60+
5161
/**
5262
* @return CloudSchedulerClient
5363
*/
5464
private function createClient(array $options = [])
5565
{
5666
$options += [
57-
'credentials' => $this->getMockBuilder(CredentialsWrapper::class)
58-
->disableOriginalConstructor()
59-
->getMock(),
67+
'credentials' => $this->createCredentials(),
6068
];
6169

6270
return new CloudSchedulerClient($options);

0 commit comments

Comments
 (0)