| 1 | package Grafeas::V1::Risk::Types; | ||
| 2 | |||
| 3 | use strict; | ||
| 4 | use warnings; | ||
| 5 | |||
| 6 | use Type::Library -base; | ||
| 7 | use Type::Utils -all; | ||
| 8 | use Types::Standard -types; | ||
| 9 | |||
| 10 | declare 'Risk', | ||
| 11 | as InstanceOf['Grafeas::V1::Risk::Risk']; | ||
| 12 | |||
| 13 | coerce 'Risk', | ||
| 14 | from HashRef, via { 'Grafeas::V1::Risk::Risk'->new($_) }; | ||
| 15 | |||
| 16 | declare 'RepeatedRisk', | ||
| 17 | as ArrayRef[Risk()]; | ||
| 18 | |||
| 19 | coerce 'RepeatedRisk', | ||
| 20 | from ArrayRef[HashRef], via { [ map { 'Grafeas::V1::Risk::Risk'->new($_) } @$_ ] }; | ||
| 21 | |||
| 22 | declare 'MapStringRisk', | ||
| 23 | as HashRef[Risk()]; | ||
| 24 | |||
| 25 | declare 'CISAKnownExploitedVulnerabilities', | ||
| 26 | as InstanceOf['Grafeas::V1::Risk::CISAKnownExploitedVulnerabilities']; | ||
| 27 | |||
| 28 | coerce 'CISAKnownExploitedVulnerabilities', | ||
| 29 | from HashRef, via { 'Grafeas::V1::Risk::CISAKnownExploitedVulnerabilities'->new($_) }; | ||
| 30 | |||
| 31 | declare 'RepeatedCISAKnownExploitedVulnerabilities', | ||
| 32 | as ArrayRef[CISAKnownExploitedVulnerabilities()]; | ||
| 33 | |||
| 34 | coerce 'RepeatedCISAKnownExploitedVulnerabilities', | ||
| 35 | from ArrayRef[HashRef], via { [ map { 'Grafeas::V1::Risk::CISAKnownExploitedVulnerabilities'->new($_) } @$_ ] }; | ||
| 36 | |||
| 37 | declare 'MapStringCISAKnownExploitedVulnerabilities', | ||
| 38 | as HashRef[CISAKnownExploitedVulnerabilities()]; | ||
| 39 | |||
| 40 | declare 'ExploitPredictionScoringSystem', | ||
| 41 | as InstanceOf['Grafeas::V1::Risk::ExploitPredictionScoringSystem']; | ||
| 42 | |||
| 43 | coerce 'ExploitPredictionScoringSystem', | ||
| 44 | from HashRef, via { 'Grafeas::V1::Risk::ExploitPredictionScoringSystem'->new($_) }; | ||
| 45 | |||
| 46 | declare 'RepeatedExploitPredictionScoringSystem', | ||
| 47 | as ArrayRef[ExploitPredictionScoringSystem()]; | ||
| 48 | |||
| 49 | coerce 'RepeatedExploitPredictionScoringSystem', | ||
| 50 | from ArrayRef[HashRef], via { [ map { 'Grafeas::V1::Risk::ExploitPredictionScoringSystem'->new($_) } @$_ ] }; | ||
| 51 | |||
| 52 | declare 'MapStringExploitPredictionScoringSystem', | ||
| 53 | as HashRef[ExploitPredictionScoringSystem()]; | ||
| 54 | |||
| 55 | 1; | ||
| 56 | |||
| 57 | __END__ |