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

"""
zypev1

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from zypev1.models.geography import Geography


class ContentRuleMetadata(object):

    """Implementation of the 'ContentRuleMetadata' model.

    TODO: type model description here.

    Attributes:
        id (string): TODO: type description here.
        created_at (string): 06-30T10:13:14.555-04:00
        updated_at (string): TODO: type description here.
        enabled (bool): TODO: type description here.
        geographies (list of Geography): TODO: type description here.
        name (string): TODO: type description here.
        policy (string): TODO: type description here.
        priority (string): TODO: type description here.
        stackable (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": '_id',
        "created_at": 'created_at',
        "updated_at": 'updated_at',
        "enabled": 'enabled',
        "geographies": 'geographies',
        "name": 'name',
        "policy": 'policy',
        "priority": 'priority',
        "stackable": 'stackable'
    }

    def __init__(self,
                 id=None,
                 created_at=None,
                 updated_at=None,
                 enabled=None,
                 geographies=None,
                 name=None,
                 policy=None,
                 priority=None,
                 stackable=None):
        """Constructor for the ContentRuleMetadata class"""

        # Initialize members of the class
        self.id = id
        self.created_at = created_at
        self.updated_at = updated_at
        self.enabled = enabled
        self.geographies = geographies
        self.name = name
        self.policy = policy
        self.priority = priority
        self.stackable = stackable

    @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
        id = dictionary.get('_id')
        created_at = dictionary.get('created_at')
        updated_at = dictionary.get('updated_at')
        enabled = dictionary.get('enabled')
        geographies = None
        if dictionary.get('geographies') is not None:
            geographies = [Geography.from_dictionary(x) for x in dictionary.get('geographies')]
        name = dictionary.get('name')
        policy = dictionary.get('policy')
        priority = dictionary.get('priority')
        stackable = dictionary.get('stackable')

        # Return an object of this model
        return cls(id,
                   created_at,
                   updated_at,
                   enabled,
                   geographies,
                   name,
                   policy,
                   priority,
                   stackable)
