@@ -0,0 +1,6247 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE NoImplicitPrelude #-}
4+{-# LANGUAGE OverloadedStrings #-}
5+{-# LANGUAGE RecordWildCards #-}
6+
7+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
8+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
9+
10+-- |
11+-- Module : Network.Google.ServiceManagement.Types.Product
12+-- Copyright : (c) 2015-2016 Brendan Hay
13+-- License : Mozilla Public License, v. 2.0.
14+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
15+-- Stability : auto-generated
16+-- Portability : non-portable (GHC extensions)
17+--
18+module Network.Google.ServiceManagement.Types.Product where
19+
20+import Network.Google.Prelude
21+import Network.Google.ServiceManagement.Types.Sum
22+
23+-- | Response message for UndeleteService method.
24+--
25+-- /See:/ 'undeleteServiceResponse' smart constructor.
26+newtype UndeleteServiceResponse = UndeleteServiceResponse'
27+ { _usrService :: Maybe ManagedService
28+ } deriving (Eq,Show,Data,Typeable,Generic)
29+
30+-- | Creates a value of 'UndeleteServiceResponse' with the minimum fields required to make a request.
31+--
32+-- Use one of the following lenses to modify other fields as desired:
33+--
34+-- * 'usrService'
35+undeleteServiceResponse
36+ :: UndeleteServiceResponse
37+undeleteServiceResponse =
38+ UndeleteServiceResponse'
39+ { _usrService = Nothing
40+ }
41+
42+-- | Revived service resource.
43+usrService :: Lens' UndeleteServiceResponse (Maybe ManagedService)
44+usrService
45+ = lens _usrService (\ s a -> s{_usrService = a})
46+
47+instance FromJSON UndeleteServiceResponse where
48+ parseJSON
49+ = withObject "UndeleteServiceResponse"
50+ (\ o ->
51+ UndeleteServiceResponse' <$> (o .:? "service"))
52+
53+instance ToJSON UndeleteServiceResponse where
54+ toJSON UndeleteServiceResponse'{..}
55+ = object (catMaybes [("service" .=) <$> _usrService])
56+
57+-- | Define a parameter\'s name and location. The parameter may be passed as
58+-- either an HTTP header or a URL query parameter, and if both are passed
59+-- the behavior is implementation-dependent.
60+--
61+-- /See:/ 'systemParameter' smart constructor.
62+data SystemParameter = SystemParameter'
63+ { _spHTTPHeader :: !(Maybe Text)
64+ , _spURLQueryParameter :: !(Maybe Text)
65+ , _spName :: !(Maybe Text)
66+ } deriving (Eq,Show,Data,Typeable,Generic)
67+
68+-- | Creates a value of 'SystemParameter' with the minimum fields required to make a request.
69+--
70+-- Use one of the following lenses to modify other fields as desired:
71+--
72+-- * 'spHTTPHeader'
73+--
74+-- * 'spURLQueryParameter'
75+--
76+-- * 'spName'
77+systemParameter
78+ :: SystemParameter
79+systemParameter =
80+ SystemParameter'
81+ { _spHTTPHeader = Nothing
82+ , _spURLQueryParameter = Nothing
83+ , _spName = Nothing
84+ }
85+
86+-- | Define the HTTP header name to use for the parameter. It is case
87+-- insensitive.
88+spHTTPHeader :: Lens' SystemParameter (Maybe Text)
89+spHTTPHeader
90+ = lens _spHTTPHeader (\ s a -> s{_spHTTPHeader = a})
91+
92+-- | Define the URL query parameter name to use for the parameter. It is case
93+-- sensitive.
94+spURLQueryParameter :: Lens' SystemParameter (Maybe Text)
95+spURLQueryParameter
96+ = lens _spURLQueryParameter
97+ (\ s a -> s{_spURLQueryParameter = a})
98+
99+-- | Define the name of the parameter, such as \"api_key\", \"alt\",
100+-- \"callback\", and etc. It is case sensitive.
101+spName :: Lens' SystemParameter (Maybe Text)
102+spName = lens _spName (\ s a -> s{_spName = a})
103+
104+instance FromJSON SystemParameter where
105+ parseJSON
106+ = withObject "SystemParameter"
107+ (\ o ->
108+ SystemParameter' <$>
109+ (o .:? "httpHeader") <*> (o .:? "urlQueryParameter")
110+ <*> (o .:? "name"))
111+
112+instance ToJSON SystemParameter where
113+ toJSON SystemParameter'{..}
114+ = object
115+ (catMaybes
116+ [("httpHeader" .=) <$> _spHTTPHeader,
117+ ("urlQueryParameter" .=) <$> _spURLQueryParameter,
118+ ("name" .=) <$> _spName])
119+
120+-- | Generated advice about this change, used for providing more information
121+-- about how a change will affect the existing service.
122+--
123+-- /See:/ 'advice' smart constructor.
124+newtype Advice = Advice'
125+ { _aDescription :: Maybe Text
126+ } deriving (Eq,Show,Data,Typeable,Generic)
127+
128+-- | Creates a value of 'Advice' with the minimum fields required to make a request.
129+--
130+-- Use one of the following lenses to modify other fields as desired:
131+--
132+-- * 'aDescription'
133+advice
134+ :: Advice
135+advice =
136+ Advice'
137+ { _aDescription = Nothing
138+ }
139+
140+-- | Useful description for why this advice was applied and what actions
141+-- should be taken to mitigate any implied risks.
142+aDescription :: Lens' Advice (Maybe Text)
143+aDescription
144+ = lens _aDescription (\ s a -> s{_aDescription = a})
145+
146+instance FromJSON Advice where
147+ parseJSON
148+ = withObject "Advice"
149+ (\ o -> Advice' <$> (o .:? "description"))
150+
151+instance ToJSON Advice where
152+ toJSON Advice'{..}
153+ = object
154+ (catMaybes [("description" .=) <$> _aDescription])
155+
156+-- | Generic specification of a source configuration file
157+--
158+-- /See:/ 'configFile' smart constructor.
159+data ConfigFile = ConfigFile'
160+ { _cfFileContents :: !(Maybe Base64)
161+ , _cfFilePath :: !(Maybe Text)
162+ , _cfFileType :: !(Maybe ConfigFileFileType)
163+ } deriving (Eq,Show,Data,Typeable,Generic)
164+
165+-- | Creates a value of 'ConfigFile' with the minimum fields required to make a request.
166+--
167+-- Use one of the following lenses to modify other fields as desired:
168+--
169+-- * 'cfFileContents'
170+--
171+-- * 'cfFilePath'
172+--
173+-- * 'cfFileType'
174+configFile
175+ :: ConfigFile
176+configFile =
177+ ConfigFile'
178+ { _cfFileContents = Nothing
179+ , _cfFilePath = Nothing
180+ , _cfFileType = Nothing
181+ }
182+
183+-- | The bytes that constitute the file.
184+cfFileContents :: Lens' ConfigFile (Maybe ByteString)
185+cfFileContents
186+ = lens _cfFileContents
187+ (\ s a -> s{_cfFileContents = a})
188+ . mapping _Base64
189+
190+-- | The file name of the configuration file (full or relative path).
191+cfFilePath :: Lens' ConfigFile (Maybe Text)
192+cfFilePath
193+ = lens _cfFilePath (\ s a -> s{_cfFilePath = a})
194+
195+-- | The type of configuration file this represents.
196+cfFileType :: Lens' ConfigFile (Maybe ConfigFileFileType)
197+cfFileType
198+ = lens _cfFileType (\ s a -> s{_cfFileType = a})
199+
200+instance FromJSON ConfigFile where
201+ parseJSON
202+ = withObject "ConfigFile"
203+ (\ o ->
204+ ConfigFile' <$>
205+ (o .:? "fileContents") <*> (o .:? "filePath") <*>
206+ (o .:? "fileType"))
207+
208+instance ToJSON ConfigFile where
209+ toJSON ConfigFile'{..}
210+ = object
211+ (catMaybes
212+ [("fileContents" .=) <$> _cfFileContents,
213+ ("filePath" .=) <$> _cfFilePath,
214+ ("fileType" .=) <$> _cfFileType])
215+
216+-- | An object that describes the schema of a MonitoredResource object using
217+-- a type name and a set of labels. For example, the monitored resource
218+-- descriptor for Google Compute Engine VM instances has a type of
219+-- \`\"gce_instance\"\` and specifies the use of the labels
220+-- \`\"instance_id\"\` and \`\"zone\"\` to identify particular VM
221+-- instances. Different APIs can support different monitored resource
222+-- types. APIs generally provide a \`list\` method that returns the
223+-- monitored resource descriptors used by the API.
224+--
225+-- /See:/ 'monitoredResourceDescriptor' smart constructor.
226+data MonitoredResourceDescriptor = MonitoredResourceDescriptor'
227+ { _mrdName :: !(Maybe Text)
228+ , _mrdDisplayName :: !(Maybe Text)
229+ , _mrdLabels :: !(Maybe [LabelDescriptor])
230+ , _mrdType :: !(Maybe Text)
231+ , _mrdDescription :: !(Maybe Text)
232+ } deriving (Eq,Show,Data,Typeable,Generic)
233+
234+-- | Creates a value of 'MonitoredResourceDescriptor' with the minimum fields required to make a request.
235+--
236+-- Use one of the following lenses to modify other fields as desired:
237+--
238+-- * 'mrdName'
239+--
240+-- * 'mrdDisplayName'
241+--
242+-- * 'mrdLabels'
243+--
244+-- * 'mrdType'
245+--
246+-- * 'mrdDescription'
247+monitoredResourceDescriptor
248+ :: MonitoredResourceDescriptor
249+monitoredResourceDescriptor =
250+ MonitoredResourceDescriptor'
251+ { _mrdName = Nothing
252+ , _mrdDisplayName = Nothing
253+ , _mrdLabels = Nothing
254+ , _mrdType = Nothing
255+ , _mrdDescription = Nothing
256+ }
257+
258+-- | Optional. The resource name of the monitored resource descriptor:
259+-- \`\"projects\/{project_id}\/monitoredResourceDescriptors\/{type}\"\`
260+-- where {type} is the value of the \`type\` field in this object and
261+-- {project_id} is a project ID that provides API-specific context for
262+-- accessing the type. APIs that do not use project information can use the
263+-- resource name format \`\"monitoredResourceDescriptors\/{type}\"\`.
264+mrdName :: Lens' MonitoredResourceDescriptor (Maybe Text)
265+mrdName = lens _mrdName (\ s a -> s{_mrdName = a})
266+
267+-- | Optional. A concise name for the monitored resource type that might be
268+-- displayed in user interfaces. It should be a Title Cased Noun Phrase,
269+-- without any article or other determiners. For example, \`\"Google Cloud
270+-- SQL Database\"\`.
271+mrdDisplayName :: Lens' MonitoredResourceDescriptor (Maybe Text)
272+mrdDisplayName
273+ = lens _mrdDisplayName
274+ (\ s a -> s{_mrdDisplayName = a})
275+
276+-- | Required. A set of labels used to describe instances of this monitored
277+-- resource type. For example, an individual Google Cloud SQL database is
278+-- identified by values for the labels \`\"database_id\"\` and
279+-- \`\"zone\"\`.
280+mrdLabels :: Lens' MonitoredResourceDescriptor [LabelDescriptor]
281+mrdLabels
282+ = lens _mrdLabels (\ s a -> s{_mrdLabels = a}) .
283+ _Default
284+ . _Coerce
285+
286+-- | Required. The monitored resource type. For example, the type
287+-- \`\"cloudsql_database\"\` represents databases in Google Cloud SQL. The
288+-- maximum length of this value is 256 characters.
289+mrdType :: Lens' MonitoredResourceDescriptor (Maybe Text)
290+mrdType = lens _mrdType (\ s a -> s{_mrdType = a})
291+
292+-- | Optional. A detailed description of the monitored resource type that
293+-- might be used in documentation.
294+mrdDescription :: Lens' MonitoredResourceDescriptor (Maybe Text)
295+mrdDescription
296+ = lens _mrdDescription
297+ (\ s a -> s{_mrdDescription = a})
298+
299+instance FromJSON MonitoredResourceDescriptor where
300+ parseJSON
301+ = withObject "MonitoredResourceDescriptor"
302+ (\ o ->
303+ MonitoredResourceDescriptor' <$>
304+ (o .:? "name") <*> (o .:? "displayName") <*>
305+ (o .:? "labels" .!= mempty)
306+ <*> (o .:? "type")
307+ <*> (o .:? "description"))
308+
309+instance ToJSON MonitoredResourceDescriptor where
310+ toJSON MonitoredResourceDescriptor'{..}
311+ = object
312+ (catMaybes
313+ [("name" .=) <$> _mrdName,
314+ ("displayName" .=) <$> _mrdDisplayName,
315+ ("labels" .=) <$> _mrdLabels,
316+ ("type" .=) <$> _mrdType,
317+ ("description" .=) <$> _mrdDescription])
318+
319+-- | A documentation rule provides information about individual API elements.
320+--
321+-- /See:/ 'documentationRule' smart constructor.
322+data DocumentationRule = DocumentationRule'
323+ { _drSelector :: !(Maybe Text)
324+ , _drDeprecationDescription :: !(Maybe Text)
325+ , _drDescription :: !(Maybe Text)
326+ } deriving (Eq,Show,Data,Typeable,Generic)
327+
328+-- | Creates a value of 'DocumentationRule' with the minimum fields required to make a request.
329+--
330+-- Use one of the following lenses to modify other fields as desired:
331+--
332+-- * 'drSelector'
333+--
334+-- * 'drDeprecationDescription'
335+--
336+-- * 'drDescription'
337+documentationRule
338+ :: DocumentationRule
339+documentationRule =
340+ DocumentationRule'
341+ { _drSelector = Nothing
342+ , _drDeprecationDescription = Nothing
343+ , _drDescription = Nothing
344+ }
345+
346+-- | The selector is a comma-separated list of patterns. Each pattern is a
347+-- qualified name of the element which may end in \"*\", indicating a
348+-- wildcard. Wildcards are only allowed at the end and for a whole
349+-- component of the qualified name, i.e. \"foo.*\" is ok, but not
350+-- \"foo.b*\" or \"foo.*.bar\". To specify a default for all applicable
351+-- elements, the whole pattern \"*\" is used.
352+drSelector :: Lens' DocumentationRule (Maybe Text)
353+drSelector
354+ = lens _drSelector (\ s a -> s{_drSelector = a})
355+
356+-- | Deprecation description of the selected element(s). It can be provided
357+-- if an element is marked as \`deprecated\`.
358+drDeprecationDescription :: Lens' DocumentationRule (Maybe Text)
359+drDeprecationDescription
360+ = lens _drDeprecationDescription
361+ (\ s a -> s{_drDeprecationDescription = a})
362+
363+-- | Description of the selected API(s).
364+drDescription :: Lens' DocumentationRule (Maybe Text)
365+drDescription
366+ = lens _drDescription
367+ (\ s a -> s{_drDescription = a})
368+
369+instance FromJSON DocumentationRule where
370+ parseJSON
371+ = withObject "DocumentationRule"
372+ (\ o ->
373+ DocumentationRule' <$>
374+ (o .:? "selector") <*>
375+ (o .:? "deprecationDescription")
376+ <*> (o .:? "description"))
377+
378+instance ToJSON DocumentationRule where
379+ toJSON DocumentationRule'{..}
380+ = object
381+ (catMaybes
382+ [("selector" .=) <$> _drSelector,
383+ ("deprecationDescription" .=) <$>
384+ _drDeprecationDescription,
385+ ("description" .=) <$> _drDescription])
386+
387+-- | The \`Status\` type defines a logical error model that is suitable for
388+-- different programming environments, including REST APIs and RPC APIs. It
389+-- is used by [gRPC](https:\/\/github.com\/grpc). The error model is
390+-- designed to be: - Simple to use and understand for most users - Flexible
391+-- enough to meet unexpected needs # Overview The \`Status\` message
392+-- contains three pieces of data: error code, error message, and error
393+-- details. The error code should be an enum value of google.rpc.Code, but
394+-- it may accept additional error codes if needed. The error message should
395+-- be a developer-facing English message that helps developers *understand*
396+-- and *resolve* the error. If a localized user-facing error message is
397+-- needed, put the localized message in the error details or localize it in
398+-- the client. The optional error details may contain arbitrary information
399+-- about the error. There is a predefined set of error detail types in the
400+-- package \`google.rpc\` which can be used for common error conditions. #
401+-- Language mapping The \`Status\` message is the logical representation of
402+-- the error model, but it is not necessarily the actual wire format. When
403+-- the \`Status\` message is exposed in different client libraries and
404+-- different wire protocols, it can be mapped differently. For example, it
405+-- will likely be mapped to some exceptions in Java, but more likely mapped
406+-- to some error codes in C. # Other uses The error model and the
407+-- \`Status\` message can be used in a variety of environments, either with
408+-- or without APIs, to provide a consistent developer experience across
409+-- different environments. Example uses of this error model include: -
410+-- Partial errors. If a service needs to return partial errors to the
411+-- client, it may embed the \`Status\` in the normal response to indicate
412+-- the partial errors. - Workflow errors. A typical workflow has multiple
413+-- steps. Each step may have a \`Status\` message for error reporting
414+-- purpose. - Batch operations. If a client uses batch request and batch
415+-- response, the \`Status\` message should be used directly inside batch
416+-- response, one for each error sub-response. - Asynchronous operations. If
417+-- an API call embeds asynchronous operation results in its response, the
418+-- status of those operations should be represented directly using the
419+-- \`Status\` message. - Logging. If some API errors are stored in logs,
420+-- the message \`Status\` could be used directly after any stripping needed
421+-- for security\/privacy reasons.
422+--
423+-- /See:/ 'status' smart constructor.
424+data Status = Status'
425+ { _sDetails :: !(Maybe [StatusDetailsItem])
426+ , _sCode :: !(Maybe (Textual Int32))
427+ , _sMessage :: !(Maybe Text)
428+ } deriving (Eq,Show,Data,Typeable,Generic)
429+
430+-- | Creates a value of 'Status' with the minimum fields required to make a request.
431+--
432+-- Use one of the following lenses to modify other fields as desired:
433+--
434+-- * 'sDetails'
435+--
436+-- * 'sCode'
437+--
438+-- * 'sMessage'
439+status
440+ :: Status
441+status =
442+ Status'
443+ { _sDetails = Nothing
444+ , _sCode = Nothing
445+ , _sMessage = Nothing
446+ }
447+
448+-- | A list of messages that carry the error details. There will be a common
449+-- set of message types for APIs to use.
450+sDetails :: Lens' Status [StatusDetailsItem]
451+sDetails
452+ = lens _sDetails (\ s a -> s{_sDetails = a}) .
453+ _Default
454+ . _Coerce
455+
456+-- | The status code, which should be an enum value of google.rpc.Code.
457+sCode :: Lens' Status (Maybe Int32)
458+sCode
459+ = lens _sCode (\ s a -> s{_sCode = a}) .
460+ mapping _Coerce
461+
462+-- | A developer-facing error message, which should be in English. Any
463+-- user-facing error message should be localized and sent in the
464+-- google.rpc.Status.details field, or localized by the client.
465+sMessage :: Lens' Status (Maybe Text)
466+sMessage = lens _sMessage (\ s a -> s{_sMessage = a})
467+
468+instance FromJSON Status where
469+ parseJSON
470+ = withObject "Status"
471+ (\ o ->
472+ Status' <$>
473+ (o .:? "details" .!= mempty) <*> (o .:? "code") <*>
474+ (o .:? "message"))
475+
476+instance ToJSON Status where
477+ toJSON Status'{..}
478+ = object
479+ (catMaybes
480+ [("details" .=) <$> _sDetails,
481+ ("code" .=) <$> _sCode,
482+ ("message" .=) <$> _sMessage])
483+
484+-- | Service-specific metadata associated with the operation. It typically
485+-- contains progress information and common metadata such as create time.
486+-- Some services might not provide such metadata. Any method that returns a
487+-- long-running operation should document the metadata type, if any.
488+--
489+-- /See:/ 'operationSchema' smart constructor.
490+newtype OperationSchema = OperationSchema'
491+ { _osAddtional :: HashMap Text JSONValue
492+ } deriving (Eq,Show,Data,Typeable,Generic)
493+
494+-- | Creates a value of 'OperationSchema' with the minimum fields required to make a request.
495+--
496+-- Use one of the following lenses to modify other fields as desired:
497+--
498+-- * 'osAddtional'
499+operationSchema
500+ :: HashMap Text JSONValue -- ^ 'osAddtional'
501+ -> OperationSchema
502+operationSchema pOsAddtional_ =
503+ OperationSchema'
504+ { _osAddtional = _Coerce # pOsAddtional_
505+ }
506+
507+-- | Properties of the object. Contains field \'type with type URL.
508+osAddtional :: Lens' OperationSchema (HashMap Text JSONValue)
509+osAddtional
510+ = lens _osAddtional (\ s a -> s{_osAddtional = a}) .
511+ _Coerce
512+
513+instance FromJSON OperationSchema where
514+ parseJSON
515+ = withObject "OperationSchema"
516+ (\ o -> OperationSchema' <$> (parseJSONObject o))
517+
518+instance ToJSON OperationSchema where
519+ toJSON = toJSON . _osAddtional
520+
521+-- | Response message for GenerateConfigReport method.
522+--
523+-- /See:/ 'generateConfigReportResponse' smart constructor.
524+data GenerateConfigReportResponse = GenerateConfigReportResponse'
525+ { _gcrrDiagnostics :: !(Maybe [Diagnostic])
526+ , _gcrrServiceName :: !(Maybe Text)
527+ , _gcrrId :: !(Maybe Text)
528+ , _gcrrChangeReports :: !(Maybe [ChangeReport])
529+ } deriving (Eq,Show,Data,Typeable,Generic)
530+
531+-- | Creates a value of 'GenerateConfigReportResponse' with the minimum fields required to make a request.
532+--
533+-- Use one of the following lenses to modify other fields as desired:
534+--
535+-- * 'gcrrDiagnostics'
536+--
537+-- * 'gcrrServiceName'
538+--
539+-- * 'gcrrId'
540+--
541+-- * 'gcrrChangeReports'
542+generateConfigReportResponse
543+ :: GenerateConfigReportResponse
544+generateConfigReportResponse =
545+ GenerateConfigReportResponse'
546+ { _gcrrDiagnostics = Nothing
547+ , _gcrrServiceName = Nothing
548+ , _gcrrId = Nothing
549+ , _gcrrChangeReports = Nothing
550+ }
551+
552+-- | Errors \/ Linter warnings associated with the service definition this
553+-- report belongs to.
554+gcrrDiagnostics :: Lens' GenerateConfigReportResponse [Diagnostic]
555+gcrrDiagnostics
556+ = lens _gcrrDiagnostics
557+ (\ s a -> s{_gcrrDiagnostics = a})
558+ . _Default
559+ . _Coerce
560+
561+-- | Name of the service this report belongs to.
562+gcrrServiceName :: Lens' GenerateConfigReportResponse (Maybe Text)
563+gcrrServiceName
564+ = lens _gcrrServiceName
565+ (\ s a -> s{_gcrrServiceName = a})
566+
567+-- | ID of the service configuration this report belongs to.
568+gcrrId :: Lens' GenerateConfigReportResponse (Maybe Text)
569+gcrrId = lens _gcrrId (\ s a -> s{_gcrrId = a})
570+
571+-- | list of ChangeReport, each corresponding to comparison between two
572+-- service configurations.
573+gcrrChangeReports :: Lens' GenerateConfigReportResponse [ChangeReport]
574+gcrrChangeReports
575+ = lens _gcrrChangeReports
576+ (\ s a -> s{_gcrrChangeReports = a})
577+ . _Default
578+ . _Coerce
579+
580+instance FromJSON GenerateConfigReportResponse where
581+ parseJSON
582+ = withObject "GenerateConfigReportResponse"
583+ (\ o ->
584+ GenerateConfigReportResponse' <$>
585+ (o .:? "diagnostics" .!= mempty) <*>
586+ (o .:? "serviceName")
587+ <*> (o .:? "id")
588+ <*> (o .:? "changeReports" .!= mempty))
589+
590+instance ToJSON GenerateConfigReportResponse where
591+ toJSON GenerateConfigReportResponse'{..}
592+ = object
593+ (catMaybes
594+ [("diagnostics" .=) <$> _gcrrDiagnostics,
595+ ("serviceName" .=) <$> _gcrrServiceName,
596+ ("id" .=) <$> _gcrrId,
597+ ("changeReports" .=) <$> _gcrrChangeReports])
598+
599+-- | Options for counters
600+--
601+-- /See:/ 'counterOptions' smart constructor.
602+data CounterOptions = CounterOptions'
603+ { _coField :: !(Maybe Text)
604+ , _coMetric :: !(Maybe Text)
605+ } deriving (Eq,Show,Data,Typeable,Generic)
606+
607+-- | Creates a value of 'CounterOptions' with the minimum fields required to make a request.
608+--
609+-- Use one of the following lenses to modify other fields as desired:
610+--
611+-- * 'coField'
612+--
613+-- * 'coMetric'
614+counterOptions
615+ :: CounterOptions
616+counterOptions =
617+ CounterOptions'
618+ { _coField = Nothing
619+ , _coMetric = Nothing
620+ }
621+
622+-- | The field value to attribute.
623+coField :: Lens' CounterOptions (Maybe Text)
624+coField = lens _coField (\ s a -> s{_coField = a})
625+
626+-- | The metric to update.
627+coMetric :: Lens' CounterOptions (Maybe Text)
628+coMetric = lens _coMetric (\ s a -> s{_coMetric = a})
629+
630+instance FromJSON CounterOptions where
631+ parseJSON
632+ = withObject "CounterOptions"
633+ (\ o ->
634+ CounterOptions' <$>
635+ (o .:? "field") <*> (o .:? "metric"))
636+
637+instance ToJSON CounterOptions where
638+ toJSON CounterOptions'{..}
639+ = object
640+ (catMaybes
641+ [("field" .=) <$> _coField,
642+ ("metric" .=) <$> _coMetric])
643+
644+-- | Do not use this. For media support, add instead
645+-- [][google.bytestream.RestByteStream] as an API to your configuration.
646+--
647+-- /See:/ 'mediaUpload' smart constructor.
648+newtype MediaUpload' = MediaUpload''
649+ { _muEnabled :: Maybe Bool
650+ } deriving (Eq,Show,Data,Typeable,Generic)
651+
652+-- | Creates a value of 'MediaUpload' with the minimum fields required to make a request.
653+--
654+-- Use one of the following lenses to modify other fields as desired:
655+--
656+-- * 'muEnabled'
657+mediaUpload
658+ :: MediaUpload'
659+mediaUpload =
660+ MediaUpload''
661+ { _muEnabled = Nothing
662+ }
663+
664+-- | Whether upload is enabled.
665+muEnabled :: Lens' MediaUpload' (Maybe Bool)
666+muEnabled
667+ = lens _muEnabled (\ s a -> s{_muEnabled = a})
668+
669+instance FromJSON MediaUpload' where
670+ parseJSON
671+ = withObject "MediaUpload"
672+ (\ o -> MediaUpload'' <$> (o .:? "enabled"))
673+
674+instance ToJSON MediaUpload' where
675+ toJSON MediaUpload''{..}
676+ = object (catMaybes [("enabled" .=) <$> _muEnabled])
677+
678+-- | Enables \"data access\" audit logging for a service and specifies a list
679+-- of members that are log-exempted.
680+--
681+-- /See:/ 'auditConfig' smart constructor.
682+data AuditConfig = AuditConfig'
683+ { _acService :: !(Maybe Text)
684+ , _acExemptedMembers :: !(Maybe [Text])
685+ } deriving (Eq,Show,Data,Typeable,Generic)
686+
687+-- | Creates a value of 'AuditConfig' with the minimum fields required to make a request.
688+--
689+-- Use one of the following lenses to modify other fields as desired:
690+--
691+-- * 'acService'
692+--
693+-- * 'acExemptedMembers'
694+auditConfig
695+ :: AuditConfig
696+auditConfig =
697+ AuditConfig'
698+ { _acService = Nothing
699+ , _acExemptedMembers = Nothing
700+ }
701+
702+-- | Specifies a service that will be enabled for \"data access\" audit
703+-- logging. For example, \`resourcemanager\`, \`storage\`, \`compute\`.
704+-- \`allServices\` is a special value that covers all services.
705+acService :: Lens' AuditConfig (Maybe Text)
706+acService
707+ = lens _acService (\ s a -> s{_acService = a})
708+
709+-- | Specifies the identities that are exempted from \"data access\" audit
710+-- logging for the \`service\` specified above. Follows the same format of
711+-- Binding.members.
712+acExemptedMembers :: Lens' AuditConfig [Text]
713+acExemptedMembers
714+ = lens _acExemptedMembers
715+ (\ s a -> s{_acExemptedMembers = a})
716+ . _Default
717+ . _Coerce
718+
719+instance FromJSON AuditConfig where
720+ parseJSON
721+ = withObject "AuditConfig"
722+ (\ o ->
723+ AuditConfig' <$>
724+ (o .:? "service") <*>
725+ (o .:? "exemptedMembers" .!= mempty))
726+
727+instance ToJSON AuditConfig where
728+ toJSON AuditConfig'{..}
729+ = object
730+ (catMaybes
731+ [("service" .=) <$> _acService,
732+ ("exemptedMembers" .=) <$> _acExemptedMembers])
733+
734+-- | Selects and configures the service controller used by the service. The
735+-- service controller handles features like abuse, quota, billing, logging,
736+-- monitoring, etc.
737+--
738+-- /See:/ 'control' smart constructor.
739+newtype Control = Control'
740+ { _cEnvironment :: Maybe Text
741+ } deriving (Eq,Show,Data,Typeable,Generic)
742+
743+-- | Creates a value of 'Control' with the minimum fields required to make a request.
744+--
745+-- Use one of the following lenses to modify other fields as desired:
746+--
747+-- * 'cEnvironment'
748+control
749+ :: Control
750+control =
751+ Control'
752+ { _cEnvironment = Nothing
753+ }
754+
755+-- | The service control environment to use. If empty, no control plane
756+-- feature (like quota and billing) will be enabled.
757+cEnvironment :: Lens' Control (Maybe Text)
758+cEnvironment
759+ = lens _cEnvironment (\ s a -> s{_cEnvironment = a})
760+
761+instance FromJSON Control where
762+ parseJSON
763+ = withObject "Control"
764+ (\ o -> Control' <$> (o .:? "environment"))
765+
766+instance ToJSON Control where
767+ toJSON Control'{..}
768+ = object
769+ (catMaybes [("environment" .=) <$> _cEnvironment])
770+
771+-- | Strategy used to delete a service. This strategy is a placeholder only
772+-- used by the system generated rollout to delete a service.
773+--
774+-- /See:/ 'deleteServiceStrategy' smart constructor.
775+data DeleteServiceStrategy =
776+ DeleteServiceStrategy'
777+ deriving (Eq,Show,Data,Typeable,Generic)
778+
779+-- | Creates a value of 'DeleteServiceStrategy' with the minimum fields required to make a request.
780+--
781+deleteServiceStrategy
782+ :: DeleteServiceStrategy
783+deleteServiceStrategy = DeleteServiceStrategy'
784+
785+instance FromJSON DeleteServiceStrategy where
786+ parseJSON
787+ = withObject "DeleteServiceStrategy"
788+ (\ o -> pure DeleteServiceStrategy')
789+
790+instance ToJSON DeleteServiceStrategy where
791+ toJSON = const emptyObject
792+
793+-- | User-defined authentication requirements, including support for [JSON
794+-- Web Token
795+-- (JWT)](https:\/\/tools.ietf.org\/html\/draft-ietf-oauth-json-web-token-32).
796+--
797+-- /See:/ 'authRequirement' smart constructor.
798+data AuthRequirement = AuthRequirement'
799+ { _arProviderId :: !(Maybe Text)
800+ , _arAudiences :: !(Maybe Text)
801+ } deriving (Eq,Show,Data,Typeable,Generic)
802+
803+-- | Creates a value of 'AuthRequirement' with the minimum fields required to make a request.
804+--
805+-- Use one of the following lenses to modify other fields as desired:
806+--
807+-- * 'arProviderId'
808+--
809+-- * 'arAudiences'
810+authRequirement
811+ :: AuthRequirement
812+authRequirement =
813+ AuthRequirement'
814+ { _arProviderId = Nothing
815+ , _arAudiences = Nothing
816+ }
817+
818+-- | id from authentication provider. Example: provider_id: bookstore_auth
819+arProviderId :: Lens' AuthRequirement (Maybe Text)
820+arProviderId
821+ = lens _arProviderId (\ s a -> s{_arProviderId = a})
822+
823+-- | The list of JWT
824+-- [audiences](https:\/\/tools.ietf.org\/html\/draft-ietf-oauth-json-web-token-32#section-4.1.3).
825+-- that are allowed to access. A JWT containing any of these audiences will
826+-- be accepted. When this setting is absent, only JWTs with audience
827+-- \"https:\/\/Service_name\/API_name\" will be accepted. For example, if
828+-- no audiences are in the setting, LibraryService API will only accept
829+-- JWTs with the following audience
830+-- \"https:\/\/library-example.googleapis.com\/google.example.library.v1.LibraryService\".
831+-- Example: audiences: bookstore_android.apps.googleusercontent.com,
832+-- bookstore_web.apps.googleusercontent.com
833+arAudiences :: Lens' AuthRequirement (Maybe Text)
834+arAudiences
835+ = lens _arAudiences (\ s a -> s{_arAudiences = a})
836+
837+instance FromJSON AuthRequirement where
838+ parseJSON
839+ = withObject "AuthRequirement"
840+ (\ o ->
841+ AuthRequirement' <$>
842+ (o .:? "providerId") <*> (o .:? "audiences"))
843+
844+instance ToJSON AuthRequirement where
845+ toJSON AuthRequirement'{..}
846+ = object
847+ (catMaybes
848+ [("providerId" .=) <$> _arProviderId,
849+ ("audiences" .=) <$> _arAudiences])
850+
851+-- | Response message for \`ListServices\` method.
852+--
853+-- /See:/ 'listServicesResponse' smart constructor.
854+data ListServicesResponse = ListServicesResponse'
855+ { _lsrNextPageToken :: !(Maybe Text)
856+ , _lsrServices :: !(Maybe [ManagedService])
857+ } deriving (Eq,Show,Data,Typeable,Generic)
858+
859+-- | Creates a value of 'ListServicesResponse' with the minimum fields required to make a request.
860+--
861+-- Use one of the following lenses to modify other fields as desired:
862+--
863+-- * 'lsrNextPageToken'
864+--
865+-- * 'lsrServices'
866+listServicesResponse
867+ :: ListServicesResponse
868+listServicesResponse =
869+ ListServicesResponse'
870+ { _lsrNextPageToken = Nothing
871+ , _lsrServices = Nothing
872+ }
873+
874+-- | Token that can be passed to \`ListServices\` to resume a paginated
875+-- query.
876+lsrNextPageToken :: Lens' ListServicesResponse (Maybe Text)
877+lsrNextPageToken
878+ = lens _lsrNextPageToken
879+ (\ s a -> s{_lsrNextPageToken = a})
880+
881+-- | The results of the query.
882+lsrServices :: Lens' ListServicesResponse [ManagedService]
883+lsrServices
884+ = lens _lsrServices (\ s a -> s{_lsrServices = a}) .
885+ _Default
886+ . _Coerce
887+
888+instance FromJSON ListServicesResponse where
889+ parseJSON
890+ = withObject "ListServicesResponse"
891+ (\ o ->
892+ ListServicesResponse' <$>
893+ (o .:? "nextPageToken") <*>
894+ (o .:? "services" .!= mempty))
895+
896+instance ToJSON ListServicesResponse where
897+ toJSON ListServicesResponse'{..}
898+ = object
899+ (catMaybes
900+ [("nextPageToken" .=) <$> _lsrNextPageToken,
901+ ("services" .=) <$> _lsrServices])
902+
903+-- | \`Context\` defines which contexts an API requests. Example: context:
904+-- rules: - selector: \"*\" requested: - google.rpc.context.ProjectContext
905+-- - google.rpc.context.OriginContext The above specifies that all methods
906+-- in the API request \`google.rpc.context.ProjectContext\` and
907+-- \`google.rpc.context.OriginContext\`. Available context types are
908+-- defined in package \`google.rpc.context\`.
909+--
910+-- /See:/ 'context' smart constructor.
911+newtype Context = Context'
912+ { _cRules :: Maybe [ContextRule]
913+ } deriving (Eq,Show,Data,Typeable,Generic)
914+
915+-- | Creates a value of 'Context' with the minimum fields required to make a request.
916+--
917+-- Use one of the following lenses to modify other fields as desired:
918+--
919+-- * 'cRules'
920+context
921+ :: Context
922+context =
923+ Context'
924+ { _cRules = Nothing
925+ }
926+
927+-- | A list of RPC context rules that apply to individual API methods.
928+-- **NOTE:** All service configuration rules follow \"last one wins\"
929+-- order.
930+cRules :: Lens' Context [ContextRule]
931+cRules
932+ = lens _cRules (\ s a -> s{_cRules = a}) . _Default .
933+ _Coerce
934+
935+instance FromJSON Context where
936+ parseJSON
937+ = withObject "Context"
938+ (\ o -> Context' <$> (o .:? "rules" .!= mempty))
939+
940+instance ToJSON Context where
941+ toJSON Context'{..}
942+ = object (catMaybes [("rules" .=) <$> _cRules])
943+
944+-- | Configuration of a specific logging destination (the producer project or
945+-- the consumer project).
946+--
947+-- /See:/ 'loggingDestination' smart constructor.
948+data LoggingDestination = LoggingDestination'
949+ { _ldMonitoredResource :: !(Maybe Text)
950+ , _ldLogs :: !(Maybe [Text])
951+ } deriving (Eq,Show,Data,Typeable,Generic)
952+
953+-- | Creates a value of 'LoggingDestination' with the minimum fields required to make a request.
954+--
955+-- Use one of the following lenses to modify other fields as desired:
956+--
957+-- * 'ldMonitoredResource'
958+--
959+-- * 'ldLogs'
960+loggingDestination
961+ :: LoggingDestination
962+loggingDestination =
963+ LoggingDestination'
964+ { _ldMonitoredResource = Nothing
965+ , _ldLogs = Nothing
966+ }
967+
968+-- | The monitored resource type. The type must be defined in the
969+-- Service.monitored_resources section.
970+ldMonitoredResource :: Lens' LoggingDestination (Maybe Text)
971+ldMonitoredResource
972+ = lens _ldMonitoredResource
973+ (\ s a -> s{_ldMonitoredResource = a})
974+
975+-- | Names of the logs to be sent to this destination. Each name must be
976+-- defined in the Service.logs section. If the log name is not a domain
977+-- scoped name, it will be automatically prefixed with the service name
978+-- followed by \"\/\".
979+ldLogs :: Lens' LoggingDestination [Text]
980+ldLogs
981+ = lens _ldLogs (\ s a -> s{_ldLogs = a}) . _Default .
982+ _Coerce
983+
984+instance FromJSON LoggingDestination where
985+ parseJSON
986+ = withObject "LoggingDestination"
987+ (\ o ->
988+ LoggingDestination' <$>
989+ (o .:? "monitoredResource") <*>
990+ (o .:? "logs" .!= mempty))
991+
992+instance ToJSON LoggingDestination where
993+ toJSON LoggingDestination'{..}
994+ = object
995+ (catMaybes
996+ [("monitoredResource" .=) <$> _ldMonitoredResource,
997+ ("logs" .=) <$> _ldLogs])
998+
999+-- | Defines a metric type and its schema.
1000+--
1001+-- /See:/ 'metricDescriptor' smart constructor.
1002+data MetricDescriptor = MetricDescriptor'
1003+ { _mdMetricKind :: !(Maybe MetricDescriptorMetricKind)
1004+ , _mdName :: !(Maybe Text)
1005+ , _mdDisplayName :: !(Maybe Text)
1006+ , _mdLabels :: !(Maybe [LabelDescriptor])
1007+ , _mdType :: !(Maybe Text)
1008+ , _mdValueType :: !(Maybe MetricDescriptorValueType)
1009+ , _mdDescription :: !(Maybe Text)
1010+ , _mdUnit :: !(Maybe Text)
1011+ } deriving (Eq,Show,Data,Typeable,Generic)
1012+
1013+-- | Creates a value of 'MetricDescriptor' with the minimum fields required to make a request.
1014+--
1015+-- Use one of the following lenses to modify other fields as desired:
1016+--
1017+-- * 'mdMetricKind'
1018+--
1019+-- * 'mdName'
1020+--
1021+-- * 'mdDisplayName'
1022+--
1023+-- * 'mdLabels'
1024+--
1025+-- * 'mdType'
1026+--
1027+-- * 'mdValueType'
1028+--
1029+-- * 'mdDescription'
1030+--
1031+-- * 'mdUnit'
1032+metricDescriptor
1033+ :: MetricDescriptor
1034+metricDescriptor =
1035+ MetricDescriptor'
1036+ { _mdMetricKind = Nothing
1037+ , _mdName = Nothing
1038+ , _mdDisplayName = Nothing
1039+ , _mdLabels = Nothing
1040+ , _mdType = Nothing
1041+ , _mdValueType = Nothing
1042+ , _mdDescription = Nothing
1043+ , _mdUnit = Nothing
1044+ }
1045+
1046+-- | Whether the metric records instantaneous values, changes to a value,
1047+-- etc. Some combinations of \`metric_kind\` and \`value_type\` might not
1048+-- be supported.
1049+mdMetricKind :: Lens' MetricDescriptor (Maybe MetricDescriptorMetricKind)
1050+mdMetricKind
1051+ = lens _mdMetricKind (\ s a -> s{_mdMetricKind = a})
1052+
1053+-- | Resource name. The format of the name may vary between different
1054+-- implementations. For examples:
1055+-- projects\/{project_id}\/metricDescriptors\/{type=**}
1056+-- metricDescriptors\/{type=**}
1057+mdName :: Lens' MetricDescriptor (Maybe Text)
1058+mdName = lens _mdName (\ s a -> s{_mdName = a})
1059+
1060+-- | A concise name for the metric, which can be displayed in user
1061+-- interfaces. Use sentence case without an ending period, for example
1062+-- \"Request count\".
1063+mdDisplayName :: Lens' MetricDescriptor (Maybe Text)
1064+mdDisplayName
1065+ = lens _mdDisplayName
1066+ (\ s a -> s{_mdDisplayName = a})
1067+
1068+-- | The set of labels that can be used to describe a specific instance of
1069+-- this metric type. For example, the
1070+-- \`compute.googleapis.com\/instance\/network\/received_bytes_count\`
1071+-- metric type has a label, \`loadbalanced\`, that specifies whether the
1072+-- traffic was received through a load balanced IP address.
1073+mdLabels :: Lens' MetricDescriptor [LabelDescriptor]
1074+mdLabels
1075+ = lens _mdLabels (\ s a -> s{_mdLabels = a}) .
1076+ _Default
1077+ . _Coerce
1078+
1079+-- | The metric type including a DNS name prefix, for example
1080+-- \`\"compute.googleapis.com\/instance\/cpu\/utilization\"\`. Metric types
1081+-- should use a natural hierarchical grouping such as the following:
1082+-- compute.googleapis.com\/instance\/cpu\/utilization
1083+-- compute.googleapis.com\/instance\/disk\/read_ops_count
1084+-- compute.googleapis.com\/instance\/network\/received_bytes_count Note
1085+-- that if the metric type changes, the monitoring data will be
1086+-- discontinued, and anything depends on it will break, such as monitoring
1087+-- dashboards, alerting rules and quota limits. Therefore, once a metric
1088+-- has been published, its type should be immutable.
1089+mdType :: Lens' MetricDescriptor (Maybe Text)
1090+mdType = lens _mdType (\ s a -> s{_mdType = a})
1091+
1092+-- | Whether the measurement is an integer, a floating-point number, etc.
1093+-- Some combinations of \`metric_kind\` and \`value_type\` might not be
1094+-- supported.
1095+mdValueType :: Lens' MetricDescriptor (Maybe MetricDescriptorValueType)
1096+mdValueType
1097+ = lens _mdValueType (\ s a -> s{_mdValueType = a})
1098+
1099+-- | A detailed description of the metric, which can be used in
1100+-- documentation.
1101+mdDescription :: Lens' MetricDescriptor (Maybe Text)
1102+mdDescription
1103+ = lens _mdDescription
1104+ (\ s a -> s{_mdDescription = a})
1105+
1106+-- | The unit in which the metric value is reported. It is only applicable if
1107+-- the \`value_type\` is \`INT64\`, \`DOUBLE\`, or \`DISTRIBUTION\`. The
1108+-- supported units are a subset of [The Unified Code for Units of
1109+-- Measure](http:\/\/unitsofmeasure.org\/ucum.html) standard: **Basic units
1110+-- (UNIT)** * \`bit\` bit * \`By\` byte * \`s\` second * \`min\` minute *
1111+-- \`h\` hour * \`d\` day **Prefixes (PREFIX)** * \`k\` kilo (10**3) *
1112+-- \`M\` mega (10**6) * \`G\` giga (10**9) * \`T\` tera (10**12) * \`P\`
1113+-- peta (10**15) * \`E\` exa (10**18) * \`Z\` zetta (10**21) * \`Y\` yotta
1114+-- (10**24) * \`m\` milli (10**-3) * \`u\` micro (10**-6) * \`n\` nano
1115+-- (10**-9) * \`p\` pico (10**-12) * \`f\` femto (10**-15) * \`a\` atto
1116+-- (10**-18) * \`z\` zepto (10**-21) * \`y\` yocto (10**-24) * \`Ki\` kibi
1117+-- (2**10) * \`Mi\` mebi (2**20) * \`Gi\` gibi (2**30) * \`Ti\` tebi
1118+-- (2**40) **Grammar** The grammar includes the dimensionless unit \`1\`,
1119+-- such as \`1\/s\`. The grammar also includes these connectors: * \`\/\`
1120+-- division (as an infix operator, e.g. \`1\/s\`). * \`.\` multiplication
1121+-- (as an infix operator, e.g. \`GBy.d\`) The grammar for a unit is as
1122+-- follows: Expression = Component { \".\" Component } { \"\/\" Component }
1123+-- ; Component = [ PREFIX ] UNIT [ Annotation ] | Annotation | \"1\" ;
1124+-- Annotation = \"{\" NAME \"}\" ; Notes: * \`Annotation\` is just a
1125+-- comment if it follows a \`UNIT\` and is equivalent to \`1\` if it is
1126+-- used alone. For examples, \`{requests}\/s == 1\/s\`,
1127+-- \`By{transmitted}\/s == By\/s\`. * \`NAME\` is a sequence of non-blank
1128+-- printable ASCII characters not containing \'{\' or \'}\'.
1129+mdUnit :: Lens' MetricDescriptor (Maybe Text)
1130+mdUnit = lens _mdUnit (\ s a -> s{_mdUnit = a})
1131+
1132+instance FromJSON MetricDescriptor where
1133+ parseJSON
1134+ = withObject "MetricDescriptor"
1135+ (\ o ->
1136+ MetricDescriptor' <$>
1137+ (o .:? "metricKind") <*> (o .:? "name") <*>
1138+ (o .:? "displayName")
1139+ <*> (o .:? "labels" .!= mempty)
1140+ <*> (o .:? "type")
1141+ <*> (o .:? "valueType")
1142+ <*> (o .:? "description")
1143+ <*> (o .:? "unit"))
1144+
1145+instance ToJSON MetricDescriptor where
1146+ toJSON MetricDescriptor'{..}
1147+ = object
1148+ (catMaybes
1149+ [("metricKind" .=) <$> _mdMetricKind,
1150+ ("name" .=) <$> _mdName,
1151+ ("displayName" .=) <$> _mdDisplayName,
1152+ ("labels" .=) <$> _mdLabels, ("type" .=) <$> _mdType,
1153+ ("valueType" .=) <$> _mdValueType,
1154+ ("description" .=) <$> _mdDescription,
1155+ ("unit" .=) <$> _mdUnit])
1156+
1157+-- | Request message for \`GetIamPolicy\` method.
1158+--
1159+-- /See:/ 'getIAMPolicyRequest' smart constructor.
1160+data GetIAMPolicyRequest =
1161+ GetIAMPolicyRequest'
1162+ deriving (Eq,Show,Data,Typeable,Generic)
1163+
1164+-- | Creates a value of 'GetIAMPolicyRequest' with the minimum fields required to make a request.
1165+--
1166+getIAMPolicyRequest
1167+ :: GetIAMPolicyRequest
1168+getIAMPolicyRequest = GetIAMPolicyRequest'
1169+
1170+instance FromJSON GetIAMPolicyRequest where
1171+ parseJSON
1172+ = withObject "GetIAMPolicyRequest"
1173+ (\ o -> pure GetIAMPolicyRequest')
1174+
1175+instance ToJSON GetIAMPolicyRequest where
1176+ toJSON = const emptyObject
1177+
1178+-- | A backend rule provides configuration for an individual API element.
1179+--
1180+-- /See:/ 'backendRule' smart constructor.
1181+data BackendRule = BackendRule'
1182+ { _brSelector :: !(Maybe Text)
1183+ , _brAddress :: !(Maybe Text)
1184+ , _brDeadline :: !(Maybe (Textual Double))
1185+ } deriving (Eq,Show,Data,Typeable,Generic)
1186+
1187+-- | Creates a value of 'BackendRule' with the minimum fields required to make a request.
1188+--
1189+-- Use one of the following lenses to modify other fields as desired:
1190+--
1191+-- * 'brSelector'
1192+--
1193+-- * 'brAddress'
1194+--
1195+-- * 'brDeadline'
1196+backendRule
1197+ :: BackendRule
1198+backendRule =
1199+ BackendRule'
1200+ { _brSelector = Nothing
1201+ , _brAddress = Nothing
1202+ , _brDeadline = Nothing
1203+ }
1204+
1205+-- | Selects the methods to which this rule applies. Refer to selector for
1206+-- syntax details.
1207+brSelector :: Lens' BackendRule (Maybe Text)
1208+brSelector
1209+ = lens _brSelector (\ s a -> s{_brSelector = a})
1210+
1211+-- | The address of the API backend.
1212+brAddress :: Lens' BackendRule (Maybe Text)
1213+brAddress
1214+ = lens _brAddress (\ s a -> s{_brAddress = a})
1215+
1216+-- | The number of seconds to wait for a response from a request. The default
1217+-- depends on the deployment context.
1218+brDeadline :: Lens' BackendRule (Maybe Double)
1219+brDeadline
1220+ = lens _brDeadline (\ s a -> s{_brDeadline = a}) .
1221+ mapping _Coerce
1222+
1223+instance FromJSON BackendRule where
1224+ parseJSON
1225+ = withObject "BackendRule"
1226+ (\ o ->
1227+ BackendRule' <$>
1228+ (o .:? "selector") <*> (o .:? "address") <*>
1229+ (o .:? "deadline"))
1230+
1231+instance ToJSON BackendRule where
1232+ toJSON BackendRule'{..}
1233+ = object
1234+ (catMaybes
1235+ [("selector" .=) <$> _brSelector,
1236+ ("address" .=) <$> _brAddress,
1237+ ("deadline" .=) <$> _brDeadline])
1238+
1239+-- | Request message for SubmitConfigSource method.
1240+--
1241+-- /See:/ 'submitConfigSourceRequest' smart constructor.
1242+data SubmitConfigSourceRequest = SubmitConfigSourceRequest'
1243+ { _scsrValidateOnly :: !(Maybe Bool)
1244+ , _scsrConfigSource :: !(Maybe ConfigSource)
1245+ } deriving (Eq,Show,Data,Typeable,Generic)
1246+
1247+-- | Creates a value of 'SubmitConfigSourceRequest' with the minimum fields required to make a request.
1248+--
1249+-- Use one of the following lenses to modify other fields as desired:
1250+--
1251+-- * 'scsrValidateOnly'
1252+--
1253+-- * 'scsrConfigSource'
1254+submitConfigSourceRequest
1255+ :: SubmitConfigSourceRequest
1256+submitConfigSourceRequest =
1257+ SubmitConfigSourceRequest'
1258+ { _scsrValidateOnly = Nothing
1259+ , _scsrConfigSource = Nothing
1260+ }
1261+
1262+-- | Optional. If set, this will result in the generation of a
1263+-- \`google.api.Service\` configuration based on the \`ConfigSource\`
1264+-- provided, but the generated config and the sources will NOT be
1265+-- persisted.
1266+scsrValidateOnly :: Lens' SubmitConfigSourceRequest (Maybe Bool)
1267+scsrValidateOnly
1268+ = lens _scsrValidateOnly
1269+ (\ s a -> s{_scsrValidateOnly = a})
1270+
1271+-- | The source configuration for the service.
1272+scsrConfigSource :: Lens' SubmitConfigSourceRequest (Maybe ConfigSource)
1273+scsrConfigSource
1274+ = lens _scsrConfigSource
1275+ (\ s a -> s{_scsrConfigSource = a})
1276+
1277+instance FromJSON SubmitConfigSourceRequest where
1278+ parseJSON
1279+ = withObject "SubmitConfigSourceRequest"
1280+ (\ o ->
1281+ SubmitConfigSourceRequest' <$>
1282+ (o .:? "validateOnly") <*> (o .:? "configSource"))
1283+
1284+instance ToJSON SubmitConfigSourceRequest where
1285+ toJSON SubmitConfigSourceRequest'{..}
1286+ = object
1287+ (catMaybes
1288+ [("validateOnly" .=) <$> _scsrValidateOnly,
1289+ ("configSource" .=) <$> _scsrConfigSource])
1290+
1291+-- | \`SourceContext\` represents information about the source of a protobuf
1292+-- element, like the file in which it is defined.
1293+--
1294+-- /See:/ 'sourceContext' smart constructor.
1295+newtype SourceContext = SourceContext'
1296+ { _scFileName :: Maybe Text
1297+ } deriving (Eq,Show,Data,Typeable,Generic)
1298+
1299+-- | Creates a value of 'SourceContext' with the minimum fields required to make a request.
1300+--
1301+-- Use one of the following lenses to modify other fields as desired:
1302+--
1303+-- * 'scFileName'
1304+sourceContext
1305+ :: SourceContext
1306+sourceContext =
1307+ SourceContext'
1308+ { _scFileName = Nothing
1309+ }
1310+
1311+-- | The path-qualified name of the .proto file that contained the associated
1312+-- protobuf element. For example:
1313+-- \`\"google\/protobuf\/source_context.proto\"\`.
1314+scFileName :: Lens' SourceContext (Maybe Text)
1315+scFileName
1316+ = lens _scFileName (\ s a -> s{_scFileName = a})
1317+
1318+instance FromJSON SourceContext where
1319+ parseJSON
1320+ = withObject "SourceContext"
1321+ (\ o -> SourceContext' <$> (o .:? "fileName"))
1322+
1323+instance ToJSON SourceContext where
1324+ toJSON SourceContext'{..}
1325+ = object
1326+ (catMaybes [("fileName" .=) <$> _scFileName])
1327+
1328+-- | A single field of a message type.
1329+--
1330+-- /See:/ 'field' smart constructor.
1331+data Field = Field'
1332+ { _fKind :: !(Maybe FieldKind)
1333+ , _fOneofIndex :: !(Maybe (Textual Int32))
1334+ , _fName :: !(Maybe Text)
1335+ , _fJSONName :: !(Maybe Text)
1336+ , _fCardinality :: !(Maybe FieldCardinality)
1337+ , _fOptions :: !(Maybe [Option])
1338+ , _fPacked :: !(Maybe Bool)
1339+ , _fDefaultValue :: !(Maybe Text)
1340+ , _fNumber :: !(Maybe (Textual Int32))
1341+ , _fTypeURL :: !(Maybe Text)
1342+ } deriving (Eq,Show,Data,Typeable,Generic)
1343+
1344+-- | Creates a value of 'Field' with the minimum fields required to make a request.
1345+--
1346+-- Use one of the following lenses to modify other fields as desired:
1347+--
1348+-- * 'fKind'
1349+--
1350+-- * 'fOneofIndex'
1351+--
1352+-- * 'fName'
1353+--
1354+-- * 'fJSONName'
1355+--
1356+-- * 'fCardinality'
1357+--
1358+-- * 'fOptions'
1359+--
1360+-- * 'fPacked'
1361+--
1362+-- * 'fDefaultValue'
1363+--
1364+-- * 'fNumber'
1365+--
1366+-- * 'fTypeURL'
1367+field
1368+ :: Field
1369+field =
1370+ Field'
1371+ { _fKind = Nothing
1372+ , _fOneofIndex = Nothing
1373+ , _fName = Nothing
1374+ , _fJSONName = Nothing
1375+ , _fCardinality = Nothing
1376+ , _fOptions = Nothing
1377+ , _fPacked = Nothing
1378+ , _fDefaultValue = Nothing
1379+ , _fNumber = Nothing
1380+ , _fTypeURL = Nothing
1381+ }
1382+
1383+-- | The field type.
1384+fKind :: Lens' Field (Maybe FieldKind)
1385+fKind = lens _fKind (\ s a -> s{_fKind = a})
1386+
1387+-- | The index of the field type in \`Type.oneofs\`, for message or
1388+-- enumeration types. The first type has index 1; zero means the type is
1389+-- not in the list.
1390+fOneofIndex :: Lens' Field (Maybe Int32)
1391+fOneofIndex
1392+ = lens _fOneofIndex (\ s a -> s{_fOneofIndex = a}) .
1393+ mapping _Coerce
1394+
1395+-- | The field name.
1396+fName :: Lens' Field (Maybe Text)
1397+fName = lens _fName (\ s a -> s{_fName = a})
1398+
1399+-- | The field JSON name.
1400+fJSONName :: Lens' Field (Maybe Text)
1401+fJSONName
1402+ = lens _fJSONName (\ s a -> s{_fJSONName = a})
1403+
1404+-- | The field cardinality.
1405+fCardinality :: Lens' Field (Maybe FieldCardinality)
1406+fCardinality
1407+ = lens _fCardinality (\ s a -> s{_fCardinality = a})
1408+
1409+-- | The protocol buffer options.
1410+fOptions :: Lens' Field [Option]
1411+fOptions
1412+ = lens _fOptions (\ s a -> s{_fOptions = a}) .
1413+ _Default
1414+ . _Coerce
1415+
1416+-- | Whether to use alternative packed wire representation.
1417+fPacked :: Lens' Field (Maybe Bool)
1418+fPacked = lens _fPacked (\ s a -> s{_fPacked = a})
1419+
1420+-- | The string value of the default value of this field. Proto2 syntax only.
1421+fDefaultValue :: Lens' Field (Maybe Text)
1422+fDefaultValue
1423+ = lens _fDefaultValue
1424+ (\ s a -> s{_fDefaultValue = a})
1425+
1426+-- | The field number.
1427+fNumber :: Lens' Field (Maybe Int32)
1428+fNumber
1429+ = lens _fNumber (\ s a -> s{_fNumber = a}) .
1430+ mapping _Coerce
1431+
1432+-- | The field type URL, without the scheme, for message or enumeration
1433+-- types. Example: \`\"type.googleapis.com\/google.protobuf.Timestamp\"\`.
1434+fTypeURL :: Lens' Field (Maybe Text)
1435+fTypeURL = lens _fTypeURL (\ s a -> s{_fTypeURL = a})
1436+
1437+instance FromJSON Field where
1438+ parseJSON
1439+ = withObject "Field"
1440+ (\ o ->
1441+ Field' <$>
1442+ (o .:? "kind") <*> (o .:? "oneofIndex") <*>
1443+ (o .:? "name")
1444+ <*> (o .:? "jsonName")
1445+ <*> (o .:? "cardinality")
1446+ <*> (o .:? "options" .!= mempty)
1447+ <*> (o .:? "packed")
1448+ <*> (o .:? "defaultValue")
1449+ <*> (o .:? "number")
1450+ <*> (o .:? "typeUrl"))
1451+
1452+instance ToJSON Field where
1453+ toJSON Field'{..}
1454+ = object
1455+ (catMaybes
1456+ [("kind" .=) <$> _fKind,
1457+ ("oneofIndex" .=) <$> _fOneofIndex,
1458+ ("name" .=) <$> _fName,
1459+ ("jsonName" .=) <$> _fJSONName,
1460+ ("cardinality" .=) <$> _fCardinality,
1461+ ("options" .=) <$> _fOptions,
1462+ ("packed" .=) <$> _fPacked,
1463+ ("defaultValue" .=) <$> _fDefaultValue,
1464+ ("number" .=) <$> _fNumber,
1465+ ("typeUrl" .=) <$> _fTypeURL])
1466+
1467+-- | Strategy that specifies how Google Service Control should select
1468+-- different versions of service configurations based on traffic
1469+-- percentage. One example of how to gradually rollout a new service
1470+-- configuration using this strategy: Day 1 Rollout { id:
1471+-- \"example.googleapis.com\/rollout_20160206\" traffic_percent_strategy {
1472+-- percentages: { \"example.googleapis.com\/20160201\": 70.00
1473+-- \"example.googleapis.com\/20160206\": 30.00 } } } Day 2 Rollout { id:
1474+-- \"example.googleapis.com\/rollout_20160207\" traffic_percent_strategy: {
1475+-- percentages: { \"example.googleapis.com\/20160206\": 100.00 } } }
1476+--
1477+-- /See:/ 'trafficPercentStrategy' smart constructor.
1478+newtype TrafficPercentStrategy = TrafficPercentStrategy'
1479+ { _tpsPercentages :: Maybe TrafficPercentStrategyPercentages
1480+ } deriving (Eq,Show,Data,Typeable,Generic)
1481+
1482+-- | Creates a value of 'TrafficPercentStrategy' with the minimum fields required to make a request.
1483+--
1484+-- Use one of the following lenses to modify other fields as desired:
1485+--
1486+-- * 'tpsPercentages'
1487+trafficPercentStrategy
1488+ :: TrafficPercentStrategy
1489+trafficPercentStrategy =
1490+ TrafficPercentStrategy'
1491+ { _tpsPercentages = Nothing
1492+ }
1493+
1494+-- | Maps service configuration IDs to their corresponding traffic
1495+-- percentage. Key is the service configuration ID, Value is the traffic
1496+-- percentage which must be greater than 0.0 and the sum must equal to
1497+-- 100.0.
1498+tpsPercentages :: Lens' TrafficPercentStrategy (Maybe TrafficPercentStrategyPercentages)
1499+tpsPercentages
1500+ = lens _tpsPercentages
1501+ (\ s a -> s{_tpsPercentages = a})
1502+
1503+instance FromJSON TrafficPercentStrategy where
1504+ parseJSON
1505+ = withObject "TrafficPercentStrategy"
1506+ (\ o ->
1507+ TrafficPercentStrategy' <$> (o .:? "percentages"))
1508+
1509+instance ToJSON TrafficPercentStrategy where
1510+ toJSON TrafficPercentStrategy'{..}
1511+ = object
1512+ (catMaybes [("percentages" .=) <$> _tpsPercentages])
1513+
1514+-- | \`Service\` is the root object of Google service configuration schema.
1515+-- It describes basic information about a service, such as the name and the
1516+-- title, and delegates other aspects to sub-sections. Each sub-section is
1517+-- either a proto message or a repeated proto message that configures a
1518+-- specific aspect, such as auth. See each proto message definition for
1519+-- details. Example: type: google.api.Service config_version: 3 name:
1520+-- calendar.googleapis.com title: Google Calendar API apis: - name:
1521+-- google.calendar.v3.Calendar backend: rules: - selector:
1522+-- \"google.calendar.v3.*\" address: calendar.example.com
1523+--
1524+-- /See:/ 'service' smart constructor.
1525+data Service = Service'
1526+ { _sControl :: !(Maybe Control)
1527+ , _sMetrics :: !(Maybe [MetricDescriptor])
1528+ , _sContext :: !(Maybe Context)
1529+ , _sAuthentication :: !(Maybe Authentication)
1530+ , _sAPIs :: !(Maybe [API])
1531+ , _sTypes :: !(Maybe [Type])
1532+ , _sAnalytics :: !(Maybe Analytics)
1533+ , _sVisibility :: !(Maybe Visibility)
1534+ , _sSystemTypes :: !(Maybe [Type])
1535+ , _sMonitoredResources :: !(Maybe [MonitoredResourceDescriptor])
1536+ , _sBackend :: !(Maybe Backend)
1537+ , _sMonitoring :: !(Maybe Monitoring)
1538+ , _sName :: !(Maybe Text)
1539+ , _sSystemParameters :: !(Maybe SystemParameters)
1540+ , _sLogs :: !(Maybe [LogDescriptor])
1541+ , _sDocumentation :: !(Maybe Documentation)
1542+ , _sId :: !(Maybe Text)
1543+ , _sUsage :: !(Maybe Usage)
1544+ , _sEndpoints :: !(Maybe [Endpoint])
1545+ , _sEnums :: !(Maybe [Enum])
1546+ , _sConfigVersion :: !(Maybe (Textual Word32))
1547+ , _sHTTP :: !(Maybe HTTP)
1548+ , _sTitle :: !(Maybe Text)
1549+ , _sProducerProjectId :: !(Maybe Text)
1550+ , _sCustomError :: !(Maybe CustomError)
1551+ , _sLogging :: !(Maybe Logging)
1552+ } deriving (Eq,Show,Data,Typeable,Generic)
1553+
1554+-- | Creates a value of 'Service' with the minimum fields required to make a request.
1555+--
1556+-- Use one of the following lenses to modify other fields as desired:
1557+--
1558+-- * 'sControl'
1559+--
1560+-- * 'sMetrics'
1561+--
1562+-- * 'sContext'
1563+--
1564+-- * 'sAuthentication'
1565+--
1566+-- * 'sAPIs'
1567+--
1568+-- * 'sTypes'
1569+--
1570+-- * 'sAnalytics'
1571+--
1572+-- * 'sVisibility'
1573+--
1574+-- * 'sSystemTypes'
1575+--
1576+-- * 'sMonitoredResources'
1577+--
1578+-- * 'sBackend'
1579+--
1580+-- * 'sMonitoring'
1581+--
1582+-- * 'sName'
1583+--
1584+-- * 'sSystemParameters'
1585+--
1586+-- * 'sLogs'
1587+--
1588+-- * 'sDocumentation'
1589+--
1590+-- * 'sId'
1591+--
1592+-- * 'sUsage'
1593+--
1594+-- * 'sEndpoints'
1595+--
1596+-- * 'sEnums'
1597+--
1598+-- * 'sConfigVersion'
1599+--
1600+-- * 'sHTTP'
1601+--
1602+-- * 'sTitle'
1603+--
1604+-- * 'sProducerProjectId'
1605+--
1606+-- * 'sCustomError'
1607+--
1608+-- * 'sLogging'
1609+service
1610+ :: Service
1611+service =
1612+ Service'
1613+ { _sControl = Nothing
1614+ , _sMetrics = Nothing
1615+ , _sContext = Nothing
1616+ , _sAuthentication = Nothing
1617+ , _sAPIs = Nothing
1618+ , _sTypes = Nothing
1619+ , _sAnalytics = Nothing
1620+ , _sVisibility = Nothing
1621+ , _sSystemTypes = Nothing
1622+ , _sMonitoredResources = Nothing
1623+ , _sBackend = Nothing
1624+ , _sMonitoring = Nothing
1625+ , _sName = Nothing
1626+ , _sSystemParameters = Nothing
1627+ , _sLogs = Nothing
1628+ , _sDocumentation = Nothing
1629+ , _sId = Nothing
1630+ , _sUsage = Nothing
1631+ , _sEndpoints = Nothing
1632+ , _sEnums = Nothing
1633+ , _sConfigVersion = Nothing
1634+ , _sHTTP = Nothing
1635+ , _sTitle = Nothing
1636+ , _sProducerProjectId = Nothing
1637+ , _sCustomError = Nothing
1638+ , _sLogging = Nothing
1639+ }
1640+
1641+-- | Configuration for the service control plane.
1642+sControl :: Lens' Service (Maybe Control)
1643+sControl = lens _sControl (\ s a -> s{_sControl = a})
1644+
1645+-- | Defines the metrics used by this service.
1646+sMetrics :: Lens' Service [MetricDescriptor]
1647+sMetrics
1648+ = lens _sMetrics (\ s a -> s{_sMetrics = a}) .
1649+ _Default
1650+ . _Coerce
1651+
1652+-- | Context configuration.
1653+sContext :: Lens' Service (Maybe Context)
1654+sContext = lens _sContext (\ s a -> s{_sContext = a})
1655+
1656+-- | Auth configuration.
1657+sAuthentication :: Lens' Service (Maybe Authentication)
1658+sAuthentication
1659+ = lens _sAuthentication
1660+ (\ s a -> s{_sAuthentication = a})
1661+
1662+-- | A list of API interfaces exported by this service. Only the \`name\`
1663+-- field of the google.protobuf.Api needs to be provided by the
1664+-- configuration author, as the remaining fields will be derived from the
1665+-- IDL during the normalization process. It is an error to specify an API
1666+-- interface here which cannot be resolved against the associated IDL
1667+-- files.
1668+sAPIs :: Lens' Service [API]
1669+sAPIs
1670+ = lens _sAPIs (\ s a -> s{_sAPIs = a}) . _Default .
1671+ _Coerce
1672+
1673+-- | A list of all proto message types included in this API service. Types
1674+-- referenced directly or indirectly by the \`apis\` are automatically
1675+-- included. Messages which are not referenced but shall be included, such
1676+-- as types used by the \`google.protobuf.Any\` type, should be listed here
1677+-- by name. Example: types: - name: google.protobuf.Int32
1678+sTypes :: Lens' Service [Type]
1679+sTypes
1680+ = lens _sTypes (\ s a -> s{_sTypes = a}) . _Default .
1681+ _Coerce
1682+
1683+-- | WARNING: DO NOT USE UNTIL THIS MESSAGE IS REMOVED. Analytics
1684+-- configuration.
1685+sAnalytics :: Lens' Service (Maybe Analytics)
1686+sAnalytics
1687+ = lens _sAnalytics (\ s a -> s{_sAnalytics = a})
1688+
1689+-- | API visibility configuration.
1690+sVisibility :: Lens' Service (Maybe Visibility)
1691+sVisibility
1692+ = lens _sVisibility (\ s a -> s{_sVisibility = a})
1693+
1694+-- | A list of all proto message types included in this API service. It
1695+-- serves similar purpose as [google.api.Service.types], except that these
1696+-- types are not needed by user-defined APIs. Therefore, they will not show
1697+-- up in the generated discovery doc. This field should only be used to
1698+-- define system APIs in ESF.
1699+sSystemTypes :: Lens' Service [Type]
1700+sSystemTypes
1701+ = lens _sSystemTypes (\ s a -> s{_sSystemTypes = a})
1702+ . _Default
1703+ . _Coerce
1704+
1705+-- | Defines the monitored resources used by this service. This is required
1706+-- by the Service.monitoring and Service.logging configurations.
1707+sMonitoredResources :: Lens' Service [MonitoredResourceDescriptor]
1708+sMonitoredResources
1709+ = lens _sMonitoredResources
1710+ (\ s a -> s{_sMonitoredResources = a})
1711+ . _Default
1712+ . _Coerce
1713+
1714+-- | API backend configuration.
1715+sBackend :: Lens' Service (Maybe Backend)
1716+sBackend = lens _sBackend (\ s a -> s{_sBackend = a})
1717+
1718+-- | Monitoring configuration.
1719+sMonitoring :: Lens' Service (Maybe Monitoring)
1720+sMonitoring
1721+ = lens _sMonitoring (\ s a -> s{_sMonitoring = a})
1722+
1723+-- | The DNS address at which this service is available, e.g.
1724+-- \`calendar.googleapis.com\`.
1725+sName :: Lens' Service (Maybe Text)
1726+sName = lens _sName (\ s a -> s{_sName = a})
1727+
1728+-- | System parameter configuration.
1729+sSystemParameters :: Lens' Service (Maybe SystemParameters)
1730+sSystemParameters
1731+ = lens _sSystemParameters
1732+ (\ s a -> s{_sSystemParameters = a})
1733+
1734+-- | Defines the logs used by this service.
1735+sLogs :: Lens' Service [LogDescriptor]
1736+sLogs
1737+ = lens _sLogs (\ s a -> s{_sLogs = a}) . _Default .
1738+ _Coerce
1739+
1740+-- | Additional API documentation.
1741+sDocumentation :: Lens' Service (Maybe Documentation)
1742+sDocumentation
1743+ = lens _sDocumentation
1744+ (\ s a -> s{_sDocumentation = a})
1745+
1746+-- | A unique ID for a specific instance of this message, typically assigned
1747+-- by the client for tracking purpose. If empty, the server may choose to
1748+-- generate one instead.
1749+sId :: Lens' Service (Maybe Text)
1750+sId = lens _sId (\ s a -> s{_sId = a})
1751+
1752+-- | Configuration controlling usage of this service.
1753+sUsage :: Lens' Service (Maybe Usage)
1754+sUsage = lens _sUsage (\ s a -> s{_sUsage = a})
1755+
1756+-- | Configuration for network endpoints. If this is empty, then an endpoint
1757+-- with the same name as the service is automatically generated to service
1758+-- all defined APIs.
1759+sEndpoints :: Lens' Service [Endpoint]
1760+sEndpoints
1761+ = lens _sEndpoints (\ s a -> s{_sEndpoints = a}) .
1762+ _Default
1763+ . _Coerce
1764+
1765+-- | A list of all enum types included in this API service. Enums referenced
1766+-- directly or indirectly by the \`apis\` are automatically included. Enums
1767+-- which are not referenced but shall be included should be listed here by
1768+-- name. Example: enums: - name: google.someapi.v1.SomeEnum
1769+sEnums :: Lens' Service [Enum]
1770+sEnums
1771+ = lens _sEnums (\ s a -> s{_sEnums = a}) . _Default .
1772+ _Coerce
1773+
1774+-- | The version of the service configuration. The config version may
1775+-- influence interpretation of the configuration, for example, to determine
1776+-- defaults. This is documented together with applicable options. The
1777+-- current default for the config version itself is \`3\`.
1778+sConfigVersion :: Lens' Service (Maybe Word32)
1779+sConfigVersion
1780+ = lens _sConfigVersion
1781+ (\ s a -> s{_sConfigVersion = a})
1782+ . mapping _Coerce
1783+
1784+-- | HTTP configuration.
1785+sHTTP :: Lens' Service (Maybe HTTP)
1786+sHTTP = lens _sHTTP (\ s a -> s{_sHTTP = a})
1787+
1788+-- | The product title associated with this service.
1789+sTitle :: Lens' Service (Maybe Text)
1790+sTitle = lens _sTitle (\ s a -> s{_sTitle = a})
1791+
1792+-- | The id of the Google developer project that owns the service. Members of
1793+-- this project can manage the service configuration, manage consumption of
1794+-- the service, etc.
1795+sProducerProjectId :: Lens' Service (Maybe Text)
1796+sProducerProjectId
1797+ = lens _sProducerProjectId
1798+ (\ s a -> s{_sProducerProjectId = a})
1799+
1800+-- | Custom error configuration.
1801+sCustomError :: Lens' Service (Maybe CustomError)
1802+sCustomError
1803+ = lens _sCustomError (\ s a -> s{_sCustomError = a})
1804+
1805+-- | Logging configuration.
1806+sLogging :: Lens' Service (Maybe Logging)
1807+sLogging = lens _sLogging (\ s a -> s{_sLogging = a})
1808+
1809+instance FromJSON Service where
1810+ parseJSON
1811+ = withObject "Service"
1812+ (\ o ->
1813+ Service' <$>
1814+ (o .:? "control") <*> (o .:? "metrics" .!= mempty)
1815+ <*> (o .:? "context")
1816+ <*> (o .:? "authentication")
1817+ <*> (o .:? "apis" .!= mempty)
1818+ <*> (o .:? "types" .!= mempty)
1819+ <*> (o .:? "analytics")
1820+ <*> (o .:? "visibility")
1821+ <*> (o .:? "systemTypes" .!= mempty)
1822+ <*> (o .:? "monitoredResources" .!= mempty)
1823+ <*> (o .:? "backend")
1824+ <*> (o .:? "monitoring")
1825+ <*> (o .:? "name")
1826+ <*> (o .:? "systemParameters")
1827+ <*> (o .:? "logs" .!= mempty)
1828+ <*> (o .:? "documentation")
1829+ <*> (o .:? "id")
1830+ <*> (o .:? "usage")
1831+ <*> (o .:? "endpoints" .!= mempty)
1832+ <*> (o .:? "enums" .!= mempty)
1833+ <*> (o .:? "configVersion")
1834+ <*> (o .:? "http")
1835+ <*> (o .:? "title")
1836+ <*> (o .:? "producerProjectId")
1837+ <*> (o .:? "customError")
1838+ <*> (o .:? "logging"))
1839+
1840+instance ToJSON Service where
1841+ toJSON Service'{..}
1842+ = object
1843+ (catMaybes
1844+ [("control" .=) <$> _sControl,
1845+ ("metrics" .=) <$> _sMetrics,
1846+ ("context" .=) <$> _sContext,
1847+ ("authentication" .=) <$> _sAuthentication,
1848+ ("apis" .=) <$> _sAPIs, ("types" .=) <$> _sTypes,
1849+ ("analytics" .=) <$> _sAnalytics,
1850+ ("visibility" .=) <$> _sVisibility,
1851+ ("systemTypes" .=) <$> _sSystemTypes,
1852+ ("monitoredResources" .=) <$> _sMonitoredResources,
1853+ ("backend" .=) <$> _sBackend,
1854+ ("monitoring" .=) <$> _sMonitoring,
1855+ ("name" .=) <$> _sName,
1856+ ("systemParameters" .=) <$> _sSystemParameters,
1857+ ("logs" .=) <$> _sLogs,
1858+ ("documentation" .=) <$> _sDocumentation,
1859+ ("id" .=) <$> _sId, ("usage" .=) <$> _sUsage,
1860+ ("endpoints" .=) <$> _sEndpoints,
1861+ ("enums" .=) <$> _sEnums,
1862+ ("configVersion" .=) <$> _sConfigVersion,
1863+ ("http" .=) <$> _sHTTP, ("title" .=) <$> _sTitle,
1864+ ("producerProjectId" .=) <$> _sProducerProjectId,
1865+ ("customError" .=) <$> _sCustomError,
1866+ ("logging" .=) <$> _sLogging])
1867+
1868+-- | This resource represents a long-running operation that is the result of
1869+-- a network API call.
1870+--
1871+-- /See:/ 'operation' smart constructor.
1872+data Operation = Operation'
1873+ { _oDone :: !(Maybe Bool)
1874+ , _oError :: !(Maybe Status)
1875+ , _oResponse :: !(Maybe OperationResponse)
1876+ , _oName :: !(Maybe Text)
1877+ , _oMetadata :: !(Maybe OperationSchema)
1878+ } deriving (Eq,Show,Data,Typeable,Generic)
1879+
1880+-- | Creates a value of 'Operation' with the minimum fields required to make a request.
1881+--
1882+-- Use one of the following lenses to modify other fields as desired:
1883+--
1884+-- * 'oDone'
1885+--
1886+-- * 'oError'
1887+--
1888+-- * 'oResponse'
1889+--
1890+-- * 'oName'
1891+--
1892+-- * 'oMetadata'
1893+operation
1894+ :: Operation
1895+operation =
1896+ Operation'
1897+ { _oDone = Nothing
1898+ , _oError = Nothing
1899+ , _oResponse = Nothing
1900+ , _oName = Nothing
1901+ , _oMetadata = Nothing
1902+ }
1903+
1904+-- | If the value is \`false\`, it means the operation is still in progress.
1905+-- If true, the operation is completed, and either \`error\` or
1906+-- \`response\` is available.
1907+oDone :: Lens' Operation (Maybe Bool)
1908+oDone = lens _oDone (\ s a -> s{_oDone = a})
1909+
1910+-- | The error result of the operation in case of failure or cancellation.
1911+oError :: Lens' Operation (Maybe Status)
1912+oError = lens _oError (\ s a -> s{_oError = a})
1913+
1914+-- | The normal response of the operation in case of success. If the original
1915+-- method returns no data on success, such as \`Delete\`, the response is
1916+-- \`google.protobuf.Empty\`. If the original method is standard
1917+-- \`Get\`\/\`Create\`\/\`Update\`, the response should be the resource.
1918+-- For other methods, the response should have the type \`XxxResponse\`,
1919+-- where \`Xxx\` is the original method name. For example, if the original
1920+-- method name is \`TakeSnapshot()\`, the inferred response type is
1921+-- \`TakeSnapshotResponse\`.
1922+oResponse :: Lens' Operation (Maybe OperationResponse)
1923+oResponse
1924+ = lens _oResponse (\ s a -> s{_oResponse = a})
1925+
1926+-- | The server-assigned name, which is only unique within the same service
1927+-- that originally returns it. If you use the default HTTP mapping, the
1928+-- \`name\` should have the format of \`operations\/some\/unique\/name\`.
1929+oName :: Lens' Operation (Maybe Text)
1930+oName = lens _oName (\ s a -> s{_oName = a})
1931+
1932+-- | Service-specific metadata associated with the operation. It typically
1933+-- contains progress information and common metadata such as create time.
1934+-- Some services might not provide such metadata. Any method that returns a
1935+-- long-running operation should document the metadata type, if any.
1936+oMetadata :: Lens' Operation (Maybe OperationSchema)
1937+oMetadata
1938+ = lens _oMetadata (\ s a -> s{_oMetadata = a})
1939+
1940+instance FromJSON Operation where
1941+ parseJSON
1942+ = withObject "Operation"
1943+ (\ o ->
1944+ Operation' <$>
1945+ (o .:? "done") <*> (o .:? "error") <*>
1946+ (o .:? "response")
1947+ <*> (o .:? "name")
1948+ <*> (o .:? "metadata"))
1949+
1950+instance ToJSON Operation where
1951+ toJSON Operation'{..}
1952+ = object
1953+ (catMaybes
1954+ [("done" .=) <$> _oDone, ("error" .=) <$> _oError,
1955+ ("response" .=) <$> _oResponse,
1956+ ("name" .=) <$> _oName,
1957+ ("metadata" .=) <$> _oMetadata])
1958+
1959+-- | Request message for EnableService method.
1960+--
1961+-- /See:/ 'enableServiceRequest' smart constructor.
1962+newtype EnableServiceRequest = EnableServiceRequest'
1963+ { _esrConsumerId :: Maybe Text
1964+ } deriving (Eq,Show,Data,Typeable,Generic)
1965+
1966+-- | Creates a value of 'EnableServiceRequest' with the minimum fields required to make a request.
1967+--
1968+-- Use one of the following lenses to modify other fields as desired:
1969+--
1970+-- * 'esrConsumerId'
1971+enableServiceRequest
1972+ :: EnableServiceRequest
1973+enableServiceRequest =
1974+ EnableServiceRequest'
1975+ { _esrConsumerId = Nothing
1976+ }
1977+
1978+-- | The identity of consumer resource which service enablement will be
1979+-- applied to. The Google Service Management implementation accepts the
1980+-- following forms: \"project:\", \"project_number:\". Note: this is made
1981+-- compatible with google.api.servicecontrol.v1.Operation.consumer_id.
1982+esrConsumerId :: Lens' EnableServiceRequest (Maybe Text)
1983+esrConsumerId
1984+ = lens _esrConsumerId
1985+ (\ s a -> s{_esrConsumerId = a})
1986+
1987+instance FromJSON EnableServiceRequest where
1988+ parseJSON
1989+ = withObject "EnableServiceRequest"
1990+ (\ o ->
1991+ EnableServiceRequest' <$> (o .:? "consumerId"))
1992+
1993+instance ToJSON EnableServiceRequest where
1994+ toJSON EnableServiceRequest'{..}
1995+ = object
1996+ (catMaybes [("consumerId" .=) <$> _esrConsumerId])
1997+
1998+-- | Response message for ListServiceConfigs method.
1999+--
2000+-- /See:/ 'listServiceConfigsResponse' smart constructor.
2001+data ListServiceConfigsResponse = ListServiceConfigsResponse'
2002+ { _lscrServiceConfigs :: !(Maybe [Service])
2003+ , _lscrNextPageToken :: !(Maybe Text)
2004+ } deriving (Eq,Show,Data,Typeable,Generic)
2005+
2006+-- | Creates a value of 'ListServiceConfigsResponse' with the minimum fields required to make a request.
2007+--
2008+-- Use one of the following lenses to modify other fields as desired:
2009+--
2010+-- * 'lscrServiceConfigs'
2011+--
2012+-- * 'lscrNextPageToken'
2013+listServiceConfigsResponse
2014+ :: ListServiceConfigsResponse
2015+listServiceConfigsResponse =
2016+ ListServiceConfigsResponse'
2017+ { _lscrServiceConfigs = Nothing
2018+ , _lscrNextPageToken = Nothing
2019+ }
2020+
2021+-- | The list of service configuration resources.
2022+lscrServiceConfigs :: Lens' ListServiceConfigsResponse [Service]
2023+lscrServiceConfigs
2024+ = lens _lscrServiceConfigs
2025+ (\ s a -> s{_lscrServiceConfigs = a})
2026+ . _Default
2027+ . _Coerce
2028+
2029+-- | The token of the next page of results.
2030+lscrNextPageToken :: Lens' ListServiceConfigsResponse (Maybe Text)
2031+lscrNextPageToken
2032+ = lens _lscrNextPageToken
2033+ (\ s a -> s{_lscrNextPageToken = a})
2034+
2035+instance FromJSON ListServiceConfigsResponse where
2036+ parseJSON
2037+ = withObject "ListServiceConfigsResponse"
2038+ (\ o ->
2039+ ListServiceConfigsResponse' <$>
2040+ (o .:? "serviceConfigs" .!= mempty) <*>
2041+ (o .:? "nextPageToken"))
2042+
2043+instance ToJSON ListServiceConfigsResponse where
2044+ toJSON ListServiceConfigsResponse'{..}
2045+ = object
2046+ (catMaybes
2047+ [("serviceConfigs" .=) <$> _lscrServiceConfigs,
2048+ ("nextPageToken" .=) <$> _lscrNextPageToken])
2049+
2050+-- | A custom error rule.
2051+--
2052+-- /See:/ 'customErrorRule' smart constructor.
2053+data CustomErrorRule = CustomErrorRule'
2054+ { _cerIsErrorType :: !(Maybe Bool)
2055+ , _cerSelector :: !(Maybe Text)
2056+ } deriving (Eq,Show,Data,Typeable,Generic)
2057+
2058+-- | Creates a value of 'CustomErrorRule' with the minimum fields required to make a request.
2059+--
2060+-- Use one of the following lenses to modify other fields as desired:
2061+--
2062+-- * 'cerIsErrorType'
2063+--
2064+-- * 'cerSelector'
2065+customErrorRule
2066+ :: CustomErrorRule
2067+customErrorRule =
2068+ CustomErrorRule'
2069+ { _cerIsErrorType = Nothing
2070+ , _cerSelector = Nothing
2071+ }
2072+
2073+-- | Mark this message as possible payload in error response. Otherwise,
2074+-- objects of this type will be filtered when they appear in error payload.
2075+cerIsErrorType :: Lens' CustomErrorRule (Maybe Bool)
2076+cerIsErrorType
2077+ = lens _cerIsErrorType
2078+ (\ s a -> s{_cerIsErrorType = a})
2079+
2080+-- | Selects messages to which this rule applies. Refer to selector for
2081+-- syntax details.
2082+cerSelector :: Lens' CustomErrorRule (Maybe Text)
2083+cerSelector
2084+ = lens _cerSelector (\ s a -> s{_cerSelector = a})
2085+
2086+instance FromJSON CustomErrorRule where
2087+ parseJSON
2088+ = withObject "CustomErrorRule"
2089+ (\ o ->
2090+ CustomErrorRule' <$>
2091+ (o .:? "isErrorType") <*> (o .:? "selector"))
2092+
2093+instance ToJSON CustomErrorRule where
2094+ toJSON CustomErrorRule'{..}
2095+ = object
2096+ (catMaybes
2097+ [("isErrorType" .=) <$> _cerIsErrorType,
2098+ ("selector" .=) <$> _cerSelector])
2099+
2100+-- | Response message for SubmitConfigSource method.
2101+--
2102+-- /See:/ 'submitConfigSourceResponse' smart constructor.
2103+newtype SubmitConfigSourceResponse = SubmitConfigSourceResponse'
2104+ { _scsrServiceConfig :: Maybe Service
2105+ } deriving (Eq,Show,Data,Typeable,Generic)
2106+
2107+-- | Creates a value of 'SubmitConfigSourceResponse' with the minimum fields required to make a request.
2108+--
2109+-- Use one of the following lenses to modify other fields as desired:
2110+--
2111+-- * 'scsrServiceConfig'
2112+submitConfigSourceResponse
2113+ :: SubmitConfigSourceResponse
2114+submitConfigSourceResponse =
2115+ SubmitConfigSourceResponse'
2116+ { _scsrServiceConfig = Nothing
2117+ }
2118+
2119+-- | The generated service configuration.
2120+scsrServiceConfig :: Lens' SubmitConfigSourceResponse (Maybe Service)
2121+scsrServiceConfig
2122+ = lens _scsrServiceConfig
2123+ (\ s a -> s{_scsrServiceConfig = a})
2124+
2125+instance FromJSON SubmitConfigSourceResponse where
2126+ parseJSON
2127+ = withObject "SubmitConfigSourceResponse"
2128+ (\ o ->
2129+ SubmitConfigSourceResponse' <$>
2130+ (o .:? "serviceConfig"))
2131+
2132+instance ToJSON SubmitConfigSourceResponse where
2133+ toJSON SubmitConfigSourceResponse'{..}
2134+ = object
2135+ (catMaybes
2136+ [("serviceConfig" .=) <$> _scsrServiceConfig])
2137+
2138+-- | A visibility rule provides visibility configuration for an individual
2139+-- API element.
2140+--
2141+-- /See:/ 'visibilityRule' smart constructor.
2142+data VisibilityRule = VisibilityRule'
2143+ { _vrRestriction :: !(Maybe Text)
2144+ , _vrSelector :: !(Maybe Text)
2145+ } deriving (Eq,Show,Data,Typeable,Generic)
2146+
2147+-- | Creates a value of 'VisibilityRule' with the minimum fields required to make a request.
2148+--
2149+-- Use one of the following lenses to modify other fields as desired:
2150+--
2151+-- * 'vrRestriction'
2152+--
2153+-- * 'vrSelector'
2154+visibilityRule
2155+ :: VisibilityRule
2156+visibilityRule =
2157+ VisibilityRule'
2158+ { _vrRestriction = Nothing
2159+ , _vrSelector = Nothing
2160+ }
2161+
2162+-- | A comma-separated list of visibility labels that apply to the
2163+-- \`selector\`. Any of the listed labels can be used to grant the
2164+-- visibility. If a rule has multiple labels, removing one of the labels
2165+-- but not all of them can break clients. Example: visibility: rules: -
2166+-- selector: google.calendar.Calendar.EnhancedSearch restriction:
2167+-- GOOGLE_INTERNAL, TRUSTED_TESTER Removing GOOGLE_INTERNAL from this
2168+-- restriction will break clients that rely on this method and only had
2169+-- access to it through GOOGLE_INTERNAL.
2170+vrRestriction :: Lens' VisibilityRule (Maybe Text)
2171+vrRestriction
2172+ = lens _vrRestriction
2173+ (\ s a -> s{_vrRestriction = a})
2174+
2175+-- | Selects methods, messages, fields, enums, etc. to which this rule
2176+-- applies. Refer to selector for syntax details.
2177+vrSelector :: Lens' VisibilityRule (Maybe Text)
2178+vrSelector
2179+ = lens _vrSelector (\ s a -> s{_vrSelector = a})
2180+
2181+instance FromJSON VisibilityRule where
2182+ parseJSON
2183+ = withObject "VisibilityRule"
2184+ (\ o ->
2185+ VisibilityRule' <$>
2186+ (o .:? "restriction") <*> (o .:? "selector"))
2187+
2188+instance ToJSON VisibilityRule where
2189+ toJSON VisibilityRule'{..}
2190+ = object
2191+ (catMaybes
2192+ [("restriction" .=) <$> _vrRestriction,
2193+ ("selector" .=) <$> _vrSelector])
2194+
2195+-- | Change report associated with a particular service configuration. It
2196+-- contains a list of ConfigChanges based on the comparison between two
2197+-- service configurations.
2198+--
2199+-- /See:/ 'changeReport' smart constructor.
2200+newtype ChangeReport = ChangeReport'
2201+ { _crConfigChanges :: Maybe [ConfigChange]
2202+ } deriving (Eq,Show,Data,Typeable,Generic)
2203+
2204+-- | Creates a value of 'ChangeReport' with the minimum fields required to make a request.
2205+--
2206+-- Use one of the following lenses to modify other fields as desired:
2207+--
2208+-- * 'crConfigChanges'
2209+changeReport
2210+ :: ChangeReport
2211+changeReport =
2212+ ChangeReport'
2213+ { _crConfigChanges = Nothing
2214+ }
2215+
2216+-- | List of changes between two service configurations. The changes will be
2217+-- alphabetically sorted based on the identifier of each change. A
2218+-- ConfigChange identifier is a dot separated path to the configuration.
2219+-- Example:
2220+-- visibility.rules[selector=\'LibraryService.CreateBook\'].restriction
2221+crConfigChanges :: Lens' ChangeReport [ConfigChange]
2222+crConfigChanges
2223+ = lens _crConfigChanges
2224+ (\ s a -> s{_crConfigChanges = a})
2225+ . _Default
2226+ . _Coerce
2227+
2228+instance FromJSON ChangeReport where
2229+ parseJSON
2230+ = withObject "ChangeReport"
2231+ (\ o ->
2232+ ChangeReport' <$> (o .:? "configChanges" .!= mempty))
2233+
2234+instance ToJSON ChangeReport where
2235+ toJSON ChangeReport'{..}
2236+ = object
2237+ (catMaybes
2238+ [("configChanges" .=) <$> _crConfigChanges])
2239+
2240+-- | Do not use this. For media support, add instead
2241+-- [][google.bytestream.RestByteStream] as an API to your configuration.
2242+--
2243+-- /See:/ 'mediaDownload' smart constructor.
2244+newtype MediaDownload' = MediaDownload''
2245+ { _mdEnabled :: Maybe Bool
2246+ } deriving (Eq,Show,Data,Typeable,Generic)
2247+
2248+-- | Creates a value of 'MediaDownload' with the minimum fields required to make a request.
2249+--
2250+-- Use one of the following lenses to modify other fields as desired:
2251+--
2252+-- * 'mdEnabled'
2253+mediaDownload
2254+ :: MediaDownload'
2255+mediaDownload =
2256+ MediaDownload''
2257+ { _mdEnabled = Nothing
2258+ }
2259+
2260+-- | Whether download is enabled.
2261+mdEnabled :: Lens' MediaDownload' (Maybe Bool)
2262+mdEnabled
2263+ = lens _mdEnabled (\ s a -> s{_mdEnabled = a})
2264+
2265+instance FromJSON MediaDownload' where
2266+ parseJSON
2267+ = withObject "MediaDownload"
2268+ (\ o -> MediaDownload'' <$> (o .:? "enabled"))
2269+
2270+instance ToJSON MediaDownload' where
2271+ toJSON MediaDownload''{..}
2272+ = object (catMaybes [("enabled" .=) <$> _mdEnabled])
2273+
2274+-- | The option\'s value. For example, \`\"com.google.protobuf\"\`.
2275+--
2276+-- /See:/ 'optionValue' smart constructor.
2277+newtype OptionValue = OptionValue'
2278+ { _ovAddtional :: HashMap Text JSONValue
2279+ } deriving (Eq,Show,Data,Typeable,Generic)
2280+
2281+-- | Creates a value of 'OptionValue' with the minimum fields required to make a request.
2282+--
2283+-- Use one of the following lenses to modify other fields as desired:
2284+--
2285+-- * 'ovAddtional'
2286+optionValue
2287+ :: HashMap Text JSONValue -- ^ 'ovAddtional'
2288+ -> OptionValue
2289+optionValue pOvAddtional_ =
2290+ OptionValue'
2291+ { _ovAddtional = _Coerce # pOvAddtional_
2292+ }
2293+
2294+-- | Properties of the object. Contains field \'type with type URL.
2295+ovAddtional :: Lens' OptionValue (HashMap Text JSONValue)
2296+ovAddtional
2297+ = lens _ovAddtional (\ s a -> s{_ovAddtional = a}) .
2298+ _Coerce
2299+
2300+instance FromJSON OptionValue where
2301+ parseJSON
2302+ = withObject "OptionValue"
2303+ (\ o -> OptionValue' <$> (parseJSONObject o))
2304+
2305+instance ToJSON OptionValue where
2306+ toJSON = toJSON . _ovAddtional
2307+
2308+-- | Enum value definition.
2309+--
2310+-- /See:/ 'enumValue' smart constructor.
2311+data EnumValue = EnumValue'
2312+ { _evName :: !(Maybe Text)
2313+ , _evOptions :: !(Maybe [Option])
2314+ , _evNumber :: !(Maybe (Textual Int32))
2315+ } deriving (Eq,Show,Data,Typeable,Generic)
2316+
2317+-- | Creates a value of 'EnumValue' with the minimum fields required to make a request.
2318+--
2319+-- Use one of the following lenses to modify other fields as desired:
2320+--
2321+-- * 'evName'
2322+--
2323+-- * 'evOptions'
2324+--
2325+-- * 'evNumber'
2326+enumValue
2327+ :: EnumValue
2328+enumValue =
2329+ EnumValue'
2330+ { _evName = Nothing
2331+ , _evOptions = Nothing
2332+ , _evNumber = Nothing
2333+ }
2334+
2335+-- | Enum value name.
2336+evName :: Lens' EnumValue (Maybe Text)
2337+evName = lens _evName (\ s a -> s{_evName = a})
2338+
2339+-- | Protocol buffer options.
2340+evOptions :: Lens' EnumValue [Option]
2341+evOptions
2342+ = lens _evOptions (\ s a -> s{_evOptions = a}) .
2343+ _Default
2344+ . _Coerce
2345+
2346+-- | Enum value number.
2347+evNumber :: Lens' EnumValue (Maybe Int32)
2348+evNumber
2349+ = lens _evNumber (\ s a -> s{_evNumber = a}) .
2350+ mapping _Coerce
2351+
2352+instance FromJSON EnumValue where
2353+ parseJSON
2354+ = withObject "EnumValue"
2355+ (\ o ->
2356+ EnumValue' <$>
2357+ (o .:? "name") <*> (o .:? "options" .!= mempty) <*>
2358+ (o .:? "number"))
2359+
2360+instance ToJSON EnumValue where
2361+ toJSON EnumValue'{..}
2362+ = object
2363+ (catMaybes
2364+ [("name" .=) <$> _evName,
2365+ ("options" .=) <$> _evOptions,
2366+ ("number" .=) <$> _evNumber])
2367+
2368+-- | \`Authentication\` defines the authentication configuration for an API.
2369+-- Example for an API targeted for external use: name:
2370+-- calendar.googleapis.com authentication: rules: - selector: \"*\" oauth:
2371+-- canonical_scopes: https:\/\/www.googleapis.com\/auth\/calendar -
2372+-- selector: google.calendar.Delegate oauth: canonical_scopes:
2373+-- https:\/\/www.googleapis.com\/auth\/calendar.read
2374+--
2375+-- /See:/ 'authentication' smart constructor.
2376+data Authentication = Authentication'
2377+ { _aRules :: !(Maybe [AuthenticationRule])
2378+ , _aProviders :: !(Maybe [AuthProvider])
2379+ } deriving (Eq,Show,Data,Typeable,Generic)
2380+
2381+-- | Creates a value of 'Authentication' with the minimum fields required to make a request.
2382+--
2383+-- Use one of the following lenses to modify other fields as desired:
2384+--
2385+-- * 'aRules'
2386+--
2387+-- * 'aProviders'
2388+authentication
2389+ :: Authentication
2390+authentication =
2391+ Authentication'
2392+ { _aRules = Nothing
2393+ , _aProviders = Nothing
2394+ }
2395+
2396+-- | A list of authentication rules that apply to individual API methods.
2397+-- **NOTE:** All service configuration rules follow \"last one wins\"
2398+-- order.
2399+aRules :: Lens' Authentication [AuthenticationRule]
2400+aRules
2401+ = lens _aRules (\ s a -> s{_aRules = a}) . _Default .
2402+ _Coerce
2403+
2404+-- | Defines a set of authentication providers that a service supports.
2405+aProviders :: Lens' Authentication [AuthProvider]
2406+aProviders
2407+ = lens _aProviders (\ s a -> s{_aProviders = a}) .
2408+ _Default
2409+ . _Coerce
2410+
2411+instance FromJSON Authentication where
2412+ parseJSON
2413+ = withObject "Authentication"
2414+ (\ o ->
2415+ Authentication' <$>
2416+ (o .:? "rules" .!= mempty) <*>
2417+ (o .:? "providers" .!= mempty))
2418+
2419+instance ToJSON Authentication where
2420+ toJSON Authentication'{..}
2421+ = object
2422+ (catMaybes
2423+ [("rules" .=) <$> _aRules,
2424+ ("providers" .=) <$> _aProviders])
2425+
2426+-- | Declares an API to be included in this API. The including API must
2427+-- redeclare all the methods from the included API, but documentation and
2428+-- options are inherited as follows: - If after comment and whitespace
2429+-- stripping, the documentation string of the redeclared method is empty,
2430+-- it will be inherited from the original method. - Each annotation
2431+-- belonging to the service config (http, visibility) which is not set in
2432+-- the redeclared method will be inherited. - If an http annotation is
2433+-- inherited, the path pattern will be modified as follows. Any version
2434+-- prefix will be replaced by the version of the including API plus the
2435+-- root path if specified. Example of a simple mixin: package
2436+-- google.acl.v1; service AccessControl { \/\/ Get the underlying ACL
2437+-- object. rpc GetAcl(GetAclRequest) returns (Acl) { option
2438+-- (google.api.http).get = \"\/v1\/{resource=**}:getAcl\"; } } package
2439+-- google.storage.v2; service Storage { \/\/ rpc GetAcl(GetAclRequest)
2440+-- returns (Acl); \/\/ Get a data record. rpc GetData(GetDataRequest)
2441+-- returns (Data) { option (google.api.http).get = \"\/v2\/{resource=**}\";
2442+-- } } Example of a mixin configuration: apis: - name:
2443+-- google.storage.v2.Storage mixins: - name: google.acl.v1.AccessControl
2444+-- The mixin construct implies that all methods in \`AccessControl\` are
2445+-- also declared with same name and request\/response types in \`Storage\`.
2446+-- A documentation generator or annotation processor will see the effective
2447+-- \`Storage.GetAcl\` method after inherting documentation and annotations
2448+-- as follows: service Storage { \/\/ Get the underlying ACL object. rpc
2449+-- GetAcl(GetAclRequest) returns (Acl) { option (google.api.http).get =
2450+-- \"\/v2\/{resource=**}:getAcl\"; } ... } Note how the version in the path
2451+-- pattern changed from \`v1\` to \`v2\`. If the \`root\` field in the
2452+-- mixin is specified, it should be a relative path under which inherited
2453+-- HTTP paths are placed. Example: apis: - name: google.storage.v2.Storage
2454+-- mixins: - name: google.acl.v1.AccessControl root: acls This implies the
2455+-- following inherited HTTP annotation: service Storage { \/\/ Get the
2456+-- underlying ACL object. rpc GetAcl(GetAclRequest) returns (Acl) { option
2457+-- (google.api.http).get = \"\/v2\/acls\/{resource=**}:getAcl\"; } ... }
2458+--
2459+-- /See:/ 'mixin' smart constructor.
2460+data Mixin = Mixin'
2461+ { _mRoot :: !(Maybe Text)
2462+ , _mName :: !(Maybe Text)
2463+ } deriving (Eq,Show,Data,Typeable,Generic)
2464+
2465+-- | Creates a value of 'Mixin' with the minimum fields required to make a request.
2466+--
2467+-- Use one of the following lenses to modify other fields as desired:
2468+--
2469+-- * 'mRoot'
2470+--
2471+-- * 'mName'
2472+mixin
2473+ :: Mixin
2474+mixin =
2475+ Mixin'
2476+ { _mRoot = Nothing
2477+ , _mName = Nothing
2478+ }
2479+
2480+-- | If non-empty specifies a path under which inherited HTTP paths are
2481+-- rooted.
2482+mRoot :: Lens' Mixin (Maybe Text)
2483+mRoot = lens _mRoot (\ s a -> s{_mRoot = a})
2484+
2485+-- | The fully qualified name of the API which is included.
2486+mName :: Lens' Mixin (Maybe Text)
2487+mName = lens _mName (\ s a -> s{_mName = a})
2488+
2489+instance FromJSON Mixin where
2490+ parseJSON
2491+ = withObject "Mixin"
2492+ (\ o -> Mixin' <$> (o .:? "root") <*> (o .:? "name"))
2493+
2494+instance ToJSON Mixin where
2495+ toJSON Mixin'{..}
2496+ = object
2497+ (catMaybes
2498+ [("root" .=) <$> _mRoot, ("name" .=) <$> _mName])
2499+
2500+-- | A custom pattern is used for defining custom HTTP verb.
2501+--
2502+-- /See:/ 'customHTTPPattern' smart constructor.
2503+data CustomHTTPPattern = CustomHTTPPattern'
2504+ { _chttppPath :: !(Maybe Text)
2505+ , _chttppKind :: !(Maybe Text)
2506+ } deriving (Eq,Show,Data,Typeable,Generic)
2507+
2508+-- | Creates a value of 'CustomHTTPPattern' with the minimum fields required to make a request.
2509+--
2510+-- Use one of the following lenses to modify other fields as desired:
2511+--
2512+-- * 'chttppPath'
2513+--
2514+-- * 'chttppKind'
2515+customHTTPPattern
2516+ :: CustomHTTPPattern
2517+customHTTPPattern =
2518+ CustomHTTPPattern'
2519+ { _chttppPath = Nothing
2520+ , _chttppKind = Nothing
2521+ }
2522+
2523+-- | The path matched by this custom verb.
2524+chttppPath :: Lens' CustomHTTPPattern (Maybe Text)
2525+chttppPath
2526+ = lens _chttppPath (\ s a -> s{_chttppPath = a})
2527+
2528+-- | The name of this custom HTTP verb.
2529+chttppKind :: Lens' CustomHTTPPattern (Maybe Text)
2530+chttppKind
2531+ = lens _chttppKind (\ s a -> s{_chttppKind = a})
2532+
2533+instance FromJSON CustomHTTPPattern where
2534+ parseJSON
2535+ = withObject "CustomHTTPPattern"
2536+ (\ o ->
2537+ CustomHTTPPattern' <$>
2538+ (o .:? "path") <*> (o .:? "kind"))
2539+
2540+instance ToJSON CustomHTTPPattern where
2541+ toJSON CustomHTTPPattern'{..}
2542+ = object
2543+ (catMaybes
2544+ [("path" .=) <$> _chttppPath,
2545+ ("kind" .=) <$> _chttppKind])
2546+
2547+-- | Usage configuration rules for the service. NOTE: Under development. Use
2548+-- this rule to configure unregistered calls for the service. Unregistered
2549+-- calls are calls that do not contain consumer project identity. (Example:
2550+-- calls that do not contain an API key). By default, API methods do not
2551+-- allow unregistered calls, and each method call must be identified by a
2552+-- consumer project identity. Use this rule to allow\/disallow unregistered
2553+-- calls. Example of an API that wants to allow unregistered calls for
2554+-- entire service. usage: rules: - selector: \"*\"
2555+-- allow_unregistered_calls: true Example of a method that wants to allow
2556+-- unregistered calls. usage: rules: - selector:
2557+-- \"google.example.library.v1.LibraryService.CreateBook\"
2558+-- allow_unregistered_calls: true
2559+--
2560+-- /See:/ 'usageRule' smart constructor.
2561+data UsageRule = UsageRule'
2562+ { _urSelector :: !(Maybe Text)
2563+ , _urAllowUnregisteredCalls :: !(Maybe Bool)
2564+ } deriving (Eq,Show,Data,Typeable,Generic)
2565+
2566+-- | Creates a value of 'UsageRule' with the minimum fields required to make a request.
2567+--
2568+-- Use one of the following lenses to modify other fields as desired:
2569+--
2570+-- * 'urSelector'
2571+--
2572+-- * 'urAllowUnregisteredCalls'
2573+usageRule
2574+ :: UsageRule
2575+usageRule =
2576+ UsageRule'
2577+ { _urSelector = Nothing
2578+ , _urAllowUnregisteredCalls = Nothing
2579+ }
2580+
2581+-- | Selects the methods to which this rule applies. Use \'*\' to indicate
2582+-- all methods in all APIs. Refer to selector for syntax details.
2583+urSelector :: Lens' UsageRule (Maybe Text)
2584+urSelector
2585+ = lens _urSelector (\ s a -> s{_urSelector = a})
2586+
2587+-- | True, if the method allows unregistered calls; false otherwise.
2588+urAllowUnregisteredCalls :: Lens' UsageRule (Maybe Bool)
2589+urAllowUnregisteredCalls
2590+ = lens _urAllowUnregisteredCalls
2591+ (\ s a -> s{_urAllowUnregisteredCalls = a})
2592+
2593+instance FromJSON UsageRule where
2594+ parseJSON
2595+ = withObject "UsageRule"
2596+ (\ o ->
2597+ UsageRule' <$>
2598+ (o .:? "selector") <*>
2599+ (o .:? "allowUnregisteredCalls"))
2600+
2601+instance ToJSON UsageRule where
2602+ toJSON UsageRule'{..}
2603+ = object
2604+ (catMaybes
2605+ [("selector" .=) <$> _urSelector,
2606+ ("allowUnregisteredCalls" .=) <$>
2607+ _urAllowUnregisteredCalls])
2608+
2609+--
2610+-- /See:/ 'statusDetailsItem' smart constructor.
2611+newtype StatusDetailsItem = StatusDetailsItem'
2612+ { _sdiAddtional :: HashMap Text JSONValue
2613+ } deriving (Eq,Show,Data,Typeable,Generic)
2614+
2615+-- | Creates a value of 'StatusDetailsItem' with the minimum fields required to make a request.
2616+--
2617+-- Use one of the following lenses to modify other fields as desired:
2618+--
2619+-- * 'sdiAddtional'
2620+statusDetailsItem
2621+ :: HashMap Text JSONValue -- ^ 'sdiAddtional'
2622+ -> StatusDetailsItem
2623+statusDetailsItem pSdiAddtional_ =
2624+ StatusDetailsItem'
2625+ { _sdiAddtional = _Coerce # pSdiAddtional_
2626+ }
2627+
2628+-- | Properties of the object. Contains field \'type with type URL.
2629+sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
2630+sdiAddtional
2631+ = lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
2632+ . _Coerce
2633+
2634+instance FromJSON StatusDetailsItem where
2635+ parseJSON
2636+ = withObject "StatusDetailsItem"
2637+ (\ o -> StatusDetailsItem' <$> (parseJSONObject o))
2638+
2639+instance ToJSON StatusDetailsItem where
2640+ toJSON = toJSON . _sdiAddtional
2641+
2642+-- | Represents a documentation page. A page can contain subpages to
2643+-- represent nested documentation set structure.
2644+--
2645+-- /See:/ 'page' smart constructor.
2646+data Page = Page'
2647+ { _pSubpages :: !(Maybe [Page])
2648+ , _pContent :: !(Maybe Text)
2649+ , _pName :: !(Maybe Text)
2650+ } deriving (Eq,Show,Data,Typeable,Generic)
2651+
2652+-- | Creates a value of 'Page' with the minimum fields required to make a request.
2653+--
2654+-- Use one of the following lenses to modify other fields as desired:
2655+--
2656+-- * 'pSubpages'
2657+--
2658+-- * 'pContent'
2659+--
2660+-- * 'pName'
2661+page
2662+ :: Page
2663+page =
2664+ Page'
2665+ { _pSubpages = Nothing
2666+ , _pContent = Nothing
2667+ , _pName = Nothing
2668+ }
2669+
2670+-- | Subpages of this page. The order of subpages specified here will be
2671+-- honored in the generated docset.
2672+pSubpages :: Lens' Page [Page]
2673+pSubpages
2674+ = lens _pSubpages (\ s a -> s{_pSubpages = a}) .
2675+ _Default
2676+ . _Coerce
2677+
2678+-- | The Markdown content of the page. You can use '(== include {path} ==)'
2679+-- to include content from a Markdown file.
2680+pContent :: Lens' Page (Maybe Text)
2681+pContent = lens _pContent (\ s a -> s{_pContent = a})
2682+
2683+-- | The name of the page. It will be used as an identity of the page to
2684+-- generate URI of the page, text of the link to this page in navigation,
2685+-- etc. The full page name (start from the root page name to this page
2686+-- concatenated with \`.\`) can be used as reference to the page in your
2687+-- documentation. For example:
2688+--
2689+-- > pages:
2690+-- > - name: Tutorial
2691+-- > content: (== include tutorial.md ==)
2692+-- > subpages:
2693+-- > - name: Java
2694+-- > content: (== include tutorial_java.md ==)
2695+--
2696+-- You can reference \`Java\` page using Markdown reference link syntax:
2697+-- \`Java\`.
2698+pName :: Lens' Page (Maybe Text)
2699+pName = lens _pName (\ s a -> s{_pName = a})
2700+
2701+instance FromJSON Page where
2702+ parseJSON
2703+ = withObject "Page"
2704+ (\ o ->
2705+ Page' <$>
2706+ (o .:? "subpages" .!= mempty) <*> (o .:? "content")
2707+ <*> (o .:? "name"))
2708+
2709+instance ToJSON Page where
2710+ toJSON Page'{..}
2711+ = object
2712+ (catMaybes
2713+ [("subpages" .=) <$> _pSubpages,
2714+ ("content" .=) <$> _pContent,
2715+ ("name" .=) <$> _pName])
2716+
2717+-- | Service configuration against which the comparison will be done. For
2718+-- this version of API, the supported types are
2719+-- google.api.servicemanagement.v1.ConfigRef,
2720+-- google.api.servicemanagement.v1.ConfigSource, and google.api.Service
2721+--
2722+-- /See:/ 'generateConfigReportRequestOldConfig' smart constructor.
2723+newtype GenerateConfigReportRequestOldConfig = GenerateConfigReportRequestOldConfig'
2724+ { _gcrrocAddtional :: HashMap Text JSONValue
2725+ } deriving (Eq,Show,Data,Typeable,Generic)
2726+
2727+-- | Creates a value of 'GenerateConfigReportRequestOldConfig' with the minimum fields required to make a request.
2728+--
2729+-- Use one of the following lenses to modify other fields as desired:
2730+--
2731+-- * 'gcrrocAddtional'
2732+generateConfigReportRequestOldConfig
2733+ :: HashMap Text JSONValue -- ^ 'gcrrocAddtional'
2734+ -> GenerateConfigReportRequestOldConfig
2735+generateConfigReportRequestOldConfig pGcrrocAddtional_ =
2736+ GenerateConfigReportRequestOldConfig'
2737+ { _gcrrocAddtional = _Coerce # pGcrrocAddtional_
2738+ }
2739+
2740+-- | Properties of the object. Contains field \'type with type URL.
2741+gcrrocAddtional :: Lens' GenerateConfigReportRequestOldConfig (HashMap Text JSONValue)
2742+gcrrocAddtional
2743+ = lens _gcrrocAddtional
2744+ (\ s a -> s{_gcrrocAddtional = a})
2745+ . _Coerce
2746+
2747+instance FromJSON
2748+ GenerateConfigReportRequestOldConfig where
2749+ parseJSON
2750+ = withObject "GenerateConfigReportRequestOldConfig"
2751+ (\ o ->
2752+ GenerateConfigReportRequestOldConfig' <$>
2753+ (parseJSONObject o))
2754+
2755+instance ToJSON GenerateConfigReportRequestOldConfig
2756+ where
2757+ toJSON = toJSON . _gcrrocAddtional
2758+
2759+-- | Analytics configuration of the service. The example below shows how to
2760+-- configure monitored resources and metrics for analytics. In the example,
2761+-- a monitored resource and two metrics are defined. The
2762+-- \`library.googleapis.com\/book\/returned_count\` and
2763+-- \`library.googleapis.com\/book\/overdue_count\` metric are sent to the
2764+-- analytics. monitored_resources: - type: library.googleapis.com\/branch
2765+-- labels: - key: \/city description: The city where the library branch is
2766+-- located in. - key: \/name description: The name of the branch. metrics:
2767+-- - name: library.googleapis.com\/book\/returned_count metric_kind: DELTA
2768+-- value_type: INT64 labels: - key: \/customer_id - name:
2769+-- library.googleapis.com\/book\/overdue_count metric_kind: GAUGE
2770+-- value_type: INT64 labels: - key: \/customer_id analytics:
2771+-- producer_destinations: - monitored_resource:
2772+-- library.googleapis.com\/branch metrics: -
2773+-- library.googleapis.com\/book\/returned_count -
2774+-- library.googleapis.com\/book\/overdue_count
2775+--
2776+-- /See:/ 'analytics' smart constructor.
2777+newtype Analytics = Analytics'
2778+ { _aProducerDestinations :: Maybe [AnalyticsDestination]
2779+ } deriving (Eq,Show,Data,Typeable,Generic)
2780+
2781+-- | Creates a value of 'Analytics' with the minimum fields required to make a request.
2782+--
2783+-- Use one of the following lenses to modify other fields as desired:
2784+--
2785+-- * 'aProducerDestinations'
2786+analytics
2787+ :: Analytics
2788+analytics =
2789+ Analytics'
2790+ { _aProducerDestinations = Nothing
2791+ }
2792+
2793+-- | Analytics configurations for sending metrics to the analytics backend.
2794+-- There can be multiple producer destinations, each one must have a
2795+-- different monitored resource type. A metric can be used in at most one
2796+-- producer destination.
2797+aProducerDestinations :: Lens' Analytics [AnalyticsDestination]
2798+aProducerDestinations
2799+ = lens _aProducerDestinations
2800+ (\ s a -> s{_aProducerDestinations = a})
2801+ . _Default
2802+ . _Coerce
2803+
2804+instance FromJSON Analytics where
2805+ parseJSON
2806+ = withObject "Analytics"
2807+ (\ o ->
2808+ Analytics' <$>
2809+ (o .:? "producerDestinations" .!= mempty))
2810+
2811+instance ToJSON Analytics where
2812+ toJSON Analytics'{..}
2813+ = object
2814+ (catMaybes
2815+ [("producerDestinations" .=) <$>
2816+ _aProducerDestinations])
2817+
2818+-- | A rule to be applied in a Policy.
2819+--
2820+-- /See:/ 'rule' smart constructor.
2821+data Rule = Rule'
2822+ { _rAction :: !(Maybe RuleAction)
2823+ , _rIn :: !(Maybe [Text])
2824+ , _rNotIn :: !(Maybe [Text])
2825+ , _rConditions :: !(Maybe [Condition])
2826+ , _rPermissions :: !(Maybe [Text])
2827+ , _rLogConfig :: !(Maybe [LogConfig])
2828+ , _rDescription :: !(Maybe Text)
2829+ } deriving (Eq,Show,Data,Typeable,Generic)
2830+
2831+-- | Creates a value of 'Rule' with the minimum fields required to make a request.
2832+--
2833+-- Use one of the following lenses to modify other fields as desired:
2834+--
2835+-- * 'rAction'
2836+--
2837+-- * 'rIn'
2838+--
2839+-- * 'rNotIn'
2840+--
2841+-- * 'rConditions'
2842+--
2843+-- * 'rPermissions'
2844+--
2845+-- * 'rLogConfig'
2846+--
2847+-- * 'rDescription'
2848+rule
2849+ :: Rule
2850+rule =
2851+ Rule'
2852+ { _rAction = Nothing
2853+ , _rIn = Nothing
2854+ , _rNotIn = Nothing
2855+ , _rConditions = Nothing
2856+ , _rPermissions = Nothing
2857+ , _rLogConfig = Nothing
2858+ , _rDescription = Nothing
2859+ }
2860+
2861+-- | Required
2862+rAction :: Lens' Rule (Maybe RuleAction)
2863+rAction = lens _rAction (\ s a -> s{_rAction = a})
2864+
2865+-- | If one or more \'in\' clauses are specified, the rule matches if the
2866+-- PRINCIPAL\/AUTHORITY_SELECTOR is in at least one of these entries.
2867+rIn :: Lens' Rule [Text]
2868+rIn
2869+ = lens _rIn (\ s a -> s{_rIn = a}) . _Default .
2870+ _Coerce
2871+
2872+-- | If one or more \'not_in\' clauses are specified, the rule matches if the
2873+-- PRINCIPAL\/AUTHORITY_SELECTOR is in none of the entries. The format for
2874+-- in and not_in entries is the same as for members in a Binding (see
2875+-- google\/iam\/v1\/policy.proto).
2876+rNotIn :: Lens' Rule [Text]
2877+rNotIn
2878+ = lens _rNotIn (\ s a -> s{_rNotIn = a}) . _Default .
2879+ _Coerce
2880+
2881+-- | Additional restrictions that must be met
2882+rConditions :: Lens' Rule [Condition]
2883+rConditions
2884+ = lens _rConditions (\ s a -> s{_rConditions = a}) .
2885+ _Default
2886+ . _Coerce
2887+
2888+-- | A permission is a string of form \'..\' (e.g.,
2889+-- \'storage.buckets.list\'). A value of \'*\' matches all permissions, and
2890+-- a verb part of \'*\' (e.g., \'storage.buckets.*\') matches all verbs.
2891+rPermissions :: Lens' Rule [Text]
2892+rPermissions
2893+ = lens _rPermissions (\ s a -> s{_rPermissions = a})
2894+ . _Default
2895+ . _Coerce
2896+
2897+-- | The config returned to callers of tech.iam.IAM.CheckPolicy for any
2898+-- entries that match the LOG action.
2899+rLogConfig :: Lens' Rule [LogConfig]
2900+rLogConfig
2901+ = lens _rLogConfig (\ s a -> s{_rLogConfig = a}) .
2902+ _Default
2903+ . _Coerce
2904+
2905+-- | Human-readable description of the rule.
2906+rDescription :: Lens' Rule (Maybe Text)
2907+rDescription
2908+ = lens _rDescription (\ s a -> s{_rDescription = a})
2909+
2910+instance FromJSON Rule where
2911+ parseJSON
2912+ = withObject "Rule"
2913+ (\ o ->
2914+ Rule' <$>
2915+ (o .:? "action") <*> (o .:? "in" .!= mempty) <*>
2916+ (o .:? "notIn" .!= mempty)
2917+ <*> (o .:? "conditions" .!= mempty)
2918+ <*> (o .:? "permissions" .!= mempty)
2919+ <*> (o .:? "logConfig" .!= mempty)
2920+ <*> (o .:? "description"))
2921+
2922+instance ToJSON Rule where
2923+ toJSON Rule'{..}
2924+ = object
2925+ (catMaybes
2926+ [("action" .=) <$> _rAction, ("in" .=) <$> _rIn,
2927+ ("notIn" .=) <$> _rNotIn,
2928+ ("conditions" .=) <$> _rConditions,
2929+ ("permissions" .=) <$> _rPermissions,
2930+ ("logConfig" .=) <$> _rLogConfig,
2931+ ("description" .=) <$> _rDescription])
2932+
2933+-- | \`Visibility\` defines restrictions for the visibility of service
2934+-- elements. Restrictions are specified using visibility labels (e.g.,
2935+-- TRUSTED_TESTER) that are elsewhere linked to users and projects. Users
2936+-- and projects can have access to more than one visibility label. The
2937+-- effective visibility for multiple labels is the union of each label\'s
2938+-- elements, plus any unrestricted elements. If an element and its parents
2939+-- have no restrictions, visibility is unconditionally granted. Example:
2940+-- visibility: rules: - selector: google.calendar.Calendar.EnhancedSearch
2941+-- restriction: TRUSTED_TESTER - selector:
2942+-- google.calendar.Calendar.Delegate restriction: GOOGLE_INTERNAL Here, all
2943+-- methods are publicly visible except for the restricted methods
2944+-- EnhancedSearch and Delegate.
2945+--
2946+-- /See:/ 'visibility' smart constructor.
2947+newtype Visibility = Visibility'
2948+ { _vRules :: Maybe [VisibilityRule]
2949+ } deriving (Eq,Show,Data,Typeable,Generic)
2950+
2951+-- | Creates a value of 'Visibility' with the minimum fields required to make a request.
2952+--
2953+-- Use one of the following lenses to modify other fields as desired:
2954+--
2955+-- * 'vRules'
2956+visibility
2957+ :: Visibility
2958+visibility =
2959+ Visibility'
2960+ { _vRules = Nothing
2961+ }
2962+
2963+-- | A list of visibility rules that apply to individual API elements.
2964+-- **NOTE:** All service configuration rules follow \"last one wins\"
2965+-- order.
2966+vRules :: Lens' Visibility [VisibilityRule]
2967+vRules
2968+ = lens _vRules (\ s a -> s{_vRules = a}) . _Default .
2969+ _Coerce
2970+
2971+instance FromJSON Visibility where
2972+ parseJSON
2973+ = withObject "Visibility"
2974+ (\ o -> Visibility' <$> (o .:? "rules" .!= mempty))
2975+
2976+instance ToJSON Visibility where
2977+ toJSON Visibility'{..}
2978+ = object (catMaybes [("rules" .=) <$> _vRules])
2979+
2980+-- | Authentication rules for the service. By default, if a method has any
2981+-- authentication requirements, every request must include a valid
2982+-- credential matching one of the requirements. It\'s an error to include
2983+-- more than one kind of credential in a single request. If a method
2984+-- doesn\'t have any auth requirements, request credentials will be
2985+-- ignored.
2986+--
2987+-- /See:/ 'authenticationRule' smart constructor.
2988+data AuthenticationRule = AuthenticationRule'
2989+ { _arRequirements :: !(Maybe [AuthRequirement])
2990+ , _arSelector :: !(Maybe Text)
2991+ , _arAllowWithoutCredential :: !(Maybe Bool)
2992+ , _arOAuth :: !(Maybe OAuthRequirements)
2993+ } deriving (Eq,Show,Data,Typeable,Generic)
2994+
2995+-- | Creates a value of 'AuthenticationRule' with the minimum fields required to make a request.
2996+--
2997+-- Use one of the following lenses to modify other fields as desired:
2998+--
2999+-- * 'arRequirements'
3000+--
3001+-- * 'arSelector'
3002+--
3003+-- * 'arAllowWithoutCredential'
3004+--
3005+-- * 'arOAuth'
3006+authenticationRule
3007+ :: AuthenticationRule
3008+authenticationRule =
3009+ AuthenticationRule'
3010+ { _arRequirements = Nothing
3011+ , _arSelector = Nothing
3012+ , _arAllowWithoutCredential = Nothing
3013+ , _arOAuth = Nothing
3014+ }
3015+
3016+-- | Requirements for additional authentication providers.
3017+arRequirements :: Lens' AuthenticationRule [AuthRequirement]
3018+arRequirements
3019+ = lens _arRequirements
3020+ (\ s a -> s{_arRequirements = a})
3021+ . _Default
3022+ . _Coerce
3023+
3024+-- | Selects the methods to which this rule applies. Refer to selector for
3025+-- syntax details.
3026+arSelector :: Lens' AuthenticationRule (Maybe Text)
3027+arSelector
3028+ = lens _arSelector (\ s a -> s{_arSelector = a})
3029+
3030+-- | Whether to allow requests without a credential. The credential can be an
3031+-- OAuth token, Google cookies (first-party auth) or EndUserCreds. For
3032+-- requests without credentials, if the service control environment is
3033+-- specified, each incoming request **must** be associated with a service
3034+-- consumer. This can be done by passing an API key that belongs to a
3035+-- consumer project.
3036+arAllowWithoutCredential :: Lens' AuthenticationRule (Maybe Bool)
3037+arAllowWithoutCredential
3038+ = lens _arAllowWithoutCredential
3039+ (\ s a -> s{_arAllowWithoutCredential = a})
3040+
3041+-- | The requirements for OAuth credentials.
3042+arOAuth :: Lens' AuthenticationRule (Maybe OAuthRequirements)
3043+arOAuth = lens _arOAuth (\ s a -> s{_arOAuth = a})
3044+
3045+instance FromJSON AuthenticationRule where
3046+ parseJSON
3047+ = withObject "AuthenticationRule"
3048+ (\ o ->
3049+ AuthenticationRule' <$>
3050+ (o .:? "requirements" .!= mempty) <*>
3051+ (o .:? "selector")
3052+ <*> (o .:? "allowWithoutCredential")
3053+ <*> (o .:? "oauth"))
3054+
3055+instance ToJSON AuthenticationRule where
3056+ toJSON AuthenticationRule'{..}
3057+ = object
3058+ (catMaybes
3059+ [("requirements" .=) <$> _arRequirements,
3060+ ("selector" .=) <$> _arSelector,
3061+ ("allowWithoutCredential" .=) <$>
3062+ _arAllowWithoutCredential,
3063+ ("oauth" .=) <$> _arOAuth])
3064+
3065+-- | Request message for \`SetIamPolicy\` method.
3066+--
3067+-- /See:/ 'setIAMPolicyRequest' smart constructor.
3068+newtype SetIAMPolicyRequest = SetIAMPolicyRequest'
3069+ { _siprPolicy :: Maybe Policy
3070+ } deriving (Eq,Show,Data,Typeable,Generic)
3071+
3072+-- | Creates a value of 'SetIAMPolicyRequest' with the minimum fields required to make a request.
3073+--
3074+-- Use one of the following lenses to modify other fields as desired:
3075+--
3076+-- * 'siprPolicy'
3077+setIAMPolicyRequest
3078+ :: SetIAMPolicyRequest
3079+setIAMPolicyRequest =
3080+ SetIAMPolicyRequest'
3081+ { _siprPolicy = Nothing
3082+ }
3083+
3084+-- | REQUIRED: The complete policy to be applied to the \`resource\`. The
3085+-- size of the policy is limited to a few 10s of KB. An empty policy is a
3086+-- valid policy but certain Cloud Platform services (such as Projects)
3087+-- might reject them.
3088+siprPolicy :: Lens' SetIAMPolicyRequest (Maybe Policy)
3089+siprPolicy
3090+ = lens _siprPolicy (\ s a -> s{_siprPolicy = a})
3091+
3092+instance FromJSON SetIAMPolicyRequest where
3093+ parseJSON
3094+ = withObject "SetIAMPolicyRequest"
3095+ (\ o -> SetIAMPolicyRequest' <$> (o .:? "policy"))
3096+
3097+instance ToJSON SetIAMPolicyRequest where
3098+ toJSON SetIAMPolicyRequest'{..}
3099+ = object (catMaybes [("policy" .=) <$> _siprPolicy])
3100+
3101+-- | Maps service configuration IDs to their corresponding traffic
3102+-- percentage. Key is the service configuration ID, Value is the traffic
3103+-- percentage which must be greater than 0.0 and the sum must equal to
3104+-- 100.0.
3105+--
3106+-- /See:/ 'trafficPercentStrategyPercentages' smart constructor.
3107+newtype TrafficPercentStrategyPercentages = TrafficPercentStrategyPercentages'
3108+ { _tpspAddtional :: HashMap Text (Textual Double)
3109+ } deriving (Eq,Show,Data,Typeable,Generic)
3110+
3111+-- | Creates a value of 'TrafficPercentStrategyPercentages' with the minimum fields required to make a request.
3112+--
3113+-- Use one of the following lenses to modify other fields as desired:
3114+--
3115+-- * 'tpspAddtional'
3116+trafficPercentStrategyPercentages
3117+ :: HashMap Text Double -- ^ 'tpspAddtional'
3118+ -> TrafficPercentStrategyPercentages
3119+trafficPercentStrategyPercentages pTpspAddtional_ =
3120+ TrafficPercentStrategyPercentages'
3121+ { _tpspAddtional = _Coerce # pTpspAddtional_
3122+ }
3123+
3124+tpspAddtional :: Lens' TrafficPercentStrategyPercentages (HashMap Text Double)
3125+tpspAddtional
3126+ = lens _tpspAddtional
3127+ (\ s a -> s{_tpspAddtional = a})
3128+ . _Coerce
3129+
3130+instance FromJSON TrafficPercentStrategyPercentages
3131+ where
3132+ parseJSON
3133+ = withObject "TrafficPercentStrategyPercentages"
3134+ (\ o ->
3135+ TrafficPercentStrategyPercentages' <$>
3136+ (parseJSONObject o))
3137+
3138+instance ToJSON TrafficPercentStrategyPercentages
3139+ where
3140+ toJSON = toJSON . _tpspAddtional
3141+
3142+-- | Response message for ListServiceRollouts method.
3143+--
3144+-- /See:/ 'listServiceRolloutsResponse' smart constructor.
3145+data ListServiceRolloutsResponse = ListServiceRolloutsResponse'
3146+ { _lsrrNextPageToken :: !(Maybe Text)
3147+ , _lsrrRollouts :: !(Maybe [Rollout])
3148+ } deriving (Eq,Show,Data,Typeable,Generic)
3149+
3150+-- | Creates a value of 'ListServiceRolloutsResponse' with the minimum fields required to make a request.
3151+--
3152+-- Use one of the following lenses to modify other fields as desired:
3153+--
3154+-- * 'lsrrNextPageToken'
3155+--
3156+-- * 'lsrrRollouts'
3157+listServiceRolloutsResponse
3158+ :: ListServiceRolloutsResponse
3159+listServiceRolloutsResponse =
3160+ ListServiceRolloutsResponse'
3161+ { _lsrrNextPageToken = Nothing
3162+ , _lsrrRollouts = Nothing
3163+ }
3164+
3165+-- | The token of the next page of results.
3166+lsrrNextPageToken :: Lens' ListServiceRolloutsResponse (Maybe Text)
3167+lsrrNextPageToken
3168+ = lens _lsrrNextPageToken
3169+ (\ s a -> s{_lsrrNextPageToken = a})
3170+
3171+-- | The list of rollout resources.
3172+lsrrRollouts :: Lens' ListServiceRolloutsResponse [Rollout]
3173+lsrrRollouts
3174+ = lens _lsrrRollouts (\ s a -> s{_lsrrRollouts = a})
3175+ . _Default
3176+ . _Coerce
3177+
3178+instance FromJSON ListServiceRolloutsResponse where
3179+ parseJSON
3180+ = withObject "ListServiceRolloutsResponse"
3181+ (\ o ->
3182+ ListServiceRolloutsResponse' <$>
3183+ (o .:? "nextPageToken") <*>
3184+ (o .:? "rollouts" .!= mempty))
3185+
3186+instance ToJSON ListServiceRolloutsResponse where
3187+ toJSON ListServiceRolloutsResponse'{..}
3188+ = object
3189+ (catMaybes
3190+ [("nextPageToken" .=) <$> _lsrrNextPageToken,
3191+ ("rollouts" .=) <$> _lsrrRollouts])
3192+
3193+-- | Output generated from semantically comparing two versions of a service
3194+-- configuration. Includes detailed information about a field that have
3195+-- changed with applicable advice about potential consequences for the
3196+-- change, such as backwards-incompatibility.
3197+--
3198+-- /See:/ 'configChange' smart constructor.
3199+data ConfigChange = ConfigChange'
3200+ { _ccOldValue :: !(Maybe Text)
3201+ , _ccNewValue :: !(Maybe Text)
3202+ , _ccAdvices :: !(Maybe [Advice])
3203+ , _ccChangeType :: !(Maybe ConfigChangeChangeType)
3204+ , _ccElement :: !(Maybe Text)
3205+ } deriving (Eq,Show,Data,Typeable,Generic)
3206+
3207+-- | Creates a value of 'ConfigChange' with the minimum fields required to make a request.
3208+--
3209+-- Use one of the following lenses to modify other fields as desired:
3210+--
3211+-- * 'ccOldValue'
3212+--
3213+-- * 'ccNewValue'
3214+--
3215+-- * 'ccAdvices'
3216+--
3217+-- * 'ccChangeType'
3218+--
3219+-- * 'ccElement'
3220+configChange
3221+ :: ConfigChange
3222+configChange =
3223+ ConfigChange'
3224+ { _ccOldValue = Nothing
3225+ , _ccNewValue = Nothing
3226+ , _ccAdvices = Nothing
3227+ , _ccChangeType = Nothing
3228+ , _ccElement = Nothing
3229+ }
3230+
3231+-- | Value of the changed object in the old Service configuration, in JSON
3232+-- format. This field will not be populated if ChangeType == ADDED.
3233+ccOldValue :: Lens' ConfigChange (Maybe Text)
3234+ccOldValue
3235+ = lens _ccOldValue (\ s a -> s{_ccOldValue = a})
3236+
3237+-- | Value of the changed object in the new Service configuration, in JSON
3238+-- format. This field will not be populated if ChangeType == REMOVED.
3239+ccNewValue :: Lens' ConfigChange (Maybe Text)
3240+ccNewValue
3241+ = lens _ccNewValue (\ s a -> s{_ccNewValue = a})
3242+
3243+-- | Collection of advice provided for this change, useful for determining
3244+-- the possible impact of this change.
3245+ccAdvices :: Lens' ConfigChange [Advice]
3246+ccAdvices
3247+ = lens _ccAdvices (\ s a -> s{_ccAdvices = a}) .
3248+ _Default
3249+ . _Coerce
3250+
3251+-- | The type for this change, either ADDED, REMOVED, or MODIFIED.
3252+ccChangeType :: Lens' ConfigChange (Maybe ConfigChangeChangeType)
3253+ccChangeType
3254+ = lens _ccChangeType (\ s a -> s{_ccChangeType = a})
3255+
3256+-- | Object hierarchy path to the change, with levels separated by a \'.\'
3257+-- character. For repeated fields, an applicable unique identifier field is
3258+-- used for the index (usually selector, name, or id). For maps, the term
3259+-- \'key\' is used. If the field has no unique identifier, the numeric
3260+-- index is used. Examples: -
3261+-- visibility.rules[selector==\"google.LibraryService.CreateBook\"].restriction
3262+-- -
3263+-- quota.metric_rules[selector==\"google\"].metric_costs[key==\"reads\"].value
3264+-- - logging.producer_destinations[0]
3265+ccElement :: Lens' ConfigChange (Maybe Text)
3266+ccElement
3267+ = lens _ccElement (\ s a -> s{_ccElement = a})
3268+
3269+instance FromJSON ConfigChange where
3270+ parseJSON
3271+ = withObject "ConfigChange"
3272+ (\ o ->
3273+ ConfigChange' <$>
3274+ (o .:? "oldValue") <*> (o .:? "newValue") <*>
3275+ (o .:? "advices" .!= mempty)
3276+ <*> (o .:? "changeType")
3277+ <*> (o .:? "element"))
3278+
3279+instance ToJSON ConfigChange where
3280+ toJSON ConfigChange'{..}
3281+ = object
3282+ (catMaybes
3283+ [("oldValue" .=) <$> _ccOldValue,
3284+ ("newValue" .=) <$> _ccNewValue,
3285+ ("advices" .=) <$> _ccAdvices,
3286+ ("changeType" .=) <$> _ccChangeType,
3287+ ("element" .=) <$> _ccElement])
3288+
3289+-- | Write a Cloud Audit log
3290+--
3291+-- /See:/ 'cloudAuditOptions' smart constructor.
3292+data CloudAuditOptions =
3293+ CloudAuditOptions'
3294+ deriving (Eq,Show,Data,Typeable,Generic)
3295+
3296+-- | Creates a value of 'CloudAuditOptions' with the minimum fields required to make a request.
3297+--
3298+cloudAuditOptions
3299+ :: CloudAuditOptions
3300+cloudAuditOptions = CloudAuditOptions'
3301+
3302+instance FromJSON CloudAuditOptions where
3303+ parseJSON
3304+ = withObject "CloudAuditOptions"
3305+ (\ o -> pure CloudAuditOptions')
3306+
3307+instance ToJSON CloudAuditOptions where
3308+ toJSON = const emptyObject
3309+
3310+-- | \`Backend\` defines the backend configuration for a service.
3311+--
3312+-- /See:/ 'backend' smart constructor.
3313+newtype Backend = Backend'
3314+ { _bRules :: Maybe [BackendRule]
3315+ } deriving (Eq,Show,Data,Typeable,Generic)
3316+
3317+-- | Creates a value of 'Backend' with the minimum fields required to make a request.
3318+--
3319+-- Use one of the following lenses to modify other fields as desired:
3320+--
3321+-- * 'bRules'
3322+backend
3323+ :: Backend
3324+backend =
3325+ Backend'
3326+ { _bRules = Nothing
3327+ }
3328+
3329+-- | A list of API backend rules that apply to individual API methods.
3330+-- **NOTE:** All service configuration rules follow \"last one wins\"
3331+-- order.
3332+bRules :: Lens' Backend [BackendRule]
3333+bRules
3334+ = lens _bRules (\ s a -> s{_bRules = a}) . _Default .
3335+ _Coerce
3336+
3337+instance FromJSON Backend where
3338+ parseJSON
3339+ = withObject "Backend"
3340+ (\ o -> Backend' <$> (o .:? "rules" .!= mempty))
3341+
3342+instance ToJSON Backend where
3343+ toJSON Backend'{..}
3344+ = object (catMaybes [("rules" .=) <$> _bRules])
3345+
3346+-- | Write a Data Access (Gin) log
3347+--
3348+-- /See:/ 'dataAccessOptions' smart constructor.
3349+data DataAccessOptions =
3350+ DataAccessOptions'
3351+ deriving (Eq,Show,Data,Typeable,Generic)
3352+
3353+-- | Creates a value of 'DataAccessOptions' with the minimum fields required to make a request.
3354+--
3355+dataAccessOptions
3356+ :: DataAccessOptions
3357+dataAccessOptions = DataAccessOptions'
3358+
3359+instance FromJSON DataAccessOptions where
3360+ parseJSON
3361+ = withObject "DataAccessOptions"
3362+ (\ o -> pure DataAccessOptions')
3363+
3364+instance ToJSON DataAccessOptions where
3365+ toJSON = const emptyObject
3366+
3367+-- | Monitoring configuration of the service. The example below shows how to
3368+-- configure monitored resources and metrics for monitoring. In the
3369+-- example, a monitored resource and two metrics are defined. The
3370+-- \`library.googleapis.com\/book\/returned_count\` metric is sent to both
3371+-- producer and consumer projects, whereas the
3372+-- \`library.googleapis.com\/book\/overdue_count\` metric is only sent to
3373+-- the consumer project. monitored_resources: - type:
3374+-- library.googleapis.com\/branch labels: - key: \/city description: The
3375+-- city where the library branch is located in. - key: \/name description:
3376+-- The name of the branch. metrics: - name:
3377+-- library.googleapis.com\/book\/returned_count metric_kind: DELTA
3378+-- value_type: INT64 labels: - key: \/customer_id - name:
3379+-- library.googleapis.com\/book\/overdue_count metric_kind: GAUGE
3380+-- value_type: INT64 labels: - key: \/customer_id monitoring:
3381+-- producer_destinations: - monitored_resource:
3382+-- library.googleapis.com\/branch metrics: -
3383+-- library.googleapis.com\/book\/returned_count consumer_destinations: -
3384+-- monitored_resource: library.googleapis.com\/branch metrics: -
3385+-- library.googleapis.com\/book\/returned_count -
3386+-- library.googleapis.com\/book\/overdue_count
3387+--
3388+-- /See:/ 'monitoring' smart constructor.
3389+data Monitoring = Monitoring'
3390+ { _mProducerDestinations :: !(Maybe [MonitoringDestination])
3391+ , _mConsumerDestinations :: !(Maybe [MonitoringDestination])
3392+ } deriving (Eq,Show,Data,Typeable,Generic)
3393+
3394+-- | Creates a value of 'Monitoring' with the minimum fields required to make a request.
3395+--
3396+-- Use one of the following lenses to modify other fields as desired:
3397+--
3398+-- * 'mProducerDestinations'
3399+--
3400+-- * 'mConsumerDestinations'
3401+monitoring
3402+ :: Monitoring
3403+monitoring =
3404+ Monitoring'
3405+ { _mProducerDestinations = Nothing
3406+ , _mConsumerDestinations = Nothing
3407+ }
3408+
3409+-- | Monitoring configurations for sending metrics to the producer project.
3410+-- There can be multiple producer destinations, each one must have a
3411+-- different monitored resource type. A metric can be used in at most one
3412+-- producer destination.
3413+mProducerDestinations :: Lens' Monitoring [MonitoringDestination]
3414+mProducerDestinations
3415+ = lens _mProducerDestinations
3416+ (\ s a -> s{_mProducerDestinations = a})
3417+ . _Default
3418+ . _Coerce
3419+
3420+-- | Monitoring configurations for sending metrics to the consumer project.
3421+-- There can be multiple consumer destinations, each one must have a
3422+-- different monitored resource type. A metric can be used in at most one
3423+-- consumer destination.
3424+mConsumerDestinations :: Lens' Monitoring [MonitoringDestination]
3425+mConsumerDestinations
3426+ = lens _mConsumerDestinations
3427+ (\ s a -> s{_mConsumerDestinations = a})
3428+ . _Default
3429+ . _Coerce
3430+
3431+instance FromJSON Monitoring where
3432+ parseJSON
3433+ = withObject "Monitoring"
3434+ (\ o ->
3435+ Monitoring' <$>
3436+ (o .:? "producerDestinations" .!= mempty) <*>
3437+ (o .:? "consumerDestinations" .!= mempty))
3438+
3439+instance ToJSON Monitoring where
3440+ toJSON Monitoring'{..}
3441+ = object
3442+ (catMaybes
3443+ [("producerDestinations" .=) <$>
3444+ _mProducerDestinations,
3445+ ("consumerDestinations" .=) <$>
3446+ _mConsumerDestinations])
3447+
3448+-- | A description of a log type. Example in YAML format: - name:
3449+-- library.googleapis.com\/activity_history description: The history of
3450+-- borrowing and returning library items. display_name: Activity labels: -
3451+-- key: \/customer_id description: Identifier of a library customer
3452+--
3453+-- /See:/ 'logDescriptor' smart constructor.
3454+data LogDescriptor = LogDescriptor'
3455+ { _ldName :: !(Maybe Text)
3456+ , _ldDisplayName :: !(Maybe Text)
3457+ , _ldLabels :: !(Maybe [LabelDescriptor])
3458+ , _ldDescription :: !(Maybe Text)
3459+ } deriving (Eq,Show,Data,Typeable,Generic)
3460+
3461+-- | Creates a value of 'LogDescriptor' with the minimum fields required to make a request.
3462+--
3463+-- Use one of the following lenses to modify other fields as desired:
3464+--
3465+-- * 'ldName'
3466+--
3467+-- * 'ldDisplayName'
3468+--
3469+-- * 'ldLabels'
3470+--
3471+-- * 'ldDescription'
3472+logDescriptor
3473+ :: LogDescriptor
3474+logDescriptor =
3475+ LogDescriptor'
3476+ { _ldName = Nothing
3477+ , _ldDisplayName = Nothing
3478+ , _ldLabels = Nothing
3479+ , _ldDescription = Nothing
3480+ }
3481+
3482+-- | The name of the log. It must be less than 512 characters long and can
3483+-- include the following characters: upper- and lower-case alphanumeric
3484+-- characters [A-Za-z0-9], and punctuation characters including slash,
3485+-- underscore, hyphen, period [\/_-.].
3486+ldName :: Lens' LogDescriptor (Maybe Text)
3487+ldName = lens _ldName (\ s a -> s{_ldName = a})
3488+
3489+-- | The human-readable name for this log. This information appears on the
3490+-- user interface and should be concise.
3491+ldDisplayName :: Lens' LogDescriptor (Maybe Text)
3492+ldDisplayName
3493+ = lens _ldDisplayName
3494+ (\ s a -> s{_ldDisplayName = a})
3495+
3496+-- | The set of labels that are available to describe a specific log entry.
3497+-- Runtime requests that contain labels not specified here are considered
3498+-- invalid.
3499+ldLabels :: Lens' LogDescriptor [LabelDescriptor]
3500+ldLabels
3501+ = lens _ldLabels (\ s a -> s{_ldLabels = a}) .
3502+ _Default
3503+ . _Coerce
3504+
3505+-- | A human-readable description of this log. This information appears in
3506+-- the documentation and can contain details.
3507+ldDescription :: Lens' LogDescriptor (Maybe Text)
3508+ldDescription
3509+ = lens _ldDescription
3510+ (\ s a -> s{_ldDescription = a})
3511+
3512+instance FromJSON LogDescriptor where
3513+ parseJSON
3514+ = withObject "LogDescriptor"
3515+ (\ o ->
3516+ LogDescriptor' <$>
3517+ (o .:? "name") <*> (o .:? "displayName") <*>
3518+ (o .:? "labels" .!= mempty)
3519+ <*> (o .:? "description"))
3520+
3521+instance ToJSON LogDescriptor where
3522+ toJSON LogDescriptor'{..}
3523+ = object
3524+ (catMaybes
3525+ [("name" .=) <$> _ldName,
3526+ ("displayName" .=) <$> _ldDisplayName,
3527+ ("labels" .=) <$> _ldLabels,
3528+ ("description" .=) <$> _ldDescription])
3529+
3530+-- | Method represents a method of an api.
3531+--
3532+-- /See:/ 'method' smart constructor.
3533+data Method = Method'
3534+ { _metRequestStreaming :: !(Maybe Bool)
3535+ , _metResponseTypeURL :: !(Maybe Text)
3536+ , _metName :: !(Maybe Text)
3537+ , _metResponseStreaming :: !(Maybe Bool)
3538+ , _metRequestTypeURL :: !(Maybe Text)
3539+ , _metOptions :: !(Maybe [Option])
3540+ , _metSyntax :: !(Maybe MethodSyntax)
3541+ } deriving (Eq,Show,Data,Typeable,Generic)
3542+
3543+-- | Creates a value of 'Method' with the minimum fields required to make a request.
3544+--
3545+-- Use one of the following lenses to modify other fields as desired:
3546+--
3547+-- * 'metRequestStreaming'
3548+--
3549+-- * 'metResponseTypeURL'
3550+--
3551+-- * 'metName'
3552+--
3553+-- * 'metResponseStreaming'
3554+--
3555+-- * 'metRequestTypeURL'
3556+--
3557+-- * 'metOptions'
3558+--
3559+-- * 'metSyntax'
3560+method
3561+ :: Method
3562+method =
3563+ Method'
3564+ { _metRequestStreaming = Nothing
3565+ , _metResponseTypeURL = Nothing
3566+ , _metName = Nothing
3567+ , _metResponseStreaming = Nothing
3568+ , _metRequestTypeURL = Nothing
3569+ , _metOptions = Nothing
3570+ , _metSyntax = Nothing
3571+ }
3572+
3573+-- | If true, the request is streamed.
3574+metRequestStreaming :: Lens' Method (Maybe Bool)
3575+metRequestStreaming
3576+ = lens _metRequestStreaming
3577+ (\ s a -> s{_metRequestStreaming = a})
3578+
3579+-- | The URL of the output message type.
3580+metResponseTypeURL :: Lens' Method (Maybe Text)
3581+metResponseTypeURL
3582+ = lens _metResponseTypeURL
3583+ (\ s a -> s{_metResponseTypeURL = a})
3584+
3585+-- | The simple name of this method.
3586+metName :: Lens' Method (Maybe Text)
3587+metName = lens _metName (\ s a -> s{_metName = a})
3588+
3589+-- | If true, the response is streamed.
3590+metResponseStreaming :: Lens' Method (Maybe Bool)
3591+metResponseStreaming
3592+ = lens _metResponseStreaming
3593+ (\ s a -> s{_metResponseStreaming = a})
3594+
3595+-- | A URL of the input message type.
3596+metRequestTypeURL :: Lens' Method (Maybe Text)
3597+metRequestTypeURL
3598+ = lens _metRequestTypeURL
3599+ (\ s a -> s{_metRequestTypeURL = a})
3600+
3601+-- | Any metadata attached to the method.
3602+metOptions :: Lens' Method [Option]
3603+metOptions
3604+ = lens _metOptions (\ s a -> s{_metOptions = a}) .
3605+ _Default
3606+ . _Coerce
3607+
3608+-- | The source syntax of this method.
3609+metSyntax :: Lens' Method (Maybe MethodSyntax)
3610+metSyntax
3611+ = lens _metSyntax (\ s a -> s{_metSyntax = a})
3612+
3613+instance FromJSON Method where
3614+ parseJSON
3615+ = withObject "Method"
3616+ (\ o ->
3617+ Method' <$>
3618+ (o .:? "requestStreaming") <*>
3619+ (o .:? "responseTypeUrl")
3620+ <*> (o .:? "name")
3621+ <*> (o .:? "responseStreaming")
3622+ <*> (o .:? "requestTypeUrl")
3623+ <*> (o .:? "options" .!= mempty)
3624+ <*> (o .:? "syntax"))
3625+
3626+instance ToJSON Method where
3627+ toJSON Method'{..}
3628+ = object
3629+ (catMaybes
3630+ [("requestStreaming" .=) <$> _metRequestStreaming,
3631+ ("responseTypeUrl" .=) <$> _metResponseTypeURL,
3632+ ("name" .=) <$> _metName,
3633+ ("responseStreaming" .=) <$> _metResponseStreaming,
3634+ ("requestTypeUrl" .=) <$> _metRequestTypeURL,
3635+ ("options" .=) <$> _metOptions,
3636+ ("syntax" .=) <$> _metSyntax])
3637+
3638+-- | Represents a diagnostic message (error or warning)
3639+--
3640+-- /See:/ 'diagnostic' smart constructor.
3641+data Diagnostic = Diagnostic'
3642+ { _dLocation :: !(Maybe Text)
3643+ , _dKind :: !(Maybe DiagnosticKind)
3644+ , _dMessage :: !(Maybe Text)
3645+ } deriving (Eq,Show,Data,Typeable,Generic)
3646+
3647+-- | Creates a value of 'Diagnostic' with the minimum fields required to make a request.
3648+--
3649+-- Use one of the following lenses to modify other fields as desired:
3650+--
3651+-- * 'dLocation'
3652+--
3653+-- * 'dKind'
3654+--
3655+-- * 'dMessage'
3656+diagnostic
3657+ :: Diagnostic
3658+diagnostic =
3659+ Diagnostic'
3660+ { _dLocation = Nothing
3661+ , _dKind = Nothing
3662+ , _dMessage = Nothing
3663+ }
3664+
3665+-- | File name and line number of the error or warning.
3666+dLocation :: Lens' Diagnostic (Maybe Text)
3667+dLocation
3668+ = lens _dLocation (\ s a -> s{_dLocation = a})
3669+
3670+-- | The kind of diagnostic information provided.
3671+dKind :: Lens' Diagnostic (Maybe DiagnosticKind)
3672+dKind = lens _dKind (\ s a -> s{_dKind = a})
3673+
3674+-- | Message describing the error or warning.
3675+dMessage :: Lens' Diagnostic (Maybe Text)
3676+dMessage = lens _dMessage (\ s a -> s{_dMessage = a})
3677+
3678+instance FromJSON Diagnostic where
3679+ parseJSON
3680+ = withObject "Diagnostic"
3681+ (\ o ->
3682+ Diagnostic' <$>
3683+ (o .:? "location") <*> (o .:? "kind") <*>
3684+ (o .:? "message"))
3685+
3686+instance ToJSON Diagnostic where
3687+ toJSON Diagnostic'{..}
3688+ = object
3689+ (catMaybes
3690+ [("location" .=) <$> _dLocation,
3691+ ("kind" .=) <$> _dKind,
3692+ ("message" .=) <$> _dMessage])
3693+
3694+-- | ### System parameter configuration A system parameter is a special kind
3695+-- of parameter defined by the API system, not by an individual API. It is
3696+-- typically mapped to an HTTP header and\/or a URL query parameter. This
3697+-- configuration specifies which methods change the names of the system
3698+-- parameters.
3699+--
3700+-- /See:/ 'systemParameters' smart constructor.
3701+newtype SystemParameters = SystemParameters'
3702+ { _spRules :: Maybe [SystemParameterRule]
3703+ } deriving (Eq,Show,Data,Typeable,Generic)
3704+
3705+-- | Creates a value of 'SystemParameters' with the minimum fields required to make a request.
3706+--
3707+-- Use one of the following lenses to modify other fields as desired:
3708+--
3709+-- * 'spRules'
3710+systemParameters
3711+ :: SystemParameters
3712+systemParameters =
3713+ SystemParameters'
3714+ { _spRules = Nothing
3715+ }
3716+
3717+-- | Define system parameters. The parameters defined here will override the
3718+-- default parameters implemented by the system. If this field is missing
3719+-- from the service config, default system parameters will be used. Default
3720+-- system parameters and names is implementation-dependent. Example: define
3721+-- api key and alt name for all methods system_parameters rules: -
3722+-- selector: \"*\" parameters: - name: api_key url_query_parameter: api_key
3723+-- - name: alt http_header: Response-Content-Type Example: define 2 api key
3724+-- names for a specific method. system_parameters rules: - selector:
3725+-- \"\/ListShelves\" parameters: - name: api_key http_header: Api-Key1 -
3726+-- name: api_key http_header: Api-Key2 **NOTE:** All service configuration
3727+-- rules follow \"last one wins\" order.
3728+spRules :: Lens' SystemParameters [SystemParameterRule]
3729+spRules
3730+ = lens _spRules (\ s a -> s{_spRules = a}) . _Default
3731+ . _Coerce
3732+
3733+instance FromJSON SystemParameters where
3734+ parseJSON
3735+ = withObject "SystemParameters"
3736+ (\ o ->
3737+ SystemParameters' <$> (o .:? "rules" .!= mempty))
3738+
3739+instance ToJSON SystemParameters where
3740+ toJSON SystemParameters'{..}
3741+ = object (catMaybes [("rules" .=) <$> _spRules])
3742+
3743+-- | Represents a source file which is used to generate the service
3744+-- configuration defined by \`google.api.Service\`.
3745+--
3746+-- /See:/ 'configSource' smart constructor.
3747+data ConfigSource = ConfigSource'
3748+ { _csFiles :: !(Maybe [ConfigFile])
3749+ , _csId :: !(Maybe Text)
3750+ } deriving (Eq,Show,Data,Typeable,Generic)
3751+
3752+-- | Creates a value of 'ConfigSource' with the minimum fields required to make a request.
3753+--
3754+-- Use one of the following lenses to modify other fields as desired:
3755+--
3756+-- * 'csFiles'
3757+--
3758+-- * 'csId'
3759+configSource
3760+ :: ConfigSource
3761+configSource =
3762+ ConfigSource'
3763+ { _csFiles = Nothing
3764+ , _csId = Nothing
3765+ }
3766+
3767+-- | Set of source configuration files that are used to generate a service
3768+-- configuration (\`google.api.Service\`).
3769+csFiles :: Lens' ConfigSource [ConfigFile]
3770+csFiles
3771+ = lens _csFiles (\ s a -> s{_csFiles = a}) . _Default
3772+ . _Coerce
3773+
3774+-- | A unique ID for a specific instance of this message, typically assigned
3775+-- by the client for tracking purpose. If empty, the server may choose to
3776+-- generate one instead.
3777+csId :: Lens' ConfigSource (Maybe Text)
3778+csId = lens _csId (\ s a -> s{_csId = a})
3779+
3780+instance FromJSON ConfigSource where
3781+ parseJSON
3782+ = withObject "ConfigSource"
3783+ (\ o ->
3784+ ConfigSource' <$>
3785+ (o .:? "files" .!= mempty) <*> (o .:? "id"))
3786+
3787+instance ToJSON ConfigSource where
3788+ toJSON ConfigSource'{..}
3789+ = object
3790+ (catMaybes
3791+ [("files" .=) <$> _csFiles, ("id" .=) <$> _csId])
3792+
3793+-- | \`Documentation\` provides the information for describing a service.
3794+-- Example:
3795+--
3796+-- > documentation:
3797+-- > summary: >
3798+-- > The Google Calendar API gives access
3799+-- > to most calendar features.
3800+-- > pages:
3801+-- > - name: Overview
3802+-- > content: (== include google/foo/overview.md ==)
3803+-- > - name: Tutorial
3804+-- > content: (== include google/foo/tutorial.md ==)
3805+-- > subpages;
3806+-- > - name: Java
3807+-- > content: (== include google/foo/tutorial_java.md ==)
3808+-- > rules:
3809+-- > - selector: google.calendar.Calendar.Get
3810+-- > description: >
3811+-- > ...
3812+-- > - selector: google.calendar.Calendar.Put
3813+-- > description: >
3814+-- > ...
3815+--
3816+-- Documentation is provided in markdown syntax. In addition to standard
3817+-- markdown features, definition lists, tables and fenced code blocks are
3818+-- supported. Section headers can be provided and are interpreted relative
3819+-- to the section nesting of the context where a documentation fragment is
3820+-- embedded. Documentation from the IDL is merged with documentation
3821+-- defined via the config at normalization time, where documentation
3822+-- provided by config rules overrides IDL provided. A number of constructs
3823+-- specific to the API platform are supported in documentation text. In
3824+-- order to reference a proto element, the following notation can be used:
3825+--
3826+-- > [fully.qualified.proto.name][]
3827+--
3828+-- To override the display text used for the link, this can be used:
3829+--
3830+-- > [display text][fully.qualified.proto.name]
3831+--
3832+-- Text can be excluded from doc using the following notation:
3833+--
3834+-- > (-- internal comment --)
3835+--
3836+-- Comments can be made conditional using a visibility label. The below
3837+-- text will be only rendered if the \`BETA\` label is available:
3838+--
3839+-- > (--BETA: comment for BETA users --)
3840+--
3841+-- A few directives are available in documentation. Note that directives
3842+-- must appear on a single line to be properly identified. The \`include\`
3843+-- directive includes a markdown file from an external source:
3844+--
3845+-- > (== include path/to/file ==)
3846+--
3847+-- The \`resource_for\` directive marks a message to be the resource of a
3848+-- collection in REST view. If it is not specified, tools attempt to infer
3849+-- the resource from the operations in a collection:
3850+--
3851+-- > (== resource_for v1.shelves.books ==)
3852+--
3853+-- The directive \`suppress_warning\` does not directly affect
3854+-- documentation and is documented together with service config validation.
3855+--
3856+-- /See:/ 'documentation' smart constructor.
3857+data Documentation = Documentation'
3858+ { _dSummary :: !(Maybe Text)
3859+ , _dDocumentationRootURL :: !(Maybe Text)
3860+ , _dRules :: !(Maybe [DocumentationRule])
3861+ , _dPages :: !(Maybe [Page])
3862+ , _dOverview :: !(Maybe Text)
3863+ } deriving (Eq,Show,Data,Typeable,Generic)
3864+
3865+-- | Creates a value of 'Documentation' with the minimum fields required to make a request.
3866+--
3867+-- Use one of the following lenses to modify other fields as desired:
3868+--
3869+-- * 'dSummary'
3870+--
3871+-- * 'dDocumentationRootURL'
3872+--
3873+-- * 'dRules'
3874+--
3875+-- * 'dPages'
3876+--
3877+-- * 'dOverview'
3878+documentation
3879+ :: Documentation
3880+documentation =
3881+ Documentation'
3882+ { _dSummary = Nothing
3883+ , _dDocumentationRootURL = Nothing
3884+ , _dRules = Nothing
3885+ , _dPages = Nothing
3886+ , _dOverview = Nothing
3887+ }
3888+
3889+-- | A short summary of what the service does. Can only be provided by plain
3890+-- text.
3891+dSummary :: Lens' Documentation (Maybe Text)
3892+dSummary = lens _dSummary (\ s a -> s{_dSummary = a})
3893+
3894+-- | The URL to the root of documentation.
3895+dDocumentationRootURL :: Lens' Documentation (Maybe Text)
3896+dDocumentationRootURL
3897+ = lens _dDocumentationRootURL
3898+ (\ s a -> s{_dDocumentationRootURL = a})
3899+
3900+-- | A list of documentation rules that apply to individual API elements.
3901+-- **NOTE:** All service configuration rules follow \"last one wins\"
3902+-- order.
3903+dRules :: Lens' Documentation [DocumentationRule]
3904+dRules
3905+ = lens _dRules (\ s a -> s{_dRules = a}) . _Default .
3906+ _Coerce
3907+
3908+-- | The top level pages for the documentation set.
3909+dPages :: Lens' Documentation [Page]
3910+dPages
3911+ = lens _dPages (\ s a -> s{_dPages = a}) . _Default .
3912+ _Coerce
3913+
3914+-- | Declares a single overview page. For example:
3915+--
3916+-- > documentation:
3917+-- > summary: ...
3918+-- > overview: (== include overview.md ==)
3919+--
3920+-- This is a shortcut for the following declaration (using pages style):
3921+--
3922+-- > documentation:
3923+-- > summary: ...
3924+-- > pages:
3925+-- > - name: Overview
3926+-- > content: (== include overview.md ==)
3927+--
3928+-- Note: you cannot specify both \`overview\` field and \`pages\` field.
3929+dOverview :: Lens' Documentation (Maybe Text)
3930+dOverview
3931+ = lens _dOverview (\ s a -> s{_dOverview = a})
3932+
3933+instance FromJSON Documentation where
3934+ parseJSON
3935+ = withObject "Documentation"
3936+ (\ o ->
3937+ Documentation' <$>
3938+ (o .:? "summary") <*> (o .:? "documentationRootUrl")
3939+ <*> (o .:? "rules" .!= mempty)
3940+ <*> (o .:? "pages" .!= mempty)
3941+ <*> (o .:? "overview"))
3942+
3943+instance ToJSON Documentation where
3944+ toJSON Documentation'{..}
3945+ = object
3946+ (catMaybes
3947+ [("summary" .=) <$> _dSummary,
3948+ ("documentationRootUrl" .=) <$>
3949+ _dDocumentationRootURL,
3950+ ("rules" .=) <$> _dRules, ("pages" .=) <$> _dPages,
3951+ ("overview" .=) <$> _dOverview])
3952+
3953+-- | Represents the status of one operation step.
3954+--
3955+-- /See:/ 'step' smart constructor.
3956+data Step = Step'
3957+ { _sStatus :: !(Maybe StepStatus)
3958+ , _sDescription :: !(Maybe Text)
3959+ } deriving (Eq,Show,Data,Typeable,Generic)
3960+
3961+-- | Creates a value of 'Step' with the minimum fields required to make a request.
3962+--
3963+-- Use one of the following lenses to modify other fields as desired:
3964+--
3965+-- * 'sStatus'
3966+--
3967+-- * 'sDescription'
3968+step
3969+ :: Step
3970+step =
3971+ Step'
3972+ { _sStatus = Nothing
3973+ , _sDescription = Nothing
3974+ }
3975+
3976+-- | The status code.
3977+sStatus :: Lens' Step (Maybe StepStatus)
3978+sStatus = lens _sStatus (\ s a -> s{_sStatus = a})
3979+
3980+-- | The short description of the step.
3981+sDescription :: Lens' Step (Maybe Text)
3982+sDescription
3983+ = lens _sDescription (\ s a -> s{_sDescription = a})
3984+
3985+instance FromJSON Step where
3986+ parseJSON
3987+ = withObject "Step"
3988+ (\ o ->
3989+ Step' <$> (o .:? "status") <*> (o .:? "description"))
3990+
3991+instance ToJSON Step where
3992+ toJSON Step'{..}
3993+ = object
3994+ (catMaybes
3995+ [("status" .=) <$> _sStatus,
3996+ ("description" .=) <$> _sDescription])
3997+
3998+-- | Configuration of a specific analytics destination.
3999+--
4000+-- /See:/ 'analyticsDestination' smart constructor.
4001+data AnalyticsDestination = AnalyticsDestination'
4002+ { _adMetrics :: !(Maybe [Text])
4003+ , _adMonitoredResource :: !(Maybe Text)
4004+ } deriving (Eq,Show,Data,Typeable,Generic)
4005+
4006+-- | Creates a value of 'AnalyticsDestination' with the minimum fields required to make a request.
4007+--
4008+-- Use one of the following lenses to modify other fields as desired:
4009+--
4010+-- * 'adMetrics'
4011+--
4012+-- * 'adMonitoredResource'
4013+analyticsDestination
4014+ :: AnalyticsDestination
4015+analyticsDestination =
4016+ AnalyticsDestination'
4017+ { _adMetrics = Nothing
4018+ , _adMonitoredResource = Nothing
4019+ }
4020+
4021+-- | Names of the metrics to report to this analytics destination. Each name
4022+-- must be defined in Service.metrics section. Metrics with value type BOOL
4023+-- and STRING must be of GUAGE kind, metrics with value type INT64, DOUBLE
4024+-- and MONEY must be of DELTA kind.
4025+adMetrics :: Lens' AnalyticsDestination [Text]
4026+adMetrics
4027+ = lens _adMetrics (\ s a -> s{_adMetrics = a}) .
4028+ _Default
4029+ . _Coerce
4030+
4031+-- | The monitored resource type. The type must be defined in
4032+-- Service.monitored_resources section.
4033+adMonitoredResource :: Lens' AnalyticsDestination (Maybe Text)
4034+adMonitoredResource
4035+ = lens _adMonitoredResource
4036+ (\ s a -> s{_adMonitoredResource = a})
4037+
4038+instance FromJSON AnalyticsDestination where
4039+ parseJSON
4040+ = withObject "AnalyticsDestination"
4041+ (\ o ->
4042+ AnalyticsDestination' <$>
4043+ (o .:? "metrics" .!= mempty) <*>
4044+ (o .:? "monitoredResource"))
4045+
4046+instance ToJSON AnalyticsDestination where
4047+ toJSON AnalyticsDestination'{..}
4048+ = object
4049+ (catMaybes
4050+ [("metrics" .=) <$> _adMetrics,
4051+ ("monitoredResource" .=) <$> _adMonitoredResource])
4052+
4053+-- | Request message for \`TestIamPermissions\` method.
4054+--
4055+-- /See:/ 'testIAMPermissionsRequest' smart constructor.
4056+newtype TestIAMPermissionsRequest = TestIAMPermissionsRequest'
4057+ { _tiprPermissions :: Maybe [Text]
4058+ } deriving (Eq,Show,Data,Typeable,Generic)
4059+
4060+-- | Creates a value of 'TestIAMPermissionsRequest' with the minimum fields required to make a request.
4061+--
4062+-- Use one of the following lenses to modify other fields as desired:
4063+--
4064+-- * 'tiprPermissions'
4065+testIAMPermissionsRequest
4066+ :: TestIAMPermissionsRequest
4067+testIAMPermissionsRequest =
4068+ TestIAMPermissionsRequest'
4069+ { _tiprPermissions = Nothing
4070+ }
4071+
4072+-- | The set of permissions to check for the \`resource\`. Permissions with
4073+-- wildcards (such as \'*\' or \'storage.*\') are not allowed. For more
4074+-- information see [IAM
4075+-- Overview](https:\/\/cloud.google.com\/iam\/docs\/overview#permissions).
4076+tiprPermissions :: Lens' TestIAMPermissionsRequest [Text]
4077+tiprPermissions
4078+ = lens _tiprPermissions
4079+ (\ s a -> s{_tiprPermissions = a})
4080+ . _Default
4081+ . _Coerce
4082+
4083+instance FromJSON TestIAMPermissionsRequest where
4084+ parseJSON
4085+ = withObject "TestIAMPermissionsRequest"
4086+ (\ o ->
4087+ TestIAMPermissionsRequest' <$>
4088+ (o .:? "permissions" .!= mempty))
4089+
4090+instance ToJSON TestIAMPermissionsRequest where
4091+ toJSON TestIAMPermissionsRequest'{..}
4092+ = object
4093+ (catMaybes [("permissions" .=) <$> _tiprPermissions])
4094+
4095+-- | Define a system parameter rule mapping system parameter definitions to
4096+-- methods.
4097+--
4098+-- /See:/ 'systemParameterRule' smart constructor.
4099+data SystemParameterRule = SystemParameterRule'
4100+ { _sprSelector :: !(Maybe Text)
4101+ , _sprParameters :: !(Maybe [SystemParameter])
4102+ } deriving (Eq,Show,Data,Typeable,Generic)
4103+
4104+-- | Creates a value of 'SystemParameterRule' with the minimum fields required to make a request.
4105+--
4106+-- Use one of the following lenses to modify other fields as desired:
4107+--
4108+-- * 'sprSelector'
4109+--
4110+-- * 'sprParameters'
4111+systemParameterRule
4112+ :: SystemParameterRule
4113+systemParameterRule =
4114+ SystemParameterRule'
4115+ { _sprSelector = Nothing
4116+ , _sprParameters = Nothing
4117+ }
4118+
4119+-- | Selects the methods to which this rule applies. Use \'*\' to indicate
4120+-- all methods in all APIs. Refer to selector for syntax details.
4121+sprSelector :: Lens' SystemParameterRule (Maybe Text)
4122+sprSelector
4123+ = lens _sprSelector (\ s a -> s{_sprSelector = a})
4124+
4125+-- | Define parameters. Multiple names may be defined for a parameter. For a
4126+-- given method call, only one of them should be used. If multiple names
4127+-- are used the behavior is implementation-dependent. If none of the
4128+-- specified names are present the behavior is parameter-dependent.
4129+sprParameters :: Lens' SystemParameterRule [SystemParameter]
4130+sprParameters
4131+ = lens _sprParameters
4132+ (\ s a -> s{_sprParameters = a})
4133+ . _Default
4134+ . _Coerce
4135+
4136+instance FromJSON SystemParameterRule where
4137+ parseJSON
4138+ = withObject "SystemParameterRule"
4139+ (\ o ->
4140+ SystemParameterRule' <$>
4141+ (o .:? "selector") <*>
4142+ (o .:? "parameters" .!= mempty))
4143+
4144+instance ToJSON SystemParameterRule where
4145+ toJSON SystemParameterRule'{..}
4146+ = object
4147+ (catMaybes
4148+ [("selector" .=) <$> _sprSelector,
4149+ ("parameters" .=) <$> _sprParameters])
4150+
4151+-- | A description of a label.
4152+--
4153+-- /See:/ 'labelDescriptor' smart constructor.
4154+data LabelDescriptor = LabelDescriptor'
4155+ { _lKey :: !(Maybe Text)
4156+ , _lValueType :: !(Maybe LabelDescriptorValueType)
4157+ , _lDescription :: !(Maybe Text)
4158+ } deriving (Eq,Show,Data,Typeable,Generic)
4159+
4160+-- | Creates a value of 'LabelDescriptor' with the minimum fields required to make a request.
4161+--
4162+-- Use one of the following lenses to modify other fields as desired:
4163+--
4164+-- * 'lKey'
4165+--
4166+-- * 'lValueType'
4167+--
4168+-- * 'lDescription'
4169+labelDescriptor
4170+ :: LabelDescriptor
4171+labelDescriptor =
4172+ LabelDescriptor'
4173+ { _lKey = Nothing
4174+ , _lValueType = Nothing
4175+ , _lDescription = Nothing
4176+ }
4177+
4178+-- | The label key.
4179+lKey :: Lens' LabelDescriptor (Maybe Text)
4180+lKey = lens _lKey (\ s a -> s{_lKey = a})
4181+
4182+-- | The type of data that can be assigned to the label.
4183+lValueType :: Lens' LabelDescriptor (Maybe LabelDescriptorValueType)
4184+lValueType
4185+ = lens _lValueType (\ s a -> s{_lValueType = a})
4186+
4187+-- | A human-readable description for the label.
4188+lDescription :: Lens' LabelDescriptor (Maybe Text)
4189+lDescription
4190+ = lens _lDescription (\ s a -> s{_lDescription = a})
4191+
4192+instance FromJSON LabelDescriptor where
4193+ parseJSON
4194+ = withObject "LabelDescriptor"
4195+ (\ o ->
4196+ LabelDescriptor' <$>
4197+ (o .:? "key") <*> (o .:? "valueType") <*>
4198+ (o .:? "description"))
4199+
4200+instance ToJSON LabelDescriptor where
4201+ toJSON LabelDescriptor'{..}
4202+ = object
4203+ (catMaybes
4204+ [("key" .=) <$> _lKey,
4205+ ("valueType" .=) <$> _lValueType,
4206+ ("description" .=) <$> _lDescription])
4207+
4208+-- | Configuration controlling usage of a service.
4209+--
4210+-- /See:/ 'usage' smart constructor.
4211+data Usage = Usage'
4212+ { _uRequirements :: !(Maybe [Text])
4213+ , _uRules :: !(Maybe [UsageRule])
4214+ } deriving (Eq,Show,Data,Typeable,Generic)
4215+
4216+-- | Creates a value of 'Usage' with the minimum fields required to make a request.
4217+--
4218+-- Use one of the following lenses to modify other fields as desired:
4219+--
4220+-- * 'uRequirements'
4221+--
4222+-- * 'uRules'
4223+usage
4224+ :: Usage
4225+usage =
4226+ Usage'
4227+ { _uRequirements = Nothing
4228+ , _uRules = Nothing
4229+ }
4230+
4231+-- | Requirements that must be satisfied before a consumer project can use
4232+-- the service. Each requirement is of the form \/; for example
4233+-- \'serviceusage.googleapis.com\/billing-enabled\'.
4234+uRequirements :: Lens' Usage [Text]
4235+uRequirements
4236+ = lens _uRequirements
4237+ (\ s a -> s{_uRequirements = a})
4238+ . _Default
4239+ . _Coerce
4240+
4241+-- | A list of usage rules that apply to individual API methods. **NOTE:**
4242+-- All service configuration rules follow \"last one wins\" order.
4243+uRules :: Lens' Usage [UsageRule]
4244+uRules
4245+ = lens _uRules (\ s a -> s{_uRules = a}) . _Default .
4246+ _Coerce
4247+
4248+instance FromJSON Usage where
4249+ parseJSON
4250+ = withObject "Usage"
4251+ (\ o ->
4252+ Usage' <$>
4253+ (o .:? "requirements" .!= mempty) <*>
4254+ (o .:? "rules" .!= mempty))
4255+
4256+instance ToJSON Usage where
4257+ toJSON Usage'{..}
4258+ = object
4259+ (catMaybes
4260+ [("requirements" .=) <$> _uRequirements,
4261+ ("rules" .=) <$> _uRules])
4262+
4263+-- | Response message for \`TestIamPermissions\` method.
4264+--
4265+-- /See:/ 'testIAMPermissionsResponse' smart constructor.
4266+newtype TestIAMPermissionsResponse = TestIAMPermissionsResponse'
4267+ { _tiamprPermissions :: Maybe [Text]
4268+ } deriving (Eq,Show,Data,Typeable,Generic)
4269+
4270+-- | Creates a value of 'TestIAMPermissionsResponse' with the minimum fields required to make a request.
4271+--
4272+-- Use one of the following lenses to modify other fields as desired:
4273+--
4274+-- * 'tiamprPermissions'
4275+testIAMPermissionsResponse
4276+ :: TestIAMPermissionsResponse
4277+testIAMPermissionsResponse =
4278+ TestIAMPermissionsResponse'
4279+ { _tiamprPermissions = Nothing
4280+ }
4281+
4282+-- | A subset of \`TestPermissionsRequest.permissions\` that the caller is
4283+-- allowed.
4284+tiamprPermissions :: Lens' TestIAMPermissionsResponse [Text]
4285+tiamprPermissions
4286+ = lens _tiamprPermissions
4287+ (\ s a -> s{_tiamprPermissions = a})
4288+ . _Default
4289+ . _Coerce
4290+
4291+instance FromJSON TestIAMPermissionsResponse where
4292+ parseJSON
4293+ = withObject "TestIAMPermissionsResponse"
4294+ (\ o ->
4295+ TestIAMPermissionsResponse' <$>
4296+ (o .:? "permissions" .!= mempty))
4297+
4298+instance ToJSON TestIAMPermissionsResponse where
4299+ toJSON TestIAMPermissionsResponse'{..}
4300+ = object
4301+ (catMaybes
4302+ [("permissions" .=) <$> _tiamprPermissions])
4303+
4304+-- | Service configuration for which we want to generate the report. For this
4305+-- version of API, the supported types are
4306+-- google.api.servicemanagement.v1.ConfigRef,
4307+-- google.api.servicemanagement.v1.ConfigSource, and google.api.Service
4308+--
4309+-- /See:/ 'generateConfigReportRequestNewConfig' smart constructor.
4310+newtype GenerateConfigReportRequestNewConfig = GenerateConfigReportRequestNewConfig'
4311+ { _gcrrncAddtional :: HashMap Text JSONValue
4312+ } deriving (Eq,Show,Data,Typeable,Generic)
4313+
4314+-- | Creates a value of 'GenerateConfigReportRequestNewConfig' with the minimum fields required to make a request.
4315+--
4316+-- Use one of the following lenses to modify other fields as desired:
4317+--
4318+-- * 'gcrrncAddtional'
4319+generateConfigReportRequestNewConfig
4320+ :: HashMap Text JSONValue -- ^ 'gcrrncAddtional'
4321+ -> GenerateConfigReportRequestNewConfig
4322+generateConfigReportRequestNewConfig pGcrrncAddtional_ =
4323+ GenerateConfigReportRequestNewConfig'
4324+ { _gcrrncAddtional = _Coerce # pGcrrncAddtional_
4325+ }
4326+
4327+-- | Properties of the object. Contains field \'type with type URL.
4328+gcrrncAddtional :: Lens' GenerateConfigReportRequestNewConfig (HashMap Text JSONValue)
4329+gcrrncAddtional
4330+ = lens _gcrrncAddtional
4331+ (\ s a -> s{_gcrrncAddtional = a})
4332+ . _Coerce
4333+
4334+instance FromJSON
4335+ GenerateConfigReportRequestNewConfig where
4336+ parseJSON
4337+ = withObject "GenerateConfigReportRequestNewConfig"
4338+ (\ o ->
4339+ GenerateConfigReportRequestNewConfig' <$>
4340+ (parseJSONObject o))
4341+
4342+instance ToJSON GenerateConfigReportRequestNewConfig
4343+ where
4344+ toJSON = toJSON . _gcrrncAddtional
4345+
4346+-- | Defines the HTTP configuration for a service. It contains a list of
4347+-- HttpRule, each specifying the mapping of an RPC method to one or more
4348+-- HTTP REST API methods.
4349+--
4350+-- /See:/ 'hTTP' smart constructor.
4351+newtype HTTP = HTTP'
4352+ { _hRules :: Maybe [HTTPRule]
4353+ } deriving (Eq,Show,Data,Typeable,Generic)
4354+
4355+-- | Creates a value of 'HTTP' with the minimum fields required to make a request.
4356+--
4357+-- Use one of the following lenses to modify other fields as desired:
4358+--
4359+-- * 'hRules'
4360+hTTP
4361+ :: HTTP
4362+hTTP =
4363+ HTTP'
4364+ { _hRules = Nothing
4365+ }
4366+
4367+-- | A list of HTTP configuration rules that apply to individual API methods.
4368+-- **NOTE:** All service configuration rules follow \"last one wins\"
4369+-- order.
4370+hRules :: Lens' HTTP [HTTPRule]
4371+hRules
4372+ = lens _hRules (\ s a -> s{_hRules = a}) . _Default .
4373+ _Coerce
4374+
4375+instance FromJSON HTTP where
4376+ parseJSON
4377+ = withObject "HTTP"
4378+ (\ o -> HTTP' <$> (o .:? "rules" .!= mempty))
4379+
4380+instance ToJSON HTTP where
4381+ toJSON HTTP'{..}
4382+ = object (catMaybes [("rules" .=) <$> _hRules])
4383+
4384+-- | Request message for DisableService method.
4385+--
4386+-- /See:/ 'disableServiceRequest' smart constructor.
4387+newtype DisableServiceRequest = DisableServiceRequest'
4388+ { _dsrConsumerId :: Maybe Text
4389+ } deriving (Eq,Show,Data,Typeable,Generic)
4390+
4391+-- | Creates a value of 'DisableServiceRequest' with the minimum fields required to make a request.
4392+--
4393+-- Use one of the following lenses to modify other fields as desired:
4394+--
4395+-- * 'dsrConsumerId'
4396+disableServiceRequest
4397+ :: DisableServiceRequest
4398+disableServiceRequest =
4399+ DisableServiceRequest'
4400+ { _dsrConsumerId = Nothing
4401+ }
4402+
4403+-- | The identity of consumer resource which service disablement will be
4404+-- applied to. The Google Service Management implementation accepts the
4405+-- following forms: \"project:\", \"project_number:\". Note: this is made
4406+-- compatible with google.api.servicecontrol.v1.Operation.consumer_id.
4407+dsrConsumerId :: Lens' DisableServiceRequest (Maybe Text)
4408+dsrConsumerId
4409+ = lens _dsrConsumerId
4410+ (\ s a -> s{_dsrConsumerId = a})
4411+
4412+instance FromJSON DisableServiceRequest where
4413+ parseJSON
4414+ = withObject "DisableServiceRequest"
4415+ (\ o ->
4416+ DisableServiceRequest' <$> (o .:? "consumerId"))
4417+
4418+instance ToJSON DisableServiceRequest where
4419+ toJSON DisableServiceRequest'{..}
4420+ = object
4421+ (catMaybes [("consumerId" .=) <$> _dsrConsumerId])
4422+
4423+-- | Defines an Identity and Access Management (IAM) policy. It is used to
4424+-- specify access control policies for Cloud Platform resources. A
4425+-- \`Policy\` consists of a list of \`bindings\`. A \`Binding\` binds a
4426+-- list of \`members\` to a \`role\`, where the members can be user
4427+-- accounts, Google groups, Google domains, and service accounts. A
4428+-- \`role\` is a named list of permissions defined by IAM. **Example** {
4429+-- \"bindings\": [ { \"role\": \"roles\/owner\", \"members\": [
4430+-- \"user:mike\'example.com\", \"group:admins\'example.com\",
4431+-- \"domain:google.com\",
4432+-- \"serviceAccount:my-other-app\'appspot.gserviceaccount.com\", ] }, {
4433+-- \"role\": \"roles\/viewer\", \"members\": [\"user:sean\'example.com\"] }
4434+-- ] } For a description of IAM and its features, see the [IAM developer\'s
4435+-- guide](https:\/\/cloud.google.com\/iam).
4436+--
4437+-- /See:/ 'policy' smart constructor.
4438+data Policy = Policy'
4439+ { _pAuditConfigs :: !(Maybe [AuditConfig])
4440+ , _pEtag :: !(Maybe Base64)
4441+ , _pRules :: !(Maybe [Rule])
4442+ , _pVersion :: !(Maybe (Textual Int32))
4443+ , _pBindings :: !(Maybe [Binding])
4444+ , _pIAMOwned :: !(Maybe Bool)
4445+ } deriving (Eq,Show,Data,Typeable,Generic)
4446+
4447+-- | Creates a value of 'Policy' with the minimum fields required to make a request.
4448+--
4449+-- Use one of the following lenses to modify other fields as desired:
4450+--
4451+-- * 'pAuditConfigs'
4452+--
4453+-- * 'pEtag'
4454+--
4455+-- * 'pRules'
4456+--
4457+-- * 'pVersion'
4458+--
4459+-- * 'pBindings'
4460+--
4461+-- * 'pIAMOwned'
4462+policy
4463+ :: Policy
4464+policy =
4465+ Policy'
4466+ { _pAuditConfigs = Nothing
4467+ , _pEtag = Nothing
4468+ , _pRules = Nothing
4469+ , _pVersion = Nothing
4470+ , _pBindings = Nothing
4471+ , _pIAMOwned = Nothing
4472+ }
4473+
4474+-- | Specifies audit logging configs for \"data access\". \"data access\":
4475+-- generally refers to data reads\/writes and admin reads. \"admin
4476+-- activity\": generally refers to admin writes. Note: \`AuditConfig\`
4477+-- doesn\'t apply to \"admin activity\", which always enables audit
4478+-- logging.
4479+pAuditConfigs :: Lens' Policy [AuditConfig]
4480+pAuditConfigs
4481+ = lens _pAuditConfigs
4482+ (\ s a -> s{_pAuditConfigs = a})
4483+ . _Default
4484+ . _Coerce
4485+
4486+-- | \`etag\` is used for optimistic concurrency control as a way to help
4487+-- prevent simultaneous updates of a policy from overwriting each other. It
4488+-- is strongly suggested that systems make use of the \`etag\` in the
4489+-- read-modify-write cycle to perform policy updates in order to avoid race
4490+-- conditions: An \`etag\` is returned in the response to \`getIamPolicy\`,
4491+-- and systems are expected to put that etag in the request to
4492+-- \`setIamPolicy\` to ensure that their change will be applied to the same
4493+-- version of the policy. If no \`etag\` is provided in the call to
4494+-- \`setIamPolicy\`, then the existing policy is overwritten blindly.
4495+pEtag :: Lens' Policy (Maybe ByteString)
4496+pEtag
4497+ = lens _pEtag (\ s a -> s{_pEtag = a}) .
4498+ mapping _Base64
4499+
4500+-- | If more than one rule is specified, the rules are applied in the
4501+-- following manner: - All matching LOG rules are always applied. - If any
4502+-- DENY\/DENY_WITH_LOG rule matches, permission is denied. Logging will be
4503+-- applied if one or more matching rule requires logging. - Otherwise, if
4504+-- any ALLOW\/ALLOW_WITH_LOG rule matches, permission is granted. Logging
4505+-- will be applied if one or more matching rule requires logging. -
4506+-- Otherwise, if no rule applies, permission is denied.
4507+pRules :: Lens' Policy [Rule]
4508+pRules
4509+ = lens _pRules (\ s a -> s{_pRules = a}) . _Default .
4510+ _Coerce
4511+
4512+-- | Version of the \`Policy\`. The default version is 0.
4513+pVersion :: Lens' Policy (Maybe Int32)
4514+pVersion
4515+ = lens _pVersion (\ s a -> s{_pVersion = a}) .
4516+ mapping _Coerce
4517+
4518+-- | Associates a list of \`members\` to a \`role\`. Multiple \`bindings\`
4519+-- must not be specified for the same \`role\`. \`bindings\` with no
4520+-- members will result in an error.
4521+pBindings :: Lens' Policy [Binding]
4522+pBindings
4523+ = lens _pBindings (\ s a -> s{_pBindings = a}) .
4524+ _Default
4525+ . _Coerce
4526+
4527+pIAMOwned :: Lens' Policy (Maybe Bool)
4528+pIAMOwned
4529+ = lens _pIAMOwned (\ s a -> s{_pIAMOwned = a})
4530+
4531+instance FromJSON Policy where
4532+ parseJSON
4533+ = withObject "Policy"
4534+ (\ o ->
4535+ Policy' <$>
4536+ (o .:? "auditConfigs" .!= mempty) <*> (o .:? "etag")
4537+ <*> (o .:? "rules" .!= mempty)
4538+ <*> (o .:? "version")
4539+ <*> (o .:? "bindings" .!= mempty)
4540+ <*> (o .:? "iamOwned"))
4541+
4542+instance ToJSON Policy where
4543+ toJSON Policy'{..}
4544+ = object
4545+ (catMaybes
4546+ [("auditConfigs" .=) <$> _pAuditConfigs,
4547+ ("etag" .=) <$> _pEtag, ("rules" .=) <$> _pRules,
4548+ ("version" .=) <$> _pVersion,
4549+ ("bindings" .=) <$> _pBindings,
4550+ ("iamOwned" .=) <$> _pIAMOwned])
4551+
4552+-- | A protocol buffer message type.
4553+--
4554+-- /See:/ 'type'' smart constructor.
4555+data Type = Type'
4556+ { _tSourceContext :: !(Maybe SourceContext)
4557+ , _tOneofs :: !(Maybe [Text])
4558+ , _tName :: !(Maybe Text)
4559+ , _tOptions :: !(Maybe [Option])
4560+ , _tFields :: !(Maybe [Field])
4561+ , _tSyntax :: !(Maybe TypeSyntax)
4562+ } deriving (Eq,Show,Data,Typeable,Generic)
4563+
4564+-- | Creates a value of 'Type' with the minimum fields required to make a request.
4565+--
4566+-- Use one of the following lenses to modify other fields as desired:
4567+--
4568+-- * 'tSourceContext'
4569+--
4570+-- * 'tOneofs'
4571+--
4572+-- * 'tName'
4573+--
4574+-- * 'tOptions'
4575+--
4576+-- * 'tFields'
4577+--
4578+-- * 'tSyntax'
4579+type'
4580+ :: Type
4581+type' =
4582+ Type'
4583+ { _tSourceContext = Nothing
4584+ , _tOneofs = Nothing
4585+ , _tName = Nothing
4586+ , _tOptions = Nothing
4587+ , _tFields = Nothing
4588+ , _tSyntax = Nothing
4589+ }
4590+
4591+-- | The source context.
4592+tSourceContext :: Lens' Type (Maybe SourceContext)
4593+tSourceContext
4594+ = lens _tSourceContext
4595+ (\ s a -> s{_tSourceContext = a})
4596+
4597+-- | The list of types appearing in \`oneof\` definitions in this type.
4598+tOneofs :: Lens' Type [Text]
4599+tOneofs
4600+ = lens _tOneofs (\ s a -> s{_tOneofs = a}) . _Default
4601+ . _Coerce
4602+
4603+-- | The fully qualified message name.
4604+tName :: Lens' Type (Maybe Text)
4605+tName = lens _tName (\ s a -> s{_tName = a})
4606+
4607+-- | The protocol buffer options.
4608+tOptions :: Lens' Type [Option]
4609+tOptions
4610+ = lens _tOptions (\ s a -> s{_tOptions = a}) .
4611+ _Default
4612+ . _Coerce
4613+
4614+-- | The list of fields.
4615+tFields :: Lens' Type [Field]
4616+tFields
4617+ = lens _tFields (\ s a -> s{_tFields = a}) . _Default
4618+ . _Coerce
4619+
4620+-- | The source syntax.
4621+tSyntax :: Lens' Type (Maybe TypeSyntax)
4622+tSyntax = lens _tSyntax (\ s a -> s{_tSyntax = a})
4623+
4624+instance FromJSON Type where
4625+ parseJSON
4626+ = withObject "Type"
4627+ (\ o ->
4628+ Type' <$>
4629+ (o .:? "sourceContext") <*>
4630+ (o .:? "oneofs" .!= mempty)
4631+ <*> (o .:? "name")
4632+ <*> (o .:? "options" .!= mempty)
4633+ <*> (o .:? "fields" .!= mempty)
4634+ <*> (o .:? "syntax"))
4635+
4636+instance ToJSON Type where
4637+ toJSON Type'{..}
4638+ = object
4639+ (catMaybes
4640+ [("sourceContext" .=) <$> _tSourceContext,
4641+ ("oneofs" .=) <$> _tOneofs, ("name" .=) <$> _tName,
4642+ ("options" .=) <$> _tOptions,
4643+ ("fields" .=) <$> _tFields,
4644+ ("syntax" .=) <$> _tSyntax])
4645+
4646+-- | Api is a light-weight descriptor for a protocol buffer service.
4647+--
4648+-- /See:/ 'api' smart constructor.
4649+data API = API'
4650+ { _aSourceContext :: !(Maybe SourceContext)
4651+ , _aMixins :: !(Maybe [Mixin])
4652+ , _aMethods :: !(Maybe [Method])
4653+ , _aName :: !(Maybe Text)
4654+ , _aVersion :: !(Maybe Text)
4655+ , _aOptions :: !(Maybe [Option])
4656+ , _aSyntax :: !(Maybe APISyntax)
4657+ } deriving (Eq,Show,Data,Typeable,Generic)
4658+
4659+-- | Creates a value of 'API' with the minimum fields required to make a request.
4660+--
4661+-- Use one of the following lenses to modify other fields as desired:
4662+--
4663+-- * 'aSourceContext'
4664+--
4665+-- * 'aMixins'
4666+--
4667+-- * 'aMethods'
4668+--
4669+-- * 'aName'
4670+--
4671+-- * 'aVersion'
4672+--
4673+-- * 'aOptions'
4674+--
4675+-- * 'aSyntax'
4676+api
4677+ :: API
4678+api =
4679+ API'
4680+ { _aSourceContext = Nothing
4681+ , _aMixins = Nothing
4682+ , _aMethods = Nothing
4683+ , _aName = Nothing
4684+ , _aVersion = Nothing
4685+ , _aOptions = Nothing
4686+ , _aSyntax = Nothing
4687+ }
4688+
4689+-- | Source context for the protocol buffer service represented by this
4690+-- message.
4691+aSourceContext :: Lens' API (Maybe SourceContext)
4692+aSourceContext
4693+ = lens _aSourceContext
4694+ (\ s a -> s{_aSourceContext = a})
4695+
4696+-- | Included APIs. See Mixin.
4697+aMixins :: Lens' API [Mixin]
4698+aMixins
4699+ = lens _aMixins (\ s a -> s{_aMixins = a}) . _Default
4700+ . _Coerce
4701+
4702+-- | The methods of this api, in unspecified order.
4703+aMethods :: Lens' API [Method]
4704+aMethods
4705+ = lens _aMethods (\ s a -> s{_aMethods = a}) .
4706+ _Default
4707+ . _Coerce
4708+
4709+-- | The fully qualified name of this api, including package name followed by
4710+-- the api\'s simple name.
4711+aName :: Lens' API (Maybe Text)
4712+aName = lens _aName (\ s a -> s{_aName = a})
4713+
4714+-- | A version string for this api. If specified, must have the form
4715+-- \`major-version.minor-version\`, as in \`1.10\`. If the minor version is
4716+-- omitted, it defaults to zero. If the entire version field is empty, the
4717+-- major version is derived from the package name, as outlined below. If
4718+-- the field is not empty, the version in the package name will be verified
4719+-- to be consistent with what is provided here. The versioning schema uses
4720+-- [semantic versioning](http:\/\/semver.org) where the major version
4721+-- number indicates a breaking change and the minor version an additive,
4722+-- non-breaking change. Both version numbers are signals to users what to
4723+-- expect from different versions, and should be carefully chosen based on
4724+-- the product plan. The major version is also reflected in the package
4725+-- name of the API, which must end in \`v\`, as in \`google.feature.v1\`.
4726+-- For major versions 0 and 1, the suffix can be omitted. Zero major
4727+-- versions must only be used for experimental, none-GA apis.
4728+aVersion :: Lens' API (Maybe Text)
4729+aVersion = lens _aVersion (\ s a -> s{_aVersion = a})
4730+
4731+-- | Any metadata attached to the API.
4732+aOptions :: Lens' API [Option]
4733+aOptions
4734+ = lens _aOptions (\ s a -> s{_aOptions = a}) .
4735+ _Default
4736+ . _Coerce
4737+
4738+-- | The source syntax of the service.
4739+aSyntax :: Lens' API (Maybe APISyntax)
4740+aSyntax = lens _aSyntax (\ s a -> s{_aSyntax = a})
4741+
4742+instance FromJSON API where
4743+ parseJSON
4744+ = withObject "API"
4745+ (\ o ->
4746+ API' <$>
4747+ (o .:? "sourceContext") <*>
4748+ (o .:? "mixins" .!= mempty)
4749+ <*> (o .:? "methods" .!= mempty)
4750+ <*> (o .:? "name")
4751+ <*> (o .:? "version")
4752+ <*> (o .:? "options" .!= mempty)
4753+ <*> (o .:? "syntax"))
4754+
4755+instance ToJSON API where
4756+ toJSON API'{..}
4757+ = object
4758+ (catMaybes
4759+ [("sourceContext" .=) <$> _aSourceContext,
4760+ ("mixins" .=) <$> _aMixins,
4761+ ("methods" .=) <$> _aMethods, ("name" .=) <$> _aName,
4762+ ("version" .=) <$> _aVersion,
4763+ ("options" .=) <$> _aOptions,
4764+ ("syntax" .=) <$> _aSyntax])
4765+
4766+-- | Configuration of a specific monitoring destination (the producer project
4767+-- or the consumer project).
4768+--
4769+-- /See:/ 'monitoringDestination' smart constructor.
4770+data MonitoringDestination = MonitoringDestination'
4771+ { _mdMetrics :: !(Maybe [Text])
4772+ , _mdMonitoredResource :: !(Maybe Text)
4773+ } deriving (Eq,Show,Data,Typeable,Generic)
4774+
4775+-- | Creates a value of 'MonitoringDestination' with the minimum fields required to make a request.
4776+--
4777+-- Use one of the following lenses to modify other fields as desired:
4778+--
4779+-- * 'mdMetrics'
4780+--
4781+-- * 'mdMonitoredResource'
4782+monitoringDestination
4783+ :: MonitoringDestination
4784+monitoringDestination =
4785+ MonitoringDestination'
4786+ { _mdMetrics = Nothing
4787+ , _mdMonitoredResource = Nothing
4788+ }
4789+
4790+-- | Names of the metrics to report to this monitoring destination. Each name
4791+-- must be defined in Service.metrics section.
4792+mdMetrics :: Lens' MonitoringDestination [Text]
4793+mdMetrics
4794+ = lens _mdMetrics (\ s a -> s{_mdMetrics = a}) .
4795+ _Default
4796+ . _Coerce
4797+
4798+-- | The monitored resource type. The type must be defined in
4799+-- Service.monitored_resources section.
4800+mdMonitoredResource :: Lens' MonitoringDestination (Maybe Text)
4801+mdMonitoredResource
4802+ = lens _mdMonitoredResource
4803+ (\ s a -> s{_mdMonitoredResource = a})
4804+
4805+instance FromJSON MonitoringDestination where
4806+ parseJSON
4807+ = withObject "MonitoringDestination"
4808+ (\ o ->
4809+ MonitoringDestination' <$>
4810+ (o .:? "metrics" .!= mempty) <*>
4811+ (o .:? "monitoredResource"))
4812+
4813+instance ToJSON MonitoringDestination where
4814+ toJSON MonitoringDestination'{..}
4815+ = object
4816+ (catMaybes
4817+ [("metrics" .=) <$> _mdMetrics,
4818+ ("monitoredResource" .=) <$> _mdMonitoredResource])
4819+
4820+-- | The full representation of a Service that is managed by Google Service
4821+-- Management.
4822+--
4823+-- /See:/ 'managedService' smart constructor.
4824+data ManagedService = ManagedService'
4825+ { _msServiceName :: !(Maybe Text)
4826+ , _msProducerProjectId :: !(Maybe Text)
4827+ } deriving (Eq,Show,Data,Typeable,Generic)
4828+
4829+-- | Creates a value of 'ManagedService' with the minimum fields required to make a request.
4830+--
4831+-- Use one of the following lenses to modify other fields as desired:
4832+--
4833+-- * 'msServiceName'
4834+--
4835+-- * 'msProducerProjectId'
4836+managedService
4837+ :: ManagedService
4838+managedService =
4839+ ManagedService'
4840+ { _msServiceName = Nothing
4841+ , _msProducerProjectId = Nothing
4842+ }
4843+
4844+-- | The name of the service. See the
4845+-- [overview](\/service-management\/overview) for naming requirements.
4846+msServiceName :: Lens' ManagedService (Maybe Text)
4847+msServiceName
4848+ = lens _msServiceName
4849+ (\ s a -> s{_msServiceName = a})
4850+
4851+-- | ID of the project that produces and owns this service.
4852+msProducerProjectId :: Lens' ManagedService (Maybe Text)
4853+msProducerProjectId
4854+ = lens _msProducerProjectId
4855+ (\ s a -> s{_msProducerProjectId = a})
4856+
4857+instance FromJSON ManagedService where
4858+ parseJSON
4859+ = withObject "ManagedService"
4860+ (\ o ->
4861+ ManagedService' <$>
4862+ (o .:? "serviceName") <*>
4863+ (o .:? "producerProjectId"))
4864+
4865+instance ToJSON ManagedService where
4866+ toJSON ManagedService'{..}
4867+ = object
4868+ (catMaybes
4869+ [("serviceName" .=) <$> _msServiceName,
4870+ ("producerProjectId" .=) <$> _msProducerProjectId])
4871+
4872+-- | The metadata associated with a long running operation resource.
4873+--
4874+-- /See:/ 'operationMetadata' smart constructor.
4875+data OperationMetadata = OperationMetadata'
4876+ { _omStartTime :: !(Maybe DateTime')
4877+ , _omSteps :: !(Maybe [Step])
4878+ , _omProgressPercentage :: !(Maybe (Textual Int32))
4879+ , _omResourceNames :: !(Maybe [Text])
4880+ } deriving (Eq,Show,Data,Typeable,Generic)
4881+
4882+-- | Creates a value of 'OperationMetadata' with the minimum fields required to make a request.
4883+--
4884+-- Use one of the following lenses to modify other fields as desired:
4885+--
4886+-- * 'omStartTime'
4887+--
4888+-- * 'omSteps'
4889+--
4890+-- * 'omProgressPercentage'
4891+--
4892+-- * 'omResourceNames'
4893+operationMetadata
4894+ :: OperationMetadata
4895+operationMetadata =
4896+ OperationMetadata'
4897+ { _omStartTime = Nothing
4898+ , _omSteps = Nothing
4899+ , _omProgressPercentage = Nothing
4900+ , _omResourceNames = Nothing
4901+ }
4902+
4903+-- | The start time of the operation.
4904+omStartTime :: Lens' OperationMetadata (Maybe UTCTime)
4905+omStartTime
4906+ = lens _omStartTime (\ s a -> s{_omStartTime = a}) .
4907+ mapping _DateTime
4908+
4909+-- | Detailed status information for each step. The order is undetermined.
4910+omSteps :: Lens' OperationMetadata [Step]
4911+omSteps
4912+ = lens _omSteps (\ s a -> s{_omSteps = a}) . _Default
4913+ . _Coerce
4914+
4915+-- | Percentage of completion of this operation, ranging from 0 to 100.
4916+omProgressPercentage :: Lens' OperationMetadata (Maybe Int32)
4917+omProgressPercentage
4918+ = lens _omProgressPercentage
4919+ (\ s a -> s{_omProgressPercentage = a})
4920+ . mapping _Coerce
4921+
4922+-- | The full name of the resources that this operation is directly
4923+-- associated with.
4924+omResourceNames :: Lens' OperationMetadata [Text]
4925+omResourceNames
4926+ = lens _omResourceNames
4927+ (\ s a -> s{_omResourceNames = a})
4928+ . _Default
4929+ . _Coerce
4930+
4931+instance FromJSON OperationMetadata where
4932+ parseJSON
4933+ = withObject "OperationMetadata"
4934+ (\ o ->
4935+ OperationMetadata' <$>
4936+ (o .:? "startTime") <*> (o .:? "steps" .!= mempty)
4937+ <*> (o .:? "progressPercentage")
4938+ <*> (o .:? "resourceNames" .!= mempty))
4939+
4940+instance ToJSON OperationMetadata where
4941+ toJSON OperationMetadata'{..}
4942+ = object
4943+ (catMaybes
4944+ [("startTime" .=) <$> _omStartTime,
4945+ ("steps" .=) <$> _omSteps,
4946+ ("progressPercentage" .=) <$> _omProgressPercentage,
4947+ ("resourceNames" .=) <$> _omResourceNames])
4948+
4949+-- | \`Endpoint\` describes a network endpoint that serves a set of APIs. A
4950+-- service may expose any number of endpoints, and all endpoints share the
4951+-- same service configuration, such as quota configuration and monitoring
4952+-- configuration. Example service configuration: name:
4953+-- library-example.googleapis.com endpoints: # Below entry makes
4954+-- \'google.example.library.v1.Library\' # API be served from endpoint
4955+-- address library-example.googleapis.com. # It also allows HTTP OPTIONS
4956+-- calls to be passed to the backend, for # it to decide whether the
4957+-- subsequent cross-origin request is # allowed to proceed. - name:
4958+-- library-example.googleapis.com apis: google.example.library.v1.Library
4959+-- allow_cors: true # Below entry makes
4960+-- \'google.example.library.v1.Library\' # API be served from endpoint
4961+-- address # google.example.library-example.v1.LibraryManager. - name:
4962+-- library-manager.googleapis.com apis:
4963+-- google.example.library.v1.LibraryManager # BNS address for a borg job.
4964+-- Can specify a task by appending # \"\/taskId\" (e.g. \"\/0\") to the job
4965+-- spec. Example OpenAPI extension for endpoint with allow_cors set to
4966+-- true: { \"swagger\": \"2.0\", \"info\": { \"description\": \"A
4967+-- simple...\" }, \"host\": \"MY_PROJECT_ID.appspot.com\",
4968+-- \"x-google-endpoints\": [{ \"name\": \"MY_PROJECT_ID.appspot.com\",
4969+-- \"allow_cors\": \"true\" }] }
4970+--
4971+-- /See:/ 'endpoint' smart constructor.
4972+data Endpoint = Endpoint'
4973+ { _eAliases :: !(Maybe [Text])
4974+ , _eAPIs :: !(Maybe [Text])
4975+ , _eAllowCORS :: !(Maybe Bool)
4976+ , _eName :: !(Maybe Text)
4977+ , _eFeatures :: !(Maybe [Text])
4978+ } deriving (Eq,Show,Data,Typeable,Generic)
4979+
4980+-- | Creates a value of 'Endpoint' with the minimum fields required to make a request.
4981+--
4982+-- Use one of the following lenses to modify other fields as desired:
4983+--
4984+-- * 'eAliases'
4985+--
4986+-- * 'eAPIs'
4987+--
4988+-- * 'eAllowCORS'
4989+--
4990+-- * 'eName'
4991+--
4992+-- * 'eFeatures'
4993+endpoint
4994+ :: Endpoint
4995+endpoint =
4996+ Endpoint'
4997+ { _eAliases = Nothing
4998+ , _eAPIs = Nothing
4999+ , _eAllowCORS = Nothing
5000+ , _eName = Nothing
5001+ , _eFeatures = Nothing
5002+ }
5003+
5004+-- | DEPRECATED: This field is no longer supported. Instead of using aliases,
5005+-- please specify multiple google.api.Endpoint for each of the intented
5006+-- alias. Additional names that this endpoint will be hosted on.
5007+eAliases :: Lens' Endpoint [Text]
5008+eAliases
5009+ = lens _eAliases (\ s a -> s{_eAliases = a}) .
5010+ _Default
5011+ . _Coerce
5012+
5013+-- | The list of APIs served by this endpoint.
5014+eAPIs :: Lens' Endpoint [Text]
5015+eAPIs
5016+ = lens _eAPIs (\ s a -> s{_eAPIs = a}) . _Default .
5017+ _Coerce
5018+
5019+-- | Allowing
5020+-- [CORS](https:\/\/en.wikipedia.org\/wiki\/Cross-origin_resource_sharing),
5021+-- aka cross-domain traffic, would allow the backends served from this
5022+-- endpoint to receive and respond to HTTP OPTIONS requests. The response
5023+-- will be used by the browser to determine whether the subsequent
5024+-- cross-origin request is allowed to proceed.
5025+eAllowCORS :: Lens' Endpoint (Maybe Bool)
5026+eAllowCORS
5027+ = lens _eAllowCORS (\ s a -> s{_eAllowCORS = a})
5028+
5029+-- | The canonical name of this endpoint.
5030+eName :: Lens' Endpoint (Maybe Text)
5031+eName = lens _eName (\ s a -> s{_eName = a})
5032+
5033+-- | The list of features enabled on this endpoint.
5034+eFeatures :: Lens' Endpoint [Text]
5035+eFeatures
5036+ = lens _eFeatures (\ s a -> s{_eFeatures = a}) .
5037+ _Default
5038+ . _Coerce
5039+
5040+instance FromJSON Endpoint where
5041+ parseJSON
5042+ = withObject "Endpoint"
5043+ (\ o ->
5044+ Endpoint' <$>
5045+ (o .:? "aliases" .!= mempty) <*>
5046+ (o .:? "apis" .!= mempty)
5047+ <*> (o .:? "allowCors")
5048+ <*> (o .:? "name")
5049+ <*> (o .:? "features" .!= mempty))
5050+
5051+instance ToJSON Endpoint where
5052+ toJSON Endpoint'{..}
5053+ = object
5054+ (catMaybes
5055+ [("aliases" .=) <$> _eAliases,
5056+ ("apis" .=) <$> _eAPIs,
5057+ ("allowCors" .=) <$> _eAllowCORS,
5058+ ("name" .=) <$> _eName,
5059+ ("features" .=) <$> _eFeatures])
5060+
5061+-- | OAuth scopes are a way to define data and permissions on data. For
5062+-- example, there are scopes defined for \"Read-only access to Google
5063+-- Calendar\" and \"Access to Cloud Platform\". Users can consent to a
5064+-- scope for an application, giving it permission to access that data on
5065+-- their behalf. OAuth scope specifications should be fairly coarse
5066+-- grained; a user will need to see and understand the text description of
5067+-- what your scope means. In most cases: use one or at most two OAuth
5068+-- scopes for an entire family of products. If your product has multiple
5069+-- APIs, you should probably be sharing the OAuth scope across all of those
5070+-- APIs. When you need finer grained OAuth consent screens: talk with your
5071+-- product management about how developers will use them in practice.
5072+-- Please note that even though each of the canonical scopes is enough for
5073+-- a request to be accepted and passed to the backend, a request can still
5074+-- fail due to the backend requiring additional scopes or permissions.
5075+--
5076+-- /See:/ 'oAuthRequirements' smart constructor.
5077+newtype OAuthRequirements = OAuthRequirements'
5078+ { _oarCanonicalScopes :: Maybe Text
5079+ } deriving (Eq,Show,Data,Typeable,Generic)
5080+
5081+-- | Creates a value of 'OAuthRequirements' with the minimum fields required to make a request.
5082+--
5083+-- Use one of the following lenses to modify other fields as desired:
5084+--
5085+-- * 'oarCanonicalScopes'
5086+oAuthRequirements
5087+ :: OAuthRequirements
5088+oAuthRequirements =
5089+ OAuthRequirements'
5090+ { _oarCanonicalScopes = Nothing
5091+ }
5092+
5093+-- | The list of publicly documented OAuth scopes that are allowed access. An
5094+-- OAuth token containing any of these scopes will be accepted. Example:
5095+-- canonical_scopes: https:\/\/www.googleapis.com\/auth\/calendar,
5096+-- https:\/\/www.googleapis.com\/auth\/calendar.read
5097+oarCanonicalScopes :: Lens' OAuthRequirements (Maybe Text)
5098+oarCanonicalScopes
5099+ = lens _oarCanonicalScopes
5100+ (\ s a -> s{_oarCanonicalScopes = a})
5101+
5102+instance FromJSON OAuthRequirements where
5103+ parseJSON
5104+ = withObject "OAuthRequirements"
5105+ (\ o ->
5106+ OAuthRequirements' <$> (o .:? "canonicalScopes"))
5107+
5108+instance ToJSON OAuthRequirements where
5109+ toJSON OAuthRequirements'{..}
5110+ = object
5111+ (catMaybes
5112+ [("canonicalScopes" .=) <$> _oarCanonicalScopes])
5113+
5114+-- | Customize service error responses. For example, list any service
5115+-- specific protobuf types that can appear in error detail lists of error
5116+-- responses. Example: custom_error: types: - google.foo.v1.CustomError -
5117+-- google.foo.v1.AnotherError
5118+--
5119+-- /See:/ 'customError' smart constructor.
5120+data CustomError = CustomError'
5121+ { _ceRules :: !(Maybe [CustomErrorRule])
5122+ , _ceTypes :: !(Maybe [Text])
5123+ } deriving (Eq,Show,Data,Typeable,Generic)
5124+
5125+-- | Creates a value of 'CustomError' with the minimum fields required to make a request.
5126+--
5127+-- Use one of the following lenses to modify other fields as desired:
5128+--
5129+-- * 'ceRules'
5130+--
5131+-- * 'ceTypes'
5132+customError
5133+ :: CustomError
5134+customError =
5135+ CustomError'
5136+ { _ceRules = Nothing
5137+ , _ceTypes = Nothing
5138+ }
5139+
5140+-- | The list of custom error rules that apply to individual API messages.
5141+-- **NOTE:** All service configuration rules follow \"last one wins\"
5142+-- order.
5143+ceRules :: Lens' CustomError [CustomErrorRule]
5144+ceRules
5145+ = lens _ceRules (\ s a -> s{_ceRules = a}) . _Default
5146+ . _Coerce
5147+
5148+-- | The list of custom error detail types, e.g.
5149+-- \'google.foo.v1.CustomError\'.
5150+ceTypes :: Lens' CustomError [Text]
5151+ceTypes
5152+ = lens _ceTypes (\ s a -> s{_ceTypes = a}) . _Default
5153+ . _Coerce
5154+
5155+instance FromJSON CustomError where
5156+ parseJSON
5157+ = withObject "CustomError"
5158+ (\ o ->
5159+ CustomError' <$>
5160+ (o .:? "rules" .!= mempty) <*>
5161+ (o .:? "types" .!= mempty))
5162+
5163+instance ToJSON CustomError where
5164+ toJSON CustomError'{..}
5165+ = object
5166+ (catMaybes
5167+ [("rules" .=) <$> _ceRules,
5168+ ("types" .=) <$> _ceTypes])
5169+
5170+-- | A protocol buffer option, which can be attached to a message, field,
5171+-- enumeration, etc.
5172+--
5173+-- /See:/ 'option' smart constructor.
5174+data Option = Option'
5175+ { _optValue :: !(Maybe OptionValue)
5176+ , _optName :: !(Maybe Text)
5177+ } deriving (Eq,Show,Data,Typeable,Generic)
5178+
5179+-- | Creates a value of 'Option' with the minimum fields required to make a request.
5180+--
5181+-- Use one of the following lenses to modify other fields as desired:
5182+--
5183+-- * 'optValue'
5184+--
5185+-- * 'optName'
5186+option
5187+ :: Option
5188+option =
5189+ Option'
5190+ { _optValue = Nothing
5191+ , _optName = Nothing
5192+ }
5193+
5194+-- | The option\'s value. For example, \`\"com.google.protobuf\"\`.
5195+optValue :: Lens' Option (Maybe OptionValue)
5196+optValue = lens _optValue (\ s a -> s{_optValue = a})
5197+
5198+-- | The option\'s name. For example, \`\"java_package\"\`.
5199+optName :: Lens' Option (Maybe Text)
5200+optName = lens _optName (\ s a -> s{_optName = a})
5201+
5202+instance FromJSON Option where
5203+ parseJSON
5204+ = withObject "Option"
5205+ (\ o ->
5206+ Option' <$> (o .:? "value") <*> (o .:? "name"))
5207+
5208+instance ToJSON Option where
5209+ toJSON Option'{..}
5210+ = object
5211+ (catMaybes
5212+ [("value" .=) <$> _optValue,
5213+ ("name" .=) <$> _optName])
5214+
5215+-- | A rollout resource that defines how service configuration versions are
5216+-- pushed to control plane systems. Typically, you create a new version of
5217+-- the service config, and then create a Rollout to push the service
5218+-- config.
5219+--
5220+-- /See:/ 'rollout' smart constructor.
5221+data Rollout = Rollout'
5222+ { _rStatus :: !(Maybe RolloutStatus)
5223+ , _rDeleteServiceStrategy :: !(Maybe DeleteServiceStrategy)
5224+ , _rTrafficPercentStrategy :: !(Maybe TrafficPercentStrategy)
5225+ , _rCreatedBy :: !(Maybe Text)
5226+ , _rServiceName :: !(Maybe Text)
5227+ , _rRolloutId :: !(Maybe Text)
5228+ , _rCreateTime :: !(Maybe DateTime')
5229+ } deriving (Eq,Show,Data,Typeable,Generic)
5230+
5231+-- | Creates a value of 'Rollout' with the minimum fields required to make a request.
5232+--
5233+-- Use one of the following lenses to modify other fields as desired:
5234+--
5235+-- * 'rStatus'
5236+--
5237+-- * 'rDeleteServiceStrategy'
5238+--
5239+-- * 'rTrafficPercentStrategy'
5240+--
5241+-- * 'rCreatedBy'
5242+--
5243+-- * 'rServiceName'
5244+--
5245+-- * 'rRolloutId'
5246+--
5247+-- * 'rCreateTime'
5248+rollout
5249+ :: Rollout
5250+rollout =
5251+ Rollout'
5252+ { _rStatus = Nothing
5253+ , _rDeleteServiceStrategy = Nothing
5254+ , _rTrafficPercentStrategy = Nothing
5255+ , _rCreatedBy = Nothing
5256+ , _rServiceName = Nothing
5257+ , _rRolloutId = Nothing
5258+ , _rCreateTime = Nothing
5259+ }
5260+
5261+-- | The status of this rollout. Readonly. In case of a failed rollout, the
5262+-- system will automatically rollback to the current Rollout version.
5263+-- Readonly.
5264+rStatus :: Lens' Rollout (Maybe RolloutStatus)
5265+rStatus = lens _rStatus (\ s a -> s{_rStatus = a})
5266+
5267+-- | The strategy associated with a rollout to delete a \`ManagedService\`.
5268+-- Readonly.
5269+rDeleteServiceStrategy :: Lens' Rollout (Maybe DeleteServiceStrategy)
5270+rDeleteServiceStrategy
5271+ = lens _rDeleteServiceStrategy
5272+ (\ s a -> s{_rDeleteServiceStrategy = a})
5273+
5274+-- | Google Service Control selects service configurations based on traffic
5275+-- percentage.
5276+rTrafficPercentStrategy :: Lens' Rollout (Maybe TrafficPercentStrategy)
5277+rTrafficPercentStrategy
5278+ = lens _rTrafficPercentStrategy
5279+ (\ s a -> s{_rTrafficPercentStrategy = a})
5280+
5281+-- | The user who created the Rollout. Readonly.
5282+rCreatedBy :: Lens' Rollout (Maybe Text)
5283+rCreatedBy
5284+ = lens _rCreatedBy (\ s a -> s{_rCreatedBy = a})
5285+
5286+-- | The name of the service associated with this Rollout.
5287+rServiceName :: Lens' Rollout (Maybe Text)
5288+rServiceName
5289+ = lens _rServiceName (\ s a -> s{_rServiceName = a})
5290+
5291+-- | Optional unique identifier of this Rollout. Only lower case letters,
5292+-- digits and \'-\' are allowed. If not specified by client, the server
5293+-- will generate one. The generated id will have the form of , where
5294+-- \"date\" is the create date in ISO 8601 format. \"revision number\" is a
5295+-- monotonically increasing positive number that is reset every day for
5296+-- each service. An example of the generated rollout_id is \'2016-02-16r1\'
5297+rRolloutId :: Lens' Rollout (Maybe Text)
5298+rRolloutId
5299+ = lens _rRolloutId (\ s a -> s{_rRolloutId = a})
5300+
5301+-- | Creation time of the rollout. Readonly.
5302+rCreateTime :: Lens' Rollout (Maybe UTCTime)
5303+rCreateTime
5304+ = lens _rCreateTime (\ s a -> s{_rCreateTime = a}) .
5305+ mapping _DateTime
5306+
5307+instance FromJSON Rollout where
5308+ parseJSON
5309+ = withObject "Rollout"
5310+ (\ o ->
5311+ Rollout' <$>
5312+ (o .:? "status") <*> (o .:? "deleteServiceStrategy")
5313+ <*> (o .:? "trafficPercentStrategy")
5314+ <*> (o .:? "createdBy")
5315+ <*> (o .:? "serviceName")
5316+ <*> (o .:? "rolloutId")
5317+ <*> (o .:? "createTime"))
5318+
5319+instance ToJSON Rollout where
5320+ toJSON Rollout'{..}
5321+ = object
5322+ (catMaybes
5323+ [("status" .=) <$> _rStatus,
5324+ ("deleteServiceStrategy" .=) <$>
5325+ _rDeleteServiceStrategy,
5326+ ("trafficPercentStrategy" .=) <$>
5327+ _rTrafficPercentStrategy,
5328+ ("createdBy" .=) <$> _rCreatedBy,
5329+ ("serviceName" .=) <$> _rServiceName,
5330+ ("rolloutId" .=) <$> _rRolloutId,
5331+ ("createTime" .=) <$> _rCreateTime])
5332+
5333+-- | A condition to be met.
5334+--
5335+-- /See:/ 'condition' smart constructor.
5336+data Condition = Condition'
5337+ { _cOp :: !(Maybe ConditionOp)
5338+ , _cIAM :: !(Maybe ConditionIAM)
5339+ , _cValues :: !(Maybe [Text])
5340+ , _cValue :: !(Maybe Text)
5341+ , _cSys :: !(Maybe ConditionSys)
5342+ , _cSvc :: !(Maybe Text)
5343+ } deriving (Eq,Show,Data,Typeable,Generic)
5344+
5345+-- | Creates a value of 'Condition' with the minimum fields required to make a request.
5346+--
5347+-- Use one of the following lenses to modify other fields as desired:
5348+--
5349+-- * 'cOp'
5350+--
5351+-- * 'cIAM'
5352+--
5353+-- * 'cValues'
5354+--
5355+-- * 'cValue'
5356+--
5357+-- * 'cSys'
5358+--
5359+-- * 'cSvc'
5360+condition
5361+ :: Condition
5362+condition =
5363+ Condition'
5364+ { _cOp = Nothing
5365+ , _cIAM = Nothing
5366+ , _cValues = Nothing
5367+ , _cValue = Nothing
5368+ , _cSys = Nothing
5369+ , _cSvc = Nothing
5370+ }
5371+
5372+-- | An operator to apply the subject with.
5373+cOp :: Lens' Condition (Maybe ConditionOp)
5374+cOp = lens _cOp (\ s a -> s{_cOp = a})
5375+
5376+-- | Trusted attributes supplied by the IAM system.
5377+cIAM :: Lens' Condition (Maybe ConditionIAM)
5378+cIAM = lens _cIAM (\ s a -> s{_cIAM = a})
5379+
5380+-- | The objects of the condition. This is mutually exclusive with \'value\'.
5381+cValues :: Lens' Condition [Text]
5382+cValues
5383+ = lens _cValues (\ s a -> s{_cValues = a}) . _Default
5384+ . _Coerce
5385+
5386+-- | DEPRECATED. Use \'values\' instead.
5387+cValue :: Lens' Condition (Maybe Text)
5388+cValue = lens _cValue (\ s a -> s{_cValue = a})
5389+
5390+-- | Trusted attributes supplied by any service that owns resources and uses
5391+-- the IAM system for access control.
5392+cSys :: Lens' Condition (Maybe ConditionSys)
5393+cSys = lens _cSys (\ s a -> s{_cSys = a})
5394+
5395+-- | Trusted attributes discharged by the service.
5396+cSvc :: Lens' Condition (Maybe Text)
5397+cSvc = lens _cSvc (\ s a -> s{_cSvc = a})
5398+
5399+instance FromJSON Condition where
5400+ parseJSON
5401+ = withObject "Condition"
5402+ (\ o ->
5403+ Condition' <$>
5404+ (o .:? "op") <*> (o .:? "iam") <*>
5405+ (o .:? "values" .!= mempty)
5406+ <*> (o .:? "value")
5407+ <*> (o .:? "sys")
5408+ <*> (o .:? "svc"))
5409+
5410+instance ToJSON Condition where
5411+ toJSON Condition'{..}
5412+ = object
5413+ (catMaybes
5414+ [("op" .=) <$> _cOp, ("iam" .=) <$> _cIAM,
5415+ ("values" .=) <$> _cValues, ("value" .=) <$> _cValue,
5416+ ("sys" .=) <$> _cSys, ("svc" .=) <$> _cSvc])
5417+
5418+-- | Enum type definition.
5419+--
5420+-- /See:/ 'enum' smart constructor.
5421+data Enum = Enum'
5422+ { _enuSourceContext :: !(Maybe SourceContext)
5423+ , _enuEnumvalue :: !(Maybe [EnumValue])
5424+ , _enuName :: !(Maybe Text)
5425+ , _enuOptions :: !(Maybe [Option])
5426+ , _enuSyntax :: !(Maybe EnumSyntax)
5427+ } deriving (Eq,Show,Data,Typeable,Generic)
5428+
5429+-- | Creates a value of 'Enum' with the minimum fields required to make a request.
5430+--
5431+-- Use one of the following lenses to modify other fields as desired:
5432+--
5433+-- * 'enuSourceContext'
5434+--
5435+-- * 'enuEnumvalue'
5436+--
5437+-- * 'enuName'
5438+--
5439+-- * 'enuOptions'
5440+--
5441+-- * 'enuSyntax'
5442+enum
5443+ :: Enum
5444+enum =
5445+ Enum'
5446+ { _enuSourceContext = Nothing
5447+ , _enuEnumvalue = Nothing
5448+ , _enuName = Nothing
5449+ , _enuOptions = Nothing
5450+ , _enuSyntax = Nothing
5451+ }
5452+
5453+-- | The source context.
5454+enuSourceContext :: Lens' Enum (Maybe SourceContext)
5455+enuSourceContext
5456+ = lens _enuSourceContext
5457+ (\ s a -> s{_enuSourceContext = a})
5458+
5459+-- | Enum value definitions.
5460+enuEnumvalue :: Lens' Enum [EnumValue]
5461+enuEnumvalue
5462+ = lens _enuEnumvalue (\ s a -> s{_enuEnumvalue = a})
5463+ . _Default
5464+ . _Coerce
5465+
5466+-- | Enum type name.
5467+enuName :: Lens' Enum (Maybe Text)
5468+enuName = lens _enuName (\ s a -> s{_enuName = a})
5469+
5470+-- | Protocol buffer options.
5471+enuOptions :: Lens' Enum [Option]
5472+enuOptions
5473+ = lens _enuOptions (\ s a -> s{_enuOptions = a}) .
5474+ _Default
5475+ . _Coerce
5476+
5477+-- | The source syntax.
5478+enuSyntax :: Lens' Enum (Maybe EnumSyntax)
5479+enuSyntax
5480+ = lens _enuSyntax (\ s a -> s{_enuSyntax = a})
5481+
5482+instance FromJSON Enum where
5483+ parseJSON
5484+ = withObject "Enum"
5485+ (\ o ->
5486+ Enum' <$>
5487+ (o .:? "sourceContext") <*>
5488+ (o .:? "enumvalue" .!= mempty)
5489+ <*> (o .:? "name")
5490+ <*> (o .:? "options" .!= mempty)
5491+ <*> (o .:? "syntax"))
5492+
5493+instance ToJSON Enum where
5494+ toJSON Enum'{..}
5495+ = object
5496+ (catMaybes
5497+ [("sourceContext" .=) <$> _enuSourceContext,
5498+ ("enumvalue" .=) <$> _enuEnumvalue,
5499+ ("name" .=) <$> _enuName,
5500+ ("options" .=) <$> _enuOptions,
5501+ ("syntax" .=) <$> _enuSyntax])
5502+
5503+-- | Logging configuration of the service. The following example shows how to
5504+-- configure logs to be sent to the producer and consumer projects. In the
5505+-- example, the \`activity_history\` log is sent to both the producer and
5506+-- consumer projects, whereas the \`purchase_history\` log is only sent to
5507+-- the producer project. monitored_resources: - type:
5508+-- library.googleapis.com\/branch labels: - key: \/city description: The
5509+-- city where the library branch is located in. - key: \/name description:
5510+-- The name of the branch. logs: - name: activity_history labels: - key:
5511+-- \/customer_id - name: purchase_history logging: producer_destinations: -
5512+-- monitored_resource: library.googleapis.com\/branch logs: -
5513+-- activity_history - purchase_history consumer_destinations: -
5514+-- monitored_resource: library.googleapis.com\/branch logs: -
5515+-- activity_history
5516+--
5517+-- /See:/ 'logging' smart constructor.
5518+data Logging = Logging'
5519+ { _lProducerDestinations :: !(Maybe [LoggingDestination])
5520+ , _lConsumerDestinations :: !(Maybe [LoggingDestination])
5521+ } deriving (Eq,Show,Data,Typeable,Generic)
5522+
5523+-- | Creates a value of 'Logging' with the minimum fields required to make a request.
5524+--
5525+-- Use one of the following lenses to modify other fields as desired:
5526+--
5527+-- * 'lProducerDestinations'
5528+--
5529+-- * 'lConsumerDestinations'
5530+logging
5531+ :: Logging
5532+logging =
5533+ Logging'
5534+ { _lProducerDestinations = Nothing
5535+ , _lConsumerDestinations = Nothing
5536+ }
5537+
5538+-- | Logging configurations for sending logs to the producer project. There
5539+-- can be multiple producer destinations, each one must have a different
5540+-- monitored resource type. A log can be used in at most one producer
5541+-- destination.
5542+lProducerDestinations :: Lens' Logging [LoggingDestination]
5543+lProducerDestinations
5544+ = lens _lProducerDestinations
5545+ (\ s a -> s{_lProducerDestinations = a})
5546+ . _Default
5547+ . _Coerce
5548+
5549+-- | Logging configurations for sending logs to the consumer project. There
5550+-- can be multiple consumer destinations, each one must have a different
5551+-- monitored resource type. A log can be used in at most one consumer
5552+-- destination.
5553+lConsumerDestinations :: Lens' Logging [LoggingDestination]
5554+lConsumerDestinations
5555+ = lens _lConsumerDestinations
5556+ (\ s a -> s{_lConsumerDestinations = a})
5557+ . _Default
5558+ . _Coerce
5559+
5560+instance FromJSON Logging where
5561+ parseJSON
5562+ = withObject "Logging"
5563+ (\ o ->
5564+ Logging' <$>
5565+ (o .:? "producerDestinations" .!= mempty) <*>
5566+ (o .:? "consumerDestinations" .!= mempty))
5567+
5568+instance ToJSON Logging where
5569+ toJSON Logging'{..}
5570+ = object
5571+ (catMaybes
5572+ [("producerDestinations" .=) <$>
5573+ _lProducerDestinations,
5574+ ("consumerDestinations" .=) <$>
5575+ _lConsumerDestinations])
5576+
5577+-- | Represents a service configuration with its name and id.
5578+--
5579+-- /See:/ 'configRef' smart constructor.
5580+newtype ConfigRef = ConfigRef'
5581+ { _crName :: Maybe Text
5582+ } deriving (Eq,Show,Data,Typeable,Generic)
5583+
5584+-- | Creates a value of 'ConfigRef' with the minimum fields required to make a request.
5585+--
5586+-- Use one of the following lenses to modify other fields as desired:
5587+--
5588+-- * 'crName'
5589+configRef
5590+ :: ConfigRef
5591+configRef =
5592+ ConfigRef'
5593+ { _crName = Nothing
5594+ }
5595+
5596+-- | Resource name of a service config. It must have the following format:
5597+-- \"services\/{service name}\/configs\/{config id}\".
5598+crName :: Lens' ConfigRef (Maybe Text)
5599+crName = lens _crName (\ s a -> s{_crName = a})
5600+
5601+instance FromJSON ConfigRef where
5602+ parseJSON
5603+ = withObject "ConfigRef"
5604+ (\ o -> ConfigRef' <$> (o .:? "name"))
5605+
5606+instance ToJSON ConfigRef where
5607+ toJSON ConfigRef'{..}
5608+ = object (catMaybes [("name" .=) <$> _crName])
5609+
5610+-- | Request message for GenerateConfigReport method.
5611+--
5612+-- /See:/ 'generateConfigReportRequest' smart constructor.
5613+data GenerateConfigReportRequest = GenerateConfigReportRequest'
5614+ { _gcrrOldConfig :: !(Maybe GenerateConfigReportRequestOldConfig)
5615+ , _gcrrNewConfig :: !(Maybe GenerateConfigReportRequestNewConfig)
5616+ } deriving (Eq,Show,Data,Typeable,Generic)
5617+
5618+-- | Creates a value of 'GenerateConfigReportRequest' with the minimum fields required to make a request.
5619+--
5620+-- Use one of the following lenses to modify other fields as desired:
5621+--
5622+-- * 'gcrrOldConfig'
5623+--
5624+-- * 'gcrrNewConfig'
5625+generateConfigReportRequest
5626+ :: GenerateConfigReportRequest
5627+generateConfigReportRequest =
5628+ GenerateConfigReportRequest'
5629+ { _gcrrOldConfig = Nothing
5630+ , _gcrrNewConfig = Nothing
5631+ }
5632+
5633+-- | Service configuration against which the comparison will be done. For
5634+-- this version of API, the supported types are
5635+-- google.api.servicemanagement.v1.ConfigRef,
5636+-- google.api.servicemanagement.v1.ConfigSource, and google.api.Service
5637+gcrrOldConfig :: Lens' GenerateConfigReportRequest (Maybe GenerateConfigReportRequestOldConfig)
5638+gcrrOldConfig
5639+ = lens _gcrrOldConfig
5640+ (\ s a -> s{_gcrrOldConfig = a})
5641+
5642+-- | Service configuration for which we want to generate the report. For this
5643+-- version of API, the supported types are
5644+-- google.api.servicemanagement.v1.ConfigRef,
5645+-- google.api.servicemanagement.v1.ConfigSource, and google.api.Service
5646+gcrrNewConfig :: Lens' GenerateConfigReportRequest (Maybe GenerateConfigReportRequestNewConfig)
5647+gcrrNewConfig
5648+ = lens _gcrrNewConfig
5649+ (\ s a -> s{_gcrrNewConfig = a})
5650+
5651+instance FromJSON GenerateConfigReportRequest where
5652+ parseJSON
5653+ = withObject "GenerateConfigReportRequest"
5654+ (\ o ->
5655+ GenerateConfigReportRequest' <$>
5656+ (o .:? "oldConfig") <*> (o .:? "newConfig"))
5657+
5658+instance ToJSON GenerateConfigReportRequest where
5659+ toJSON GenerateConfigReportRequest'{..}
5660+ = object
5661+ (catMaybes
5662+ [("oldConfig" .=) <$> _gcrrOldConfig,
5663+ ("newConfig" .=) <$> _gcrrNewConfig])
5664+
5665+-- | \`HttpRule\` defines the mapping of an RPC method to one or more HTTP
5666+-- REST APIs. The mapping determines what portions of the request message
5667+-- are populated from the path, query parameters, or body of the HTTP
5668+-- request. The mapping is typically specified as an \`google.api.http\`
5669+-- annotation, see \"google\/api\/annotations.proto\" for details. The
5670+-- mapping consists of a field specifying the path template and method
5671+-- kind. The path template can refer to fields in the request message, as
5672+-- in the example below which describes a REST GET operation on a resource
5673+-- collection of messages: \`\`\`proto service Messaging { rpc
5674+-- GetMessage(GetMessageRequest) returns (Message) { option
5675+-- (google.api.http).get =
5676+-- \"\/v1\/messages\/{message_id}\/{sub.subfield}\"; } } message
5677+-- GetMessageRequest { message SubMessage { string subfield = 1; } string
5678+-- message_id = 1; \/\/ mapped to the URL SubMessage sub = 2; \/\/
5679+-- \`sub.subfield\` is url-mapped } message Message { string text = 1; \/\/
5680+-- content of the resource } \`\`\` This definition enables an automatic,
5681+-- bidrectional mapping of HTTP JSON to RPC. Example: HTTP | RPC
5682+-- -----|----- \`GET \/v1\/messages\/123456\/foo\` |
5683+-- \`GetMessage(message_id: \"123456\" sub: SubMessage(subfield:
5684+-- \"foo\"))\` In general, not only fields but also field paths can be
5685+-- referenced from a path pattern. Fields mapped to the path pattern cannot
5686+-- be repeated and must have a primitive (non-message) type. Any fields in
5687+-- the request message which are not bound by the path pattern
5688+-- automatically become (optional) HTTP query parameters. Assume the
5689+-- following definition of the request message: \`\`\`proto message
5690+-- GetMessageRequest { message SubMessage { string subfield = 1; } string
5691+-- message_id = 1; \/\/ mapped to the URL int64 revision = 2; \/\/ becomes
5692+-- a parameter SubMessage sub = 3; \/\/ \`sub.subfield\` becomes a
5693+-- parameter } \`\`\` This enables a HTTP JSON to RPC mapping as below:
5694+-- HTTP | RPC -----|----- \`GET
5695+-- \/v1\/messages\/123456?revision=2&sub.subfield=foo\` |
5696+-- \`GetMessage(message_id: \"123456\" revision: 2 sub:
5697+-- SubMessage(subfield: \"foo\"))\` Note that fields which are mapped to
5698+-- HTTP parameters must have a primitive type or a repeated primitive type.
5699+-- Message types are not allowed. In the case of a repeated type, the
5700+-- parameter can be repeated in the URL, as in \`...?param=A¶m=B\`. For
5701+-- HTTP method kinds which allow a request body, the \`body\` field
5702+-- specifies the mapping. Consider a REST update method on the message
5703+-- resource collection: \`\`\`proto service Messaging { rpc
5704+-- UpdateMessage(UpdateMessageRequest) returns (Message) { option
5705+-- (google.api.http) = { put: \"\/v1\/messages\/{message_id}\" body:
5706+-- \"message\" }; } } message UpdateMessageRequest { string message_id = 1;
5707+-- \/\/ mapped to the URL Message message = 2; \/\/ mapped to the body }
5708+-- \`\`\` The following HTTP JSON to RPC mapping is enabled, where the
5709+-- representation of the JSON in the request body is determined by protos
5710+-- JSON encoding: HTTP | RPC -----|----- \`PUT \/v1\/messages\/123456 {
5711+-- \"text\": \"Hi!\" }\` | \`UpdateMessage(message_id: \"123456\" message {
5712+-- text: \"Hi!\" })\` The special name \`*\` can be used in the body
5713+-- mapping to define that every field not bound by the path template should
5714+-- be mapped to the request body. This enables the following alternative
5715+-- definition of the update method: \`\`\`proto service Messaging { rpc
5716+-- UpdateMessage(Message) returns (Message) { option (google.api.http) = {
5717+-- put: \"\/v1\/messages\/{message_id}\" body: \"*\" }; } } message Message
5718+-- { string message_id = 1; string text = 2; } \`\`\` The following HTTP
5719+-- JSON to RPC mapping is enabled: HTTP | RPC -----|----- \`PUT
5720+-- \/v1\/messages\/123456 { \"text\": \"Hi!\" }\` |
5721+-- \`UpdateMessage(message_id: \"123456\" text: \"Hi!\")\` Note that when
5722+-- using \`*\` in the body mapping, it is not possible to have HTTP
5723+-- parameters, as all fields not bound by the path end in the body. This
5724+-- makes this option more rarely used in practice of defining REST APIs.
5725+-- The common usage of \`*\` is in custom methods which don\'t use the URL
5726+-- at all for transferring data. It is possible to define multiple HTTP
5727+-- methods for one RPC by using the \`additional_bindings\` option.
5728+-- Example: \`\`\`proto service Messaging { rpc
5729+-- GetMessage(GetMessageRequest) returns (Message) { option
5730+-- (google.api.http) = { get: \"\/v1\/messages\/{message_id}\"
5731+-- additional_bindings { get:
5732+-- \"\/v1\/users\/{user_id}\/messages\/{message_id}\" } }; } } message
5733+-- GetMessageRequest { string message_id = 1; string user_id = 2; } \`\`\`
5734+-- This enables the following two alternative HTTP JSON to RPC mappings:
5735+-- HTTP | RPC -----|----- \`GET \/v1\/messages\/123456\` |
5736+-- \`GetMessage(message_id: \"123456\")\` \`GET
5737+-- \/v1\/users\/me\/messages\/123456\` | \`GetMessage(user_id: \"me\"
5738+-- message_id: \"123456\")\` # Rules for HTTP mapping The rules for mapping
5739+-- HTTP path, query parameters, and body fields to the request message are
5740+-- as follows: 1. The \`body\` field specifies either \`*\` or a field
5741+-- path, or is omitted. If omitted, it assumes there is no HTTP body. 2.
5742+-- Leaf fields (recursive expansion of nested messages in the request) can
5743+-- be classified into three types: (a) Matched in the URL template. (b)
5744+-- Covered by body (if body is \`*\`, everything except (a) fields; else
5745+-- everything under the body field) (c) All other fields. 3. URL query
5746+-- parameters found in the HTTP request are mapped to (c) fields. 4. Any
5747+-- body sent with an HTTP request can contain only (b) fields. The syntax
5748+-- of the path template is as follows: Template = \"\/\" Segments [ Verb ]
5749+-- ; Segments = Segment { \"\/\" Segment } ; Segment = \"*\" | \"**\" |
5750+-- LITERAL | Variable ; Variable = \"{\" FieldPath [ \"=\" Segments ] \"}\"
5751+-- ; FieldPath = IDENT { \".\" IDENT } ; Verb = \":\" LITERAL ; The syntax
5752+-- \`*\` matches a single path segment. It follows the semantics of [RFC
5753+-- 6570](https:\/\/tools.ietf.org\/html\/rfc6570) Section 3.2.2 Simple
5754+-- String Expansion. The syntax \`**\` matches zero or more path segments.
5755+-- It follows the semantics of [RFC
5756+-- 6570](https:\/\/tools.ietf.org\/html\/rfc6570) Section 3.2.3 Reserved
5757+-- Expansion. The syntax \`LITERAL\` matches literal text in the URL path.
5758+-- The syntax \`Variable\` matches the entire path as specified by its
5759+-- template; this nested template must not contain further variables. If a
5760+-- variable matches a single path segment, its template may be omitted,
5761+-- e.g. \`{var}\` is equivalent to \`{var=*}\`. NOTE: the field paths in
5762+-- variables and in the \`body\` must not refer to repeated fields or map
5763+-- fields. Use CustomHttpPattern to specify any HTTP method that is not
5764+-- included in the \`pattern\` field, such as HEAD, or \"*\" to leave the
5765+-- HTTP method unspecified for a given URL path rule. The wild-card rule is
5766+-- useful for services that provide content to Web (HTML) clients.
5767+--
5768+-- /See:/ 'hTTPRule' smart constructor.
5769+data HTTPRule = HTTPRule'
5770+ { _httprMediaUpload :: !(Maybe MediaUpload')
5771+ , _httprSelector :: !(Maybe Text)
5772+ , _httprPost :: !(Maybe Text)
5773+ , _httprMediaDownload :: !(Maybe MediaDownload')
5774+ , _httprBody :: !(Maybe Text)
5775+ , _httprCustom :: !(Maybe CustomHTTPPattern)
5776+ , _httprResponseBody :: !(Maybe Text)
5777+ , _httprPatch :: !(Maybe Text)
5778+ , _httprGet :: !(Maybe Text)
5779+ , _httprAdditionalBindings :: !(Maybe [HTTPRule])
5780+ , _httprDelete :: !(Maybe Text)
5781+ , _httprPut :: !(Maybe Text)
5782+ } deriving (Eq,Show,Data,Typeable,Generic)
5783+
5784+-- | Creates a value of 'HTTPRule' with the minimum fields required to make a request.
5785+--
5786+-- Use one of the following lenses to modify other fields as desired:
5787+--
5788+-- * 'httprMediaUpload'
5789+--
5790+-- * 'httprSelector'
5791+--
5792+-- * 'httprPost'
5793+--
5794+-- * 'httprMediaDownload'
5795+--
5796+-- * 'httprBody'
5797+--
5798+-- * 'httprCustom'
5799+--
5800+-- * 'httprResponseBody'
5801+--
5802+-- * 'httprPatch'
5803+--
5804+-- * 'httprGet'
5805+--
5806+-- * 'httprAdditionalBindings'
5807+--
5808+-- * 'httprDelete'
5809+--
5810+-- * 'httprPut'
5811+hTTPRule
5812+ :: HTTPRule
5813+hTTPRule =
5814+ HTTPRule'
5815+ { _httprMediaUpload = Nothing
5816+ , _httprSelector = Nothing
5817+ , _httprPost = Nothing
5818+ , _httprMediaDownload = Nothing
5819+ , _httprBody = Nothing
5820+ , _httprCustom = Nothing
5821+ , _httprResponseBody = Nothing
5822+ , _httprPatch = Nothing
5823+ , _httprGet = Nothing
5824+ , _httprAdditionalBindings = Nothing
5825+ , _httprDelete = Nothing
5826+ , _httprPut = Nothing
5827+ }
5828+
5829+-- | Do not use this. For media support, add instead
5830+-- [][google.bytestream.RestByteStream] as an API to your configuration.
5831+httprMediaUpload :: Lens' HTTPRule (Maybe MediaUpload')
5832+httprMediaUpload
5833+ = lens _httprMediaUpload
5834+ (\ s a -> s{_httprMediaUpload = a})
5835+
5836+-- | Selects methods to which this rule applies. Refer to selector for syntax
5837+-- details.
5838+httprSelector :: Lens' HTTPRule (Maybe Text)
5839+httprSelector
5840+ = lens _httprSelector
5841+ (\ s a -> s{_httprSelector = a})
5842+
5843+-- | Used for creating a resource.
5844+httprPost :: Lens' HTTPRule (Maybe Text)
5845+httprPost
5846+ = lens _httprPost (\ s a -> s{_httprPost = a})
5847+
5848+-- | Do not use this. For media support, add instead
5849+-- [][google.bytestream.RestByteStream] as an API to your configuration.
5850+httprMediaDownload :: Lens' HTTPRule (Maybe MediaDownload')
5851+httprMediaDownload
5852+ = lens _httprMediaDownload
5853+ (\ s a -> s{_httprMediaDownload = a})
5854+
5855+-- | The name of the request field whose value is mapped to the HTTP body, or
5856+-- \`*\` for mapping all fields not captured by the path pattern to the
5857+-- HTTP body. NOTE: the referred field must not be a repeated field and
5858+-- must be present at the top-level of response message type.
5859+httprBody :: Lens' HTTPRule (Maybe Text)
5860+httprBody
5861+ = lens _httprBody (\ s a -> s{_httprBody = a})
5862+
5863+-- | Custom pattern is used for defining custom verbs.
5864+httprCustom :: Lens' HTTPRule (Maybe CustomHTTPPattern)
5865+httprCustom
5866+ = lens _httprCustom (\ s a -> s{_httprCustom = a})
5867+
5868+-- | The name of the response field whose value is mapped to the HTTP body of
5869+-- response. Other response fields are ignored. This field is optional.
5870+-- When not set, the response message will be used as HTTP body of
5871+-- response. NOTE: the referred field must be not a repeated field and must
5872+-- be present at the top-level of response message type.
5873+httprResponseBody :: Lens' HTTPRule (Maybe Text)
5874+httprResponseBody
5875+ = lens _httprResponseBody
5876+ (\ s a -> s{_httprResponseBody = a})
5877+
5878+-- | Used for updating a resource.
5879+httprPatch :: Lens' HTTPRule (Maybe Text)
5880+httprPatch
5881+ = lens _httprPatch (\ s a -> s{_httprPatch = a})
5882+
5883+-- | Used for listing and getting information about resources.
5884+httprGet :: Lens' HTTPRule (Maybe Text)
5885+httprGet = lens _httprGet (\ s a -> s{_httprGet = a})
5886+
5887+-- | Additional HTTP bindings for the selector. Nested bindings must not
5888+-- contain an \`additional_bindings\` field themselves (that is, the
5889+-- nesting may only be one level deep).
5890+httprAdditionalBindings :: Lens' HTTPRule [HTTPRule]
5891+httprAdditionalBindings
5892+ = lens _httprAdditionalBindings
5893+ (\ s a -> s{_httprAdditionalBindings = a})
5894+ . _Default
5895+ . _Coerce
5896+
5897+-- | Used for deleting a resource.
5898+httprDelete :: Lens' HTTPRule (Maybe Text)
5899+httprDelete
5900+ = lens _httprDelete (\ s a -> s{_httprDelete = a})
5901+
5902+-- | Used for updating a resource.
5903+httprPut :: Lens' HTTPRule (Maybe Text)
5904+httprPut = lens _httprPut (\ s a -> s{_httprPut = a})
5905+
5906+instance FromJSON HTTPRule where
5907+ parseJSON
5908+ = withObject "HTTPRule"
5909+ (\ o ->
5910+ HTTPRule' <$>
5911+ (o .:? "mediaUpload") <*> (o .:? "selector") <*>
5912+ (o .:? "post")
5913+ <*> (o .:? "mediaDownload")
5914+ <*> (o .:? "body")
5915+ <*> (o .:? "custom")
5916+ <*> (o .:? "responseBody")
5917+ <*> (o .:? "patch")
5918+ <*> (o .:? "get")
5919+ <*> (o .:? "additionalBindings" .!= mempty)
5920+ <*> (o .:? "delete")
5921+ <*> (o .:? "put"))
5922+
5923+instance ToJSON HTTPRule where
5924+ toJSON HTTPRule'{..}
5925+ = object
5926+ (catMaybes
5927+ [("mediaUpload" .=) <$> _httprMediaUpload,
5928+ ("selector" .=) <$> _httprSelector,
5929+ ("post" .=) <$> _httprPost,
5930+ ("mediaDownload" .=) <$> _httprMediaDownload,
5931+ ("body" .=) <$> _httprBody,
5932+ ("custom" .=) <$> _httprCustom,
5933+ ("responseBody" .=) <$> _httprResponseBody,
5934+ ("patch" .=) <$> _httprPatch,
5935+ ("get" .=) <$> _httprGet,
5936+ ("additionalBindings" .=) <$>
5937+ _httprAdditionalBindings,
5938+ ("delete" .=) <$> _httprDelete,
5939+ ("put" .=) <$> _httprPut])
5940+
5941+-- | The normal response of the operation in case of success. If the original
5942+-- method returns no data on success, such as \`Delete\`, the response is
5943+-- \`google.protobuf.Empty\`. If the original method is standard
5944+-- \`Get\`\/\`Create\`\/\`Update\`, the response should be the resource.
5945+-- For other methods, the response should have the type \`XxxResponse\`,
5946+-- where \`Xxx\` is the original method name. For example, if the original
5947+-- method name is \`TakeSnapshot()\`, the inferred response type is
5948+-- \`TakeSnapshotResponse\`.
5949+--
5950+-- /See:/ 'operationResponse' smart constructor.
5951+newtype OperationResponse = OperationResponse'
5952+ { _orAddtional :: HashMap Text JSONValue
5953+ } deriving (Eq,Show,Data,Typeable,Generic)
5954+
5955+-- | Creates a value of 'OperationResponse' with the minimum fields required to make a request.
5956+--
5957+-- Use one of the following lenses to modify other fields as desired:
5958+--
5959+-- * 'orAddtional'
5960+operationResponse
5961+ :: HashMap Text JSONValue -- ^ 'orAddtional'
5962+ -> OperationResponse
5963+operationResponse pOrAddtional_ =
5964+ OperationResponse'
5965+ { _orAddtional = _Coerce # pOrAddtional_
5966+ }
5967+
5968+-- | Properties of the object. Contains field \'type with type URL.
5969+orAddtional :: Lens' OperationResponse (HashMap Text JSONValue)
5970+orAddtional
5971+ = lens _orAddtional (\ s a -> s{_orAddtional = a}) .
5972+ _Coerce
5973+
5974+instance FromJSON OperationResponse where
5975+ parseJSON
5976+ = withObject "OperationResponse"
5977+ (\ o -> OperationResponse' <$> (parseJSONObject o))
5978+
5979+instance ToJSON OperationResponse where
5980+ toJSON = toJSON . _orAddtional
5981+
5982+-- | Specifies what kind of log the caller must write Increment a streamz
5983+-- counter with the specified metric and field names. Metric names should
5984+-- start with a \'\/\', generally be lowercase-only, and end in \"_count\".
5985+-- Field names should not contain an initial slash. The actual exported
5986+-- metric names will have \"\/iam\/policy\" prepended. Field names
5987+-- correspond to IAM request parameters and field values are their
5988+-- respective values. At present the only supported field names are -
5989+-- \"iam_principal\", corresponding to IAMContext.principal; - \"\" (empty
5990+-- string), resulting in one aggretated counter with no field. Examples:
5991+-- counter { metric: \"\/debug_access_count\" field: \"iam_principal\" }
5992+-- ==> increment counter \/iam\/policy\/backend_debug_access_count
5993+-- {iam_principal=[value of IAMContext.principal]} At this time we do not
5994+-- support: * multiple field names (though this may be supported in the
5995+-- future) * decrementing the counter * incrementing it by anything other
5996+-- than 1
5997+--
5998+-- /See:/ 'logConfig' smart constructor.
5999+data LogConfig = LogConfig'
6000+ { _lcCloudAudit :: !(Maybe CloudAuditOptions)
6001+ , _lcDataAccess :: !(Maybe DataAccessOptions)
6002+ , _lcCounter :: !(Maybe CounterOptions)
6003+ } deriving (Eq,Show,Data,Typeable,Generic)
6004+
6005+-- | Creates a value of 'LogConfig' with the minimum fields required to make a request.
6006+--
6007+-- Use one of the following lenses to modify other fields as desired:
6008+--
6009+-- * 'lcCloudAudit'
6010+--
6011+-- * 'lcDataAccess'
6012+--
6013+-- * 'lcCounter'
6014+logConfig
6015+ :: LogConfig
6016+logConfig =
6017+ LogConfig'
6018+ { _lcCloudAudit = Nothing
6019+ , _lcDataAccess = Nothing
6020+ , _lcCounter = Nothing
6021+ }
6022+
6023+-- | Cloud audit options.
6024+lcCloudAudit :: Lens' LogConfig (Maybe CloudAuditOptions)
6025+lcCloudAudit
6026+ = lens _lcCloudAudit (\ s a -> s{_lcCloudAudit = a})
6027+
6028+-- | Data access options.
6029+lcDataAccess :: Lens' LogConfig (Maybe DataAccessOptions)
6030+lcDataAccess
6031+ = lens _lcDataAccess (\ s a -> s{_lcDataAccess = a})
6032+
6033+-- | Counter options.
6034+lcCounter :: Lens' LogConfig (Maybe CounterOptions)
6035+lcCounter
6036+ = lens _lcCounter (\ s a -> s{_lcCounter = a})
6037+
6038+instance FromJSON LogConfig where
6039+ parseJSON
6040+ = withObject "LogConfig"
6041+ (\ o ->
6042+ LogConfig' <$>
6043+ (o .:? "cloudAudit") <*> (o .:? "dataAccess") <*>
6044+ (o .:? "counter"))
6045+
6046+instance ToJSON LogConfig where
6047+ toJSON LogConfig'{..}
6048+ = object
6049+ (catMaybes
6050+ [("cloudAudit" .=) <$> _lcCloudAudit,
6051+ ("dataAccess" .=) <$> _lcDataAccess,
6052+ ("counter" .=) <$> _lcCounter])
6053+
6054+-- | Configuration for an anthentication provider, including support for
6055+-- [JSON Web Token
6056+-- (JWT)](https:\/\/tools.ietf.org\/html\/draft-ietf-oauth-json-web-token-32).
6057+--
6058+-- /See:/ 'authProvider' smart constructor.
6059+data AuthProvider = AuthProvider'
6060+ { _apJWKsURI :: !(Maybe Text)
6061+ , _apId :: !(Maybe Text)
6062+ , _apIssuer :: !(Maybe Text)
6063+ } deriving (Eq,Show,Data,Typeable,Generic)
6064+
6065+-- | Creates a value of 'AuthProvider' with the minimum fields required to make a request.
6066+--
6067+-- Use one of the following lenses to modify other fields as desired:
6068+--
6069+-- * 'apJWKsURI'
6070+--
6071+-- * 'apId'
6072+--
6073+-- * 'apIssuer'
6074+authProvider
6075+ :: AuthProvider
6076+authProvider =
6077+ AuthProvider'
6078+ { _apJWKsURI = Nothing
6079+ , _apId = Nothing
6080+ , _apIssuer = Nothing
6081+ }
6082+
6083+-- | URL of the provider\'s public key set to validate signature of the JWT.
6084+-- See [OpenID
6085+-- Discovery](https:\/\/openid.net\/specs\/openid-connect-discovery-1_0.html#ProviderMetadata).
6086+-- Optional if the key set document: - can be retrieved from [OpenID
6087+-- Discovery](https:\/\/openid.net\/specs\/openid-connect-discovery-1_0.html
6088+-- of the issuer. - can be inferred from the email domain of the issuer
6089+-- (e.g. a Google service account). Example:
6090+-- https:\/\/www.googleapis.com\/oauth2\/v1\/certs
6091+apJWKsURI :: Lens' AuthProvider (Maybe Text)
6092+apJWKsURI
6093+ = lens _apJWKsURI (\ s a -> s{_apJWKsURI = a})
6094+
6095+-- | The unique identifier of the auth provider. It will be referred to by
6096+-- \`AuthRequirement.provider_id\`. Example: \"bookstore_auth\".
6097+apId :: Lens' AuthProvider (Maybe Text)
6098+apId = lens _apId (\ s a -> s{_apId = a})
6099+
6100+-- | Identifies the principal that issued the JWT. See
6101+-- https:\/\/tools.ietf.org\/html\/draft-ietf-oauth-json-web-token-32#section-4.1.1
6102+-- Usually a URL or an email address. Example:
6103+-- https:\/\/securetoken.google.com Example:
6104+-- 1234567-compute\'developer.gserviceaccount.com
6105+apIssuer :: Lens' AuthProvider (Maybe Text)
6106+apIssuer = lens _apIssuer (\ s a -> s{_apIssuer = a})
6107+
6108+instance FromJSON AuthProvider where
6109+ parseJSON
6110+ = withObject "AuthProvider"
6111+ (\ o ->
6112+ AuthProvider' <$>
6113+ (o .:? "jwksUri") <*> (o .:? "id") <*>
6114+ (o .:? "issuer"))
6115+
6116+instance ToJSON AuthProvider where
6117+ toJSON AuthProvider'{..}
6118+ = object
6119+ (catMaybes
6120+ [("jwksUri" .=) <$> _apJWKsURI, ("id" .=) <$> _apId,
6121+ ("issuer" .=) <$> _apIssuer])
6122+
6123+-- | Associates \`members\` with a \`role\`.
6124+--
6125+-- /See:/ 'binding' smart constructor.
6126+data Binding = Binding'
6127+ { _bMembers :: !(Maybe [Text])
6128+ , _bRole :: !(Maybe Text)
6129+ } deriving (Eq,Show,Data,Typeable,Generic)
6130+
6131+-- | Creates a value of 'Binding' with the minimum fields required to make a request.
6132+--
6133+-- Use one of the following lenses to modify other fields as desired:
6134+--
6135+-- * 'bMembers'
6136+--
6137+-- * 'bRole'
6138+binding
6139+ :: Binding
6140+binding =
6141+ Binding'
6142+ { _bMembers = Nothing
6143+ , _bRole = Nothing
6144+ }
6145+
6146+-- | Specifies the identities requesting access for a Cloud Platform
6147+-- resource. \`members\` can have the following values: * \`allUsers\`: A
6148+-- special identifier that represents anyone who is on the internet; with
6149+-- or without a Google account. * \`allAuthenticatedUsers\`: A special
6150+-- identifier that represents anyone who is authenticated with a Google
6151+-- account or a service account. * \`user:{emailid}\`: An email address
6152+-- that represents a specific Google account. For example,
6153+-- \`alice\'gmail.com\` or \`joe\'example.com\`. *
6154+-- \`serviceAccount:{emailid}\`: An email address that represents a service
6155+-- account. For example, \`my-other-app\'appspot.gserviceaccount.com\`. *
6156+-- \`group:{emailid}\`: An email address that represents a Google group.
6157+-- For example, \`admins\'example.com\`. * \`domain:{domain}\`: A Google
6158+-- Apps domain name that represents all the users of that domain. For
6159+-- example, \`google.com\` or \`example.com\`.
6160+bMembers :: Lens' Binding [Text]
6161+bMembers
6162+ = lens _bMembers (\ s a -> s{_bMembers = a}) .
6163+ _Default
6164+ . _Coerce
6165+
6166+-- | Role that is assigned to \`members\`. For example, \`roles\/viewer\`,
6167+-- \`roles\/editor\`, or \`roles\/owner\`. Required
6168+bRole :: Lens' Binding (Maybe Text)
6169+bRole = lens _bRole (\ s a -> s{_bRole = a})
6170+
6171+instance FromJSON Binding where
6172+ parseJSON
6173+ = withObject "Binding"
6174+ (\ o ->
6175+ Binding' <$>
6176+ (o .:? "members" .!= mempty) <*> (o .:? "role"))
6177+
6178+instance ToJSON Binding where
6179+ toJSON Binding'{..}
6180+ = object
6181+ (catMaybes
6182+ [("members" .=) <$> _bMembers,
6183+ ("role" .=) <$> _bRole])
6184+
6185+-- | A context rule provides information about the context for an individual
6186+-- API element.
6187+--
6188+-- /See:/ 'contextRule' smart constructor.
6189+data ContextRule = ContextRule'
6190+ { _crSelector :: !(Maybe Text)
6191+ , _crRequested :: !(Maybe [Text])
6192+ , _crProvided :: !(Maybe [Text])
6193+ } deriving (Eq,Show,Data,Typeable,Generic)
6194+
6195+-- | Creates a value of 'ContextRule' with the minimum fields required to make a request.
6196+--
6197+-- Use one of the following lenses to modify other fields as desired:
6198+--
6199+-- * 'crSelector'
6200+--
6201+-- * 'crRequested'
6202+--
6203+-- * 'crProvided'
6204+contextRule
6205+ :: ContextRule
6206+contextRule =
6207+ ContextRule'
6208+ { _crSelector = Nothing
6209+ , _crRequested = Nothing
6210+ , _crProvided = Nothing
6211+ }
6212+
6213+-- | Selects the methods to which this rule applies. Refer to selector for
6214+-- syntax details.
6215+crSelector :: Lens' ContextRule (Maybe Text)
6216+crSelector
6217+ = lens _crSelector (\ s a -> s{_crSelector = a})
6218+
6219+-- | A list of full type names of requested contexts.
6220+crRequested :: Lens' ContextRule [Text]
6221+crRequested
6222+ = lens _crRequested (\ s a -> s{_crRequested = a}) .
6223+ _Default
6224+ . _Coerce
6225+
6226+-- | A list of full type names of provided contexts.
6227+crProvided :: Lens' ContextRule [Text]
6228+crProvided
6229+ = lens _crProvided (\ s a -> s{_crProvided = a}) .
6230+ _Default
6231+ . _Coerce
6232+
6233+instance FromJSON ContextRule where
6234+ parseJSON
6235+ = withObject "ContextRule"
6236+ (\ o ->
6237+ ContextRule' <$>
6238+ (o .:? "selector") <*> (o .:? "requested" .!= mempty)
6239+ <*> (o .:? "provided" .!= mempty))
6240+
6241+instance ToJSON ContextRule where
6242+ toJSON ContextRule'{..}
6243+ = object
6244+ (catMaybes
6245+ [("selector" .=) <$> _crSelector,
6246+ ("requested" .=) <$> _crRequested,
6247+ ("provided" .=) <$> _crProvided])