Skip to content

Commit

Permalink
feat: migrate to new monv2 action api (part 2: phase out dst api) (#138)
Browse files Browse the repository at this point in the history
Co-authored-by: vikram <[email protected]>
  • Loading branch information
obs-gh-owengoebel and vikramraman authored Aug 16, 2024
1 parent 3fc930e commit f5eaade
Show file tree
Hide file tree
Showing 14 changed files with 82 additions and 1,332 deletions.
39 changes: 0 additions & 39 deletions client/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,45 +564,6 @@ func (c *Client) DeleteMonitorV2Action(ctx context.Context, id string) error {
return c.Meta.DeleteMonitorV2Action(ctx, id)
}

func (c *Client) SaveActionWithDestinationLinks(ctx context.Context, actionId string, destinationLinks []meta.ActionDestinationLinkInput) (*meta.MonitorV2Action, error) {
if !c.Flags[flagObs2110] {
c.obs2110.Lock()
defer c.obs2110.Unlock()
}
return c.Meta.SaveActionWithDestinationLinks(ctx, actionId, destinationLinks)
}

func (c *Client) CreateMonitorV2Destination(ctx context.Context, workspaceId string, input *meta.MonitorV2DestinationInput) (*meta.MonitorV2Destination, error) {
if !c.Flags[flagObs2110] {
c.obs2110.Lock()
defer c.obs2110.Unlock()
}
if c.Config.ManagingObjectID != nil {
input.ManagedById = c.Config.ManagingObjectID
}
return c.Meta.CreateMonitorV2Destination(ctx, workspaceId, input)
}

func (c *Client) UpdateMonitorV2Destination(ctx context.Context, id string, input *meta.MonitorV2DestinationInput) (*meta.MonitorV2Destination, error) {
if !c.Flags[flagObs2110] {
c.obs2110.Lock()
defer c.obs2110.Unlock()
}
return c.Meta.UpdateMonitorV2Destination(ctx, id, input)
}

func (c *Client) GetMonitorV2Destination(ctx context.Context, id string) (*meta.MonitorV2Destination, error) {
return c.Meta.GetMonitorV2Destination(ctx, id)
}

func (c *Client) DeleteMonitorV2Destination(ctx context.Context, id string) error {
if !c.Flags[flagObs2110] {
c.obs2110.Lock()
defer c.obs2110.Unlock()
}
return c.Meta.DeleteMonitorV2Destination(ctx, id)
}

func (c *Client) LookupMonitorV2(ctx context.Context, workspaceId *string, nameExact *string) (*meta.MonitorV2, error) {
return c.Meta.LookupMonitorV2(ctx, workspaceId, nameExact)
}
Expand Down
2 changes: 0 additions & 2 deletions client/internal/meta/operation/monitorv2.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,6 @@ query lookupMonitorV2($workspaceId: ObjectId, $folderId: ObjectId, $nameExact: S
}
}

# @genqlient(for: "ActionDestinationLinkInput.sendEndNotifications", omitempty: true)
# @genqlient(for: "ActionDestinationLinkInput.sendRemindersInterval", omitempty: true)
# @genqlient(for: "MonitorV2ActionRuleInput.sendEndNotifications", omitempty: true)
# @genqlient(for: "MonitorV2ActionRuleInput.sendRemindersInterval", omitempty: true)
mutation saveMonitorV2Relations(
Expand Down
39 changes: 1 addition & 38 deletions client/internal/meta/operation/monitorv2_action.graphql
Original file line number Diff line number Diff line change
@@ -1,36 +1,3 @@
fragment MonitorV2WebhookDestination on MonitorV2WebhookDestination {
url
method
}

fragment MonitorV2EmailDestination on MonitorV2EmailDestination {
users
addresses
}

fragment MonitorV2DestinationDefinition on MonitorV2DestinationDefinition {
inline
type
# @genqlient(flatten: true)
email {
...MonitorV2EmailDestination
}
# @genqlient(flatten: true)
webhook {
...MonitorV2WebhookDestination
}
}

fragment ActionDestinationLink on ActionDestinationLink {
destinationID
sendEndNotifications
sendRemindersInterval
# @genqlient(flatten: true)
definition {
...MonitorV2DestinationDefinition
}
}

fragment MonitorV2EmailAction on MonitorV2EmailAction {
users
addresses
Expand Down Expand Up @@ -59,10 +26,6 @@ fragment MonitorV2Action on MonitorV2Action {
inline
type
# @genqlient(flatten: true)
destinationLinks {
...ActionDestinationLink
}
# @genqlient(flatten: true)
email {
...MonitorV2EmailAction
}
Expand Down Expand Up @@ -149,4 +112,4 @@ query searchMonitorV2Action($workspaceId: ObjectId, $folderId: ObjectId, $nameEx
monitorV2Actions: searchMonitorV2Action(workspaceId: $workspaceId, folderId: $folderId, nameExact: $nameExact, nameSubstring: $nameSubstring) {
...MonitorV2ActionSearchResult
}
}
}
80 changes: 0 additions & 80 deletions client/internal/meta/operation/monitorv2_destination.graphql

This file was deleted.

Loading

0 comments on commit f5eaade

Please sign in to comment.