Package apiclient :: Module push :: Class Subscription |
[hide private]
[frames] | no frames]

# Class Subscription

source code

    Information about a subscription.

Instance Methods | [hide private]
__init__(self) Create a new Subscription. | source code
verify(self, headers) Verifies that a webhook notification has the correct client_token. | source code
subscribe(self) Subscribe header value. | source code
subscription_id(self) Subscription ID header value. | source code
topic_id(self) Topic ID header value. | source code
topic_uri(self) Topic URI header value. | source code
client_token(self) Client Token header value. | source code
event_type(self) Event Type header value. | source code
unsubscribe(self) Unsuscribe header value. | source code
Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Class Methods | [hide private]
for_request(cls, request, channel, client_token=None) Creates a subscription and attaches it to a request. | source code
for_channel(cls, channel, client_token=None) Alternate constructor to create a subscription from a channel. | source code

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self) (Constructor) | source code
    Create a new Subscription.
Overrides: object.__init__

### for_request(cls, request, channel, client_token=None) Class Method | source code
    Creates a subscription and attaches it to a request.

    Args:
      request: An http.HttpRequest to modify for making a subscription.
      channel: A apiclient.push.Channel describing the subscription to
               create.
      client_token: (optional) client token to verify the notification.

    Returns:
      New subscription object.

### for_channel(cls, channel, client_token=None) Class Method | source code
    Alternate constructor to create a subscription from a channel.

    Args:
      channel: A apiclient.push.Channel describing the subscription to
               create.
      client_token: (optional) client token to verify the notification.

    Returns:
      New subscription object.

### verify(self, headers) | source code
    Verifies that a webhook notification has the correct client_token.

    Args:
      headers: dict of request headers for a push notification.

    Returns:
      Boolean value indicating whether the notification is verified.

### subscribe(self) | source code
    Subscribe header value.
Decorators: `@property`

### subscription_id(self) | source code
    Subscription ID header value.
Decorators: `@property`

### topic_id(self) | source code
    Topic ID header value.
Decorators: `@property`

### topic_uri(self) | source code
    Topic URI header value.
Decorators: `@property`

### client_token(self) | source code
    Client Token header value.
Decorators: `@property`

### event_type(self) | source code
    Event Type header value.
Decorators: `@property`

### unsubscribe(self) | source code
    Unsuscribe header value.
Decorators: `@property`