@staticmethod
def convert_k8s_obj_to_json(k8s_obj):
    '\n    Builds a JSON K8s object.\n\n    If obj is None, return None.\n    If obj is str, int, long, float, bool, return directly.\n    If obj is datetime.datetime, datetime.date\n        convert to string in iso8601 format.\n    If obj is list, sanitize each element in the list.\n    If obj is dict, return the dict.\n    If obj is swagger model, return the properties dict.\n\n    Args:\n      obj: The data to serialize.\n    Returns: The serialized form of data.\n    '
    from six import text_type, integer_types, iteritems
    PRIMITIVE_TYPES = ((float, bool, bytes, text_type) + integer_types)
    from datetime import date, datetime
    if (k8s_obj is None):
        return None
    elif isinstance(k8s_obj, PRIMITIVE_TYPES):
        return k8s_obj
    elif isinstance(k8s_obj, list):
        return [K8sHelper.convert_k8s_obj_to_json(sub_obj) for sub_obj in k8s_obj]
    elif isinstance(k8s_obj, tuple):
        return tuple((K8sHelper.convert_k8s_obj_to_json(sub_obj) for sub_obj in k8s_obj))
    elif isinstance(k8s_obj, (datetime, date)):
        return k8s_obj.isoformat()
    elif isinstance(k8s_obj, dsl.PipelineParam):
        if isinstance(k8s_obj.value, str):
            return k8s_obj.value
        return ('{{inputs.parameters.%s}}' % k8s_obj.full_name)
    if isinstance(k8s_obj, dict):
        obj_dict = k8s_obj
    else:
        obj_dict = {k8s_obj.attribute_map[attr]: getattr(k8s_obj, attr) for (attr, _) in iteritems(k8s_obj.swagger_types) if (getattr(k8s_obj, attr) is not None)}
    return {key: K8sHelper.convert_k8s_obj_to_json(val) for (key, val) in iteritems(obj_dict)}
Builds a JSON K8s object.

If obj is None, return None.
If obj is str, int, long, float, bool, return directly.
If obj is datetime.datetime, datetime.date
    convert to string in iso8601 format.
If obj is list, sanitize each element in the list.
If obj is dict, return the dict.
If obj is swagger model, return the properties dict.

Args:
  obj: The data to serialize.
Returns: The serialized form of data.
@staticmethod
def convert_k8s_obj_to_json(k8s_obj):
    '\n    Builds a JSON K8s object.\n\n    If obj is None, return None.\n    If obj is str, int, long, float, bool, return directly.\n    If obj is datetime.datetime, datetime.date\n        convert to string in iso8601 format.\n    If obj is list, sanitize each element in the list.\n    If obj is dict, return the dict.\n    If obj is swagger model, return the properties dict.\n\n    Args:\n      obj: The data to serialize.\n    Returns: The serialized form of data.\n    '
    from six import text_type, integer_types, iteritems
    PRIMITIVE_TYPES = ((float, bool, bytes, text_type) + integer_types)
    from datetime import date, datetime
    if (k8s_obj is None):
        return None
    elif isinstance(k8s_obj, PRIMITIVE_TYPES):
        return k8s_obj
    elif isinstance(k8s_obj, list):
        return [K8sHelper.convert_k8s_obj_to_json(sub_obj) for sub_obj in k8s_obj]
    elif isinstance(k8s_obj, tuple):
        return tuple((K8sHelper.convert_k8s_obj_to_json(sub_obj) for sub_obj in k8s_obj))
    elif isinstance(k8s_obj, (datetime, date)):
        return k8s_obj.isoformat()
    elif isinstance(k8s_obj, dsl.PipelineParam):
        if isinstance(k8s_obj.value, str):
            return k8s_obj.value
        return ('{{inputs.parameters.%s}}' % k8s_obj.full_name)
    if isinstance(k8s_obj, dict):
        obj_dict = k8s_obj
    else:
        obj_dict = {k8s_obj.attribute_map[attr]: getattr(k8s_obj, attr) for (attr, _) in iteritems(k8s_obj.swagger_types) if (getattr(k8s_obj, attr) is not None)}
    return {key: K8sHelper.convert_k8s_obj_to_json(val) for (key, val) in iteritems(obj_dict)}