| 1 | package Google::Api::Http::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 'Http', | ||
| 11 | as InstanceOf['Google::Api::Http::Http']; | ||
| 12 | |||
| 13 | coerce 'Http', | ||
| 14 | from HashRef, via { 'Google::Api::Http::Http'->new($_) }; | ||
| 15 | |||
| 16 | declare 'RepeatedHttp', | ||
| 17 | as ArrayRef[Http()]; | ||
| 18 | |||
| 19 | coerce 'RepeatedHttp', | ||
| 20 | from ArrayRef[HashRef], via { [ map { 'Google::Api::Http::Http'->new($_) } @$_ ] }; | ||
| 21 | |||
| 22 | declare 'MapStringHttp', | ||
| 23 | as HashRef[Http()]; | ||
| 24 | |||
| 25 | declare 'HttpRule', | ||
| 26 | as InstanceOf['Google::Api::Http::HttpRule']; | ||
| 27 | |||
| 28 | coerce 'HttpRule', | ||
| 29 | from HashRef, via { 'Google::Api::Http::HttpRule'->new($_) }; | ||
| 30 | |||
| 31 | declare 'RepeatedHttpRule', | ||
| 32 | as ArrayRef[HttpRule()]; | ||
| 33 | |||
| 34 | coerce 'RepeatedHttpRule', | ||
| 35 | from ArrayRef[HashRef], via { [ map { 'Google::Api::Http::HttpRule'->new($_) } @$_ ] }; | ||
| 36 | |||
| 37 | declare 'MapStringHttpRule', | ||
| 38 | as HashRef[HttpRule()]; | ||
| 39 | |||
| 40 | declare 'CustomHttpPattern', | ||
| 41 | as InstanceOf['Google::Api::Http::CustomHttpPattern']; | ||
| 42 | |||
| 43 | coerce 'CustomHttpPattern', | ||
| 44 | from HashRef, via { 'Google::Api::Http::CustomHttpPattern'->new($_) }; | ||
| 45 | |||
| 46 | declare 'RepeatedCustomHttpPattern', | ||
| 47 | as ArrayRef[CustomHttpPattern()]; | ||
| 48 | |||
| 49 | coerce 'RepeatedCustomHttpPattern', | ||
| 50 | from ArrayRef[HashRef], via { [ map { 'Google::Api::Http::CustomHttpPattern'->new($_) } @$_ ] }; | ||
| 51 | |||
| 52 | declare 'MapStringCustomHttpPattern', | ||
| 53 | as HashRef[CustomHttpPattern()]; | ||
| 54 | |||
| 55 | 1; | ||
| 56 | |||
| 57 | __END__ |