Example #1
0
    def _from_openapi_data(cls, *args, **kwargs):  # noqa: E501
        """CommentResponseSchema - a model defined in OpenAPI

        Keyword Args:
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _spec_property_naming (bool): True if the variable names in the input data
                                are serialized names, as specified in the OpenAPI document.
                                False if the variable names in the input data
                                are pythonic names, e.g. snake case (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            _visited_composed_classes (tuple): This stores a tuple of
                                classes that we have traveled through so that
                                if we see that class again we will not use its
                                discriminator again.
                                When traveling through a discriminator, the
                                composed schema that is
                                is traveled through is added to this set.
                                For example if Animal has a discriminator
                                petType and we pass in "Dog", and the class Dog
                                allOf includes Animal, we move through Animal
                                once using the discriminator, and pick Dog.
                                Then in Dog, we will make an instance of the
                                Animal class but this time we won't travel
                                through its discriminator because we passed in
                                _visited_composed_classes = (Animal,)
            action ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional]  # noqa: E501
            comment (str): [optional]  # noqa: E501
            created_at (datetime): [optional]  # noqa: E501
            id (str): [optional]  # noqa: E501
            is_author (bool): [optional]  # noqa: E501
            is_bulk_applied (bool): [optional]  # noqa: E501
            name (str): [optional]  # noqa: E501
            rel_id (str): [optional]  # noqa: E501
            status (str): [optional]  # noqa: E501
        """

        _check_type = kwargs.pop('_check_type', True)
        _spec_property_naming = kwargs.pop('_spec_property_naming', True)
        _path_to_item = kwargs.pop('_path_to_item', ())
        _configuration = kwargs.pop('_configuration', None)
        _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

        self = super(OpenApiModel, cls).__new__(cls)

        if args:
            for arg in args:
                if isinstance(arg, dict):
                    kwargs.update(arg)
                else:
                    raise ApiTypeError(
                        "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
                            args,
                            self.__class__.__name__,
                        ),
                        path_to_item=_path_to_item,
                        valid_classes=(self.__class__,),
                    )

        self._data_store = {}
        self._check_type = _check_type
        self._spec_property_naming = _spec_property_naming
        self._path_to_item = _path_to_item
        self._configuration = _configuration
        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

        for var_name, var_value in kwargs.items():
            if var_name not in self.attribute_map and \
                        self._configuration is not None and \
                        self._configuration.discard_unknown_keys and \
                        self.additional_properties_type is None:
                # discard variable.
                continue
            setattr(self, var_name, var_value)
        return self
