def upload_object(bucket, filename, encryption_key, key_hash):
 service = create_service()
 with open(filename, 'rb') as f:
  request = service.objects().insert(bucket=bucket, name=filename, media_body=http.MediaIoBaseUpload(f, 'application/octet-stream'))
  request.headers['x-goog-encryption-algorithm'] = 'AES256'
  request.headers['x-goog-encryption-key'] = encryption_key
  request.headers['x-goog-encryption-key-sha256'] = key_hash
  resp = request.execute()
 return resp

def upload_object ( bucket , filename , encryption_key , key_hash ) : service = create_service ( ) with open ( filename , 'rb' ) as f : request = service . objects ( ) . insert ( bucket = bucket , name = filename , media_body = http . MediaIoBaseUpload ( f , 'application/octet-stream' ) ) request . headers [ 'x-goog-encryption-algorithm' ] = 'AES256' request . headers [ 'x-goog-encryption-key' ] = encryption_key request . headers [ 'x-goog-encryption-key-sha256' ] = key_hash resp = request . execute ( ) return resp
uploads an object .