from typing import Optional


class DeliveryInfoDto(object):
    def __init__(
        self,                   # type: DeliveryInfoDto
        partner,                # type: str
        remote_id=None,         # type: Optional[str]
        partner_id=None,        # type: Optional[str]
        brand=None,             # type: Optional[str]
    ):
        self.partner = partner
        self.remote_id = remote_id
        self.partner_id = partner_id
        self.brand = brand

    def to_dict(self):
        ret = {
            "partner": self.partner
        }
        if self.remote_id is not None:
            ret["remoteId"] = self.remote_id
        if self.partner_id is not None:
            ret["partnerId"] = self.partner_id
        if self.brand is not None:
            ret["brand"] = self.brand

        return ret

    @staticmethod
    def from_dict(d):
        return DeliveryInfoDto(
            partner=d["partner"],
            remote_id=d.get("remoteId"),
            partner_id=d.get("partnerId"),
            brand=d.get("brand"),
        )
