/// <summary> /// Updates default type Id on Time Series model settings synchronously. /// </summary> /// <param name="defaultTypeId">Default type Id of the model that new instances will automatically belong to.</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>The updated model settings with the http response <see cref="Response{TimeSeriesModelSettings}"/>.</returns> public virtual Response <TimeSeriesModelSettings> UpdateModelSettingsDefaultTypeId(string defaultTypeId, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(TimeSeriesInsightsClient)}.{nameof(UpdateModelSettingsDefaultTypeId)}"); scope.Start(); try { // To do: Generate client session Id var options = new UpdateModelSettingsRequest { DefaultTypeId = defaultTypeId }; Response <ModelSettingsResponse> modelSettings = _modelSettingsRestClient.Update(options, null, cancellationToken); return(Response.FromValue(modelSettings.Value.ModelSettings, modelSettings.GetRawResponse())); } catch (Exception ex) { scope.Failed(ex); throw; } }
/// <summary> /// Updates model name on Time Series model settings asynchronously. /// </summary> /// <param name="name">Model display name which is mutable by the user. Initial value is "DefaultModel".</param> /// <param name="cancellationToken">The cancellation token.</param> /// <returns>The updated model settings with the http response <see cref="Response{TimeSeriesModelSettings}"/>.</returns> public virtual async Task <Response <TimeSeriesModelSettings> > UpdateModelSettingsNameAsync(string name, CancellationToken cancellationToken = default) { using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(TimeSeriesInsightsClient)}.{nameof(UpdateModelSettingsName)}"); scope.Start(); try { // To do: Generate client session Id var options = new UpdateModelSettingsRequest { Name = name }; Response <ModelSettingsResponse> modelSettings = await _modelSettingsRestClient.UpdateAsync(options, null, cancellationToken).ConfigureAwait(false); return(Response.FromValue(modelSettings.Value.ModelSettings, modelSettings.GetRawResponse())); } catch (Exception ex) { scope.Failed(ex); throw; } }