> +      }
> +   }
> +
> +   /**
> +    * Create and Update options - extend the domain class, passed to API 
> update and create calls.
> +    * Essentially the same as the domain class. Ensure validation and safe 
> typing.
> +    */
> +   public static class CreateOptions extends Rule {
> +      private CreateOptions(Rule rule) {
> +         super(rule);
> +         checkNotNull(rule.getDirection(), "direction should not be null");
> +         checkNotNull(rule.getSecurityGroupId(), "security group id should 
> not be null");
> +         checkState(rule.getPortRangeMax()>= rule.getPortRangeMin(),
> +               "port range max should be greater than or equal to port range 
> min");
> +         checkState(rule.getRemoteGroupId()==null || 
> rule.getRemoteIpPrefix()==null,
> +               "You can specify either remote_group_id or remote_ip_prefix 
> in the request body.");

Yeah, this is a very good point. I will do a cleanup PR that will include this 
too.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/132/files#r17031208

Reply via email to