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)
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)
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)
class VulnerabilitiesReportMetadataV1Schema(Schema): generated_at = RFC3339DateTime() uuid = fields.Str() generated_by = fields.Dict() @post_load def make(self, data, **kwargs): return VulnerabilitiesReportMetadata(**data)
class VulnerabilityV1Schema(Schema): vulnerability_id = fields.Str() description = fields.Str(allow_none=True, missing=None) severity = fields.Str() link = fields.Str() feed = fields.Str() feed_group = fields.Str() cvss_scores_nvd = fields.List(fields.Nested(CvssCombined.CvssCombinedV1Schema)) cvss_scores_vendor = fields.List( fields.Nested(CvssCombined.CvssCombinedV1Schema) ) created_at = RFC3339DateTime() last_modified = RFC3339DateTime() @post_load def make(self, data, **kwargs): return Vulnerability(**data)
class EventStatusV1Schema(Schema): event_id = fields.Str() event_timestamp = RFC3339DateTime() event_state = fields.Str() @post_load def make(self, data, **kwargs): return EventStatus(**data)
class FixedArtifactV1Schema(Schema): version = fields.Str() wont_fix = fields.Bool() observed_at = RFC3339DateTime() @post_load def make(self, data, **kwargs): return FixedArtifact(**data)
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)
class MatchV1Schema(Schema): detected_at = RFC3339DateTime() @post_load def make(self, data, **kwargs): return Match(**data)
class VulnerabilitiesReportMetadataV1Schema(Schema): generated_at = RFC3339DateTime() uuid = fields.Str() generated_by = fields.Dict()