@@ -0,0 +1,1145 @@
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.KnowledgeGraphSearch.Types.Product
12+-- Copyright : (c) 2015 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.KnowledgeGraphSearch.Types.Product where
19+
20+import Network.Google.KnowledgeGraphSearch.Types.Sum
21+import Network.Google.Prelude
22+
23+-- | Options for counters
24+--
25+-- /See:/ 'counterOptions' smart constructor.
26+data CounterOptions = CounterOptions
27+ { _coField :: !(Maybe Text)
28+ , _coMetric :: !(Maybe Text)
29+ } deriving (Eq,Show,Data,Typeable,Generic)
30+
31+-- | Creates a value of 'CounterOptions' with the minimum fields required to make a request.
32+--
33+-- Use one of the following lenses to modify other fields as desired:
34+--
35+-- * 'coField'
36+--
37+-- * 'coMetric'
38+counterOptions
39+ :: CounterOptions
40+counterOptions =
41+ CounterOptions
42+ { _coField = Nothing
43+ , _coMetric = Nothing
44+ }
45+
46+-- | The field value to attribute.
47+coField :: Lens' CounterOptions (Maybe Text)
48+coField = lens _coField (\ s a -> s{_coField = a})
49+
50+-- | The metric to update.
51+coMetric :: Lens' CounterOptions (Maybe Text)
52+coMetric = lens _coMetric (\ s a -> s{_coMetric = a})
53+
54+instance FromJSON CounterOptions where
55+ parseJSON
56+ = withObject "CounterOptions"
57+ (\ o ->
58+ CounterOptions <$>
59+ (o .:? "field") <*> (o .:? "metric"))
60+
61+instance ToJSON CounterOptions where
62+ toJSON CounterOptions{..}
63+ = object
64+ (catMaybes
65+ [("field" .=) <$> _coField,
66+ ("metric" .=) <$> _coMetric])
67+
68+-- | A generic empty message that you can re-use to avoid defining duplicated
69+-- empty messages in your APIs. A typical example is to use it as the
70+-- request or the response type of an API method. For instance: service Foo
71+-- { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The
72+-- JSON representation for \`Empty\` is empty JSON object \`{}\`.
73+--
74+-- /See:/ 'empty' smart constructor.
75+data Empty =
76+ Empty
77+ deriving (Eq,Show,Data,Typeable,Generic)
78+
79+-- | Creates a value of 'Empty' with the minimum fields required to make a request.
80+--
81+empty
82+ :: Empty
83+empty = Empty
84+
85+instance FromJSON Empty where
86+ parseJSON = withObject "Empty" (\ o -> pure Empty)
87+
88+instance ToJSON Empty where
89+ toJSON = const emptyObject
90+
91+-- | Represents a service account key. A service account can have 0 or more
92+-- key pairs. The private keys for these are not stored by Google.
93+-- ServiceAccountKeys are immutable.
94+--
95+-- /See:/ 'serviceAccountKey' smart constructor.
96+data ServiceAccountKey = ServiceAccountKey
97+ { _sakValidAfterTime :: !(Maybe Text)
98+ , _sakPrivateKeyData :: !(Maybe (Textual Word8))
99+ , _sakName :: !(Maybe Text)
100+ , _sakPrivateKeyType :: !(Maybe Text)
101+ , _sakValidBeforeTime :: !(Maybe Text)
102+ } deriving (Eq,Show,Data,Typeable,Generic)
103+
104+-- | Creates a value of 'ServiceAccountKey' with the minimum fields required to make a request.
105+--
106+-- Use one of the following lenses to modify other fields as desired:
107+--
108+-- * 'sakValidAfterTime'
109+--
110+-- * 'sakPrivateKeyData'
111+--
112+-- * 'sakName'
113+--
114+-- * 'sakPrivateKeyType'
115+--
116+-- * 'sakValidBeforeTime'
117+serviceAccountKey
118+ :: ServiceAccountKey
119+serviceAccountKey =
120+ ServiceAccountKey
121+ { _sakValidAfterTime = Nothing
122+ , _sakPrivateKeyData = Nothing
123+ , _sakName = Nothing
124+ , _sakPrivateKeyType = Nothing
125+ , _sakValidBeforeTime = Nothing
126+ }
127+
128+-- | The key can be used after this timestamp.
129+sakValidAfterTime :: Lens' ServiceAccountKey (Maybe Text)
130+sakValidAfterTime
131+ = lens _sakValidAfterTime
132+ (\ s a -> s{_sakValidAfterTime = a})
133+
134+-- | The key data.
135+sakPrivateKeyData :: Lens' ServiceAccountKey (Maybe Word8)
136+sakPrivateKeyData
137+ = lens _sakPrivateKeyData
138+ (\ s a -> s{_sakPrivateKeyData = a})
139+ . mapping _Coerce
140+
141+-- | The resource name of the service account key in the format
142+-- \"projects\/{project}\/serviceAccounts\/{email}\/keys\/{key}\".
143+sakName :: Lens' ServiceAccountKey (Maybe Text)
144+sakName = lens _sakName (\ s a -> s{_sakName = a})
145+
146+-- | The type of the private key.
147+sakPrivateKeyType :: Lens' ServiceAccountKey (Maybe Text)
148+sakPrivateKeyType
149+ = lens _sakPrivateKeyType
150+ (\ s a -> s{_sakPrivateKeyType = a})
151+
152+-- | The key can be used before this timestamp.
153+sakValidBeforeTime :: Lens' ServiceAccountKey (Maybe Text)
154+sakValidBeforeTime
155+ = lens _sakValidBeforeTime
156+ (\ s a -> s{_sakValidBeforeTime = a})
157+
158+instance FromJSON ServiceAccountKey where
159+ parseJSON
160+ = withObject "ServiceAccountKey"
161+ (\ o ->
162+ ServiceAccountKey <$>
163+ (o .:? "validAfterTime") <*> (o .:? "privateKeyData")
164+ <*> (o .:? "name")
165+ <*> (o .:? "privateKeyType")
166+ <*> (o .:? "validBeforeTime"))
167+
168+instance ToJSON ServiceAccountKey where
169+ toJSON ServiceAccountKey{..}
170+ = object
171+ (catMaybes
172+ [("validAfterTime" .=) <$> _sakValidAfterTime,
173+ ("privateKeyData" .=) <$> _sakPrivateKeyData,
174+ ("name" .=) <$> _sakName,
175+ ("privateKeyType" .=) <$> _sakPrivateKeyType,
176+ ("validBeforeTime" .=) <$> _sakValidBeforeTime])
177+
178+-- | A rule to be applied in a Policy.
179+--
180+-- /See:/ 'rule' smart constructor.
181+data Rule = Rule
182+ { _rAction :: !(Maybe Text)
183+ , _rIn :: !(Maybe [Text])
184+ , _rNotIn :: !(Maybe [Text])
185+ , _rConditions :: !(Maybe [Condition])
186+ , _rPermissions :: !(Maybe [Text])
187+ , _rLogConfig :: !(Maybe [LogConfig])
188+ , _rDescription :: !(Maybe Text)
189+ } deriving (Eq,Show,Data,Typeable,Generic)
190+
191+-- | Creates a value of 'Rule' with the minimum fields required to make a request.
192+--
193+-- Use one of the following lenses to modify other fields as desired:
194+--
195+-- * 'rAction'
196+--
197+-- * 'rIn'
198+--
199+-- * 'rNotIn'
200+--
201+-- * 'rConditions'
202+--
203+-- * 'rPermissions'
204+--
205+-- * 'rLogConfig'
206+--
207+-- * 'rDescription'
208+rule
209+ :: Rule
210+rule =
211+ Rule
212+ { _rAction = Nothing
213+ , _rIn = Nothing
214+ , _rNotIn = Nothing
215+ , _rConditions = Nothing
216+ , _rPermissions = Nothing
217+ , _rLogConfig = Nothing
218+ , _rDescription = Nothing
219+ }
220+
221+-- | Required
222+rAction :: Lens' Rule (Maybe Text)
223+rAction = lens _rAction (\ s a -> s{_rAction = a})
224+
225+-- | The rule matches if the PRINCIPAL\/AUTHORITY_SELECTOR is in this set of
226+-- entries.
227+rIn :: Lens' Rule [Text]
228+rIn
229+ = lens _rIn (\ s a -> s{_rIn = a}) . _Default .
230+ _Coerce
231+
232+-- | The rule matches if the PRINCIPAL\/AUTHORITY_SELECTOR is not in this set
233+-- of entries. The format for in and not_in entries is the same as for
234+-- members in a Binding (see google\/iam\/v1\/policy.proto).
235+rNotIn :: Lens' Rule [Text]
236+rNotIn
237+ = lens _rNotIn (\ s a -> s{_rNotIn = a}) . _Default .
238+ _Coerce
239+
240+-- | Additional restrictions that must be met
241+rConditions :: Lens' Rule [Condition]
242+rConditions
243+ = lens _rConditions (\ s a -> s{_rConditions = a}) .
244+ _Default
245+ . _Coerce
246+
247+-- | A permission is a string of form \'..\' (e.g.,
248+-- \'storage.buckets.list\'). A value of \'*\' matches all permissions, and
249+-- a verb part of \'*\' (e.g., \'storage.buckets.*\') matches all verbs.
250+rPermissions :: Lens' Rule [Text]
251+rPermissions
252+ = lens _rPermissions (\ s a -> s{_rPermissions = a})
253+ . _Default
254+ . _Coerce
255+
256+-- | The config returned to callers of tech.iam.IAM.CheckPolicy for any
257+-- entries that match the LOG action.
258+rLogConfig :: Lens' Rule [LogConfig]
259+rLogConfig
260+ = lens _rLogConfig (\ s a -> s{_rLogConfig = a}) .
261+ _Default
262+ . _Coerce
263+
264+-- | Human-readable description of the rule.
265+rDescription :: Lens' Rule (Maybe Text)
266+rDescription
267+ = lens _rDescription (\ s a -> s{_rDescription = a})
268+
269+instance FromJSON Rule where
270+ parseJSON
271+ = withObject "Rule"
272+ (\ o ->
273+ Rule <$>
274+ (o .:? "action") <*> (o .:? "in" .!= mempty) <*>
275+ (o .:? "notIn" .!= mempty)
276+ <*> (o .:? "conditions" .!= mempty)
277+ <*> (o .:? "permissions" .!= mempty)
278+ <*> (o .:? "logConfig" .!= mempty)
279+ <*> (o .:? "description"))
280+
281+instance ToJSON Rule where
282+ toJSON Rule{..}
283+ = object
284+ (catMaybes
285+ [("action" .=) <$> _rAction, ("in" .=) <$> _rIn,
286+ ("notIn" .=) <$> _rNotIn,
287+ ("conditions" .=) <$> _rConditions,
288+ ("permissions" .=) <$> _rPermissions,
289+ ("logConfig" .=) <$> _rLogConfig,
290+ ("description" .=) <$> _rDescription])
291+
292+-- | The service account key create request.
293+--
294+-- /See:/ 'createServiceAccountKeyRequest' smart constructor.
295+newtype CreateServiceAccountKeyRequest = CreateServiceAccountKeyRequest
296+ { _csakrPrivateKeyType :: Maybe Text
297+ } deriving (Eq,Show,Data,Typeable,Generic)
298+
299+-- | Creates a value of 'CreateServiceAccountKeyRequest' with the minimum fields required to make a request.
300+--
301+-- Use one of the following lenses to modify other fields as desired:
302+--
303+-- * 'csakrPrivateKeyType'
304+createServiceAccountKeyRequest
305+ :: CreateServiceAccountKeyRequest
306+createServiceAccountKeyRequest =
307+ CreateServiceAccountKeyRequest
308+ { _csakrPrivateKeyType = Nothing
309+ }
310+
311+-- | The type of the key requested. GOOGLE_CREDENTIALS is the default key
312+-- type.
313+csakrPrivateKeyType :: Lens' CreateServiceAccountKeyRequest (Maybe Text)
314+csakrPrivateKeyType
315+ = lens _csakrPrivateKeyType
316+ (\ s a -> s{_csakrPrivateKeyType = a})
317+
318+instance FromJSON CreateServiceAccountKeyRequest
319+ where
320+ parseJSON
321+ = withObject "CreateServiceAccountKeyRequest"
322+ (\ o ->
323+ CreateServiceAccountKeyRequest <$>
324+ (o .:? "privateKeyType"))
325+
326+instance ToJSON CreateServiceAccountKeyRequest where
327+ toJSON CreateServiceAccountKeyRequest{..}
328+ = object
329+ (catMaybes
330+ [("privateKeyType" .=) <$> _csakrPrivateKeyType])
331+
332+-- | Request message for \`SetIamPolicy\` method.
333+--
334+-- /See:/ 'setIAMPolicyRequest' smart constructor.
335+newtype SetIAMPolicyRequest = SetIAMPolicyRequest
336+ { _siprPolicy :: Maybe Policy
337+ } deriving (Eq,Show,Data,Typeable,Generic)
338+
339+-- | Creates a value of 'SetIAMPolicyRequest' with the minimum fields required to make a request.
340+--
341+-- Use one of the following lenses to modify other fields as desired:
342+--
343+-- * 'siprPolicy'
344+setIAMPolicyRequest
345+ :: SetIAMPolicyRequest
346+setIAMPolicyRequest =
347+ SetIAMPolicyRequest
348+ { _siprPolicy = Nothing
349+ }
350+
351+-- | REQUIRED: The complete policy to be applied to the \`resource\`. The
352+-- size of the policy is limited to a few 10s of KB. An empty policy is a
353+-- valid policy but certain Cloud Platform services (such as Projects)
354+-- might reject them.
355+siprPolicy :: Lens' SetIAMPolicyRequest (Maybe Policy)
356+siprPolicy
357+ = lens _siprPolicy (\ s a -> s{_siprPolicy = a})
358+
359+instance FromJSON SetIAMPolicyRequest where
360+ parseJSON
361+ = withObject "SetIAMPolicyRequest"
362+ (\ o -> SetIAMPolicyRequest <$> (o .:? "policy"))
363+
364+instance ToJSON SetIAMPolicyRequest where
365+ toJSON SetIAMPolicyRequest{..}
366+ = object (catMaybes [("policy" .=) <$> _siprPolicy])
367+
368+-- | The service account sign blob request.
369+--
370+-- /See:/ 'signBlobRequest' smart constructor.
371+newtype SignBlobRequest = SignBlobRequest
372+ { _sbrBytesToSign :: Maybe (Textual Word8)
373+ } deriving (Eq,Show,Data,Typeable,Generic)
374+
375+-- | Creates a value of 'SignBlobRequest' with the minimum fields required to make a request.
376+--
377+-- Use one of the following lenses to modify other fields as desired:
378+--
379+-- * 'sbrBytesToSign'
380+signBlobRequest
381+ :: SignBlobRequest
382+signBlobRequest =
383+ SignBlobRequest
384+ { _sbrBytesToSign = Nothing
385+ }
386+
387+-- | The bytes to sign
388+sbrBytesToSign :: Lens' SignBlobRequest (Maybe Word8)
389+sbrBytesToSign
390+ = lens _sbrBytesToSign
391+ (\ s a -> s{_sbrBytesToSign = a})
392+ . mapping _Coerce
393+
394+instance FromJSON SignBlobRequest where
395+ parseJSON
396+ = withObject "SignBlobRequest"
397+ (\ o -> SignBlobRequest <$> (o .:? "bytesToSign"))
398+
399+instance ToJSON SignBlobRequest where
400+ toJSON SignBlobRequest{..}
401+ = object
402+ (catMaybes [("bytesToSign" .=) <$> _sbrBytesToSign])
403+
404+-- | The service account keys list response.
405+--
406+-- /See:/ 'listServiceAccountKeysResponse' smart constructor.
407+newtype ListServiceAccountKeysResponse = ListServiceAccountKeysResponse
408+ { _lsakrKeys :: Maybe [ServiceAccountKey]
409+ } deriving (Eq,Show,Data,Typeable,Generic)
410+
411+-- | Creates a value of 'ListServiceAccountKeysResponse' with the minimum fields required to make a request.
412+--
413+-- Use one of the following lenses to modify other fields as desired:
414+--
415+-- * 'lsakrKeys'
416+listServiceAccountKeysResponse
417+ :: ListServiceAccountKeysResponse
418+listServiceAccountKeysResponse =
419+ ListServiceAccountKeysResponse
420+ { _lsakrKeys = Nothing
421+ }
422+
423+-- | The public keys for the service account.
424+lsakrKeys :: Lens' ListServiceAccountKeysResponse [ServiceAccountKey]
425+lsakrKeys
426+ = lens _lsakrKeys (\ s a -> s{_lsakrKeys = a}) .
427+ _Default
428+ . _Coerce
429+
430+instance FromJSON ListServiceAccountKeysResponse
431+ where
432+ parseJSON
433+ = withObject "ListServiceAccountKeysResponse"
434+ (\ o ->
435+ ListServiceAccountKeysResponse <$>
436+ (o .:? "keys" .!= mempty))
437+
438+instance ToJSON ListServiceAccountKeysResponse where
439+ toJSON ListServiceAccountKeysResponse{..}
440+ = object (catMaybes [("keys" .=) <$> _lsakrKeys])
441+
442+-- | Write a Cloud Audit log
443+--
444+-- /See:/ 'cloudAuditOptions' smart constructor.
445+data CloudAuditOptions =
446+ CloudAuditOptions
447+ deriving (Eq,Show,Data,Typeable,Generic)
448+
449+-- | Creates a value of 'CloudAuditOptions' with the minimum fields required to make a request.
450+--
451+cloudAuditOptions
452+ :: CloudAuditOptions
453+cloudAuditOptions = CloudAuditOptions
454+
455+instance FromJSON CloudAuditOptions where
456+ parseJSON
457+ = withObject "CloudAuditOptions"
458+ (\ o -> pure CloudAuditOptions)
459+
460+instance ToJSON CloudAuditOptions where
461+ toJSON = const emptyObject
462+
463+-- | Write a Data Access (Gin) log
464+--
465+-- /See:/ 'dataAccessOptions' smart constructor.
466+data DataAccessOptions =
467+ DataAccessOptions
468+ deriving (Eq,Show,Data,Typeable,Generic)
469+
470+-- | Creates a value of 'DataAccessOptions' with the minimum fields required to make a request.
471+--
472+dataAccessOptions
473+ :: DataAccessOptions
474+dataAccessOptions = DataAccessOptions
475+
476+instance FromJSON DataAccessOptions where
477+ parseJSON
478+ = withObject "DataAccessOptions"
479+ (\ o -> pure DataAccessOptions)
480+
481+instance ToJSON DataAccessOptions where
482+ toJSON = const emptyObject
483+
484+-- | A service account in the Identity and Access Management API. To create a
485+-- service account, you specify the project_id and account_id for the
486+-- account. The account_id is unique within the project, and used to
487+-- generate the service account email address and a stable unique id. All
488+-- other methods can identify accounts using the format
489+-- \"projects\/{project}\/serviceAccounts\/{account}\". Using \'-\' as a
490+-- wildcard for the project, will infer the project from the account. The
491+-- account value can be the email address or the unique_id of the service
492+-- account.
493+--
494+-- /See:/ 'serviceAccount' smart constructor.
495+data ServiceAccount = ServiceAccount
496+ { _saEmail :: !(Maybe Text)
497+ , _saEtag :: !(Maybe (Textual Word8))
498+ , _saUniqueId :: !(Maybe Text)
499+ , _saName :: !(Maybe Text)
500+ , _saDisplayName :: !(Maybe Text)
501+ , _saProjectId :: !(Maybe Text)
502+ , _saOAuth2ClientId :: !(Maybe Text)
503+ } deriving (Eq,Show,Data,Typeable,Generic)
504+
505+-- | Creates a value of 'ServiceAccount' with the minimum fields required to make a request.
506+--
507+-- Use one of the following lenses to modify other fields as desired:
508+--
509+-- * 'saEmail'
510+--
511+-- * 'saEtag'
512+--
513+-- * 'saUniqueId'
514+--
515+-- * 'saName'
516+--
517+-- * 'saDisplayName'
518+--
519+-- * 'saProjectId'
520+--
521+-- * 'saOAuth2ClientId'
522+serviceAccount
523+ :: ServiceAccount
524+serviceAccount =
525+ ServiceAccount
526+ { _saEmail = Nothing
527+ , _saEtag = Nothing
528+ , _saUniqueId = Nothing
529+ , _saName = Nothing
530+ , _saDisplayName = Nothing
531+ , _saProjectId = Nothing
532+ , _saOAuth2ClientId = Nothing
533+ }
534+
535+-- | \'OutputOnly Email address of the service account.
536+saEmail :: Lens' ServiceAccount (Maybe Text)
537+saEmail = lens _saEmail (\ s a -> s{_saEmail = a})
538+
539+-- | Used to perform a consistent read-modify-write.
540+saEtag :: Lens' ServiceAccount (Maybe Word8)
541+saEtag
542+ = lens _saEtag (\ s a -> s{_saEtag = a}) .
543+ mapping _Coerce
544+
545+-- | \'OutputOnly unique and stable id of the service account.
546+saUniqueId :: Lens' ServiceAccount (Maybe Text)
547+saUniqueId
548+ = lens _saUniqueId (\ s a -> s{_saUniqueId = a})
549+
550+-- | The resource name of the service account in the format
551+-- \"projects\/{project}\/serviceAccounts\/{account}\". In requests using
552+-- \'-\' as a wildcard for the project, will infer the project from the
553+-- account and the account value can be the email address or the unique_id
554+-- of the service account. In responses the resource name will always be in
555+-- the format \"projects\/{project}\/serviceAccounts\/{email}\".
556+saName :: Lens' ServiceAccount (Maybe Text)
557+saName = lens _saName (\ s a -> s{_saName = a})
558+
559+-- | Optional. A user-specified description of the service account. Must be
560+-- fewer than 100 UTF-8 bytes.
561+saDisplayName :: Lens' ServiceAccount (Maybe Text)
562+saDisplayName
563+ = lens _saDisplayName
564+ (\ s a -> s{_saDisplayName = a})
565+
566+-- | \'OutputOnly The id of the project that owns the service account.
567+saProjectId :: Lens' ServiceAccount (Maybe Text)
568+saProjectId
569+ = lens _saProjectId (\ s a -> s{_saProjectId = a})
570+
571+-- | \'OutputOnly. The OAuth2 client id for the service account. This is used
572+-- in conjunction with the OAuth2 clientconfig API to make three legged
573+-- OAuth2 (3LO) flows to access the data of Google users.
574+saOAuth2ClientId :: Lens' ServiceAccount (Maybe Text)
575+saOAuth2ClientId
576+ = lens _saOAuth2ClientId
577+ (\ s a -> s{_saOAuth2ClientId = a})
578+
579+instance FromJSON ServiceAccount where
580+ parseJSON
581+ = withObject "ServiceAccount"
582+ (\ o ->
583+ ServiceAccount <$>
584+ (o .:? "email") <*> (o .:? "etag") <*>
585+ (o .:? "uniqueId")
586+ <*> (o .:? "name")
587+ <*> (o .:? "displayName")
588+ <*> (o .:? "projectId")
589+ <*> (o .:? "oauth2ClientId"))
590+
591+instance ToJSON ServiceAccount where
592+ toJSON ServiceAccount{..}
593+ = object
594+ (catMaybes
595+ [("email" .=) <$> _saEmail, ("etag" .=) <$> _saEtag,
596+ ("uniqueId" .=) <$> _saUniqueId,
597+ ("name" .=) <$> _saName,
598+ ("displayName" .=) <$> _saDisplayName,
599+ ("projectId" .=) <$> _saProjectId,
600+ ("oauth2ClientId" .=) <$> _saOAuth2ClientId])
601+
602+-- | Request message for \`TestIamPermissions\` method.
603+--
604+-- /See:/ 'testIAMPermissionsRequest' smart constructor.
605+newtype TestIAMPermissionsRequest = TestIAMPermissionsRequest
606+ { _tiprPermissions :: Maybe [Text]
607+ } deriving (Eq,Show,Data,Typeable,Generic)
608+
609+-- | Creates a value of 'TestIAMPermissionsRequest' with the minimum fields required to make a request.
610+--
611+-- Use one of the following lenses to modify other fields as desired:
612+--
613+-- * 'tiprPermissions'
614+testIAMPermissionsRequest
615+ :: TestIAMPermissionsRequest
616+testIAMPermissionsRequest =
617+ TestIAMPermissionsRequest
618+ { _tiprPermissions = Nothing
619+ }
620+
621+-- | The set of permissions to check for the \`resource\`. Permissions with
622+-- wildcards (such as \'*\' or \'storage.*\') are not allowed. For more
623+-- information see IAM Overview.
624+tiprPermissions :: Lens' TestIAMPermissionsRequest [Text]
625+tiprPermissions
626+ = lens _tiprPermissions
627+ (\ s a -> s{_tiprPermissions = a})
628+ . _Default
629+ . _Coerce
630+
631+instance FromJSON TestIAMPermissionsRequest where
632+ parseJSON
633+ = withObject "TestIAMPermissionsRequest"
634+ (\ o ->
635+ TestIAMPermissionsRequest <$>
636+ (o .:? "permissions" .!= mempty))
637+
638+instance ToJSON TestIAMPermissionsRequest where
639+ toJSON TestIAMPermissionsRequest{..}
640+ = object
641+ (catMaybes [("permissions" .=) <$> _tiprPermissions])
642+
643+-- | Response message for \`TestIamPermissions\` method.
644+--
645+-- /See:/ 'testIAMPermissionsResponse' smart constructor.
646+newtype TestIAMPermissionsResponse = TestIAMPermissionsResponse
647+ { _tiamprPermissions :: Maybe [Text]
648+ } deriving (Eq,Show,Data,Typeable,Generic)
649+
650+-- | Creates a value of 'TestIAMPermissionsResponse' with the minimum fields required to make a request.
651+--
652+-- Use one of the following lenses to modify other fields as desired:
653+--
654+-- * 'tiamprPermissions'
655+testIAMPermissionsResponse
656+ :: TestIAMPermissionsResponse
657+testIAMPermissionsResponse =
658+ TestIAMPermissionsResponse
659+ { _tiamprPermissions = Nothing
660+ }
661+
662+-- | A subset of \`TestPermissionsRequest.permissions\` that the caller is
663+-- allowed.
664+tiamprPermissions :: Lens' TestIAMPermissionsResponse [Text]
665+tiamprPermissions
666+ = lens _tiamprPermissions
667+ (\ s a -> s{_tiamprPermissions = a})
668+ . _Default
669+ . _Coerce
670+
671+instance FromJSON TestIAMPermissionsResponse where
672+ parseJSON
673+ = withObject "TestIAMPermissionsResponse"
674+ (\ o ->
675+ TestIAMPermissionsResponse <$>
676+ (o .:? "permissions" .!= mempty))
677+
678+instance ToJSON TestIAMPermissionsResponse where
679+ toJSON TestIAMPermissionsResponse{..}
680+ = object
681+ (catMaybes
682+ [("permissions" .=) <$> _tiamprPermissions])
683+
684+-- | Defines an Identity and Access Management (IAM) policy. It is used to
685+-- specify access control policies for Cloud Platform resources. A
686+-- \`Policy\` consists of a list of \`bindings\`. A \`Binding\` binds a
687+-- list of \`members\` to a \`role\`, where the members can be user
688+-- accounts, Google groups, Google domains, and service accounts. A
689+-- \`role\` is a named list of permissions defined by IAM. **Example** {
690+-- \"bindings\": [ { \"role\": \"roles\/owner\", \"members\": [
691+-- \"user:mike\'example.com\", \"group:admins\'example.com\",
692+-- \"domain:google.com\",
693+-- \"serviceAccount:my-other-app\'appspot.gserviceaccount.com\"] }, {
694+-- \"role\": \"roles\/viewer\", \"members\": [\"user:sean\'example.com\"] }
695+-- ] } For a description of IAM and its features, see the [IAM developer\'s
696+-- guide](https:\/\/cloud.google.com\/iam).
697+--
698+-- /See:/ 'policy' smart constructor.
699+data Policy = Policy
700+ { _pEtag :: !(Maybe (Textual Word8))
701+ , _pRules :: !(Maybe [Rule])
702+ , _pVersion :: !(Maybe (Textual Int32))
703+ , _pBindings :: !(Maybe [Binding])
704+ } deriving (Eq,Show,Data,Typeable,Generic)
705+
706+-- | Creates a value of 'Policy' with the minimum fields required to make a request.
707+--
708+-- Use one of the following lenses to modify other fields as desired:
709+--
710+-- * 'pEtag'
711+--
712+-- * 'pRules'
713+--
714+-- * 'pVersion'
715+--
716+-- * 'pBindings'
717+policy
718+ :: Policy
719+policy =
720+ Policy
721+ { _pEtag = Nothing
722+ , _pRules = Nothing
723+ , _pVersion = Nothing
724+ , _pBindings = Nothing
725+ }
726+
727+-- | \`etag\` is used for optimistic concurrency control as a way to help
728+-- prevent simultaneous updates of a policy from overwriting each other. It
729+-- is strongly suggested that systems make use of the \`etag\` in the
730+-- read-modify-write cycle to perform policy updates in order to avoid race
731+-- conditions: An \`etag\` is returned in the response to \`getIamPolicy\`,
732+-- and systems are expected to put that etag in the request to
733+-- \`setIamPolicy\` to ensure that their change will be applied to the same
734+-- version of the policy. If no \`etag\` is provided in the call to
735+-- \`setIamPolicy\`, then the existing policy is overwritten blindly.
736+pEtag :: Lens' Policy (Maybe Word8)
737+pEtag
738+ = lens _pEtag (\ s a -> s{_pEtag = a}) .
739+ mapping _Coerce
740+
741+pRules :: Lens' Policy [Rule]
742+pRules
743+ = lens _pRules (\ s a -> s{_pRules = a}) . _Default .
744+ _Coerce
745+
746+-- | Version of the \`Policy\`. The default version is 0.
747+pVersion :: Lens' Policy (Maybe Int32)
748+pVersion
749+ = lens _pVersion (\ s a -> s{_pVersion = a}) .
750+ mapping _Coerce
751+
752+-- | Associates a list of \`members\` to a \`role\`. Multiple \`bindings\`
753+-- must not be specified for the same \`role\`. \`bindings\` with no
754+-- members will result in an error.
755+pBindings :: Lens' Policy [Binding]
756+pBindings
757+ = lens _pBindings (\ s a -> s{_pBindings = a}) .
758+ _Default
759+ . _Coerce
760+
761+instance FromJSON Policy where
762+ parseJSON
763+ = withObject "Policy"
764+ (\ o ->
765+ Policy <$>
766+ (o .:? "etag") <*> (o .:? "rules" .!= mempty) <*>
767+ (o .:? "version")
768+ <*> (o .:? "bindings" .!= mempty))
769+
770+instance ToJSON Policy where
771+ toJSON Policy{..}
772+ = object
773+ (catMaybes
774+ [("etag" .=) <$> _pEtag, ("rules" .=) <$> _pRules,
775+ ("version" .=) <$> _pVersion,
776+ ("bindings" .=) <$> _pBindings])
777+
778+-- | A condition to be met.
779+--
780+-- /See:/ 'condition' smart constructor.
781+data Condition = Condition
782+ { _cOp :: !(Maybe Text)
783+ , _cIAM :: !(Maybe Text)
784+ , _cValues :: !(Maybe [Text])
785+ , _cValue :: !(Maybe Text)
786+ , _cSys :: !(Maybe Text)
787+ , _cSvc :: !(Maybe Text)
788+ } deriving (Eq,Show,Data,Typeable,Generic)
789+
790+-- | Creates a value of 'Condition' with the minimum fields required to make a request.
791+--
792+-- Use one of the following lenses to modify other fields as desired:
793+--
794+-- * 'cOp'
795+--
796+-- * 'cIAM'
797+--
798+-- * 'cValues'
799+--
800+-- * 'cValue'
801+--
802+-- * 'cSys'
803+--
804+-- * 'cSvc'
805+condition
806+ :: Condition
807+condition =
808+ Condition
809+ { _cOp = Nothing
810+ , _cIAM = Nothing
811+ , _cValues = Nothing
812+ , _cValue = Nothing
813+ , _cSys = Nothing
814+ , _cSvc = Nothing
815+ }
816+
817+-- | An operator to apply the subject with.
818+cOp :: Lens' Condition (Maybe Text)
819+cOp = lens _cOp (\ s a -> s{_cOp = a})
820+
821+-- | Trusted attributes supplied by the IAM system.
822+cIAM :: Lens' Condition (Maybe Text)
823+cIAM = lens _cIAM (\ s a -> s{_cIAM = a})
824+
825+-- | The objects of the condition. This is mutually exclusive with \'value\'.
826+cValues :: Lens' Condition [Text]
827+cValues
828+ = lens _cValues (\ s a -> s{_cValues = a}) . _Default
829+ . _Coerce
830+
831+-- | The object of the condition. Exactly one of these must be set.
832+cValue :: Lens' Condition (Maybe Text)
833+cValue = lens _cValue (\ s a -> s{_cValue = a})
834+
835+-- | Trusted attributes supplied by any service that owns resources and uses
836+-- the IAM system for access control.
837+cSys :: Lens' Condition (Maybe Text)
838+cSys = lens _cSys (\ s a -> s{_cSys = a})
839+
840+-- | Trusted attributes discharged by the service.
841+cSvc :: Lens' Condition (Maybe Text)
842+cSvc = lens _cSvc (\ s a -> s{_cSvc = a})
843+
844+instance FromJSON Condition where
845+ parseJSON
846+ = withObject "Condition"
847+ (\ o ->
848+ Condition <$>
849+ (o .:? "op") <*> (o .:? "iam") <*>
850+ (o .:? "values" .!= mempty)
851+ <*> (o .:? "value")
852+ <*> (o .:? "sys")
853+ <*> (o .:? "svc"))
854+
855+instance ToJSON Condition where
856+ toJSON Condition{..}
857+ = object
858+ (catMaybes
859+ [("op" .=) <$> _cOp, ("iam" .=) <$> _cIAM,
860+ ("values" .=) <$> _cValues, ("value" .=) <$> _cValue,
861+ ("sys" .=) <$> _cSys, ("svc" .=) <$> _cSvc])
862+
863+-- | The service account sign blob response.
864+--
865+-- /See:/ 'signBlobResponse' smart constructor.
866+data SignBlobResponse = SignBlobResponse
867+ { _sbrSignature :: !(Maybe (Textual Word8))
868+ , _sbrKeyId :: !(Maybe Text)
869+ } deriving (Eq,Show,Data,Typeable,Generic)
870+
871+-- | Creates a value of 'SignBlobResponse' with the minimum fields required to make a request.
872+--
873+-- Use one of the following lenses to modify other fields as desired:
874+--
875+-- * 'sbrSignature'
876+--
877+-- * 'sbrKeyId'
878+signBlobResponse
879+ :: SignBlobResponse
880+signBlobResponse =
881+ SignBlobResponse
882+ { _sbrSignature = Nothing
883+ , _sbrKeyId = Nothing
884+ }
885+
886+-- | The signed blob.
887+sbrSignature :: Lens' SignBlobResponse (Maybe Word8)
888+sbrSignature
889+ = lens _sbrSignature (\ s a -> s{_sbrSignature = a})
890+ . mapping _Coerce
891+
892+-- | The id of the key used to sign the blob.
893+sbrKeyId :: Lens' SignBlobResponse (Maybe Text)
894+sbrKeyId = lens _sbrKeyId (\ s a -> s{_sbrKeyId = a})
895+
896+instance FromJSON SignBlobResponse where
897+ parseJSON
898+ = withObject "SignBlobResponse"
899+ (\ o ->
900+ SignBlobResponse <$>
901+ (o .:? "signature") <*> (o .:? "keyId"))
902+
903+instance ToJSON SignBlobResponse where
904+ toJSON SignBlobResponse{..}
905+ = object
906+ (catMaybes
907+ [("signature" .=) <$> _sbrSignature,
908+ ("keyId" .=) <$> _sbrKeyId])
909+
910+-- | The service account list response.
911+--
912+-- /See:/ 'listServiceAccountsResponse' smart constructor.
913+data ListServiceAccountsResponse = ListServiceAccountsResponse
914+ { _lsarNextPageToken :: !(Maybe Text)
915+ , _lsarAccounts :: !(Maybe [ServiceAccount])
916+ } deriving (Eq,Show,Data,Typeable,Generic)
917+
918+-- | Creates a value of 'ListServiceAccountsResponse' with the minimum fields required to make a request.
919+--
920+-- Use one of the following lenses to modify other fields as desired:
921+--
922+-- * 'lsarNextPageToken'
923+--
924+-- * 'lsarAccounts'
925+listServiceAccountsResponse
926+ :: ListServiceAccountsResponse
927+listServiceAccountsResponse =
928+ ListServiceAccountsResponse
929+ { _lsarNextPageToken = Nothing
930+ , _lsarAccounts = Nothing
931+ }
932+
933+-- | To retrieve the next page of results, set
934+-- [ListServiceAccountsRequest.page_token] to this value.
935+lsarNextPageToken :: Lens' ListServiceAccountsResponse (Maybe Text)
936+lsarNextPageToken
937+ = lens _lsarNextPageToken
938+ (\ s a -> s{_lsarNextPageToken = a})
939+
940+-- | The list of matching service accounts.
941+lsarAccounts :: Lens' ListServiceAccountsResponse [ServiceAccount]
942+lsarAccounts
943+ = lens _lsarAccounts (\ s a -> s{_lsarAccounts = a})
944+ . _Default
945+ . _Coerce
946+
947+instance FromJSON ListServiceAccountsResponse where
948+ parseJSON
949+ = withObject "ListServiceAccountsResponse"
950+ (\ o ->
951+ ListServiceAccountsResponse <$>
952+ (o .:? "nextPageToken") <*>
953+ (o .:? "accounts" .!= mempty))
954+
955+instance ToJSON ListServiceAccountsResponse where
956+ toJSON ListServiceAccountsResponse{..}
957+ = object
958+ (catMaybes
959+ [("nextPageToken" .=) <$> _lsarNextPageToken,
960+ ("accounts" .=) <$> _lsarAccounts])
961+
962+-- | Specifies what kind of log the caller must write Increment a streamz
963+-- counter with the specified metric and field names. Metric names should
964+-- start with a \'\/\', generally be lowercase-only, and end in \"_count\".
965+-- Field names should not contain an initial slash. The actual exported
966+-- metric names will have \"\/iam\/policy\" prepended. Field names
967+-- correspond to IAM request parameters and field values are their
968+-- respective values. At present only \"iam_principal\", corresponding to
969+-- IAMContext.principal, is supported. Examples: counter { metric:
970+-- \"\/debug_access_count\" field: \"iam_principal\" } ==> increment
971+-- counter \/iam\/policy\/backend_debug_access_count {iam_principal=[value
972+-- of IAMContext.principal]} At this time we do not support: * multiple
973+-- field names (though this may be supported in the future) * decrementing
974+-- the counter * incrementing it by anything other than 1
975+--
976+-- /See:/ 'logConfig' smart constructor.
977+data LogConfig = LogConfig
978+ { _lcCloudAudit :: !(Maybe CloudAuditOptions)
979+ , _lcDataAccess :: !(Maybe DataAccessOptions)
980+ , _lcCounter :: !(Maybe CounterOptions)
981+ } deriving (Eq,Show,Data,Typeable,Generic)
982+
983+-- | Creates a value of 'LogConfig' with the minimum fields required to make a request.
984+--
985+-- Use one of the following lenses to modify other fields as desired:
986+--
987+-- * 'lcCloudAudit'
988+--
989+-- * 'lcDataAccess'
990+--
991+-- * 'lcCounter'
992+logConfig
993+ :: LogConfig
994+logConfig =
995+ LogConfig
996+ { _lcCloudAudit = Nothing
997+ , _lcDataAccess = Nothing
998+ , _lcCounter = Nothing
999+ }
1000+
1001+-- | Cloud audit options.
1002+lcCloudAudit :: Lens' LogConfig (Maybe CloudAuditOptions)
1003+lcCloudAudit
1004+ = lens _lcCloudAudit (\ s a -> s{_lcCloudAudit = a})
1005+
1006+-- | Data access options.
1007+lcDataAccess :: Lens' LogConfig (Maybe DataAccessOptions)
1008+lcDataAccess
1009+ = lens _lcDataAccess (\ s a -> s{_lcDataAccess = a})
1010+
1011+-- | Counter options.
1012+lcCounter :: Lens' LogConfig (Maybe CounterOptions)
1013+lcCounter
1014+ = lens _lcCounter (\ s a -> s{_lcCounter = a})
1015+
1016+instance FromJSON LogConfig where
1017+ parseJSON
1018+ = withObject "LogConfig"
1019+ (\ o ->
1020+ LogConfig <$>
1021+ (o .:? "cloudAudit") <*> (o .:? "dataAccess") <*>
1022+ (o .:? "counter"))
1023+
1024+instance ToJSON LogConfig where
1025+ toJSON LogConfig{..}
1026+ = object
1027+ (catMaybes
1028+ [("cloudAudit" .=) <$> _lcCloudAudit,
1029+ ("dataAccess" .=) <$> _lcDataAccess,
1030+ ("counter" .=) <$> _lcCounter])
1031+
1032+-- | The service account create request.
1033+--
1034+-- /See:/ 'createServiceAccountRequest' smart constructor.
1035+data CreateServiceAccountRequest = CreateServiceAccountRequest
1036+ { _csarServiceAccount :: !(Maybe ServiceAccount)
1037+ , _csarAccountId :: !(Maybe Text)
1038+ } deriving (Eq,Show,Data,Typeable,Generic)
1039+
1040+-- | Creates a value of 'CreateServiceAccountRequest' with the minimum fields required to make a request.
1041+--
1042+-- Use one of the following lenses to modify other fields as desired:
1043+--
1044+-- * 'csarServiceAccount'
1045+--
1046+-- * 'csarAccountId'
1047+createServiceAccountRequest
1048+ :: CreateServiceAccountRequest
1049+createServiceAccountRequest =
1050+ CreateServiceAccountRequest
1051+ { _csarServiceAccount = Nothing
1052+ , _csarAccountId = Nothing
1053+ }
1054+
1055+-- | The ServiceAccount resource to create. Currently, only the following
1056+-- values are user assignable: display_name .
1057+csarServiceAccount :: Lens' CreateServiceAccountRequest (Maybe ServiceAccount)
1058+csarServiceAccount
1059+ = lens _csarServiceAccount
1060+ (\ s a -> s{_csarServiceAccount = a})
1061+
1062+-- | Required. The account id that is used to generate the service account
1063+-- email address and a stable unique id. It is unique within a project,
1064+-- must be 1-63 characters long, and match the regular expression
1065+-- [a-z]([-a-z0-9]*[a-z0-9]) to comply with RFC1035.
1066+csarAccountId :: Lens' CreateServiceAccountRequest (Maybe Text)
1067+csarAccountId
1068+ = lens _csarAccountId
1069+ (\ s a -> s{_csarAccountId = a})
1070+
1071+instance FromJSON CreateServiceAccountRequest where
1072+ parseJSON
1073+ = withObject "CreateServiceAccountRequest"
1074+ (\ o ->
1075+ CreateServiceAccountRequest <$>
1076+ (o .:? "serviceAccount") <*> (o .:? "accountId"))
1077+
1078+instance ToJSON CreateServiceAccountRequest where
1079+ toJSON CreateServiceAccountRequest{..}
1080+ = object
1081+ (catMaybes
1082+ [("serviceAccount" .=) <$> _csarServiceAccount,
1083+ ("accountId" .=) <$> _csarAccountId])
1084+
1085+-- | Associates \`members\` with a \`role\`.
1086+--
1087+-- /See:/ 'binding' smart constructor.
1088+data Binding = Binding
1089+ { _bMembers :: !(Maybe [Text])
1090+ , _bRole :: !(Maybe Text)
1091+ } deriving (Eq,Show,Data,Typeable,Generic)
1092+
1093+-- | Creates a value of 'Binding' with the minimum fields required to make a request.
1094+--
1095+-- Use one of the following lenses to modify other fields as desired:
1096+--
1097+-- * 'bMembers'
1098+--
1099+-- * 'bRole'
1100+binding
1101+ :: Binding
1102+binding =
1103+ Binding
1104+ { _bMembers = Nothing
1105+ , _bRole = Nothing
1106+ }
1107+
1108+-- | Specifies the identities requesting access for a Cloud Platform
1109+-- resource. \`members\` can have the following values: * \`allUsers\`: A
1110+-- special identifier that represents anyone who is on the internet; with
1111+-- or without a Google account. * \`allAuthenticatedUsers\`: A special
1112+-- identifier that represents anyone who is authenticated with a Google
1113+-- account or a service account. * \`user:{emailid}\`: An email address
1114+-- that represents a specific Google account. For example,
1115+-- \`alice\'gmail.com\` or \`joe\'example.com\`. *
1116+-- \`serviceAccount:{emailid}\`: An email address that represents a service
1117+-- account. For example, \`my-other-app\'appspot.gserviceaccount.com\`. *
1118+-- \`group:{emailid}\`: An email address that represents a Google group.
1119+-- For example, \`admins\'example.com\`. * \`domain:{domain}\`: A Google
1120+-- Apps domain name that represents all the users of that domain. For
1121+-- example, \`google.com\` or \`example.com\`.
1122+bMembers :: Lens' Binding [Text]
1123+bMembers
1124+ = lens _bMembers (\ s a -> s{_bMembers = a}) .
1125+ _Default
1126+ . _Coerce
1127+
1128+-- | Role that is assigned to \`members\`. For example, \`roles\/viewer\`,
1129+-- \`roles\/editor\`, or \`roles\/owner\`. Required
1130+bRole :: Lens' Binding (Maybe Text)
1131+bRole = lens _bRole (\ s a -> s{_bRole = a})
1132+
1133+instance FromJSON Binding where
1134+ parseJSON
1135+ = withObject "Binding"
1136+ (\ o ->
1137+ Binding <$>
1138+ (o .:? "members" .!= mempty) <*> (o .:? "role"))
1139+
1140+instance ToJSON Binding where
1141+ toJSON Binding{..}
1142+ = object
1143+ (catMaybes
1144+ [("members" .=) <$> _bMembers,
1145+ ("role" .=) <$> _bRole])