Example #2
0
    def __init__(self, *args, **kwargs):  # noqa: E501
        """HostnamesForIpGetOutput - a model defined in OpenAPI

        Keyword Args:
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _spec_property_naming (bool): True if the variable names in the input data
                                are serialized names, as specified in the OpenAPI document.
                                False if the variable names in the input data
                                are pythonic names, e.g. snake case (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            _visited_composed_classes (tuple): This stores a tuple of
                                classes that we have traveled through so that
                                if we see that class again we will not use its
                                discriminator again.
                                When traveling through a discriminator, the
                                composed schema that is
                                is traveled through is added to this set.
                                For example if Animal has a discriminator
                                petType and we pass in "Dog", and the class Dog
                                allOf includes Animal, we move through Animal
                                once using the discriminator, and pick Dog.
                                Then in Dog, we will make an instance of the
                                Animal class but this time we won't travel
                                through its discriminator because we passed in
                                _visited_composed_classes = (Animal,)
            count (int): number of records in this result. [optional]  # noqa: E501
            data ([HostnamesForIp]): list of objects. [optional]  # noqa: E501
            offset (int): starting offset after filtering. [optional]  # noqa: E501
            total (int): number of records total after filtering. [optional]  # noqa: E501
        """

        _check_type = kwargs.pop('_check_type', True)
        _spec_property_naming = kwargs.pop('_spec_property_naming', False)
        _path_to_item = kwargs.pop('_path_to_item', ())
        _configuration = kwargs.pop('_configuration', None)
        _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

        if args:
            for arg in args:
                if isinstance(arg, dict):
                    kwargs.update(arg)
                else:
                    raise ApiTypeError(
                        "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
                        % (
                            args,
                            self.__class__.__name__,
                        ),
                        path_to_item=_path_to_item,
                        valid_classes=(self.__class__, ),
                    )

        self._data_store = {}
        self._check_type = _check_type
        self._spec_property_naming = _spec_property_naming
        self._path_to_item = _path_to_item
        self._configuration = _configuration
        self._visited_composed_classes = _visited_composed_classes + (
            self.__class__, )

        for var_name, var_value in kwargs.items():
            if var_name not in self.attribute_map and \
                        self._configuration is not None and \
                        self._configuration.discard_unknown_keys and \
                        self.additional_properties_type is None:
                # discard variable.
                continue
            setattr(self, var_name, var_value)
            if var_name in self.read_only_vars:
                raise ApiAttributeError(
                    f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
                    f"class with read only attributes.")
    def _from_openapi_data(cls, *args, **kwargs):  # noqa: E501
        """TargetSingleOutputData - a model defined in OpenAPI

        Keyword Args:
            id (str):
            org_id (str):
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _spec_property_naming (bool): True if the variable names in the input data
                                are serialized names, as specified in the OpenAPI document.
                                False if the variable names in the input data
                                are pythonic names, e.g. snake case (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            _visited_composed_classes (tuple): This stores a tuple of
                                classes that we have traveled through so that
                                if we see that class again we will not use its
                                discriminator again.
                                When traveling through a discriminator, the
                                composed schema that is
                                is traveled through is added to this set.
                                For example if Animal has a discriminator
                                petType and we pass in "Dog", and the class Dog
                                allOf includes Animal, we move through Animal
                                once using the discriminator, and pick Dog.
                                Then in Dog, we will make an instance of the
                                Animal class but this time we won't travel
                                through its discriminator because we passed in
                                _visited_composed_classes = (Animal,)
            affiliation_state (str): [optional]  # noqa: E501
            applicability (int, none_type): [optional]  # noqa: E501
            attack_note (str, none_type): [optional]  # noqa: E501
            authorization_state (str): [optional]  # noqa: E501
            confidence (int): [optional]  # noqa: E501
            cpe ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional]  # noqa: E501
            criticality (int, none_type): [optional]  # noqa: E501
            deleted (bool): [optional]  # noqa: E501
            description (str, none_type): [optional]  # noqa: E501
            enumerability (int, none_type): [optional]  # noqa: E501
            first_seen (datetime): [optional]  # noqa: E501
            impact_score (str): [optional]  # noqa: E501
            last_seen (datetime): [optional]  # noqa: E501
            lens_id (str): [optional]  # noqa: E501
            lens_view (str): [optional]  # noqa: E501
            name (str): [optional]  # noqa: E501
            perspective (str): [optional]  # noqa: E501
            perspective_name (str): [optional]  # noqa: E501
            post_exploit (int, none_type): [optional]  # noqa: E501
            priority_impact_factor (float): [optional]  # noqa: E501
            priority_score (float): [optional]  # noqa: E501
            priority_status_factor (float): [optional]  # noqa: E501
            priority_tags_factor (float): [optional]  # noqa: E501
            private_weakness (int, none_type): [optional]  # noqa: E501
            public_weakness (int, none_type): [optional]  # noqa: E501
            randori_notes (str, none_type): [optional]  # noqa: E501
            reference (str, none_type): [optional]  # noqa: E501
            research (int, none_type): [optional]  # noqa: E501
            service_id (str): [optional]  # noqa: E501
            status (str): [optional]  # noqa: E501
            tags ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional]  # noqa: E501
            target_temptation (int, none_type): [optional]  # noqa: E501
            tech_category ([str], none_type): [optional]  # noqa: E501
            temptation_last_modified (datetime): [optional]  # noqa: E501
            vendor (str, none_type): [optional]  # noqa: E501
            version (str, none_type): [optional]  # noqa: E501
        """

        _check_type = kwargs.pop('_check_type', True)
        _spec_property_naming = kwargs.pop('_spec_property_naming', False)
        _path_to_item = kwargs.pop('_path_to_item', ())
        _configuration = kwargs.pop('_configuration', None)
        _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

        self = super(OpenApiModel, cls).__new__(cls)

        if args:
            for arg in args:
                if isinstance(arg, dict):
                    kwargs.update(arg)
                else:
                    raise ApiTypeError(
                        "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
                        % (
                            args,
                            self.__class__.__name__,
                        ),
                        path_to_item=_path_to_item,
                        valid_classes=(self.__class__, ),
                    )

        self._data_store = {}
        self._check_type = _check_type
        self._spec_property_naming = _spec_property_naming
        self._path_to_item = _path_to_item
        self._configuration = _configuration
        self._visited_composed_classes = _visited_composed_classes + (
            self.__class__, )

        constant_args = {
            '_check_type': _check_type,
            '_path_to_item': _path_to_item,
            '_spec_property_naming': _spec_property_naming,
            '_configuration': _configuration,
            '_visited_composed_classes': self._visited_composed_classes,
        }
        composed_info = validate_get_composed_info(constant_args, kwargs, self)
        self._composed_instances = composed_info[0]
        self._var_name_to_model_instances = composed_info[1]
        self._additional_properties_model_instances = composed_info[2]
        discarded_args = composed_info[3]

        for var_name, var_value in kwargs.items():
            if var_name in discarded_args and \
                        self._configuration is not None and \
                        self._configuration.discard_unknown_keys and \
                        self._additional_properties_model_instances:
                # discard variable.
                continue
            setattr(self, var_name, var_value)

        return self
