gogol-spanner-0.4.0: Google Cloud Spanner SDK.

Copyright(c) 2015-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.Google.Resource.Spanner.Projects.Instances.Databases.Sessions.Create

Contents

Description

Creates a new session. A session can be used to perform transactions that read and/or modify data in a Cloud Spanner database. Sessions are meant to be reused for many consecutive transactions. Sessions can only execute one transaction at a time. To execute multiple concurrent read-write/write-only transactions, create multiple sessions. Note that standalone reads and queries use a transaction internally, and count toward the one transaction limit. Cloud Spanner limits the number of sessions that can exist at any given time; thus, it is a good idea to delete idle and/or unneeded sessions. Aside from explicit deletes, Cloud Spanner can delete sessions for which no operations are sent for more than an hour. If a session is deleted, requests to it return `NOT_FOUND`. Idle sessions can be kept alive by sending a trivial SQL query periodically, e.g., `"SELECT 1"`.

See: Cloud Spanner API Reference for spanner.projects.instances.databases.sessions.create.

Synopsis

REST Resource

type ProjectsInstancesDatabasesSessionsCreateResource = "v1" :> (Capture "database" Text :> ("sessions" :> (QueryParam "$.xgafv" Xgafv :> (QueryParam "upload_protocol" Text :> (QueryParam "access_token" Text :> (QueryParam "uploadType" Text :> (QueryParam "callback" Text :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] CreateSessionRequest :> Post '[JSON] Session))))))))) Source #

A resource alias for spanner.projects.instances.databases.sessions.create method which the ProjectsInstancesDatabasesSessionsCreate request conforms to.

Creating a Request

projectsInstancesDatabasesSessionsCreate Source #

Creates a value of ProjectsInstancesDatabasesSessionsCreate with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

data ProjectsInstancesDatabasesSessionsCreate Source #

Creates a new session. A session can be used to perform transactions that read and/or modify data in a Cloud Spanner database. Sessions are meant to be reused for many consecutive transactions. Sessions can only execute one transaction at a time. To execute multiple concurrent read-write/write-only transactions, create multiple sessions. Note that standalone reads and queries use a transaction internally, and count toward the one transaction limit. Cloud Spanner limits the number of sessions that can exist at any given time; thus, it is a good idea to delete idle and/or unneeded sessions. Aside from explicit deletes, Cloud Spanner can delete sessions for which no operations are sent for more than an hour. If a session is deleted, requests to it return `NOT_FOUND`. Idle sessions can be kept alive by sending a trivial SQL query periodically, e.g., `"SELECT 1"`.

See: projectsInstancesDatabasesSessionsCreate smart constructor.

Instances
Eq ProjectsInstancesDatabasesSessionsCreate Source # 
Instance details

Defined in Network.Google.Resource.Spanner.Projects.Instances.Databases.Sessions.Create

Data ProjectsInstancesDatabasesSessionsCreate Source # 
Instance details

Defined in Network.Google.Resource.Spanner.Projects.Instances.Databases.Sessions.Create

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ProjectsInstancesDatabasesSessionsCreate -> c ProjectsInstancesDatabasesSessionsCreate #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ProjectsInstancesDatabasesSessionsCreate #

toConstr :: ProjectsInstancesDatabasesSessionsCreate -> Constr #

dataTypeOf :: ProjectsInstancesDatabasesSessionsCreate -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ProjectsInstancesDatabasesSessionsCreate) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ProjectsInstancesDatabasesSessionsCreate) #

gmapT :: (forall b. Data b => b -> b) -> ProjectsInstancesDatabasesSessionsCreate -> ProjectsInstancesDatabasesSessionsCreate #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ProjectsInstancesDatabasesSessionsCreate -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ProjectsInstancesDatabasesSessionsCreate -> r #

gmapQ :: (forall d. Data d => d -> u) -> ProjectsInstancesDatabasesSessionsCreate -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ProjectsInstancesDatabasesSessionsCreate -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ProjectsInstancesDatabasesSessionsCreate -> m ProjectsInstancesDatabasesSessionsCreate #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ProjectsInstancesDatabasesSessionsCreate -> m ProjectsInstancesDatabasesSessionsCreate #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ProjectsInstancesDatabasesSessionsCreate -> m ProjectsInstancesDatabasesSessionsCreate #

Show ProjectsInstancesDatabasesSessionsCreate Source # 
Instance details

Defined in Network.Google.Resource.Spanner.Projects.Instances.Databases.Sessions.Create

Generic ProjectsInstancesDatabasesSessionsCreate Source # 
Instance details

Defined in Network.Google.Resource.Spanner.Projects.Instances.Databases.Sessions.Create

GoogleRequest ProjectsInstancesDatabasesSessionsCreate Source # 
Instance details

Defined in Network.Google.Resource.Spanner.Projects.Instances.Databases.Sessions.Create

type Rep ProjectsInstancesDatabasesSessionsCreate Source # 
Instance details

Defined in Network.Google.Resource.Spanner.Projects.Instances.Databases.Sessions.Create

type Rep ProjectsInstancesDatabasesSessionsCreate = D1 (MetaData "ProjectsInstancesDatabasesSessionsCreate" "Network.Google.Resource.Spanner.Projects.Instances.Databases.Sessions.Create" "gogol-spanner-0.4.0-Gx6Dlj0rchWGrfXCDHk4fo" False) (C1 (MetaCons "ProjectsInstancesDatabasesSessionsCreate'" PrefixI True) ((S1 (MetaSel (Just "_pXgafv") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Xgafv)) :*: (S1 (MetaSel (Just "_pUploadProtocol") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_pDatabase") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text))) :*: ((S1 (MetaSel (Just "_pAccessToken") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_pUploadType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 (MetaSel (Just "_pPayload") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 CreateSessionRequest) :*: S1 (MetaSel (Just "_pCallback") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))))))
type Scopes ProjectsInstancesDatabasesSessionsCreate Source # 
Instance details

Defined in Network.Google.Resource.Spanner.Projects.Instances.Databases.Sessions.Create

type Scopes ProjectsInstancesDatabasesSessionsCreate = "https://www.googleapis.com/auth/cloud-platform" ': ("https://www.googleapis.com/auth/spanner.data" ': ([] :: [Symbol]))
type Rs ProjectsInstancesDatabasesSessionsCreate Source # 
Instance details

Defined in Network.Google.Resource.Spanner.Projects.Instances.Databases.Sessions.Create

Request Lenses

pUploadProtocol :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Text) Source #

Upload protocol for media (e.g. "raw", "multipart").

pDatabase :: Lens' ProjectsInstancesDatabasesSessionsCreate Text Source #

Required. The database in which the new session is created.

pUploadType :: Lens' ProjectsInstancesDatabasesSessionsCreate (Maybe Text) Source #

Legacy upload protocol for media (e.g. "media", "multipart").