-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Integrate new gapic-generator-java and rules_gapic (#743)
* chore: Integrate new gapic-generator-java and rules_gapic PiperOrigin-RevId: 454027580 Source-Link: googleapis/googleapis@1b22277 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e04cea20d0d12eb5c3bdb360a9e72b654edcb638 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTA0Y2VhMjBkMGQxMmViNWMzYmRiMzYwYTllNzJiNjU0ZWRjYjYzOCJ9 chore: include generated samples dir PiperOrigin-RevId: 450696442 Source-Link: googleapis/googleapis@da052c9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4800d1f2ea50e2cad9ce78b34185e9577029db5c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDgwMGQxZjJlYTUwZTJjYWQ5Y2U3OGIzNDE4NWU5NTc3MDI5ZGI1YyJ9 chore(deps): upgrade gapic-generator-java to 2.8.0 and update gax-java to 2.18.1 PiperOrigin-RevId: 450543911 Source-Link: googleapis/googleapis@5528344 Source-Link: https://github.com/googleapis/googleapis-gen/commit/9f6775cab1958982b88967a43e5e806af0f135db Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOWY2Nzc1Y2FiMTk1ODk4MmI4ODk2N2E0M2U1ZTgwNmFmMGYxMzVkYiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
- Loading branch information
1 parent
31a92e7
commit 39ab148
Showing
37 changed files
with
1,586 additions
and
6 deletions.
There are no files selected for viewing
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
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
52 changes: 52 additions & 0 deletions
52
...oval/v1/accessapprovaladminclient/approveapprovalrequest/AsyncApproveApprovalRequest.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,52 @@ | ||
/* | ||
* 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.accessapproval.v1.samples; | ||
|
||
// [START accessapproval_v1_generated_accessapprovaladminclient_approveapprovalrequest_async] | ||
import com.google.api.core.ApiFuture; | ||
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient; | ||
import com.google.cloud.accessapproval.v1.ApprovalRequest; | ||
import com.google.cloud.accessapproval.v1.ApprovalRequestName; | ||
import com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage; | ||
import com.google.protobuf.Timestamp; | ||
|
||
public class AsyncApproveApprovalRequest { | ||
|
||
public static void main(String[] args) throws Exception { | ||
asyncApproveApprovalRequest(); | ||
} | ||
|
||
public static void asyncApproveApprovalRequest() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
try (AccessApprovalAdminClient accessApprovalAdminClient = AccessApprovalAdminClient.create()) { | ||
ApproveApprovalRequestMessage request = | ||
ApproveApprovalRequestMessage.newBuilder() | ||
.setName( | ||
ApprovalRequestName.ofProjectApprovalRequestName( | ||
"[PROJECT]", "[APPROVAL_REQUEST]") | ||
.toString()) | ||
.setExpireTime(Timestamp.newBuilder().build()) | ||
.build(); | ||
ApiFuture<ApprovalRequest> future = | ||
accessApprovalAdminClient.approveApprovalRequestCallable().futureCall(request); | ||
// Do something. | ||
ApprovalRequest response = future.get(); | ||
} | ||
} | ||
} | ||
// [END accessapproval_v1_generated_accessapprovaladminclient_approveapprovalrequest_async] |
48 changes: 48 additions & 0 deletions
48
...roval/v1/accessapprovaladminclient/approveapprovalrequest/SyncApproveApprovalRequest.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,48 @@ | ||
/* | ||
* 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.accessapproval.v1.samples; | ||
|
||
// [START accessapproval_v1_generated_accessapprovaladminclient_approveapprovalrequest_sync] | ||
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient; | ||
import com.google.cloud.accessapproval.v1.ApprovalRequest; | ||
import com.google.cloud.accessapproval.v1.ApprovalRequestName; | ||
import com.google.cloud.accessapproval.v1.ApproveApprovalRequestMessage; | ||
import com.google.protobuf.Timestamp; | ||
|
||
public class SyncApproveApprovalRequest { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncApproveApprovalRequest(); | ||
} | ||
|
||
public static void syncApproveApprovalRequest() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
try (AccessApprovalAdminClient accessApprovalAdminClient = AccessApprovalAdminClient.create()) { | ||
ApproveApprovalRequestMessage request = | ||
ApproveApprovalRequestMessage.newBuilder() | ||
.setName( | ||
ApprovalRequestName.ofProjectApprovalRequestName( | ||
"[PROJECT]", "[APPROVAL_REQUEST]") | ||
.toString()) | ||
.setExpireTime(Timestamp.newBuilder().build()) | ||
.build(); | ||
ApprovalRequest response = accessApprovalAdminClient.approveApprovalRequest(request); | ||
} | ||
} | ||
} | ||
// [END accessapproval_v1_generated_accessapprovaladminclient_approveapprovalrequest_sync] |
42 changes: 42 additions & 0 deletions
42
.../accessapproval/v1/accessapprovaladminclient/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,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.accessapproval.v1.samples; | ||
|
||
// [START accessapproval_v1_generated_accessapprovaladminclient_create_setcredentialsprovider_sync] | ||
import com.google.api.gax.core.FixedCredentialsProvider; | ||
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient; | ||
import com.google.cloud.accessapproval.v1.AccessApprovalAdminSettings; | ||
import com.google.cloud.accessapproval.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. | ||
AccessApprovalAdminSettings accessApprovalAdminSettings = | ||
AccessApprovalAdminSettings.newBuilder() | ||
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) | ||
.build(); | ||
AccessApprovalAdminClient accessApprovalAdminClient = | ||
AccessApprovalAdminClient.create(accessApprovalAdminSettings); | ||
} | ||
} | ||
// [END accessapproval_v1_generated_accessapprovaladminclient_create_setcredentialsprovider_sync] |
39 changes: 39 additions & 0 deletions
39
...oogle/cloud/accessapproval/v1/accessapprovaladminclient/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.accessapproval.v1.samples; | ||
|
||
// [START accessapproval_v1_generated_accessapprovaladminclient_create_setendpoint_sync] | ||
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient; | ||
import com.google.cloud.accessapproval.v1.AccessApprovalAdminSettings; | ||
import com.google.cloud.accessapproval.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. | ||
AccessApprovalAdminSettings accessApprovalAdminSettings = | ||
AccessApprovalAdminSettings.newBuilder().setEndpoint(myEndpoint).build(); | ||
AccessApprovalAdminClient accessApprovalAdminClient = | ||
AccessApprovalAdminClient.create(accessApprovalAdminSettings); | ||
} | ||
} | ||
// [END accessapproval_v1_generated_accessapprovaladminclient_create_setendpoint_sync] |
47 changes: 47 additions & 0 deletions
47
...ssapprovaladminclient/deleteaccessapprovalsettings/AsyncDeleteAccessApprovalSettings.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,47 @@ | ||
/* | ||
* 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.accessapproval.v1.samples; | ||
|
||
// [START accessapproval_v1_generated_accessapprovaladminclient_deleteaccessapprovalsettings_async] | ||
import com.google.api.core.ApiFuture; | ||
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient; | ||
import com.google.cloud.accessapproval.v1.AccessApprovalSettingsName; | ||
import com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage; | ||
import com.google.protobuf.Empty; | ||
|
||
public class AsyncDeleteAccessApprovalSettings { | ||
|
||
public static void main(String[] args) throws Exception { | ||
asyncDeleteAccessApprovalSettings(); | ||
} | ||
|
||
public static void asyncDeleteAccessApprovalSettings() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
try (AccessApprovalAdminClient accessApprovalAdminClient = AccessApprovalAdminClient.create()) { | ||
DeleteAccessApprovalSettingsMessage request = | ||
DeleteAccessApprovalSettingsMessage.newBuilder() | ||
.setName(AccessApprovalSettingsName.ofProjectName("[PROJECT]").toString()) | ||
.build(); | ||
ApiFuture<Empty> future = | ||
accessApprovalAdminClient.deleteAccessApprovalSettingsCallable().futureCall(request); | ||
// Do something. | ||
future.get(); | ||
} | ||
} | ||
} | ||
// [END accessapproval_v1_generated_accessapprovaladminclient_deleteaccessapprovalsettings_async] |
42 changes: 42 additions & 0 deletions
42
...essapprovaladminclient/deleteaccessapprovalsettings/SyncDeleteAccessApprovalSettings.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.accessapproval.v1.samples; | ||
|
||
// [START accessapproval_v1_generated_accessapprovaladminclient_deleteaccessapprovalsettings_sync] | ||
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient; | ||
import com.google.cloud.accessapproval.v1.AccessApprovalSettingsName; | ||
import com.google.cloud.accessapproval.v1.DeleteAccessApprovalSettingsMessage; | ||
|
||
public class SyncDeleteAccessApprovalSettings { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncDeleteAccessApprovalSettings(); | ||
} | ||
|
||
public static void syncDeleteAccessApprovalSettings() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
try (AccessApprovalAdminClient accessApprovalAdminClient = AccessApprovalAdminClient.create()) { | ||
DeleteAccessApprovalSettingsMessage request = | ||
DeleteAccessApprovalSettingsMessage.newBuilder() | ||
.setName(AccessApprovalSettingsName.ofProjectName("[PROJECT]").toString()) | ||
.build(); | ||
accessApprovalAdminClient.deleteAccessApprovalSettings(request); | ||
} | ||
} | ||
} | ||
// [END accessapproval_v1_generated_accessapprovaladminclient_deleteaccessapprovalsettings_sync] |
40 changes: 40 additions & 0 deletions
40
...eteaccessapprovalsettings/SyncDeleteAccessApprovalSettingsAccessapprovalsettingsname.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.accessapproval.v1.samples; | ||
|
||
// [START | ||
// accessapproval_v1_generated_accessapprovaladminclient_deleteaccessapprovalsettings_accessapprovalsettingsname_sync] | ||
import com.google.cloud.accessapproval.v1.AccessApprovalAdminClient; | ||
import com.google.cloud.accessapproval.v1.AccessApprovalSettingsName; | ||
|
||
public class SyncDeleteAccessApprovalSettingsAccessapprovalsettingsname { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncDeleteAccessApprovalSettingsAccessapprovalsettingsname(); | ||
} | ||
|
||
public static void syncDeleteAccessApprovalSettingsAccessapprovalsettingsname() throws Exception { | ||
// This snippet has been automatically generated for illustrative purposes only. | ||
// It may require modifications to work in your environment. | ||
try (AccessApprovalAdminClient accessApprovalAdminClient = AccessApprovalAdminClient.create()) { | ||
AccessApprovalSettingsName name = AccessApprovalSettingsName.ofProjectName("[PROJECT]"); | ||
accessApprovalAdminClient.deleteAccessApprovalSettings(name); | ||
} | ||
} | ||
} | ||
// [END | ||
// accessapproval_v1_generated_accessapprovaladminclient_deleteaccessapprovalsettings_accessapprovalsettingsname_sync] |
Oops, something went wrong.