public Bucket(string bucketId, CloudAuthenticator authenticator, StorageConfiguration configuration) { this._bucketId = bucketId; this._authenticator = authenticator; this._config = configuration; _authenticator.GetInitializer().GZipEnabled = _config.EnableGzip; _googleStorageService = new Google.Apis.Storage.v1.StorageService(_authenticator.GetInitializer()); }
private bool IsKeyUsed(CloudAuthenticator authenticator, string key) { // TODO consider using AllocateIds() var result = new Google.Apis.Datastore.v1beta3.DatastoreService(authenticator.GetInitializer()).Projects.Lookup(new LookupRequest { Keys = new List <Key> { new Key { Path = new List <PathElement> { new PathElement { Name = key, Kind = typeof(T).Name } } } } }, authenticator.GetProjectId()).Execute(); return(result.Found.Any()); }