/// <summary> /// Creates a new instance of the <see cref="TimeSeriesInsightsClient"/> class, with options. /// </summary> /// <param name='environmentFqdn'>Per environment FQDN, for example 10000000-0000-0000-0000-100000000109.env.timeseries.azure.com. /// You can obtain this domain name from the response of the Get Environments API, Azure portal, or Azure Resource Manager.</param> /// <param name="credential">The <see cref="TokenCredential"/> implementation which will be used to request for the authentication token.</param> /// <param name="options">Options that allow configuration of requests sent to the time series insights service.</param> /// <remarks> /// <para> /// The options parameter provides an opportunity to override default behavior, including specifying API version, /// overriding <see href="https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/core/Azure.Core/samples/Pipeline.md">transport</see>, /// enabling <see href="https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/core/Azure.Core/samples/Diagnostics.md">diagnostics</see>, /// and controlling <see href="https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/core/Azure.Core/samples/Configuration.md">retry strategy</see>. /// </para> /// </remarks> public TimeSeriesInsightsClient(string environmentFqdn, TokenCredential credential, TimeSeriesInsightsClientOptions options) { Argument.AssertNotNullOrEmpty(environmentFqdn, nameof(environmentFqdn)); Argument.AssertNotNull(credential, nameof(credential)); Argument.AssertNotNull(options, nameof(options)); _clientDiagnostics = new ClientDiagnostics(options); options.AddPolicy(new BearerTokenAuthenticationPolicy(credential, GetAuthorizationScopes()), HttpPipelinePosition.PerCall); _httpPipeline = HttpPipelineBuilder.Build(options); string versionString = options.GetVersionString(); _modelSettingsRestClient = new ModelSettingsRestClient(_clientDiagnostics, _httpPipeline, environmentFqdn, versionString); _timeSeriesInstancesRestClient = new TimeSeriesInstancesRestClient(_clientDiagnostics, _httpPipeline, environmentFqdn, versionString); _timeSeriesTypesRestClient = new TimeSeriesTypesRestClient(_clientDiagnostics, _httpPipeline, environmentFqdn, versionString); _timeSeriesHierarchiesRestClient = new TimeSeriesHierarchiesRestClient(_clientDiagnostics, _httpPipeline, environmentFqdn, versionString); _queryRestClient = new QueryRestClient(_clientDiagnostics, _httpPipeline, environmentFqdn, versionString); ModelSettings = new ModelSettingsClient(_modelSettingsRestClient, _clientDiagnostics); Instances = new InstancesClient(_timeSeriesInstancesRestClient, _clientDiagnostics); Types = new TypesClient(_timeSeriesTypesRestClient, _clientDiagnostics); Hierarchies = new HierarchiesClient(_timeSeriesHierarchiesRestClient, _clientDiagnostics); Query = new QueryClient(_queryRestClient, _clientDiagnostics); }
internal TimeSeriesInsightsTypes(TimeSeriesTypesRestClient typesRestClient, ClientDiagnostics clientDiagnostics) { Argument.AssertNotNull(typesRestClient, nameof(typesRestClient)); Argument.AssertNotNull(clientDiagnostics, nameof(clientDiagnostics)); _typesRestClient = typesRestClient; _clientDiagnostics = clientDiagnostics; }