-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Enable REST transport for most of Java and Go clients (#681)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 456641589 Source-Link: googleapis/googleapis@8a251f5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4ca52a529cf01308d9714950edffbea3560cfbdb Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGNhNTJhNTI5Y2YwMTMwOGQ5NzE0OTUwZWRmZmJlYTM1NjBjZmJkYiJ9
- Loading branch information
1 parent
09cd503
commit ceecd91
Showing
156 changed files
with
7,050 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...loud/servicedirectory/v1/lookupserviceclient/create/SyncCreateSetCredentialsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.servicedirectory.v1.samples; | ||
|
||
// [START servicedirectory_v1_generated_lookupserviceclient_create_setcredentialsprovider_sync] | ||
import com.google.api.gax.core.FixedCredentialsProvider; | ||
import com.google.cloud.servicedirectory.v1.LookupServiceClient; | ||
import com.google.cloud.servicedirectory.v1.LookupServiceSettings; | ||
import com.google.cloud.servicedirectory.v1.myCredentials; | ||
|
||
public class SyncCreateSetCredentialsProvider { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncCreateSetCredentialsProvider(); | ||
} | ||
|
||
public static void syncCreateSetCredentialsProvider() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
LookupServiceSettings lookupServiceSettings = | ||
LookupServiceSettings.newBuilder() | ||
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) | ||
.build(); | ||
LookupServiceClient lookupServiceClient = LookupServiceClient.create(lookupServiceSettings); | ||
} | ||
} | ||
// [END servicedirectory_v1_generated_lookupserviceclient_create_setcredentialsprovider_sync] |
40 changes: 40 additions & 0 deletions
40
...oud/servicedirectory/v1/lookupserviceclient/create/SyncCreateSetCredentialsProvider1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.servicedirectory.v1.samples; | ||
|
||
// [START servicedirectory_v1_generated_lookupserviceclient_create_setcredentialsprovider1_sync] | ||
import com.google.cloud.servicedirectory.v1.LookupServiceClient; | ||
import com.google.cloud.servicedirectory.v1.LookupServiceSettings; | ||
|
||
public class SyncCreateSetCredentialsProvider1 { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncCreateSetCredentialsProvider1(); | ||
} | ||
|
||
public static void syncCreateSetCredentialsProvider1() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
LookupServiceSettings lookupServiceSettings = | ||
LookupServiceSettings.newBuilder() | ||
.setTransportChannelProvider( | ||
LookupServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) | ||
.build(); | ||
LookupServiceClient lookupServiceClient = LookupServiceClient.create(lookupServiceSettings); | ||
} | ||
} | ||
// [END servicedirectory_v1_generated_lookupserviceclient_create_setcredentialsprovider1_sync] |
38 changes: 38 additions & 0 deletions
38
...om/google/cloud/servicedirectory/v1/lookupserviceclient/create/SyncCreateSetEndpoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.servicedirectory.v1.samples; | ||
|
||
// [START servicedirectory_v1_generated_lookupserviceclient_create_setendpoint_sync] | ||
import com.google.cloud.servicedirectory.v1.LookupServiceClient; | ||
import com.google.cloud.servicedirectory.v1.LookupServiceSettings; | ||
import com.google.cloud.servicedirectory.v1.myEndpoint; | ||
|
||
public class SyncCreateSetEndpoint { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncCreateSetEndpoint(); | ||
} | ||
|
||
public static void syncCreateSetEndpoint() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
LookupServiceSettings lookupServiceSettings = | ||
LookupServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); | ||
LookupServiceClient lookupServiceClient = LookupServiceClient.create(lookupServiceSettings); | ||
} | ||
} | ||
// [END servicedirectory_v1_generated_lookupserviceclient_create_setendpoint_sync] |
50 changes: 50 additions & 0 deletions
50
...gle/cloud/servicedirectory/v1/lookupserviceclient/resolveservice/AsyncResolveService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.servicedirectory.v1.samples; | ||
|
||
// [START servicedirectory_v1_generated_lookupserviceclient_resolveservice_async] | ||
import com.google.api.core.ApiFuture; | ||
import com.google.cloud.servicedirectory.v1.LookupServiceClient; | ||
import com.google.cloud.servicedirectory.v1.ResolveServiceRequest; | ||
import com.google.cloud.servicedirectory.v1.ResolveServiceResponse; | ||
import com.google.cloud.servicedirectory.v1.ServiceName; | ||
|
||
public class AsyncResolveService { | ||
|
||
public static void main(String[] args) throws Exception { | ||
asyncResolveService(); | ||
} | ||
|
||
public static void asyncResolveService() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) { | ||
ResolveServiceRequest request = | ||
ResolveServiceRequest.newBuilder() | ||
.setName( | ||
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString()) | ||
.setMaxEndpoints(2074789987) | ||
.setEndpointFilter("endpointFilter-1834249875") | ||
.build(); | ||
ApiFuture<ResolveServiceResponse> future = | ||
lookupServiceClient.resolveServiceCallable().futureCall(request); | ||
// Do something. | ||
ResolveServiceResponse response = future.get(); | ||
} | ||
} | ||
} | ||
// [END servicedirectory_v1_generated_lookupserviceclient_resolveservice_async] |
46 changes: 46 additions & 0 deletions
46
...ogle/cloud/servicedirectory/v1/lookupserviceclient/resolveservice/SyncResolveService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.servicedirectory.v1.samples; | ||
|
||
// [START servicedirectory_v1_generated_lookupserviceclient_resolveservice_sync] | ||
import com.google.cloud.servicedirectory.v1.LookupServiceClient; | ||
import com.google.cloud.servicedirectory.v1.ResolveServiceRequest; | ||
import com.google.cloud.servicedirectory.v1.ResolveServiceResponse; | ||
import com.google.cloud.servicedirectory.v1.ServiceName; | ||
|
||
public class SyncResolveService { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncResolveService(); | ||
} | ||
|
||
public static void syncResolveService() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
try (LookupServiceClient lookupServiceClient = LookupServiceClient.create()) { | ||
ResolveServiceRequest request = | ||
ResolveServiceRequest.newBuilder() | ||
.setName( | ||
ServiceName.of("[PROJECT]", "[LOCATION]", "[NAMESPACE]", "[SERVICE]").toString()) | ||
.setMaxEndpoints(2074789987) | ||
.setEndpointFilter("endpointFilter-1834249875") | ||
.build(); | ||
ResolveServiceResponse response = lookupServiceClient.resolveService(request); | ||
} | ||
} | ||
} | ||
// [END servicedirectory_v1_generated_lookupserviceclient_resolveservice_sync] |
45 changes: 45 additions & 0 deletions
45
...le/cloud/servicedirectory/v1/lookupservicesettings/resolveservice/SyncResolveService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.servicedirectory.v1.samples; | ||
|
||
// [START servicedirectory_v1_generated_lookupservicesettings_resolveservice_sync] | ||
import com.google.cloud.servicedirectory.v1.LookupServiceSettings; | ||
import java.time.Duration; | ||
|
||
public class SyncResolveService { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncResolveService(); | ||
} | ||
|
||
public static void syncResolveService() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
LookupServiceSettings.Builder lookupServiceSettingsBuilder = LookupServiceSettings.newBuilder(); | ||
lookupServiceSettingsBuilder | ||
.resolveServiceSettings() | ||
.setRetrySettings( | ||
lookupServiceSettingsBuilder | ||
.resolveServiceSettings() | ||
.getRetrySettings() | ||
.toBuilder() | ||
.setTotalTimeout(Duration.ofSeconds(30)) | ||
.build()); | ||
LookupServiceSettings lookupServiceSettings = lookupServiceSettingsBuilder.build(); | ||
} | ||
} | ||
// [END servicedirectory_v1_generated_lookupservicesettings_resolveservice_sync] |
43 changes: 43 additions & 0 deletions
43
...ervicedirectory/v1/registrationserviceclient/create/SyncCreateSetCredentialsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.servicedirectory.v1.samples; | ||
|
||
// [START | ||
// servicedirectory_v1_generated_registrationserviceclient_create_setcredentialsprovider_sync] | ||
import com.google.api.gax.core.FixedCredentialsProvider; | ||
import com.google.cloud.servicedirectory.v1.RegistrationServiceClient; | ||
import com.google.cloud.servicedirectory.v1.RegistrationServiceSettings; | ||
import com.google.cloud.servicedirectory.v1.myCredentials; | ||
|
||
public class SyncCreateSetCredentialsProvider { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncCreateSetCredentialsProvider(); | ||
} | ||
|
||
public static void syncCreateSetCredentialsProvider() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
RegistrationServiceSettings registrationServiceSettings = | ||
RegistrationServiceSettings.newBuilder() | ||
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) | ||
.build(); | ||
RegistrationServiceClient registrationServiceClient = | ||
RegistrationServiceClient.create(registrationServiceSettings); | ||
} | ||
} | ||
// [END servicedirectory_v1_generated_registrationserviceclient_create_setcredentialsprovider_sync] |
42 changes: 42 additions & 0 deletions
42
...rvicedirectory/v1/registrationserviceclient/create/SyncCreateSetCredentialsProvider1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.servicedirectory.v1.samples; | ||
|
||
// [START | ||
// servicedirectory_v1_generated_registrationserviceclient_create_setcredentialsprovider1_sync] | ||
import com.google.cloud.servicedirectory.v1.RegistrationServiceClient; | ||
import com.google.cloud.servicedirectory.v1.RegistrationServiceSettings; | ||
|
||
public class SyncCreateSetCredentialsProvider1 { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncCreateSetCredentialsProvider1(); | ||
} | ||
|
||
public static void syncCreateSetCredentialsProvider1() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
RegistrationServiceSettings registrationServiceSettings = | ||
RegistrationServiceSettings.newBuilder() | ||
.setTransportChannelProvider( | ||
RegistrationServiceSettings.defaultHttpJsonTransportProviderBuilder().build()) | ||
.build(); | ||
RegistrationServiceClient registrationServiceClient = | ||
RegistrationServiceClient.create(registrationServiceSettings); | ||
} | ||
} | ||
// [END servicedirectory_v1_generated_registrationserviceclient_create_setcredentialsprovider1_sync] |
39 changes: 39 additions & 0 deletions
39
...gle/cloud/servicedirectory/v1/registrationserviceclient/create/SyncCreateSetEndpoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.servicedirectory.v1.samples; | ||
|
||
// [START servicedirectory_v1_generated_registrationserviceclient_create_setendpoint_sync] | ||
import com.google.cloud.servicedirectory.v1.RegistrationServiceClient; | ||
import com.google.cloud.servicedirectory.v1.RegistrationServiceSettings; | ||
import com.google.cloud.servicedirectory.v1.myEndpoint; | ||
|
||
public class SyncCreateSetEndpoint { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncCreateSetEndpoint(); | ||
} | ||
|
||
public static void syncCreateSetEndpoint() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
RegistrationServiceSettings registrationServiceSettings = | ||
RegistrationServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); | ||
RegistrationServiceClient registrationServiceClient = | ||
RegistrationServiceClient.create(registrationServiceSettings); | ||
} | ||
} | ||
// [END servicedirectory_v1_generated_registrationserviceclient_create_setendpoint_sync] |
Oops, something went wrong.