Example #4
0
    def __init__(self, id, org_id, *args, **kwargs):  # noqa: E501
        """Hostname - a model defined in OpenAPI

        Args:
            id (str):
            org_id (str):

        Keyword Args:
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _spec_property_naming (bool): True if the variable names in the input data
                                are serialized names, as specified in the OpenAPI document.
                                False if the variable names in the input data
                                are pythonic names, e.g. snake case (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            _visited_composed_classes (tuple): This stores a tuple of
                                classes that we have traveled through so that
                                if we see that class again we will not use its
                                discriminator again.
                                When traveling through a discriminator, the
                                composed schema that is
                                is traveled through is added to this set.
                                For example if Animal has a discriminator
                                petType and we pass in "Dog", and the class Dog
                                allOf includes Animal, we move through Animal
                                once using the discriminator, and pick Dog.
                                Then in Dog, we will make an instance of the
                                Animal class but this time we won't travel
                                through its discriminator because we passed in
                                _visited_composed_classes = (Animal,)
            affiliation_state (str): [optional]  # noqa: E501
            confidence (int): [optional]  # noqa: E501
            deleted (bool): [optional]  # noqa: E501
            first_seen (datetime): [optional]  # noqa: E501
            hostname (str): [optional]  # noqa: E501
            impact_score (str): [optional]  # noqa: E501
            ip_count (int): [optional]  # noqa: E501
            is_prime (bool): [optional]  # noqa: E501
            last_seen (datetime): [optional]  # noqa: E501
            lens_id (str): [optional]  # noqa: E501
            lens_view (str): [optional]  # noqa: E501
            max_confidence (int): [optional]  # noqa: E501
            name_type (int): [optional]  # noqa: E501
            only_in_review_targets (bool): [optional]  # noqa: E501
            perspective (str): [optional]  # noqa: E501
            perspective_name (str): [optional]  # noqa: E501
            priority_impact_factor (float): [optional]  # noqa: E501
            priority_score (float): [optional]  # noqa: E501
            priority_status_factor (float): [optional]  # noqa: E501
            priority_tags_factor (float): [optional]  # noqa: E501
            status (str): [optional]  # noqa: E501
            tags ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional]  # noqa: E501
            target_temptation (int, none_type): [optional]  # noqa: E501
        """

        _check_type = kwargs.pop('_check_type', True)
        _spec_property_naming = kwargs.pop('_spec_property_naming', False)
        _path_to_item = kwargs.pop('_path_to_item', ())
        _configuration = kwargs.pop('_configuration', None)
        _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

        if args:
            for arg in args:
                if isinstance(arg, dict):
                    kwargs.update(arg)
                else:
                    raise ApiTypeError(
                        "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
                        % (
                            args,
                            self.__class__.__name__,
                        ),
                        path_to_item=_path_to_item,
                        valid_classes=(self.__class__, ),
                    )

        self._data_store = {}
        self._check_type = _check_type
        self._spec_property_naming = _spec_property_naming
        self._path_to_item = _path_to_item
        self._configuration = _configuration
        self._visited_composed_classes = _visited_composed_classes + (
            self.__class__, )

        self.id = id
        self.org_id = org_id
        for var_name, var_value in kwargs.items():
            if var_name not in self.attribute_map and \
                        self._configuration is not None and \
                        self._configuration.discard_unknown_keys and \
                        self.additional_properties_type is None:
                # discard variable.
                continue
            setattr(self, var_name, var_value)
            if var_name in self.read_only_vars:
                raise ApiAttributeError(
                    f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
                    f"class with read only attributes.")
