| 1 | package Google::Api::Context::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 'Context', | ||
| 11 | as InstanceOf['Google::Api::Context::Context']; | ||
| 12 | |||
| 13 | coerce 'Context', | ||
| 14 | from HashRef, via { 'Google::Api::Context::Context'->new($_) }; | ||
| 15 | |||
| 16 | declare 'RepeatedContext', | ||
| 17 | as ArrayRef[Context()]; | ||
| 18 | |||
| 19 | coerce 'RepeatedContext', | ||
| 20 | from ArrayRef[HashRef], via { [ map { 'Google::Api::Context::Context'->new($_) } @$_ ] }; | ||
| 21 | |||
| 22 | declare 'MapStringContext', | ||
| 23 | as HashRef[Context()]; | ||
| 24 | |||
| 25 | declare 'ContextRule', | ||
| 26 | as InstanceOf['Google::Api::Context::ContextRule']; | ||
| 27 | |||
| 28 | coerce 'ContextRule', | ||
| 29 | from HashRef, via { 'Google::Api::Context::ContextRule'->new($_) }; | ||
| 30 | |||
| 31 | declare 'RepeatedContextRule', | ||
| 32 | as ArrayRef[ContextRule()]; | ||
| 33 | |||
| 34 | coerce 'RepeatedContextRule', | ||
| 35 | from ArrayRef[HashRef], via { [ map { 'Google::Api::Context::ContextRule'->new($_) } @$_ ] }; | ||
| 36 | |||
| 37 | declare 'MapStringContextRule', | ||
| 38 | as HashRef[ContextRule()]; | ||
| 39 | |||
| 40 | 1; | ||
| 41 | |||
| 42 | __END__ |