forked from digitalocean/godo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AsRequest method on LoadBalancer
Updating a LoadBalancer requires a LoadBalancerRequest, which is not easily creatable from a LoadBalancer. Serializing the LoadBalancer to JSON and then deserializing it to a LoadBalancerRequest mostly works, except that Region is a string on the Request but not on the LB (since the LB returns the entire Region object), so json.Unmarshal returns an error. An explicit AsRequest method makes it easier for consumers of the API to modify existing LoadBalancer objects, and is designed to avoid modifying attributes on the original LoadBalancer when the LoadBalancerRequest is modified.
- Loading branch information
Showing
2 changed files
with
141 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters