Ejemplo n.º 1
0
        internal static CloudError DeserializeCloudError(JsonElement element)
        {
            Optional <CloudErrorBody> error = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("error"))
                {
                    error = CloudErrorBody.DeserializeCloudErrorBody(property.Value);
                    continue;
                }
            }
            return(new CloudError(error.Value));
        }
        internal static CloudError DeserializeCloudError(JsonElement element)
        {
            CloudErrorBody error = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("error"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    error = CloudErrorBody.DeserializeCloudErrorBody(property.Value);
                    continue;
                }
            }
            return(new CloudError(error));
        }
        internal static CloudError DeserializeCloudError(JsonElement element)
        {
            Optional <CloudErrorBody> error = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("error"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    error = CloudErrorBody.DeserializeCloudErrorBody(property.Value);
                    continue;
                }
            }
            return(new CloudError(error.Value));
        }