| 1 | package Google::Firestore::Admin::V1::Field::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 'Field', | ||
| 11 | as InstanceOf['Google::Firestore::Admin::V1::Field::Field']; | ||
| 12 | |||
| 13 | coerce 'Field', | ||
| 14 | from HashRef, via { 'Google::Firestore::Admin::V1::Field::Field'->new($_) }; | ||
| 15 | |||
| 16 | declare 'RepeatedField', | ||
| 17 | as ArrayRef[Field()]; | ||
| 18 | |||
| 19 | coerce 'RepeatedField', | ||
| 20 | from ArrayRef[HashRef], via { [ map { 'Google::Firestore::Admin::V1::Field::Field'->new($_) } @$_ ] }; | ||
| 21 | |||
| 22 | declare 'MapStringField', | ||
| 23 | as HashRef[Field()]; | ||
| 24 | |||
| 25 | declare 'IndexConfig', | ||
| 26 | as InstanceOf['Google::Firestore::Admin::V1::Field::Field::IndexConfig']; | ||
| 27 | |||
| 28 | coerce 'IndexConfig', | ||
| 29 | from HashRef, via { 'Google::Firestore::Admin::V1::Field::Field::IndexConfig'->new($_) }; | ||
| 30 | |||
| 31 | declare 'RepeatedIndexConfig', | ||
| 32 | as ArrayRef[IndexConfig()]; | ||
| 33 | |||
| 34 | coerce 'RepeatedIndexConfig', | ||
| 35 | from ArrayRef[HashRef], via { [ map { 'Google::Firestore::Admin::V1::Field::Field::IndexConfig'->new($_) } @$_ ] }; | ||
| 36 | |||
| 37 | declare 'MapStringIndexConfig', | ||
| 38 | as HashRef[IndexConfig()]; | ||
| 39 | |||
| 40 | declare 'TtlConfig', | ||
| 41 | as InstanceOf['Google::Firestore::Admin::V1::Field::Field::TtlConfig']; | ||
| 42 | |||
| 43 | coerce 'TtlConfig', | ||
| 44 | from HashRef, via { 'Google::Firestore::Admin::V1::Field::Field::TtlConfig'->new($_) }; | ||
| 45 | |||
| 46 | declare 'RepeatedTtlConfig', | ||
| 47 | as ArrayRef[TtlConfig()]; | ||
| 48 | |||
| 49 | coerce 'RepeatedTtlConfig', | ||
| 50 | from ArrayRef[HashRef], via { [ map { 'Google::Firestore::Admin::V1::Field::Field::TtlConfig'->new($_) } @$_ ] }; | ||
| 51 | |||
| 52 | declare 'MapStringTtlConfig', | ||
| 53 | as HashRef[TtlConfig()]; | ||
| 54 | |||
| 55 | declare 'State', | ||
| 56 | as (Int | Str); | ||
| 57 | |||
| 58 | 1; | ||
| 59 | |||
| 60 | __END__ |