internal GatewayProperties(GatewayProvisioningState?provisioningState, bool? @public, Uri uri, bool?httpsOnly, SsoProperties ssoProperties, GatewayApiMetadataProperties apiMetadataProperties, GatewayCorsProperties corsProperties, GatewayResourceRequests resourceRequests, IReadOnlyList <GatewayInstance> instances, GatewayOperatorProperties operatorProperties) { ProvisioningState = provisioningState; Public = @public; Uri = uri; HttpsOnly = httpsOnly; SsoProperties = ssoProperties; ApiMetadataProperties = apiMetadataProperties; CorsProperties = corsProperties; ResourceRequests = resourceRequests; Instances = instances; OperatorProperties = operatorProperties; }
internal static GatewayProperties DeserializeGatewayProperties(JsonElement element) { Optional <GatewayProvisioningState> provisioningState = default; Optional <bool> @public = default; Optional <Uri> url = default; Optional <bool> httpsOnly = default; Optional <SsoProperties> ssoProperties = default; Optional <GatewayApiMetadataProperties> apiMetadataProperties = default; Optional <GatewayCorsProperties> corsProperties = default; Optional <GatewayResourceRequests> resourceRequests = default; Optional <IReadOnlyList <GatewayInstance> > instances = default; Optional <GatewayOperatorProperties> operatorProperties = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("provisioningState")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } provisioningState = new GatewayProvisioningState(property.Value.GetString()); continue; } if (property.NameEquals("public")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } @public = property.Value.GetBoolean(); continue; } if (property.NameEquals("url")) { if (property.Value.ValueKind == JsonValueKind.Null) { url = null; continue; } url = new Uri(property.Value.GetString()); continue; } if (property.NameEquals("httpsOnly")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } httpsOnly = property.Value.GetBoolean(); continue; } if (property.NameEquals("ssoProperties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } ssoProperties = SsoProperties.DeserializeSsoProperties(property.Value); continue; } if (property.NameEquals("apiMetadataProperties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } apiMetadataProperties = GatewayApiMetadataProperties.DeserializeGatewayApiMetadataProperties(property.Value); continue; } if (property.NameEquals("corsProperties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } corsProperties = GatewayCorsProperties.DeserializeGatewayCorsProperties(property.Value); continue; } if (property.NameEquals("resourceRequests")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } resourceRequests = GatewayResourceRequests.DeserializeGatewayResourceRequests(property.Value); continue; } if (property.NameEquals("instances")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <GatewayInstance> array = new List <GatewayInstance>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(GatewayInstance.DeserializeGatewayInstance(item)); } instances = array; continue; } if (property.NameEquals("operatorProperties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } operatorProperties = GatewayOperatorProperties.DeserializeGatewayOperatorProperties(property.Value); continue; } } return(new GatewayProperties(Optional.ToNullable(provisioningState), Optional.ToNullable(@public), url.Value, Optional.ToNullable(httpsOnly), ssoProperties.Value, apiMetadataProperties.Value, corsProperties.Value, resourceRequests.Value, Optional.ToList(instances), operatorProperties.Value)); }