| 1 | package Google::Backstory::Entity::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 'EntityMetadata', | ||
| 11 | as InstanceOf['Google::Backstory::Entity::EntityMetadata']; | ||
| 12 | |||
| 13 | coerce 'EntityMetadata', | ||
| 14 | from HashRef, via { 'Google::Backstory::Entity::EntityMetadata'->new($_) }; | ||
| 15 | |||
| 16 | declare 'RepeatedEntityMetadata', | ||
| 17 | as ArrayRef[EntityMetadata()]; | ||
| 18 | |||
| 19 | coerce 'RepeatedEntityMetadata', | ||
| 20 | from ArrayRef[HashRef], via { [ map { 'Google::Backstory::Entity::EntityMetadata'->new($_) } @$_ ] }; | ||
| 21 | |||
| 22 | declare 'MapStringEntityMetadata', | ||
| 23 | as HashRef[EntityMetadata()]; | ||
| 24 | |||
| 25 | declare 'EntityType', | ||
| 26 | as (Int | Str); | ||
| 27 | |||
| 28 | declare 'SourceType', | ||
| 29 | as (Int | Str); | ||
| 30 | |||
| 31 | declare 'AtiPrioritization', | ||
| 32 | as InstanceOf['Google::Backstory::Entity::AtiPrioritization']; | ||
| 33 | |||
| 34 | coerce 'AtiPrioritization', | ||
| 35 | from HashRef, via { 'Google::Backstory::Entity::AtiPrioritization'->new($_) }; | ||
| 36 | |||
| 37 | declare 'RepeatedAtiPrioritization', | ||
| 38 | as ArrayRef[AtiPrioritization()]; | ||
| 39 | |||
| 40 | coerce 'RepeatedAtiPrioritization', | ||
| 41 | from ArrayRef[HashRef], via { [ map { 'Google::Backstory::Entity::AtiPrioritization'->new($_) } @$_ ] }; | ||
| 42 | |||
| 43 | declare 'MapStringAtiPrioritization', | ||
| 44 | as HashRef[AtiPrioritization()]; | ||
| 45 | |||
| 46 | declare 'Entity', | ||
| 47 | as InstanceOf['Google::Backstory::Entity::Entity']; | ||
| 48 | |||
| 49 | coerce 'Entity', | ||
| 50 | from HashRef, via { 'Google::Backstory::Entity::Entity'->new($_) }; | ||
| 51 | |||
| 52 | declare 'RepeatedEntity', | ||
| 53 | as ArrayRef[Entity()]; | ||
| 54 | |||
| 55 | coerce 'RepeatedEntity', | ||
| 56 | from ArrayRef[HashRef], via { [ map { 'Google::Backstory::Entity::Entity'->new($_) } @$_ ] }; | ||
| 57 | |||
| 58 | declare 'MapStringEntity', | ||
| 59 | as HashRef[Entity()]; | ||
| 60 | |||
| 61 | declare 'Relation', | ||
| 62 | as InstanceOf['Google::Backstory::Entity::Relation']; | ||
| 63 | |||
| 64 | coerce 'Relation', | ||
| 65 | from HashRef, via { 'Google::Backstory::Entity::Relation'->new($_) }; | ||
| 66 | |||
| 67 | declare 'RepeatedRelation', | ||
| 68 | as ArrayRef[Relation()]; | ||
| 69 | |||
| 70 | coerce 'RepeatedRelation', | ||
| 71 | from ArrayRef[HashRef], via { [ map { 'Google::Backstory::Entity::Relation'->new($_) } @$_ ] }; | ||
| 72 | |||
| 73 | declare 'MapStringRelation', | ||
| 74 | as HashRef[Relation()]; | ||
| 75 | |||
| 76 | declare 'Relationship', | ||
| 77 | as (Int | Str); | ||
| 78 | |||
| 79 | declare 'Directionality', | ||
| 80 | as (Int | Str); | ||
| 81 | |||
| 82 | declare 'EntityLabel', | ||
| 83 | as (Int | Str); | ||
| 84 | |||
| 85 | declare 'Metric', | ||
| 86 | as InstanceOf['Google::Backstory::Entity::Metric']; | ||
| 87 | |||
| 88 | coerce 'Metric', | ||
| 89 | from HashRef, via { 'Google::Backstory::Entity::Metric'->new($_) }; | ||
| 90 | |||
| 91 | declare 'RepeatedMetric', | ||
| 92 | as ArrayRef[Metric()]; | ||
| 93 | |||
| 94 | coerce 'RepeatedMetric', | ||
| 95 | from ArrayRef[HashRef], via { [ map { 'Google::Backstory::Entity::Metric'->new($_) } @$_ ] }; | ||
| 96 | |||
| 97 | declare 'MapStringMetric', | ||
| 98 | as HashRef[Metric()]; | ||
| 99 | |||
| 100 | declare 'AggregateFunction', | ||
| 101 | as (Int | Str); | ||
| 102 | |||
| 103 | declare 'MetricName', | ||
| 104 | as (Int | Str); | ||
| 105 | |||
| 106 | declare 'Dimension', | ||
| 107 | as (Int | Str); | ||
| 108 | |||
| 109 | declare 'Measure', | ||
| 110 | as InstanceOf['Google::Backstory::Entity::Metric::Measure']; | ||
| 111 | |||
| 112 | coerce 'Measure', | ||
| 113 | from HashRef, via { 'Google::Backstory::Entity::Metric::Measure'->new($_) }; | ||
| 114 | |||
| 115 | declare 'RepeatedMeasure', | ||
| 116 | as ArrayRef[Measure()]; | ||
| 117 | |||
| 118 | coerce 'RepeatedMeasure', | ||
| 119 | from ArrayRef[HashRef], via { [ map { 'Google::Backstory::Entity::Metric::Measure'->new($_) } @$_ ] }; | ||
| 120 | |||
| 121 | declare 'MapStringMeasure', | ||
| 122 | as HashRef[Measure()]; | ||
| 123 | |||
| 124 | 1; | ||
| 125 | |||
| 126 | __END__ |