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

"""
ctddocumentation

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


class DiscoveryParams(object):

    """Implementation of the 'DiscoveryParams' model.

    TODO: type model description here.

    Attributes:
        ip_range (string): TODO: type description here.
        sub_query (string): TODO: type description here.
        concurrent_scans (int): TODO: type description here.
        retranmissions (int): TODO: type description here.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "ip_range": 'ip_range',
        "sub_query": 'sub_query',
        "concurrent_scans": 'concurrent_scans',
        "retranmissions": 'retranmissions'
    }

    _optionals = [
        'ip_range',
        'sub_query',
        'concurrent_scans',
        'retranmissions',
    ]

    def __init__(self,
                 ip_range=APIHelper.SKIP,
                 sub_query=APIHelper.SKIP,
                 concurrent_scans=APIHelper.SKIP,
                 retranmissions=APIHelper.SKIP):
        """Constructor for the DiscoveryParams class"""

        # Initialize members of the class
        if ip_range is not APIHelper.SKIP:
            self.ip_range = ip_range 
        if sub_query is not APIHelper.SKIP:
            self.sub_query = sub_query 
        if concurrent_scans is not APIHelper.SKIP:
            self.concurrent_scans = concurrent_scans 
        if retranmissions is not APIHelper.SKIP:
            self.retranmissions = retranmissions 

    @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

        ip_range = dictionary.get("ip_range") if dictionary.get("ip_range") else APIHelper.SKIP
        sub_query = dictionary.get("sub_query") if dictionary.get("sub_query") else APIHelper.SKIP
        concurrent_scans = dictionary.get("concurrent_scans") if dictionary.get("concurrent_scans") else APIHelper.SKIP
        retranmissions = dictionary.get("retranmissions") if dictionary.get("retranmissions") else APIHelper.SKIP
        # Return an object of this model
        return cls(ip_range,
                   sub_query,
                   concurrent_scans,
                   retranmissions)
