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: Initializes PayloadSerializer object.
docstr_tok: ["Initializes","PayloadSerializer","object","."]
code: def __init__(
      self,
      bucket: Optional[str] = None,
      region: str = JUMPSTART_DEFAULT_REGION_NAME,
      s3_client: Optional[boto3.client] = None,
  ) -> None:
      """Initializes PayloadSerializer object."""
      self.bucket = bucket or get_jumpstart_content_bucket()
      self.region = region
      self.s3_client = s3_client
  
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 1 to create a new PayloadSerializer object  with example: obj = PayloadSerializer(bucket, region, s3_client)