/// <summary> /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider" /// /> and <see cref="ignoreCase" /> /// </summary> /// <param name="sourceValue">the value to convert into an instance of <see cref="ConfigurationStoreUpdateParameters" />.</param> /// <returns> /// an instance of <see cref="ConfigurationStoreUpdateParameters" />, or <c>null</c> if there is no suitable conversion. /// </returns> public static object ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return(null); } try { ConfigurationStoreUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString()); } catch { // Unable to use JSON pattern } try { return(new ConfigurationStoreUpdateParameters { Properties = ConfigurationStorePropertiesUpdateParametersTypeConverter.ConvertFrom(sourceValue.Properties), Tag = sourceValue.Tag, }); } catch { } return(null); }
public virtual ConfigurationStoresUpdateOperation StartUpdate(string resourceGroupName, string configStoreName, ConfigurationStoreUpdateParameters configStoreUpdateParameters, CancellationToken cancellationToken = default) { if (resourceGroupName == null) { throw new ArgumentNullException(nameof(resourceGroupName)); } if (configStoreName == null) { throw new ArgumentNullException(nameof(configStoreName)); } if (configStoreUpdateParameters == null) { throw new ArgumentNullException(nameof(configStoreUpdateParameters)); } using var scope = _clientDiagnostics.CreateScope("ConfigurationStoresClient.StartUpdate"); scope.Start(); try { var originalResponse = RestClient.Update(resourceGroupName, configStoreName, configStoreUpdateParameters, cancellationToken); return(new ConfigurationStoresUpdateOperation(_clientDiagnostics, _pipeline, RestClient.CreateUpdateRequest(resourceGroupName, configStoreName, configStoreUpdateParameters).Request, originalResponse)); } catch (Exception e) { scope.Failed(e); throw; } }