module Network.Google.KnowledgeGraphSearch.Types.Product where
import Network.Google.KnowledgeGraphSearch.Types.Sum
import Network.Google.Prelude
data CounterOptions = CounterOptions'
{ _coField :: !(Maybe Text)
, _coMetric :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
counterOptions
:: CounterOptions
counterOptions =
CounterOptions'
{ _coField = Nothing
, _coMetric = Nothing
}
coField :: Lens' CounterOptions (Maybe Text)
coField = lens _coField (\ s a -> s{_coField = a})
coMetric :: Lens' CounterOptions (Maybe Text)
coMetric = lens _coMetric (\ s a -> s{_coMetric = a})
instance FromJSON CounterOptions where
parseJSON
= withObject "CounterOptions"
(\ o ->
CounterOptions' <$>
(o .:? "field") <*> (o .:? "metric"))
instance ToJSON CounterOptions where
toJSON CounterOptions'{..}
= object
(catMaybes
[("field" .=) <$> _coField,
("metric" .=) <$> _coMetric])
data Empty =
Empty'
deriving (Eq,Show,Data,Typeable,Generic)
empty
:: Empty
empty = Empty'
instance FromJSON Empty where
parseJSON = withObject "Empty" (\ o -> pure Empty')
instance ToJSON Empty where
toJSON = const emptyObject
data ServiceAccountKey = ServiceAccountKey'
{ _sakValidAfterTime :: !(Maybe Text)
, _sakPrivateKeyData :: !(Maybe Base64)
, _sakName :: !(Maybe Text)
, _sakPrivateKeyType :: !(Maybe Text)
, _sakValidBeforeTime :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
serviceAccountKey
:: ServiceAccountKey
serviceAccountKey =
ServiceAccountKey'
{ _sakValidAfterTime = Nothing
, _sakPrivateKeyData = Nothing
, _sakName = Nothing
, _sakPrivateKeyType = Nothing
, _sakValidBeforeTime = Nothing
}
sakValidAfterTime :: Lens' ServiceAccountKey (Maybe Text)
sakValidAfterTime
= lens _sakValidAfterTime
(\ s a -> s{_sakValidAfterTime = a})
sakPrivateKeyData :: Lens' ServiceAccountKey (Maybe ByteString)
sakPrivateKeyData
= lens _sakPrivateKeyData
(\ s a -> s{_sakPrivateKeyData = a})
. mapping _Base64
sakName :: Lens' ServiceAccountKey (Maybe Text)
sakName = lens _sakName (\ s a -> s{_sakName = a})
sakPrivateKeyType :: Lens' ServiceAccountKey (Maybe Text)
sakPrivateKeyType
= lens _sakPrivateKeyType
(\ s a -> s{_sakPrivateKeyType = a})
sakValidBeforeTime :: Lens' ServiceAccountKey (Maybe Text)
sakValidBeforeTime
= lens _sakValidBeforeTime
(\ s a -> s{_sakValidBeforeTime = a})
instance FromJSON ServiceAccountKey where
parseJSON
= withObject "ServiceAccountKey"
(\ o ->
ServiceAccountKey' <$>
(o .:? "validAfterTime") <*> (o .:? "privateKeyData")
<*> (o .:? "name")
<*> (o .:? "privateKeyType")
<*> (o .:? "validBeforeTime"))
instance ToJSON ServiceAccountKey where
toJSON ServiceAccountKey'{..}
= object
(catMaybes
[("validAfterTime" .=) <$> _sakValidAfterTime,
("privateKeyData" .=) <$> _sakPrivateKeyData,
("name" .=) <$> _sakName,
("privateKeyType" .=) <$> _sakPrivateKeyType,
("validBeforeTime" .=) <$> _sakValidBeforeTime])
data Rule = Rule'
{ _rAction :: !(Maybe Text)
, _rIn :: !(Maybe [Text])
, _rNotIn :: !(Maybe [Text])
, _rConditions :: !(Maybe [Condition])
, _rPermissions :: !(Maybe [Text])
, _rLogConfig :: !(Maybe [LogConfig])
, _rDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
rule
:: Rule
rule =
Rule'
{ _rAction = Nothing
, _rIn = Nothing
, _rNotIn = Nothing
, _rConditions = Nothing
, _rPermissions = Nothing
, _rLogConfig = Nothing
, _rDescription = Nothing
}
rAction :: Lens' Rule (Maybe Text)
rAction = lens _rAction (\ s a -> s{_rAction = a})
rIn :: Lens' Rule [Text]
rIn
= lens _rIn (\ s a -> s{_rIn = a}) . _Default .
_Coerce
rNotIn :: Lens' Rule [Text]
rNotIn
= lens _rNotIn (\ s a -> s{_rNotIn = a}) . _Default .
_Coerce
rConditions :: Lens' Rule [Condition]
rConditions
= lens _rConditions (\ s a -> s{_rConditions = a}) .
_Default
. _Coerce
rPermissions :: Lens' Rule [Text]
rPermissions
= lens _rPermissions (\ s a -> s{_rPermissions = a})
. _Default
. _Coerce
rLogConfig :: Lens' Rule [LogConfig]
rLogConfig
= lens _rLogConfig (\ s a -> s{_rLogConfig = a}) .
_Default
. _Coerce
rDescription :: Lens' Rule (Maybe Text)
rDescription
= lens _rDescription (\ s a -> s{_rDescription = a})
instance FromJSON Rule where
parseJSON
= withObject "Rule"
(\ o ->
Rule' <$>
(o .:? "action") <*> (o .:? "in" .!= mempty) <*>
(o .:? "notIn" .!= mempty)
<*> (o .:? "conditions" .!= mempty)
<*> (o .:? "permissions" .!= mempty)
<*> (o .:? "logConfig" .!= mempty)
<*> (o .:? "description"))
instance ToJSON Rule where
toJSON Rule'{..}
= object
(catMaybes
[("action" .=) <$> _rAction, ("in" .=) <$> _rIn,
("notIn" .=) <$> _rNotIn,
("conditions" .=) <$> _rConditions,
("permissions" .=) <$> _rPermissions,
("logConfig" .=) <$> _rLogConfig,
("description" .=) <$> _rDescription])
newtype CreateServiceAccountKeyRequest = CreateServiceAccountKeyRequest'
{ _csakrPrivateKeyType :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
createServiceAccountKeyRequest
:: CreateServiceAccountKeyRequest
createServiceAccountKeyRequest =
CreateServiceAccountKeyRequest'
{ _csakrPrivateKeyType = Nothing
}
csakrPrivateKeyType :: Lens' CreateServiceAccountKeyRequest (Maybe Text)
csakrPrivateKeyType
= lens _csakrPrivateKeyType
(\ s a -> s{_csakrPrivateKeyType = a})
instance FromJSON CreateServiceAccountKeyRequest
where
parseJSON
= withObject "CreateServiceAccountKeyRequest"
(\ o ->
CreateServiceAccountKeyRequest' <$>
(o .:? "privateKeyType"))
instance ToJSON CreateServiceAccountKeyRequest where
toJSON CreateServiceAccountKeyRequest'{..}
= object
(catMaybes
[("privateKeyType" .=) <$> _csakrPrivateKeyType])
newtype SetIAMPolicyRequest = SetIAMPolicyRequest'
{ _siprPolicy :: Maybe Policy
} deriving (Eq,Show,Data,Typeable,Generic)
setIAMPolicyRequest
:: SetIAMPolicyRequest
setIAMPolicyRequest =
SetIAMPolicyRequest'
{ _siprPolicy = Nothing
}
siprPolicy :: Lens' SetIAMPolicyRequest (Maybe Policy)
siprPolicy
= lens _siprPolicy (\ s a -> s{_siprPolicy = a})
instance FromJSON SetIAMPolicyRequest where
parseJSON
= withObject "SetIAMPolicyRequest"
(\ o -> SetIAMPolicyRequest' <$> (o .:? "policy"))
instance ToJSON SetIAMPolicyRequest where
toJSON SetIAMPolicyRequest'{..}
= object (catMaybes [("policy" .=) <$> _siprPolicy])
newtype SignBlobRequest = SignBlobRequest'
{ _sbrBytesToSign :: Maybe Base64
} deriving (Eq,Show,Data,Typeable,Generic)
signBlobRequest
:: SignBlobRequest
signBlobRequest =
SignBlobRequest'
{ _sbrBytesToSign = Nothing
}
sbrBytesToSign :: Lens' SignBlobRequest (Maybe ByteString)
sbrBytesToSign
= lens _sbrBytesToSign
(\ s a -> s{_sbrBytesToSign = a})
. mapping _Base64
instance FromJSON SignBlobRequest where
parseJSON
= withObject "SignBlobRequest"
(\ o -> SignBlobRequest' <$> (o .:? "bytesToSign"))
instance ToJSON SignBlobRequest where
toJSON SignBlobRequest'{..}
= object
(catMaybes [("bytesToSign" .=) <$> _sbrBytesToSign])
newtype ListServiceAccountKeysResponse = ListServiceAccountKeysResponse'
{ _lsakrKeys :: Maybe [ServiceAccountKey]
} deriving (Eq,Show,Data,Typeable,Generic)
listServiceAccountKeysResponse
:: ListServiceAccountKeysResponse
listServiceAccountKeysResponse =
ListServiceAccountKeysResponse'
{ _lsakrKeys = Nothing
}
lsakrKeys :: Lens' ListServiceAccountKeysResponse [ServiceAccountKey]
lsakrKeys
= lens _lsakrKeys (\ s a -> s{_lsakrKeys = a}) .
_Default
. _Coerce
instance FromJSON ListServiceAccountKeysResponse
where
parseJSON
= withObject "ListServiceAccountKeysResponse"
(\ o ->
ListServiceAccountKeysResponse' <$>
(o .:? "keys" .!= mempty))
instance ToJSON ListServiceAccountKeysResponse where
toJSON ListServiceAccountKeysResponse'{..}
= object (catMaybes [("keys" .=) <$> _lsakrKeys])
data CloudAuditOptions =
CloudAuditOptions'
deriving (Eq,Show,Data,Typeable,Generic)
cloudAuditOptions
:: CloudAuditOptions
cloudAuditOptions = CloudAuditOptions'
instance FromJSON CloudAuditOptions where
parseJSON
= withObject "CloudAuditOptions"
(\ o -> pure CloudAuditOptions')
instance ToJSON CloudAuditOptions where
toJSON = const emptyObject
data DataAccessOptions =
DataAccessOptions'
deriving (Eq,Show,Data,Typeable,Generic)
dataAccessOptions
:: DataAccessOptions
dataAccessOptions = DataAccessOptions'
instance FromJSON DataAccessOptions where
parseJSON
= withObject "DataAccessOptions"
(\ o -> pure DataAccessOptions')
instance ToJSON DataAccessOptions where
toJSON = const emptyObject
data ServiceAccount = ServiceAccount'
{ _saEmail :: !(Maybe Text)
, _saEtag :: !(Maybe Base64)
, _saUniqueId :: !(Maybe Text)
, _saName :: !(Maybe Text)
, _saDisplayName :: !(Maybe Text)
, _saProjectId :: !(Maybe Text)
, _saOAuth2ClientId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
serviceAccount
:: ServiceAccount
serviceAccount =
ServiceAccount'
{ _saEmail = Nothing
, _saEtag = Nothing
, _saUniqueId = Nothing
, _saName = Nothing
, _saDisplayName = Nothing
, _saProjectId = Nothing
, _saOAuth2ClientId = Nothing
}
saEmail :: Lens' ServiceAccount (Maybe Text)
saEmail = lens _saEmail (\ s a -> s{_saEmail = a})
saEtag :: Lens' ServiceAccount (Maybe ByteString)
saEtag
= lens _saEtag (\ s a -> s{_saEtag = a}) .
mapping _Base64
saUniqueId :: Lens' ServiceAccount (Maybe Text)
saUniqueId
= lens _saUniqueId (\ s a -> s{_saUniqueId = a})
saName :: Lens' ServiceAccount (Maybe Text)
saName = lens _saName (\ s a -> s{_saName = a})
saDisplayName :: Lens' ServiceAccount (Maybe Text)
saDisplayName
= lens _saDisplayName
(\ s a -> s{_saDisplayName = a})
saProjectId :: Lens' ServiceAccount (Maybe Text)
saProjectId
= lens _saProjectId (\ s a -> s{_saProjectId = a})
saOAuth2ClientId :: Lens' ServiceAccount (Maybe Text)
saOAuth2ClientId
= lens _saOAuth2ClientId
(\ s a -> s{_saOAuth2ClientId = a})
instance FromJSON ServiceAccount where
parseJSON
= withObject "ServiceAccount"
(\ o ->
ServiceAccount' <$>
(o .:? "email") <*> (o .:? "etag") <*>
(o .:? "uniqueId")
<*> (o .:? "name")
<*> (o .:? "displayName")
<*> (o .:? "projectId")
<*> (o .:? "oauth2ClientId"))
instance ToJSON ServiceAccount where
toJSON ServiceAccount'{..}
= object
(catMaybes
[("email" .=) <$> _saEmail, ("etag" .=) <$> _saEtag,
("uniqueId" .=) <$> _saUniqueId,
("name" .=) <$> _saName,
("displayName" .=) <$> _saDisplayName,
("projectId" .=) <$> _saProjectId,
("oauth2ClientId" .=) <$> _saOAuth2ClientId])
newtype TestIAMPermissionsRequest = TestIAMPermissionsRequest'
{ _tiprPermissions :: Maybe [Text]
} deriving (Eq,Show,Data,Typeable,Generic)
testIAMPermissionsRequest
:: TestIAMPermissionsRequest
testIAMPermissionsRequest =
TestIAMPermissionsRequest'
{ _tiprPermissions = Nothing
}
tiprPermissions :: Lens' TestIAMPermissionsRequest [Text]
tiprPermissions
= lens _tiprPermissions
(\ s a -> s{_tiprPermissions = a})
. _Default
. _Coerce
instance FromJSON TestIAMPermissionsRequest where
parseJSON
= withObject "TestIAMPermissionsRequest"
(\ o ->
TestIAMPermissionsRequest' <$>
(o .:? "permissions" .!= mempty))
instance ToJSON TestIAMPermissionsRequest where
toJSON TestIAMPermissionsRequest'{..}
= object
(catMaybes [("permissions" .=) <$> _tiprPermissions])
newtype TestIAMPermissionsResponse = TestIAMPermissionsResponse'
{ _tiamprPermissions :: Maybe [Text]
} deriving (Eq,Show,Data,Typeable,Generic)
testIAMPermissionsResponse
:: TestIAMPermissionsResponse
testIAMPermissionsResponse =
TestIAMPermissionsResponse'
{ _tiamprPermissions = Nothing
}
tiamprPermissions :: Lens' TestIAMPermissionsResponse [Text]
tiamprPermissions
= lens _tiamprPermissions
(\ s a -> s{_tiamprPermissions = a})
. _Default
. _Coerce
instance FromJSON TestIAMPermissionsResponse where
parseJSON
= withObject "TestIAMPermissionsResponse"
(\ o ->
TestIAMPermissionsResponse' <$>
(o .:? "permissions" .!= mempty))
instance ToJSON TestIAMPermissionsResponse where
toJSON TestIAMPermissionsResponse'{..}
= object
(catMaybes
[("permissions" .=) <$> _tiamprPermissions])
data Policy = Policy'
{ _pEtag :: !(Maybe Base64)
, _pRules :: !(Maybe [Rule])
, _pVersion :: !(Maybe (Textual Int32))
, _pBindings :: !(Maybe [Binding])
} deriving (Eq,Show,Data,Typeable,Generic)
policy
:: Policy
policy =
Policy'
{ _pEtag = Nothing
, _pRules = Nothing
, _pVersion = Nothing
, _pBindings = Nothing
}
pEtag :: Lens' Policy (Maybe ByteString)
pEtag
= lens _pEtag (\ s a -> s{_pEtag = a}) .
mapping _Base64
pRules :: Lens' Policy [Rule]
pRules
= lens _pRules (\ s a -> s{_pRules = a}) . _Default .
_Coerce
pVersion :: Lens' Policy (Maybe Int32)
pVersion
= lens _pVersion (\ s a -> s{_pVersion = a}) .
mapping _Coerce
pBindings :: Lens' Policy [Binding]
pBindings
= lens _pBindings (\ s a -> s{_pBindings = a}) .
_Default
. _Coerce
instance FromJSON Policy where
parseJSON
= withObject "Policy"
(\ o ->
Policy' <$>
(o .:? "etag") <*> (o .:? "rules" .!= mempty) <*>
(o .:? "version")
<*> (o .:? "bindings" .!= mempty))
instance ToJSON Policy where
toJSON Policy'{..}
= object
(catMaybes
[("etag" .=) <$> _pEtag, ("rules" .=) <$> _pRules,
("version" .=) <$> _pVersion,
("bindings" .=) <$> _pBindings])
data Condition = Condition'
{ _cOp :: !(Maybe Text)
, _cIAM :: !(Maybe Text)
, _cValues :: !(Maybe [Text])
, _cValue :: !(Maybe Text)
, _cSys :: !(Maybe Text)
, _cSvc :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
condition
:: Condition
condition =
Condition'
{ _cOp = Nothing
, _cIAM = Nothing
, _cValues = Nothing
, _cValue = Nothing
, _cSys = Nothing
, _cSvc = Nothing
}
cOp :: Lens' Condition (Maybe Text)
cOp = lens _cOp (\ s a -> s{_cOp = a})
cIAM :: Lens' Condition (Maybe Text)
cIAM = lens _cIAM (\ s a -> s{_cIAM = a})
cValues :: Lens' Condition [Text]
cValues
= lens _cValues (\ s a -> s{_cValues = a}) . _Default
. _Coerce
cValue :: Lens' Condition (Maybe Text)
cValue = lens _cValue (\ s a -> s{_cValue = a})
cSys :: Lens' Condition (Maybe Text)
cSys = lens _cSys (\ s a -> s{_cSys = a})
cSvc :: Lens' Condition (Maybe Text)
cSvc = lens _cSvc (\ s a -> s{_cSvc = a})
instance FromJSON Condition where
parseJSON
= withObject "Condition"
(\ o ->
Condition' <$>
(o .:? "op") <*> (o .:? "iam") <*>
(o .:? "values" .!= mempty)
<*> (o .:? "value")
<*> (o .:? "sys")
<*> (o .:? "svc"))
instance ToJSON Condition where
toJSON Condition'{..}
= object
(catMaybes
[("op" .=) <$> _cOp, ("iam" .=) <$> _cIAM,
("values" .=) <$> _cValues, ("value" .=) <$> _cValue,
("sys" .=) <$> _cSys, ("svc" .=) <$> _cSvc])
data SignBlobResponse = SignBlobResponse'
{ _sbrSignature :: !(Maybe Base64)
, _sbrKeyId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
signBlobResponse
:: SignBlobResponse
signBlobResponse =
SignBlobResponse'
{ _sbrSignature = Nothing
, _sbrKeyId = Nothing
}
sbrSignature :: Lens' SignBlobResponse (Maybe ByteString)
sbrSignature
= lens _sbrSignature (\ s a -> s{_sbrSignature = a})
. mapping _Base64
sbrKeyId :: Lens' SignBlobResponse (Maybe Text)
sbrKeyId = lens _sbrKeyId (\ s a -> s{_sbrKeyId = a})
instance FromJSON SignBlobResponse where
parseJSON
= withObject "SignBlobResponse"
(\ o ->
SignBlobResponse' <$>
(o .:? "signature") <*> (o .:? "keyId"))
instance ToJSON SignBlobResponse where
toJSON SignBlobResponse'{..}
= object
(catMaybes
[("signature" .=) <$> _sbrSignature,
("keyId" .=) <$> _sbrKeyId])
data ListServiceAccountsResponse = ListServiceAccountsResponse'
{ _lsarNextPageToken :: !(Maybe Text)
, _lsarAccounts :: !(Maybe [ServiceAccount])
} deriving (Eq,Show,Data,Typeable,Generic)
listServiceAccountsResponse
:: ListServiceAccountsResponse
listServiceAccountsResponse =
ListServiceAccountsResponse'
{ _lsarNextPageToken = Nothing
, _lsarAccounts = Nothing
}
lsarNextPageToken :: Lens' ListServiceAccountsResponse (Maybe Text)
lsarNextPageToken
= lens _lsarNextPageToken
(\ s a -> s{_lsarNextPageToken = a})
lsarAccounts :: Lens' ListServiceAccountsResponse [ServiceAccount]
lsarAccounts
= lens _lsarAccounts (\ s a -> s{_lsarAccounts = a})
. _Default
. _Coerce
instance FromJSON ListServiceAccountsResponse where
parseJSON
= withObject "ListServiceAccountsResponse"
(\ o ->
ListServiceAccountsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "accounts" .!= mempty))
instance ToJSON ListServiceAccountsResponse where
toJSON ListServiceAccountsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lsarNextPageToken,
("accounts" .=) <$> _lsarAccounts])
data LogConfig = LogConfig'
{ _lcCloudAudit :: !(Maybe CloudAuditOptions)
, _lcDataAccess :: !(Maybe DataAccessOptions)
, _lcCounter :: !(Maybe CounterOptions)
} deriving (Eq,Show,Data,Typeable,Generic)
logConfig
:: LogConfig
logConfig =
LogConfig'
{ _lcCloudAudit = Nothing
, _lcDataAccess = Nothing
, _lcCounter = Nothing
}
lcCloudAudit :: Lens' LogConfig (Maybe CloudAuditOptions)
lcCloudAudit
= lens _lcCloudAudit (\ s a -> s{_lcCloudAudit = a})
lcDataAccess :: Lens' LogConfig (Maybe DataAccessOptions)
lcDataAccess
= lens _lcDataAccess (\ s a -> s{_lcDataAccess = a})
lcCounter :: Lens' LogConfig (Maybe CounterOptions)
lcCounter
= lens _lcCounter (\ s a -> s{_lcCounter = a})
instance FromJSON LogConfig where
parseJSON
= withObject "LogConfig"
(\ o ->
LogConfig' <$>
(o .:? "cloudAudit") <*> (o .:? "dataAccess") <*>
(o .:? "counter"))
instance ToJSON LogConfig where
toJSON LogConfig'{..}
= object
(catMaybes
[("cloudAudit" .=) <$> _lcCloudAudit,
("dataAccess" .=) <$> _lcDataAccess,
("counter" .=) <$> _lcCounter])
data CreateServiceAccountRequest = CreateServiceAccountRequest'
{ _csarServiceAccount :: !(Maybe ServiceAccount)
, _csarAccountId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
createServiceAccountRequest
:: CreateServiceAccountRequest
createServiceAccountRequest =
CreateServiceAccountRequest'
{ _csarServiceAccount = Nothing
, _csarAccountId = Nothing
}
csarServiceAccount :: Lens' CreateServiceAccountRequest (Maybe ServiceAccount)
csarServiceAccount
= lens _csarServiceAccount
(\ s a -> s{_csarServiceAccount = a})
csarAccountId :: Lens' CreateServiceAccountRequest (Maybe Text)
csarAccountId
= lens _csarAccountId
(\ s a -> s{_csarAccountId = a})
instance FromJSON CreateServiceAccountRequest where
parseJSON
= withObject "CreateServiceAccountRequest"
(\ o ->
CreateServiceAccountRequest' <$>
(o .:? "serviceAccount") <*> (o .:? "accountId"))
instance ToJSON CreateServiceAccountRequest where
toJSON CreateServiceAccountRequest'{..}
= object
(catMaybes
[("serviceAccount" .=) <$> _csarServiceAccount,
("accountId" .=) <$> _csarAccountId])
data Binding = Binding'
{ _bMembers :: !(Maybe [Text])
, _bRole :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
binding
:: Binding
binding =
Binding'
{ _bMembers = Nothing
, _bRole = Nothing
}
bMembers :: Lens' Binding [Text]
bMembers
= lens _bMembers (\ s a -> s{_bMembers = a}) .
_Default
. _Coerce
bRole :: Lens' Binding (Maybe Text)
bRole = lens _bRole (\ s a -> s{_bRole = a})
instance FromJSON Binding where
parseJSON
= withObject "Binding"
(\ o ->
Binding' <$>
(o .:? "members" .!= mempty) <*> (o .:? "role"))
instance ToJSON Binding where
toJSON Binding'{..}
= object
(catMaybes
[("members" .=) <$> _bMembers,
("role" .=) <$> _bRole])