diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a313c1..3f5d355 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/user.go b/user.go index 100ab24..43e897c 100644 --- a/user.go +++ b/user.go @@ -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. @@ -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 } diff --git a/version.go b/version.go index ff9076c..ed52aac 100644 --- a/version.go +++ b/version.go @@ -1,4 +1,4 @@ package ilert // Version package version -const Version = "v3.7.1" +const Version = "v3.8.0"