MCPcopy Create free account
hub / github.com/auth0/auth0-cli / makeOrganizationView

Function makeOrganizationView

internal/display/organizations.go:79–109  ·  view source on GitHub ↗
(organization *management.Organization)

Source from the content-addressed store, hash-verified

77}
78
79func makeOrganizationView(organization *management.Organization) *organizationView {
80 accentColor := ""
81 backgroundColor := ""
82
83 if organization.Branding != nil && organization.Branding.Colors != nil {
84 if len(organization.Branding.GetColors()["primary"]) > 0 {
85 accentColor = organization.Branding.GetColors()["primary"]
86 }
87
88 if len(organization.Branding.GetColors()["page_background"]) > 0 {
89 backgroundColor = organization.Branding.GetColors()["page_background"]
90 }
91 }
92
93 metadata := ""
94 buf, err := json.MarshalIndent(organization.Metadata, "", " ")
95 if err == nil {
96 metadata = string(buf)
97 }
98
99 return &organizationView{
100 ID: organization.GetID(),
101 Name: organization.GetName(),
102 DisplayName: organization.GetDisplayName(),
103 LogoURL: organization.GetBranding().GetLogoURL(),
104 AccentColor: accentColor,
105 BackgroundColor: backgroundColor,
106 Metadata: ansi.ColorizeJSON(metadata),
107 raw: organization,
108 }
109}

Callers 4

OrganizationListMethod · 0.85
OrganizationShowMethod · 0.85
OrganizationCreateMethod · 0.85
OrganizationUpdateMethod · 0.85

Calls 2

ColorizeJSONFunction · 0.92
GetNameMethod · 0.65

Tested by

no test coverage detected