Skip to content

Commit

Permalink
add status page search & edit changelog/version
Browse files Browse the repository at this point in the history
  • Loading branch information
STLVRTX committed Sep 4, 2022
1 parent ca1149b commit 0f82065
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 1 deletion.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 04.09.2022, Version 2.1.2

- improve data source search for:
- alert actions
- alert sources
- connectors
- escalation policies
- incident templates
- schedules
- services
- status pages
- teams
- uptime monitors
- users

## 30.08.2022, Version 2.1.1

- add various validation lists to schedule
Expand Down
38 changes: 38 additions & 0 deletions statuspage.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,44 @@ func (c *Client) GetStatusPageSubscribers(input *GetStatusPageSubscribersInput)
return &GetStatusPageSubscribersOutput{Subscribers: subscribers}, nil
}

// SearchStatusPageInput represents the input of a SearchStatusPage operation.
type SearchStatusPageInput struct {
_ struct{}
StatusPageName *string
}

// SearchStatusPageOutput represents the output of a SearchStatusPage operation.
type SearchStatusPageOutput struct {
_ struct{}
StatusPage *StatusPage
}

// SearchStatusPage gets the statusPage with specified name.
func (c *Client) SearchStatusPage(input *SearchStatusPageInput) (*SearchStatusPageOutput, error) {
if input == nil {
return nil, errors.New("input is required")
}
if input.StatusPageName == nil {
return nil, errors.New("status page name is required")
}

resp, err := c.httpClient.R().Get(fmt.Sprintf("%s/name/%s", apiRoutes.statusPages, *input.StatusPageName))
if err != nil {
return nil, err
}
if apiErr := getGenericAPIError(resp, 200); apiErr != nil {
return nil, apiErr
}

statusPage := &StatusPage{}
err = json.Unmarshal(resp.Body(), statusPage)
if err != nil {
return nil, err
}

return &SearchStatusPageOutput{StatusPage: statusPage}, nil
}

// UpdateStatusPageInput represents the input of a UpdateStatusPage operation.
type UpdateStatusPageInput struct {
_ struct{}
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 = "v2.1.1"
const Version = "v2.1.2"

0 comments on commit 0f82065

Please sign in to comment.