internal static ManagedHsmTrackedResourceData DeserializeManagedHsmTrackedResourceData(JsonElement element) { Optional <ManagedHsmSku> sku = default; IDictionary <string, string> tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } sku = ManagedHsmSku.DeserializeManagedHsmSku(property.Value); continue; } if (property.NameEquals("tags")) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } tags = dictionary; continue; } if (property.NameEquals("location")) { location = property.Value.GetString(); continue; } if (property.NameEquals("id")) { id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = property.Value.GetString(); continue; } if (property.NameEquals("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } } return(new ManagedHsmTrackedResourceData(id, name, type, systemData, tags, location, sku.Value)); }
internal ManagedHsmResource(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, ManagedHsmSku sku) : base(id, name, type, systemData, tags, location) { Sku = sku; }
internal ManagedHsmPrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, ManagedHsmSku sku, string groupId, IReadOnlyList <string> requiredMembers, IList <string> requiredZoneNames) : base(id, name, resourceType, systemData, tags, location, sku) { GroupId = groupId; RequiredMembers = requiredMembers; RequiredZoneNames = requiredZoneNames; }
internal KeyVaultTrackedResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, ManagedHsmSku sku) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; }
internal static ManagedHsmPrivateLinkResource DeserializeManagedHsmPrivateLinkResource(JsonElement element) { Optional <ManagedHsmSku> sku = default; IDictionary <string, string> tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <string> groupId = default; Optional <IReadOnlyList <string> > requiredMembers = default; Optional <IList <string> > requiredZoneNames = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("sku")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } sku = ManagedHsmSku.DeserializeManagedHsmSku(property.Value); continue; } if (property.NameEquals("tags")) { Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } tags = dictionary; continue; } if (property.NameEquals("location")) { location = property.Value.GetString(); continue; } if (property.NameEquals("id")) { id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = property.Value.GetString(); continue; } if (property.NameEquals("systemData")) { systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString()); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("groupId")) { groupId = property0.Value.GetString(); continue; } if (property0.NameEquals("requiredMembers")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(item.GetString()); } requiredMembers = array; continue; } if (property0.NameEquals("requiredZoneNames")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } List <string> array = new List <string>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(item.GetString()); } requiredZoneNames = array; continue; } } continue; } } return(new ManagedHsmPrivateLinkResource(id, name, type, systemData, tags, location, sku.Value, groupId.Value, Optional.ToList(requiredMembers), Optional.ToList(requiredZoneNames))); }