(self)
Validate the profile and all payloads are valid.

    Raises:
      ProfileValidationError: the profile data was not valid.
Validate the profile and all payloads are valid.
Validate the profile and all payloads are valid .
def _ValidateProfile(self):
    """Validate the profile and all payloads are valid.

    Raises:
      ProfileValidationError: the profile data was not valid.
    """
    required_keys = [PAYLOADKEYS_DISPLAYNAME,
                     PAYLOADKEYS_IDENTIFIER,
                     PAYLOADKEYS_ORG,
                     PAYLOADKEYS_SCOPE,
                     PAYLOADKEYS_TYPE]
    for key in required_keys:
      if not self.Get(key):
        raise ProfileValidationError('Required key (%s) missing.' % key)

    if not self.Get(PAYLOADKEYS_UUID):
      self.Set(PAYLOADKEYS_UUID, GenerateUUID(self.Get(PAYLOADKEYS_IDENTIFIER)))

    if not self.Get(PAYLOADKEYS_VERSION):
      self.Set(PAYLOADKEYS_VERSION, 1)

    if len(self.Get(PAYLOADKEYS_CONTENT)) < 1:
      raise ProfileValidationError('Profile has no payloads.')
def _ValidateProfile ( self ) : required_keys = [ PAYLOADKEYS_DISPLAYNAME , PAYLOADKEYS_IDENTIFIER , PAYLOADKEYS_ORG , PAYLOADKEYS_SCOPE , PAYLOADKEYS_TYPE ] for key in required_keys : if not self . Get ( key ) : raise ProfileValidationError ( 'Required key (%s) missing.' % key ) if not self . Get ( PAYLOADKEYS_UUID ) : self . Set ( PAYLOADKEYS_UUID , GenerateUUID ( self . Get ( PAYLOADKEYS_IDENTIFIER ) ) ) if not self . Get ( PAYLOADKEYS_VERSION ) : self . Set ( PAYLOADKEYS_VERSION , 1 ) if len ( self . Get ( PAYLOADKEYS_CONTENT ) ) < 1 : raise ProfileValidationError ( 'Profile has no payloads.' )