@@ -0,0 +1,1145 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE NoImplicitPrelude #-}
4+{-# LANGUAGE OverloadedStrings #-}
5+{-# LANGUAGE RecordWildCards #-}
7+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
8+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
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)
18+module Network.Google.KnowledgeGraphSearch.Types.Product where
20+import Network.Google.KnowledgeGraphSearch.Types.Sum
21+import Network.Google.Prelude
23+-- | Options for counters
25+-- /See:/ 'counterOptions' smart constructor.
26+data CounterOptions = CounterOptions
27+ { _coField :: !(Maybe Text)
28+ , _coMetric :: !(Maybe Text)
29+ } deriving (Eq,Show,Data,Typeable,Generic)
31+-- | Creates a value of 'CounterOptions' with the minimum fields required to make a request.
33+-- Use one of the following lenses to modify other fields as desired:
43+ , _coMetric = Nothing
46+-- | The field value to attribute.
47+coField :: Lens' CounterOptions (Maybe Text)
48+coField = lens _coField (\ s a -> s{_coField = a})
50+-- | The metric to update.
51+coMetric :: Lens' CounterOptions (Maybe Text)
52+coMetric = lens _coMetric (\ s a -> s{_coMetric = a})
54+instance FromJSON CounterOptions where
56+ = withObject "CounterOptions"
59+ (o .:? "field") <*> (o .:? "metric"))
61+instance ToJSON CounterOptions where
62+ toJSON CounterOptions{..}
65+ [("field" .=) <$> _coField,
66+ ("metric" .=) <$> _coMetric])
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 \`{}\`.
74+-- /See:/ 'empty' smart constructor.
77+ deriving (Eq,Show,Data,Typeable,Generic)
79+-- | Creates a value of 'Empty' with the minimum fields required to make a request.
85+instance FromJSON Empty where
86+ parseJSON = withObject "Empty" (\ o -> pure Empty)
88+instance ToJSON Empty where
89+ toJSON = const emptyObject
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.
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)
104+-- | Creates a value of 'ServiceAccountKey' with the minimum fields required to make a request.
106+-- Use one of the following lenses to modify other fields as desired:
108+-- * 'sakValidAfterTime'
110+-- * 'sakPrivateKeyData'
114+-- * 'sakPrivateKeyType'
116+-- * 'sakValidBeforeTime'
118+ :: ServiceAccountKey
121+ { _sakValidAfterTime = Nothing
122+ , _sakPrivateKeyData = Nothing
123+ , _sakName = Nothing
124+ , _sakPrivateKeyType = Nothing
125+ , _sakValidBeforeTime = Nothing
128+-- | The key can be used after this timestamp.
129+sakValidAfterTime :: Lens' ServiceAccountKey (Maybe Text)
131+ = lens _sakValidAfterTime
132+ (\ s a -> s{_sakValidAfterTime = a})
135+sakPrivateKeyData :: Lens' ServiceAccountKey (Maybe Word8)
137+ = lens _sakPrivateKeyData
138+ (\ s a -> s{_sakPrivateKeyData = a})
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})
146+-- | The type of the private key.
147+sakPrivateKeyType :: Lens' ServiceAccountKey (Maybe Text)
149+ = lens _sakPrivateKeyType
150+ (\ s a -> s{_sakPrivateKeyType = a})
152+-- | The key can be used before this timestamp.
153+sakValidBeforeTime :: Lens' ServiceAccountKey (Maybe Text)
155+ = lens _sakValidBeforeTime
156+ (\ s a -> s{_sakValidBeforeTime = a})
158+instance FromJSON ServiceAccountKey where
160+ = withObject "ServiceAccountKey"
162+ ServiceAccountKey <$>
163+ (o .:? "validAfterTime") <*> (o .:? "privateKeyData")
165+ <*> (o .:? "privateKeyType")
166+ <*> (o .:? "validBeforeTime"))
168+instance ToJSON ServiceAccountKey where
169+ toJSON ServiceAccountKey{..}
172+ [("validAfterTime" .=) <$> _sakValidAfterTime,
173+ ("privateKeyData" .=) <$> _sakPrivateKeyData,
174+ ("name" .=) <$> _sakName,
175+ ("privateKeyType" .=) <$> _sakPrivateKeyType,
176+ ("validBeforeTime" .=) <$> _sakValidBeforeTime])
178+-- | A rule to be applied in a Policy.
180+-- /See:/ 'rule' smart constructor.
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)
191+-- | Creates a value of 'Rule' with the minimum fields required to make a request.
193+-- Use one of the following lenses to modify other fields as desired:
212+ { _rAction = Nothing
215+ , _rConditions = Nothing
216+ , _rPermissions = Nothing
217+ , _rLogConfig = Nothing
218+ , _rDescription = Nothing
222+rAction :: Lens' Rule (Maybe Text)
223+rAction = lens _rAction (\ s a -> s{_rAction = a})
225+-- | The rule matches if the PRINCIPAL\/AUTHORITY_SELECTOR is in this set of
227+rIn :: Lens' Rule [Text]
229+ = lens _rIn (\ s a -> s{_rIn = a}) . _Default .
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]
237+ = lens _rNotIn (\ s a -> s{_rNotIn = a}) . _Default .
240+-- | Additional restrictions that must be met
241+rConditions :: Lens' Rule [Condition]
243+ = lens _rConditions (\ s a -> s{_rConditions = a}) .
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]
252+ = lens _rPermissions (\ s a -> s{_rPermissions = a})
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]
260+ = lens _rLogConfig (\ s a -> s{_rLogConfig = a}) .
264+-- | Human-readable description of the rule.
265+rDescription :: Lens' Rule (Maybe Text)
267+ = lens _rDescription (\ s a -> s{_rDescription = a})
269+instance FromJSON Rule where
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"))
281+instance ToJSON Rule where
285+ [("action" .=) <$> _rAction, ("in" .=) <$> _rIn,
286+ ("notIn" .=) <$> _rNotIn,
287+ ("conditions" .=) <$> _rConditions,
288+ ("permissions" .=) <$> _rPermissions,
289+ ("logConfig" .=) <$> _rLogConfig,
290+ ("description" .=) <$> _rDescription])
292+-- | The service account key create request.
294+-- /See:/ 'createServiceAccountKeyRequest' smart constructor.
295+newtype CreateServiceAccountKeyRequest = CreateServiceAccountKeyRequest
296+ { _csakrPrivateKeyType :: Maybe Text
297+ } deriving (Eq,Show,Data,Typeable,Generic)
299+-- | Creates a value of 'CreateServiceAccountKeyRequest' with the minimum fields required to make a request.
301+-- Use one of the following lenses to modify other fields as desired:
303+-- * 'csakrPrivateKeyType'
304+createServiceAccountKeyRequest
305+ :: CreateServiceAccountKeyRequest
306+createServiceAccountKeyRequest =
307+ CreateServiceAccountKeyRequest
308+ { _csakrPrivateKeyType = Nothing
311+-- | The type of the key requested. GOOGLE_CREDENTIALS is the default key
313+csakrPrivateKeyType :: Lens' CreateServiceAccountKeyRequest (Maybe Text)
315+ = lens _csakrPrivateKeyType
316+ (\ s a -> s{_csakrPrivateKeyType = a})
318+instance FromJSON CreateServiceAccountKeyRequest
321+ = withObject "CreateServiceAccountKeyRequest"
323+ CreateServiceAccountKeyRequest <$>
324+ (o .:? "privateKeyType"))
326+instance ToJSON CreateServiceAccountKeyRequest where
327+ toJSON CreateServiceAccountKeyRequest{..}
330+ [("privateKeyType" .=) <$> _csakrPrivateKeyType])
332+-- | Request message for \`SetIamPolicy\` method.
334+-- /See:/ 'setIAMPolicyRequest' smart constructor.
335+newtype SetIAMPolicyRequest = SetIAMPolicyRequest
336+ { _siprPolicy :: Maybe Policy
337+ } deriving (Eq,Show,Data,Typeable,Generic)
339+-- | Creates a value of 'SetIAMPolicyRequest' with the minimum fields required to make a request.
341+-- Use one of the following lenses to modify other fields as desired:
345+ :: SetIAMPolicyRequest
346+setIAMPolicyRequest =
348+ { _siprPolicy = Nothing
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)
357+ = lens _siprPolicy (\ s a -> s{_siprPolicy = a})
359+instance FromJSON SetIAMPolicyRequest where
361+ = withObject "SetIAMPolicyRequest"
362+ (\ o -> SetIAMPolicyRequest <$> (o .:? "policy"))
364+instance ToJSON SetIAMPolicyRequest where
365+ toJSON SetIAMPolicyRequest{..}
366+ = object (catMaybes [("policy" .=) <$> _siprPolicy])
368+-- | The service account sign blob request.
370+-- /See:/ 'signBlobRequest' smart constructor.
371+newtype SignBlobRequest = SignBlobRequest
372+ { _sbrBytesToSign :: Maybe (Textual Word8)
373+ } deriving (Eq,Show,Data,Typeable,Generic)
375+-- | Creates a value of 'SignBlobRequest' with the minimum fields required to make a request.
377+-- Use one of the following lenses to modify other fields as desired:
379+-- * 'sbrBytesToSign'
384+ { _sbrBytesToSign = Nothing
387+-- | The bytes to sign
388+sbrBytesToSign :: Lens' SignBlobRequest (Maybe Word8)
390+ = lens _sbrBytesToSign
391+ (\ s a -> s{_sbrBytesToSign = a})
394+instance FromJSON SignBlobRequest where
396+ = withObject "SignBlobRequest"
397+ (\ o -> SignBlobRequest <$> (o .:? "bytesToSign"))
399+instance ToJSON SignBlobRequest where
400+ toJSON SignBlobRequest{..}
402+ (catMaybes [("bytesToSign" .=) <$> _sbrBytesToSign])
404+-- | The service account keys list response.
406+-- /See:/ 'listServiceAccountKeysResponse' smart constructor.
407+newtype ListServiceAccountKeysResponse = ListServiceAccountKeysResponse
408+ { _lsakrKeys :: Maybe [ServiceAccountKey]
409+ } deriving (Eq,Show,Data,Typeable,Generic)
411+-- | Creates a value of 'ListServiceAccountKeysResponse' with the minimum fields required to make a request.
413+-- Use one of the following lenses to modify other fields as desired:
416+listServiceAccountKeysResponse
417+ :: ListServiceAccountKeysResponse
418+listServiceAccountKeysResponse =
419+ ListServiceAccountKeysResponse
420+ { _lsakrKeys = Nothing
423+-- | The public keys for the service account.
424+lsakrKeys :: Lens' ListServiceAccountKeysResponse [ServiceAccountKey]
426+ = lens _lsakrKeys (\ s a -> s{_lsakrKeys = a}) .
430+instance FromJSON ListServiceAccountKeysResponse
433+ = withObject "ListServiceAccountKeysResponse"
435+ ListServiceAccountKeysResponse <$>
436+ (o .:? "keys" .!= mempty))
438+instance ToJSON ListServiceAccountKeysResponse where
439+ toJSON ListServiceAccountKeysResponse{..}
440+ = object (catMaybes [("keys" .=) <$> _lsakrKeys])
442+-- | Write a Cloud Audit log
444+-- /See:/ 'cloudAuditOptions' smart constructor.
445+data CloudAuditOptions =
447+ deriving (Eq,Show,Data,Typeable,Generic)
449+-- | Creates a value of 'CloudAuditOptions' with the minimum fields required to make a request.
452+ :: CloudAuditOptions
453+cloudAuditOptions = CloudAuditOptions
455+instance FromJSON CloudAuditOptions where
457+ = withObject "CloudAuditOptions"
458+ (\ o -> pure CloudAuditOptions)
460+instance ToJSON CloudAuditOptions where
461+ toJSON = const emptyObject
463+-- | Write a Data Access (Gin) log
465+-- /See:/ 'dataAccessOptions' smart constructor.
466+data DataAccessOptions =
468+ deriving (Eq,Show,Data,Typeable,Generic)
470+-- | Creates a value of 'DataAccessOptions' with the minimum fields required to make a request.
473+ :: DataAccessOptions
474+dataAccessOptions = DataAccessOptions
476+instance FromJSON DataAccessOptions where
478+ = withObject "DataAccessOptions"
479+ (\ o -> pure DataAccessOptions)
481+instance ToJSON DataAccessOptions where
482+ toJSON = const emptyObject
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
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)
505+-- | Creates a value of 'ServiceAccount' with the minimum fields required to make a request.
507+-- Use one of the following lenses to modify other fields as desired:
521+-- * 'saOAuth2ClientId'
526+ { _saEmail = Nothing
528+ , _saUniqueId = Nothing
530+ , _saDisplayName = Nothing
531+ , _saProjectId = Nothing
532+ , _saOAuth2ClientId = Nothing
535+-- | \'OutputOnly Email address of the service account.
536+saEmail :: Lens' ServiceAccount (Maybe Text)
537+saEmail = lens _saEmail (\ s a -> s{_saEmail = a})
539+-- | Used to perform a consistent read-modify-write.
540+saEtag :: Lens' ServiceAccount (Maybe Word8)
542+ = lens _saEtag (\ s a -> s{_saEtag = a}) .
545+-- | \'OutputOnly unique and stable id of the service account.
546+saUniqueId :: Lens' ServiceAccount (Maybe Text)
548+ = lens _saUniqueId (\ s a -> s{_saUniqueId = a})
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})
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)
563+ = lens _saDisplayName
564+ (\ s a -> s{_saDisplayName = a})
566+-- | \'OutputOnly The id of the project that owns the service account.
567+saProjectId :: Lens' ServiceAccount (Maybe Text)
569+ = lens _saProjectId (\ s a -> s{_saProjectId = a})
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)
576+ = lens _saOAuth2ClientId
577+ (\ s a -> s{_saOAuth2ClientId = a})
579+instance FromJSON ServiceAccount where
581+ = withObject "ServiceAccount"
584+ (o .:? "email") <*> (o .:? "etag") <*>
587+ <*> (o .:? "displayName")
588+ <*> (o .:? "projectId")
589+ <*> (o .:? "oauth2ClientId"))
591+instance ToJSON ServiceAccount where
592+ toJSON ServiceAccount{..}
595+ [("email" .=) <$> _saEmail, ("etag" .=) <$> _saEtag,
596+ ("uniqueId" .=) <$> _saUniqueId,
597+ ("name" .=) <$> _saName,
598+ ("displayName" .=) <$> _saDisplayName,
599+ ("projectId" .=) <$> _saProjectId,
600+ ("oauth2ClientId" .=) <$> _saOAuth2ClientId])
602+-- | Request message for \`TestIamPermissions\` method.
604+-- /See:/ 'testIAMPermissionsRequest' smart constructor.
605+newtype TestIAMPermissionsRequest = TestIAMPermissionsRequest
606+ { _tiprPermissions :: Maybe [Text]
607+ } deriving (Eq,Show,Data,Typeable,Generic)
609+-- | Creates a value of 'TestIAMPermissionsRequest' with the minimum fields required to make a request.
611+-- Use one of the following lenses to modify other fields as desired:
613+-- * 'tiprPermissions'
614+testIAMPermissionsRequest
615+ :: TestIAMPermissionsRequest
616+testIAMPermissionsRequest =
617+ TestIAMPermissionsRequest
618+ { _tiprPermissions = Nothing
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]
626+ = lens _tiprPermissions
627+ (\ s a -> s{_tiprPermissions = a})
631+instance FromJSON TestIAMPermissionsRequest where
633+ = withObject "TestIAMPermissionsRequest"
635+ TestIAMPermissionsRequest <$>
636+ (o .:? "permissions" .!= mempty))
638+instance ToJSON TestIAMPermissionsRequest where
639+ toJSON TestIAMPermissionsRequest{..}
641+ (catMaybes [("permissions" .=) <$> _tiprPermissions])
643+-- | Response message for \`TestIamPermissions\` method.
645+-- /See:/ 'testIAMPermissionsResponse' smart constructor.
646+newtype TestIAMPermissionsResponse = TestIAMPermissionsResponse
647+ { _tiamprPermissions :: Maybe [Text]
648+ } deriving (Eq,Show,Data,Typeable,Generic)
650+-- | Creates a value of 'TestIAMPermissionsResponse' with the minimum fields required to make a request.
652+-- Use one of the following lenses to modify other fields as desired:
654+-- * 'tiamprPermissions'
655+testIAMPermissionsResponse
656+ :: TestIAMPermissionsResponse
657+testIAMPermissionsResponse =
658+ TestIAMPermissionsResponse
659+ { _tiamprPermissions = Nothing
662+-- | A subset of \`TestPermissionsRequest.permissions\` that the caller is
664+tiamprPermissions :: Lens' TestIAMPermissionsResponse [Text]
666+ = lens _tiamprPermissions
667+ (\ s a -> s{_tiamprPermissions = a})
671+instance FromJSON TestIAMPermissionsResponse where
673+ = withObject "TestIAMPermissionsResponse"
675+ TestIAMPermissionsResponse <$>
676+ (o .:? "permissions" .!= mempty))
678+instance ToJSON TestIAMPermissionsResponse where
679+ toJSON TestIAMPermissionsResponse{..}
682+ [("permissions" .=) <$> _tiamprPermissions])
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).
698+-- /See:/ 'policy' smart constructor.
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)
706+-- | Creates a value of 'Policy' with the minimum fields required to make a request.
708+-- Use one of the following lenses to modify other fields as desired:
723+ , _pVersion = Nothing
724+ , _pBindings = Nothing
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)
738+ = lens _pEtag (\ s a -> s{_pEtag = a}) .
741+pRules :: Lens' Policy [Rule]
743+ = lens _pRules (\ s a -> s{_pRules = a}) . _Default .
746+-- | Version of the \`Policy\`. The default version is 0.
747+pVersion :: Lens' Policy (Maybe Int32)
749+ = lens _pVersion (\ s a -> s{_pVersion = a}) .
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]
757+ = lens _pBindings (\ s a -> s{_pBindings = a}) .
761+instance FromJSON Policy where
763+ = withObject "Policy"
766+ (o .:? "etag") <*> (o .:? "rules" .!= mempty) <*>
768+ <*> (o .:? "bindings" .!= mempty))
770+instance ToJSON Policy where
774+ [("etag" .=) <$> _pEtag, ("rules" .=) <$> _pRules,
775+ ("version" .=) <$> _pVersion,
776+ ("bindings" .=) <$> _pBindings])
778+-- | A condition to be met.
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)
790+-- | Creates a value of 'Condition' with the minimum fields required to make a request.
792+-- Use one of the following lenses to modify other fields as desired:
811+ , _cValues = Nothing
817+-- | An operator to apply the subject with.
818+cOp :: Lens' Condition (Maybe Text)
819+cOp = lens _cOp (\ s a -> s{_cOp = a})
821+-- | Trusted attributes supplied by the IAM system.
822+cIAM :: Lens' Condition (Maybe Text)
823+cIAM = lens _cIAM (\ s a -> s{_cIAM = a})
825+-- | The objects of the condition. This is mutually exclusive with \'value\'.
826+cValues :: Lens' Condition [Text]
828+ = lens _cValues (\ s a -> s{_cValues = a}) . _Default
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})
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})
840+-- | Trusted attributes discharged by the service.
841+cSvc :: Lens' Condition (Maybe Text)
842+cSvc = lens _cSvc (\ s a -> s{_cSvc = a})
844+instance FromJSON Condition where
846+ = withObject "Condition"
849+ (o .:? "op") <*> (o .:? "iam") <*>
850+ (o .:? "values" .!= mempty)
855+instance ToJSON Condition where
856+ toJSON Condition{..}
859+ [("op" .=) <$> _cOp, ("iam" .=) <$> _cIAM,
860+ ("values" .=) <$> _cValues, ("value" .=) <$> _cValue,
861+ ("sys" .=) <$> _cSys, ("svc" .=) <$> _cSvc])
863+-- | The service account sign blob response.
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)
871+-- | Creates a value of 'SignBlobResponse' with the minimum fields required to make a request.
873+-- Use one of the following lenses to modify other fields as desired:
882+ { _sbrSignature = Nothing
883+ , _sbrKeyId = Nothing
886+-- | The signed blob.
887+sbrSignature :: Lens' SignBlobResponse (Maybe Word8)
889+ = lens _sbrSignature (\ s a -> s{_sbrSignature = a})
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})
896+instance FromJSON SignBlobResponse where
898+ = withObject "SignBlobResponse"
900+ SignBlobResponse <$>
901+ (o .:? "signature") <*> (o .:? "keyId"))
903+instance ToJSON SignBlobResponse where
904+ toJSON SignBlobResponse{..}
907+ [("signature" .=) <$> _sbrSignature,
908+ ("keyId" .=) <$> _sbrKeyId])
910+-- | The service account list response.
912+-- /See:/ 'listServiceAccountsResponse' smart constructor.
913+data ListServiceAccountsResponse = ListServiceAccountsResponse
914+ { _lsarNextPageToken :: !(Maybe Text)
915+ , _lsarAccounts :: !(Maybe [ServiceAccount])
916+ } deriving (Eq,Show,Data,Typeable,Generic)
918+-- | Creates a value of 'ListServiceAccountsResponse' with the minimum fields required to make a request.
920+-- Use one of the following lenses to modify other fields as desired:
922+-- * 'lsarNextPageToken'
925+listServiceAccountsResponse
926+ :: ListServiceAccountsResponse
927+listServiceAccountsResponse =
928+ ListServiceAccountsResponse
929+ { _lsarNextPageToken = Nothing
930+ , _lsarAccounts = Nothing
933+-- | To retrieve the next page of results, set
934+-- [ListServiceAccountsRequest.page_token] to this value.
935+lsarNextPageToken :: Lens' ListServiceAccountsResponse (Maybe Text)
937+ = lens _lsarNextPageToken
938+ (\ s a -> s{_lsarNextPageToken = a})
940+-- | The list of matching service accounts.
941+lsarAccounts :: Lens' ListServiceAccountsResponse [ServiceAccount]
943+ = lens _lsarAccounts (\ s a -> s{_lsarAccounts = a})
947+instance FromJSON ListServiceAccountsResponse where
949+ = withObject "ListServiceAccountsResponse"
951+ ListServiceAccountsResponse <$>
952+ (o .:? "nextPageToken") <*>
953+ (o .:? "accounts" .!= mempty))
955+instance ToJSON ListServiceAccountsResponse where
956+ toJSON ListServiceAccountsResponse{..}
959+ [("nextPageToken" .=) <$> _lsarNextPageToken,
960+ ("accounts" .=) <$> _lsarAccounts])
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
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)
983+-- | Creates a value of 'LogConfig' with the minimum fields required to make a request.
985+-- Use one of the following lenses to modify other fields as desired:
996+ { _lcCloudAudit = Nothing
997+ , _lcDataAccess = Nothing
998+ , _lcCounter = Nothing
1001+-- | Cloud audit options.
1002+lcCloudAudit :: Lens' LogConfig (Maybe CloudAuditOptions)
1004+ = lens _lcCloudAudit (\ s a -> s{_lcCloudAudit = a})
1006+-- | Data access options.
1007+lcDataAccess :: Lens' LogConfig (Maybe DataAccessOptions)
1009+ = lens _lcDataAccess (\ s a -> s{_lcDataAccess = a})
1011+-- | Counter options.
1012+lcCounter :: Lens' LogConfig (Maybe CounterOptions)
1014+ = lens _lcCounter (\ s a -> s{_lcCounter = a})
1016+instance FromJSON LogConfig where
1018+ = withObject "LogConfig"
1021+ (o .:? "cloudAudit") <*> (o .:? "dataAccess") <*>
1024+instance ToJSON LogConfig where
1025+ toJSON LogConfig{..}
1028+ [("cloudAudit" .=) <$> _lcCloudAudit,
1029+ ("dataAccess" .=) <$> _lcDataAccess,
1030+ ("counter" .=) <$> _lcCounter])
1032+-- | The service account create request.
1034+-- /See:/ 'createServiceAccountRequest' smart constructor.
1035+data CreateServiceAccountRequest = CreateServiceAccountRequest
1036+ { _csarServiceAccount :: !(Maybe ServiceAccount)
1037+ , _csarAccountId :: !(Maybe Text)
1038+ } deriving (Eq,Show,Data,Typeable,Generic)
1040+-- | Creates a value of 'CreateServiceAccountRequest' with the minimum fields required to make a request.
1042+-- Use one of the following lenses to modify other fields as desired:
1044+-- * 'csarServiceAccount'
1046+-- * 'csarAccountId'
1047+createServiceAccountRequest
1048+ :: CreateServiceAccountRequest
1049+createServiceAccountRequest =
1050+ CreateServiceAccountRequest
1051+ { _csarServiceAccount = Nothing
1052+ , _csarAccountId = Nothing
1055+-- | The ServiceAccount resource to create. Currently, only the following
1056+-- values are user assignable: display_name .
1057+csarServiceAccount :: Lens' CreateServiceAccountRequest (Maybe ServiceAccount)
1059+ = lens _csarServiceAccount
1060+ (\ s a -> s{_csarServiceAccount = a})
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)
1068+ = lens _csarAccountId
1069+ (\ s a -> s{_csarAccountId = a})
1071+instance FromJSON CreateServiceAccountRequest where
1073+ = withObject "CreateServiceAccountRequest"
1075+ CreateServiceAccountRequest <$>
1076+ (o .:? "serviceAccount") <*> (o .:? "accountId"))
1078+instance ToJSON CreateServiceAccountRequest where
1079+ toJSON CreateServiceAccountRequest{..}
1082+ [("serviceAccount" .=) <$> _csarServiceAccount,
1083+ ("accountId" .=) <$> _csarAccountId])
1085+-- | Associates \`members\` with a \`role\`.
1087+-- /See:/ 'binding' smart constructor.
1088+data Binding = Binding
1089+ { _bMembers :: !(Maybe [Text])
1090+ , _bRole :: !(Maybe Text)
1091+ } deriving (Eq,Show,Data,Typeable,Generic)
1093+-- | Creates a value of 'Binding' with the minimum fields required to make a request.
1095+-- Use one of the following lenses to modify other fields as desired:
1104+ { _bMembers = Nothing
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]
1124+ = lens _bMembers (\ s a -> s{_bMembers = a}) .
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})
1133+instance FromJSON Binding where
1135+ = withObject "Binding"
1138+ (o .:? "members" .!= mempty) <*> (o .:? "role"))
1140+instance ToJSON Binding where
1144+ [("members" .=) <$> _bMembers,
1145+ ("role" .=) <$> _bRole])