<s> from libsaas import http , parsers <EOL> from libsaas . services import base <EOL> from . import resource <EOL> class Replies ( resource . PaginatedDeskResource ) : <EOL> path = '<STR_LIT>' <EOL> class Reply ( resource . DeskResource ) : <EOL> path = '<STR_LIT>' <EOL> class CasesBase ( resource . DeskResource ) : <EOL> path = '<STR_LIT>' <EOL> class Cases ( CasesBase ) : <EOL> def create ( self , * args , ** kwargs ) : <EOL> raise base . MethodNotSupported ( ) <EOL> def update ( self , * args , ** kwargs ) : <EOL> raise base . MethodNotSupported ( ) <EOL> def delete ( self , * args , ** kwargs ) : <EOL> raise base . MethodNotSupported ( ) <EOL> @ base . apimethod <EOL> def get ( self , embed = None , fields = None , per_page = None , page = None ) : <EOL> """<STR_LIT>""" <EOL> params = base . get_params ( None , locals ( ) ) <EOL> return http . Request ( '<STR_LIT:GET>' , self . get_url ( ) , params ) , parsers . parse_json <EOL> @ base . apimethod <EOL> def search ( self , name = None , first_name = None , last_name = None , email = None , <EOL> phone = None , company = None , twitter = None , labels = None , <EOL> case_id = None , subject = None , description = None , <EOL> status = None , priority = None , assigned_group = None , <EOL> assigned_user = None , channels = None , notes = None , attachments = None , <EOL> created = None , updated = None , since_created_at = None , <EOL> max_created_at = None , since_updated_at = None , max_updated_at = None , <EOL> since_id = None , max_id = None , per_page = None , page = None , <EOL> embed = None , fields = None , ** case_custom_fields ) : <EOL> """<STR_LIT>""" <EOL> store = locals ( ) <EOL> store . update ( store . pop ( '<STR_LIT>' ) ) <EOL> params = base . get_params ( None , store ) <EOL> url = '<STR_LIT>' . format ( self . get_url ( ) , '<STR_LIT>' ) <EOL> return http . Request ( '<STR_LIT:GET>' , url , params ) , parsers . parse_json <EOL> class Case ( CasesBase ) : <EOL> def __init__ ( self , parent , object_id , is_external = False ) : <EOL> case_id = '<STR_LIT>' % object_id if is_external else object_id <EOL> super ( Case , self ) . __init__ ( parent , case_id ) <EOL> @ base . apimethod <EOL> def message ( self ) : <EOL> """<STR_LIT>""" <EOL> url = '<STR_LIT>' . format ( self . get_url ( ) , '<STR_LIT:message>' ) <EOL> return http . Request ( '<STR_LIT:GET>' , url ) , parsers . parse_json <EOL> @ base . apimethod <EOL> def history ( self , per_page = None , page = None ) : <EOL> """<STR_LIT>""" <EOL> params = base . get_params ( None , locals ( ) ) <EOL> url = '<STR_LIT>' . format ( self . get_url ( ) , '<STR_LIT>' ) <EOL> return http . Request ( '<STR_LIT:GET>' , url , params ) , parsers . parse_json <EOL> @ base . resource ( Replies ) <EOL> def replies ( self ) : <EOL> """<STR_LIT>""" <EOL> return Replies ( self ) <EOL> @ base . resource ( Reply ) <EOL> def reply ( self , reply_id ) : <EOL> """<STR_LIT>""" <EOL> return Reply ( self , reply_id ) </s>
