(self, _json_obj=None, _selection_list=None, **kwargs)
Create the type given a json object or keyword arguments.

        >>> class AnotherInput(Input):
        ...     a_str = str
        ...
        >>> class TheInput(Input):
        ...     a_int = int
        ...     a_float = float
        ...     a_nested = AnotherInput
        ...     a_nested_list = list_of(AnotherInput)
        ...

        It can be constructed using fields and values as a regular Python class:

        >>> TheInput(a_int=1, a_float=1.2, a_nested=AnotherInput(a_str='hi'))
        TheInput(a_int=1, a_float=1.2, a_nested=AnotherInput(a_str='hi'))

        Or can be given as a dict (ie: JSON data) as parameter:

        >>> TheInput({'aInt': 1, 'aFloat': 1.2, 'aNested': {'aStr': 'hi'}})
        TheInput(a_int=1, a_float=1.2, a_nested=AnotherInput(a_str='hi'))

        It can be printed to GraphQL DSL using ``__to_graphql_input__()``:

        >>> value = TheInput(a_int=1, a_float=1.2,
        ...                  a_nested=AnotherInput(a_str='hi'),
        ...                  a_nested_list=[AnotherInput(a_str='there')])
        >>> print(TheInput.__to_graphql_input__(value))
        {aInt: 1, aFloat: 1.2, aNested: {aStr: "hi"}, aNestedList: [{aStr: "there"}]}
        >>> value = TheInput({'aInt': 1, 'aFloat': 1.2, 'aNested': {'aStr': 'hi'},
        ...           'aNestedList': [{'aStr': 'there'}]})
        >>> print(TheInput.__to_graphql_input__(value))
        {aInt: 1, aFloat: 1.2, aNested: {aStr: "hi"}, aNestedList: [{aStr: "there"}]}

        The nested types (lists, non-null) can also take an already realized
        value, see ``AnotherInput`` below:

        >>> value = TheInput({'aInt': 1, 'aFloat': 1.2, 'aNested': {'aStr': 'hi'},
        ...           'aNestedList': [AnotherInput(a_str='there')]})
        >>> print(TheInput.__to_graphql_input__(value))
        {aInt: 1, aFloat: 1.2, aNested: {aStr: "hi"}, aNestedList: [{aStr: "there"}]}

        ``None`` will print ``null``:

        >>> print(TheInput.__to_graphql_input__(None))
        null

        .. note::

            ``selection_list`` parameter makes no sense and is ignored,
            it's only provided to cope with the ``ContainerType`` interface.
Create the type given a json object or keyword arguments.
Create the type given a json object or keyword arguments .
def __init__(self, _json_obj=None, _selection_list=None, **kwargs):
        '''Create the type given a json object or keyword arguments.

        >>> class AnotherInput(Input):
        ...     a_str = str
        ...
        >>> class TheInput(Input):
        ...     a_int = int
        ...     a_float = float
        ...     a_nested = AnotherInput
        ...     a_nested_list = list_of(AnotherInput)
        ...

        It can be constructed using fields and values as a regular Python class:

        >>> TheInput(a_int=1, a_float=1.2, a_nested=AnotherInput(a_str='hi'))
        TheInput(a_int=1, a_float=1.2, a_nested=AnotherInput(a_str='hi'))

        Or can be given as a dict (ie: JSON data) as parameter:

        >>> TheInput({'aInt': 1, 'aFloat': 1.2, 'aNested': {'aStr': 'hi'}})
        TheInput(a_int=1, a_float=1.2, a_nested=AnotherInput(a_str='hi'))

        It can be printed to GraphQL DSL using ``__to_graphql_input__()``:

        >>> value = TheInput(a_int=1, a_float=1.2,
        ...                  a_nested=AnotherInput(a_str='hi'),
        ...                  a_nested_list=[AnotherInput(a_str='there')])
        >>> print(TheInput.__to_graphql_input__(value))
        {aInt: 1, aFloat: 1.2, aNested: {aStr: "hi"}, aNestedList: [{aStr: "there"}]}
        >>> value = TheInput({'aInt': 1, 'aFloat': 1.2, 'aNested': {'aStr': 'hi'},
        ...           'aNestedList': [{'aStr': 'there'}]})
        >>> print(TheInput.__to_graphql_input__(value))
        {aInt: 1, aFloat: 1.2, aNested: {aStr: "hi"}, aNestedList: [{aStr: "there"}]}

        The nested types (lists, non-null) can also take an already realized
        value, see ``AnotherInput`` below:

        >>> value = TheInput({'aInt': 1, 'aFloat': 1.2, 'aNested': {'aStr': 'hi'},
        ...           'aNestedList': [AnotherInput(a_str='there')]})
        >>> print(TheInput.__to_graphql_input__(value))
        {aInt: 1, aFloat: 1.2, aNested: {aStr: "hi"}, aNestedList: [{aStr: "there"}]}

        ``None`` will print ``null``:

        >>> print(TheInput.__to_graphql_input__(None))
        null

        .. note::

            ``selection_list`` parameter makes no sense and is ignored,
            it's only provided to cope with the ``ContainerType`` interface.

        '''  # noqa: E501
        if _json_obj is None:
            _json_obj = {}
        super().__init__(_json_obj, _selection_list)
        cls = type(self)
        for k, v in kwargs.items():
            f = cls[k]
            if not isinstance(v, (f.type, Variable, list)):
                v = f.type(v)
            setattr(self, k, v)
def __init__ ( self , _json_obj = None , _selection_list = None , * * kwargs ) : # noqa: E501 if _json_obj is None : _json_obj = { } super ( ) . __init__ ( _json_obj , _selection_list ) cls = type ( self ) for k , v in kwargs . items ( ) : f = cls [ k ] if not isinstance ( v , ( f . type , Variable , list ) ) : v = f . type ( v ) setattr ( self , k , v )