Example #5
0
    def __init__(self, *args, **kwargs):  # noqa: E501
        """PortsForIpSingleOutputData - a model defined in OpenAPI

        Keyword Args:
            id (str):
            org_id (str):
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _spec_property_naming (bool): True if the variable names in the input data
                                are serialized names, as specified in the OpenAPI document.
                                False if the variable names in the input data
                                are pythonic names, e.g. snake case (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            _visited_composed_classes (tuple): This stores a tuple of
                                classes that we have traveled through so that
                                if we see that class again we will not use its
                                discriminator again.
                                When traveling through a discriminator, the
                                composed schema that is
                                is traveled through is added to this set.
                                For example if Animal has a discriminator
                                petType and we pass in "Dog", and the class Dog
                                allOf includes Animal, we move through Animal
                                once using the discriminator, and pick Dog.
                                Then in Dog, we will make an instance of the
                                Animal class but this time we won't travel
                                through its discriminator because we passed in
                                _visited_composed_classes = (Animal,)
            confidence (int): [optional]  # noqa: E501
            deleted (bool): [optional]  # noqa: E501
            ip_id (str): [optional]  # noqa: E501
            last_seen (datetime): [optional]  # noqa: E501
            lens_id (str): [optional]  # noqa: E501
            lens_view (str): [optional]  # noqa: E501
            perspective (str): [optional]  # noqa: E501
            perspective_name (str): [optional]  # noqa: E501
            port (int): [optional]  # noqa: E501
            protocol (int): [optional]  # noqa: E501
            seen_open (bool): [optional]  # noqa: E501
            state (str): [optional]  # noqa: E501
        """

        _check_type = kwargs.pop('_check_type', True)
        _spec_property_naming = kwargs.pop('_spec_property_naming', False)
        _path_to_item = kwargs.pop('_path_to_item', ())
        _configuration = kwargs.pop('_configuration', None)
        _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

        if args:
            for arg in args:
                if isinstance(arg, dict):
                    kwargs.update(arg)
                else:
                    raise ApiTypeError(
                        "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
                            args,
                            self.__class__.__name__,
                        ),
                        path_to_item=_path_to_item,
                        valid_classes=(self.__class__,),
                    )

        self._data_store = {}
        self._check_type = _check_type
        self._spec_property_naming = _spec_property_naming
        self._path_to_item = _path_to_item
        self._configuration = _configuration
        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

        constant_args = {
            '_check_type': _check_type,
            '_path_to_item': _path_to_item,
            '_spec_property_naming': _spec_property_naming,
            '_configuration': _configuration,
            '_visited_composed_classes': self._visited_composed_classes,
        }
        composed_info = validate_get_composed_info(
            constant_args, kwargs, self)
        self._composed_instances = composed_info[0]
        self._var_name_to_model_instances = composed_info[1]
        self._additional_properties_model_instances = composed_info[2]
        discarded_args = composed_info[3]

        for var_name, var_value in kwargs.items():
            if var_name in discarded_args and \
                        self._configuration is not None and \
                        self._configuration.discard_unknown_keys and \
                        self._additional_properties_model_instances:
                # discard variable.
                continue
            setattr(self, var_name, var_value)
            if var_name in self.read_only_vars:
                raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
                                     f"class with read only attributes.")
