@@ -77,6 +77,8 @@ protected IamIdentityExamples() {
77
77
private static String apikeyEtag ;
78
78
private static String svcId ;
79
79
private static String svcIdEtag ;
80
+ private static String srvIdGroupId ;
81
+ private static String srvIdGroupEtag ;
80
82
private static String profileId ;
81
83
private static String profileEtag ;
82
84
private static String claimRuleId ;
@@ -465,6 +467,114 @@ public static void main(String[] args) throws Exception {
465
467
e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
466
468
}
467
469
470
+ try {
471
+ System .out .println ("createServiceIdGroup() result:" );
472
+
473
+ // begin-create_service_id_group
474
+
475
+ CreateServiceIdGroupOptions createServiceIdGroupOptions = new CreateServiceIdGroupOptions .Builder ()
476
+ .accountId (accountId )
477
+ .name (serviceIdName )
478
+ .description ("Example ServiceIdGroup" )
479
+ .build ();
480
+
481
+ Response <ServiceIdGroup > response = identityservice .createServiceIdGroup (createServiceIdGroupOptions ).execute ();
482
+ ServiceIdGroup serviceIdGroup = response .getResult ();
483
+ srvIdGroupId = serviceIdGroup .getId ();
484
+
485
+ System .out .println (serviceIdGroup );
486
+
487
+ // end-create_service_id_group
488
+
489
+ } catch (ServiceResponseException e ) {
490
+ logger .error (String .format ("Service returned status code %s: %s\n Error details: %s" ,
491
+ e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
492
+ }
493
+
494
+ try {
495
+ System .out .println ("getServiceIdGroup() result:" );
496
+
497
+ // begin-get_service_id_group
498
+
499
+ GetServiceIdGroupOptions getServiceIdGroupOptions = new GetServiceIdGroupOptions .Builder ()
500
+ .id (srvIdGroupId )
501
+ .build ();
502
+
503
+ Response <ServiceIdGroup > response = identityservice .getServiceIdGroup (getServiceIdGroupOptions ).execute ();
504
+ ServiceIdGroup serviceIdGroup = response .getResult ();
505
+ srvIdGroupEtag = response .getHeaders ().values ("Etag" ).get (0 );
506
+
507
+ System .out .println (serviceIdGroup );
508
+
509
+ // end-get_service_id_group
510
+
511
+ } catch (ServiceResponseException e ) {
512
+ logger .error (String .format ("Service returned status code %s: %s\n Error details: %s" ,
513
+ e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
514
+ }
515
+
516
+ try {
517
+ System .out .println ("listServiceIdGroup() result:" );
518
+
519
+ // begin-list_service_id_group
520
+
521
+ ListServiceIdGroupOptions listServiceIdGroupOptions = new ListServiceIdGroupOptions .Builder ()
522
+ .accountId (accountId )
523
+ .build ();
524
+
525
+ Response <ServiceIdGroupList > response = identityservice .listServiceIdGroup (listServiceIdGroupOptions ).execute ();
526
+ ServiceIdGroupList serviceIdGroupList = response .getResult ();
527
+
528
+ System .out .println (serviceIdGroupList );
529
+
530
+ // end-list_service_id_group
531
+
532
+ } catch (ServiceResponseException e ) {
533
+ logger .error (String .format ("Service returned status code %s: %s\n Error details: %s" ,
534
+ e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
535
+ }
536
+
537
+ try {
538
+ System .out .println ("updateServiceIdGroup() result:" );
539
+
540
+ // begin-update_service_id_group
541
+
542
+ UpdateServiceIdGroupOptions updateServiceIdGroupOptions = new UpdateServiceIdGroupOptions .Builder ()
543
+ .id (srvIdGroupId )
544
+ .ifMatch (srvIdGroupEtag )
545
+ .description ("Example ServiceIdGroup updated" )
546
+ .build ();
547
+
548
+ Response <ServiceIdGroup > response = identityservice .updateServiceIdGroup (updateServiceIdGroupOptions ).execute ();
549
+ ServiceIdGroup serviceIdGroup = response .getResult ();
550
+
551
+ System .out .println (serviceIdGroup );
552
+
553
+ // end-update_service_id_group
554
+
555
+ } catch (ServiceResponseException e ) {
556
+ logger .error (String .format ("Service returned status code %s: %s\n Error details: %s" ,
557
+ e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
558
+ }
559
+
560
+ try {
561
+ System .out .println ("deleteServiceIdGroup() result:" );
562
+
563
+ // begin-delete_service_id_group
564
+
565
+ DeleteServiceIdGroupOptions deleteServiceIdGroupOptions = new DeleteServiceIdGroupOptions .Builder ()
566
+ .id (srvIdGroupId )
567
+ .build ();
568
+
569
+ identityservice .deleteServiceIdGroup (deleteServiceIdGroupOptions ).execute ();
570
+
571
+ // end-delete_service_id_group
572
+
573
+ } catch (ServiceResponseException e ) {
574
+ logger .error (String .format ("Service returned status code %s: %s\n Error details: %s" ,
575
+ e .getStatusCode (), e .getMessage (), e .getDebuggingInfo ()), e );
576
+ }
577
+
468
578
try {
469
579
System .out .println ("createProfile() result:" );
470
580
0 commit comments