Пример #1
0
    class FeedGroupMetadataV1Schema(Schema):
        name = fields.Str()
        created_at = RFC3339DateTime()
        updated_at = RFC3339DateTime()
        last_sync = RFC3339DateTime()
        enabled = fields.Boolean()
        record_count = fields.Integer()

        @post_load
        def make(self, data, **kwargs):
            return FeedGroupMetadata(**data)
Пример #2
0
    class FeedMetadataV1Schema(Schema):
        name = fields.Str()
        created_at = RFC3339DateTime()
        updated_at = RFC3339DateTime()
        last_full_sync = RFC3339DateTime()
        enabled = fields.Boolean()
        groups = fields.List(
            fields.Nested(FeedGroupMetadata.FeedGroupMetadataV1Schema))

        @post_load
        def make(self, data, **kwargs):
            return FeedMetadata(**data)
Пример #3
0
    class ImageV1Schema(Schema):
        id = fields.Str()
        digest = fields.Str()
        user_id = fields.Str()
        state = fields.Str()
        distro_namespace = fields.Str()
        created_at = RFC3339DateTime()
        last_modified = RFC3339DateTime()
        tags = fields.List(fields.Str())

        @post_load
        def make(self, data, **kwargs):
            return Image(**data)
Пример #4
0
    class VulnerabilitiesReportMetadataV1Schema(Schema):
        schema_version = fields.Str()
        generated_at = RFC3339DateTime()
        generated_by = fields.Dict()

        @post_load
        def make(self, data, **kwargs):
            return VulnerabilitiesReportMetadata(**data)
Пример #5
0
    class EventStatusV1Schema(Schema):
        event_id = fields.Str()
        event_timestamp = RFC3339DateTime()
        event_state = fields.Str()

        @post_load
        def make(self, data, **kwargs):
            return EventStatus(**data)
Пример #6
0
    class DistroMappingV1Schema(Schema):
        from_distro = fields.Str()
        to_distro = fields.Str()
        flavor = fields.Str()
        created_at = RFC3339DateTime()

        @post_load
        def make(self, data, **kwargs):
            return DistroMapping(**data)
Пример #7
0
    class FixedArtifactV1Schema(Schema):
        versions = fields.List(fields.Str())
        wont_fix = fields.Bool()
        observed_at = RFC3339DateTime(
            allow_none=True,
            missing=None,
        )
        advisories = fields.List(fields.Nested(Advisory.AdvisoryV1Schema))

        @post_load
        def make(self, data, **kwargs):
            return FixedArtifact(**data)
Пример #8
0
    class MatchV1Schema(Schema):
        detected_at = RFC3339DateTime()

        @post_load
        def make(self, data, **kwargs):
            return Match(**data)