| 1 | package Google::Datastore::V1beta3::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 'PartitionId', | ||
| 11 | as InstanceOf['Google::Datastore::V1beta3::Entity::PartitionId']; | ||
| 12 | |||
| 13 | coerce 'PartitionId', | ||
| 14 | from HashRef, via { 'Google::Datastore::V1beta3::Entity::PartitionId'->new($_) }; | ||
| 15 | |||
| 16 | declare 'RepeatedPartitionId', | ||
| 17 | as ArrayRef[PartitionId()]; | ||
| 18 | |||
| 19 | coerce 'RepeatedPartitionId', | ||
| 20 | from ArrayRef[HashRef], via { [ map { 'Google::Datastore::V1beta3::Entity::PartitionId'->new($_) } @$_ ] }; | ||
| 21 | |||
| 22 | declare 'MapStringPartitionId', | ||
| 23 | as HashRef[PartitionId()]; | ||
| 24 | |||
| 25 | declare 'Key', | ||
| 26 | as InstanceOf['Google::Datastore::V1beta3::Entity::Key']; | ||
| 27 | |||
| 28 | coerce 'Key', | ||
| 29 | from HashRef, via { 'Google::Datastore::V1beta3::Entity::Key'->new($_) }; | ||
| 30 | |||
| 31 | declare 'RepeatedKey', | ||
| 32 | as ArrayRef[Key()]; | ||
| 33 | |||
| 34 | coerce 'RepeatedKey', | ||
| 35 | from ArrayRef[HashRef], via { [ map { 'Google::Datastore::V1beta3::Entity::Key'->new($_) } @$_ ] }; | ||
| 36 | |||
| 37 | declare 'MapStringKey', | ||
| 38 | as HashRef[Key()]; | ||
| 39 | |||
| 40 | declare 'PathElement', | ||
| 41 | as InstanceOf['Google::Datastore::V1beta3::Entity::Key::PathElement']; | ||
| 42 | |||
| 43 | coerce 'PathElement', | ||
| 44 | from HashRef, via { 'Google::Datastore::V1beta3::Entity::Key::PathElement'->new($_) }; | ||
| 45 | |||
| 46 | declare 'RepeatedPathElement', | ||
| 47 | as ArrayRef[PathElement()]; | ||
| 48 | |||
| 49 | coerce 'RepeatedPathElement', | ||
| 50 | from ArrayRef[HashRef], via { [ map { 'Google::Datastore::V1beta3::Entity::Key::PathElement'->new($_) } @$_ ] }; | ||
| 51 | |||
| 52 | declare 'MapStringPathElement', | ||
| 53 | as HashRef[PathElement()]; | ||
| 54 | |||
| 55 | declare 'ArrayValue', | ||
| 56 | as InstanceOf['Google::Datastore::V1beta3::Entity::ArrayValue']; | ||
| 57 | |||
| 58 | coerce 'ArrayValue', | ||
| 59 | from HashRef, via { 'Google::Datastore::V1beta3::Entity::ArrayValue'->new($_) }; | ||
| 60 | |||
| 61 | declare 'RepeatedArrayValue', | ||
| 62 | as ArrayRef[ArrayValue()]; | ||
| 63 | |||
| 64 | coerce 'RepeatedArrayValue', | ||
| 65 | from ArrayRef[HashRef], via { [ map { 'Google::Datastore::V1beta3::Entity::ArrayValue'->new($_) } @$_ ] }; | ||
| 66 | |||
| 67 | declare 'MapStringArrayValue', | ||
| 68 | as HashRef[ArrayValue()]; | ||
| 69 | |||
| 70 | declare 'Value', | ||
| 71 | as InstanceOf['Google::Datastore::V1beta3::Entity::Value']; | ||
| 72 | |||
| 73 | coerce 'Value', | ||
| 74 | from HashRef, via { 'Google::Datastore::V1beta3::Entity::Value'->new($_) }; | ||
| 75 | |||
| 76 | declare 'RepeatedValue', | ||
| 77 | as ArrayRef[Value()]; | ||
| 78 | |||
| 79 | coerce 'RepeatedValue', | ||
| 80 | from ArrayRef[HashRef], via { [ map { 'Google::Datastore::V1beta3::Entity::Value'->new($_) } @$_ ] }; | ||
| 81 | |||
| 82 | declare 'MapStringValue', | ||
| 83 | as HashRef[Value()]; | ||
| 84 | |||
| 85 | declare 'Entity', | ||
| 86 | as InstanceOf['Google::Datastore::V1beta3::Entity::Entity']; | ||
| 87 | |||
| 88 | coerce 'Entity', | ||
| 89 | from HashRef, via { 'Google::Datastore::V1beta3::Entity::Entity'->new($_) }; | ||
| 90 | |||
| 91 | declare 'RepeatedEntity', | ||
| 92 | as ArrayRef[Entity()]; | ||
| 93 | |||
| 94 | coerce 'RepeatedEntity', | ||
| 95 | from ArrayRef[HashRef], via { [ map { 'Google::Datastore::V1beta3::Entity::Entity'->new($_) } @$_ ] }; | ||
| 96 | |||
| 97 | declare 'MapStringEntity', | ||
| 98 | as HashRef[Entity()]; | ||
| 99 | |||
| 100 | declare 'PropertiesEntry', | ||
| 101 | as InstanceOf['Google::Datastore::V1beta3::Entity::Entity::PropertiesEntry']; | ||
| 102 | |||
| 103 | coerce 'PropertiesEntry', | ||
| 104 | from HashRef, via { 'Google::Datastore::V1beta3::Entity::Entity::PropertiesEntry'->new($_) }; | ||
| 105 | |||
| 106 | declare 'RepeatedPropertiesEntry', | ||
| 107 | as ArrayRef[PropertiesEntry()]; | ||
| 108 | |||
| 109 | coerce 'RepeatedPropertiesEntry', | ||
| 110 | from ArrayRef[HashRef], via { [ map { 'Google::Datastore::V1beta3::Entity::Entity::PropertiesEntry'->new($_) } @$_ ] }; | ||
| 111 | |||
| 112 | declare 'MapStringPropertiesEntry', | ||
| 113 | as HashRef[PropertiesEntry()]; | ||
| 114 | |||
| 115 | 1; | ||
| 116 | |||
| 117 | __END__ |