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

"""
instagramapi

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


class RelationshipInfo(object):

    """Implementation of the 'RelationshipInfo' model.

    Attributes:
        incoming_status (IncomingStatusEnum): Status of incoming relationship
        outgoing_status (OutgoingStatusEnum): Status of outgoing relationship
        target_user_is_private (bool): Indicates whether target user is
            private or not

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "incoming_status": 'incoming_status',
        "outgoing_status": 'outgoing_status',
        "target_user_is_private": 'target_user_is_private'
    }

    _optionals = [
        'incoming_status',
        'outgoing_status',
        'target_user_is_private',
    ]

    def __init__(self,
                 incoming_status=APIHelper.SKIP,
                 outgoing_status=APIHelper.SKIP,
                 target_user_is_private=APIHelper.SKIP):
        """Constructor for the RelationshipInfo class"""

        # Initialize members of the class
        if incoming_status is not APIHelper.SKIP:
            self.incoming_status = incoming_status 
        if outgoing_status is not APIHelper.SKIP:
            self.outgoing_status = outgoing_status 
        if target_user_is_private is not APIHelper.SKIP:
            self.target_user_is_private = target_user_is_private 

    @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 not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        incoming_status = dictionary.get("incoming_status") if dictionary.get("incoming_status") else APIHelper.SKIP
        outgoing_status = dictionary.get("outgoing_status") if dictionary.get("outgoing_status") else APIHelper.SKIP
        target_user_is_private = dictionary.get("target_user_is_private") if "target_user_is_private" in dictionary.keys() else APIHelper.SKIP
        # Return an object of this model
        return cls(incoming_status,
                   outgoing_status,
                   target_user_is_private)

    def __repr__(self):
        return (f'{self.__class__.__name__}('
                f'incoming_status={(self.incoming_status if hasattr(self, "incoming_status") else None)!r}, '
                f'outgoing_status={(self.outgoing_status if hasattr(self, "outgoing_status") else None)!r}, '
                f'target_user_is_private={(self.target_user_is_private if hasattr(self, "target_user_is_private") else None)!r})')

    def __str__(self):
        return (f'{self.__class__.__name__}('
                f'incoming_status={(self.incoming_status if hasattr(self, "incoming_status") else None)!s}, '
                f'outgoing_status={(self.outgoing_status if hasattr(self, "outgoing_status") else None)!s}, '
                f'target_user_is_private={(self.target_user_is_private if hasattr(self, "target_user_is_private") else None)!s})')
