class_docstr: Static class for storing and retrieving S3 payload artifacts.
class_docstr_tok: ["Static","class","for","storing","and","retrieving","S3","payload","artifacts","."]
docstr: Returns size in bytes of S3 object using S3.HeadObject operation.
docstr_tok: ["Returns","size","in","bytes","of","S3","object","using","S3.HeadObject","operation","."]
code: def _get_object_size_bytes(
      bucket: str,
      key: str,
      region: str = JUMPSTART_DEFAULT_REGION_NAME,
      s3_client: Optional[boto3.client] = None,
  ) -> bytes:
      """Returns size in bytes of S3 object using S3.HeadObject operation."""
      if s3_client is None:
          s3_client = JumpStartS3PayloadAccessor._get_default_s3_client(
              region
          )
  
      return s3_client.head_object(Bucket=bucket, Key=key)[
          "ContentLength"
      ]
  
imports: from __future__ import absolute_import
  import functools
  from typing import Any, Dict, List, Optional
  import boto3
  from sagemaker.deprecations import deprecated
  from sagemaker.jumpstart.types import JumpStartModelHeader, JumpStartModelSpecs
  from sagemaker.jumpstart import cache
  from sagemaker.jumpstart.constants import JUMPSTART_DEFAULT_REGION_NAME
label_desc: Use image node_id 4 for calling the JumpStartS3PayloadAccessor obj's underlying member method code with example usage: obj._get_object_size_bytes(bucket, key, region, s3_client) and returns: s3_client