Skip to content

Commit

Permalink
Add hand-off target upsert (#19)
Browse files Browse the repository at this point in the history
Closes GRA-430
  • Loading branch information
andrewgarner authored Sep 12, 2024
1 parent e784ec8 commit f7759e9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions hand_off_target_upsert.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package client

import (
"context"
"net/http"
)

type UpsertHandOffTargetParams struct {
// ID is your identifier of choice for this hand-off target. Can be anything consisting
// of letters, numbers, or any of the following characters: `_` `-` `+` `=`.
ID string `json:"id"`

// Name is the hand-off target’s name. This cannot be nil.
Name string `json:"name"`
}

// UpsertHandOffTarget inserts or updates a hand-off target
func (c *Client) UpsertHandOffTarget(ctx context.Context, p *UpsertHandOffTargetParams) error {
rsp, err := c.makeRequest(ctx, http.MethodPost, "hand-off-targets", p)
if err != nil {
return err
}
defer rsp.Body.Close()

if err := responseError(rsp); err != nil {
return err
}
return nil
}
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package client

const version = "0.1.1"
const version = "0.2.0"

0 comments on commit f7759e9

Please sign in to comment.