GoogleCloudPlatform / java-docs-samples

Java and Kotlin Code samples used on cloud.google.com
https://cloud.google.com/java
Apache License 2.0
1.75k stars 2.82k forks source link

refactor(iam): update service account samples to use GAPIC library #9293

Closed msilc closed 3 months ago

msilc commented 4 months ago

Description

Service accounts snippets rewrote using a new library

Checklist

Sita04 commented 4 months ago

IMHO this should be moved out from iam/api-client to iam/cloud-client. @Sita04 please advise.

Agreed it should be moved out of api-client folder. We have an existing folder for GAPIC samples under iam/snippets Kindly consider creating a new sub-folder and moving these. We should also make note to update doc references for the samples.

@hegemonic for visibility.

msilc commented 4 months ago

IMHO this should be moved out from iam/api-client to iam/cloud-client. @Sita04 please advise.

Agreed it should be moved out of api-client folder. We have an existing folder for GAPIC samples under iam/snippets Kindly consider creating a new sub-folder and moving these. We should also make note to update doc references for the samples.

@hegemonic for visibility.

Should only the updated snippets or the entire iam/api-client be moved to the new folder?

Sita04 commented 4 months ago

IMHO this should be moved out from iam/api-client to iam/cloud-client. @Sita04 please advise.

Agreed it should be moved out of api-client folder. We have an existing folder for GAPIC samples under iam/snippets Kindly consider creating a new sub-folder and moving these. We should also make note to update doc references for the samples. @hegemonic for visibility.

Should only the updated snippets or the entire iam/api-client be moved to the new folder?

Only the snippets that are updated should be moved to the iam/snippets folder. Thanks!

snippet-bot[bot] commented 4 months ago

Here is the summary of changes.

