Skip to content

feat(IAM Identity): adding serviceId Groups API #274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Java Style
<module name="SuppressWarningsFilter" />
<module name="NewlineAtEndOfFile" />
<module name="FileLength">
<property name="max" value="3000" />
<property name="max" value="10000" />
</module>
<module name="FileTabCharacter" />

Expand Down Expand Up @@ -80,7 +80,7 @@ Java Style
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="MethodLength">
<property name="max" value="2000" />
<property name="max" value="3000" />
</module>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ protected IamIdentityExamples() {
private static String apikeyEtag;
private static String svcId;
private static String svcIdEtag;
private static String srvIdGroupId;
private static String srvIdGroupEtag;
private static String profileId;
private static String profileEtag;
private static String claimRuleId;
Expand Down Expand Up @@ -465,6 +467,114 @@ public static void main(String[] args) throws Exception {
e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e);
}

try {
System.out.println("createServiceIdGroup() result:");

// begin-create_service_id_group

CreateServiceIdGroupOptions createServiceIdGroupOptions = new CreateServiceIdGroupOptions.Builder()
.accountId(accountId)
.name(serviceIdName)
.description("Example ServiceIdGroup")
.build();

Response<ServiceIdGroup> response = identityservice.createServiceIdGroup(createServiceIdGroupOptions).execute();
ServiceIdGroup serviceIdGroup = response.getResult();
srvIdGroupId = serviceIdGroup.getId();

System.out.println(serviceIdGroup);

// end-create_service_id_group

} catch (ServiceResponseException e) {
logger.error(String.format("Service returned status code %s: %s\nError details: %s",
e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e);
}

try {
System.out.println("getServiceIdGroup() result:");

// begin-get_service_id_group

GetServiceIdGroupOptions getServiceIdGroupOptions = new GetServiceIdGroupOptions.Builder()
.id(srvIdGroupId)
.build();

Response<ServiceIdGroup> response = identityservice.getServiceIdGroup(getServiceIdGroupOptions).execute();
ServiceIdGroup serviceIdGroup = response.getResult();
srvIdGroupEtag = response.getHeaders().values("Etag").get(0);

System.out.println(serviceIdGroup);

// end-get_service_id_group

} catch (ServiceResponseException e) {
logger.error(String.format("Service returned status code %s: %s\nError details: %s",
e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e);
}

try {
System.out.println("listServiceIdGroup() result:");

// begin-list_service_id_group

ListServiceIdGroupOptions listServiceIdGroupOptions = new ListServiceIdGroupOptions.Builder()
.accountId(accountId)
.build();

Response<ServiceIdGroupList> response = identityservice.listServiceIdGroup(listServiceIdGroupOptions).execute();
ServiceIdGroupList serviceIdGroupList = response.getResult();

System.out.println(serviceIdGroupList);

// end-list_service_id_group

} catch (ServiceResponseException e) {
logger.error(String.format("Service returned status code %s: %s\nError details: %s",
e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e);
}

try {
System.out.println("updateServiceIdGroup() result:");

// begin-update_service_id_group

UpdateServiceIdGroupOptions updateServiceIdGroupOptions = new UpdateServiceIdGroupOptions.Builder()
.id(srvIdGroupId)
.ifMatch(srvIdGroupEtag)
.description("Example ServiceIdGroup updated")
.build();

Response<ServiceIdGroup> response = identityservice.updateServiceIdGroup(updateServiceIdGroupOptions).execute();
ServiceIdGroup serviceIdGroup = response.getResult();

System.out.println(serviceIdGroup);

// end-update_service_id_group

} catch (ServiceResponseException e) {
logger.error(String.format("Service returned status code %s: %s\nError details: %s",
e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e);
}

try {
System.out.println("deleteServiceIdGroup() result:");

// begin-delete_service_id_group

DeleteServiceIdGroupOptions deleteServiceIdGroupOptions = new DeleteServiceIdGroupOptions.Builder()
.id(srvIdGroupId)
.build();

identityservice.deleteServiceIdGroup(deleteServiceIdGroupOptions).execute();

// end-delete_service_id_group

} catch (ServiceResponseException e) {
logger.error(String.format("Service returned status code %s: %s\nError details: %s",
e.getStatusCode(), e.getMessage(), e.getDebuggingInfo()), e);
}

try {
System.out.println("createProfile() result:");

Expand Down
Loading