/// <summary> /// Initializes a new instance of the <see cref="GraphClient"/> class. /// </summary> /// <param name="provider">Provides access to core services.</param> /// <param name="client">Provides the ability to interact with the Microsoft Graph.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider"/> is null. /// or /// <paramref name="client"/> is null. /// </exception> public GraphClient(IExplorerProvider provider, IGraphServiceClient client) { provider.AssertNotNull(nameof(provider)); client.AssertNotNull(nameof(client)); this.provider = provider; this.client = client; }
/// <summary> /// Initializes a new instance of the <see cref="ResourceManager"/> class. /// </summary> /// <param name="provider">Provides access to core services.</param> /// <param name="token">A valid JSON Web Token (JWT).</param> /// <exception cref="ArgumentException"> /// <paramref name="token"/> is empty or null. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="provider"/> is null. /// </exception> public ResourceManager(IExplorerProvider provider, string token) { provider.AssertNotNull(nameof(provider)); token.AssertNotEmpty(nameof(token)); client = new ResourceManagementClient(new TokenCredentials(token)); this.provider = provider; }
/// <summary> /// Initializes a new instance of the <see cref="AuthenticationProvider"/> class. /// </summary> /// <param name="provider">Provides access to core services.</param> /// <param name="customerId">Identifier for customer whose resources are being accessed.</param> /// <exception cref="System.ArgumentException"> /// <paramref name="customerId"/> is empty or null. /// </exception> /// <exception cref="System.ArgumentNullException"> /// <paramref name="provider"/> is null. /// </exception> public AuthenticationProvider(IExplorerProvider provider, string customerId) { provider.AssertNotNull(nameof(provider)); customerId.AssertNotEmpty(nameof(customerId)); this.customerId = customerId; this.provider = provider; }
/// <summary> /// Initializes a new instance of the <see cref="GraphClient"/> class. /// </summary> /// <param name="provider">Provides access to core services.</param> /// <param name="customerId">Identifier for customer whose resources are being accessed.</param> /// <exception cref="ArgumentException"> /// <paramref name="customerId"/> is empty or null. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="provider"/> is null. /// </exception> public GraphClient(IExplorerProvider provider, string customerId) { provider.AssertNotNull(nameof(provider)); customerId.AssertNotEmpty(nameof(customerId)); this.customerId = customerId; this.provider = provider; client = new GraphServiceClient(new AuthenticationProvider(this.provider, customerId), httpProvider); }
/// <summary> /// Initializes a new instance of the <see cref="DistributedTokenCache"/> class. /// </summary> /// <param name="provider">Provides access to the core explorer providers.</param> /// <param name="resource">The resource being accessed.</param> /// <param name="key">The unique identifier for the cache entry.</param> /// <exception cref="ArgumentException"> /// <paramref name="resource"/> is empty or null. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="provider"/> is null. /// </exception> public DistributedTokenCache(IExplorerProvider provider, string resource, string key = null) { provider.AssertNotNull(nameof(provider)); resource.AssertNotEmpty(nameof(resource)); this.provider = provider; keyValue = key; this.resource = resource; AfterAccess = AfterAccessNotification; BeforeAccess = BeforeAccessNotification; }
/// <summary> /// Initializes a new instance of the <see cref="ServiceCommunications" /> class. /// </summary> /// <param name="provider">Provides access to core services.</param> /// <param name="token">Access token to be used for the requests.</param> /// <exception cref="System.ArgumentException"> /// <paramref name="token"/> is null. /// </exception> /// <exception cref="System.ArgumentNullException"> /// <paramref name="provider"/> is null. /// </exception> public ServiceCommunications(IExplorerProvider provider, AuthenticationResult token) { provider.AssertNotNull(nameof(provider)); this.provider = provider; this.token = token; }
/// <summary> /// Initializes a new instance of the <see cref="ConfigurationProvider"/> class. /// </summary> /// <param name="service">Provides access to core explorer providers.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="service"/> is null. /// </exception> public ConfigurationProvider(IExplorerProvider service) { service.AssertNotNull(nameof(service)); this.service = service; }
/// <summary> /// Initializes a new instance of the <see cref="RedisCacheProvider"/> class. /// </summary> /// <param name="provider">Provides access to core report providers.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider"/> is null. /// </exception> public RedisCacheProvider(IExplorerProvider provider) { provider.AssertNotNull(nameof(provider)); this.provider = provider; }
/// <summary> /// Initializes a new instance of <see cref="AccessTokenProvider"/> class. /// </summary> /// <param name="provider">Provides access to core explorer providers.</param> /// <exception cref="System.ArgumentNullException"> /// <paramref name="provider"/> is null. /// </exception> public AccessTokenProvider(IExplorerProvider provider) { provider.AssertNotNull(nameof(provider)); this.provider = provider; }
/// <summary> /// Initializes a new instance of the <see cref="KeyVaultProvider"/> class. /// </summary> /// <param name="provider">Provides access to core explorer providers.</param> /// <exception cref="ArgumentNullException"> /// <paramref name="provider"/> is null. /// </exception> public KeyVaultProvider(IExplorerProvider provider) { provider.AssertNotNull(nameof(provider)); this.provider = provider; }