code: def update_application_metadata(template, application_id, sar_client=None):
      
      if not template or not application_id:
          raise ValueError('Require SAM template and application ID to update application metadata')
  
      if not sar_client:
          sar_client = boto3.client('serverlessrepo')
  
      template_dict = _get_template_dict(template)
      app_metadata = get_app_metadata(template_dict)
      request = _update_application_request(app_metadata, application_id)
      sar_client.update_application(**request)
docs: Update the application metadata.
  
      :param template: Content of a packaged YAML or JSON SAM template
      :type template: str_or_dict
      :param application_id: The Amazon Resource Name (ARN) of the application
      :type application_id: str
      :param sar_client: The boto3 client used to access SAR
      :type sar_client: boto3.client
      :raises ValueError