| 1 | package Grafeas::V1::Cvss::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 'CVSSVersion', | ||
| 11 | as (Int | Str); | ||
| 12 | |||
| 13 | declare 'CVSSv3', | ||
| 14 | as InstanceOf['Grafeas::V1::Cvss::CVSSv3']; | ||
| 15 | |||
| 16 | coerce 'CVSSv3', | ||
| 17 | from HashRef, via { 'Grafeas::V1::Cvss::CVSSv3'->new($_) }; | ||
| 18 | |||
| 19 | declare 'RepeatedCVSSv3', | ||
| 20 | as ArrayRef[CVSSv3()]; | ||
| 21 | |||
| 22 | coerce 'RepeatedCVSSv3', | ||
| 23 | from ArrayRef[HashRef], via { [ map { 'Grafeas::V1::Cvss::CVSSv3'->new($_) } @$_ ] }; | ||
| 24 | |||
| 25 | declare 'MapStringCVSSv3', | ||
| 26 | as HashRef[CVSSv3()]; | ||
| 27 | |||
| 28 | declare 'AttackVector', | ||
| 29 | as (Int | Str); | ||
| 30 | |||
| 31 | declare 'AttackComplexity', | ||
| 32 | as (Int | Str); | ||
| 33 | |||
| 34 | declare 'PrivilegesRequired', | ||
| 35 | as (Int | Str); | ||
| 36 | |||
| 37 | declare 'UserInteraction', | ||
| 38 | as (Int | Str); | ||
| 39 | |||
| 40 | declare 'Scope', | ||
| 41 | as (Int | Str); | ||
| 42 | |||
| 43 | declare 'Impact', | ||
| 44 | as (Int | Str); | ||
| 45 | |||
| 46 | declare 'CVSS', | ||
| 47 | as InstanceOf['Grafeas::V1::Cvss::CVSS']; | ||
| 48 | |||
| 49 | coerce 'CVSS', | ||
| 50 | from HashRef, via { 'Grafeas::V1::Cvss::CVSS'->new($_) }; | ||
| 51 | |||
| 52 | declare 'RepeatedCVSS', | ||
| 53 | as ArrayRef[CVSS()]; | ||
| 54 | |||
| 55 | coerce 'RepeatedCVSS', | ||
| 56 | from ArrayRef[HashRef], via { [ map { 'Grafeas::V1::Cvss::CVSS'->new($_) } @$_ ] }; | ||
| 57 | |||
| 58 | declare 'MapStringCVSS', | ||
| 59 | as HashRef[CVSS()]; | ||
| 60 | |||
| 61 | declare 'AttackVector', | ||
| 62 | as (Int | Str); | ||
| 63 | |||
| 64 | declare 'AttackComplexity', | ||
| 65 | as (Int | Str); | ||
| 66 | |||
| 67 | declare 'Authentication', | ||
| 68 | as (Int | Str); | ||
| 69 | |||
| 70 | declare 'PrivilegesRequired', | ||
| 71 | as (Int | Str); | ||
| 72 | |||
| 73 | declare 'UserInteraction', | ||
| 74 | as (Int | Str); | ||
| 75 | |||
| 76 | declare 'Scope', | ||
| 77 | as (Int | Str); | ||
| 78 | |||
| 79 | declare 'Impact', | ||
| 80 | as (Int | Str); | ||
| 81 | |||
| 82 | declare 'AttackRequirements', | ||
| 83 | as (Int | Str); | ||
| 84 | |||
| 85 | declare 'ExploitMaturity', | ||
| 86 | as (Int | Str); | ||
| 87 | |||
| 88 | 1; | ||
| 89 | |||
| 90 | __END__ |