@@ -99,6 +99,19 @@ def __init__(self, client, document):
9999 def __str__ (self ):
100100 return f'Asset: { self .uid } '
101101
102+ def analyze (self , analyzers , notification_url = None ):
103+ """Analyze the asset"""
104+
105+ r = self ._client (
106+ 'post' ,
107+ f'assets/{ self .uid } /analyze' ,
108+ params = {'notification_url' : notification_url },
109+ json_type_body = [a .to_json_type () for a in analyzers ]
110+ )
111+
112+ if not notification_url :
113+ self .meta = r ['meta' ]
114+
102115 def download (self ):
103116 """Download the asset"""
104117 return self ._client (
@@ -121,8 +134,7 @@ def expire(self, seconds):
121134
122135 self ._document .update (r )
123136
124-
125- def persist (self ,):
137+ def persist (self ):
126138 """Set the asset to persist (remove the expires time)"""
127139
128140 r = self ._client (
@@ -132,19 +144,6 @@ def persist(self,):
132144
133145 self ._document .update (r )
134146
135- def analyze (self , analyzers , notification_url = None ):
136- """Analyze the asset"""
137-
138- r = self ._client (
139- 'post' ,
140- f'assets/{ self .uid } /analyze' ,
141- params = {'notification_url' : notification_url },
142- json_type_body = [a .to_json_type () for a in analyzers ]
143- )
144-
145- if not notification_url :
146- self .meta = r ['meta' ]
147-
148147 @classmethod
149148 def all (self , client , secure = None , type = None , q = None , rate_buffer = 0 ):
150149 """
0 commit comments