mirror of
https://github.com/google/nomulus
synced 2026-02-03 11:32:24 +00:00
Use Multimap bindings to construct BigQuery schema map
This refactoring allows the schemas to live in the same package they are used, rather than all having to be inside the bigquery package. This is a follow-up to [] ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=120551011
This commit is contained in:
@@ -21,12 +21,16 @@ import com.google.api.client.http.HttpTransport;
|
||||
import com.google.api.client.json.JsonFactory;
|
||||
import com.google.api.services.bigquery.Bigquery;
|
||||
import com.google.api.services.bigquery.BigqueryScopes;
|
||||
import com.google.api.services.bigquery.model.TableFieldSchema;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.domain.registry.config.ConfigModule.Config;
|
||||
import com.google.domain.registry.request.OAuthScopes;
|
||||
|
||||
import dagger.Module;
|
||||
import dagger.Multibindings;
|
||||
import dagger.Provides;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -41,6 +45,13 @@ import java.util.Set;
|
||||
@Module
|
||||
public final class BigqueryModule {
|
||||
|
||||
@Multibindings
|
||||
interface BigQueryMultibindings {
|
||||
|
||||
/** Provides a map of BigQuery table names to field names. */
|
||||
Map<String, ImmutableList<TableFieldSchema>> bigquerySchemas();
|
||||
}
|
||||
|
||||
/** Provides OAuth2 scopes for the Bigquery service needed by Domain Registry. */
|
||||
@Provides(type = SET_VALUES)
|
||||
@OAuthScopes
|
||||
|
||||
Reference in New Issue
Block a user