Example #6
0
    def _from_openapi_data(cls, *args, **kwargs):  # noqa: E501
        """ActionMetadataSingleOutputData - a model defined in OpenAPI

        Keyword Args:
            action_id (str):
            bart_id (str):
            id (str):
            org_id (str):
            result (str):
            runbook_instance_id (str):
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _spec_property_naming (bool): True if the variable names in the input data
                                are serialized names, as specified in the OpenAPI document.
                                False if the variable names in the input data
                                are pythonic names, e.g. snake case (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            _visited_composed_classes (tuple): This stores a tuple of
                                classes that we have traveled through so that
                                if we see that class again we will not use its
                                discriminator again.
                                When traveling through a discriminator, the
                                composed schema that is
                                is traveled through is added to this set.
                                For example if Animal has a discriminator
                                petType and we pass in "Dog", and the class Dog
                                allOf includes Animal, we move through Animal
                                once using the discriminator, and pick Dog.
                                Then in Dog, we will make an instance of the
                                Animal class but this time we won't travel
                                through its discriminator because we passed in
                                _visited_composed_classes = (Animal,)
            artifacts_status (str, none_type): [optional]  # noqa: E501
            completed (datetime, none_type): [optional]  # noqa: E501
            config_hash (str, none_type): [optional]  # noqa: E501
            created (datetime, none_type): [optional]  # noqa: E501
            deleted (bool, none_type): [optional]  # noqa: E501
            description (str, none_type): [optional]  # noqa: E501
            description_id (str, none_type): [optional]  # noqa: E501
            display_name (str, none_type): [optional]  # noqa: E501
            dst_email ([str], none_type): [optional]  # noqa: E501
            dst_host ([str], none_type): [optional]  # noqa: E501
            dst_ip ([str], none_type): [optional]  # noqa: E501
            dst_mac ([str], none_type): [optional]  # noqa: E501
            dst_misc ([str], none_type): [optional]  # noqa: E501
            dst_network ([str], none_type): [optional]  # noqa: E501
            dst_path ([str], none_type): [optional]  # noqa: E501
            dst_port ([int], none_type): [optional]  # noqa: E501
            implant_id (str, none_type): [optional]  # noqa: E501
            implant_nick (str, none_type): [optional]  # noqa: E501
            implant_uid (str, none_type): [optional]  # noqa: E501
            mitre_techniques ([str], none_type): [optional]  # noqa: E501
            name (str, none_type): [optional]  # noqa: E501
            perspective_metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional]  # noqa: E501
            randori_notes (str, none_type): [optional]  # noqa: E501
            result_hash (str, none_type): [optional]  # noqa: E501
            src_email ([str], none_type): [optional]  # noqa: E501
            src_host ([str], none_type): [optional]  # noqa: E501
            src_ip ([str], none_type): [optional]  # noqa: E501
            src_mac ([str], none_type): [optional]  # noqa: E501
            src_misc ([str], none_type): [optional]  # noqa: E501
            stability (int, none_type): [optional]  # noqa: E501
            started (datetime, none_type): [optional]  # noqa: E501
            stealth (int, none_type): [optional]  # noqa: E501
            summary_sha (str, none_type): [optional]  # noqa: E501
            template (str, none_type): [optional]  # noqa: E501
            trigger ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional]  # noqa: E501
            updated (datetime, none_type): [optional]  # noqa: E501
        """

        _check_type = kwargs.pop('_check_type', True)
        _spec_property_naming = kwargs.pop('_spec_property_naming', False)
        _path_to_item = kwargs.pop('_path_to_item', ())
        _configuration = kwargs.pop('_configuration', None)
        _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

        self = super(OpenApiModel, cls).__new__(cls)

        if args:
            for arg in args:
                if isinstance(arg, dict):
                    kwargs.update(arg)
                else:
                    raise ApiTypeError(
                        "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
                        % (
                            args,
                            self.__class__.__name__,
                        ),
                        path_to_item=_path_to_item,
                        valid_classes=(self.__class__, ),
                    )

        self._data_store = {}
        self._check_type = _check_type
        self._spec_property_naming = _spec_property_naming
        self._path_to_item = _path_to_item
        self._configuration = _configuration
        self._visited_composed_classes = _visited_composed_classes + (
            self.__class__, )

        constant_args = {
            '_check_type': _check_type,
            '_path_to_item': _path_to_item,
            '_spec_property_naming': _spec_property_naming,
            '_configuration': _configuration,
            '_visited_composed_classes': self._visited_composed_classes,
        }
        composed_info = validate_get_composed_info(constant_args, kwargs, self)
        self._composed_instances = composed_info[0]
        self._var_name_to_model_instances = composed_info[1]
        self._additional_properties_model_instances = composed_info[2]
        discarded_args = composed_info[3]

        for var_name, var_value in kwargs.items():
            if var_name in discarded_args and \
                        self._configuration is not None and \
                        self._configuration.discard_unknown_keys and \
                        self._additional_properties_model_instances:
                # discard variable.
                continue
            setattr(self, var_name, var_value)

        return self
