Example #1
0
        internal static DeploymentOperation DeserializeDeploymentOperation(JsonElement element)
        {
            Optional <string> id          = default;
            Optional <string> operationId = default;
            Optional <DeploymentOperationProperties> properties = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("operationId"))
                {
                    operationId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    properties = DeploymentOperationProperties.DeserializeDeploymentOperationProperties(property.Value);
                    continue;
                }
            }
            return(new DeploymentOperation(id.Value, operationId.Value, properties.Value));
        }
        internal static DeploymentOperation DeserializeDeploymentOperation(JsonElement element)
        {
            string id          = default;
            string operationId = default;
            DeploymentOperationProperties properties = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("operationId"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    operationId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    properties = DeploymentOperationProperties.DeserializeDeploymentOperationProperties(property.Value);
                    continue;
                }
            }
            return(new DeploymentOperation(id, operationId, properties));
        }