Skip to content

Commit

Permalink
App struct modification
Browse files Browse the repository at this point in the history
  • Loading branch information
kgibson-spotnana committed Jan 30, 2024
1 parent 3afdb06 commit d3aa5c0
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 61 deletions.
98 changes: 38 additions & 60 deletions app_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,8 @@ import "time"

// AllApps Apps and their attributes
type AllApps []App
type App struct {
ID string `json:"_id,omitempty"`
Name string `json:"name,omitempty"`
CatalogItem any `json:"catalogItem,omitempty"`
DisplayName string `json:"displayName,omitempty"`
DisplayLabel string `json:"displayLabel,omitempty"`
Description string `json:"description,omitempty"`
Color any `json:"color,omitempty"`
Logo struct {
URL string `json:"url,omitempty"`
} `json:"logo,omitempty"`
Provision any `json:"provision,omitempty"`
Sso struct {
Bookmark struct {
URL string `json:"url,omitempty"`
} `json:"bookmark,omitempty"`
Type string `json:"type,omitempty"`
SpErrorFlow bool `json:"spErrorFlow,omitempty"`
Hidden bool `json:"hidden,omitempty"`
Active bool `json:"active,omitempty"`
Beta bool `json:"beta,omitempty"`
URL string `json:"url,omitempty"`
Jit struct {
Supported bool `json:"supported,omitempty"`
Enabled bool `json:"enabled,omitempty"`
} `json:"jit,omitempty"`
} `json:"sso,omitempty"`
Status string `json:"status,omitempty"`
Organization string `json:"organization,omitempty"`
}
type AppDetail struct {
ID string `json:"_id,omitempty"`
Name string `json:"name,omitempty"`
CatalogItem any `json:"catalogItem,omitempty"`
DisplayName string `json:"displayName,omitempty"`
DisplayLabel string `json:"displayLabel,omitempty"`
Description string `json:"description,omitempty"`
Color any `json:"color,omitempty"`
Logo struct {
URL string `json:"url,omitempty"`
} `json:"logo,omitempty"`
Provision any `json:"provision,omitempty"`
Sso struct {
Hidden bool `json:"hidden,omitempty"`
IdpCertificateUpdatedAt time.Time `json:"idpCertificateUpdatedAt,omitempty"`
IdpPrivateKeyUpdatedAt time.Time `json:"idpPrivateKeyUpdatedAt,omitempty"`
IdpCertExpirationAt time.Time `json:"idpCertExpirationAt,omitempty"`
Beta bool `json:"beta,omitempty"`
Type string `json:"type,omitempty"`
URL string `json:"url,omitempty"`
Active bool `json:"active,omitempty"`
CertExpired bool `json:"certExpired,omitempty"`
Jit struct {
Supported bool `json:"supported,omitempty"`
Enabled bool `json:"enabled,omitempty"`
} `json:"jit,omitempty"`
} `json:"sso,omitempty"`
Status string `json:"status,omitempty"`
Organization string `json:"organization,omitempty"`
}

// AppAssociations is the structure of an App Association object
type AppAssociations []struct {
Attributes any `json:"attributes,omitempty"`
To struct {
Expand Down Expand Up @@ -273,3 +215,39 @@ type NewApp struct {
} `json:"sso,omitempty"`
SsoURL string `json:"ssoUrl,omitempty"`
}

// App is the structure of an App object
type App struct {
ID string `json:"_id,omitempty"`
Name string `json:"name,omitempty"`
CatalogItem any `json:"catalogItem,omitempty"`
DisplayName string `json:"displayName,omitempty"`
DisplayLabel string `json:"displayLabel,omitempty"`
Description string `json:"description,omitempty"`
Color any `json:"color,omitempty"`
Logo *Logo `json:"logo,omitempty"`
Provision any `json:"provision,omitempty"`
Sso *Sso `json:"sso,omitempty"`
Status string `json:"status,omitempty"`
Organization string `json:"organization,omitempty"`
}
type Logo struct {
URL string `json:"url,omitempty"`
}
type Bookmark struct {
URL string `json:"url,omitempty"`
}
type Jit struct {
Supported bool `json:"supported,omitempty"`
Enabled bool `json:"enabled,omitempty"`
}
type Sso struct {
Bookmark *Bookmark `json:"bookmark,omitempty"`
Type string `json:"type,omitempty"`
SpErrorFlow bool `json:"spErrorFlow,omitempty"`
Hidden bool `json:"hidden,omitempty"`
Active bool `json:"active,omitempty"`
Beta bool `json:"beta,omitempty"`
URL string `json:"url,omitempty"`
Jit *Jit `json:"jit,omitempty"`
}
2 changes: 1 addition & 1 deletion applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (c *Client) GetAllApplications() (allApplications AllApps, err error) {
}

// GetApplication returns a single application
func (c *Client) GetApplication(appId string) (application AppDetail, err error) {
func (c *Client) GetApplication(appId string) (application App, err error) {
c.HostURL.Path = "/api/v2/applications/" + appId
req, err := http.NewRequest(http.MethodGet, c.HostURL.String(), nil)
req.Header = c.Headers
Expand Down
File renamed without changes.

0 comments on commit d3aa5c0

Please sign in to comment.