Example #7
0
    def __init__(self, action_id, artifacts_status, bart_id, org_id, runbook_instance_id, started, updated, *args, **kwargs):  # noqa: E501
        """UserApActionInstances - a model defined in OpenAPI

        Args:
            action_id (str):
            artifacts_status (str):
            bart_id (str):
            org_id (str):
            runbook_instance_id (str):
            started (datetime):
            updated (datetime):

        Keyword Args:
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _spec_property_naming (bool): True if the variable names in the input data
                                are serialized names, as specified in the OpenAPI document.
                                False if the variable names in the input data
                                are pythonic names, e.g. snake case (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            _visited_composed_classes (tuple): This stores a tuple of
                                classes that we have traveled through so that
                                if we see that class again we will not use its
                                discriminator again.
                                When traveling through a discriminator, the
                                composed schema that is
                                is traveled through is added to this set.
                                For example if Animal has a discriminator
                                petType and we pass in "Dog", and the class Dog
                                allOf includes Animal, we move through Animal
                                once using the discriminator, and pick Dog.
                                Then in Dog, we will make an instance of the
                                Animal class but this time we won't travel
                                through its discriminator because we passed in
                                _visited_composed_classes = (Animal,)
            dst_ip ([str], none_type): [optional]  # noqa: E501
            dst_network ([str], none_type): [optional]  # noqa: E501
            src_ip ([str], none_type): [optional]  # noqa: E501
            completed (datetime, none_type): [optional]  # noqa: E501
            config ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional]  # noqa: E501
            config_hash (str, none_type): [optional]  # noqa: E501
            deleted (bool): [optional]  # noqa: E501
            dst_email ([str], none_type): [optional]  # noqa: E501
            dst_host ([str], none_type): [optional]  # noqa: E501
            dst_mac ([str], none_type): [optional]  # noqa: E501
            dst_misc ([str], none_type): [optional]  # noqa: E501
            dst_path ([str], none_type): [optional]  # noqa: E501
            dst_port ([int], none_type): [optional]  # noqa: E501
            id (str): [optional]  # noqa: E501
            implant_id (str, none_type): [optional]  # noqa: E501
            implant_uid (str, none_type): [optional]  # noqa: E501
            perspective_metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional]  # noqa: E501
            platform_state (int, none_type): [optional]  # noqa: E501
            randori_notes (str, none_type): [optional]  # noqa: E501
            result (str, none_type): [optional]  # noqa: E501
            result_hash (str, none_type): [optional]  # noqa: E501
            src_email ([str], none_type): [optional]  # noqa: E501
            src_host ([str], none_type): [optional]  # noqa: E501
            src_mac ([str], none_type): [optional]  # noqa: E501
            src_misc ([str], none_type): [optional]  # noqa: E501
            summary_sha (str, none_type): [optional]  # noqa: E501
            trigger ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional]  # noqa: E501
        """

        _check_type = kwargs.pop('_check_type', True)
        _spec_property_naming = kwargs.pop('_spec_property_naming', False)
        _path_to_item = kwargs.pop('_path_to_item', ())
        _configuration = kwargs.pop('_configuration', None)
        _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

        if args:
            for arg in args:
                if isinstance(arg, dict):
                    kwargs.update(arg)
                else:
                    raise ApiTypeError(
                        "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
                            args,
                            self.__class__.__name__,
                        ),
                        path_to_item=_path_to_item,
                        valid_classes=(self.__class__,),
                    )

        self._data_store = {}
        self._check_type = _check_type
        self._spec_property_naming = _spec_property_naming
        self._path_to_item = _path_to_item
        self._configuration = _configuration
        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

        self.action_id = action_id
        self.artifacts_status = artifacts_status
        self.bart_id = bart_id
        self.org_id = org_id
        self.runbook_instance_id = runbook_instance_id
        self.started = started
        self.updated = updated
        for var_name, var_value in kwargs.items():
            if var_name not in self.attribute_map and \
                        self._configuration is not None and \
                        self._configuration.discard_unknown_keys and \
                        self.additional_properties_type is None:
                # discard variable.
                continue
            setattr(self, var_name, var_value)
            if var_name in self.read_only_vars:
                raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
                                     f"class with read only attributes.")
