Skip to content

Commit

Permalink
Fix outdated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
nipunayf committed Aug 13, 2023
1 parent c173a17 commit 04868e1
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions examples/list_groups.bal
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function main() returns error? {

log:printInfo("List groups");

stream<ad:Group, error>|error groupStream = aadClient->listGroups();
if (groupStream is stream<ad:Group, error>) {
stream<ad:Group, error?>|error groupStream = aadClient->listGroups();
if (groupStream is stream<ad:Group, error?>) {
error? e = groupStream.forEach(isolated function(ad:Group item) {
log:printInfo(item.toString());
});
Expand Down
4 changes: 2 additions & 2 deletions examples/list_members_of_group.bal
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function main() returns error? {
log:printInfo("List members in a group");
string groupId = "<GROUP_ID>";

stream<ad:User, error>|error groupStream = aadClient->listGroupMembers(groupId);
if (groupStream is stream<ad:User, error>) {
stream<ad:User, error?>|error groupStream = aadClient->listGroupMembers(groupId);
if (groupStream is stream<ad:User, error?>) {
error? e = groupStream.forEach(isolated function(ad:User item) {
log:printInfo(item.toString());
});
Expand Down
4 changes: 2 additions & 2 deletions examples/list_owners_of_group.bal
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function main() returns error? {
log:printInfo("List owners in a group");
string groupId = "<GROUP_ID>";

stream<ad:User, error>|error groupStream = aadClient->listGroupOwners(groupId);
if (groupStream is stream<ad:User, error>) {
stream<ad:User, error?>|error groupStream = aadClient->listGroupOwners(groupId);
if (groupStream is stream<ad:User, error?>) {
error? e = groupStream.forEach(isolated function(ad:User item) {
log:printInfo(item.toString());
});
Expand Down
4 changes: 2 additions & 2 deletions examples/list_parent_groups.bal
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function main() returns error? {
log:printInfo("List parent groups");
string groupId = "<GROUP_ID>";

stream<ad:Group, error>|error groupStream = aadClient->listParentGroups("group", groupId);
if (groupStream is stream<ad:Group, error>) {
stream<ad:Group, error?>|error groupStream = aadClient->listParentGroups("group", groupId);
if (groupStream is stream<ad:Group, error?>) {
error? e = groupStream.forEach(isolated function(ad:Group item) {
log:printInfo(item.toString());
});
Expand Down
4 changes: 2 additions & 2 deletions examples/list_permission_grants.bal
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function main() returns error? {
log:printInfo("List permission grants");
string groupId = "<GROUP_ID>";

stream<ad:PermissionGrant, error>|error grantStream = aadClient->listPermissionGrants(groupId);
if (grantStream is stream<ad:PermissionGrant, error>) {
stream<ad:PermissionGrant, error?>|error grantStream = aadClient->listPermissionGrants(groupId);
if (grantStream is stream<ad:PermissionGrant, error?>) {
error? e = grantStream.forEach(isolated function(ad:PermissionGrant item) {
log:printInfo(item.toString());
});
Expand Down
4 changes: 2 additions & 2 deletions examples/list_transitive_members.bal
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function main() returns error? {
log:printInfo("List transitive members in a group");
string groupId = "<GROUP_ID>";

stream<ad:User, error>|error groupStream = aadClient->listTransitiveGroupMembers(groupId);
if (groupStream is stream<ad:User, error>) {
stream<ad:User, error?>|error groupStream = aadClient->listTransitiveGroupMembers(groupId);
if (groupStream is stream<ad:User, error?>) {
error? e = groupStream.forEach(isolated function(ad:User item) {
log:printInfo(item.toString());
});
Expand Down
4 changes: 2 additions & 2 deletions examples/list_transitive_parent_groups.bal
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public function main() returns error? {
log:printInfo("List transitive parent groups");
string groupId = "<GROUP_ID>";

stream<ad:Group, error>|error groupStream = aadClient->listTransitiveParentGroups("group", groupId);
if (groupStream is stream<ad:Group, error>) {
stream<ad:Group, error?>|error groupStream = aadClient->listTransitiveParentGroups("group", groupId);
if (groupStream is stream<ad:Group, error?>) {
error? e = groupStream.forEach(isolated function(ad:Group item) {
log:printInfo(item.toString());
});
Expand Down
4 changes: 2 additions & 2 deletions examples/list_users.bal
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function main() returns error? {

log:printInfo("List users");

stream<ad:User, error>|error userStream = aadClient->listUsers();
if (userStream is stream<ad:User, error>) {
stream<ad:User, error?>|error userStream = aadClient->listUsers();
if (userStream is stream<ad:User, error?>) {
error? e = userStream.forEach(isolated function(ad:User item) {
log:printInfo(item.toString());
});
Expand Down

0 comments on commit 04868e1

Please sign in to comment.