Skip to content

Commit

Permalink
Merge pull request #40 from iLert/add-send-no-invitation
Browse files Browse the repository at this point in the history
add send-no-invitation option
  • Loading branch information
yacut authored Jul 3, 2024
2 parents f41c46a + 4b237c3 commit c517bc2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 06.05.2024, Version 3.8.0

- add send-no-invitation option to user create api [#40](https://github.com/iLert/ilert-go/pull/40)

## 06.05.2024, Version 3.7.1

- readd removed connector and alert action for microsoft teams simple webhook [#39](https://github.com/iLert/ilert-go/pull/39)
Expand Down
12 changes: 9 additions & 3 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ var UserRoleAll = []string{

// CreateUserInput represents the input of a CreateUser operation.
type CreateUserInput struct {
_ struct{}
User *User
_ struct{}
User *User
SendNoInvitation *bool
}

// CreateUserOutput represents the output of a CreateUser operation.
Expand All @@ -87,7 +88,12 @@ func (c *Client) CreateUser(input *CreateUserInput) (*CreateUserOutput, error) {
return nil, errors.New("user input is required")
}

resp, err := c.httpClient.R().SetBody(input.User).Post(apiRoutes.users)
requestURL := apiRoutes.users
if input.SendNoInvitation != nil {
requestURL = fmt.Sprintf("%s?send-no-invitation=%t", apiRoutes.users, *input.SendNoInvitation)
}

resp, err := c.httpClient.R().SetBody(input.User).Post(requestURL)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ilert

// Version package version
const Version = "v3.7.1"
const Version = "v3.8.0"

0 comments on commit c517bc2

Please sign in to comment.