public PurviewMetadataRolesClient(Uri endpoint, TokenCredential credential, PurviewMetadataClientOptions options) { if (endpoint == null) { throw new ArgumentNullException(nameof(endpoint)); } if (credential == null) { throw new ArgumentNullException(nameof(credential)); } options ??= new PurviewMetadataClientOptions(); ClientDiagnostics = new ClientDiagnostics(options, true); _tokenCredential = credential; _pipeline = HttpPipelineBuilder.Build(options, Array.Empty <HttpPipelinePolicy>(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); _endpoint = endpoint; }
public PurviewMetadataPolicyClient(Uri endpoint, string collectionName, TokenCredential credential, PurviewMetadataClientOptions options = null) { if (endpoint == null) { throw new ArgumentNullException(nameof(endpoint)); } if (collectionName == null) { throw new ArgumentNullException(nameof(collectionName)); } if (credential == null) { throw new ArgumentNullException(nameof(credential)); } options ??= new PurviewMetadataClientOptions(); _clientDiagnostics = new ClientDiagnostics(options); _tokenCredential = credential; _pipeline = HttpPipelineBuilder.Build(options, new HttpPipelinePolicy[] { new LowLevelCallbackPolicy() }, new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); _endpoint = endpoint; _collectionName = collectionName; }