<s> import shopify . resources <EOL> class Countable ( object ) : <EOL> @ classmethod <EOL> def count ( cls , _options = None , ** kwargs ) : <EOL> if _options is None : <EOL> _options = kwargs <EOL> return int ( cls . get ( "<STR_LIT:count>" , ** _options ) ) <EOL> class Metafields ( object ) : <EOL> def metafields ( self , _options = None , ** kwargs ) : <EOL> if _options is None : <EOL> _options = kwargs <EOL> return shopify . resources . Metafield . find ( resource = self . __class__ . plural , resource_id = self . id , ** _options ) <EOL> def metafields_count ( self , _options = None , ** kwargs ) : <EOL> if _options is None : <EOL> _options = kwargs <EOL> return int ( self . get ( "<STR_LIT>" , ** _options ) ) <EOL> def add_metafield ( self , metafield ) : <EOL> if self . is_new ( ) : <EOL> raise ValueError ( "<STR_LIT>" ) <EOL> metafield . _prefix_options = dict ( resource = self . __class__ . plural , resource_id = self . id ) <EOL> metafield . save ( ) <EOL> return metafield <EOL> class Events ( object ) : <EOL> def events ( self ) : <EOL> return shopify . resources . Event . find ( resource = self . __class__ . plural , resource_id = self . id ) </s>
