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

# Class Headers

source code

    Headers for managing subscriptions.

Instance Methods | [hide private]
__init__(self) Create a new subscription configuration instance. | source code
__setitem__(self, key, value) Set a header value, ensuring the key is an allowed value. | source code
__getitem__(self, key) Get a header value, normalizing the key case. | source code
_normalize_key(self, key) Normalize a header name for use as a key. | source code
items(self) Generator for each header. | source code
write(self, headers) Applies the subscription headers. | source code
read(self, headers) Read from headers. | source code

Class Variables | [hide private]
| ALL_HEADERS = `set([SUBSCRIBE, SUBSCRIPTION_ID, TOPIC_ID, TOPIC`...``

Method Details | [hide private]

### __setitem__(self, key, value) (Index assignment operator) | source code
    Set a header value, ensuring the key is an allowed value.

    Args:
      key: str, the header key.
      value: str, the header value.
    Raises:
      ValueError if key is not one of the accepted headers.

### __getitem__(self, key) (Indexing operator) | source code
    Get a header value, normalizing the key case.

    Args:
      key: str, the header key.
    Returns:
      String header value.
    Raises:
      KeyError if the key is not one of the accepted headers.

### write(self, headers) | source code
    Applies the subscription headers.

    Args:
      headers: dict of headers to insert values into.

### read(self, headers) | source code
    Read from headers.

    Args:
      headers: dict of headers to read from.

Class Variable Details | [hide private]

  ### ALL_HEADERS Value:
      set([SUBSCRIBE, SUBSCRIPTION_ID, TOPIC_ID, TOPIC_URI, CLIENT_TOKEN, EV
      ENT_TYPE, UNSUBSCRIBE])