internal ExpressRouteLinkData(ResourceIdentifier id, string name, ResourceType?resourceType, ETag?etag, string routerName, string interfaceName, string patchPanelId, string rackId, ExpressRouteLinkConnectorType?connectorType, ExpressRouteLinkAdminState?adminState, NetworkProvisioningState?provisioningState, ExpressRouteLinkMacSecConfig macSecConfig) : base(id, name, resourceType) { Etag = etag; RouterName = routerName; InterfaceName = interfaceName; PatchPanelId = patchPanelId; RackId = rackId; ConnectorType = connectorType; AdminState = adminState; ProvisioningState = provisioningState; MacSecConfig = macSecConfig; }
internal ExpressRouteLink(string id, string name, string etag, string routerName, string interfaceName, string patchPanelId, string rackId, ExpressRouteLinkConnectorType?connectorType, ExpressRouteLinkAdminState?adminState, ProvisioningState?provisioningState, ExpressRouteLinkMacSecConfig macSecConfig) : base(id) { Name = name; Etag = etag; RouterName = routerName; InterfaceName = interfaceName; PatchPanelId = patchPanelId; RackId = rackId; ConnectorType = connectorType; AdminState = adminState; ProvisioningState = provisioningState; MacSecConfig = macSecConfig; }
internal static ExpressRouteLinkData DeserializeExpressRouteLinkData(JsonElement element) { Optional <string> name = default; Optional <string> etag = default; Optional <string> id = default; Optional <string> routerName = default; Optional <string> interfaceName = default; Optional <string> patchPanelId = default; Optional <string> rackId = default; Optional <ExpressRouteLinkConnectorType> connectorType = default; Optional <ExpressRouteLinkAdminState> adminState = default; Optional <ProvisioningState> provisioningState = default; Optional <ExpressRouteLinkMacSecConfig> macSecConfig = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("etag")) { etag = property.Value.GetString(); continue; } if (property.NameEquals("id")) { id = property.Value.GetString(); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("routerName")) { routerName = property0.Value.GetString(); continue; } if (property0.NameEquals("interfaceName")) { interfaceName = property0.Value.GetString(); continue; } if (property0.NameEquals("patchPanelId")) { patchPanelId = property0.Value.GetString(); continue; } if (property0.NameEquals("rackId")) { rackId = property0.Value.GetString(); continue; } if (property0.NameEquals("connectorType")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } connectorType = new ExpressRouteLinkConnectorType(property0.Value.GetString()); continue; } if (property0.NameEquals("adminState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } adminState = new ExpressRouteLinkAdminState(property0.Value.GetString()); continue; } if (property0.NameEquals("provisioningState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } provisioningState = new ProvisioningState(property0.Value.GetString()); continue; } if (property0.NameEquals("macSecConfig")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } macSecConfig = ExpressRouteLinkMacSecConfig.DeserializeExpressRouteLinkMacSecConfig(property0.Value); continue; } } continue; } } return(new ExpressRouteLinkData(id.Value, name.Value, etag.Value, routerName.Value, interfaceName.Value, patchPanelId.Value, rackId.Value, Optional.ToNullable(connectorType), Optional.ToNullable(adminState), Optional.ToNullable(provisioningState), macSecConfig.Value)); }