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

"""
    test_meraki

    This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""

import test_meraki.models.center_1
import test_meraki.models.bottom_left_corner
import test_meraki.models.bottom_right_corner
import test_meraki.models.top_left_corner
import test_meraki.models.top_right_corner

class UpdateNetworkFloorPlan(object):

    """Implementation of the 'updateNetworkFloorPlan' model.

    TODO: type model description here.

    Attributes:
        name (string): The name of your floor plan.
        center (Center1): The longitude and latitude of the center of your
            floor plan. If you want to change the geolocation data of your
            floor plan, either the 'center' or two adjacent corners (e.g.
            'topLeftCorner' and 'bottomLeftCorner') must be specified. If
            'center' is specified, the floor plan is placed over that point
            with no rotation. If two adjacent corners are specified, the floor
            plan is rotated to line up with the two specified points. The
            aspect ratio of the floor plan's image is preserved regardless of
            which corners/center are specified. (This means if that more than
            two corners are specified, only two corners may be used to
            preserve the floor plan's aspect ratio.). No two points can have
            the same latitude, longitude pair.
        bottom_left_corner (BottomLeftCorner): The longitude and latitude of
            the bottom left corner of your floor plan.
        bottom_right_corner (BottomRightCorner): The longitude and latitude of
            the bottom right corner of your floor plan.
        top_left_corner (TopLeftCorner): The longitude and latitude of the top
            left corner of your floor plan.
        top_right_corner (TopRightCorner): The longitude and latitude of the
            top right corner of your floor plan.
        image_contents (string): The file contents (a base 64 encoded string)
            of your new image. Supported formats are PNG, GIF, and JPG. Note
            that all images are saved as PNG files, regardless of the format
            they are uploaded in. If you upload a new image, and you do NOT
            specify any new geolocation fields ('center, 'topLeftCorner',
            etc), the floor plan will be recentered with no rotation in order
            to maintain the aspect ratio of your new image.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "name":'name',
        "center":'center',
        "bottom_left_corner":'bottomLeftCorner',
        "bottom_right_corner":'bottomRightCorner',
        "top_left_corner":'topLeftCorner',
        "top_right_corner":'topRightCorner',
        "image_contents":'imageContents'
    }

    def __init__(self,
                 name=None,
                 center=None,
                 bottom_left_corner=None,
                 bottom_right_corner=None,
                 top_left_corner=None,
                 top_right_corner=None,
                 image_contents=None):
        """Constructor for the UpdateNetworkFloorPlan class"""

        # Initialize members of the class
        self.name = name
        self.center = center
        self.bottom_left_corner = bottom_left_corner
        self.bottom_right_corner = bottom_right_corner
        self.top_left_corner = top_left_corner
        self.top_right_corner = top_right_corner
        self.image_contents = image_contents


    @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
        name = dictionary.get('name')
        center = test_meraki.models.center_1.Center1.from_dictionary(dictionary.get('center')) if dictionary.get('center') else None
        bottom_left_corner = test_meraki.models.bottom_left_corner.BottomLeftCorner.from_dictionary(dictionary.get('bottomLeftCorner')) if dictionary.get('bottomLeftCorner') else None
        bottom_right_corner = test_meraki.models.bottom_right_corner.BottomRightCorner.from_dictionary(dictionary.get('bottomRightCorner')) if dictionary.get('bottomRightCorner') else None
        top_left_corner = test_meraki.models.top_left_corner.TopLeftCorner.from_dictionary(dictionary.get('topLeftCorner')) if dictionary.get('topLeftCorner') else None
        top_right_corner = test_meraki.models.top_right_corner.TopRightCorner.from_dictionary(dictionary.get('topRightCorner')) if dictionary.get('topRightCorner') else None
        image_contents = dictionary.get('imageContents')

        # Return an object of this model
        return cls(name,
                   center,
                   bottom_left_corner,
                   bottom_right_corner,
                   top_left_corner,
                   top_right_corner,
                   image_contents)


