<s> '''<STR_LIT>''' <EOL> from __future__ import unicode_literals <EOL> from . . collection_base import CollectionRequestBase , CollectionResponseBase , CollectionPageBase <EOL> from . . request_builder_base import RequestBuilderBase <EOL> from . . model . share import Share <EOL> import json <EOL> class SharesCollectionRequest ( CollectionRequestBase ) : <EOL> def __init__ ( self , request_url , client , options ) : <EOL> """<STR_LIT>""" <EOL> super ( SharesCollectionRequest , self ) . __init__ ( request_url , client , options ) <EOL> def get ( self ) : <EOL> """<STR_LIT>""" <EOL> self . method = "<STR_LIT:GET>" <EOL> collection_response = SharesCollectionResponse ( json . loads ( self . send ( ) . content ) ) <EOL> return self . _page_from_response ( collection_response ) <EOL> class SharesCollectionRequestBuilder ( RequestBuilderBase ) : <EOL> def __getitem__ ( self , key ) : <EOL> """<STR_LIT>""" <EOL> return ShareRequestBuilder ( self . append_to_request_url ( str ( key ) ) , self . _client ) <EOL> def request ( self , expand = None , select = None , top = None , order_by = None , options = None ) : <EOL> """<STR_LIT>""" <EOL> req = SharesCollectionRequest ( self . _request_url , self . _client , options ) <EOL> req . _set_query_options ( expand = expand , select = select , top = top , order_by = order_by ) <EOL> return req <EOL> def get ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . request ( ) . get ( ) <EOL> class SharesCollectionResponse ( CollectionResponseBase ) : <EOL> @ property <EOL> def collection_page ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . _collection_page : <EOL> self . _collection_page . _prop_list = self . _prop_dict [ "<STR_LIT:value>" ] <EOL> else : <EOL> self . _collection_page = SharesCollectionPage ( self . _prop_dict [ "<STR_LIT:value>" ] ) <EOL> return self . _collection_page <EOL> class SharesCollectionPage ( CollectionPageBase ) : <EOL> def __getitem__ ( self , index ) : <EOL> """<STR_LIT>""" <EOL> return Share ( self . _prop_list [ index ] ) <EOL> def shares ( self ) : <EOL> """<STR_LIT>""" <EOL> for item in self . _prop_list : <EOL> yield Share ( item ) <EOL> def _init_next_page_request ( self , next_page_link , client , options ) : <EOL> """<STR_LIT>""" <EOL> self . _next_page_request = SharesCollectionRequest ( next_page_link , client , options ) <EOL> from . . request . share_request_builder import ShareRequestBuilder </s>
