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

"""
ctddocumentation

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


class CodeSections(object):

    """Implementation of the 'CodeSections' model.

    TODO: type model description here.

    Attributes:
        mtype (string): TODO: type description here.
        filename (string): TODO: type description here.
        rid (string): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "mtype": 'type',
        "filename": 'filename',
        "rid": 'rid'
    }

    _optionals = [
        'mtype',
        'filename',
        'rid',
    ]

    def __init__(self,
                 mtype=APIHelper.SKIP,
                 filename=APIHelper.SKIP,
                 rid=APIHelper.SKIP):
        """Constructor for the CodeSections class"""

        # Initialize members of the class
        if mtype is not APIHelper.SKIP:
            self.mtype = mtype 
        if filename is not APIHelper.SKIP:
            self.filename = filename 
        if rid is not APIHelper.SKIP:
            self.rid = rid 

    @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

        mtype = dictionary.get("type") if dictionary.get("type") else APIHelper.SKIP
        filename = dictionary.get("filename") if dictionary.get("filename") else APIHelper.SKIP
        rid = dictionary.get("rid") if dictionary.get("rid") else APIHelper.SKIP
        # Return an object of this model
        return cls(mtype,
                   filename,
                   rid)
