1
0
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:
mcilwain
2016-04-22 08:44:42 -07:00
committed by Justine Tunney
parent d65bf2a714
commit e14faaa7e6
9 changed files with 143 additions and 125 deletions

View File

@@ -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