public PurviewScanningServiceClient(Uri endpoint, TokenCredential credential, PurviewScanningServiceClientOptions options = null) { if (endpoint == null) { throw new ArgumentNullException(nameof(endpoint)); } if (credential == null) { throw new ArgumentNullException(nameof(credential)); } options ??= new PurviewScanningServiceClientOptions(); Pipeline = HttpPipelineBuilder.Build(options, new BearerTokenAuthenticationPolicy(credential, AuthorizationScopes)); this.endpoint = endpoint; apiVersion = options.Version; }
public PurviewClassificationRuleClient(Uri endpoint, string classificationRuleName, TokenCredential credential, PurviewScanningServiceClientOptions options = null) { Argument.AssertNotNull(endpoint, nameof(endpoint)); Argument.AssertNotNullOrEmpty(classificationRuleName, nameof(classificationRuleName)); Argument.AssertNotNull(credential, nameof(credential)); options ??= new PurviewScanningServiceClientOptions(); ClientDiagnostics = new ClientDiagnostics(options); _tokenCredential = credential; _pipeline = HttpPipelineBuilder.Build(options, Array.Empty <HttpPipelinePolicy>(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); _endpoint = endpoint; _classificationRuleName = classificationRuleName; _apiVersion = options.Version; }
public PurviewDataSourceClient(Uri endpoint, string dataSourceName, TokenCredential credential, PurviewScanningServiceClientOptions options = null) { if (endpoint == null) { throw new ArgumentNullException(nameof(endpoint)); } if (dataSourceName == null) { throw new ArgumentNullException(nameof(dataSourceName)); } if (credential == null) { throw new ArgumentNullException(nameof(credential)); } options ??= new PurviewScanningServiceClientOptions(); _clientDiagnostics = new ClientDiagnostics(options); var authPolicy = new BearerTokenAuthenticationPolicy(credential, AuthorizationScopes); Pipeline = HttpPipelineBuilder.Build(options, new HttpPipelinePolicy[] { authPolicy, new LowLevelCallbackPolicy() }); this.endpoint = endpoint; this.dataSourceName = dataSourceName; apiVersion = options.Version; }