gogol-pubsub-0.0.1: Google Cloud Pub/Sub SDK.

Copyright(c) 2015 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 for a given subscriber. 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.

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

Synopsis

REST Resource

type ProjectsSubscriptionsCreateResource = "v1" :> (Capture "name" Text :> (QueryParam "$.xgafv" Text :> (QueryParam "upload_protocol" Text :> (QueryParam "pp" Bool :> (QueryParam "access_token" Text :> (QueryParam "uploadType" Text :> (QueryParam "bearer_token" 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 for a given subscriber. 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.

See: projectsSubscriptionsCreate smart constructor.

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"`.