Esempio n. 1
0
    def from_obj(cls, cls_obj):
        if not cls_obj:
            return None

        obj = super(VocabString, cls).from_obj(cls_obj)
        obj.value = denormalize_from_xml(value=cls_obj.valueOf_, delimiter=obj.delimiter)
        return obj
Esempio n. 2
0
    def from_obj(cls, cls_obj):
        if not cls_obj:
            return None

        obj = super(VocabString, cls).from_obj(cls_obj)
        obj.value = denormalize_from_xml(value=cls_obj.valueOf_, delimiter=obj.delimiter)
        return obj
Esempio n. 3
0
    def from_obj(cls, cls_obj):
        # Use the subclass this was called on to initialize the object

        if not cls_obj:
            return None

        # split delimited values now, before converting from bindings object to API object
        cls_obj.valueOf_ = denormalize_from_xml(cls_obj.valueOf_, cls_obj.delimiter)
        attr = super(BaseProperty, cls).from_obj(cls_obj)
        attr.datatype = cls_obj.datatype or cls.default_datatype
        return attr
Esempio n. 4
0
    def from_obj(cls, cls_obj):
        # Use the subclass this was called on to initialize the object

        if not cls_obj:
            return None

        # split delimited values now, before converting from bindings object to API object
        cls_obj.valueOf_ = denormalize_from_xml(cls_obj.valueOf_, cls_obj.delimiter)
        attr = super(BaseProperty, cls).from_obj(cls_obj)
        attr.datatype = cls_obj.datatype or cls.default_datatype
        return attr
    def _populate_from_obj(self, attr_obj):
        self.value = denormalize_from_xml(attr_obj.get_valueOf_())

        self.id_ = attr_obj.get_id()
        self.idref = attr_obj.get_idref()
        self.datatype = attr_obj.get_datatype()
        self.appears_random = attr_obj.get_appears_random()
        self.is_obfuscated = attr_obj.get_is_obfuscated()
        self.obfuscation_algorithm_ref = attr_obj.get_obfuscation_algorithm_ref()
        self.is_defanged = attr_obj.get_is_defanged()
        self.defanging_algorithm_ref = attr_obj.get_defanging_algorithm_ref()
        self.refanging_transform_type = attr_obj.get_refanging_transform_type()
        self.refanging_transform = attr_obj.get_refanging_transform()

        PatternFieldGroup.from_obj(attr_obj, self)
Esempio n. 6
0
    def from_obj(cls, vocab_obj):
        if not vocab_obj:
            return None

        vocab_str = cls()
        # xsi_type should be set automatically by the class's constructor.

        vocab_str.value = denormalize_from_xml(vocab_obj.get_valueOf_())
        vocab_str.vocab_name = vocab_obj.get_vocab_name()
        vocab_str.vocab_reference = vocab_obj.get_vocab_reference()
        vocab_str.xsi_type = vocab_obj.get_xsi_type()

        PatternFieldGroup.from_obj(vocab_obj, vocab_str)

        return vocab_str
Esempio n. 7
0
    def _populate_from_obj(self, attr_obj):
        self.value = denormalize_from_xml(attr_obj.get_valueOf_())

        self.id_ = attr_obj.get_id()
        self.idref = attr_obj.get_idref()
        self.datatype = attr_obj.get_datatype()
        self.appears_random = attr_obj.get_appears_random()
        self.is_obfuscated = attr_obj.get_is_obfuscated()
        self.obfuscation_algorithm_ref = attr_obj.get_obfuscation_algorithm_ref()
        self.is_defanged = attr_obj.get_is_defanged()
        self.defanging_algorithm_ref = attr_obj.get_defanging_algorithm_ref()
        self.refanging_transform_type = attr_obj.get_refanging_transform_type()
        self.refanging_transform = attr_obj.get_refanging_transform()
        self.observed_encoding = attr_obj.get_observed_encoding()
        
        PatternFieldGroup.from_obj(attr_obj, self)
