class Builder {

        private Region region = US_EAST_1;
        private String endpointUrl;
        private String profile;
        private boolean forcePathStyle;
        private AwsCredentials awsCredentials;

        /**
         * Set the AWS region. Defaults to US_EAST_1
         *
         * @param region The AWS region.
         * @return The builder instance.
         */
        public Builder region(String region) {
            this.region = Region.of(region);
            return this;
        }

        /**
         * Set the AWS region. Defaults to US_EAST_1
         *
         * @param region The AWS region.
         * @return The builder instance.
         */
        public Builder region(Region region) {
            this.region = region;
            return this;
        }

        /**
         * Specifies a custom endpoint URL to override the default service URL.
         *
         * @param endpointUrl The endpoint URL.
         * @return The builder instance.
         */
        public Builder endpointUrl(String endpointUrl) {
            this.endpointUrl = endpointUrl;
            return this;
        }

        /**
         * Set the profile defined in AWS credentials. If not set, it will use the default profile.
         *
         * @param profile The profile defined in AWS credentials.
         * @return The builder instance.
         */
        public Builder profile(String profile) {
            this.profile = profile;
            return this;
        }

        /**
         * Set the forcePathStyle. When enabled, it will use the path-style URL
         *
         * @param forcePathStyle The forcePathStyle.
         * @return The builder instance.
         */
        public Builder forcePathStyle(boolean forcePathStyle) {
            this.forcePathStyle = forcePathStyle;
            return this;
        }

        /**
         * Set the AWS credentials. If not set, it will use the default credentials.
         *
         * @param awsCredentials The AWS credentials.
         * @return The builder instance.
         */
        public Builder awsCredentials(AwsCredentials awsCredentials) {
            this.awsCredentials = awsCredentials;
            return this;
        }

        public AmazonS3DocumentLoader build() {
            AwsCredentialsProvider credentialsProvider = createCredentialsProvider();
            S3Client s3Client = createS3Client(credentialsProvider);
            return new AmazonS3DocumentLoader(s3Client);
        }

        private AwsCredentialsProvider createCredentialsProvider() {
            if (!isNullOrBlank(profile)) {
                return ProfileCredentialsProvider.create(profile);
            }

            if (awsCredentials != null) {
                return awsCredentials.toCredentialsProvider();
            }

            return DefaultCredentialsProvider.create();
        }

        private S3Client createS3Client(AwsCredentialsProvider credentialsProvider) {<FILL_FUNCTION_BODY>}
    }


            S3ClientBuilder s3ClientBuilder = S3Client.builder()
                    .region(region)
                    .forcePathStyle(forcePathStyle)
                    .credentialsProvider(credentialsProvider);

            if (!isNullOrBlank(endpointUrl)) {
                try {
                    s3ClientBuilder.endpointOverride(new URI(endpointUrl));
                } catch (URISyntaxException e) {
                    throw new RuntimeException(e);
                }
            }

            return s3ClientBuilder.build();
        
<no_super_class>