def __validate_inputs(self, kwargs):
        for param in self.params_map['enum']:
            if param in kwargs:
                check_allowed_values(
                    self.allowed_values,
                    (param,),
                    kwargs[param]
                )

        for param in self.params_map['validation']:
            if param in kwargs:
                check_validations(
                    self.validations,
                    (param,),
                    kwargs[param],
                    configuration=self.api_client.configuration
                )

        if kwargs['_check_input_type'] is False:
            return

        for key, value in kwargs.items():
            fixed_val = validate_and_convert_types(
                value,
                self.openapi_types[key],
                [key],
                False,
                kwargs['_check_input_type'],
                configuration=self.api_client.configuration
            )
            kwargs[key] = fixed_val
    def __validate_inputs(self, kwargs):
        for param in self.params_map['enum']:
            if param in kwargs:
                check_allowed_values(self.allowed_values, (param, ),
                                     kwargs[param], self.validations)

        for param in self.params_map['validation']:
            if param in kwargs:
                check_validations(self.validations, (param, ), kwargs[param])
Пример #3
0
    def enum_number(self, enum_number):  # noqa: E501
        """Sets the enum_number of this EnumTest.


        :param enum_number: The enum_number of this EnumTest.  # noqa: E501
        :type: float
        """
        check_allowed_values(self.allowed_values, ('enum_number', ),
                             enum_number, self.validations)

        self._enum_number = (enum_number)
Пример #4
0
    def enum_string(self, enum_string):  # noqa: E501
        """Sets the enum_string of this EnumTest.


        :param enum_string: The enum_string of this EnumTest.  # noqa: E501
        :type: str
        """
        check_allowed_values(self.allowed_values, ('enum_string', ),
                             enum_string, self.validations)

        self._enum_string = (enum_string)
Пример #5
0
    def map_of_enum_string(self, map_of_enum_string):  # noqa: E501
        """Sets the map_of_enum_string of this MapTest.


        :param map_of_enum_string: The map_of_enum_string of this MapTest.  # noqa: E501
        :type: dict(str, str)
        """
        check_allowed_values(self.allowed_values, ('map_of_enum_string', ),
                             map_of_enum_string, self.validations)

        self._map_of_enum_string = (map_of_enum_string)
Пример #6
0
    def just_symbol(self, just_symbol):  # noqa: E501
        """Sets the just_symbol of this EnumArrays.


        :param just_symbol: The just_symbol of this EnumArrays.  # noqa: E501
        :type: str
        """
        check_allowed_values(self.allowed_values, ('just_symbol', ),
                             just_symbol, self.validations)

        self._just_symbol = (just_symbol)
Пример #7
0
    def array_enum(self, array_enum):  # noqa: E501
        """Sets the array_enum of this EnumArrays.


        :param array_enum: The array_enum of this EnumArrays.  # noqa: E501
        :type: list[str]
        """
        check_allowed_values(self.allowed_values, ('array_enum', ), array_enum,
                             self.validations)

        self._array_enum = (array_enum)
Пример #8
0
    def status(self, status):  # noqa: E501
        """Sets the status of this Order.

        Order Status  # noqa: E501

        :param status: The status of this Order.  # noqa: E501
        :type: str
        """
        check_allowed_values(self.allowed_values, ('status', ), status,
                             self.validations)

        self._status = (status)
Пример #9
0
    def value(self, value):  # noqa: E501
        """Sets the value of this OuterEnum.


        :param value: The value of this OuterEnum.  # noqa: E501
        :type: str
        """
        if value is None:
            raise ApiValueError(
                "Invalid value for `value`, must not be `None`")  # noqa: E501
        check_allowed_values(self.allowed_values, ('value', ), value,
                             self.validations)

        self._value = (value)
Пример #10
0
    def enum_string_required(self, enum_string_required):  # noqa: E501
        """Sets the enum_string_required of this EnumTest.


        :param enum_string_required: The enum_string_required of this EnumTest.  # noqa: E501
        :type: str
        """
        if enum_string_required is None:
            raise ApiValueError(
                "Invalid value for `enum_string_required`, must not be `None`"
            )  # noqa: E501
        check_allowed_values(self.allowed_values, ('enum_string_required', ),
                             enum_string_required, self.validations)

        self._enum_string_required = (enum_string_required)
Пример #11
0
    def __set_item(self, name, value):
        path_to_item = []
        if self._path_to_item:
            path_to_item.extend(self._path_to_item)
        path_to_item.append(name)

        if name in self.openapi_types:
            required_types_mixed = self.openapi_types[name]
        elif self.additional_properties_type is None:
            raise ApiKeyError(
                "{0} has no key '{1}'".format(type(self).__name__, name),
                path_to_item
            )
        elif self.additional_properties_type is not None:
            required_types_mixed = self.additional_properties_type

        if get_simple_class(name) != str:
            error_msg = type_error_message(
                var_name=name,
                var_value=name,
                valid_classes=(str,),
                key_type=True
            )
            raise ApiTypeError(
                error_msg,
                path_to_item=path_to_item,
                valid_classes=(str,),
                key_type=True
            )

        if self._check_type:
            value = validate_and_convert_types(
                value, required_types_mixed, path_to_item, self._from_server,
                self._check_type, configuration=self._configuration)
        if (name,) in self.allowed_values:
            check_allowed_values(
                self.allowed_values,
                (name,),
                value
            )
        if (name,) in self.validations:
            check_validations(
                self.validations,
                (name,),
                value
            )
        self._data_store[name] = value
    def integer_item(self, integer_item):  # noqa: E501
        """Sets the integer_item of this TypeHolderExample.


        :param integer_item: The integer_item of this TypeHolderExample.  # noqa: E501
        :type: int
        """
        if integer_item is None:
            raise ApiValueError("Invalid value for `integer_item`, must not be `None`")  # noqa: E501
        check_allowed_values(
            self.allowed_values,
            ('integer_item',),
            integer_item,
            self.validations
        )

        self._integer_item = (
            integer_item
        )
    def number_item(self, number_item):  # noqa: E501
        """Sets the number_item of this TypeHolderExample.


        :param number_item: The number_item of this TypeHolderExample.  # noqa: E501
        :type: float
        """
        if number_item is None:
            raise ApiValueError("Invalid value for `number_item`, must not be `None`")  # noqa: E501
        check_allowed_values(
            self.allowed_values,
            ('number_item',),
            number_item,
            self.validations
        )

        self._number_item = (
            number_item
        )
    def string_item(self, string_item):  # noqa: E501
        """Sets the string_item of this TypeHolderExample.


        :param string_item: The string_item of this TypeHolderExample.  # noqa: E501
        :type: str
        """
        if string_item is None:
            raise ApiValueError("Invalid value for `string_item`, must not be `None`")  # noqa: E501
        check_allowed_values(
            self.allowed_values,
            ('string_item',),
            string_item,
            self.validations
        )

        self._string_item = (
            string_item
        )