@@ -175,7 +175,65 @@ instance ToJSON ListTimeSeriesResponse where
175175 [("nextPageToken" .=) <$> _ltsrNextPageToken,
176176 ("timeSeries" .=) <$> _ltsrTimeSeries])
177177
178−-- | Defines a metric type and its schema.
178+-- | The MetricAssociations response.
179+--
180+-- /See:/ 'listMetricAssociationsResponse' smart constructor.
181+data ListMetricAssociationsResponse = ListMetricAssociationsResponse'
182+ { _lmarNextPageToken :: !(Maybe Text)
183+ , _lmarMetricAssociations :: !(Maybe [MetricAssociation])
184+ } deriving (Eq,Show,Data,Typeable,Generic)
185+
186+-- | Creates a value of 'ListMetricAssociationsResponse' with the minimum fields required to make a request.
187+--
188+-- Use one of the following lenses to modify other fields as desired:
189+--
190+-- * 'lmarNextPageToken'
191+--
192+-- * 'lmarMetricAssociations'
193+listMetricAssociationsResponse
194+ :: ListMetricAssociationsResponse
195+listMetricAssociationsResponse =
196+ ListMetricAssociationsResponse'
197+ { _lmarNextPageToken = Nothing
198+ , _lmarMetricAssociations = Nothing
199+ }
200+
201+-- | If there are more results than have been returned, then this field is
202+-- set to a non-empty value. To see the additional results, use that value
203+-- as pageToken in the next call to this method.
204+lmarNextPageToken :: Lens' ListMetricAssociationsResponse (Maybe Text)
205+lmarNextPageToken
206+ = lens _lmarNextPageToken
207+ (\ s a -> s{_lmarNextPageToken = a})
208+
209+-- | The MetricAssociations that match the specified filters.
210+lmarMetricAssociations :: Lens' ListMetricAssociationsResponse [MetricAssociation]
211+lmarMetricAssociations
212+ = lens _lmarMetricAssociations
213+ (\ s a -> s{_lmarMetricAssociations = a})
214+ . _Default
215+ . _Coerce
216+
217+instance FromJSON ListMetricAssociationsResponse
218+ where
219+ parseJSON
220+ = withObject "ListMetricAssociationsResponse"
221+ (\ o ->
222+ ListMetricAssociationsResponse' <$>
223+ (o .:? "nextPageToken") <*>
224+ (o .:? "metricAssociations" .!= mempty))
225+
226+instance ToJSON ListMetricAssociationsResponse where
227+ toJSON ListMetricAssociationsResponse'{..}
228+ = object
229+ (catMaybes
230+ [("nextPageToken" .=) <$> _lmarNextPageToken,
231+ ("metricAssociations" .=) <$>
232+ _lmarMetricAssociations])
233+
234+-- | Defines a metric type and its schema. Once a metric descriptor is
235+-- created, deleting or altering it stops data collection and makes the
236+-- metric type\'s existing data unusable.
179237--
180238-- /See:/ 'metricDescriptor' smart constructor.
181239data MetricDescriptor = MetricDescriptor'
@@ -229,10 +287,13 @@ mdMetricKind :: Lens' MetricDescriptor (Maybe MetricDescriptorMetricKind)
229287mdMetricKind
230288 = lens _mdMetricKind (\ s a -> s{_mdMetricKind = a})
231289
232−-- | Resource name. The format of the name may vary between different
233−-- implementations. For examples:
234−-- projects\/{project_id}\/metricDescriptors\/{type=**}
235−-- metricDescriptors\/{type=**}
290+-- | The resource name of the metric descriptor. Depending on the
291+-- implementation, the name typically includes: (1) the parent resource
292+-- name that defines the scope of the metric type or of its data; and (2)
293+-- the metric\'s URL-encoded type, which also appears in the type field of
294+-- this descriptor. For example, following is the resource name of a custom
295+-- metric within the GCP project my-project-id:
296+-- \"projects\/my-project-id\/metricDescriptors\/custom.googleapis.com%2Finvoice%2Fpaid%2Famount\"
236297mdName :: Lens' MetricDescriptor (Maybe Text)
237298mdName = lens _mdName (\ s a -> s{_mdName = a})
238299
@@ -246,25 +307,20 @@ mdDisplayName
246307
247308-- | The set of labels that can be used to describe a specific instance of
248309-- this metric type. For example, the
249−-- compute.googleapis.com\/instance\/network\/received_bytes_count metric
250−-- type has a label, loadbalanced, that specifies whether the traffic was
251−-- received through a load balanced IP address.
310+-- appengine.googleapis.com\/http\/server\/response_latencies metric type
311+-- has a label for the HTTP response code, response_code, so you can look
312+-- at latencies for successful responses or just for responses that failed.
252313mdLabels :: Lens' MetricDescriptor [LabelDescriptor]
253314mdLabels
254315 = lens _mdLabels (\ s a -> s{_mdLabels = a}) .
255316 _Default
256317 . _Coerce
257318
258−-- | The metric type including a DNS name prefix, for example
259−-- \"compute.googleapis.com\/instance\/cpu\/utilization\". Metric types
260−-- should use a natural hierarchical grouping such as the following:
261−-- compute.googleapis.com\/instance\/cpu\/utilization
262−-- compute.googleapis.com\/instance\/disk\/read_ops_count
263−-- compute.googleapis.com\/instance\/network\/received_bytes_count Note
264−-- that if the metric type changes, the monitoring data will be
265−-- discontinued, and anything depends on it will break, such as monitoring
266−-- dashboards, alerting rules and quota limits. Therefore, once a metric
267−-- has been published, its type should be immutable.
319+-- | The metric type, including its DNS name prefix. The type is not
320+-- URL-encoded. All user-defined custom metric types have the DNS name
321+-- custom.googleapis.com. Metric types should use a natural hierarchical
322+-- grouping. For example: \"custom.googleapis.com\/invoice\/paid\/amount\"
323+-- \"appengine.googleapis.com\/http\/server\/response_latencies\"
268324mdType :: Lens' MetricDescriptor (Maybe Text)
269325mdType = lens _mdType (\ s a -> s{_mdType = a})
270326
@@ -858,6 +914,66 @@ instance ToJSON Field where
858914 ("number" .=) <$> _fNumber,
859915 ("typeUrl" .=) <$> _fTypeURL])
860916
917+-- | A Vital Signs MetricAssociation, representing the inclusion of its
918+-- referenced metric type within its parent category.
919+--
920+-- /See:/ 'metricAssociation' smart constructor.
921+data MetricAssociation = MetricAssociation'
922+ { _maMetricType :: !(Maybe Text)
923+ , _maName :: !(Maybe Text)
924+ , _maIsDefault :: !(Maybe Bool)
925+ } deriving (Eq,Show,Data,Typeable,Generic)
926+
927+-- | Creates a value of 'MetricAssociation' with the minimum fields required to make a request.
928+--
929+-- Use one of the following lenses to modify other fields as desired:
930+--
931+-- * 'maMetricType'
932+--
933+-- * 'maName'
934+--
935+-- * 'maIsDefault'
936+metricAssociation
937+ :: MetricAssociation
938+metricAssociation =
939+ MetricAssociation'
940+ { _maMetricType = Nothing
941+ , _maName = Nothing
942+ , _maIsDefault = Nothing
943+ }
944+
945+-- | Resource name of the metric. It must be the full resource name. For
946+-- example, \"compute.googleapis.com\/instance\/cpu\/utilization\".
947+maMetricType :: Lens' MetricAssociation (Maybe Text)
948+maMetricType
949+ = lens _maMetricType (\ s a -> s{_maMetricType = a})
950+
951+-- | Resource name for the metric association.
952+maName :: Lens' MetricAssociation (Maybe Text)
953+maName = lens _maName (\ s a -> s{_maName = a})
954+
955+-- | A flag to indicate whether this association is part of Stackdriver\'s
956+-- default taxonomy.
957+maIsDefault :: Lens' MetricAssociation (Maybe Bool)
958+maIsDefault
959+ = lens _maIsDefault (\ s a -> s{_maIsDefault = a})
960+
961+instance FromJSON MetricAssociation where
962+ parseJSON
963+ = withObject "MetricAssociation"
964+ (\ o ->
965+ MetricAssociation' <$>
966+ (o .:? "metricType") <*> (o .:? "name") <*>
967+ (o .:? "isDefault"))
968+
969+instance ToJSON MetricAssociation where
970+ toJSON MetricAssociation'{..}
971+ = object
972+ (catMaybes
973+ [("metricType" .=) <$> _maMetricType,
974+ ("name" .=) <$> _maName,
975+ ("isDefault" .=) <$> _maIsDefault])
976+
861977-- | A generic empty message that you can re-use to avoid defining duplicated
862978-- empty messages in your APIs. A typical example is to use it as the
863979-- request or the response type of an API method. For instance: service Foo
@@ -989,7 +1105,11 @@ instance ToJSON ListMetricDescriptorsResponse where
9891105 [("metricDescriptors" .=) <$> _lmdrMetricDescriptors,
9901106 ("nextPageToken" .=) <$> _lmdrNextPageToken])
9911107
992−-- | The option\'s value. For example, \"com.google.protobuf\".
1108+-- | The option\'s value packed in an Any message. If the value is a
1109+-- primitive, the corresponding wrapper type defined in
1110+-- google\/protobuf\/wrappers.proto should be used. If the value is an
1111+-- enum, it should be stored as an int32 value using the
1112+-- google.protobuf.Int32Value type.
9931113--
9941114-- /See:/ 'optionValue' smart constructor.
9951115newtype OptionValue = OptionValue'
@@ -1023,6 +1143,90 @@ instance FromJSON OptionValue where
10231143instance ToJSON OptionValue where
10241144 toJSON = toJSON . _ovAddtional
10251145
1146+-- | A Vital Signs Category.
1147+--
1148+-- /See:/ 'category' smart constructor.
1149+data Category = Category'
1150+ { _cShortName :: !(Maybe Text)
1151+ , _cName :: !(Maybe Text)
1152+ , _cDisplayName :: !(Maybe Text)
1153+ , _cDescription :: !(Maybe Text)
1154+ , _cIsDefault :: !(Maybe Bool)
1155+ } deriving (Eq,Show,Data,Typeable,Generic)
1156+
1157+-- | Creates a value of 'Category' with the minimum fields required to make a request.
1158+--
1159+-- Use one of the following lenses to modify other fields as desired:
1160+--
1161+-- * 'cShortName'
1162+--
1163+-- * 'cName'
1164+--
1165+-- * 'cDisplayName'
1166+--
1167+-- * 'cDescription'
1168+--
1169+-- * 'cIsDefault'
1170+category
1171+ :: Category
1172+category =
1173+ Category'
1174+ { _cShortName = Nothing
1175+ , _cName = Nothing
1176+ , _cDisplayName = Nothing
1177+ , _cDescription = Nothing
1178+ , _cIsDefault = Nothing
1179+ }
1180+
1181+-- | Unique usually one-word name for this category. e.g. latency or
1182+-- custom:goodness
1183+cShortName :: Lens' Category (Maybe Text)
1184+cShortName
1185+ = lens _cShortName (\ s a -> s{_cShortName = a})
1186+
1187+-- | Resource name for the category. e.g.
1188+-- projects\/91091\/categories\/latency or
1189+-- projects\/91091\/categories\/custom:goodness
1190+cName :: Lens' Category (Maybe Text)
1191+cName = lens _cName (\ s a -> s{_cName = a})
1192+
1193+-- | A human-readable name for the category.
1194+cDisplayName :: Lens' Category (Maybe Text)
1195+cDisplayName
1196+ = lens _cDisplayName (\ s a -> s{_cDisplayName = a})
1197+
1198+-- | A human-readable description for the category. The description can be
1199+-- longer and contain more details.
1200+cDescription :: Lens' Category (Maybe Text)
1201+cDescription
1202+ = lens _cDescription (\ s a -> s{_cDescription = a})
1203+
1204+-- | A flag to indicate whether this category is part of Stackdriver\'s
1205+-- default taxonomy.
1206+cIsDefault :: Lens' Category (Maybe Bool)
1207+cIsDefault
1208+ = lens _cIsDefault (\ s a -> s{_cIsDefault = a})
1209+
1210+instance FromJSON Category where
1211+ parseJSON
1212+ = withObject "Category"
1213+ (\ o ->
1214+ Category' <$>
1215+ (o .:? "shortName") <*> (o .:? "name") <*>
1216+ (o .:? "displayName")
1217+ <*> (o .:? "description")
1218+ <*> (o .:? "isDefault"))
1219+
1220+instance ToJSON Category where
1221+ toJSON Category'{..}
1222+ = object
1223+ (catMaybes
1224+ [("shortName" .=) <$> _cShortName,
1225+ ("name" .=) <$> _cName,
1226+ ("displayName" .=) <$> _cDisplayName,
1227+ ("description" .=) <$> _cDescription,
1228+ ("isDefault" .=) <$> _cIsDefault])
1229+
10261230-- | The CreateTimeSeries request.
10271231--
10281232-- /See:/ 'createTimeSeriesRequest' smart constructor.
@@ -1164,8 +1368,8 @@ instance ToJSON Explicit where
11641368 toJSON Explicit'{..}
11651369 = object (catMaybes [("bounds" .=) <$> _eBounds])
11661370
1167−-- | The set of labels that uniquely identify a metric. To specify a metric,
1168−-- all labels enumerated in the MetricDescriptor must be assigned values.
1371+-- | The set of label values that uniquely identify this metric. All labels
1372+-- listed in the MetricDescriptor must be assigned values.
11691373--
11701374-- /See:/ 'metricLabels' smart constructor.
11711375newtype MetricLabels = MetricLabels'
@@ -1532,7 +1736,7 @@ instance ToJSON CollectdPayload where
15321736 ("type" .=) <$> _cpType,
15331737 ("plugin" .=) <$> _cpPlugin])
15341738
1535−-- | A specific metric identified by specifying values for all of the labels
1739+-- | A specific metric, identified by specifying values for all of the labels
15361740-- of a MetricDescriptor.
15371741--
15381742-- /See:/ 'metric' smart constructor.
@@ -1556,13 +1760,13 @@ metric =
15561760 , _mType = Nothing
15571761 }
15581762
1559−-- | The set of labels that uniquely identify a metric. To specify a metric,
1560−-- all labels enumerated in the MetricDescriptor must be assigned values.
1763+-- | The set of label values that uniquely identify this metric. All labels
1764+-- listed in the MetricDescriptor must be assigned values.
15611765mLabels :: Lens' Metric (Maybe MetricLabels)
15621766mLabels = lens _mLabels (\ s a -> s{_mLabels = a})
15631767
15641768-- | An existing metric type, see google.api.MetricDescriptor. For example,
1565−-- compute.googleapis.com\/instance\/cpu\/usage_time.
1769+-- custom.googleapis.com\/invoice\/paid\/amount.
15661770mType :: Lens' Metric (Maybe Text)
15671771mType = lens _mType (\ s a -> s{_mType = a})
15681772
@@ -1646,6 +1850,59 @@ instance ToJSON Exponential where
16461850 ("scale" .=) <$> _eScale,
16471851 ("numFiniteBuckets" .=) <$> _eNumFiniteBuckets])
16481852
1853+-- | The ListCategories response.
1854+--
1855+-- /See:/ 'listCategoriesResponse' smart constructor.
1856+data ListCategoriesResponse = ListCategoriesResponse'
1857+ { _lcrNextPageToken :: !(Maybe Text)
1858+ , _lcrCategory :: !(Maybe [Category])
1859+ } deriving (Eq,Show,Data,Typeable,Generic)
1860+
1861+-- | Creates a value of 'ListCategoriesResponse' with the minimum fields required to make a request.
1862+--
1863+-- Use one of the following lenses to modify other fields as desired:
1864+--
1865+-- * 'lcrNextPageToken'
1866+--
1867+-- * 'lcrCategory'
1868+listCategoriesResponse
1869+ :: ListCategoriesResponse
1870+listCategoriesResponse =
1871+ ListCategoriesResponse'
1872+ { _lcrNextPageToken = Nothing
1873+ , _lcrCategory = Nothing
1874+ }
1875+
1876+-- | If there are more results than have been returned, then this field is
1877+-- set to a non-empty value. To see the additional results, use that value
1878+-- as pageToken in the next call to this method.
1879+lcrNextPageToken :: Lens' ListCategoriesResponse (Maybe Text)
1880+lcrNextPageToken
1881+ = lens _lcrNextPageToken
1882+ (\ s a -> s{_lcrNextPageToken = a})
1883+
1884+-- | The Categories that match the specified filters.
1885+lcrCategory :: Lens' ListCategoriesResponse [Category]
1886+lcrCategory
1887+ = lens _lcrCategory (\ s a -> s{_lcrCategory = a}) .
1888+ _Default
1889+ . _Coerce
1890+
1891+instance FromJSON ListCategoriesResponse where
1892+ parseJSON
1893+ = withObject "ListCategoriesResponse"
1894+ (\ o ->
1895+ ListCategoriesResponse' <$>
1896+ (o .:? "nextPageToken") <*>
1897+ (o .:? "category" .!= mempty))
1898+
1899+instance ToJSON ListCategoriesResponse where
1900+ toJSON ListCategoriesResponse'{..}
1901+ = object
1902+ (catMaybes
1903+ [("nextPageToken" .=) <$> _lcrNextPageToken,
1904+ ("category" .=) <$> _lcrCategory])
1905+
16491906-- | The range of the population values.
16501907--
16511908-- /See:/ 'range' smart constructor.
@@ -2113,11 +2370,18 @@ option =
21132370 , _oName = Nothing
21142371 }
21152372
2116−-- | The option\'s value. For example, \"com.google.protobuf\".
2373+-- | The option\'s value packed in an Any message. If the value is a
2374+-- primitive, the corresponding wrapper type defined in
2375+-- google\/protobuf\/wrappers.proto should be used. If the value is an
2376+-- enum, it should be stored as an int32 value using the
2377+-- google.protobuf.Int32Value type.
21172378oValue :: Lens' Option (Maybe OptionValue)
21182379oValue = lens _oValue (\ s a -> s{_oValue = a})
21192380
2120−-- | The option\'s name. For example, \"java_package\".
2381+-- | The option\'s name. For protobuf built-in options (options defined in
2382+-- descriptor.proto), this is the short name. For example, \"map_entry\".
2383+-- For custom options, it should be the fully-qualified name. For example,
2384+-- \"google.api.http\".
21212385oName :: Lens' Option (Maybe Text)
21222386oName = lens _oName (\ s a -> s{_oName = a})
21232387