internal static RoleInstanceProperties DeserializeRoleInstanceProperties(JsonElement element)
        {
            Optional <RoleInstanceNetworkProfile> networkProfile = default;
            Optional <RoleInstanceView>           instanceView   = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("networkProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    networkProfile = RoleInstanceNetworkProfile.DeserializeRoleInstanceNetworkProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("instanceView"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    instanceView = RoleInstanceView.DeserializeRoleInstanceView(property.Value);
                    continue;
                }
            }
            return(new RoleInstanceProperties(networkProfile.Value, instanceView.Value));
        }
Ejemplo n.º 2
0
 internal RoleInstanceProperties(RoleInstanceNetworkProfile networkProfile, RoleInstanceView instanceView)
 {
     NetworkProfile = networkProfile;
     InstanceView   = instanceView;
 }