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