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

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


class AlipayDataDataserviceAdconversionConversionidQueryModel(object):

    def __init__(self):
        self._converted_event = None
        self._plan_id = None
        self._principal_tag = None

    @property
    def converted_event(self):
        return self._converted_event

    @converted_event.setter
    def converted_event(self, value):
        self._converted_event = value
    @property
    def plan_id(self):
        return self._plan_id

    @plan_id.setter
    def plan_id(self, value):
        self._plan_id = value
    @property
    def principal_tag(self):
        return self._principal_tag

    @principal_tag.setter
    def principal_tag(self, value):
        self._principal_tag = value


    def to_alipay_dict(self):
        params = dict()
        if self.converted_event:
            if hasattr(self.converted_event, 'to_alipay_dict'):
                params['converted_event'] = self.converted_event.to_alipay_dict()
            else:
                params['converted_event'] = self.converted_event
        if self.plan_id:
            if hasattr(self.plan_id, 'to_alipay_dict'):
                params['plan_id'] = self.plan_id.to_alipay_dict()
            else:
                params['plan_id'] = self.plan_id
        if self.principal_tag:
            if hasattr(self.principal_tag, 'to_alipay_dict'):
                params['principal_tag'] = self.principal_tag.to_alipay_dict()
            else:
                params['principal_tag'] = self.principal_tag
        return params

    @staticmethod
    def from_alipay_dict(d):
        if not d:
            return None
        o = AlipayDataDataserviceAdconversionConversionidQueryModel()
        if 'converted_event' in d:
            o.converted_event = d['converted_event']
        if 'plan_id' in d:
            o.plan_id = d['plan_id']
        if 'principal_tag' in d:
            o.principal_tag = d['principal_tag']
        return o


