<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import gdata . calendar_resource . data <EOL> import gdata . client <EOL> import urllib <EOL> RESOURCE_FEED_TEMPLATE = '<STR_LIT>' <EOL> class CalendarResourceClient ( gdata . client . GDClient ) : <EOL> """<STR_LIT>""" <EOL> host = '<STR_LIT>' <EOL> api_version = '<STR_LIT>' <EOL> auth_service = '<STR_LIT>' <EOL> auth_scopes = gdata . gauth . AUTH_SCOPES [ '<STR_LIT>' ] <EOL> ssl = True <EOL> def __init__ ( self , domain , auth_token = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> gdata . client . GDClient . __init__ ( self , auth_token = auth_token , ** kwargs ) <EOL> self . domain = domain <EOL> def make_resource_feed_uri ( self , resource_id = None , params = None ) : <EOL> """<STR_LIT>""" <EOL> uri = RESOURCE_FEED_TEMPLATE % ( self . api_version , self . domain ) <EOL> if resource_id : <EOL> uri += resource_id <EOL> if params : <EOL> uri += '<STR_LIT:?>' + urllib . urlencode ( params ) <EOL> return uri <EOL> MakeResourceFeedUri = make_resource_feed_uri <EOL> def get_resource_feed ( self , uri = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if uri is None : <EOL> uri = self . MakeResourceFeedUri ( ) <EOL> return self . get_feed ( <EOL> uri , <EOL> desired_class = gdata . calendar_resource . data . CalendarResourceFeed , <EOL> ** kwargs ) <EOL> GetResourceFeed = get_resource_feed <EOL> def get_resource ( self , uri = None , resource_id = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if uri is None : <EOL> uri = self . MakeResourceFeedUri ( resource_id ) <EOL> return self . get_entry ( <EOL> uri , <EOL> desired_class = gdata . calendar_resource . data . CalendarResourceEntry , <EOL> ** kwargs ) <EOL> GetResource = get_resource <EOL> def create_resource ( self , resource_id , resource_common_name = None , <EOL> resource_description = None , resource_type = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> new_resource = gdata . calendar_resource . data . CalendarResourceEntry ( <EOL> resource_id = resource_id , <EOL> resource_common_name = resource_common_name , <EOL> resource_description = resource_description , <EOL> resource_type = resource_type ) <EOL> return self . post ( new_resource , self . MakeResourceFeedUri ( ) , ** kwargs ) <EOL> CreateResource = create_resource <EOL> def update_resource ( self , resource_id , resource_common_name = None , <EOL> resource_description = None , resource_type = None , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> new_resource = gdata . calendar_resource . data . CalendarResourceEntry ( <EOL> resource_id = resource_id , <EOL> resource_common_name = resource_common_name , <EOL> resource_description = resource_description , <EOL> resource_type = resource_type ) <EOL> return self . update ( new_resource , uri = self . MakeResourceFeedUri ( resource_id ) , <EOL> ** kwargs ) <EOL> UpdateResource = update_resource <EOL> def delete_resource ( self , resource_id , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return self . delete ( self . MakeResourceFeedUri ( resource_id ) , ** kwargs ) <EOL> DeleteResource = delete_resource </s>