You are about to add 11 region tags. - [iam/snippets/src/main/java/CreateServiceAccount.java:16](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/68fdb8977cd2823f020d0c40e309f8e3998dbcf5/iam/snippets/src/main/java/CreateServiceAccount.java#L16), tag `iam_create_service_account` - [iam/snippets/src/main/java/CreateServiceAccountKey.java:16](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/68fdb8977cd2823f020d0c40e309f8e3998dbcf5/iam/snippets/src/main/java/CreateServiceAccountKey.java#L16), tag `iam_create_key` - [iam/snippets/src/main/java/DeleteServiceAccount.java:16](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/68fdb8977cd2823f020d0c40e309f8e3998dbcf5/iam/snippets/src/main/java/DeleteServiceAccount.java#L16), tag `iam_delete_service_account` - [iam/snippets/src/main/java/DeleteServiceAccountKey.java:16](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/68fdb8977cd2823f020d0c40e309f8e3998dbcf5/iam/snippets/src/main/java/DeleteServiceAccountKey.java#L16), tag `iam_delete_key` - [iam/snippets/src/main/java/DisableServiceAccount.java:16](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/68fdb8977cd2823f020d0c40e309f8e3998dbcf5/iam/snippets/src/main/java/DisableServiceAccount.java#L16), tag `iam_disable_service_account` - [iam/snippets/src/main/java/DisableServiceAccountKey.java:16](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/68fdb8977cd2823f020d0c40e309f8e3998dbcf5/iam/snippets/src/main/java/DisableServiceAccountKey.java#L16), tag `iam_disable_service_account_key` - [iam/snippets/src/main/java/EnableServiceAccount.java:16](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/68fdb8977cd2823f020d0c40e309f8e3998dbcf5/iam/snippets/src/main/java/EnableServiceAccount.java#L16), tag `iam_enable_service_account` - [iam/snippets/src/main/java/EnableServiceAccountKey.java:16](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/68fdb8977cd2823f020d0c40e309f8e3998dbcf5/iam/snippets/src/main/java/EnableServiceAccountKey.java#L16), tag `iam_enable_service_account_key` - [iam/snippets/src/main/java/ListServiceAccountKeys.java:16](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/68fdb8977cd2823f020d0c40e309f8e3998dbcf5/iam/snippets/src/main/java/ListServiceAccountKeys.java#L16), tag `iam_list_keys` - [iam/snippets/src/main/java/ListServiceAccounts.java:16](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/68fdb8977cd2823f020d0c40e309f8e3998dbcf5/iam/snippets/src/main/java/ListServiceAccounts.java#L16), tag `iam_list_service_accounts` - [iam/snippets/src/main/java/RenameServiceAccount.java:16](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/68fdb8977cd2823f020d0c40e309f8e3998dbcf5/iam/snippets/src/main/java/RenameServiceAccount.java#L16), tag `iam_rename_service_account`
You are about to delete 11 region tags. - [iam/api-client/src/main/java/iam/snippets/CreateServiceAccountKey.java:18](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/c4425de595b48e0b4ccb7e66b1a5ad246e632733/iam/api-client/src/main/java/iam/snippets/CreateServiceAccountKey.java#L18), tag `iam_create_key` - [iam/api-client/src/main/java/iam/snippets/DisableServiceAccount.java:18](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/c4425de595b48e0b4ccb7e66b1a5ad246e632733/iam/api-client/src/main/java/iam/snippets/DisableServiceAccount.java#L18), tag `iam_disable_service_account` - [iam/api-client/src/main/java/iam/snippets/DisableServiceAccountKey.java:18](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/c4425de595b48e0b4ccb7e66b1a5ad246e632733/iam/api-client/src/main/java/iam/snippets/DisableServiceAccountKey.java#L18), tag `iam_disable_service_account_key` - [iam/api-client/src/main/java/iam/snippets/EnableServiceAccount.java:18](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/c4425de595b48e0b4ccb7e66b1a5ad246e632733/iam/api-client/src/main/java/iam/snippets/EnableServiceAccount.java#L18), tag `iam_enable_service_account` - [iam/api-client/src/main/java/iam/snippets/EnableServiceAccountKey.java:18](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/c4425de595b48e0b4ccb7e66b1a5ad246e632733/iam/api-client/src/main/java/iam/snippets/EnableServiceAccountKey.java#L18), tag `iam_enable_service_account_key` - [iam/api-client/src/main/java/iam/snippets/ListServiceAccountKeys.java:18](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/c4425de595b48e0b4ccb7e66b1a5ad246e632733/iam/api-client/src/main/java/iam/snippets/ListServiceAccountKeys.java#L18), tag `iam_list_keys` - [iam/api-client/src/main/java/iam/snippets/ListServiceAccounts.java:18](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/c4425de595b48e0b4ccb7e66b1a5ad246e632733/iam/api-client/src/main/java/iam/snippets/ListServiceAccounts.java#L18), tag `iam_list_service_accounts` - [iam/api-client/src/main/java/iam/snippets/CreateServiceAccount.java:18](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/c4425de595b48e0b4ccb7e66b1a5ad246e632733/iam/api-client/src/main/java/iam/snippets/CreateServiceAccount.java#L18), tag `iam_create_service_account` - [iam/api-client/src/main/java/iam/snippets/DeleteServiceAccount.java:18](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/c4425de595b48e0b4ccb7e66b1a5ad246e632733/iam/api-client/src/main/java/iam/snippets/DeleteServiceAccount.java#L18), tag `iam_delete_service_account` - [iam/api-client/src/main/java/iam/snippets/DeleteServiceAccountKey.java:18](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/c4425de595b48e0b4ccb7e66b1a5ad246e632733/iam/api-client/src/main/java/iam/snippets/DeleteServiceAccountKey.java#L18), tag `iam_delete_key` - [iam/api-client/src/main/java/iam/snippets/RenameServiceAccount.java:18](https://github.com/GoogleCloudPlatform/java-docs-samples/blob/c4425de595b48e0b4ccb7e66b1a5ad246e632733/iam/api-client/src/main/java/iam/snippets/RenameServiceAccount.java#L18), tag `iam_rename_service_account`

This comment is generated by snippet-bot. If you find problems with this result, please file an issue at: https://github.com/googleapis/repo-automation-bots/issues. To update this comment, add snippet-bot:force-run label or use the checkbox below:

Sita04 commented 4 months ago

@msilc Kindly fix the failed tests.