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

"""
restapisdk

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""
from restapisdk.models.table_input import TableInput


class ApiRestV2ConnectionRemovetableRequest(object):

    """Implementation of the 'Api Rest V2 Connection Removetable Request' model.

    TODO: type model description here.

    Attributes:
        id (string): GUID of the connection
        tables (list of TableInput): A JSON array of name or GUIDs of the
            table or both.    At least one input is required. Provide either
            table name or id. When both are given then id is considered

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "id": 'id',
        "tables": 'tables'
    }

    def __init__(self,
                 id=None,
                 tables=None):
        """Constructor for the ApiRestV2ConnectionRemovetableRequest class"""

        # Initialize members of the class
        self.id = id
        self.tables = tables

    @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')
        tables = None
        if dictionary.get('tables') is not None:
            tables = [TableInput.from_dictionary(x) for x in dictionary.get('tables')]

        # Return an object of this model
        return cls(id,
                   tables)
