diff --git a/ignite.go b/ignite.go index 6fc0209..ea84d08 100644 --- a/ignite.go +++ b/ignite.go @@ -33,6 +33,14 @@ func (c ClientCategoryIgniteGateways) Get(ctx context.Context, id string, opts . return &gw, nil } +// Delete is used to delete a gateway by its ID. +func (c ClientCategoryIgniteGateways) Delete(ctx context.Context, id string, opts ...ClientOption) error { + return c.c.do(ctx, clientArgs{ + method: "DELETE", + path: "/ignite/gateways/" + url.PathEscape(id), + }, opts) +} + // Create is used to create a deployment. func (c ClientCategoryIgniteDeployments) Create( ctx context.Context, deployment *types.DeploymentConfig, opts ...ClientOption, diff --git a/ignite_test.go b/ignite_test.go index 162c2f7..9eac7a2 100644 --- a/ignite_test.go +++ b/ignite_test.go @@ -39,6 +39,21 @@ func TestClient_Ignite_Gateways_Get(t *testing.T) { &types.Gateway{ID: "hello"}) } +func TestClient_Ignite_Gateways_Delete(t *testing.T) { + c := &mockClientDoer{ + t: t, + wantMethod: "DELETE", + wantPath: "/ignite/gateways/test%20test", + wantIgnore404: false, + tokenType: "pat", + } + testApiSingleton(c, + &ClientCategoryIgniteGateways{c: c}, + "Delete", + []any{"test test"}, + nil) +} + func TestClient_Ignite_Deployments_Create(t *testing.T) { deploymentConfig := &types.DeploymentConfig{ DeploymentConfigPartial: types.DeploymentConfigPartial{ diff --git a/version.go b/version.go index 6d56d89..e0e479f 100644 --- a/version.go +++ b/version.go @@ -1,4 +1,4 @@ package hop // Version is used to define a tagged version. This will be updated when a new version is released. -const Version = "1.5.0" +const Version = "1.6.0"