gogol-pubsub-0.4.0: Google Cloud Pub/Sub 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.PubSub.Projects.Subscriptions.Create

Contents

Description

Creates a subscription to a given topic. See the resource name rules. If the subscription already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the resource name format. The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.

See: Cloud Pub/Sub API Reference for pubsub.projects.subscriptions.create.

Synopsis

REST Resource

type ProjectsSubscriptionsCreateResource = "v1" :> (Capture "name" Text :> (QueryParam "$.xgafv" Xgafv :> (QueryParam "upload_protocol" Text :> (QueryParam "access_token" Text :> (QueryParam "uploadType" Text :> (QueryParam "callback" Text :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] Subscription :> Put '[JSON] Subscription)))))))) Source #

A resource alias for pubsub.projects.subscriptions.create method which the ProjectsSubscriptionsCreate request conforms to.

Creating a Request

projectsSubscriptionsCreate Source #

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

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

data ProjectsSubscriptionsCreate Source #

Creates a subscription to a given topic. See the resource name rules. If the subscription already exists, returns `ALREADY_EXISTS`. If the corresponding topic doesn't exist, returns `NOT_FOUND`. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic, conforming to the resource name format. The generated name is populated in the returned Subscription object. Note that for REST API requests, you must specify a name in the request.

See: projectsSubscriptionsCreate smart constructor.

Instances
Eq ProjectsSubscriptionsCreate Source # 
Instance details

Defined in Network.Google.Resource.PubSub.Projects.Subscriptions.Create

Data ProjectsSubscriptionsCreate Source # 
Instance details

Defined in Network.Google.Resource.PubSub.Projects.Subscriptions.Create

Methods

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

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

toConstr :: ProjectsSubscriptionsCreate -> Constr #

dataTypeOf :: ProjectsSubscriptionsCreate -> DataType #

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

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

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

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

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

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

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

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

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

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

Show ProjectsSubscriptionsCreate Source # 
Instance details

Defined in Network.Google.Resource.PubSub.Projects.Subscriptions.Create

Generic ProjectsSubscriptionsCreate Source # 
Instance details

Defined in Network.Google.Resource.PubSub.Projects.Subscriptions.Create

Associated Types

type Rep ProjectsSubscriptionsCreate :: Type -> Type #

GoogleRequest ProjectsSubscriptionsCreate Source # 
Instance details

Defined in Network.Google.Resource.PubSub.Projects.Subscriptions.Create

type Rep ProjectsSubscriptionsCreate Source # 
Instance details

Defined in Network.Google.Resource.PubSub.Projects.Subscriptions.Create

type Rep ProjectsSubscriptionsCreate = D1 (MetaData "ProjectsSubscriptionsCreate" "Network.Google.Resource.PubSub.Projects.Subscriptions.Create" "gogol-pubsub-0.4.0-4HrlFZL2Veq5x2Cv2TajBN" False) (C1 (MetaCons "ProjectsSubscriptionsCreate'" PrefixI True) ((S1 (MetaSel (Just "_pscXgafv") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Xgafv)) :*: (S1 (MetaSel (Just "_pscUploadProtocol") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_pscAccessToken") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 (MetaSel (Just "_pscUploadType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "_pscPayload") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Subscription)) :*: (S1 (MetaSel (Just "_pscName") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "_pscCallback") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Text))))))
type Scopes ProjectsSubscriptionsCreate Source # 
Instance details

Defined in Network.Google.Resource.PubSub.Projects.Subscriptions.Create

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

Defined in Network.Google.Resource.PubSub.Projects.Subscriptions.Create

Request Lenses

pscUploadProtocol :: Lens' ProjectsSubscriptionsCreate (Maybe Text) Source #

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

pscUploadType :: Lens' ProjectsSubscriptionsCreate (Maybe Text) Source #

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

pscName :: Lens' ProjectsSubscriptionsCreate Text Source #

The name of the subscription. It must have the format `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in length, and it must not start with `"goog"`.