class_docstr: A row in Table.
  The fields in it can be accessed:
  
  * like attributes (``row.key``)
  * like dictionary values (``row[key]``)
  
  ``key in row`` will search through row keys.
  
  Row can be used to create a row object by using named arguments,
  the fields will be sorted by names. It is not allowed to omit
  a named argument to represent the value is None or missing. This should be
  explicitly set to None in this case.
  
  ::
  
      >>> row = Row(name="Alice", age=11)
      >>> row
      Row(age=11, name='Alice')
      >>> row['name'], row['age']
      ('Alice', 11)
      >>> row.name, row.age
      ('Alice', 11)
      >>> 'name' in row
      True
      >>> 'wrong_key' in row
      False
  
  Row can also be used to create another Row like class, then it
  could be used to create Row objects, such as
  
  ::
  
      >>> Person = Row("name", "age")
      >>> Person
      <Row(name, age)>
      >>> 'name' in Person
      True
      >>> 'wrong_key' in Person
      False
      >>> Person("Alice", 11)
      Row(name='Alice', age=11)
class_docstr_tok: ["A","row","in","Table",".","The","fields","in","it","can","be","accessed",":","*","like","attributes","(","``","row.key","``",")","*","like","dictionary","values","(","``","row","[","key","]","``",")","``","key","in","row","``","will","search","through","row","keys",".","Row","can","be","used","to","create","a","row","object","by","using","named","arguments",",","the","fields","will","be","sorted","by","names",".","It","is","not","allowed","to","omit","a","named","argument","to","represent","the","value","is","None","or","missing",".","This","should","be","explicitly","set","to","None","in","this","case",".",":",":",">",">",">","row","=","Row","(","name=","''","Alice","''",",","age=11",")",">",">",">","row","Row","(","age=11",",","name='Alice","'",")",">",">",">","row","[","'name","'","]",",","row","[","'age","'","]","(","'Alice","'",",","11",")",">",">",">","row.name",",","row.age","(","'Alice","'",",","11",")",">",">",">","'name","'","in","row","True",">",">",">","'wrong_key","'","in","row","False","Row","can","also","be","used","to","create","another","Row","like","class",",","then","it","could","be","used","to","create","Row","objects",",","such","as",":",":",">",">",">","Person","=","Row","(","``","name","''",",","``","age","''",")",">",">",">","Person","<","Row","(","name",",","age",")",">",">",">",">","'name","'","in","Person","True",">",">",">","'wrong_key","'","in","Person","False",">",">",">","Person","(","``","Alice","''",",","11",")","Row","(","name='Alice","'",",","age=11",")"]
docstr: Returns as a dict.
  
  Example:
  ::
  
      >>> Row(name="Alice", age=11).as_dict() == {'name': 'Alice', 'age': 11}
      True
      >>> row = Row(key=1, value=Row(name='a', age=2))
      >>> row.as_dict() == {'key': 1, 'value': Row(age=2, name='a')}
      True
      >>> row.as_dict(True) == {'key': 1, 'value': {'name': 'a', 'age': 2}}
      True
  
  :param recursive: turns the nested Row as dict (default: False).
docstr_tok: ["Returns","as","a","dict",".","Example",":",":",":",">",">",">","Row","(","name=","''","Alice","''",",","age=11",")",".as_dict","(",")","==","{","'name","'",":","'Alice","'",",","'age","'",":","11","}","True",">",">",">","row","=","Row","(","key=1",",","value=Row","(","name=","'","a","'",",","age=2",")",")",">",">",">","row.as_dict","(",")","==","{","'key","'",":","1",",","'value","'",":","Row","(","age=2",",","name=","'","a","'",")","}","True",">",">",">","row.as_dict","(","True",")","==","{","'key","'",":","1",",","'value","'",":","{","'name","'",":","'","a","'",",","'age","'",":","2","}","}","True",":","param","recursive",":","turns","the","nested","Row","as","dict","(","default",":","False",")","."]
code: def as_dict(self, recursive=False):
      """
      Returns as a dict.
  
      Example:
      ::
  
          >>> Row(name="Alice", age=11).as_dict() == {'name': 'Alice', 'age': 11}
          True
          >>> row = Row(key=1, value=Row(name='a', age=2))
          >>> row.as_dict() == {'key': 1, 'value': Row(age=2, name='a')}
          True
          >>> row.as_dict(True) == {'key': 1, 'value': {'name': 'a', 'age': 2}}
          True
  
      :param recursive: turns the nested Row as dict (default: False).
      """
      if not hasattr(self, "_fields"):
          raise TypeError("Cannot convert a Row class into dict")
  
      if recursive:
  
          def conv(obj):
              if isinstance(obj, Row):
                  return obj.as_dict(True)
              elif isinstance(obj, list):
                  return [conv(o) for o in obj]
              elif isinstance(obj, dict):
                  return dict((k, conv(v)) for k, v in obj.items())
              else:
                  return obj
  
          return dict(zip(self._fields, (conv(o) for o in self)))
      else:
          return dict(zip(self._fields, self))
  
imports: from enum import Enum
  from typing import List
  from pyflink.java_gateway import get_gateway
label_desc: Use image node_id 2 for calling the Row obj's underlying member method code with example usage: obj.as_dict(recursive) and returns: dict, dict, obj, unknown, dict, obj