internal CdnOriginGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, HealthProbeParameters healthProbeSettings, IList <WritableSubResource> origins, int?trafficRestorationTimeToHealedOrNewEndpointsInMinutes, ResponseBasedOriginErrorDetectionParameters responseBasedOriginErrorDetectionSettings, OriginGroupResourceState?resourceState, string provisioningState) : base(id, name, resourceType, systemData) { HealthProbeSettings = healthProbeSettings; Origins = origins; TrafficRestorationTimeToHealedOrNewEndpointsInMinutes = trafficRestorationTimeToHealedOrNewEndpointsInMinutes; ResponseBasedOriginErrorDetectionSettings = responseBasedOriginErrorDetectionSettings; ResourceState = resourceState; ProvisioningState = provisioningState; }
internal AfdOriginGroupData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, LoadBalancingSettingsParameters loadBalancingSettings, HealthProbeParameters healthProbeSettings, int?trafficRestorationTimeToHealedOrNewEndpointsInMinutes, ResponseBasedOriginErrorDetectionParameters responseBasedAfdOriginErrorDetectionSettings, EnabledState?sessionAffinityState, AfdProvisioningState?provisioningState, DeploymentStatus?deploymentStatus) : base(id, name, type, systemData) { LoadBalancingSettings = loadBalancingSettings; HealthProbeSettings = healthProbeSettings; TrafficRestorationTimeToHealedOrNewEndpointsInMinutes = trafficRestorationTimeToHealedOrNewEndpointsInMinutes; ResponseBasedAfdOriginErrorDetectionSettings = responseBasedAfdOriginErrorDetectionSettings; SessionAffinityState = sessionAffinityState; ProvisioningState = provisioningState; DeploymentStatus = deploymentStatus; }
internal static CdnOriginGroupData DeserializeCdnOriginGroupData(JsonElement element) { Optional <SystemData> systemData = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; Optional <HealthProbeParameters> healthProbeSettings = default; Optional <IList <WritableSubResource> > origins = default; Optional <int?> trafficRestorationTimeToHealedOrNewEndpointsInMinutes = default; Optional <ResponseBasedOriginErrorDetectionParameters> responseBasedOriginErrorDetectionSettings = default; Optional <OriginGroupResourceState> resourceState = default; Optional <string> provisioningState = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("systemData")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } systemData = SystemData.DeserializeSystemData(property.Value); 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("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("healthProbeSettings")) { if (property0.Value.ValueKind == JsonValueKind.Null) { healthProbeSettings = null; continue; } healthProbeSettings = HealthProbeParameters.DeserializeHealthProbeParameters(property0.Value); continue; } if (property0.NameEquals("origins")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } List <WritableSubResource> array = new List <WritableSubResource>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(JsonSerializer.Deserialize <WritableSubResource>(item.ToString())); } origins = array; continue; } if (property0.NameEquals("trafficRestorationTimeToHealedOrNewEndpointsInMinutes")) { if (property0.Value.ValueKind == JsonValueKind.Null) { trafficRestorationTimeToHealedOrNewEndpointsInMinutes = null; continue; } trafficRestorationTimeToHealedOrNewEndpointsInMinutes = property0.Value.GetInt32(); continue; } if (property0.NameEquals("responseBasedOriginErrorDetectionSettings")) { if (property0.Value.ValueKind == JsonValueKind.Null) { responseBasedOriginErrorDetectionSettings = null; continue; } responseBasedOriginErrorDetectionSettings = ResponseBasedOriginErrorDetectionParameters.DeserializeResponseBasedOriginErrorDetectionParameters(property0.Value); continue; } if (property0.NameEquals("resourceState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } resourceState = new OriginGroupResourceState(property0.Value.GetString()); continue; } if (property0.NameEquals("provisioningState")) { provisioningState = property0.Value.GetString(); continue; } } continue; } } return(new CdnOriginGroupData(id, name, type, systemData.Value, healthProbeSettings.Value, Optional.ToList(origins), Optional.ToNullable(trafficRestorationTimeToHealedOrNewEndpointsInMinutes), responseBasedOriginErrorDetectionSettings.Value, Optional.ToNullable(resourceState), provisioningState.Value)); }
internal static AfdOriginGroupData DeserializeAfdOriginGroupData(JsonElement element) { Optional <SystemData> systemData = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; Optional <LoadBalancingSettingsParameters> loadBalancingSettings = default; Optional <HealthProbeParameters> healthProbeSettings = default; Optional <int?> trafficRestorationTimeToHealedOrNewEndpointsInMinutes = default; Optional <ResponseBasedOriginErrorDetectionParameters> responseBasedAfdOriginErrorDetectionSettings = default; Optional <EnabledState> sessionAffinityState = default; Optional <AfdProvisioningState> provisioningState = default; Optional <DeploymentStatus> deploymentStatus = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("systemData")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } systemData = SystemData.DeserializeSystemData(property.Value); 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("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("loadBalancingSettings")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } loadBalancingSettings = LoadBalancingSettingsParameters.DeserializeLoadBalancingSettingsParameters(property0.Value); continue; } if (property0.NameEquals("healthProbeSettings")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } healthProbeSettings = HealthProbeParameters.DeserializeHealthProbeParameters(property0.Value); continue; } if (property0.NameEquals("trafficRestorationTimeToHealedOrNewEndpointsInMinutes")) { if (property0.Value.ValueKind == JsonValueKind.Null) { trafficRestorationTimeToHealedOrNewEndpointsInMinutes = null; continue; } trafficRestorationTimeToHealedOrNewEndpointsInMinutes = property0.Value.GetInt32(); continue; } if (property0.NameEquals("responseBasedAfdOriginErrorDetectionSettings")) { if (property0.Value.ValueKind == JsonValueKind.Null) { responseBasedAfdOriginErrorDetectionSettings = null; continue; } responseBasedAfdOriginErrorDetectionSettings = ResponseBasedOriginErrorDetectionParameters.DeserializeResponseBasedOriginErrorDetectionParameters(property0.Value); continue; } if (property0.NameEquals("sessionAffinityState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } sessionAffinityState = new EnabledState(property0.Value.GetString()); continue; } if (property0.NameEquals("provisioningState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } provisioningState = new AfdProvisioningState(property0.Value.GetString()); continue; } if (property0.NameEquals("deploymentStatus")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } deploymentStatus = new DeploymentStatus(property0.Value.GetString()); continue; } } continue; } } return(new AfdOriginGroupData(id, name, type, systemData.Value, loadBalancingSettings.Value, healthProbeSettings.Value, Optional.ToNullable(trafficRestorationTimeToHealedOrNewEndpointsInMinutes), responseBasedAfdOriginErrorDetectionSettings.Value, Optional.ToNullable(sessionAffinityState), Optional.ToNullable(provisioningState), Optional.ToNullable(deploymentStatus))); }