private void CopyApiVersionOverrides(ArmClientOptions options) { foreach (var keyValuePair in options.ResourceApiVersionOverrides) { ApiVersionOverrides.Add(keyValuePair.Key, keyValuePair.Value); if (!ResourceApiVersionCache.TryGetValue(keyValuePair.Key.Namespace, out var apiVersionCache)) { apiVersionCache = new Dictionary <string, string>(); ResourceApiVersionCache.TryAdd(keyValuePair.Key.Namespace, apiVersionCache); } apiVersionCache.Add(keyValuePair.Key.Type, keyValuePair.Value); } }
/// <summary> /// Gets the api version override if it has been set for the current client options. /// </summary> /// <param name="resourceType"> The resource type to get the version for. </param> /// <param name="apiVersion"> The api version to variable to set. </param> public bool TryGetApiVersion(ResourceType resourceType, out string apiVersion) { return(ApiVersionOverrides.TryGetValue(resourceType, out apiVersion)); }
/// <summary> /// Gets the api version override if it has been set for the current client options. /// </summary> /// <param name="resourceType"> The resource type to get the version for. </param> /// <param name="apiVersion"> The api version to variable to set. </param> internal virtual bool TryGetApiVersion(ResourceType resourceType, out string apiVersion) { return(ApiVersionOverrides.TryGetValue(resourceType, out apiVersion)); }