Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hand-off target upsert #19

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"