Package googleapiclient :: Module discovery :: Class Resource
[hide private]
[frames] | no frames]

Class Resource

source code

object --+
         |
        Resource

A class for interacting with a resource.

Instance Methods [hide private]
 
__init__(self, http, baseUrl, model, requestBuilder, developerKey, resourceDesc, rootDesc, schema)
Build a Resource from the API description.
source code
 
_set_dynamic_attr(self, attr_name, value)
Sets an instance attribute and tracks it in a list of dynamic attributes.
source code
 
__getstate__(self)
Trim the state down to something that can be pickled.
source code
 
__setstate__(self, state)
Reconstitute the state of the object from being pickled.
source code
 
__enter__(self) source code
 
__exit__(self, exc_type, exc, exc_tb) source code
 
close(self)
Close httplib2 connections.
source code
 
_set_service_methods(self) source code
 
_add_basic_methods(self, resourceDesc, rootDesc, schema) source code
 
_add_nested_resources(self, resourceDesc, rootDesc, schema) source code
 
_add_next_methods(self, resourceDesc, schema) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, http, baseUrl, model, requestBuilder, developerKey, resourceDesc, rootDesc, schema)
(Constructor)

source code 
Build a Resource from the API description.

Args:
  http: httplib2.Http, Object to make http requests with.
  baseUrl: string, base URL for the API. All requests are relative to this
      URI.
  model: googleapiclient.Model, converts to and from the wire format.
  requestBuilder: class or callable that instantiates an
      googleapiclient.HttpRequest object.
  developerKey: string, key obtained from
      https://code.google.com/apis/console
  resourceDesc: object, section of deserialized discovery document that
      describes a resource. Note that the top level discovery document
      is considered a resource.
  rootDesc: object, the entire deserialized discovery document.
  schema: object, mapping of schema names to schema descriptions.

Overrides: object.__init__

_set_dynamic_attr(self, attr_name, value)

source code 
Sets an instance attribute and tracks it in a list of dynamic attributes.

Args:
  attr_name: string; The name of the attribute to be set
  value: The value being set on the object and tracked in the dynamic cache.

__getstate__(self)

source code 

Trim the state down to something that can be pickled.

Uses the fact that the instance variable _dynamic_attrs holds attrs that will be wiped and restored on pickle serialization.

__setstate__(self, state)

source code 

Reconstitute the state of the object from being pickled.

Uses the fact that the instance variable _dynamic_attrs holds attrs that will be wiped and restored on pickle serialization.