"""mindbodypublicapi.

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

# ruff: noqa: E501
from mindbodypublicapi.api_helper import APIHelper


class GetMembershipsRequest(object):
    """Implementation of the 'GetMembershipsRequest' model.

    Attributes:
        membership_ids (List[int]): The requested membership IDs.<br />  Default:
            **all** IDs that the authenticated user’s access level allows.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "membership_ids": "MembershipIds",
    }

    _optionals = [
        "membership_ids",
    ]

    def __init__(
        self,
        membership_ids=APIHelper.SKIP):
        """Initialize a GetMembershipsRequest instance."""
        # Initialize members of the class
        if membership_ids is not APIHelper.SKIP:
            self.membership_ids = membership_ids

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Create 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
        membership_ids =\
            dictionary.get("MembershipIds")\
            if dictionary.get("MembershipIds")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(membership_ids)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _membership_ids=(
            self.membership_ids
            if hasattr(self, "membership_ids")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"membership_ids={_membership_ids!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _membership_ids=(
            self.membership_ids
            if hasattr(self, "membership_ids")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"membership_ids={_membership_ids!s}, "
            f")"
        )
