# -*- coding: utf-8 -*-

"""
ctddocumentation

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from ctddocumentation.api_helper import APIHelper


class UpdateLicenseResponse(object):

    """Implementation of the 'UpdateLicenseResponse' model.

    TODO: type model description here.

    Attributes:
        success (bool): TODO: type description here.
        message (string): TODO: type description here.
        status (StatusEnum): TODO: type description here.
        expiration_date (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "success": 'success',
        "message": 'message',
        "status": 'status',
        "expiration_date": 'expiration_date'
    }

    _optionals = [
        'status',
        'expiration_date',
    ]

    def __init__(self,
                 success=None,
                 message=None,
                 status=APIHelper.SKIP,
                 expiration_date=APIHelper.SKIP):
        """Constructor for the UpdateLicenseResponse class"""

        # Initialize members of the class
        self.success = success 
        self.message = message 
        if status is not APIHelper.SKIP:
            self.status = status 
        if expiration_date is not APIHelper.SKIP:
            self.expiration_date = expiration_date 

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Creates an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if dictionary is None:
            return None

        # Extract variables from the dictionary

        success = dictionary.get("success") if "success" in dictionary.keys() else None
        message = dictionary.get("message") if dictionary.get("message") else None
        status = dictionary.get("status") if dictionary.get("status") else APIHelper.SKIP
        expiration_date = dictionary.get("expiration_date") if dictionary.get("expiration_date") else APIHelper.SKIP
        # Return an object of this model
        return cls(success,
                   message,
                   status,
                   expiration_date)
