- Archive - Archive a connection
- Create - Create a connection
- Delete - Delete a connection
- Get - Get a single connection
- Pause - Pause a connection
- Unarchive - Unarchive a connection
- Unpause - Unpause a connection
- Update - Update a connection
Archive a connection
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
id := "esse"
ctx := context.Background()
res, err := s.Connection.Archive(ctx, id)
if err != nil {
log.Fatal(err)
}
if res.Connection != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
id |
string | ✔️ | N/A |
*operations.ArchiveConnectionResponse, error
Create a connection
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
ctx := context.Background()
res, err := s.Connection.Create(ctx, operations.CreateConnectionRequestBody{
Destination: &operations.CreateConnectionRequestBodyDestination{
AuthMethod: &shared.APIKey{
Config: &shared.DestinationAuthMethodAPIKeyConfig{
APIKey: "porro",
Key: "dolorum",
To: shared.DestinationAuthMethodAPIKeyConfigToHeader.ToPointer(),
},
Type: shared.APIKeyTypeAPIKey,
},
CliPath: hookdeck.String("nam"),
HTTPMethod: shared.DestinationHTTPMethodPut.ToPointer(),
Name: "Wayne Lind",
PathForwardingDisabled: hookdeck.Bool(false),
RateLimit: hookdeck.Int64(105907),
RateLimitPeriod: operations.CreateConnectionRequestBodyDestinationRateLimitPeriodMinute.ToPointer(),
URL: hookdeck.String("molestiae"),
},
DestinationID: hookdeck.String("modi"),
Name: "Krista Rippin",
Rules: []interface{}{
shared.RetryRule{
Count: hookdeck.Int64(18789),
Interval: hookdeck.Int64(324141),
Strategy: shared.RetryStrategyExponential,
Type: shared.RetryRuleTypeRetry,
},
shared.RetryRule{
Count: hookdeck.Int64(612096),
Interval: hookdeck.Int64(222321),
Strategy: shared.RetryStrategyExponential,
Type: shared.RetryRuleTypeRetry,
},
shared.AlertRule{
Strategy: shared.AlertStrategyLastAttempt,
Type: shared.AlertRuleTypeAlert,
},
},
Ruleset: &operations.CreateConnectionRequestBodyRuleset{
IsTeamDefault: hookdeck.Bool(false),
Name: "Wilbur Kirlin",
Rules: []interface{}{
shared.DelayRule{
Delay: 697631,
Type: shared.DelayRuleTypeDelay,
},
shared.RetryRule{
Count: hookdeck.Int64(60225),
Interval: hookdeck.Int64(969810),
Strategy: shared.RetryStrategyExponential,
Type: shared.RetryRuleTypeRetry,
},
},
},
RulesetID: hookdeck.String("mollitia"),
Source: &operations.CreateConnectionRequestBodySource{
AllowedHTTPMethods: []shared.SourceAllowedHTTPMethod{
shared.SourceAllowedHTTPMethodGet,
shared.SourceAllowedHTTPMethodPost,
shared.SourceAllowedHTTPMethodPost,
},
CustomResponse: &shared.SourceCustomResponse{
Body: "explicabo",
ContentType: shared.SourceCustomResponseContentTypeXML,
},
Name: "Guadalupe Hickle",
},
SourceID: hookdeck.String("accusantium"),
})
if err != nil {
log.Fatal(err)
}
if res.Connection != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
request |
operations.CreateConnectionRequestBody | ✔️ | The request object to use for the request. |
*operations.CreateConnectionResponse, error
Delete a connection
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
id := "iure"
ctx := context.Background()
res, err := s.Connection.Delete(ctx, id)
if err != nil {
log.Fatal(err)
}
if res.DeleteConnection200ApplicationJSONObject != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
id |
string | ✔️ | N/A |
*operations.DeleteConnectionResponse, error
Get a single connection
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
id := "culpa"
ctx := context.Background()
res, err := s.Connection.Get(ctx, id)
if err != nil {
log.Fatal(err)
}
if res.Connection != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
id |
string | ✔️ | N/A |
*operations.GetConnectionResponse, error
Pause a connection
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
id := "doloribus"
ctx := context.Background()
res, err := s.Connection.Pause(ctx, id)
if err != nil {
log.Fatal(err)
}
if res.Connection != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
id |
string | ✔️ | N/A |
*operations.PauseConnectionResponse, error
Unarchive a connection
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
id := "sapiente"
ctx := context.Background()
res, err := s.Connection.Unarchive(ctx, id)
if err != nil {
log.Fatal(err)
}
if res.Connection != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
id |
string | ✔️ | N/A |
*operations.UnarchiveConnectionResponse, error
Unpause a connection
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
id := "architecto"
ctx := context.Background()
res, err := s.Connection.Unpause(ctx, id)
if err != nil {
log.Fatal(err)
}
if res.Connection != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
id |
string | ✔️ | N/A |
*operations.UnpauseConnectionResponse, error
Update a connection
package main
import(
"context"
"log"
"github.com/speakeasy-sdks/hookdeck-go"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)
func main() {
s := hookdeck.New(
hookdeck.WithSecurity(shared.Security{
BasicAuth: &shared.SchemeBasicAuth{
Password: "",
Username: "",
},
}),
)
requestBody := operations.UpdateConnectionRequestBody{
Name: hookdeck.String("Mike Nicolas"),
Rules: []interface{}{
shared.FilterRule{
Body: &shared.ConnectionFilterProperty{},
Headers: &shared.ConnectionFilterProperty{},
Path: &shared.ConnectionFilterProperty{},
Query: &shared.ConnectionFilterProperty{},
Type: shared.FilterRuleTypeFilter,
},
shared.AlertRule{
Strategy: shared.AlertStrategyEachAttempt,
Type: shared.AlertRuleTypeAlert,
},
shared.FilterRule{
Body: &shared.ConnectionFilterProperty{},
Headers: &shared.ConnectionFilterProperty{},
Path: &shared.ConnectionFilterProperty{},
Query: &shared.ConnectionFilterProperty{},
Type: shared.FilterRuleTypeFilter,
},
},
Ruleset: &operations.UpdateConnectionRequestBodyRuleset{
IsTeamDefault: hookdeck.Bool(false),
Name: "Shannon Mueller",
Rules: []interface{}{
shared.TransformFull{
Transformation: &shared.TransformFullTransformation{
Code: "enim",
Env: map[string]string{
"quo": "sequi",
},
Name: "Vernon Ondricka Sr.",
},
TransformationID: hookdeck.String("error"),
Type: shared.TransformFullTypeTransform,
},
},
},
RulesetID: hookdeck.String("temporibus"),
}
id := "laborum"
ctx := context.Background()
res, err := s.Connection.Update(ctx, requestBody, id)
if err != nil {
log.Fatal(err)
}
if res.Connection != nil {
// handle response
}
}
Parameter | Type | Required | Description |
---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. |
requestBody |
operations.UpdateConnectionRequestBody | ✔️ | N/A |
id |
string | ✔️ | N/A |