Skip to content

Commit

Permalink
ref: convert issue alert frequency to json number
Browse files Browse the repository at this point in the history
  • Loading branch information
jianyuan committed Dec 13, 2023
1 parent b3fa073 commit ce941c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion sentry/issue_alerts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package sentry

import (
"context"
"encoding/json"
"errors"
"fmt"
"time"
Expand All @@ -16,7 +17,7 @@ type IssueAlert struct {
Actions []*IssueAlertAction `json:"actions,omitempty"`
ActionMatch *string `json:"actionMatch,omitempty"`
FilterMatch *string `json:"filterMatch,omitempty"`
Frequency *int `json:"frequency,omitempty"`
Frequency *json.Number `json:"frequency,omitempty"`
Name *string `json:"name,omitempty"`
DateCreated *time.Time `json:"dateCreated,omitempty"`
Owner *string `json:"owner,omitempty"`
Expand Down
16 changes: 8 additions & 8 deletions sentry/issue_alerts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func TestIssueAlertsService_List(t *testing.T) {
ID: String("12345"),
ActionMatch: String("any"),
Environment: String("production"),
Frequency: Int(30),
Frequency: JsonNumber(json.Number("30")),
Name: String("Notify errors"),
Conditions: []*IssueAlertCondition{
{
Expand Down Expand Up @@ -326,7 +326,7 @@ func TestIssueAlertsService_Get(t *testing.T) {
},
ActionMatch: String("any"),
FilterMatch: String("any"),
Frequency: Int(30),
Frequency: JsonNumber(json.Number("30")),
Name: String("My Rule Name"),
DateCreated: Time(mustParseTime("2022-05-23T19:54:30.860115Z")),
Owner: String("team:1322366"),
Expand Down Expand Up @@ -404,7 +404,7 @@ func TestIssueAlertsService_Create(t *testing.T) {
params := &IssueAlert{
ActionMatch: String("all"),
Environment: String("production"),
Frequency: Int(30),
Frequency: JsonNumber(json.Number("30")),
Name: String("Notify errors"),
Conditions: []*IssueAlertCondition{
{
Expand Down Expand Up @@ -433,7 +433,7 @@ func TestIssueAlertsService_Create(t *testing.T) {
ID: String("123456"),
ActionMatch: String("all"),
Environment: String("production"),
Frequency: Int(30),
Frequency: JsonNumber(json.Number("30")),
Name: String("Notify errors"),
Conditions: []*IssueAlertCondition{
{
Expand Down Expand Up @@ -532,7 +532,7 @@ func TestIssueAlertsService_CreateWithAsyncTask(t *testing.T) {
params := &IssueAlert{
ActionMatch: String("all"),
Environment: String("production"),
Frequency: Int(30),
Frequency: JsonNumber(json.Number("30")),
Name: String("Notify errors"),
Conditions: []*IssueAlertCondition{
{
Expand Down Expand Up @@ -561,7 +561,7 @@ func TestIssueAlertsService_CreateWithAsyncTask(t *testing.T) {
ID: String("123456"),
ActionMatch: String("all"),
Environment: String("production"),
Frequency: Int(30),
Frequency: JsonNumber(json.Number("30")),
Name: String("Notify errors"),
Conditions: []*IssueAlertCondition{
{
Expand Down Expand Up @@ -596,7 +596,7 @@ func TestIssueAlertsService_Update(t *testing.T) {
ActionMatch: String("all"),
FilterMatch: String("any"),
Environment: String("staging"),
Frequency: Int(30),
Frequency: JsonNumber(json.Number("30")),
Name: String("Notify errors"),
Conditions: []*IssueAlertCondition{
{
Expand Down Expand Up @@ -709,7 +709,7 @@ func TestIssueAlertsService_Update(t *testing.T) {
ID: String("12345"),
ActionMatch: String("any"),
Environment: String("staging"),
Frequency: Int(30),
Frequency: JsonNumber(json.Number("30")),
Name: String("Notify errors"),
Conditions: []*IssueAlertCondition{
{
Expand Down

0 comments on commit ce941c8

Please sign in to comment.