def generate_presigned_post(self, Bucket, Key, Fields=None, Conditions=None, ExpiresIn=3600):
 bucket = Bucket
 key = Key
 fields = Fields
 conditions = Conditions
 expires_in = ExpiresIn
 if (fields is None):
  fields = {}
 if (conditions is None):
  conditions = []
 post_presigner = S3PostPresigner(self._request_signer)
 serializer = self._serializer
 operation_model = self.meta.service_model.operation_model('CreateBucket')
 request_dict = serializer.serialize_to_request({'Bucket': bucket}, operation_model)
 prepare_request_dict(request_dict, endpoint_url=self.meta.endpoint_url)
 conditions.append({'bucket': bucket})
 if key.endswith('${filename}'):
  conditions.append(['starts-with', '$key', key[:(- len('${filename}'))]])
 else:
  conditions.append({'key': key})
 fields['key'] = key
 return post_presigner.generate_presigned_post(request_dict=request_dict, fields=fields, conditions=conditions, expires_in=expires_in)

def generate_presigned_post ( self , Bucket , Key , Fields = None , Conditions = None , ExpiresIn = 3600 ) : bucket = Bucket key = Key fields = Fields conditions = Conditions expires_in = ExpiresIn if ( fields is None ) : fields = { } if ( conditions is None ) : conditions = [ ] post_presigner = S3PostPresigner ( self . _request_signer ) serializer = self . _serializer operation_model = self . meta . service_model . operation_model ( 'CreateBucket' ) request_dict = serializer . serialize_to_request ( { 'Bucket' : bucket } , operation_model ) prepare_request_dict ( request_dict , endpoint_url = self . meta . endpoint_url ) conditions . append ( { 'bucket' : bucket } ) if key . endswith ( '${filename}' ) : conditions . append ( [ 'starts-with' , '$key' , key [ : ( - len ( '${filename}' ) ) ] ] ) else : conditions . append ( { 'key' : key } ) fields [ 'key' ] = key return post_presigner . generate_presigned_post ( request_dict = request_dict , fields = fields , conditions = conditions , expires_in = expires_in )
builds the url and the form fields used for a presigned s3 post :type bucket: string .