Exemplo n.º 1
0
def KeyValue(vim, *args, **kwargs):
    '''Non-localized key/value pair'''

    obj = vim.client.factory.create('ns0:KeyValue')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 2:
        raise IndexError('Expected at least 3 arguments got: %d' % len(args))

    required = ['key', 'value']
    optional = ['dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
def HostNewNetworkConnectInfo(vim, *args, **kwargs):
    '''Network information for a network that will be added to VirtualCenter when the
    host is added.'''
    
    obj = vim.client.factory.create('ns0:HostNewNetworkConnectInfo')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 1:
        raise IndexError('Expected at least 2 arguments got: %d' % len(args))

    required = [ 'summary' ]
    optional = [ 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj
    
Exemplo n.º 3
0
def VmfsDatastoreInfo(vim, *args, **kwargs):
    '''Information details about a VMFS datastore.'''

    obj = vim.client.factory.create('ns0:VmfsDatastoreInfo')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 4:
        raise IndexError('Expected at least 5 arguments got: %d' % len(args))

    required = ['freeSpace', 'maxFileSize', 'name', 'url']
    optional = ['vmfs', 'timestamp', 'dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 4
0
def ExtensionClientInfo(vim, *args, **kwargs):
    '''This data object type describes a client of the extension.'''

    obj = vim.client.factory.create('ns0:ExtensionClientInfo')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 5:
        raise IndexError('Expected at least 6 arguments got: %d' % len(args))

    required = ['company', 'description', 'type', 'url', 'version']
    optional = ['dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 5
0
def OvfConsumerOvfSection(vim, *args, **kwargs):
    '''A self-contained OVF section'''

    obj = vim.client.factory.create('{urn:vim25}OvfConsumerOvfSection')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 2:
        raise IndexError('Expected at least 3 arguments got: %d' % len(args))

    required = ['lineNumber', 'xml']
    optional = ['dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 6
0
def DvsPortDisconnectedEvent(vim, *args, **kwargs):
    '''A port is disconnected in the distributed virtual switch.'''
    
    obj = vim.client.factory.create('ns0:DvsPortDisconnectedEvent')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 5:
        raise IndexError('Expected at least 6 arguments got: %d' % len(args))

    required = [ 'portKey', 'chainId', 'createdTime', 'key', 'userName' ]
    optional = [ 'connectee', 'changeTag', 'computeResource', 'datacenter', 'ds', 'dvs',
        'fullFormattedMessage', 'host', 'net', 'vm', 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj
    
def ProfileProfileStructure(vim, *args, **kwargs):
    ''''''

    obj = vim.client.factory.create('ns0:ProfileProfileStructure')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 1:
        raise IndexError('Expected at least 2 arguments got: %d' % len(args))

    required = ['profileTypeName']
    optional = ['child', 'dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 8
0
def PerformanceDescription(vim, *args, **kwargs):
    '''Static strings for performance metrics.'''

    obj = vim.client.factory.create('{urn:vim25}PerformanceDescription')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 2:
        raise IndexError('Expected at least 3 arguments got: %d' % len(args))

    required = ['counterType', 'statsType']
    optional = ['dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 9
0
def RoleEventArgument(vim, *args, **kwargs):
    '''The event argument is a Role object.'''

    obj = vim.client.factory.create('{urn:vim25}RoleEventArgument')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 2:
        raise IndexError('Expected at least 3 arguments got: %d' % len(args))

    required = ['name', 'roleId']
    optional = ['dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 10
0
def VirtualSerialPortFileBackingInfo(vim, *args, **kwargs):
    '''The data object provides information for backing a virtual serial port with a
    host file.'''
    
    obj = vim.client.factory.create('ns0:VirtualSerialPortFileBackingInfo')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 1:
        raise IndexError('Expected at least 2 arguments got: %d' % len(args))

    required = [ 'fileName' ]
    optional = [ 'datastore', 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj
    
def VirtualCdromAtapiBackingInfo(vim, *args, **kwargs):
    '''The VirtualCdrom.AtapiBackingInfo data object type represents an ATAPI device
    backing for a virtual CD-ROM.'''
    
    obj = vim.client.factory.create('ns0:VirtualCdromAtapiBackingInfo')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 1:
        raise IndexError('Expected at least 2 arguments got: %d' % len(args))

    required = [ 'deviceName' ]
    optional = [ 'useAutoDetect', 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj
    
Exemplo n.º 12
0
def PowerSystemInfo(vim, *args, **kwargs):
    '''Power System Info data object. Shows current state of power management system.'''

    obj = vim.client.factory.create('ns0:PowerSystemInfo')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 1:
        raise IndexError('Expected at least 2 arguments got: %d' % len(args))

    required = ['currentPolicy']
    optional = ['dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 13
0
def Capability(vim, *args, **kwargs):
    '''A particular product may or may not support certain features. This data object
    indicates whether or not a service instance implements these features. This
    data object type indicates the circumstances under which an operation throws a
    NotSupported fault.Support for some features is indicated by the presence or
    absence of the manager object from the service instance. For example, the
    AlarmManager manager object indicates collecting alarms is supported. Other
    features indicate whether or not a given operation on an object throws a
    NotSupported fault.Some capabilities depend on the host or virtual machine
    version. These are specified by using the vim.host.Capability and
    vim.vm.Capability objects.'''

    obj = vim.client.factory.create('ns0:Capability')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 3:
        raise IndexError('Expected at least 4 arguments got: %d' % len(args))

    required = [
        'multiHostSupported', 'provisioningSupported',
        'userShellAccessSupported'
    ]
    optional = ['supportedEVCMode', 'dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 14
0
def TaskReasonUser(vim, *args, **kwargs):
    '''Indicates that the task was queued by a specific user.'''

    obj = vim.client.factory.create('ns0:TaskReasonUser')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 1:
        raise IndexError('Expected at least 2 arguments got: %d' % len(args))

    required = ['userName']
    optional = ['dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 15
0
def UpdateSet(vim, *args, **kwargs):
    '''A set of updates that represent the changes since a prior call to
    CheckForUpdates, WaitForUpdates, or WaitForUpdatesEx.'''
    
    obj = vim.client.factory.create('ns0:UpdateSet')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 1:
        raise IndexError('Expected at least 2 arguments got: %d' % len(args))

    required = [ 'version' ]
    optional = [ 'filterSet', 'truncated', 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj
    
Exemplo n.º 16
0
def VirtualVmxnet(vim, *args, **kwargs):
    '''The VirtualVmxnet data object type represents an instance of the Vmxnet virtual
    Ethernet adapter attached to a virtual machine.'''

    obj = vim.client.factory.create('{urn:vim25}VirtualVmxnet')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 1:
        raise IndexError('Expected at least 2 arguments got: %d' % len(args))

    required = [ 'key' ]
    optional = [ 'addressType', 'macAddress', 'wakeOnLanEnabled', 'backing', 'connectable',
        'controllerKey', 'deviceInfo', 'unitNumber', 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj
def DrsRuleComplianceEvent(vim, *args, **kwargs):
    '''This event records when a virtual machine comes into compliance with DRS rules.'''
    
    obj = vim.client.factory.create('ns0:DrsRuleComplianceEvent')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 5:
        raise IndexError('Expected at least 6 arguments got: %d' % len(args))

    required = [ 'template', 'chainId', 'createdTime', 'key', 'userName' ]
    optional = [ 'changeTag', 'computeResource', 'datacenter', 'ds', 'dvs',
        'fullFormattedMessage', 'host', 'net', 'vm', 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj
    
Exemplo n.º 18
0
def PerfMetricSeriesCSV(vim, *args, **kwargs):
    '''This data object type represents a PerfMetricSeries encoded in CSV format.'''

    obj = vim.client.factory.create('ns0:PerfMetricSeriesCSV')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 1:
        raise IndexError('Expected at least 2 arguments got: %d' % len(args))

    required = ['id']
    optional = ['value', 'dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
def StorageRequirement(vim, *args, **kwargs):
    '''Describes the storage requirment to perform a consolidation operation.'''

    obj = vim.client.factory.create('{urn:vim25}StorageRequirement')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 2:
        raise IndexError('Expected at least 3 arguments got: %d' % len(args))

    required = ['datastore', 'freeSpaceRequiredInKb']
    optional = ['dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
def EnteringStandbyModeEvent(vim, *args, **kwargs):
    '''This event records that a host has begun the process of entering standby mode.
    All virtual machine operations are blocked, except the following:'''

    obj = vim.client.factory.create('{urn:vim25}EnteringStandbyModeEvent')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 4:
        raise IndexError('Expected at least 5 arguments got: %d' % len(args))

    required = [ 'chainId', 'createdTime', 'key', 'userName' ]
    optional = [ 'changeTag', 'computeResource', 'datacenter', 'ds', 'dvs',
        'fullFormattedMessage', 'host', 'net', 'vm', 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj
def CustomFieldDefRemovedEvent(vim, *args, **kwargs):
    '''This event records the removal of a custom field definition.'''
    
    obj = vim.client.factory.create('ns0:CustomFieldDefRemovedEvent')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 6:
        raise IndexError('Expected at least 7 arguments got: %d' % len(args))

    required = [ 'fieldKey', 'name', 'chainId', 'createdTime', 'key', 'userName' ]
    optional = [ 'changeTag', 'computeResource', 'datacenter', 'ds', 'dvs',
        'fullFormattedMessage', 'host', 'net', 'vm', 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj
    
def VmConfigFileQueryFilter(vim, *args, **kwargs):
    '''The filter for the virtual machine configuration file.'''

    obj = vim.client.factory.create('{urn:vim25}VmConfigFileQueryFilter')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 0:
        raise IndexError('Expected at least 1 arguments got: %d' % len(args))

    required = []
    optional = ['matchConfigVersion', 'dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 23
0
def EvaluationLicenseSource(vim, *args, **kwargs):
    '''Specify an evaluation license source. Feature licensing is not required while
    the remaining hours is greater than zero.'''
    
    obj = vim.client.factory.create('ns0:EvaluationLicenseSource')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 0:
        raise IndexError('Expected at least 1 arguments got: %d' % len(args))

    required = [  ]
    optional = [ 'remainingHours', 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj
    
def DiskChangeExtent(vim, *args, **kwargs):
    '''An area of the disk flagged as modified'''

    obj = vim.client.factory.create('{urn:vim25}DiskChangeExtent')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 2:
        raise IndexError('Expected at least 3 arguments got: %d' % len(args))

    required = ['length', 'start']
    optional = ['dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
def VirtualMachineMksTicket(vim, *args, **kwargs):
    '''This data object contains the information needed to establish an MKS (mouse-
    keyboard-screen) connection to a running virtual machine.'''
    
    obj = vim.client.factory.create('ns0:VirtualMachineMksTicket')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 2:
        raise IndexError('Expected at least 3 arguments got: %d' % len(args))

    required = [ 'cfgFile', 'ticket' ]
    optional = [ 'host', 'port', 'sslThumbprint', 'dynamicProperty', 'dynamicType' ]

    for name, arg in zip(required+optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError("Invalid argument: %s.  Expected one of %s" % (name, ", ".join(required + optional)))

    return obj
    
def HostVirtualSwitchSimpleBridge(vim, *args, **kwargs):
    '''A bridge that is statically bound to a single physical network adapter.'''

    obj = vim.client.factory.create('ns0:HostVirtualSwitchSimpleBridge')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 1:
        raise IndexError('Expected at least 2 arguments got: %d' % len(args))

    required = ['nicDevice']
    optional = ['dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 27
0
def HostFirewallRulesetIpList(vim, *args, **kwargs):
    ''''''

    obj = vim.client.factory.create('ns0:HostFirewallRulesetIpList')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 1:
        raise IndexError('Expected at least 2 arguments got: %d' % len(args))

    required = ['allIp']
    optional = ['ipAddress', 'ipNetwork', 'dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 28
0
def TypeDescription(vim, *args, **kwargs):
    '''Static strings used for describing an object type.'''

    obj = vim.client.factory.create('ns0:TypeDescription')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 3:
        raise IndexError('Expected at least 4 arguments got: %d' % len(args))

    required = ['key', 'label', 'summary']
    optional = ['dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 29
0
def HttpNfcLeaseHostInfo(vim, *args, **kwargs):
    '''Contains information about how to connect to a given host.'''

    obj = vim.client.factory.create('ns0:HttpNfcLeaseHostInfo')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 2:
        raise IndexError('Expected at least 3 arguments got: %d' % len(args))

    required = ['sslThumbprint', 'url']
    optional = ['dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj
Exemplo n.º 30
0
def ProfilePolicy(vim, *args, **kwargs):
    '''The ProfilePolicy data object represents a policy.'''

    obj = vim.client.factory.create('ns0:ProfilePolicy')

    # do some validation checking...
    if (len(args) + len(kwargs)) < 2:
        raise IndexError('Expected at least 3 arguments got: %d' % len(args))

    required = ['id', 'policyOption']
    optional = ['dynamicProperty', 'dynamicType']

    for name, arg in zip(required + optional, args):
        setattr(obj, name, arg)

    for name, value in kwargs.items():
        if name in required + optional:
            setattr(obj, name, value)
        else:
            raise InvalidArgumentError(
                "Invalid argument: %s.  Expected one of %s" %
                (name, ", ".join(required + optional)))

    return obj