-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: read organization expanded (#1118)
Co-authored-by: David Ragot <[email protected]>
- Loading branch information
Showing
28 changed files
with
1,742 additions
and
524 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
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package organizations | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/formancehq/fctl/membershipclient" | ||
"github.com/pterm/pterm" | ||
) | ||
|
||
func PrintOrganization(store *membershipclient.OrganizationExpanded) error { | ||
pterm.DefaultSection.Println("Organization") | ||
|
||
data := [][]string{ | ||
{"ID", store.Id}, | ||
{"Name", store.Name}, | ||
{"Domain", func() string { | ||
if store.Domain == nil { | ||
return "None" | ||
} | ||
return *store.Domain | ||
}()}, | ||
{"Default Stack Role", func() string { | ||
if store.DefaultStackAccess == nil { | ||
return "None" | ||
} | ||
return string(*store.DefaultStackAccess) | ||
}()}, | ||
{"Default Organization Role", func() string { | ||
if store.DefaultOrganizationAccess == nil { | ||
return "None" | ||
} | ||
return string(*store.DefaultOrganizationAccess) | ||
}()}, | ||
} | ||
|
||
if store.Owner != nil { | ||
data = append(data, []string{"Owner", store.Owner.Email}) | ||
} | ||
|
||
if store.TotalUsers != nil { | ||
data = append(data, []string{"Total Users", strconv.Itoa(int(*store.TotalUsers))}) | ||
} | ||
|
||
if store.TotalStacks != nil { | ||
data = append(data, []string{"Total Stacks", strconv.Itoa(int(*store.TotalStacks))}) | ||
} | ||
|
||
return pterm.DefaultTable.WithHasHeader().WithData(data).Render() | ||
} |
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
Oops, something went wrong.
3cd2343
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs – ./
docs.numary.com
docs-git-main-formance.vercel.app
docs.formance.com
beta.formance.com
developers.numary.com
docs-formance.vercel.app
developers.formance.com