> +import org.jclouds.softlayer.domain.VirtualGuest;
> +import org.jclouds.softlayer.domain.VirtualGuestBlockDevice;
> +
> +import javax.inject.Inject;
> +import java.util.HashSet;
> +import java.util.Set;
> +
> +import static com.google.common.base.Preconditions.checkNotNull;
> +
> +/**
> + * Converts a VirtualGuest into a json string valid for creating a CCI via
> softlayer api
> + * The string is set into the payload of the HttpRequest
> + *
> + * @author Andrea Turli
> + */
> +public class VirtualGuestToJson implements Binder {
This binding is only used when creating a `VirtualGuest`, to bind the
VirtualGuest parameter to the request body.
The VirtualGuest object, however, has many fields that are not required in the
create operation and the binder just extracts the required fields, populates
them into a "smaller" object, and then binds it to the request body.
This approach seems a bit confusing, as it might be difficult for users to know
which fields of the VirtualGuest object have to be populated in order to create
it. Could the api method be refactored to directly receive the `ObjectData`
(perhaps renamed to VirtualGuestCreation or similar) instead of the entire
VirtualGuest? WDYT?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/296/files#r10275204