Example #8
0
    def _from_openapi_data(cls, dst_search, name, org_id, runbook_id, src_search, start_time, status, technique_ids, uid, *args, **kwargs):  # noqa: E501
        """AttackRunbook - a model defined in OpenAPI

        Args:
            dst_search (str):
            name (str):
            org_id (str):
            runbook_id (str):
            src_search (str):
            start_time (datetime):
            status (str):
            technique_ids ([str]):
            uid (str):

        Keyword Args:
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _spec_property_naming (bool): True if the variable names in the input data
                                are serialized names, as specified in the OpenAPI document.
                                False if the variable names in the input data
                                are pythonic names, e.g. snake case (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            _visited_composed_classes (tuple): This stores a tuple of
                                classes that we have traveled through so that
                                if we see that class again we will not use its
                                discriminator again.
                                When traveling through a discriminator, the
                                composed schema that is
                                is traveled through is added to this set.
                                For example if Animal has a discriminator
                                petType and we pass in "Dog", and the class Dog
                                allOf includes Animal, we move through Animal
                                once using the discriminator, and pick Dog.
                                Then in Dog, we will make an instance of the
                                Animal class but this time we won't travel
                                through its discriminator because we passed in
                                _visited_composed_classes = (Animal,)
            comment (str): [optional]  # noqa: E501
            deleted (bool, none_type): [optional]  # noqa: E501
            description (str, none_type): [optional]  # noqa: E501
            dst_email ([str], none_type): [optional]  # noqa: E501
            dst_host ([str], none_type): [optional]  # noqa: E501
            dst_ip ([str]): [optional]  # noqa: E501
            dst_mac ([str], none_type): [optional]  # noqa: E501
            dst_misc ([str], none_type): [optional]  # noqa: E501
            dst_network ([str]): [optional]  # noqa: E501
            dst_path ([str], none_type): [optional]  # noqa: E501
            dst_port ([int], none_type): [optional]  # noqa: E501
            end_time (datetime, none_type): [optional]  # noqa: E501
            guidance (str, none_type): [optional]  # noqa: E501
            id (str): [optional]  # noqa: E501
            implant_ids ([str], none_type): [optional]  # noqa: E501
            implant_nick (str, none_type): [optional]  # noqa: E501
            implant_src_host ([str], none_type): [optional]  # noqa: E501
            implant_src_ip ([str]): [optional]  # noqa: E501
            instance_label (str, none_type): [optional]  # noqa: E501
            objective (str, none_type): [optional]  # noqa: E501
            perspective_metadata ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type): [optional]  # noqa: E501
            randori_notes (str, none_type): [optional]  # noqa: E501
            results (str, none_type): [optional]  # noqa: E501
            src_email ([str], none_type): [optional]  # noqa: E501
            src_host ([str], none_type): [optional]  # noqa: E501
            src_ip ([str]): [optional]  # noqa: E501
            src_mac ([str], none_type): [optional]  # noqa: E501
            src_misc ([str], none_type): [optional]  # noqa: E501
            trigger ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type): [optional]  # noqa: E501
        """

        _check_type = kwargs.pop('_check_type', True)
        _spec_property_naming = kwargs.pop('_spec_property_naming', True)
        _path_to_item = kwargs.pop('_path_to_item', ())
        _configuration = kwargs.pop('_configuration', None)
        _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

        self = super(OpenApiModel, cls).__new__(cls)

        if args:
            for arg in args:
                if isinstance(arg, dict):
                    kwargs.update(arg)
                else:
                    raise ApiTypeError(
                        "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
                            args,
                            self.__class__.__name__,
                        ),
                        path_to_item=_path_to_item,
                        valid_classes=(self.__class__,),
                    )

        self._data_store = {}
        self._check_type = _check_type
        self._spec_property_naming = _spec_property_naming
        self._path_to_item = _path_to_item
        self._configuration = _configuration
        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

        self.dst_search = dst_search
        self.name = name
        self.org_id = org_id
        self.runbook_id = runbook_id
        self.src_search = src_search
        self.start_time = start_time
        self.status = status
        self.technique_ids = technique_ids
        self.uid = uid
        for var_name, var_value in kwargs.items():
            if var_name not in self.attribute_map and \
                        self._configuration is not None and \
                        self._configuration.discard_unknown_keys and \
                        self.additional_properties_type is None:
                # discard variable.
                continue
            setattr(self, var_name, var_value)
        return self
