code: def _construct_body_s3_dict(self):
          
          if isinstance(self.definition_uri, dict):
              if not self.definition_uri.get("Bucket", None) or not self.definition_uri.get("Key", None):
                  # DefinitionUri is a dictionary but does not contain Bucket or Key property
                  raise InvalidResourceException(self.logical_id,
                                                 "'DefinitionUri' requires Bucket and Key properties to be specified")
              s3_pointer = self.definition_uri
  
          else:
  
              # DefinitionUri is a string
              s3_pointer = parse_s3_uri(self.definition_uri)
              if s3_pointer is None:
                  raise InvalidResourceException(self.logical_id,
                                                 '\'DefinitionUri\' is not a valid S3 Uri of the form '
                                                 '"s3://bucket/key" with optional versionId query parameter.')
  
          body_s3 = {
              'Bucket': s3_pointer['Bucket'],
              'Key': s3_pointer['Key']
          }
          if 'Version' in s3_pointer:
              body_s3['Version'] = s3_pointer['Version']
          return body_s3
docs: Constructs the RestApi's `BodyS3Location property`_, from the SAM Api's DefinitionUri property.
  
          :returns: a BodyS3Location dict, containing the S3 Bucket, Key, and Version of the Swagger definition
          :rtype: dict