internal WebPubSubPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ProvisioningState?provisioningState, PrivateEndpoint privateEndpoint, IReadOnlyList <string> groupIds, WebPubSubPrivateLinkServiceConnectionState connectionState) : base(id, name, resourceType, systemData) { ProvisioningState = provisioningState; PrivateEndpoint = privateEndpoint; GroupIds = groupIds; ConnectionState = connectionState; }
internal static WebPubSubPrivateEndpointConnectionData DeserializeWebPubSubPrivateEndpointConnectionData(JsonElement element) { ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; Optional <ProvisioningState> provisioningState = default; Optional <PrivateEndpoint> privateEndpoint = default; Optional <IReadOnlyList <string> > groupIds = default; Optional <WebPubSubPrivateLinkServiceConnectionState> privateLinkServiceConnectionState = default; foreach (var property in element.EnumerateObject()) { 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("provisioningState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } provisioningState = new ProvisioningState(property0.Value.GetString()); continue; } if (property0.NameEquals("privateEndpoint")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } privateEndpoint = PrivateEndpoint.DeserializePrivateEndpoint(property0.Value); continue; } if (property0.NameEquals("groupIds")) { 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()); } groupIds = array; continue; } if (property0.NameEquals("privateLinkServiceConnectionState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } privateLinkServiceConnectionState = WebPubSubPrivateLinkServiceConnectionState.DeserializeWebPubSubPrivateLinkServiceConnectionState(property0.Value); continue; } } continue; } } return(new WebPubSubPrivateEndpointConnectionData(id, name, type, systemData, Optional.ToNullable(provisioningState), privateEndpoint.Value, Optional.ToList(groupIds), privateLinkServiceConnectionState.Value)); }