Copyright | (c) 2015-2016 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
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
- 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))))))))
- projectsSubscriptionsCreate :: Subscription -> Text -> ProjectsSubscriptionsCreate
- data ProjectsSubscriptionsCreate
- pscXgafv :: Lens' ProjectsSubscriptionsCreate (Maybe Xgafv)
- pscUploadProtocol :: Lens' ProjectsSubscriptionsCreate (Maybe Text)
- pscAccessToken :: Lens' ProjectsSubscriptionsCreate (Maybe Text)
- pscUploadType :: Lens' ProjectsSubscriptionsCreate (Maybe Text)
- pscPayload :: Lens' ProjectsSubscriptionsCreate Subscription
- pscName :: Lens' ProjectsSubscriptionsCreate Text
- pscCallback :: Lens' ProjectsSubscriptionsCreate (Maybe Text)
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
Request Lenses
pscUploadProtocol :: Lens' ProjectsSubscriptionsCreate (Maybe Text) Source #
Upload protocol for media (e.g. "raw", "multipart").
pscAccessToken :: Lens' ProjectsSubscriptionsCreate (Maybe Text) Source #
OAuth access token.
pscUploadType :: Lens' ProjectsSubscriptionsCreate (Maybe Text) Source #
Legacy upload protocol for media (e.g. "media", "multipart").
pscPayload :: Lens' ProjectsSubscriptionsCreate Subscription Source #
Multipart request metadata.
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"`.
pscCallback :: Lens' ProjectsSubscriptionsCreate (Maybe Text) Source #
JSONP