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

"""
ctddocumentation

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


class VirtualZones(object):

    """Implementation of the 'VirtualZones' model.

    TODO: type model description here.

    Attributes:
        destination_virtual_zone (DestinationVirtualZone): TODO: type
            description here.
        source_virtual_zone (DestinationVirtualZone): TODO: type description
            here.
        destination_virtual_zone_id (int): TODO: type description here.
        source_virtual_zone_id (int): TODO: type description here.
        policy_id (int): TODO: type description here.
        id (int): TODO: type description here.
        site_id (int): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "destination_virtual_zone": 'destination_virtual_zone',
        "source_virtual_zone": 'source_virtual_zone',
        "destination_virtual_zone_id": 'destination_virtual_zone_id',
        "source_virtual_zone_id": 'source_virtual_zone_id',
        "policy_id": 'policy_id',
        "id": 'id',
        "site_id": 'site_id'
    }

    _optionals = [
        'destination_virtual_zone',
        'source_virtual_zone',
        'destination_virtual_zone_id',
        'source_virtual_zone_id',
        'policy_id',
        'id',
        'site_id',
    ]

    def __init__(self,
                 destination_virtual_zone=APIHelper.SKIP,
                 source_virtual_zone=APIHelper.SKIP,
                 destination_virtual_zone_id=APIHelper.SKIP,
                 source_virtual_zone_id=APIHelper.SKIP,
                 policy_id=APIHelper.SKIP,
                 id=APIHelper.SKIP,
                 site_id=APIHelper.SKIP):
        """Constructor for the VirtualZones class"""

        # Initialize members of the class
        if destination_virtual_zone is not APIHelper.SKIP:
            self.destination_virtual_zone = destination_virtual_zone 
        if source_virtual_zone is not APIHelper.SKIP:
            self.source_virtual_zone = source_virtual_zone 
        if destination_virtual_zone_id is not APIHelper.SKIP:
            self.destination_virtual_zone_id = destination_virtual_zone_id 
        if source_virtual_zone_id is not APIHelper.SKIP:
            self.source_virtual_zone_id = source_virtual_zone_id 
        if policy_id is not APIHelper.SKIP:
            self.policy_id = policy_id 
        if id is not APIHelper.SKIP:
            self.id = id 
        if site_id is not APIHelper.SKIP:
            self.site_id = site_id 

    @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

        destination_virtual_zone = DestinationVirtualZone.from_dictionary(dictionary.get('destination_virtual_zone')) if 'destination_virtual_zone' in dictionary.keys() else APIHelper.SKIP
        source_virtual_zone = DestinationVirtualZone.from_dictionary(dictionary.get('source_virtual_zone')) if 'source_virtual_zone' in dictionary.keys() else APIHelper.SKIP
        destination_virtual_zone_id = dictionary.get("destination_virtual_zone_id") if dictionary.get("destination_virtual_zone_id") else APIHelper.SKIP
        source_virtual_zone_id = dictionary.get("source_virtual_zone_id") if dictionary.get("source_virtual_zone_id") else APIHelper.SKIP
        policy_id = dictionary.get("policy_id") if dictionary.get("policy_id") else APIHelper.SKIP
        id = dictionary.get("id") if dictionary.get("id") else APIHelper.SKIP
        site_id = dictionary.get("site_id") if dictionary.get("site_id") else APIHelper.SKIP
        # Return an object of this model
        return cls(destination_virtual_zone,
                   source_virtual_zone,
                   destination_virtual_zone_id,
                   source_virtual_zone_id,
                   policy_id,
                   id,
                   site_id)
