{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.PubSub.Types.Product where
import Network.Google.Prelude
import Network.Google.PubSub.Types.Sum
data PushConfig =
PushConfig'
{ _pcOidcToken :: !(Maybe OidcToken)
, _pcAttributes :: !(Maybe PushConfigAttributes)
, _pcPushEndpoint :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
pushConfig
:: PushConfig
pushConfig =
PushConfig'
{_pcOidcToken = Nothing, _pcAttributes = Nothing, _pcPushEndpoint = Nothing}
pcOidcToken :: Lens' PushConfig (Maybe OidcToken)
pcOidcToken
= lens _pcOidcToken (\ s a -> s{_pcOidcToken = a})
pcAttributes :: Lens' PushConfig (Maybe PushConfigAttributes)
pcAttributes
= lens _pcAttributes (\ s a -> s{_pcAttributes = a})
pcPushEndpoint :: Lens' PushConfig (Maybe Text)
pcPushEndpoint
= lens _pcPushEndpoint
(\ s a -> s{_pcPushEndpoint = a})
instance FromJSON PushConfig where
parseJSON
= withObject "PushConfig"
(\ o ->
PushConfig' <$>
(o .:? "oidcToken") <*> (o .:? "attributes") <*>
(o .:? "pushEndpoint"))
instance ToJSON PushConfig where
toJSON PushConfig'{..}
= object
(catMaybes
[("oidcToken" .=) <$> _pcOidcToken,
("attributes" .=) <$> _pcAttributes,
("pushEndpoint" .=) <$> _pcPushEndpoint])
data ReceivedMessage =
ReceivedMessage'
{ _rmAckId :: !(Maybe Text)
, _rmMessage :: !(Maybe PubsubMessage)
}
deriving (Eq, Show, Data, Typeable, Generic)
receivedMessage
:: ReceivedMessage
receivedMessage = ReceivedMessage' {_rmAckId = Nothing, _rmMessage = Nothing}
rmAckId :: Lens' ReceivedMessage (Maybe Text)
rmAckId = lens _rmAckId (\ s a -> s{_rmAckId = a})
rmMessage :: Lens' ReceivedMessage (Maybe PubsubMessage)
rmMessage
= lens _rmMessage (\ s a -> s{_rmMessage = a})
instance FromJSON ReceivedMessage where
parseJSON
= withObject "ReceivedMessage"
(\ o ->
ReceivedMessage' <$>
(o .:? "ackId") <*> (o .:? "message"))
instance ToJSON ReceivedMessage where
toJSON ReceivedMessage'{..}
= object
(catMaybes
[("ackId" .=) <$> _rmAckId,
("message" .=) <$> _rmMessage])
data Snapshot =
Snapshot'
{ _sTopic :: !(Maybe Text)
, _sName :: !(Maybe Text)
, _sLabels :: !(Maybe SnapshotLabels)
, _sExpireTime :: !(Maybe DateTime')
}
deriving (Eq, Show, Data, Typeable, Generic)
snapshot
:: Snapshot
snapshot =
Snapshot'
{ _sTopic = Nothing
, _sName = Nothing
, _sLabels = Nothing
, _sExpireTime = Nothing
}
sTopic :: Lens' Snapshot (Maybe Text)
sTopic = lens _sTopic (\ s a -> s{_sTopic = a})
sName :: Lens' Snapshot (Maybe Text)
sName = lens _sName (\ s a -> s{_sName = a})
sLabels :: Lens' Snapshot (Maybe SnapshotLabels)
sLabels = lens _sLabels (\ s a -> s{_sLabels = a})
sExpireTime :: Lens' Snapshot (Maybe UTCTime)
sExpireTime
= lens _sExpireTime (\ s a -> s{_sExpireTime = a}) .
mapping _DateTime
instance FromJSON Snapshot where
parseJSON
= withObject "Snapshot"
(\ o ->
Snapshot' <$>
(o .:? "topic") <*> (o .:? "name") <*>
(o .:? "labels")
<*> (o .:? "expireTime"))
instance ToJSON Snapshot where
toJSON Snapshot'{..}
= object
(catMaybes
[("topic" .=) <$> _sTopic, ("name" .=) <$> _sName,
("labels" .=) <$> _sLabels,
("expireTime" .=) <$> _sExpireTime])
data ListTopicSnapshotsResponse =
ListTopicSnapshotsResponse'
{ _ltsrNextPageToken :: !(Maybe Text)
, _ltsrSnapshots :: !(Maybe [Text])
}
deriving (Eq, Show, Data, Typeable, Generic)
listTopicSnapshotsResponse
:: ListTopicSnapshotsResponse
listTopicSnapshotsResponse =
ListTopicSnapshotsResponse'
{_ltsrNextPageToken = Nothing, _ltsrSnapshots = Nothing}
ltsrNextPageToken :: Lens' ListTopicSnapshotsResponse (Maybe Text)
ltsrNextPageToken
= lens _ltsrNextPageToken
(\ s a -> s{_ltsrNextPageToken = a})
ltsrSnapshots :: Lens' ListTopicSnapshotsResponse [Text]
ltsrSnapshots
= lens _ltsrSnapshots
(\ s a -> s{_ltsrSnapshots = a})
. _Default
. _Coerce
instance FromJSON ListTopicSnapshotsResponse where
parseJSON
= withObject "ListTopicSnapshotsResponse"
(\ o ->
ListTopicSnapshotsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "snapshots" .!= mempty))
instance ToJSON ListTopicSnapshotsResponse where
toJSON ListTopicSnapshotsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _ltsrNextPageToken,
("snapshots" .=) <$> _ltsrSnapshots])
data Expr =
Expr'
{ _eLocation :: !(Maybe Text)
, _eExpression :: !(Maybe Text)
, _eTitle :: !(Maybe Text)
, _eDescription :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
expr
:: Expr
expr =
Expr'
{ _eLocation = Nothing
, _eExpression = Nothing
, _eTitle = Nothing
, _eDescription = Nothing
}
eLocation :: Lens' Expr (Maybe Text)
eLocation
= lens _eLocation (\ s a -> s{_eLocation = a})
eExpression :: Lens' Expr (Maybe Text)
eExpression
= lens _eExpression (\ s a -> s{_eExpression = a})
eTitle :: Lens' Expr (Maybe Text)
eTitle = lens _eTitle (\ s a -> s{_eTitle = a})
eDescription :: Lens' Expr (Maybe Text)
eDescription
= lens _eDescription (\ s a -> s{_eDescription = a})
instance FromJSON Expr where
parseJSON
= withObject "Expr"
(\ o ->
Expr' <$>
(o .:? "location") <*> (o .:? "expression") <*>
(o .:? "title")
<*> (o .:? "description"))
instance ToJSON Expr where
toJSON Expr'{..}
= object
(catMaybes
[("location" .=) <$> _eLocation,
("expression" .=) <$> _eExpression,
("title" .=) <$> _eTitle,
("description" .=) <$> _eDescription])
data OidcToken =
OidcToken'
{ _otAudience :: !(Maybe Text)
, _otServiceAccountEmail :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
oidcToken
:: OidcToken
oidcToken = OidcToken' {_otAudience = Nothing, _otServiceAccountEmail = Nothing}
otAudience :: Lens' OidcToken (Maybe Text)
otAudience
= lens _otAudience (\ s a -> s{_otAudience = a})
otServiceAccountEmail :: Lens' OidcToken (Maybe Text)
otServiceAccountEmail
= lens _otServiceAccountEmail
(\ s a -> s{_otServiceAccountEmail = a})
instance FromJSON OidcToken where
parseJSON
= withObject "OidcToken"
(\ o ->
OidcToken' <$>
(o .:? "audience") <*> (o .:? "serviceAccountEmail"))
instance ToJSON OidcToken where
toJSON OidcToken'{..}
= object
(catMaybes
[("audience" .=) <$> _otAudience,
("serviceAccountEmail" .=) <$>
_otServiceAccountEmail])
data ModifyAckDeadlineRequest =
ModifyAckDeadlineRequest'
{ _madrAckIds :: !(Maybe [Text])
, _madrAckDeadlineSeconds :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
modifyAckDeadlineRequest
:: ModifyAckDeadlineRequest
modifyAckDeadlineRequest =
ModifyAckDeadlineRequest'
{_madrAckIds = Nothing, _madrAckDeadlineSeconds = Nothing}
madrAckIds :: Lens' ModifyAckDeadlineRequest [Text]
madrAckIds
= lens _madrAckIds (\ s a -> s{_madrAckIds = a}) .
_Default
. _Coerce
madrAckDeadlineSeconds :: Lens' ModifyAckDeadlineRequest (Maybe Int32)
madrAckDeadlineSeconds
= lens _madrAckDeadlineSeconds
(\ s a -> s{_madrAckDeadlineSeconds = a})
. mapping _Coerce
instance FromJSON ModifyAckDeadlineRequest where
parseJSON
= withObject "ModifyAckDeadlineRequest"
(\ o ->
ModifyAckDeadlineRequest' <$>
(o .:? "ackIds" .!= mempty) <*>
(o .:? "ackDeadlineSeconds"))
instance ToJSON ModifyAckDeadlineRequest where
toJSON ModifyAckDeadlineRequest'{..}
= object
(catMaybes
[("ackIds" .=) <$> _madrAckIds,
("ackDeadlineSeconds" .=) <$>
_madrAckDeadlineSeconds])
newtype ModifyPushConfigRequest =
ModifyPushConfigRequest'
{ _mpcrPushConfig :: Maybe PushConfig
}
deriving (Eq, Show, Data, Typeable, Generic)
modifyPushConfigRequest
:: ModifyPushConfigRequest
modifyPushConfigRequest = ModifyPushConfigRequest' {_mpcrPushConfig = Nothing}
mpcrPushConfig :: Lens' ModifyPushConfigRequest (Maybe PushConfig)
mpcrPushConfig
= lens _mpcrPushConfig
(\ s a -> s{_mpcrPushConfig = a})
instance FromJSON ModifyPushConfigRequest where
parseJSON
= withObject "ModifyPushConfigRequest"
(\ o ->
ModifyPushConfigRequest' <$> (o .:? "pushConfig"))
instance ToJSON ModifyPushConfigRequest where
toJSON ModifyPushConfigRequest'{..}
= object
(catMaybes [("pushConfig" .=) <$> _mpcrPushConfig])
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 PubsubMessage =
PubsubMessage'
{ _pmData :: !(Maybe Bytes)
, _pmPublishTime :: !(Maybe DateTime')
, _pmAttributes :: !(Maybe PubsubMessageAttributes)
, _pmMessageId :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
pubsubMessage
:: PubsubMessage
pubsubMessage =
PubsubMessage'
{ _pmData = Nothing
, _pmPublishTime = Nothing
, _pmAttributes = Nothing
, _pmMessageId = Nothing
}
pmData :: Lens' PubsubMessage (Maybe ByteString)
pmData
= lens _pmData (\ s a -> s{_pmData = a}) .
mapping _Bytes
pmPublishTime :: Lens' PubsubMessage (Maybe UTCTime)
pmPublishTime
= lens _pmPublishTime
(\ s a -> s{_pmPublishTime = a})
. mapping _DateTime
pmAttributes :: Lens' PubsubMessage (Maybe PubsubMessageAttributes)
pmAttributes
= lens _pmAttributes (\ s a -> s{_pmAttributes = a})
pmMessageId :: Lens' PubsubMessage (Maybe Text)
pmMessageId
= lens _pmMessageId (\ s a -> s{_pmMessageId = a})
instance FromJSON PubsubMessage where
parseJSON
= withObject "PubsubMessage"
(\ o ->
PubsubMessage' <$>
(o .:? "data") <*> (o .:? "publishTime") <*>
(o .:? "attributes")
<*> (o .:? "messageId"))
instance ToJSON PubsubMessage where
toJSON PubsubMessage'{..}
= object
(catMaybes
[("data" .=) <$> _pmData,
("publishTime" .=) <$> _pmPublishTime,
("attributes" .=) <$> _pmAttributes,
("messageId" .=) <$> _pmMessageId])
data ListTopicSubscriptionsResponse =
ListTopicSubscriptionsResponse'
{ _lNextPageToken :: !(Maybe Text)
, _lSubscriptions :: !(Maybe [Text])
}
deriving (Eq, Show, Data, Typeable, Generic)
listTopicSubscriptionsResponse
:: ListTopicSubscriptionsResponse
listTopicSubscriptionsResponse =
ListTopicSubscriptionsResponse'
{_lNextPageToken = Nothing, _lSubscriptions = Nothing}
lNextPageToken :: Lens' ListTopicSubscriptionsResponse (Maybe Text)
lNextPageToken
= lens _lNextPageToken
(\ s a -> s{_lNextPageToken = a})
lSubscriptions :: Lens' ListTopicSubscriptionsResponse [Text]
lSubscriptions
= lens _lSubscriptions
(\ s a -> s{_lSubscriptions = a})
. _Default
. _Coerce
instance FromJSON ListTopicSubscriptionsResponse
where
parseJSON
= withObject "ListTopicSubscriptionsResponse"
(\ o ->
ListTopicSubscriptionsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "subscriptions" .!= mempty))
instance ToJSON ListTopicSubscriptionsResponse where
toJSON ListTopicSubscriptionsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lNextPageToken,
("subscriptions" .=) <$> _lSubscriptions])
data ListTopicsResponse =
ListTopicsResponse'
{ _ltrNextPageToken :: !(Maybe Text)
, _ltrTopics :: !(Maybe [Topic])
}
deriving (Eq, Show, Data, Typeable, Generic)
listTopicsResponse
:: ListTopicsResponse
listTopicsResponse =
ListTopicsResponse' {_ltrNextPageToken = Nothing, _ltrTopics = Nothing}
ltrNextPageToken :: Lens' ListTopicsResponse (Maybe Text)
ltrNextPageToken
= lens _ltrNextPageToken
(\ s a -> s{_ltrNextPageToken = a})
ltrTopics :: Lens' ListTopicsResponse [Topic]
ltrTopics
= lens _ltrTopics (\ s a -> s{_ltrTopics = a}) .
_Default
. _Coerce
instance FromJSON ListTopicsResponse where
parseJSON
= withObject "ListTopicsResponse"
(\ o ->
ListTopicsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "topics" .!= mempty))
instance ToJSON ListTopicsResponse where
toJSON ListTopicsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _ltrNextPageToken,
("topics" .=) <$> _ltrTopics])
newtype PullResponse =
PullResponse'
{ _prReceivedMessages :: Maybe [ReceivedMessage]
}
deriving (Eq, Show, Data, Typeable, Generic)
pullResponse
:: PullResponse
pullResponse = PullResponse' {_prReceivedMessages = Nothing}
prReceivedMessages :: Lens' PullResponse [ReceivedMessage]
prReceivedMessages
= lens _prReceivedMessages
(\ s a -> s{_prReceivedMessages = a})
. _Default
. _Coerce
instance FromJSON PullResponse where
parseJSON
= withObject "PullResponse"
(\ o ->
PullResponse' <$>
(o .:? "receivedMessages" .!= mempty))
instance ToJSON PullResponse where
toJSON PullResponse'{..}
= object
(catMaybes
[("receivedMessages" .=) <$> _prReceivedMessages])
data ListSnapshotsResponse =
ListSnapshotsResponse'
{ _lsrNextPageToken :: !(Maybe Text)
, _lsrSnapshots :: !(Maybe [Snapshot])
}
deriving (Eq, Show, Data, Typeable, Generic)
listSnapshotsResponse
:: ListSnapshotsResponse
listSnapshotsResponse =
ListSnapshotsResponse' {_lsrNextPageToken = Nothing, _lsrSnapshots = Nothing}
lsrNextPageToken :: Lens' ListSnapshotsResponse (Maybe Text)
lsrNextPageToken
= lens _lsrNextPageToken
(\ s a -> s{_lsrNextPageToken = a})
lsrSnapshots :: Lens' ListSnapshotsResponse [Snapshot]
lsrSnapshots
= lens _lsrSnapshots (\ s a -> s{_lsrSnapshots = a})
. _Default
. _Coerce
instance FromJSON ListSnapshotsResponse where
parseJSON
= withObject "ListSnapshotsResponse"
(\ o ->
ListSnapshotsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "snapshots" .!= mempty))
instance ToJSON ListSnapshotsResponse where
toJSON ListSnapshotsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lsrNextPageToken,
("snapshots" .=) <$> _lsrSnapshots])
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])
data CreateSnapshotRequest =
CreateSnapshotRequest'
{ _csrLabels :: !(Maybe CreateSnapshotRequestLabels)
, _csrSubscription :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
createSnapshotRequest
:: CreateSnapshotRequest
createSnapshotRequest =
CreateSnapshotRequest' {_csrLabels = Nothing, _csrSubscription = Nothing}
csrLabels :: Lens' CreateSnapshotRequest (Maybe CreateSnapshotRequestLabels)
csrLabels
= lens _csrLabels (\ s a -> s{_csrLabels = a})
csrSubscription :: Lens' CreateSnapshotRequest (Maybe Text)
csrSubscription
= lens _csrSubscription
(\ s a -> s{_csrSubscription = a})
instance FromJSON CreateSnapshotRequest where
parseJSON
= withObject "CreateSnapshotRequest"
(\ o ->
CreateSnapshotRequest' <$>
(o .:? "labels") <*> (o .:? "subscription"))
instance ToJSON CreateSnapshotRequest where
toJSON CreateSnapshotRequest'{..}
= object
(catMaybes
[("labels" .=) <$> _csrLabels,
("subscription" .=) <$> _csrSubscription])
data SeekRequest =
SeekRequest'
{ _srSnapshot :: !(Maybe Text)
, _srTime :: !(Maybe DateTime')
}
deriving (Eq, Show, Data, Typeable, Generic)
seekRequest
:: SeekRequest
seekRequest = SeekRequest' {_srSnapshot = Nothing, _srTime = Nothing}
srSnapshot :: Lens' SeekRequest (Maybe Text)
srSnapshot
= lens _srSnapshot (\ s a -> s{_srSnapshot = a})
srTime :: Lens' SeekRequest (Maybe UTCTime)
srTime
= lens _srTime (\ s a -> s{_srTime = a}) .
mapping _DateTime
instance FromJSON SeekRequest where
parseJSON
= withObject "SeekRequest"
(\ o ->
SeekRequest' <$>
(o .:? "snapshot") <*> (o .:? "time"))
instance ToJSON SeekRequest where
toJSON SeekRequest'{..}
= object
(catMaybes
[("snapshot" .=) <$> _srSnapshot,
("time" .=) <$> _srTime])
data Topic =
Topic'
{ _tName :: !(Maybe Text)
, _tLabels :: !(Maybe TopicLabels)
}
deriving (Eq, Show, Data, Typeable, Generic)
topic
:: Topic
topic = Topic' {_tName = Nothing, _tLabels = Nothing}
tName :: Lens' Topic (Maybe Text)
tName = lens _tName (\ s a -> s{_tName = a})
tLabels :: Lens' Topic (Maybe TopicLabels)
tLabels = lens _tLabels (\ s a -> s{_tLabels = a})
instance FromJSON Topic where
parseJSON
= withObject "Topic"
(\ o ->
Topic' <$> (o .:? "name") <*> (o .:? "labels"))
instance ToJSON Topic where
toJSON Topic'{..}
= object
(catMaybes
[("name" .=) <$> _tName, ("labels" .=) <$> _tLabels])
newtype TopicLabels =
TopicLabels'
{ _tlAddtional :: HashMap Text Text
}
deriving (Eq, Show, Data, Typeable, Generic)
topicLabels
:: HashMap Text Text
-> TopicLabels
topicLabels pTlAddtional_ =
TopicLabels' {_tlAddtional = _Coerce # pTlAddtional_}
tlAddtional :: Lens' TopicLabels (HashMap Text Text)
tlAddtional
= lens _tlAddtional (\ s a -> s{_tlAddtional = a}) .
_Coerce
instance FromJSON TopicLabels where
parseJSON
= withObject "TopicLabels"
(\ o -> TopicLabels' <$> (parseJSONObject o))
instance ToJSON TopicLabels where
toJSON = toJSON . _tlAddtional
newtype CreateSnapshotRequestLabels =
CreateSnapshotRequestLabels'
{ _csrlAddtional :: HashMap Text Text
}
deriving (Eq, Show, Data, Typeable, Generic)
createSnapshotRequestLabels
:: HashMap Text Text
-> CreateSnapshotRequestLabels
createSnapshotRequestLabels pCsrlAddtional_ =
CreateSnapshotRequestLabels' {_csrlAddtional = _Coerce # pCsrlAddtional_}
csrlAddtional :: Lens' CreateSnapshotRequestLabels (HashMap Text Text)
csrlAddtional
= lens _csrlAddtional
(\ s a -> s{_csrlAddtional = a})
. _Coerce
instance FromJSON CreateSnapshotRequestLabels where
parseJSON
= withObject "CreateSnapshotRequestLabels"
(\ o ->
CreateSnapshotRequestLabels' <$> (parseJSONObject o))
instance ToJSON CreateSnapshotRequestLabels where
toJSON = toJSON . _csrlAddtional
data UpdateSnapshotRequest =
UpdateSnapshotRequest'
{ _usrSnapshot :: !(Maybe Snapshot)
, _usrUpdateMask :: !(Maybe GFieldMask)
}
deriving (Eq, Show, Data, Typeable, Generic)
updateSnapshotRequest
:: UpdateSnapshotRequest
updateSnapshotRequest =
UpdateSnapshotRequest' {_usrSnapshot = Nothing, _usrUpdateMask = Nothing}
usrSnapshot :: Lens' UpdateSnapshotRequest (Maybe Snapshot)
usrSnapshot
= lens _usrSnapshot (\ s a -> s{_usrSnapshot = a})
usrUpdateMask :: Lens' UpdateSnapshotRequest (Maybe GFieldMask)
usrUpdateMask
= lens _usrUpdateMask
(\ s a -> s{_usrUpdateMask = a})
instance FromJSON UpdateSnapshotRequest where
parseJSON
= withObject "UpdateSnapshotRequest"
(\ o ->
UpdateSnapshotRequest' <$>
(o .:? "snapshot") <*> (o .:? "updateMask"))
instance ToJSON UpdateSnapshotRequest where
toJSON UpdateSnapshotRequest'{..}
= object
(catMaybes
[("snapshot" .=) <$> _usrSnapshot,
("updateMask" .=) <$> _usrUpdateMask])
data PullRequest =
PullRequest'
{ _prMaxMessages :: !(Maybe (Textual Int32))
, _prReturnImmediately :: !(Maybe Bool)
}
deriving (Eq, Show, Data, Typeable, Generic)
pullRequest
:: PullRequest
pullRequest =
PullRequest' {_prMaxMessages = Nothing, _prReturnImmediately = Nothing}
prMaxMessages :: Lens' PullRequest (Maybe Int32)
prMaxMessages
= lens _prMaxMessages
(\ s a -> s{_prMaxMessages = a})
. mapping _Coerce
prReturnImmediately :: Lens' PullRequest (Maybe Bool)
prReturnImmediately
= lens _prReturnImmediately
(\ s a -> s{_prReturnImmediately = a})
instance FromJSON PullRequest where
parseJSON
= withObject "PullRequest"
(\ o ->
PullRequest' <$>
(o .:? "maxMessages") <*>
(o .:? "returnImmediately"))
instance ToJSON PullRequest where
toJSON PullRequest'{..}
= object
(catMaybes
[("maxMessages" .=) <$> _prMaxMessages,
("returnImmediately" .=) <$> _prReturnImmediately])
newtype PubsubMessageAttributes =
PubsubMessageAttributes'
{ _pmaAddtional :: HashMap Text Text
}
deriving (Eq, Show, Data, Typeable, Generic)
pubsubMessageAttributes
:: HashMap Text Text
-> PubsubMessageAttributes
pubsubMessageAttributes pPmaAddtional_ =
PubsubMessageAttributes' {_pmaAddtional = _Coerce # pPmaAddtional_}
pmaAddtional :: Lens' PubsubMessageAttributes (HashMap Text Text)
pmaAddtional
= lens _pmaAddtional (\ s a -> s{_pmaAddtional = a})
. _Coerce
instance FromJSON PubsubMessageAttributes where
parseJSON
= withObject "PubsubMessageAttributes"
(\ o ->
PubsubMessageAttributes' <$> (parseJSONObject o))
instance ToJSON PubsubMessageAttributes where
toJSON = toJSON . _pmaAddtional
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 PublishResponse =
PublishResponse'
{ _prMessageIds :: Maybe [Text]
}
deriving (Eq, Show, Data, Typeable, Generic)
publishResponse
:: PublishResponse
publishResponse = PublishResponse' {_prMessageIds = Nothing}
prMessageIds :: Lens' PublishResponse [Text]
prMessageIds
= lens _prMessageIds (\ s a -> s{_prMessageIds = a})
. _Default
. _Coerce
instance FromJSON PublishResponse where
parseJSON
= withObject "PublishResponse"
(\ o ->
PublishResponse' <$> (o .:? "messageIds" .!= mempty))
instance ToJSON PublishResponse where
toJSON PublishResponse'{..}
= object
(catMaybes [("messageIds" .=) <$> _prMessageIds])
newtype PublishRequest =
PublishRequest'
{ _prMessages :: Maybe [PubsubMessage]
}
deriving (Eq, Show, Data, Typeable, Generic)
publishRequest
:: PublishRequest
publishRequest = PublishRequest' {_prMessages = Nothing}
prMessages :: Lens' PublishRequest [PubsubMessage]
prMessages
= lens _prMessages (\ s a -> s{_prMessages = a}) .
_Default
. _Coerce
instance FromJSON PublishRequest where
parseJSON
= withObject "PublishRequest"
(\ o ->
PublishRequest' <$> (o .:? "messages" .!= mempty))
instance ToJSON PublishRequest where
toJSON PublishRequest'{..}
= object
(catMaybes [("messages" .=) <$> _prMessages])
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 Bytes)
, _pVersion :: !(Maybe (Textual Int32))
, _pBindings :: !(Maybe [Binding])
}
deriving (Eq, Show, Data, Typeable, Generic)
policy
:: Policy
policy = Policy' {_pEtag = Nothing, _pVersion = Nothing, _pBindings = Nothing}
pEtag :: Lens' Policy (Maybe ByteString)
pEtag
= lens _pEtag (\ s a -> s{_pEtag = a}) .
mapping _Bytes
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 .:? "version") <*>
(o .:? "bindings" .!= mempty))
instance ToJSON Policy where
toJSON Policy'{..}
= object
(catMaybes
[("etag" .=) <$> _pEtag,
("version" .=) <$> _pVersion,
("bindings" .=) <$> _pBindings])
data SeekResponse =
SeekResponse'
deriving (Eq, Show, Data, Typeable, Generic)
seekResponse
:: SeekResponse
seekResponse = SeekResponse'
instance FromJSON SeekResponse where
parseJSON
= withObject "SeekResponse"
(\ o -> pure SeekResponse')
instance ToJSON SeekResponse where
toJSON = const emptyObject
newtype ExpirationPolicy =
ExpirationPolicy'
{ _epTtl :: Maybe GDuration
}
deriving (Eq, Show, Data, Typeable, Generic)
expirationPolicy
:: ExpirationPolicy
expirationPolicy = ExpirationPolicy' {_epTtl = Nothing}
epTtl :: Lens' ExpirationPolicy (Maybe Scientific)
epTtl
= lens _epTtl (\ s a -> s{_epTtl = a}) .
mapping _GDuration
instance FromJSON ExpirationPolicy where
parseJSON
= withObject "ExpirationPolicy"
(\ o -> ExpirationPolicy' <$> (o .:? "ttl"))
instance ToJSON ExpirationPolicy where
toJSON ExpirationPolicy'{..}
= object (catMaybes [("ttl" .=) <$> _epTtl])
newtype PushConfigAttributes =
PushConfigAttributes'
{ _pcaAddtional :: HashMap Text Text
}
deriving (Eq, Show, Data, Typeable, Generic)
pushConfigAttributes
:: HashMap Text Text
-> PushConfigAttributes
pushConfigAttributes pPcaAddtional_ =
PushConfigAttributes' {_pcaAddtional = _Coerce # pPcaAddtional_}
pcaAddtional :: Lens' PushConfigAttributes (HashMap Text Text)
pcaAddtional
= lens _pcaAddtional (\ s a -> s{_pcaAddtional = a})
. _Coerce
instance FromJSON PushConfigAttributes where
parseJSON
= withObject "PushConfigAttributes"
(\ o ->
PushConfigAttributes' <$> (parseJSONObject o))
instance ToJSON PushConfigAttributes where
toJSON = toJSON . _pcaAddtional
data Subscription =
Subscription'
{ _subPushConfig :: !(Maybe PushConfig)
, _subMessageRetentionDuration :: !(Maybe GDuration)
, _subTopic :: !(Maybe Text)
, _subName :: !(Maybe Text)
, _subLabels :: !(Maybe SubscriptionLabels)
, _subRetainAckedMessages :: !(Maybe Bool)
, _subAckDeadlineSeconds :: !(Maybe (Textual Int32))
, _subExpirationPolicy :: !(Maybe ExpirationPolicy)
}
deriving (Eq, Show, Data, Typeable, Generic)
subscription
:: Subscription
subscription =
Subscription'
{ _subPushConfig = Nothing
, _subMessageRetentionDuration = Nothing
, _subTopic = Nothing
, _subName = Nothing
, _subLabels = Nothing
, _subRetainAckedMessages = Nothing
, _subAckDeadlineSeconds = Nothing
, _subExpirationPolicy = Nothing
}
subPushConfig :: Lens' Subscription (Maybe PushConfig)
subPushConfig
= lens _subPushConfig
(\ s a -> s{_subPushConfig = a})
subMessageRetentionDuration :: Lens' Subscription (Maybe Scientific)
subMessageRetentionDuration
= lens _subMessageRetentionDuration
(\ s a -> s{_subMessageRetentionDuration = a})
. mapping _GDuration
subTopic :: Lens' Subscription (Maybe Text)
subTopic = lens _subTopic (\ s a -> s{_subTopic = a})
subName :: Lens' Subscription (Maybe Text)
subName = lens _subName (\ s a -> s{_subName = a})
subLabels :: Lens' Subscription (Maybe SubscriptionLabels)
subLabels
= lens _subLabels (\ s a -> s{_subLabels = a})
subRetainAckedMessages :: Lens' Subscription (Maybe Bool)
subRetainAckedMessages
= lens _subRetainAckedMessages
(\ s a -> s{_subRetainAckedMessages = a})
subAckDeadlineSeconds :: Lens' Subscription (Maybe Int32)
subAckDeadlineSeconds
= lens _subAckDeadlineSeconds
(\ s a -> s{_subAckDeadlineSeconds = a})
. mapping _Coerce
subExpirationPolicy :: Lens' Subscription (Maybe ExpirationPolicy)
subExpirationPolicy
= lens _subExpirationPolicy
(\ s a -> s{_subExpirationPolicy = a})
instance FromJSON Subscription where
parseJSON
= withObject "Subscription"
(\ o ->
Subscription' <$>
(o .:? "pushConfig") <*>
(o .:? "messageRetentionDuration")
<*> (o .:? "topic")
<*> (o .:? "name")
<*> (o .:? "labels")
<*> (o .:? "retainAckedMessages")
<*> (o .:? "ackDeadlineSeconds")
<*> (o .:? "expirationPolicy"))
instance ToJSON Subscription where
toJSON Subscription'{..}
= object
(catMaybes
[("pushConfig" .=) <$> _subPushConfig,
("messageRetentionDuration" .=) <$>
_subMessageRetentionDuration,
("topic" .=) <$> _subTopic, ("name" .=) <$> _subName,
("labels" .=) <$> _subLabels,
("retainAckedMessages" .=) <$>
_subRetainAckedMessages,
("ackDeadlineSeconds" .=) <$> _subAckDeadlineSeconds,
("expirationPolicy" .=) <$> _subExpirationPolicy])
data UpdateSubscriptionRequest =
UpdateSubscriptionRequest'
{ _uUpdateMask :: !(Maybe GFieldMask)
, _uSubscription :: !(Maybe Subscription)
}
deriving (Eq, Show, Data, Typeable, Generic)
updateSubscriptionRequest
:: UpdateSubscriptionRequest
updateSubscriptionRequest =
UpdateSubscriptionRequest' {_uUpdateMask = Nothing, _uSubscription = Nothing}
uUpdateMask :: Lens' UpdateSubscriptionRequest (Maybe GFieldMask)
uUpdateMask
= lens _uUpdateMask (\ s a -> s{_uUpdateMask = a})
uSubscription :: Lens' UpdateSubscriptionRequest (Maybe Subscription)
uSubscription
= lens _uSubscription
(\ s a -> s{_uSubscription = a})
instance FromJSON UpdateSubscriptionRequest where
parseJSON
= withObject "UpdateSubscriptionRequest"
(\ o ->
UpdateSubscriptionRequest' <$>
(o .:? "updateMask") <*> (o .:? "subscription"))
instance ToJSON UpdateSubscriptionRequest where
toJSON UpdateSubscriptionRequest'{..}
= object
(catMaybes
[("updateMask" .=) <$> _uUpdateMask,
("subscription" .=) <$> _uSubscription])
newtype SubscriptionLabels =
SubscriptionLabels'
{ _slAddtional :: HashMap Text Text
}
deriving (Eq, Show, Data, Typeable, Generic)
subscriptionLabels
:: HashMap Text Text
-> SubscriptionLabels
subscriptionLabels pSlAddtional_ =
SubscriptionLabels' {_slAddtional = _Coerce # pSlAddtional_}
slAddtional :: Lens' SubscriptionLabels (HashMap Text Text)
slAddtional
= lens _slAddtional (\ s a -> s{_slAddtional = a}) .
_Coerce
instance FromJSON SubscriptionLabels where
parseJSON
= withObject "SubscriptionLabels"
(\ o -> SubscriptionLabels' <$> (parseJSONObject o))
instance ToJSON SubscriptionLabels where
toJSON = toJSON . _slAddtional
newtype SnapshotLabels =
SnapshotLabels'
{ _sAddtional :: HashMap Text Text
}
deriving (Eq, Show, Data, Typeable, Generic)
snapshotLabels
:: HashMap Text Text
-> SnapshotLabels
snapshotLabels pSAddtional_ =
SnapshotLabels' {_sAddtional = _Coerce # pSAddtional_}
sAddtional :: Lens' SnapshotLabels (HashMap Text Text)
sAddtional
= lens _sAddtional (\ s a -> s{_sAddtional = a}) .
_Coerce
instance FromJSON SnapshotLabels where
parseJSON
= withObject "SnapshotLabels"
(\ o -> SnapshotLabels' <$> (parseJSONObject o))
instance ToJSON SnapshotLabels where
toJSON = toJSON . _sAddtional
data ListSubscriptionsResponse =
ListSubscriptionsResponse'
{ _lisNextPageToken :: !(Maybe Text)
, _lisSubscriptions :: !(Maybe [Subscription])
}
deriving (Eq, Show, Data, Typeable, Generic)
listSubscriptionsResponse
:: ListSubscriptionsResponse
listSubscriptionsResponse =
ListSubscriptionsResponse'
{_lisNextPageToken = Nothing, _lisSubscriptions = Nothing}
lisNextPageToken :: Lens' ListSubscriptionsResponse (Maybe Text)
lisNextPageToken
= lens _lisNextPageToken
(\ s a -> s{_lisNextPageToken = a})
lisSubscriptions :: Lens' ListSubscriptionsResponse [Subscription]
lisSubscriptions
= lens _lisSubscriptions
(\ s a -> s{_lisSubscriptions = a})
. _Default
. _Coerce
instance FromJSON ListSubscriptionsResponse where
parseJSON
= withObject "ListSubscriptionsResponse"
(\ o ->
ListSubscriptionsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "subscriptions" .!= mempty))
instance ToJSON ListSubscriptionsResponse where
toJSON ListSubscriptionsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lisNextPageToken,
("subscriptions" .=) <$> _lisSubscriptions])
data Binding =
Binding'
{ _bMembers :: !(Maybe [Text])
, _bRole :: !(Maybe Text)
, _bCondition :: !(Maybe Expr)
}
deriving (Eq, Show, Data, Typeable, Generic)
binding
:: Binding
binding =
Binding' {_bMembers = Nothing, _bRole = Nothing, _bCondition = 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})
bCondition :: Lens' Binding (Maybe Expr)
bCondition
= lens _bCondition (\ s a -> s{_bCondition = a})
instance FromJSON Binding where
parseJSON
= withObject "Binding"
(\ o ->
Binding' <$>
(o .:? "members" .!= mempty) <*> (o .:? "role") <*>
(o .:? "condition"))
instance ToJSON Binding where
toJSON Binding'{..}
= object
(catMaybes
[("members" .=) <$> _bMembers,
("role" .=) <$> _bRole,
("condition" .=) <$> _bCondition])
data UpdateTopicRequest =
UpdateTopicRequest'
{ _utrUpdateMask :: !(Maybe GFieldMask)
, _utrTopic :: !(Maybe Topic)
}
deriving (Eq, Show, Data, Typeable, Generic)
updateTopicRequest
:: UpdateTopicRequest
updateTopicRequest =
UpdateTopicRequest' {_utrUpdateMask = Nothing, _utrTopic = Nothing}
utrUpdateMask :: Lens' UpdateTopicRequest (Maybe GFieldMask)
utrUpdateMask
= lens _utrUpdateMask
(\ s a -> s{_utrUpdateMask = a})
utrTopic :: Lens' UpdateTopicRequest (Maybe Topic)
utrTopic = lens _utrTopic (\ s a -> s{_utrTopic = a})
instance FromJSON UpdateTopicRequest where
parseJSON
= withObject "UpdateTopicRequest"
(\ o ->
UpdateTopicRequest' <$>
(o .:? "updateMask") <*> (o .:? "topic"))
instance ToJSON UpdateTopicRequest where
toJSON UpdateTopicRequest'{..}
= object
(catMaybes
[("updateMask" .=) <$> _utrUpdateMask,
("topic" .=) <$> _utrTopic])
newtype AcknowledgeRequest =
AcknowledgeRequest'
{ _arAckIds :: Maybe [Text]
}
deriving (Eq, Show, Data, Typeable, Generic)
acknowledgeRequest
:: AcknowledgeRequest
acknowledgeRequest = AcknowledgeRequest' {_arAckIds = Nothing}
arAckIds :: Lens' AcknowledgeRequest [Text]
arAckIds
= lens _arAckIds (\ s a -> s{_arAckIds = a}) .
_Default
. _Coerce
instance FromJSON AcknowledgeRequest where
parseJSON
= withObject "AcknowledgeRequest"
(\ o ->
AcknowledgeRequest' <$> (o .:? "ackIds" .!= mempty))
instance ToJSON AcknowledgeRequest where
toJSON AcknowledgeRequest'{..}
= object (catMaybes [("ackIds" .=) <$> _arAckIds])