on develop help sign in
Regenerating gogol-sqladmin from updated service defintions
commit329391fc731de177925dc6b932bd6af7fc30b78d authorBrendan Hay <brendan.g.hay@gmail.com> dateSat 11 Feb 2017, 11:36 (10 years ago) parentdc7eb32
5 files changed+247−4
gogol-sqladmin/gen/Network/Google/Resource/SQL/Instances/TruncateLog.hs+115 gogol-sqladmin/gen/Network/Google/SQLAdmin.hs+17 gogol-sqladmin/gen/Network/Google/SQLAdmin/Types.hs+12 gogol-sqladmin/gen/Network/Google/SQLAdmin/Types/Product.hs+102−4 gogol-sqladmin/gogol-sqladmin.cabal+1
gogol-sqladmin/gen/Network/Google/Resource/SQL/Instances/TruncateLog.hsnew file+115
@@ -0,0 +1,115 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.SQL.Instances.TruncateLog
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Truncate MySQL general and slow query log tables
24+--
25+-- /See:/ <https://cloud.google.com/sql/docs/reference/latest Cloud SQL Administration API Reference> for @sql.instances.truncateLog@.
26+module Network.Google.Resource.SQL.Instances.TruncateLog
27+ (
28+ -- * REST Resource
29+ InstancesTruncateLogResource
30+
31+ -- * Creating a Request
32+ , instancesTruncateLog
33+ , InstancesTruncateLog
34+
35+ -- * Request Lenses
36+ , itlProject
37+ , itlPayload
38+ , itlInstance
39+ ) where
40+
41+import Network.Google.Prelude
42+import Network.Google.SQLAdmin.Types
43+
44+-- | A resource alias for @sql.instances.truncateLog@ method which the
45+-- 'InstancesTruncateLog' request conforms to.
46+type InstancesTruncateLogResource =
47+ "sql" :>
48+ "v1beta4" :>
49+ "projects" :>
50+ Capture "project" Text :>
51+ "instances" :>
52+ Capture "instance" Text :>
53+ "truncateLog" :>
54+ QueryParam "alt" AltJSON :>
55+ ReqBody '[JSON] InstancesTruncateLogRequest :>
56+ Post '[JSON] Operation
57+
58+-- | Truncate MySQL general and slow query log tables
59+--
60+-- /See:/ 'instancesTruncateLog' smart constructor.
61+data InstancesTruncateLog = InstancesTruncateLog'
62+ { _itlProject :: !Text
63+ , _itlPayload :: !InstancesTruncateLogRequest
64+ , _itlInstance :: !Text
65+ } deriving (Eq,Show,Data,Typeable,Generic)
66+
67+-- | Creates a value of 'InstancesTruncateLog' with the minimum fields required to make a request.
68+--
69+-- Use one of the following lenses to modify other fields as desired:
70+--
71+-- * 'itlProject'
72+--
73+-- * 'itlPayload'
74+--
75+-- * 'itlInstance'
76+instancesTruncateLog
77+ :: Text -- ^ 'itlProject'
78+ -> InstancesTruncateLogRequest -- ^ 'itlPayload'
79+ -> Text -- ^ 'itlInstance'
80+ -> InstancesTruncateLog
81+instancesTruncateLog pItlProject_ pItlPayload_ pItlInstance_ =
82+ InstancesTruncateLog'
83+ { _itlProject = pItlProject_
84+ , _itlPayload = pItlPayload_
85+ , _itlInstance = pItlInstance_
86+ }
87+
88+-- | Project ID of the Cloud SQL project.
89+itlProject :: Lens' InstancesTruncateLog Text
90+itlProject
91+ = lens _itlProject (\ s a -> s{_itlProject = a})
92+
93+-- | Multipart request metadata.
94+itlPayload :: Lens' InstancesTruncateLog InstancesTruncateLogRequest
95+itlPayload
96+ = lens _itlPayload (\ s a -> s{_itlPayload = a})
97+
98+-- | Cloud SQL instance ID. This does not include the project ID.
99+itlInstance :: Lens' InstancesTruncateLog Text
100+itlInstance
101+ = lens _itlInstance (\ s a -> s{_itlInstance = a})
102+
103+instance GoogleRequest InstancesTruncateLog where
104+ type Rs InstancesTruncateLog = Operation
105+ type Scopes InstancesTruncateLog =
106+ '["https://www.googleapis.com/auth/cloud-platform",
107+ "https://www.googleapis.com/auth/sqlservice.admin"]
108+ requestClient InstancesTruncateLog'{..}
109+ = go _itlProject _itlInstance (Just AltJSON)
110+ _itlPayload
111+ sQLAdminService
112+ where go
113+ = buildClient
114+ (Proxy :: Proxy InstancesTruncateLogResource)
115+ mempty
gogol-sqladmin/gen/Network/Google/SQLAdmin.hs+17
@@ -109,6 +109,9 @@ module Network.Google.SQLAdmin
109109 -- ** sql.instances.stopReplica
110110 , module Network.Google.Resource.SQL.Instances.StopReplica
111111
112+ -- ** sql.instances.truncateLog
113+ , module Network.Google.Resource.SQL.Instances.TruncateLog
114+
112115 -- ** sql.instances.update
113116 , module Network.Google.Resource.SQL.Instances.Update
114117
@@ -241,6 +244,7 @@ module Network.Google.SQLAdmin
241244 , ipMApping
242245 , imaIPAddress
243246 , imaTimeToRetire
247+ , imaType
244248
245249 -- ** Database
246250 , Database
@@ -480,6 +484,12 @@ module Network.Google.SQLAdmin
480484 , opeCode
481485 , opeMessage
482486
487+ -- ** TruncateLogContext
488+ , TruncateLogContext
489+ , truncateLogContext
490+ , tlcKind
491+ , tlcLogType
492+
483493 -- ** InstancesCloneRequest
484494 , InstancesCloneRequest
485495 , instancesCloneRequest
@@ -539,6 +549,11 @@ module Network.Google.SQLAdmin
539549 , flrKind
540550 , flrItems
541551
552+ -- ** InstancesTruncateLogRequest
553+ , InstancesTruncateLogRequest
554+ , instancesTruncateLogRequest
555+ , itlrTruncateLogContext
556+
542557 -- ** ExportContextSQLExportOptions
543558 , ExportContextSQLExportOptions
544559 , exportContextSQLExportOptions
@@ -580,6 +595,7 @@ import Network.Google.Resource.SQL.Instances.Restart
580595import Network.Google.Resource.SQL.Instances.RestoreBackup
581596import Network.Google.Resource.SQL.Instances.StartReplica
582597import Network.Google.Resource.SQL.Instances.StopReplica
598+import Network.Google.Resource.SQL.Instances.TruncateLog
583599import Network.Google.Resource.SQL.Instances.Update
584600import Network.Google.Resource.SQL.Operations.Get
585601import Network.Google.Resource.SQL.Operations.List
@@ -625,6 +641,7 @@ type SQLAdminAPI =
625641 :<|> InstancesRestoreBackupResource
626642 :<|> InstancesFailoverResource
627643 :<|> InstancesRestartResource
644+ :<|> InstancesTruncateLogResource
628645 :<|> InstancesImportResource
629646 :<|> InstancesStopReplicaResource
630647 :<|> InstancesResetSSLConfigResource
gogol-sqladmin/gen/Network/Google/SQLAdmin/Types.hs+12
@@ -114,6 +114,7 @@ module Network.Google.SQLAdmin.Types
114114 , ipMApping
115115 , imaIPAddress
116116 , imaTimeToRetire
117+ , imaType
117118
118119 -- * Database
119120 , Database
@@ -353,6 +354,12 @@ module Network.Google.SQLAdmin.Types
353354 , opeCode
354355 , opeMessage
355356
357+ -- * TruncateLogContext
358+ , TruncateLogContext
359+ , truncateLogContext
360+ , tlcKind
361+ , tlcLogType
362+
356363 -- * InstancesCloneRequest
357364 , InstancesCloneRequest
358365 , instancesCloneRequest
@@ -412,6 +419,11 @@ module Network.Google.SQLAdmin.Types
412419 , flrKind
413420 , flrItems
414421
422+ -- * InstancesTruncateLogRequest
423+ , InstancesTruncateLogRequest
424+ , instancesTruncateLogRequest
425+ , itlrTruncateLogContext
426+
415427 -- * ExportContextSQLExportOptions
416428 , ExportContextSQLExportOptions
417429 , exportContextSQLExportOptions
gogol-sqladmin/gen/Network/Google/SQLAdmin/Types/Product.hs+102−4
@@ -905,6 +905,7 @@ instance ToJSON Settings where
905905data IPMApping = IPMApping'
906906 { _imaIPAddress :: !(Maybe Text)
907907 , _imaTimeToRetire :: !(Maybe DateTime')
908+ , _imaType :: !(Maybe Text)
908909 } deriving (Eq,Show,Data,Typeable,Generic)
909910
910911-- | Creates a value of 'IPMApping' with the minimum fields required to make a request.
@@ -914,12 +915,15 @@ data IPMApping = IPMApping'
914915-- * 'imaIPAddress'
915916--
916917-- * 'imaTimeToRetire'
918+--
919+-- * 'imaType'
917920ipMApping
918921 :: IPMApping
919922ipMApping =
920923 IPMApping'
921924 { _imaIPAddress = Nothing
922925 , _imaTimeToRetire = Nothing
926+ , _imaType = Nothing
923927 }
924928
925929-- | The IP address assigned.
@@ -936,19 +940,27 @@ imaTimeToRetire
936940 (\ s a -> s{_imaTimeToRetire = a})
937941 . mapping _DateTime
938942
943+-- | The type of this IP address. A PRIMARY address is an address that can
944+-- accept incoming connections. An OUTGOING address is the source address
945+-- of connections originating from the instance, if supported.
946+imaType :: Lens' IPMApping (Maybe Text)
947+imaType = lens _imaType (\ s a -> s{_imaType = a})
948+
939949instance FromJSON IPMApping where
940950 parseJSON
941951 = withObject "IPMApping"
942952 (\ o ->
943953 IPMApping' <$>
944− (o .:? "ipAddress") <*> (o .:? "timeToRetire"))
954+ (o .:? "ipAddress") <*> (o .:? "timeToRetire") <*>
955+ (o .:? "type"))
945956
946957instance ToJSON IPMApping where
947958 toJSON IPMApping'{..}
948959 = object
949960 (catMaybes
950961 [("ipAddress" .=) <$> _imaIPAddress,
951− ("timeToRetire" .=) <$> _imaTimeToRetire])
962+ ("timeToRetire" .=) <$> _imaTimeToRetire,
963+ ("type" .=) <$> _imaType])
952964
953965-- | A database resource inside a Cloud SQL instance.
954966--
@@ -2782,8 +2794,7 @@ tKind = lens _tKind (\ s a -> s{_tKind = a})
27822794tTier :: Lens' Tier (Maybe Text)
27832795tTier = lens _tTier (\ s a -> s{_tTier = a})
27842796
2785−-- | The applicable regions for this tier. Can be us-east1, europe-west1 or
2786−-- asia-east1.
2797+-- | The applicable regions for this tier.
27872798tRegion :: Lens' Tier [Text]
27882799tRegion
27892800 = lens _tRegion (\ s a -> s{_tRegion = a}) . _Default
@@ -3197,6 +3208,54 @@ instance ToJSON OperationError where
31973208 [Just ("kind" .= _opeKind), ("code" .=) <$> _opeCode,
31983209 ("message" .=) <$> _opeMessage])
31993210
3211+-- | Database Instance truncate log context.
3212+--
3213+-- /See:/ 'truncateLogContext' smart constructor.
3214+data TruncateLogContext = TruncateLogContext'
3215+ { _tlcKind :: !Text
3216+ , _tlcLogType :: !(Maybe Text)
3217+ } deriving (Eq,Show,Data,Typeable,Generic)
3218+
3219+-- | Creates a value of 'TruncateLogContext' with the minimum fields required to make a request.
3220+--
3221+-- Use one of the following lenses to modify other fields as desired:
3222+--
3223+-- * 'tlcKind'
3224+--
3225+-- * 'tlcLogType'
3226+truncateLogContext
3227+ :: TruncateLogContext
3228+truncateLogContext =
3229+ TruncateLogContext'
3230+ { _tlcKind = "sql#truncateLogContext"
3231+ , _tlcLogType = Nothing
3232+ }
3233+
3234+-- | This is always sql#truncateLogContext.
3235+tlcKind :: Lens' TruncateLogContext Text
3236+tlcKind = lens _tlcKind (\ s a -> s{_tlcKind = a})
3237+
3238+-- | The type of log to truncate. Valid values are MYSQL_GENERAL_TABLE and
3239+-- MYSQL_SLOW_TABLE.
3240+tlcLogType :: Lens' TruncateLogContext (Maybe Text)
3241+tlcLogType
3242+ = lens _tlcLogType (\ s a -> s{_tlcLogType = a})
3243+
3244+instance FromJSON TruncateLogContext where
3245+ parseJSON
3246+ = withObject "TruncateLogContext"
3247+ (\ o ->
3248+ TruncateLogContext' <$>
3249+ (o .:? "kind" .!= "sql#truncateLogContext") <*>
3250+ (o .:? "logType"))
3251+
3252+instance ToJSON TruncateLogContext where
3253+ toJSON TruncateLogContext'{..}
3254+ = object
3255+ (catMaybes
3256+ [Just ("kind" .= _tlcKind),
3257+ ("logType" .=) <$> _tlcLogType])
3258+
32003259-- | Database instance clone request.
32013260--
32023261-- /See:/ 'instancesCloneRequest' smart constructor.
@@ -3712,6 +3771,45 @@ instance ToJSON FlagsListResponse where
37123771 [Just ("kind" .= _flrKind),
37133772 ("items" .=) <$> _flrItems])
37143773
3774+-- | Instance truncate log request.
3775+--
3776+-- /See:/ 'instancesTruncateLogRequest' smart constructor.
3777+newtype InstancesTruncateLogRequest = InstancesTruncateLogRequest'
3778+ { _itlrTruncateLogContext :: Maybe TruncateLogContext
3779+ } deriving (Eq,Show,Data,Typeable,Generic)
3780+
3781+-- | Creates a value of 'InstancesTruncateLogRequest' with the minimum fields required to make a request.
3782+--
3783+-- Use one of the following lenses to modify other fields as desired:
3784+--
3785+-- * 'itlrTruncateLogContext'
3786+instancesTruncateLogRequest
3787+ :: InstancesTruncateLogRequest
3788+instancesTruncateLogRequest =
3789+ InstancesTruncateLogRequest'
3790+ { _itlrTruncateLogContext = Nothing
3791+ }
3792+
3793+-- | Contains details about the truncate log operation.
3794+itlrTruncateLogContext :: Lens' InstancesTruncateLogRequest (Maybe TruncateLogContext)
3795+itlrTruncateLogContext
3796+ = lens _itlrTruncateLogContext
3797+ (\ s a -> s{_itlrTruncateLogContext = a})
3798+
3799+instance FromJSON InstancesTruncateLogRequest where
3800+ parseJSON
3801+ = withObject "InstancesTruncateLogRequest"
3802+ (\ o ->
3803+ InstancesTruncateLogRequest' <$>
3804+ (o .:? "truncateLogContext"))
3805+
3806+instance ToJSON InstancesTruncateLogRequest where
3807+ toJSON InstancesTruncateLogRequest'{..}
3808+ = object
3809+ (catMaybes
3810+ [("truncateLogContext" .=) <$>
3811+ _itlrTruncateLogContext])
3812+
37153813-- | Options for exporting data as SQL statements.
37163814--
37173815-- /See:/ 'exportContextSQLExportOptions' smart constructor.
gogol-sqladmin/gogol-sqladmin.cabal+1
@@ -60,6 +60,7 @@ library
6060 , Network.Google.Resource.SQL.Instances.RestoreBackup
6161 , Network.Google.Resource.SQL.Instances.StartReplica
6262 , Network.Google.Resource.SQL.Instances.StopReplica
63+ , Network.Google.Resource.SQL.Instances.TruncateLog
6364 , Network.Google.Resource.SQL.Instances.Update
6465 , Network.Google.Resource.SQL.Operations.Get
6566 , Network.Google.Resource.SQL.Operations.List