Repository URL to install this package:
|
Version:
3.3.202-c2ee258 ▾
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class OperateContext(object):
def __init__(self):
self._merchant_id = None
self._operator_id = None
self._operator_type = None
@property
def merchant_id(self):
return self._merchant_id
@merchant_id.setter
def merchant_id(self, value):
self._merchant_id = value
@property
def operator_id(self):
return self._operator_id
@operator_id.setter
def operator_id(self, value):
self._operator_id = value
@property
def operator_type(self):
return self._operator_type
@operator_type.setter
def operator_type(self, value):
self._operator_type = value
def to_alipay_dict(self):
params = dict()
if self.merchant_id:
if hasattr(self.merchant_id, 'to_alipay_dict'):
params['merchant_id'] = self.merchant_id.to_alipay_dict()
else:
params['merchant_id'] = self.merchant_id
if self.operator_id:
if hasattr(self.operator_id, 'to_alipay_dict'):
params['operator_id'] = self.operator_id.to_alipay_dict()
else:
params['operator_id'] = self.operator_id
if self.operator_type:
if hasattr(self.operator_type, 'to_alipay_dict'):
params['operator_type'] = self.operator_type.to_alipay_dict()
else:
params['operator_type'] = self.operator_type
return params
@staticmethod
def from_alipay_dict(d):
if not d:
return None
o = OperateContext()
if 'merchant_id' in d:
o.merchant_id = d['merchant_id']
if 'operator_id' in d:
o.operator_id = d['operator_id']
if 'operator_type' in d:
o.operator_type = d['operator_type']
return o