Example #9
0
    def _from_openapi_data(cls, *args, **kwargs):  # noqa: E501
        """HostnamePatchInputOperationsInner - a model defined in OpenAPI

        Keyword Args:
            _check_type (bool): if True, values for parameters in openapi_types
                                will be type checked and a TypeError will be
                                raised if the wrong type is input.
                                Defaults to True
            _path_to_item (tuple/list): This is a list of keys or values to
                                drill down to the model in received_data
                                when deserializing a response
            _spec_property_naming (bool): True if the variable names in the input data
                                are serialized names, as specified in the OpenAPI document.
                                False if the variable names in the input data
                                are pythonic names, e.g. snake case (default)
            _configuration (Configuration): the instance to use when
                                deserializing a file_type parameter.
                                If passed, type conversion is attempted
                                If omitted no type conversion is done.
            _visited_composed_classes (tuple): This stores a tuple of
                                classes that we have traveled through so that
                                if we see that class again we will not use its
                                discriminator again.
                                When traveling through a discriminator, the
                                composed schema that is
                                is traveled through is added to this set.
                                For example if Animal has a discriminator
                                petType and we pass in "Dog", and the class Dog
                                allOf includes Animal, we move through Animal
                                once using the discriminator, and pick Dog.
                                Then in Dog, we will make an instance of the
                                Animal class but this time we won't travel
                                through its discriminator because we passed in
                                _visited_composed_classes = (Animal,)
            op (str): operation, \"add\" or \"remove\". [optional]  # noqa: E501
            path (str): target location. [optional]  # noqa: E501
            value (bool, date, datetime, dict, float, int, list, str, none_type): new value for add/replace. [optional]  # noqa: E501
        """

        _check_type = kwargs.pop('_check_type', True)
        _spec_property_naming = kwargs.pop('_spec_property_naming', False)
        _path_to_item = kwargs.pop('_path_to_item', ())
        _configuration = kwargs.pop('_configuration', None)
        _visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

        self = super(OpenApiModel, cls).__new__(cls)

        if args:
            for arg in args:
                if isinstance(arg, dict):
                    kwargs.update(arg)
                else:
                    raise ApiTypeError(
                        "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
                            args,
                            self.__class__.__name__,
                        ),
                        path_to_item=_path_to_item,
                        valid_classes=(self.__class__,),
                    )

        self._data_store = {}
        self._check_type = _check_type
        self._spec_property_naming = _spec_property_naming
        self._path_to_item = _path_to_item
        self._configuration = _configuration
        self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

        constant_args = {
            '_check_type': _check_type,
            '_path_to_item': _path_to_item,
            '_spec_property_naming': _spec_property_naming,
            '_configuration': _configuration,
            '_visited_composed_classes': self._visited_composed_classes,
        }
        composed_info = validate_get_composed_info(
            constant_args, kwargs, self)
        self._composed_instances = composed_info[0]
        self._var_name_to_model_instances = composed_info[1]
        self._additional_properties_model_instances = composed_info[2]
        discarded_args = composed_info[3]

        for var_name, var_value in kwargs.items():
            if var_name in discarded_args and \
                        self._configuration is not None and \
                        self._configuration.discard_unknown_keys and \
                        self._additional_properties_model_instances:
                # discard variable.
                continue
            setattr(self, var_name, var_value)

        return self