# Path: acos_client/errors.py
# class RequiredAttributeNotSpecified(Exception):
# class ACOSException(Exception):
# class ACOSUnsupportedVersion(ACOSException):
# class ACOSUnknownError(ACOSException):
# class AddressSpecifiedIsInUse(ACOSException):
# class AuthenticationFailure(ACOSException):
# class InvalidSessionID(ACOSException):
# class Exists(ACOSException):
# class NotFound(ACOSException):
# class NoSuchServiceGroup(ACOSException):
# class NotImplemented(ACOSException):
# class InUse(ACOSException):
# class InvalidPartitionParameter(ACOSException):
# class MemoryFault(ACOSException):
# class InvalidParameter(ACOSException):
# class OutOfPartitions(ACOSException):
# class PartitionIdExists(ACOSException):
# class HMMissingHttpPassive(ACOSException):
# class AxapiJsonFormatError(ACOSException):
# class ConfigManagerNotReady(ACOSException):
# class DhcpAcquireFailed(ACOSException):
# class InvalidInteger(ACOSException):
# class CertificateParsingFailed(ACOSException):
# class KeyParsingFailed(ACOSException):
# class FeatureNotSupported(ACOSException):
# class ACOSSystemNotReady(ACOSException):
# class ACOSSystemIsBusy(ACOSException):
# class LicenseOptionNotAllowed(ACOSException):
#     def __init__(self, url, attribute, requires=[]):
#     def __init__(self, code=1, msg=''):
#     def __str__(self):
# 
# Path: acos_client/v30/base.py
# class BaseV30(object):
#     def __init__(self, client):
#     def minimal_dict(self, my_dict, exclude=[]):
#     def url(self, action):
#     def _request(self, method, action, params, retry_count=0, max_retries=None,
#                  timeout=None, axapi_args=None, **kwargs):
#     def _get(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _post(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _put(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _delete(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _is_ipv6(self, ip_address):


from acos_client import errors as acos_errors
from acos_client.v30 import base
                        "used to define a new license: existing_org, "
                        "existing_user, new_user, or name. These cannot "
                        "be used in conjuction.")
        super(MultiLicenseException, self).__init__()


class NewLicense(base.BaseV30):
    url_prefix = '/glm/new-license'

    def create(self, account_name=None, country=None, existing_org=None,
               glm_password=None, last_name=None, name=None, new_email=None,
               new_password=None, new_user=None, org_id=None, phone=None,
               license_type=None, existing_user=None, first_name=None,
               glm_email=None):
        params = {
            "new-license": {}
        }

        xor = bool(existing_org) + bool(existing_user) + bool(new_user) + bool(name)

        if xor > 1:
            raise MultiLicenseException()

        if existing_org:
            params['new-license'] = self.minimal_dict({
                'existing-org': existing_org,
                'org-id': org_id
            })
        elif existing_user:
            if not glm_email:

# Path: acos_client/errors.py
# class RequiredAttributeNotSpecified(Exception):
# class ACOSException(Exception):
# class ACOSUnsupportedVersion(ACOSException):
# class ACOSUnknownError(ACOSException):
# class AddressSpecifiedIsInUse(ACOSException):
# class AuthenticationFailure(ACOSException):
# class InvalidSessionID(ACOSException):
# class Exists(ACOSException):
# class NotFound(ACOSException):
# class NoSuchServiceGroup(ACOSException):
# class NotImplemented(ACOSException):
# class InUse(ACOSException):
# class InvalidPartitionParameter(ACOSException):
# class MemoryFault(ACOSException):
# class InvalidParameter(ACOSException):
# class OutOfPartitions(ACOSException):
# class PartitionIdExists(ACOSException):
# class HMMissingHttpPassive(ACOSException):
# class AxapiJsonFormatError(ACOSException):
# class ConfigManagerNotReady(ACOSException):
# class DhcpAcquireFailed(ACOSException):
# class InvalidInteger(ACOSException):
# class CertificateParsingFailed(ACOSException):
# class KeyParsingFailed(ACOSException):
# class FeatureNotSupported(ACOSException):
# class ACOSSystemNotReady(ACOSException):
# class ACOSSystemIsBusy(ACOSException):
# class LicenseOptionNotAllowed(ACOSException):
#     def __init__(self, url, attribute, requires=[]):
#     def __init__(self, code=1, msg=''):
#     def __str__(self):
# 
# Path: acos_client/v30/base.py
# class BaseV30(object):
#     def __init__(self, client):
#     def minimal_dict(self, my_dict, exclude=[]):
#     def url(self, action):
#     def _request(self, method, action, params, retry_count=0, max_retries=None,
#                  timeout=None, axapi_args=None, **kwargs):
#     def _get(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _post(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _put(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _delete(self, action, params={}, max_retries=None, timeout=None, axapi_args=None, **kwargs):
#     def _is_ipv6(self, ip_address):


# Path: acos_client/v30/glm/license.py
from acos_client import errors as acos_errors
from acos_client.v30 import base

                        "used to define a new license: existing_org, "
                        "existing_user, new_user, or name. These cannot "
                        "be used in conjuction.")
        super(MultiLicenseException, self).__init__()


class NewLicense(base.BaseV30):
    url_prefix = '/glm/new-license'

    def create(self, account_name=None, country=None, existing_org=None,
               glm_password=None, last_name=None, name=None, new_email=None,
               new_password=None, new_user=None, org_id=None, phone=None,
               license_type=None, existing_user=None, first_name=None,
               glm_email=None):
        params = {
            "new-license": {}
        }

        xor = bool(existing_org) + bool(existing_user) + bool(new_user) + bool(name)

        if xor > 1:
            raise MultiLicenseException()

        if existing_org:
            params['new-license'] = self.minimal_dict({
                'existing-org': existing_org,
                'org-id': org_id
            })
        elif existing_user:
            if not glm_email:

                raise acos_errors.RequiredAttributeNotSpecified(