{-# 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.Discovery.Types.Product where
import Network.Google.Discovery.Types.Sum
import Network.Google.Prelude
newtype RestMethodResponse =
RestMethodResponse'
{ _rmrRef :: Maybe Text
}
deriving (Eq, Show, Data, Typeable, Generic)
restMethodResponse
:: RestMethodResponse
restMethodResponse = RestMethodResponse' {_rmrRef = Nothing}
rmrRef :: Lens' RestMethodResponse (Maybe Text)
rmrRef = lens _rmrRef (\ s a -> s{_rmrRef = a})
instance FromJSON RestMethodResponse where
parseJSON
= withObject "RestMethodResponse"
(\ o -> RestMethodResponse' <$> (o .:? "$ref"))
instance ToJSON RestMethodResponse where
toJSON RestMethodResponse'{..}
= object (catMaybes [("$ref" .=) <$> _rmrRef])
newtype RestDescriptionParameters =
RestDescriptionParameters'
{ _rdpAddtional :: HashMap Text JSONSchema
}
deriving (Eq, Show, Data, Typeable, Generic)
restDescriptionParameters
:: HashMap Text JSONSchema
-> RestDescriptionParameters
restDescriptionParameters pRdpAddtional_ =
RestDescriptionParameters' {_rdpAddtional = _Coerce # pRdpAddtional_}
rdpAddtional :: Lens' RestDescriptionParameters (HashMap Text JSONSchema)
rdpAddtional
= lens _rdpAddtional (\ s a -> s{_rdpAddtional = a})
. _Coerce
instance FromJSON RestDescriptionParameters where
parseJSON
= withObject "RestDescriptionParameters"
(\ o ->
RestDescriptionParameters' <$> (parseJSONObject o))
instance ToJSON RestDescriptionParameters where
toJSON = toJSON . _rdpAddtional
data RestMethod =
RestMethod'
{ _rmSupportsMediaDownload :: !(Maybe Bool)
, _rmParameterOrder :: !(Maybe [Text])
, _rmMediaUpload :: !(Maybe RestMethodMediaUpload)
, _rmHTTPMethod :: !(Maybe Text)
, _rmPath :: !(Maybe Text)
, _rmResponse :: !(Maybe RestMethodResponse)
, _rmSupportsMediaUpload :: !(Maybe Bool)
, _rmScopes :: !(Maybe [Text])
, _rmSupportsSubscription :: !(Maybe Bool)
, _rmParameters :: !(Maybe RestMethodParameters)
, _rmId :: !(Maybe Text)
, _rmEtagRequired :: !(Maybe Bool)
, _rmUseMediaDownloadService :: !(Maybe Bool)
, _rmDescription :: !(Maybe Text)
, _rmRequest :: !(Maybe RestMethodRequest)
}
deriving (Eq, Show, Data, Typeable, Generic)
restMethod
:: RestMethod
restMethod =
RestMethod'
{ _rmSupportsMediaDownload = Nothing
, _rmParameterOrder = Nothing
, _rmMediaUpload = Nothing
, _rmHTTPMethod = Nothing
, _rmPath = Nothing
, _rmResponse = Nothing
, _rmSupportsMediaUpload = Nothing
, _rmScopes = Nothing
, _rmSupportsSubscription = Nothing
, _rmParameters = Nothing
, _rmId = Nothing
, _rmEtagRequired = Nothing
, _rmUseMediaDownloadService = Nothing
, _rmDescription = Nothing
, _rmRequest = Nothing
}
rmSupportsMediaDownload :: Lens' RestMethod (Maybe Bool)
rmSupportsMediaDownload
= lens _rmSupportsMediaDownload
(\ s a -> s{_rmSupportsMediaDownload = a})
rmParameterOrder :: Lens' RestMethod [Text]
rmParameterOrder
= lens _rmParameterOrder
(\ s a -> s{_rmParameterOrder = a})
. _Default
. _Coerce
rmMediaUpload :: Lens' RestMethod (Maybe RestMethodMediaUpload)
rmMediaUpload
= lens _rmMediaUpload
(\ s a -> s{_rmMediaUpload = a})
rmHTTPMethod :: Lens' RestMethod (Maybe Text)
rmHTTPMethod
= lens _rmHTTPMethod (\ s a -> s{_rmHTTPMethod = a})
rmPath :: Lens' RestMethod (Maybe Text)
rmPath = lens _rmPath (\ s a -> s{_rmPath = a})
rmResponse :: Lens' RestMethod (Maybe RestMethodResponse)
rmResponse
= lens _rmResponse (\ s a -> s{_rmResponse = a})
rmSupportsMediaUpload :: Lens' RestMethod (Maybe Bool)
rmSupportsMediaUpload
= lens _rmSupportsMediaUpload
(\ s a -> s{_rmSupportsMediaUpload = a})
rmScopes :: Lens' RestMethod [Text]
rmScopes
= lens _rmScopes (\ s a -> s{_rmScopes = a}) .
_Default
. _Coerce
rmSupportsSubscription :: Lens' RestMethod (Maybe Bool)
rmSupportsSubscription
= lens _rmSupportsSubscription
(\ s a -> s{_rmSupportsSubscription = a})
rmParameters :: Lens' RestMethod (Maybe RestMethodParameters)
rmParameters
= lens _rmParameters (\ s a -> s{_rmParameters = a})
rmId :: Lens' RestMethod (Maybe Text)
rmId = lens _rmId (\ s a -> s{_rmId = a})
rmEtagRequired :: Lens' RestMethod (Maybe Bool)
rmEtagRequired
= lens _rmEtagRequired
(\ s a -> s{_rmEtagRequired = a})
rmUseMediaDownloadService :: Lens' RestMethod (Maybe Bool)
rmUseMediaDownloadService
= lens _rmUseMediaDownloadService
(\ s a -> s{_rmUseMediaDownloadService = a})
rmDescription :: Lens' RestMethod (Maybe Text)
rmDescription
= lens _rmDescription
(\ s a -> s{_rmDescription = a})
rmRequest :: Lens' RestMethod (Maybe RestMethodRequest)
rmRequest
= lens _rmRequest (\ s a -> s{_rmRequest = a})
instance FromJSON RestMethod where
parseJSON
= withObject "RestMethod"
(\ o ->
RestMethod' <$>
(o .:? "supportsMediaDownload") <*>
(o .:? "parameterOrder" .!= mempty)
<*> (o .:? "mediaUpload")
<*> (o .:? "httpMethod")
<*> (o .:? "path")
<*> (o .:? "response")
<*> (o .:? "supportsMediaUpload")
<*> (o .:? "scopes" .!= mempty)
<*> (o .:? "supportsSubscription")
<*> (o .:? "parameters")
<*> (o .:? "id")
<*> (o .:? "etagRequired")
<*> (o .:? "useMediaDownloadService")
<*> (o .:? "description")
<*> (o .:? "request"))
instance ToJSON RestMethod where
toJSON RestMethod'{..}
= object
(catMaybes
[("supportsMediaDownload" .=) <$>
_rmSupportsMediaDownload,
("parameterOrder" .=) <$> _rmParameterOrder,
("mediaUpload" .=) <$> _rmMediaUpload,
("httpMethod" .=) <$> _rmHTTPMethod,
("path" .=) <$> _rmPath,
("response" .=) <$> _rmResponse,
("supportsMediaUpload" .=) <$>
_rmSupportsMediaUpload,
("scopes" .=) <$> _rmScopes,
("supportsSubscription" .=) <$>
_rmSupportsSubscription,
("parameters" .=) <$> _rmParameters,
("id" .=) <$> _rmId,
("etagRequired" .=) <$> _rmEtagRequired,
("useMediaDownloadService" .=) <$>
_rmUseMediaDownloadService,
("description" .=) <$> _rmDescription,
("request" .=) <$> _rmRequest])
data RestResource =
RestResource'
{ _rrResources :: !(Maybe RestResourceResources)
, _rrMethods :: !(Maybe RestResourceMethods)
}
deriving (Eq, Show, Data, Typeable, Generic)
restResource
:: RestResource
restResource = RestResource' {_rrResources = Nothing, _rrMethods = Nothing}
rrResources :: Lens' RestResource (Maybe RestResourceResources)
rrResources
= lens _rrResources (\ s a -> s{_rrResources = a})
rrMethods :: Lens' RestResource (Maybe RestResourceMethods)
rrMethods
= lens _rrMethods (\ s a -> s{_rrMethods = a})
instance FromJSON RestResource where
parseJSON
= withObject "RestResource"
(\ o ->
RestResource' <$>
(o .:? "resources") <*> (o .:? "methods"))
instance ToJSON RestResource where
toJSON RestResource'{..}
= object
(catMaybes
[("resources" .=) <$> _rrResources,
("methods" .=) <$> _rrMethods])
newtype RestDescriptionAuthOAuth2Scopes =
RestDescriptionAuthOAuth2Scopes'
{ _rdaoasAddtional :: HashMap Text RestDescriptionAuthOAuth2ScopesAdditional
}
deriving (Eq, Show, Data, Typeable, Generic)
restDescriptionAuthOAuth2Scopes
:: HashMap Text RestDescriptionAuthOAuth2ScopesAdditional
-> RestDescriptionAuthOAuth2Scopes
restDescriptionAuthOAuth2Scopes pRdaoasAddtional_ =
RestDescriptionAuthOAuth2Scopes'
{_rdaoasAddtional = _Coerce # pRdaoasAddtional_}
rdaoasAddtional :: Lens' RestDescriptionAuthOAuth2Scopes (HashMap Text RestDescriptionAuthOAuth2ScopesAdditional)
rdaoasAddtional
= lens _rdaoasAddtional
(\ s a -> s{_rdaoasAddtional = a})
. _Coerce
instance FromJSON RestDescriptionAuthOAuth2Scopes
where
parseJSON
= withObject "RestDescriptionAuthOAuth2Scopes"
(\ o ->
RestDescriptionAuthOAuth2Scopes' <$>
(parseJSONObject o))
instance ToJSON RestDescriptionAuthOAuth2Scopes where
toJSON = toJSON . _rdaoasAddtional
newtype RestDescriptionMethods =
RestDescriptionMethods'
{ _rdmAddtional :: HashMap Text RestMethod
}
deriving (Eq, Show, Data, Typeable, Generic)
restDescriptionMethods
:: HashMap Text RestMethod
-> RestDescriptionMethods
restDescriptionMethods pRdmAddtional_ =
RestDescriptionMethods' {_rdmAddtional = _Coerce # pRdmAddtional_}
rdmAddtional :: Lens' RestDescriptionMethods (HashMap Text RestMethod)
rdmAddtional
= lens _rdmAddtional (\ s a -> s{_rdmAddtional = a})
. _Coerce
instance FromJSON RestDescriptionMethods where
parseJSON
= withObject "RestDescriptionMethods"
(\ o ->
RestDescriptionMethods' <$> (parseJSONObject o))
instance ToJSON RestDescriptionMethods where
toJSON = toJSON . _rdmAddtional
data DirectoryListItemsItem =
DirectoryListItemsItem'
{ _dliiDiscoveryLink :: !(Maybe Text)
, _dliiPreferred :: !(Maybe Bool)
, _dliiKind :: !Text
, _dliiIcons :: !(Maybe DirectoryListItemsItemIcons)
, _dliiName :: !(Maybe Text)
, _dliiVersion :: !(Maybe Text)
, _dliiDocumentationLink :: !(Maybe Text)
, _dliiId :: !(Maybe Text)
, _dliiLabels :: !(Maybe [Text])
, _dliiTitle :: !(Maybe Text)
, _dliiDescription :: !(Maybe Text)
, _dliiDiscoveryRestURL :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
directoryListItemsItem
:: DirectoryListItemsItem
directoryListItemsItem =
DirectoryListItemsItem'
{ _dliiDiscoveryLink = Nothing
, _dliiPreferred = Nothing
, _dliiKind = "discovery#directoryItem"
, _dliiIcons = Nothing
, _dliiName = Nothing
, _dliiVersion = Nothing
, _dliiDocumentationLink = Nothing
, _dliiId = Nothing
, _dliiLabels = Nothing
, _dliiTitle = Nothing
, _dliiDescription = Nothing
, _dliiDiscoveryRestURL = Nothing
}
dliiDiscoveryLink :: Lens' DirectoryListItemsItem (Maybe Text)
dliiDiscoveryLink
= lens _dliiDiscoveryLink
(\ s a -> s{_dliiDiscoveryLink = a})
dliiPreferred :: Lens' DirectoryListItemsItem (Maybe Bool)
dliiPreferred
= lens _dliiPreferred
(\ s a -> s{_dliiPreferred = a})
dliiKind :: Lens' DirectoryListItemsItem Text
dliiKind = lens _dliiKind (\ s a -> s{_dliiKind = a})
dliiIcons :: Lens' DirectoryListItemsItem (Maybe DirectoryListItemsItemIcons)
dliiIcons
= lens _dliiIcons (\ s a -> s{_dliiIcons = a})
dliiName :: Lens' DirectoryListItemsItem (Maybe Text)
dliiName = lens _dliiName (\ s a -> s{_dliiName = a})
dliiVersion :: Lens' DirectoryListItemsItem (Maybe Text)
dliiVersion
= lens _dliiVersion (\ s a -> s{_dliiVersion = a})
dliiDocumentationLink :: Lens' DirectoryListItemsItem (Maybe Text)
dliiDocumentationLink
= lens _dliiDocumentationLink
(\ s a -> s{_dliiDocumentationLink = a})
dliiId :: Lens' DirectoryListItemsItem (Maybe Text)
dliiId = lens _dliiId (\ s a -> s{_dliiId = a})
dliiLabels :: Lens' DirectoryListItemsItem [Text]
dliiLabels
= lens _dliiLabels (\ s a -> s{_dliiLabels = a}) .
_Default
. _Coerce
dliiTitle :: Lens' DirectoryListItemsItem (Maybe Text)
dliiTitle
= lens _dliiTitle (\ s a -> s{_dliiTitle = a})
dliiDescription :: Lens' DirectoryListItemsItem (Maybe Text)
dliiDescription
= lens _dliiDescription
(\ s a -> s{_dliiDescription = a})
dliiDiscoveryRestURL :: Lens' DirectoryListItemsItem (Maybe Text)
dliiDiscoveryRestURL
= lens _dliiDiscoveryRestURL
(\ s a -> s{_dliiDiscoveryRestURL = a})
instance FromJSON DirectoryListItemsItem where
parseJSON
= withObject "DirectoryListItemsItem"
(\ o ->
DirectoryListItemsItem' <$>
(o .:? "discoveryLink") <*> (o .:? "preferred") <*>
(o .:? "kind" .!= "discovery#directoryItem")
<*> (o .:? "icons")
<*> (o .:? "name")
<*> (o .:? "version")
<*> (o .:? "documentationLink")
<*> (o .:? "id")
<*> (o .:? "labels" .!= mempty)
<*> (o .:? "title")
<*> (o .:? "description")
<*> (o .:? "discoveryRestUrl"))
instance ToJSON DirectoryListItemsItem where
toJSON DirectoryListItemsItem'{..}
= object
(catMaybes
[("discoveryLink" .=) <$> _dliiDiscoveryLink,
("preferred" .=) <$> _dliiPreferred,
Just ("kind" .= _dliiKind),
("icons" .=) <$> _dliiIcons,
("name" .=) <$> _dliiName,
("version" .=) <$> _dliiVersion,
("documentationLink" .=) <$> _dliiDocumentationLink,
("id" .=) <$> _dliiId, ("labels" .=) <$> _dliiLabels,
("title" .=) <$> _dliiTitle,
("description" .=) <$> _dliiDescription,
("discoveryRestUrl" .=) <$> _dliiDiscoveryRestURL])
data DirectoryListItemsItemIcons =
DirectoryListItemsItemIcons'
{ _dliiiX16 :: !(Maybe Text)
, _dliiiX32 :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
directoryListItemsItemIcons
:: DirectoryListItemsItemIcons
directoryListItemsItemIcons =
DirectoryListItemsItemIcons' {_dliiiX16 = Nothing, _dliiiX32 = Nothing}
dliiiX16 :: Lens' DirectoryListItemsItemIcons (Maybe Text)
dliiiX16 = lens _dliiiX16 (\ s a -> s{_dliiiX16 = a})
dliiiX32 :: Lens' DirectoryListItemsItemIcons (Maybe Text)
dliiiX32 = lens _dliiiX32 (\ s a -> s{_dliiiX32 = a})
instance FromJSON DirectoryListItemsItemIcons where
parseJSON
= withObject "DirectoryListItemsItemIcons"
(\ o ->
DirectoryListItemsItemIcons' <$>
(o .:? "x16") <*> (o .:? "x32"))
instance ToJSON DirectoryListItemsItemIcons where
toJSON DirectoryListItemsItemIcons'{..}
= object
(catMaybes
[("x16" .=) <$> _dliiiX16, ("x32" .=) <$> _dliiiX32])
newtype RestResourceResources =
RestResourceResources'
{ _rrrAddtional :: HashMap Text RestResource
}
deriving (Eq, Show, Data, Typeable, Generic)
restResourceResources
:: HashMap Text RestResource
-> RestResourceResources
restResourceResources pRrrAddtional_ =
RestResourceResources' {_rrrAddtional = _Coerce # pRrrAddtional_}
rrrAddtional :: Lens' RestResourceResources (HashMap Text RestResource)
rrrAddtional
= lens _rrrAddtional (\ s a -> s{_rrrAddtional = a})
. _Coerce
instance FromJSON RestResourceResources where
parseJSON
= withObject "RestResourceResources"
(\ o ->
RestResourceResources' <$> (parseJSONObject o))
instance ToJSON RestResourceResources where
toJSON = toJSON . _rrrAddtional
newtype RestDescriptionAuthOAuth2 =
RestDescriptionAuthOAuth2'
{ _rdaoaScopes :: Maybe RestDescriptionAuthOAuth2Scopes
}
deriving (Eq, Show, Data, Typeable, Generic)
restDescriptionAuthOAuth2
:: RestDescriptionAuthOAuth2
restDescriptionAuthOAuth2 = RestDescriptionAuthOAuth2' {_rdaoaScopes = Nothing}
rdaoaScopes :: Lens' RestDescriptionAuthOAuth2 (Maybe RestDescriptionAuthOAuth2Scopes)
rdaoaScopes
= lens _rdaoaScopes (\ s a -> s{_rdaoaScopes = a})
instance FromJSON RestDescriptionAuthOAuth2 where
parseJSON
= withObject "RestDescriptionAuthOAuth2"
(\ o ->
RestDescriptionAuthOAuth2' <$> (o .:? "scopes"))
instance ToJSON RestDescriptionAuthOAuth2 where
toJSON RestDescriptionAuthOAuth2'{..}
= object (catMaybes [("scopes" .=) <$> _rdaoaScopes])
newtype RestDescriptionAuthOAuth2ScopesAdditional =
RestDescriptionAuthOAuth2ScopesAdditional'
{ _rdaoasaDescription :: Maybe Text
}
deriving (Eq, Show, Data, Typeable, Generic)
restDescriptionAuthOAuth2ScopesAdditional
:: RestDescriptionAuthOAuth2ScopesAdditional
restDescriptionAuthOAuth2ScopesAdditional =
RestDescriptionAuthOAuth2ScopesAdditional' {_rdaoasaDescription = Nothing}
rdaoasaDescription :: Lens' RestDescriptionAuthOAuth2ScopesAdditional (Maybe Text)
rdaoasaDescription
= lens _rdaoasaDescription
(\ s a -> s{_rdaoasaDescription = a})
instance FromJSON
RestDescriptionAuthOAuth2ScopesAdditional
where
parseJSON
= withObject
"RestDescriptionAuthOAuth2ScopesAdditional"
(\ o ->
RestDescriptionAuthOAuth2ScopesAdditional' <$>
(o .:? "description"))
instance ToJSON
RestDescriptionAuthOAuth2ScopesAdditional
where
toJSON RestDescriptionAuthOAuth2ScopesAdditional'{..}
= object
(catMaybes
[("description" .=) <$> _rdaoasaDescription])
data RestMethodMediaUploadProtocolsSimple =
RestMethodMediaUploadProtocolsSimple'
{ _rmmupsPath :: !(Maybe Text)
, _rmmupsMultiPart :: !Bool
}
deriving (Eq, Show, Data, Typeable, Generic)
restMethodMediaUploadProtocolsSimple
:: RestMethodMediaUploadProtocolsSimple
restMethodMediaUploadProtocolsSimple =
RestMethodMediaUploadProtocolsSimple'
{_rmmupsPath = Nothing, _rmmupsMultiPart = True}
rmmupsPath :: Lens' RestMethodMediaUploadProtocolsSimple (Maybe Text)
rmmupsPath
= lens _rmmupsPath (\ s a -> s{_rmmupsPath = a})
rmmupsMultiPart :: Lens' RestMethodMediaUploadProtocolsSimple Bool
rmmupsMultiPart
= lens _rmmupsMultiPart
(\ s a -> s{_rmmupsMultiPart = a})
instance FromJSON
RestMethodMediaUploadProtocolsSimple
where
parseJSON
= withObject "RestMethodMediaUploadProtocolsSimple"
(\ o ->
RestMethodMediaUploadProtocolsSimple' <$>
(o .:? "path") <*> (o .:? "multipart" .!= True))
instance ToJSON RestMethodMediaUploadProtocolsSimple
where
toJSON RestMethodMediaUploadProtocolsSimple'{..}
= object
(catMaybes
[("path" .=) <$> _rmmupsPath,
Just ("multipart" .= _rmmupsMultiPart)])
data RestDescriptionIcons =
RestDescriptionIcons'
{ _rdiX16 :: !(Maybe Text)
, _rdiX32 :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
restDescriptionIcons
:: RestDescriptionIcons
restDescriptionIcons =
RestDescriptionIcons' {_rdiX16 = Nothing, _rdiX32 = Nothing}
rdiX16 :: Lens' RestDescriptionIcons (Maybe Text)
rdiX16 = lens _rdiX16 (\ s a -> s{_rdiX16 = a})
rdiX32 :: Lens' RestDescriptionIcons (Maybe Text)
rdiX32 = lens _rdiX32 (\ s a -> s{_rdiX32 = a})
instance FromJSON RestDescriptionIcons where
parseJSON
= withObject "RestDescriptionIcons"
(\ o ->
RestDescriptionIcons' <$>
(o .:? "x16") <*> (o .:? "x32"))
instance ToJSON RestDescriptionIcons where
toJSON RestDescriptionIcons'{..}
= object
(catMaybes
[("x16" .=) <$> _rdiX16, ("x32" .=) <$> _rdiX32])
data JSONSchemaVariant =
JSONSchemaVariant'
{ _jsvDiscriminant :: !(Maybe Text)
, _jsvMap :: !(Maybe [JSONSchemaVariantMapItem])
}
deriving (Eq, Show, Data, Typeable, Generic)
jsonSchemaVariant
:: JSONSchemaVariant
jsonSchemaVariant =
JSONSchemaVariant' {_jsvDiscriminant = Nothing, _jsvMap = Nothing}
jsvDiscriminant :: Lens' JSONSchemaVariant (Maybe Text)
jsvDiscriminant
= lens _jsvDiscriminant
(\ s a -> s{_jsvDiscriminant = a})
jsvMap :: Lens' JSONSchemaVariant [JSONSchemaVariantMapItem]
jsvMap
= lens _jsvMap (\ s a -> s{_jsvMap = a}) . _Default .
_Coerce
instance FromJSON JSONSchemaVariant where
parseJSON
= withObject "JSONSchemaVariant"
(\ o ->
JSONSchemaVariant' <$>
(o .:? "discriminant") <*> (o .:? "map" .!= mempty))
instance ToJSON JSONSchemaVariant where
toJSON JSONSchemaVariant'{..}
= object
(catMaybes
[("discriminant" .=) <$> _jsvDiscriminant,
("map" .=) <$> _jsvMap])
newtype RestResourceMethods =
RestResourceMethods'
{ _rrmAddtional :: HashMap Text RestMethod
}
deriving (Eq, Show, Data, Typeable, Generic)
restResourceMethods
:: HashMap Text RestMethod
-> RestResourceMethods
restResourceMethods pRrmAddtional_ =
RestResourceMethods' {_rrmAddtional = _Coerce # pRrmAddtional_}
rrmAddtional :: Lens' RestResourceMethods (HashMap Text RestMethod)
rrmAddtional
= lens _rrmAddtional (\ s a -> s{_rrmAddtional = a})
. _Coerce
instance FromJSON RestResourceMethods where
parseJSON
= withObject "RestResourceMethods"
(\ o -> RestResourceMethods' <$> (parseJSONObject o))
instance ToJSON RestResourceMethods where
toJSON = toJSON . _rrmAddtional
newtype RestDescriptionAuth =
RestDescriptionAuth'
{ _rdaOAuth2 :: Maybe RestDescriptionAuthOAuth2
}
deriving (Eq, Show, Data, Typeable, Generic)
restDescriptionAuth
:: RestDescriptionAuth
restDescriptionAuth = RestDescriptionAuth' {_rdaOAuth2 = Nothing}
rdaOAuth2 :: Lens' RestDescriptionAuth (Maybe RestDescriptionAuthOAuth2)
rdaOAuth2
= lens _rdaOAuth2 (\ s a -> s{_rdaOAuth2 = a})
instance FromJSON RestDescriptionAuth where
parseJSON
= withObject "RestDescriptionAuth"
(\ o -> RestDescriptionAuth' <$> (o .:? "oauth2"))
instance ToJSON RestDescriptionAuth where
toJSON RestDescriptionAuth'{..}
= object (catMaybes [("oauth2" .=) <$> _rdaOAuth2])
data RestDescription =
RestDescription'
{ _rdEtag :: !(Maybe Text)
, _rdSchemas :: !(Maybe RestDescriptionSchemas)
, _rdServicePath :: !(Maybe Text)
, _rdBasePath :: !(Maybe Text)
, _rdKind :: !Text
, _rdExponentialBackoffDefault :: !(Maybe Bool)
, _rdAuth :: !(Maybe RestDescriptionAuth)
, _rdIcons :: !(Maybe RestDescriptionIcons)
, _rdBaseURL :: !(Maybe Text)
, _rdProtocol :: !Text
, _rdOwnerName :: !(Maybe Text)
, _rdResources :: !(Maybe RestDescriptionResources)
, _rdOwnerDomain :: !(Maybe Text)
, _rdBatchPath :: !(Maybe Text)
, _rdMethods :: !(Maybe RestDescriptionMethods)
, _rdName :: !(Maybe Text)
, _rdPackagePath :: !(Maybe Text)
, _rdFeatures :: !(Maybe [Text])
, _rdVersionModule :: !(Maybe Bool)
, _rdVersion :: !(Maybe Text)
, _rdParameters :: !(Maybe RestDescriptionParameters)
, _rdDocumentationLink :: !(Maybe Text)
, _rdRootURL :: !(Maybe Text)
, _rdId :: !(Maybe Text)
, _rdCanonicalName :: !(Maybe Text)
, _rdLabels :: !(Maybe [Text])
, _rdDiscoveryVersion :: !Text
, _rdTitle :: !(Maybe Text)
, _rdRevision :: !(Maybe Text)
, _rdDescription :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
restDescription
:: RestDescription
restDescription =
RestDescription'
{ _rdEtag = Nothing
, _rdSchemas = Nothing
, _rdServicePath = Nothing
, _rdBasePath = Nothing
, _rdKind = "discovery#restDescription"
, _rdExponentialBackoffDefault = Nothing
, _rdAuth = Nothing
, _rdIcons = Nothing
, _rdBaseURL = Nothing
, _rdProtocol = "rest"
, _rdOwnerName = Nothing
, _rdResources = Nothing
, _rdOwnerDomain = Nothing
, _rdBatchPath = Nothing
, _rdMethods = Nothing
, _rdName = Nothing
, _rdPackagePath = Nothing
, _rdFeatures = Nothing
, _rdVersionModule = Nothing
, _rdVersion = Nothing
, _rdParameters = Nothing
, _rdDocumentationLink = Nothing
, _rdRootURL = Nothing
, _rdId = Nothing
, _rdCanonicalName = Nothing
, _rdLabels = Nothing
, _rdDiscoveryVersion = "v1"
, _rdTitle = Nothing
, _rdRevision = Nothing
, _rdDescription = Nothing
}
rdEtag :: Lens' RestDescription (Maybe Text)
rdEtag = lens _rdEtag (\ s a -> s{_rdEtag = a})
rdSchemas :: Lens' RestDescription (Maybe RestDescriptionSchemas)
rdSchemas
= lens _rdSchemas (\ s a -> s{_rdSchemas = a})
rdServicePath :: Lens' RestDescription (Maybe Text)
rdServicePath
= lens _rdServicePath
(\ s a -> s{_rdServicePath = a})
rdBasePath :: Lens' RestDescription (Maybe Text)
rdBasePath
= lens _rdBasePath (\ s a -> s{_rdBasePath = a})
rdKind :: Lens' RestDescription Text
rdKind = lens _rdKind (\ s a -> s{_rdKind = a})
rdExponentialBackoffDefault :: Lens' RestDescription (Maybe Bool)
rdExponentialBackoffDefault
= lens _rdExponentialBackoffDefault
(\ s a -> s{_rdExponentialBackoffDefault = a})
rdAuth :: Lens' RestDescription (Maybe RestDescriptionAuth)
rdAuth = lens _rdAuth (\ s a -> s{_rdAuth = a})
rdIcons :: Lens' RestDescription (Maybe RestDescriptionIcons)
rdIcons = lens _rdIcons (\ s a -> s{_rdIcons = a})
rdBaseURL :: Lens' RestDescription (Maybe Text)
rdBaseURL
= lens _rdBaseURL (\ s a -> s{_rdBaseURL = a})
rdProtocol :: Lens' RestDescription Text
rdProtocol
= lens _rdProtocol (\ s a -> s{_rdProtocol = a})
rdOwnerName :: Lens' RestDescription (Maybe Text)
rdOwnerName
= lens _rdOwnerName (\ s a -> s{_rdOwnerName = a})
rdResources :: Lens' RestDescription (Maybe RestDescriptionResources)
rdResources
= lens _rdResources (\ s a -> s{_rdResources = a})
rdOwnerDomain :: Lens' RestDescription (Maybe Text)
rdOwnerDomain
= lens _rdOwnerDomain
(\ s a -> s{_rdOwnerDomain = a})
rdBatchPath :: Lens' RestDescription (Maybe Text)
rdBatchPath
= lens _rdBatchPath (\ s a -> s{_rdBatchPath = a})
rdMethods :: Lens' RestDescription (Maybe RestDescriptionMethods)
rdMethods
= lens _rdMethods (\ s a -> s{_rdMethods = a})
rdName :: Lens' RestDescription (Maybe Text)
rdName = lens _rdName (\ s a -> s{_rdName = a})
rdPackagePath :: Lens' RestDescription (Maybe Text)
rdPackagePath
= lens _rdPackagePath
(\ s a -> s{_rdPackagePath = a})
rdFeatures :: Lens' RestDescription [Text]
rdFeatures
= lens _rdFeatures (\ s a -> s{_rdFeatures = a}) .
_Default
. _Coerce
rdVersionModule :: Lens' RestDescription (Maybe Bool)
rdVersionModule
= lens _rdVersionModule
(\ s a -> s{_rdVersionModule = a})
rdVersion :: Lens' RestDescription (Maybe Text)
rdVersion
= lens _rdVersion (\ s a -> s{_rdVersion = a})
rdParameters :: Lens' RestDescription (Maybe RestDescriptionParameters)
rdParameters
= lens _rdParameters (\ s a -> s{_rdParameters = a})
rdDocumentationLink :: Lens' RestDescription (Maybe Text)
rdDocumentationLink
= lens _rdDocumentationLink
(\ s a -> s{_rdDocumentationLink = a})
rdRootURL :: Lens' RestDescription (Maybe Text)
rdRootURL
= lens _rdRootURL (\ s a -> s{_rdRootURL = a})
rdId :: Lens' RestDescription (Maybe Text)
rdId = lens _rdId (\ s a -> s{_rdId = a})
rdCanonicalName :: Lens' RestDescription (Maybe Text)
rdCanonicalName
= lens _rdCanonicalName
(\ s a -> s{_rdCanonicalName = a})
rdLabels :: Lens' RestDescription [Text]
rdLabels
= lens _rdLabels (\ s a -> s{_rdLabels = a}) .
_Default
. _Coerce
rdDiscoveryVersion :: Lens' RestDescription Text
rdDiscoveryVersion
= lens _rdDiscoveryVersion
(\ s a -> s{_rdDiscoveryVersion = a})
rdTitle :: Lens' RestDescription (Maybe Text)
rdTitle = lens _rdTitle (\ s a -> s{_rdTitle = a})
rdRevision :: Lens' RestDescription (Maybe Text)
rdRevision
= lens _rdRevision (\ s a -> s{_rdRevision = a})
rdDescription :: Lens' RestDescription (Maybe Text)
rdDescription
= lens _rdDescription
(\ s a -> s{_rdDescription = a})
instance FromJSON RestDescription where
parseJSON
= withObject "RestDescription"
(\ o ->
RestDescription' <$>
(o .:? "etag") <*> (o .:? "schemas") <*>
(o .:? "servicePath")
<*> (o .:? "basePath")
<*> (o .:? "kind" .!= "discovery#restDescription")
<*> (o .:? "exponentialBackoffDefault")
<*> (o .:? "auth")
<*> (o .:? "icons")
<*> (o .:? "baseUrl")
<*> (o .:? "protocol" .!= "rest")
<*> (o .:? "ownerName")
<*> (o .:? "resources")
<*> (o .:? "ownerDomain")
<*> (o .:? "batchPath")
<*> (o .:? "methods")
<*> (o .:? "name")
<*> (o .:? "packagePath")
<*> (o .:? "features" .!= mempty)
<*> (o .:? "version_module")
<*> (o .:? "version")
<*> (o .:? "parameters")
<*> (o .:? "documentationLink")
<*> (o .:? "rootUrl")
<*> (o .:? "id")
<*> (o .:? "canonicalName")
<*> (o .:? "labels" .!= mempty)
<*> (o .:? "discoveryVersion" .!= "v1")
<*> (o .:? "title")
<*> (o .:? "revision")
<*> (o .:? "description"))
instance ToJSON RestDescription where
toJSON RestDescription'{..}
= object
(catMaybes
[("etag" .=) <$> _rdEtag,
("schemas" .=) <$> _rdSchemas,
("servicePath" .=) <$> _rdServicePath,
("basePath" .=) <$> _rdBasePath,
Just ("kind" .= _rdKind),
("exponentialBackoffDefault" .=) <$>
_rdExponentialBackoffDefault,
("auth" .=) <$> _rdAuth, ("icons" .=) <$> _rdIcons,
("baseUrl" .=) <$> _rdBaseURL,
Just ("protocol" .= _rdProtocol),
("ownerName" .=) <$> _rdOwnerName,
("resources" .=) <$> _rdResources,
("ownerDomain" .=) <$> _rdOwnerDomain,
("batchPath" .=) <$> _rdBatchPath,
("methods" .=) <$> _rdMethods,
("name" .=) <$> _rdName,
("packagePath" .=) <$> _rdPackagePath,
("features" .=) <$> _rdFeatures,
("version_module" .=) <$> _rdVersionModule,
("version" .=) <$> _rdVersion,
("parameters" .=) <$> _rdParameters,
("documentationLink" .=) <$> _rdDocumentationLink,
("rootUrl" .=) <$> _rdRootURL, ("id" .=) <$> _rdId,
("canonicalName" .=) <$> _rdCanonicalName,
("labels" .=) <$> _rdLabels,
Just ("discoveryVersion" .= _rdDiscoveryVersion),
("title" .=) <$> _rdTitle,
("revision" .=) <$> _rdRevision,
("description" .=) <$> _rdDescription])
data JSONSchema =
JSONSchema'
{ _jsAnnotations :: !(Maybe JSONSchemaAnnotations)
, _jsVariant :: !(Maybe JSONSchemaVariant)
, _jsLocation :: !(Maybe Text)
, _jsRef :: !(Maybe Text)
, _jsPattern :: !(Maybe Text)
, _jsMaximum :: !(Maybe Text)
, _jsDefault :: !(Maybe Text)
, _jsFormat :: !(Maybe Text)
, _jsItems :: !(Maybe JSONSchema)
, _jsMinimum :: !(Maybe Text)
, _jsRequired :: !(Maybe Bool)
, _jsId :: !(Maybe Text)
, _jsAdditionalProperties :: !(Maybe JSONSchema)
, _jsType :: !(Maybe Text)
, _jsEnum :: !(Maybe [Text])
, _jsRepeated :: !(Maybe Bool)
, _jsReadOnly :: !(Maybe Bool)
, _jsEnumDescriptions :: !(Maybe [Text])
, _jsDescription :: !(Maybe Text)
, _jsProperties :: !(Maybe JSONSchemaProperties)
}
deriving (Eq, Show, Data, Typeable, Generic)
jsonSchema
:: JSONSchema
jsonSchema =
JSONSchema'
{ _jsAnnotations = Nothing
, _jsVariant = Nothing
, _jsLocation = Nothing
, _jsRef = Nothing
, _jsPattern = Nothing
, _jsMaximum = Nothing
, _jsDefault = Nothing
, _jsFormat = Nothing
, _jsItems = Nothing
, _jsMinimum = Nothing
, _jsRequired = Nothing
, _jsId = Nothing
, _jsAdditionalProperties = Nothing
, _jsType = Nothing
, _jsEnum = Nothing
, _jsRepeated = Nothing
, _jsReadOnly = Nothing
, _jsEnumDescriptions = Nothing
, _jsDescription = Nothing
, _jsProperties = Nothing
}
jsAnnotations :: Lens' JSONSchema (Maybe JSONSchemaAnnotations)
jsAnnotations
= lens _jsAnnotations
(\ s a -> s{_jsAnnotations = a})
jsVariant :: Lens' JSONSchema (Maybe JSONSchemaVariant)
jsVariant
= lens _jsVariant (\ s a -> s{_jsVariant = a})
jsLocation :: Lens' JSONSchema (Maybe Text)
jsLocation
= lens _jsLocation (\ s a -> s{_jsLocation = a})
jsRef :: Lens' JSONSchema (Maybe Text)
jsRef = lens _jsRef (\ s a -> s{_jsRef = a})
jsPattern :: Lens' JSONSchema (Maybe Text)
jsPattern
= lens _jsPattern (\ s a -> s{_jsPattern = a})
jsMaximum :: Lens' JSONSchema (Maybe Text)
jsMaximum
= lens _jsMaximum (\ s a -> s{_jsMaximum = a})
jsDefault :: Lens' JSONSchema (Maybe Text)
jsDefault
= lens _jsDefault (\ s a -> s{_jsDefault = a})
jsFormat :: Lens' JSONSchema (Maybe Text)
jsFormat = lens _jsFormat (\ s a -> s{_jsFormat = a})
jsItems :: Lens' JSONSchema (Maybe JSONSchema)
jsItems = lens _jsItems (\ s a -> s{_jsItems = a})
jsMinimum :: Lens' JSONSchema (Maybe Text)
jsMinimum
= lens _jsMinimum (\ s a -> s{_jsMinimum = a})
jsRequired :: Lens' JSONSchema (Maybe Bool)
jsRequired
= lens _jsRequired (\ s a -> s{_jsRequired = a})
jsId :: Lens' JSONSchema (Maybe Text)
jsId = lens _jsId (\ s a -> s{_jsId = a})
jsAdditionalProperties :: Lens' JSONSchema (Maybe JSONSchema)
jsAdditionalProperties
= lens _jsAdditionalProperties
(\ s a -> s{_jsAdditionalProperties = a})
jsType :: Lens' JSONSchema (Maybe Text)
jsType = lens _jsType (\ s a -> s{_jsType = a})
jsEnum :: Lens' JSONSchema [Text]
jsEnum
= lens _jsEnum (\ s a -> s{_jsEnum = a}) . _Default .
_Coerce
jsRepeated :: Lens' JSONSchema (Maybe Bool)
jsRepeated
= lens _jsRepeated (\ s a -> s{_jsRepeated = a})
jsReadOnly :: Lens' JSONSchema (Maybe Bool)
jsReadOnly
= lens _jsReadOnly (\ s a -> s{_jsReadOnly = a})
jsEnumDescriptions :: Lens' JSONSchema [Text]
jsEnumDescriptions
= lens _jsEnumDescriptions
(\ s a -> s{_jsEnumDescriptions = a})
. _Default
. _Coerce
jsDescription :: Lens' JSONSchema (Maybe Text)
jsDescription
= lens _jsDescription
(\ s a -> s{_jsDescription = a})
jsProperties :: Lens' JSONSchema (Maybe JSONSchemaProperties)
jsProperties
= lens _jsProperties (\ s a -> s{_jsProperties = a})
instance FromJSON JSONSchema where
parseJSON
= withObject "JSONSchema"
(\ o ->
JSONSchema' <$>
(o .:? "annotations") <*> (o .:? "variant") <*>
(o .:? "location")
<*> (o .:? "$ref")
<*> (o .:? "pattern")
<*> (o .:? "maximum")
<*> (o .:? "default")
<*> (o .:? "format")
<*> (o .:? "items")
<*> (o .:? "minimum")
<*> (o .:? "required")
<*> (o .:? "id")
<*> (o .:? "additionalProperties")
<*> (o .:? "type")
<*> (o .:? "enum" .!= mempty)
<*> (o .:? "repeated")
<*> (o .:? "readOnly")
<*> (o .:? "enumDescriptions" .!= mempty)
<*> (o .:? "description")
<*> (o .:? "properties"))
instance ToJSON JSONSchema where
toJSON JSONSchema'{..}
= object
(catMaybes
[("annotations" .=) <$> _jsAnnotations,
("variant" .=) <$> _jsVariant,
("location" .=) <$> _jsLocation,
("$ref" .=) <$> _jsRef,
("pattern" .=) <$> _jsPattern,
("maximum" .=) <$> _jsMaximum,
("default" .=) <$> _jsDefault,
("format" .=) <$> _jsFormat,
("items" .=) <$> _jsItems,
("minimum" .=) <$> _jsMinimum,
("required" .=) <$> _jsRequired, ("id" .=) <$> _jsId,
("additionalProperties" .=) <$>
_jsAdditionalProperties,
("type" .=) <$> _jsType, ("enum" .=) <$> _jsEnum,
("repeated" .=) <$> _jsRepeated,
("readOnly" .=) <$> _jsReadOnly,
("enumDescriptions" .=) <$> _jsEnumDescriptions,
("description" .=) <$> _jsDescription,
("properties" .=) <$> _jsProperties])
newtype RestDescriptionSchemas =
RestDescriptionSchemas'
{ _rdsAddtional :: HashMap Text JSONSchema
}
deriving (Eq, Show, Data, Typeable, Generic)
restDescriptionSchemas
:: HashMap Text JSONSchema
-> RestDescriptionSchemas
restDescriptionSchemas pRdsAddtional_ =
RestDescriptionSchemas' {_rdsAddtional = _Coerce # pRdsAddtional_}
rdsAddtional :: Lens' RestDescriptionSchemas (HashMap Text JSONSchema)
rdsAddtional
= lens _rdsAddtional (\ s a -> s{_rdsAddtional = a})
. _Coerce
instance FromJSON RestDescriptionSchemas where
parseJSON
= withObject "RestDescriptionSchemas"
(\ o ->
RestDescriptionSchemas' <$> (parseJSONObject o))
instance ToJSON RestDescriptionSchemas where
toJSON = toJSON . _rdsAddtional
data JSONSchemaVariantMapItem =
JSONSchemaVariantMapItem'
{ _jsvmiRef :: !(Maybe Text)
, _jsvmiTypeValue :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
jsonSchemaVariantMapItem
:: JSONSchemaVariantMapItem
jsonSchemaVariantMapItem =
JSONSchemaVariantMapItem' {_jsvmiRef = Nothing, _jsvmiTypeValue = Nothing}
jsvmiRef :: Lens' JSONSchemaVariantMapItem (Maybe Text)
jsvmiRef = lens _jsvmiRef (\ s a -> s{_jsvmiRef = a})
jsvmiTypeValue :: Lens' JSONSchemaVariantMapItem (Maybe Text)
jsvmiTypeValue
= lens _jsvmiTypeValue
(\ s a -> s{_jsvmiTypeValue = a})
instance FromJSON JSONSchemaVariantMapItem where
parseJSON
= withObject "JSONSchemaVariantMapItem"
(\ o ->
JSONSchemaVariantMapItem' <$>
(o .:? "$ref") <*> (o .:? "type_value"))
instance ToJSON JSONSchemaVariantMapItem where
toJSON JSONSchemaVariantMapItem'{..}
= object
(catMaybes
[("$ref" .=) <$> _jsvmiRef,
("type_value" .=) <$> _jsvmiTypeValue])
newtype RestDescriptionResources =
RestDescriptionResources'
{ _rdrAddtional :: HashMap Text RestResource
}
deriving (Eq, Show, Data, Typeable, Generic)
restDescriptionResources
:: HashMap Text RestResource
-> RestDescriptionResources
restDescriptionResources pRdrAddtional_ =
RestDescriptionResources' {_rdrAddtional = _Coerce # pRdrAddtional_}
rdrAddtional :: Lens' RestDescriptionResources (HashMap Text RestResource)
rdrAddtional
= lens _rdrAddtional (\ s a -> s{_rdrAddtional = a})
. _Coerce
instance FromJSON RestDescriptionResources where
parseJSON
= withObject "RestDescriptionResources"
(\ o ->
RestDescriptionResources' <$> (parseJSONObject o))
instance ToJSON RestDescriptionResources where
toJSON = toJSON . _rdrAddtional
data RestMethodMediaUploadProtocols =
RestMethodMediaUploadProtocols'
{ _rmmupSimple :: !(Maybe RestMethodMediaUploadProtocolsSimple)
, _rmmupResumable :: !(Maybe RestMethodMediaUploadProtocolsResumable)
}
deriving (Eq, Show, Data, Typeable, Generic)
restMethodMediaUploadProtocols
:: RestMethodMediaUploadProtocols
restMethodMediaUploadProtocols =
RestMethodMediaUploadProtocols'
{_rmmupSimple = Nothing, _rmmupResumable = Nothing}
rmmupSimple :: Lens' RestMethodMediaUploadProtocols (Maybe RestMethodMediaUploadProtocolsSimple)
rmmupSimple
= lens _rmmupSimple (\ s a -> s{_rmmupSimple = a})
rmmupResumable :: Lens' RestMethodMediaUploadProtocols (Maybe RestMethodMediaUploadProtocolsResumable)
rmmupResumable
= lens _rmmupResumable
(\ s a -> s{_rmmupResumable = a})
instance FromJSON RestMethodMediaUploadProtocols
where
parseJSON
= withObject "RestMethodMediaUploadProtocols"
(\ o ->
RestMethodMediaUploadProtocols' <$>
(o .:? "simple") <*> (o .:? "resumable"))
instance ToJSON RestMethodMediaUploadProtocols where
toJSON RestMethodMediaUploadProtocols'{..}
= object
(catMaybes
[("simple" .=) <$> _rmmupSimple,
("resumable" .=) <$> _rmmupResumable])
newtype JSONSchemaAnnotations =
JSONSchemaAnnotations'
{ _jsaRequired :: Maybe [Text]
}
deriving (Eq, Show, Data, Typeable, Generic)
jsonSchemaAnnotations
:: JSONSchemaAnnotations
jsonSchemaAnnotations = JSONSchemaAnnotations' {_jsaRequired = Nothing}
jsaRequired :: Lens' JSONSchemaAnnotations [Text]
jsaRequired
= lens _jsaRequired (\ s a -> s{_jsaRequired = a}) .
_Default
. _Coerce
instance FromJSON JSONSchemaAnnotations where
parseJSON
= withObject "JSONSchemaAnnotations"
(\ o ->
JSONSchemaAnnotations' <$>
(o .:? "required" .!= mempty))
instance ToJSON JSONSchemaAnnotations where
toJSON JSONSchemaAnnotations'{..}
= object
(catMaybes [("required" .=) <$> _jsaRequired])
newtype RestMethodParameters =
RestMethodParameters'
{ _rmpAddtional :: HashMap Text JSONSchema
}
deriving (Eq, Show, Data, Typeable, Generic)
restMethodParameters
:: HashMap Text JSONSchema
-> RestMethodParameters
restMethodParameters pRmpAddtional_ =
RestMethodParameters' {_rmpAddtional = _Coerce # pRmpAddtional_}
rmpAddtional :: Lens' RestMethodParameters (HashMap Text JSONSchema)
rmpAddtional
= lens _rmpAddtional (\ s a -> s{_rmpAddtional = a})
. _Coerce
instance FromJSON RestMethodParameters where
parseJSON
= withObject "RestMethodParameters"
(\ o ->
RestMethodParameters' <$> (parseJSONObject o))
instance ToJSON RestMethodParameters where
toJSON = toJSON . _rmpAddtional
data RestMethodMediaUpload =
RestMethodMediaUpload'
{ _rmmuProtocols :: !(Maybe RestMethodMediaUploadProtocols)
, _rmmuAccept :: !(Maybe [Text])
, _rmmuMaxSize :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
restMethodMediaUpload
:: RestMethodMediaUpload
restMethodMediaUpload =
RestMethodMediaUpload'
{_rmmuProtocols = Nothing, _rmmuAccept = Nothing, _rmmuMaxSize = Nothing}
rmmuProtocols :: Lens' RestMethodMediaUpload (Maybe RestMethodMediaUploadProtocols)
rmmuProtocols
= lens _rmmuProtocols
(\ s a -> s{_rmmuProtocols = a})
rmmuAccept :: Lens' RestMethodMediaUpload [Text]
rmmuAccept
= lens _rmmuAccept (\ s a -> s{_rmmuAccept = a}) .
_Default
. _Coerce
rmmuMaxSize :: Lens' RestMethodMediaUpload (Maybe Text)
rmmuMaxSize
= lens _rmmuMaxSize (\ s a -> s{_rmmuMaxSize = a})
instance FromJSON RestMethodMediaUpload where
parseJSON
= withObject "RestMethodMediaUpload"
(\ o ->
RestMethodMediaUpload' <$>
(o .:? "protocols") <*> (o .:? "accept" .!= mempty)
<*> (o .:? "maxSize"))
instance ToJSON RestMethodMediaUpload where
toJSON RestMethodMediaUpload'{..}
= object
(catMaybes
[("protocols" .=) <$> _rmmuProtocols,
("accept" .=) <$> _rmmuAccept,
("maxSize" .=) <$> _rmmuMaxSize])
newtype JSONSchemaProperties =
JSONSchemaProperties'
{ _jspAddtional :: HashMap Text JSONSchema
}
deriving (Eq, Show, Data, Typeable, Generic)
jsonSchemaProperties
:: HashMap Text JSONSchema
-> JSONSchemaProperties
jsonSchemaProperties pJspAddtional_ =
JSONSchemaProperties' {_jspAddtional = _Coerce # pJspAddtional_}
jspAddtional :: Lens' JSONSchemaProperties (HashMap Text JSONSchema)
jspAddtional
= lens _jspAddtional (\ s a -> s{_jspAddtional = a})
. _Coerce
instance FromJSON JSONSchemaProperties where
parseJSON
= withObject "JSONSchemaProperties"
(\ o ->
JSONSchemaProperties' <$> (parseJSONObject o))
instance ToJSON JSONSchemaProperties where
toJSON = toJSON . _jspAddtional
data RestMethodMediaUploadProtocolsResumable =
RestMethodMediaUploadProtocolsResumable'
{ _rmmuprPath :: !(Maybe Text)
, _rmmuprMultiPart :: !Bool
}
deriving (Eq, Show, Data, Typeable, Generic)
restMethodMediaUploadProtocolsResumable
:: RestMethodMediaUploadProtocolsResumable
restMethodMediaUploadProtocolsResumable =
RestMethodMediaUploadProtocolsResumable'
{_rmmuprPath = Nothing, _rmmuprMultiPart = True}
rmmuprPath :: Lens' RestMethodMediaUploadProtocolsResumable (Maybe Text)
rmmuprPath
= lens _rmmuprPath (\ s a -> s{_rmmuprPath = a})
rmmuprMultiPart :: Lens' RestMethodMediaUploadProtocolsResumable Bool
rmmuprMultiPart
= lens _rmmuprMultiPart
(\ s a -> s{_rmmuprMultiPart = a})
instance FromJSON
RestMethodMediaUploadProtocolsResumable
where
parseJSON
= withObject
"RestMethodMediaUploadProtocolsResumable"
(\ o ->
RestMethodMediaUploadProtocolsResumable' <$>
(o .:? "path") <*> (o .:? "multipart" .!= True))
instance ToJSON
RestMethodMediaUploadProtocolsResumable
where
toJSON RestMethodMediaUploadProtocolsResumable'{..}
= object
(catMaybes
[("path" .=) <$> _rmmuprPath,
Just ("multipart" .= _rmmuprMultiPart)])
data DirectoryList =
DirectoryList'
{ _dlKind :: !Text
, _dlItems :: !(Maybe [DirectoryListItemsItem])
, _dlDiscoveryVersion :: !Text
}
deriving (Eq, Show, Data, Typeable, Generic)
directoryList
:: DirectoryList
directoryList =
DirectoryList'
{ _dlKind = "discovery#directoryList"
, _dlItems = Nothing
, _dlDiscoveryVersion = "v1"
}
dlKind :: Lens' DirectoryList Text
dlKind = lens _dlKind (\ s a -> s{_dlKind = a})
dlItems :: Lens' DirectoryList [DirectoryListItemsItem]
dlItems
= lens _dlItems (\ s a -> s{_dlItems = a}) . _Default
. _Coerce
dlDiscoveryVersion :: Lens' DirectoryList Text
dlDiscoveryVersion
= lens _dlDiscoveryVersion
(\ s a -> s{_dlDiscoveryVersion = a})
instance FromJSON DirectoryList where
parseJSON
= withObject "DirectoryList"
(\ o ->
DirectoryList' <$>
(o .:? "kind" .!= "discovery#directoryList") <*>
(o .:? "items" .!= mempty)
<*> (o .:? "discoveryVersion" .!= "v1"))
instance ToJSON DirectoryList where
toJSON DirectoryList'{..}
= object
(catMaybes
[Just ("kind" .= _dlKind), ("items" .=) <$> _dlItems,
Just ("discoveryVersion" .= _dlDiscoveryVersion)])
data RestMethodRequest =
RestMethodRequest'
{ _rRef :: !(Maybe Text)
, _rParameterName :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
restMethodRequest
:: RestMethodRequest
restMethodRequest =
RestMethodRequest' {_rRef = Nothing, _rParameterName = Nothing}
rRef :: Lens' RestMethodRequest (Maybe Text)
rRef = lens _rRef (\ s a -> s{_rRef = a})
rParameterName :: Lens' RestMethodRequest (Maybe Text)
rParameterName
= lens _rParameterName
(\ s a -> s{_rParameterName = a})
instance FromJSON RestMethodRequest where
parseJSON
= withObject "RestMethodRequest"
(\ o ->
RestMethodRequest' <$>
(o .:? "$ref") <*> (o .:? "parameterName"))
instance ToJSON RestMethodRequest where
toJSON RestMethodRequest'{..}
= object
(catMaybes
[("$ref" .=) <$> _rRef,
("parameterName" .=) <$> _rParameterName])