class S3RepositoryPlugin extends Plugin implements RepositoryPlugin {

    static {
        try {
            // kick jackson to do some static caching of declared members info
            Jackson.jsonNodeOf("{}");
            // ClientConfiguration clinit has some classloader problems
            // TODO: fix that
            Class.forName("com.amazonaws.ClientConfiguration");
        } catch (final ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }

    protected final S3Service service;

    public S3RepositoryPlugin() {
        this.service = new S3Service();
    }

    @Override
    public List<Setting<?>> getSettings() {
        return List.of(ACCESS_KEY_SETTING, SECRET_KEY_SETTING);
    }

    @Override
    public Map<String, Repository.Factory> getRepositories(final Environment env,
                                                           final NamedXContentRegistry registry,
                                                           ClusterService clusterService,
                                                           RecoverySettings recoverySettings) {<FILL_FUNCTION_BODY>}

    @Override
    public void close() {
        service.close();
    }
}

        return Collections.singletonMap(
            S3Repository.TYPE,
            new Repository.Factory() {

                @Override
                public TypeSettings settings() {
                    return new TypeSettings(List.of(), S3Repository.optionalSettings());
                }

                @Override
                public Repository create(RepositoryMetadata metadata) throws Exception {
                    return new S3Repository(metadata, registry, service, clusterService, recoverySettings);
                }
            }
        );
    
<methods>public non-sealed void <init>() ,public org.elasticsearch.common.settings.Settings additionalSettings() ,public void close() throws java.io.IOException,public Collection<java.lang.Object> createComponents(org.elasticsearch.client.Client, org.elasticsearch.cluster.service.ClusterService, org.elasticsearch.threadpool.ThreadPool, org.elasticsearch.common.xcontent.NamedXContentRegistry, org.elasticsearch.env.Environment, org.elasticsearch.env.NodeEnvironment, org.elasticsearch.common.io.stream.NamedWriteableRegistry, Supplier<org.elasticsearch.repositories.RepositoriesService>) ,public Collection<org.elasticsearch.common.inject.Module> createGuiceModules() ,public List<org.elasticsearch.bootstrap.BootstrapCheck> getBootstrapChecks() ,public UnaryOperator<Map<java.lang.String,org.elasticsearch.cluster.metadata.Metadata.Custom>> getCustomMetadataUpgrader() ,public Collection<Class<? extends org.elasticsearch.common.component.LifecycleComponent>> getGuiceServiceClasses() ,public BiFunction<org.elasticsearch.cluster.metadata.IndexMetadata,org.elasticsearch.cluster.metadata.IndexTemplateMetadata,org.elasticsearch.cluster.metadata.IndexMetadata> getIndexMetadataUpgrader() ,public UnaryOperator<Map<java.lang.String,org.elasticsearch.cluster.metadata.IndexTemplateMetadata>> getIndexTemplateMetadataUpgrader() ,public List<org.elasticsearch.common.io.stream.NamedWriteableRegistry.Entry> getNamedWriteables() ,public List<org.elasticsearch.common.xcontent.NamedXContentRegistry.Entry> getNamedXContent() ,public Set<org.elasticsearch.cluster.node.DiscoveryNodeRole> getRoles() ,public List<SettingUpgrader<?>> getSettingUpgraders() ,public List<Setting<?>> getSettings() ,public void onIndexModule(org.elasticsearch.index.IndexModule) <variables>