Esempio n. 8
0
    def _populate_from_obj(self, attr_obj):

        self.id_ = attr_obj.id
        self.idref = attr_obj.idref
        self.datatype = attr_obj.datatype
        self.appears_random = attr_obj.appears_random
        self.is_obfuscated = attr_obj.is_obfuscated
        self.obfuscation_algorithm_ref = attr_obj.obfuscation_algorithm_ref
        self.is_defanged = attr_obj.is_defanged
        self.defanging_algorithm_ref = attr_obj.defanging_algorithm_ref
        self.refanging_transform_type = attr_obj.refanging_transform_type
        self.refanging_transform = attr_obj.refanging_transform
        self.observed_encoding = attr_obj.observed_encoding

        PatternFieldGroup.from_obj(attr_obj, self)

        # We need to check for a non-default delimiter before trying to parse
        # the value.
        self.value = denormalize_from_xml(attr_obj.valueOf_, self.delimiter)
Esempio n. 9
0
    def from_obj(cls, vocab_obj):
        if not vocab_obj:
            return None

        vocab_str = cls()
        # xsi_type should be set automatically by the class's constructor.

        vocab_str.vocab_name = vocab_obj.vocab_name
        vocab_str.vocab_reference = vocab_obj.vocab_reference
        vocab_str.xsi_type = vocab_obj.xsi_type

        PatternFieldGroup.from_obj(vocab_obj, vocab_str)

        # We need to check for a non-default delimiter before trying to parse
        # the value.
        vocab_str.value = denormalize_from_xml(vocab_obj.valueOf_,
                                               vocab_str.delimiter)

        return vocab_str
Esempio n. 10
0
    def _populate_from_obj(self, attr_obj):

        self.id_ = attr_obj.id
        self.idref = attr_obj.idref
        self.datatype = attr_obj.datatype
        self.appears_random = attr_obj.appears_random
        self.is_obfuscated = attr_obj.is_obfuscated
        self.obfuscation_algorithm_ref = attr_obj.obfuscation_algorithm_ref
        self.is_defanged = attr_obj.is_defanged
        self.defanging_algorithm_ref = attr_obj.defanging_algorithm_ref
        self.refanging_transform_type = attr_obj.refanging_transform_type
        self.refanging_transform = attr_obj.refanging_transform
        self.observed_encoding = attr_obj.observed_encoding

        PatternFieldGroup.from_obj(attr_obj, self)

        # We need to check for a non-default delimiter before trying to parse
        # the value.
        self.value = denormalize_from_xml(attr_obj.valueOf_,
                                          self.delimiter)
Esempio n. 11
0
    def from_obj(cls, vocab_obj, return_obj=None):
        if not vocab_obj:
            return None

        if not return_obj:
            klass = VocabString.lookup_class(vocab_obj.xsi_type)
            return_obj = klass()

        # xsi_type should be set automatically by the class's constructor.

        return_obj.vocab_name = vocab_obj.vocab_name
        return_obj.vocab_reference = vocab_obj.vocab_reference
        return_obj.xsi_type = vocab_obj.xsi_type

        PatternFieldGroup.from_obj(vocab_obj, return_obj)

        # We need to check for a non-default delimiter before trying to parse
        # the value.
        return_obj.value = denormalize_from_xml(value=vocab_obj.valueOf_,
                                                delimiter=return_obj.delimiter)

        return return_obj
Esempio n. 12
0
    def from_obj(cls, vocab_obj, return_obj=None):
        if not vocab_obj:
            return None

        if not return_obj:
            klass = VocabString.lookup_class(vocab_obj.xsi_type)
            return_obj = klass()

        # xsi_type should be set automatically by the class's constructor.

        return_obj.vocab_name = vocab_obj.vocab_name
        return_obj.vocab_reference = vocab_obj.vocab_reference
        return_obj.xsi_type = vocab_obj.xsi_type

        PatternFieldGroup.from_obj(vocab_obj, return_obj)

        # We need to check for a non-default delimiter before trying to parse
        # the value.
        return_obj.value = denormalize_from_xml(
            value=vocab_obj.valueOf_,
            delimiter=return_obj.delimiter
        )

        return return_obj