#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json

from alipay.aop.api.constant.ParamConstants import *


class AssetBomItem(object):

    def __init__(self):
        self._biz_type = None
        self._count = None
        self._item_id = None
        self._item_name = None
        self._item_version = None
        self._release_status = None
        self._status = None

    @property
    def biz_type(self):
        return self._biz_type

    @biz_type.setter
    def biz_type(self, value):
        self._biz_type = value
    @property
    def count(self):
        return self._count

    @count.setter
    def count(self, value):
        self._count = value
    @property
    def item_id(self):
        return self._item_id

    @item_id.setter
    def item_id(self, value):
        self._item_id = value
    @property
    def item_name(self):
        return self._item_name

    @item_name.setter
    def item_name(self, value):
        self._item_name = value
    @property
    def item_version(self):
        return self._item_version

    @item_version.setter
    def item_version(self, value):
        self._item_version = value
    @property
    def release_status(self):
        return self._release_status

    @release_status.setter
    def release_status(self, value):
        self._release_status = value
    @property
    def status(self):
        return self._status

    @status.setter
    def status(self, value):
        self._status = value


    def to_alipay_dict(self):
        params = dict()
        if self.biz_type:
            if hasattr(self.biz_type, 'to_alipay_dict'):
                params['biz_type'] = self.biz_type.to_alipay_dict()
            else:
                params['biz_type'] = self.biz_type
        if self.count:
            if hasattr(self.count, 'to_alipay_dict'):
                params['count'] = self.count.to_alipay_dict()
            else:
                params['count'] = self.count
        if self.item_id:
            if hasattr(self.item_id, 'to_alipay_dict'):
                params['item_id'] = self.item_id.to_alipay_dict()
            else:
                params['item_id'] = self.item_id
        if self.item_name:
            if hasattr(self.item_name, 'to_alipay_dict'):
                params['item_name'] = self.item_name.to_alipay_dict()
            else:
                params['item_name'] = self.item_name
        if self.item_version:
            if hasattr(self.item_version, 'to_alipay_dict'):
                params['item_version'] = self.item_version.to_alipay_dict()
            else:
                params['item_version'] = self.item_version
        if self.release_status:
            if hasattr(self.release_status, 'to_alipay_dict'):
                params['release_status'] = self.release_status.to_alipay_dict()
            else:
                params['release_status'] = self.release_status
        if self.status:
            if hasattr(self.status, 'to_alipay_dict'):
                params['status'] = self.status.to_alipay_dict()
            else:
                params['status'] = self.status
        return params

    @staticmethod
    def from_alipay_dict(d):
        if not d:
            return None
        o = AssetBomItem()
        if 'biz_type' in d:
            o.biz_type = d['biz_type']
        if 'count' in d:
            o.count = d['count']
        if 'item_id' in d:
            o.item_id = d['item_id']
        if 'item_name' in d:
            o.item_name = d['item_name']
        if 'item_version' in d:
            o.item_version = d['item_version']
        if 'release_status' in d:
            o.release_status = d['release_status']
        if 'status' in d:
            o.status = d['status']
        return o


