code: def serialize(
      self,
      snapshot: SomeUploadedSnapshotFile,
  ) -> FileUploaderStateProto:
      state_proto = FileUploaderStateProto()
  
      if snapshot is None or isinstance(snapshot, DeletedFile):
          return state_proto
  
      file_info: UploadedFileInfoProto = (
          state_proto.uploaded_file_info.add()
      )
      file_info.file_id = snapshot.file_id
      file_info.name = snapshot.name
      file_info.size = snapshot.size
      file_info.file_urls.CopyFrom(snapshot._file_urls)
  
      return state_proto
  
imports: from dataclasses import dataclass
  from textwrap import dedent
  from typing import TYPE_CHECKING, Optional, Union, cast
  from streamlit.elements.form import current_form_id
  from streamlit.elements.utils import check_callback_rules, check_session_state_rules, get_label_visibility_proto_value
  from streamlit.elements.widgets.file_uploader import _get_upload_files
  from streamlit.proto.CameraInput_pb2 import CameraInput
  from streamlit.proto.Common_pb2 import FileUploaderState
  from streamlit.proto.Common_pb2 import UploadedFileInfo
  from streamlit.runtime.metrics_util import gather_metrics
  from streamlit.runtime.scriptrunner import ScriptRunContext, get_script_run_ctx
  from streamlit.runtime.state import WidgetArgs, WidgetCallback, WidgetKwargs, register_widget
  from streamlit.runtime.state.common import compute_widget_id
  from streamlit.runtime.uploaded_file_manager import DeletedFile, UploadedFile
  from streamlit.type_util import Key, LabelVisibility, maybe_raise_label_warnings, to_key
label_desc: Use image node_id 1 for calling the CameraInputSerde obj's underlying member method code with example usage: obj.serialize(snapshot) and returns: state_proto, state_proto