| 1 | package Google::Api::Metric::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 'MetricDescriptor', | ||
| 11 | as InstanceOf['Google::Api::Metric::MetricDescriptor']; | ||
| 12 | |||
| 13 | coerce 'MetricDescriptor', | ||
| 14 | from HashRef, via { 'Google::Api::Metric::MetricDescriptor'->new($_) }; | ||
| 15 | |||
| 16 | declare 'RepeatedMetricDescriptor', | ||
| 17 | as ArrayRef[MetricDescriptor()]; | ||
| 18 | |||
| 19 | coerce 'RepeatedMetricDescriptor', | ||
| 20 | from ArrayRef[HashRef], via { [ map { 'Google::Api::Metric::MetricDescriptor'->new($_) } @$_ ] }; | ||
| 21 | |||
| 22 | declare 'MapStringMetricDescriptor', | ||
| 23 | as HashRef[MetricDescriptor()]; | ||
| 24 | |||
| 25 | declare 'MetricKind', | ||
| 26 | as (Int | Str); | ||
| 27 | |||
| 28 | declare 'ValueType', | ||
| 29 | as (Int | Str); | ||
| 30 | |||
| 31 | declare 'MetricDescriptorMetadata', | ||
| 32 | as InstanceOf['Google::Api::Metric::MetricDescriptor::MetricDescriptorMetadata']; | ||
| 33 | |||
| 34 | coerce 'MetricDescriptorMetadata', | ||
| 35 | from HashRef, via { 'Google::Api::Metric::MetricDescriptor::MetricDescriptorMetadata'->new($_) }; | ||
| 36 | |||
| 37 | declare 'RepeatedMetricDescriptorMetadata', | ||
| 38 | as ArrayRef[MetricDescriptorMetadata()]; | ||
| 39 | |||
| 40 | coerce 'RepeatedMetricDescriptorMetadata', | ||
| 41 | from ArrayRef[HashRef], via { [ map { 'Google::Api::Metric::MetricDescriptor::MetricDescriptorMetadata'->new($_) } @$_ ] }; | ||
| 42 | |||
| 43 | declare 'MapStringMetricDescriptorMetadata', | ||
| 44 | as HashRef[MetricDescriptorMetadata()]; | ||
| 45 | |||
| 46 | declare 'TimeSeriesResourceHierarchyLevel', | ||
| 47 | as (Int | Str); | ||
| 48 | |||
| 49 | declare 'Metric', | ||
| 50 | as InstanceOf['Google::Api::Metric::Metric']; | ||
| 51 | |||
| 52 | coerce 'Metric', | ||
| 53 | from HashRef, via { 'Google::Api::Metric::Metric'->new($_) }; | ||
| 54 | |||
| 55 | declare 'RepeatedMetric', | ||
| 56 | as ArrayRef[Metric()]; | ||
| 57 | |||
| 58 | coerce 'RepeatedMetric', | ||
| 59 | from ArrayRef[HashRef], via { [ map { 'Google::Api::Metric::Metric'->new($_) } @$_ ] }; | ||
| 60 | |||
| 61 | declare 'MapStringMetric', | ||
| 62 | as HashRef[Metric()]; | ||
| 63 | |||
| 64 | declare 'LabelsEntry', | ||
| 65 | as InstanceOf['Google::Api::Metric::Metric::LabelsEntry']; | ||
| 66 | |||
| 67 | coerce 'LabelsEntry', | ||
| 68 | from HashRef, via { 'Google::Api::Metric::Metric::LabelsEntry'->new($_) }; | ||
| 69 | |||
| 70 | declare 'RepeatedLabelsEntry', | ||
| 71 | as ArrayRef[LabelsEntry()]; | ||
| 72 | |||
| 73 | coerce 'RepeatedLabelsEntry', | ||
| 74 | from ArrayRef[HashRef], via { [ map { 'Google::Api::Metric::Metric::LabelsEntry'->new($_) } @$_ ] }; | ||
| 75 | |||
| 76 | declare 'MapStringLabelsEntry', | ||
| 77 | as HashRef[LabelsEntry()]; | ||
| 78 | |||
| 79 | 1; | ||
| 80 | |||
| 81 | __END__ |