public async Task <YouTubeService> InitializeServiceAsync() { UserCredential credential = await gcm.LoadUserCredentialsAsync(); return(new YouTubeService(new YouTubeService.Initializer { HttpClientInitializer = credential, ApplicationName = "Auto Video Meta Localize", })); }
public async Task <YouTubeService> InitializeServiceAsync(string userCredentialsKey) { UserCredential credential = await gcm.LoadUserCredentialsAsync(userCredentialsKey); return(new YouTubeService(new BaseClientService.Initializer { HttpClientInitializer = credential, ApplicationName = ApplicationValues.NAME, })); }
public async Task <TranslationServiceClient> InitializeServiceAsync() { UserCredential credential = await gcm.LoadUserCredentialsAsync(); TranslationServiceClientBuilder builder = new TranslationServiceClientBuilder { TokenAccessMethod = credential.GetAccessTokenForRequestAsync, }; return(await builder.BuildAsync()); }