Skip to content

Commit

Permalink
AppAssociationModifier struct
Browse files Browse the repository at this point in the history
  • Loading branch information
kgibson-spotnana committed Feb 6, 2024
1 parent d3aa5c0 commit 6fc4137
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions app_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,9 @@ type Sso struct {
URL string `json:"url,omitempty"`
Jit *Jit `json:"jit,omitempty"`
}

type AppAssociationModifier struct {
ID string `json:"id,omitempty"`
OP string `json:"op,omitempty"`
Type string `json:"type,omitempty"`
}
8 changes: 4 additions & 4 deletions applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ func (c *Client) GetAllAppAssociations() (allData []map[string]interface{}, err
// AssociateGroupWithApp associates a group with an application
func (c *Client) AssociateGroupWithApp(appId string, groupId string) (err error) {
c.HostURL.Path = "/api/v2/applications/" + appId + "/associations"
j, _ := json.Marshal(map[string]string{
"id": groupId,
"op": "add",
"type": "user_group",
j, _ := json.Marshal(AppAssociationModifier{
ID: groupId,
OP: "add",
Type: "user_group",
})
bodyReader := bytes.NewReader(j)

Expand Down

0 comments on commit 6fc4137

Please sign in to comment.