import json
from typing import Union

class ServicePeriod(object):
    def __init__(self, service_period_json):
        # type: (Union[str, None]) -> None

        if not service_period_json:
            service_period_json = "{}"
            self.str_json = ""
        else:
            self.str_json = service_period_json

        service_period = json.loads(service_period_json)
        self.id = service_period.get("servicePeriodId")

