@@ -148,7 +148,8 @@ PartitionSubscriberFactory getSubscriberFactory() {
148148 try {
149149 SubscriberServiceClient serviceClient =
150150 SubscriberServiceClient .create (
151- addDefaultSettings (this .subscriptionPath ().location ().region (), settingsBuilder ));
151+ addDefaultSettings (
152+ this .subscriptionPath ().location ().extractRegion (), settingsBuilder ));
152153 return SubscriberBuilder .newBuilder ()
153154 .setSubscriptionPath (this .subscriptionPath ())
154155 .setPartition (partition )
@@ -170,7 +171,7 @@ private CursorServiceClient newCursorServiceClient() {
170171 try {
171172 return CursorServiceClient .create (
172173 addDefaultSettings (
173- this .subscriptionPath ().location ().region (),
174+ this .subscriptionPath ().location ().extractRegion (),
174175 CursorServiceSettings .newBuilder ()
175176 .setCredentialsProvider (new PslCredentialsProvider (credentialsKey ()))));
176177 } catch (IOException e ) {
@@ -181,7 +182,7 @@ private CursorServiceClient newCursorServiceClient() {
181182 CursorClient newCursorClient () {
182183 return CursorClient .create (
183184 CursorClientSettings .newBuilder ()
184- .setRegion (this .subscriptionPath ().location ().region ())
185+ .setRegion (this .subscriptionPath ().location ().extractRegion ())
185186 .setServiceClient (newCursorServiceClient ())
186187 .build ());
187188 }
@@ -190,7 +191,7 @@ private AdminServiceClient newAdminServiceClient() {
190191 try {
191192 return AdminServiceClient .create (
192193 addDefaultSettings (
193- this .subscriptionPath ().location ().region (),
194+ this .subscriptionPath ().location ().extractRegion (),
194195 AdminServiceSettings .newBuilder ()
195196 .setCredentialsProvider (new PslCredentialsProvider (credentialsKey ()))));
196197 } catch (IOException e ) {
@@ -201,7 +202,7 @@ private AdminServiceClient newAdminServiceClient() {
201202 AdminClient newAdminClient () {
202203 return AdminClient .create (
203204 AdminClientSettings .newBuilder ()
204- .setRegion (this .subscriptionPath ().location ().region ())
205+ .setRegion (this .subscriptionPath ().location ().extractRegion ())
205206 .setServiceClient (newAdminServiceClient ())
206207 .build ());
207208 }
@@ -210,7 +211,7 @@ private TopicStatsServiceClient newTopicStatsServiceClient() {
210211 try {
211212 return TopicStatsServiceClient .create (
212213 addDefaultSettings (
213- this .subscriptionPath ().location ().region (),
214+ this .subscriptionPath ().location ().extractRegion (),
214215 TopicStatsServiceSettings .newBuilder ()
215216 .setCredentialsProvider (new PslCredentialsProvider (credentialsKey ()))));
216217 } catch (IOException e ) {
@@ -221,7 +222,7 @@ private TopicStatsServiceClient newTopicStatsServiceClient() {
221222 TopicStatsClient newTopicStatsClient () {
222223 return TopicStatsClient .create (
223224 TopicStatsClientSettings .newBuilder ()
224- .setRegion (this .subscriptionPath ().location ().region ())
225+ .setRegion (this .subscriptionPath ().location ().extractRegion ())
225226 .setServiceClient (newTopicStatsServiceClient ())
226227 .build ());
227228 }
0 commit comments