From f4ca4dbbb41b5e947e858ada30ca021fc002013f Mon Sep 17 00:00:00 2001 From: Zhiwei Liang Date: Thu, 9 Apr 2026 03:33:34 -0400 Subject: [PATCH] Remove v4beta lock usage notes from instances, locks, and nodebalancer files --- instances.go | 1 - locks.go | 8 -------- nodebalancer.go | 1 - 3 files changed, 10 deletions(-) diff --git a/instances.go b/instances.go index 5cf5e18c2..ad222060d 100644 --- a/instances.go +++ b/instances.go @@ -79,7 +79,6 @@ type Instance struct { MaintenancePolicy string `json:"maintenance_policy"` - // NOTE: Locks can only be used with v4beta. Locks []LockType `json:"locks"` } diff --git a/locks.go b/locks.go index 4b6cff0b2..ca1065e7f 100644 --- a/locks.go +++ b/locks.go @@ -5,7 +5,6 @@ import ( ) // LockType represents the type of lock that can be applied to a resource -// NOTE: Locks can only be used with v4beta. type LockType string // LockType enums @@ -15,7 +14,6 @@ const ( ) // LockedEntity represents the entity that is locked -// NOTE: Locks can only be used with v4beta. type LockedEntity struct { ID int `json:"id"` Type EntityType `json:"type"` @@ -24,7 +22,6 @@ type LockedEntity struct { } // Lock represents a resource lock -// NOTE: Locks can only be used with v4beta. type Lock struct { ID int `json:"id"` LockType LockType `json:"lock_type"` @@ -32,7 +29,6 @@ type Lock struct { } // LockCreateOptions fields are those accepted by CreateLock -// NOTE: Locks can only be used with v4beta. type LockCreateOptions struct { EntityType EntityType `json:"entity_type"` EntityID int `json:"entity_id"` @@ -40,26 +36,22 @@ type LockCreateOptions struct { } // ListLocks returns a paginated list of Locks -// NOTE: Locks can only be used with v4beta. func (c *Client) ListLocks(ctx context.Context, opts *ListOptions) ([]Lock, error) { return getPaginatedResults[Lock](ctx, c, "locks", opts) } // GetLock gets a single Lock with the provided ID -// NOTE: Locks can only be used with v4beta. func (c *Client) GetLock(ctx context.Context, lockID int) (*Lock, error) { e := formatAPIPath("locks/%d", lockID) return doGETRequest[Lock](ctx, c, e) } // CreateLock creates a lock for a resource -// NOTE: Locks can only be used with v4beta. func (c *Client) CreateLock(ctx context.Context, opts LockCreateOptions) (*Lock, error) { return doPOSTRequest[Lock](ctx, c, "locks", opts) } // DeleteLock deletes a single Lock with the provided ID -// NOTE: Locks can only be used with v4beta. func (c *Client) DeleteLock(ctx context.Context, lockID int) error { e := formatAPIPath("locks/%d", lockID) return doDELETERequest(ctx, c, e) diff --git a/nodebalancer.go b/nodebalancer.go index 3fe80b1a5..cb30b32fb 100644 --- a/nodebalancer.go +++ b/nodebalancer.go @@ -39,7 +39,6 @@ type NodeBalancer struct { // An array of locks applied to this NodeBalancer for deletion protection. // Locks prevent the NodeBalancer or its subresources from being deleted. - // NOTE: Locks can only be used with v4beta. Locks []LockType `json:"locks"` Created *time.Time `json:"-"`