File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -84,15 +84,9 @@ func (a *Action) Error() error {
8484 return nil
8585}
8686
87- type nilResource struct {}
88-
89- func (nilResource ) pathID () (string , error ) {
90- return "" , nil
91- }
92-
9387// ActionClient is a client for the actions API.
9488type ActionClient struct {
95- action * ResourceActionClient [nilResource ]
89+ action * ResourceActionClient [noopActionSupporter ]
9690}
9791
9892// GetByID retrieves an action by its ID. If the action does not exist, nil is returned.
@@ -212,6 +206,12 @@ type actionSupporter interface {
212206 pathID () (string , error )
213207}
214208
209+ // noopActionSupporter is used by the [ActionClient] to satisfy its underlying
210+ // [ResourceActionClient] generic type.
211+ type noopActionSupporter struct {}
212+
213+ func (noopActionSupporter ) pathID () (string , error ) { return "" , nil }
214+
215215// ListFor returns a paginated list of actions for the given Resource.
216216//
217217// Please note that filters specified in opts are not taken into account
Original file line number Diff line number Diff line change @@ -291,7 +291,7 @@ func NewClient(options ...ClientOption) *Client {
291291 client .handler = assembleHandlerChain (client )
292292
293293 // Cloud API
294- client .Action = ActionClient {action : & ResourceActionClient [nilResource ]{client : client }}
294+ client .Action = ActionClient {action : & ResourceActionClient [noopActionSupporter ]{client : client }}
295295 client .Datacenter = DatacenterClient {client : client }
296296 client .FloatingIP = FloatingIPClient {client : client , Action : & ResourceActionClient [* FloatingIP ]{client : client , resource : "floating_ips" }}
297297 client .Image = ImageClient {client : client , Action : & ResourceActionClient [* Image ]{client : client , resource : "images" }}
You can’t perform that action at this time.
0 commit comments