class_docstr: Utility class for serializing payloads associated with JumpStart models.
  
  Many JumpStart models embed byte-streams into payloads corresponding to images, sounds,
  and other content types which require downloading from S3.
docstr: Finds all S3 references in payload and embeds serialized S3 data.
  
  If no S3 references are found, the payload is returned un-modified.
  
  Raises:
      ValueError: If the payload has an unrecognized type.
docstr_tok: ["Finds","all","S3","references","in","payload","and","embeds","serialized","S3","data",".","If","no","S3","references","are","found",",","the","payload","is","returned","un-modified",".","Raises",":","ValueError",":","If","the","payload","has","an","unrecognized","type","."]
code: def embed_s3_references_in_json_payload(
      self, payload_body: Union[list, dict, str, int, float]
  ) -> Union[list, dict, str, int, float]:
      """Finds all S3 references in payload and embeds serialized S3 data.
  
      If no S3 references are found, the payload is returned un-modified.
  
      Raises:
          ValueError: If the payload has an unrecognized type.
      """
      if isinstance(payload_body, str):
          return self.embed_s3_references_in_str_payload(payload_body)
      if isinstance(payload_body, (float, int)):
          return payload_body
      if isinstance(payload_body, list):
          return [
              self.embed_s3_references_in_json_payload(item)
              for item in payload_body
          ]
      if isinstance(payload_body, dict):
          return {
              key: self.embed_s3_references_in_json_payload(value)
              for key, value in payload_body.items()
          }
      raise ValueError(
          f"Payload has unrecognized type: {type(payload_body)}"
      )
  
imports: from __future__ import absolute_import
  import base64
  import json
  from typing import Any, Dict, List, Optional, Union
  import re
  import boto3
  from sagemaker.jumpstart.accessors import JumpStartS3PayloadAccessor
  from sagemaker.jumpstart.artifacts.payloads import _retrieve_example_payloads
  from sagemaker.jumpstart.constants import DEFAULT_JUMPSTART_SAGEMAKER_SESSION, JUMPSTART_DEFAULT_REGION_NAME
  from sagemaker.jumpstart.enums import MIMEType
  from sagemaker.jumpstart.types import JumpStartSerializablePayload
  from sagemaker.jumpstart.utils import get_jumpstart_content_bucket
  from sagemaker.session import Session
label_desc: Use image node_id 5 for calling the PayloadSerializer obj's underlying member method code with example usage: obj.embed_s3_references_in_json_payload(payload_body) and returns: self, payload_body, unknown, unknown