text:
export ProdPreserveType, ProdPreserveTypeLeft, ProdPreserveTypeRight

import Base: prod

"""
    ProdPreserveType{T}

`ProdPreserveType` is one of the strategies for `prod` function. This strategy constraint an output of a prod to be in some specific form.
By default it fallbacks to a `ProdAnalytical` strategy and converts an output to a prespecified type but can be overwritten for some distributions
for better performance.

See also: [`prod`](@ref), [`ProdAnalytical`](@ref), [`ProdPreserveTypeLeft`](@ref), [`ProdPreserveTypeRight`](@ref)
"""
struct ProdPreserveType{T} end

ProdPreserveType(::Type{T}) where T = ProdPreserveType{T}()

prod(::ProdPreserveType{T}, left, right) where T = convert(T, prod(ProdAnalytical(), left, right))

"""
    ProdPreserveTypeLeft

`ProdPreserveTypeLeft` is one of the strategies for `prod` function. This strategy constraint an output of a prod to be in the functional form as `left` argument.
By default it fallbacks to a `ProdPreserveType` strategy and converts an output to a prespecified type but can be overwritten for some distributions
for better performance.

See also: [`prod`](@ref), [`ProdPreserveType`](@ref), [`ProdPreserveTypeRight`](@ref)
"""
struct ProdPreserveTypeLeft end

prod(::ProdPreserveTypeLeft, left::L, right) where L = prod(ProdPreserveType(L), left, right)

"""
    ProdPreserveTypeRight

`ProdPreserveTypeRight` is one of the strategies for `prod` function. This strategy constraint an output of a prod to be in the functional form as `right` argument.
By default it fallbacks to a `ProdPreserveType` strategy and converts an output to a prespecified type but can be overwritten for some distributions
for better performance.

See also: [`prod`](@ref), [`ProdPreserveType`](@ref), [`ProdPreserveTypeLeft`](@ref)
"""
struct ProdPreserveTypeRight end

prod(::ProdPreserveTypeRight, left, right::R) where R = prod(ProdPreserveType(R), left, right)


text:
# ************************************************************************
# FAUST Architecture File
# Copyright (C) 2021 GRAME, Centre National de Creation Musicale
# ---------------------------------------------------------------------

# This is sample code. This file is provided as an example of minimal
# FAUST architecture file. Redistribution and use in source and binary
# forms, with or without modification, in part or in full are permitted.
# In particular you can create a derived work of this FAUST architecture
# and distribute that work under terms of your choice.

# This sample code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# ************************************************************************

const FAUSTFLOAT = Float32

# Architectures files
include("audio/portaudio.jl")
include("gui/MapUI.jl")
include("gui/GTKUI.jl")
include("gui/OSCUI.jl")

# Generated code
<<includeIntrinsic>>
<<includeclass>>

# Main code

using ThreadPools

function main!(args)

    # DSP allocation
    my_dsp = mydsp{REAL}()

    # Audio driver allocation and init
    driver = portaudio(16, 44100)
    init!(driver, "dummy", my_dsp)

    println("getNumInputs: ", getNumInputs(my_dsp))
    println("getNumOutputs: ", getNumOutputs(my_dsp), "\n")

     # Print all paths
    map_ui = MapUI(my_dsp)
    buildUserInterface!(my_dsp, map_ui)
    println(getZoneMap(map_ui), "\n")

    # No controller
    if length(args) == 0
        run(driver)
    # OSC controller
    elseif startswith(args[1], "-osc")
        ThreadPools.@tspawnat 2 run(driver)
        osc_ui = OSCUI(my_dsp)
        buildUserInterface!(my_dsp, osc_ui)
        if args[1] == "-oscc"
            # Launch external OSC controller
            root = getRoot(osc_ui.map_ui)
            ThreadPools.@tspawnat 2 Base.run(`faust-osc-controller $(root) -port 5001 -outport 5000 -xmit 1`)
        end
        # Blocking...
        run(osc_ui)
    # GTK controller
    elseif args[1] == "-gtk"
        ThreadPools.@tspawnat 2 run(driver)
        println("Starting with GTK interface")
        gtk_ui = GTKUI(my_dsp)
        buildUserInterface!(my_dsp, gtk_ui)
        # Blocking...
        run(gtk_ui)
    end

end

# Start the application
main!(ARGS)

ext: jl


text:
# This file is a part of Julia. License is MIT: https://julialang.org/license

# commented-out definitions are implemented in C

#abstract type Any <: Any end
#abstract type Type{T} end

#abstract type Vararg{T} end

#mutable struct Symbol
#    #opaque
#end

#mutable struct TypeName
#    name::Symbol
#end

#mutable struct DataType <: Type
#    name::TypeName
#    super::Type
#    parameters::Tuple
#    names::Tuple
#    types::Tuple
#    ctor
#    instance
#    size::Int32
#    abstract::Bool
#    mutable::Bool
#    pointerfree::Bool
#end

#struct Union <: Type
#    a
#    b
#end

#mutable struct TypeVar
#    name::Symbol
#    lb::Type
#    ub::Type
#end

#struct UnionAll
#    var::TypeVar
#    body
#end

#struct Void
#end
#const nothing = Void()

#abstract type AbstractArray{T,N} end
#abstract type DenseArray{T,N} <: AbstractArray{T,N} end

#mutable struct Array{T,N} <: DenseArray{T,N}
#end

#mutable struct Module
#    name::Symbol
#end

#mutable struct Method
#end

#mutable struct MethodInstance
#end

#mutable struct CodeInfo
#end

#mutable struct TypeMapLevel
#end

#mutable struct TypeMapEntry
#end

#abstract type Ref{T} end
#primitive type Ptr{T} <: Ref{T} {32|64} end

# types for the front end

#mutable struct Expr
#    head::Symbol
#    args::Array{Any,1}
#    typ::Any
#end

#struct LineNumberNode
#    line::Int
#    file::Any # nominally Union{Symbol,Void}
#end

#struct LabelNode
#    label::Int
#end

#struct GotoNode
#    label::Int
#end

#struct QuoteNode
#    value
#end

#struct GlobalRef
#    mod::Module
#    name::Symbol
#end

#mutable struct Task
#    parent::Task
#    storage::Any
#    consumers
#    started::Bool
#    done::Bool
#    runnable::Bool
#end

export
    # key types
    Any, DataType, Vararg, ANY, NTuple,
    Tuple, Type, UnionAll, TypeName, TypeVar, Union, Void,
    SimpleVector, AbstractArray, DenseArray,
    # special objects
    Function, CodeInfo, Method, MethodTable, TypeMapEntry, TypeMapLevel,
    Module, Symbol, Task, Array, WeakRef, VecElement,
    # numeric types
    Number, Real, Integer, Bool, Ref, Ptr,
    AbstractFloat, Float16, Float32, Float64,
    Signed, Int, Int8, Int16, Int32, Int64, Int128,
    Unsigned, UInt, UInt8, UInt16, UInt32, UInt64, UInt128,
    # string types
    Char, DirectIndexString, AbstractString, String, IO,
    # errors
    ErrorException, BoundsError, DivideError, DomainError, Exception,
    InterruptException, InexactError, OutOfMemoryError, ReadOnlyMemoryError,
    OverflowError, StackOverflowError, SegmentationFault, UndefRefError, UndefVarError,
    TypeError,
    # AST representation
    Expr, GotoNode, LabelNode, LineNumberNode, QuoteNode,
    GlobalRef, NewvarNode, SSAValue, Slot, SlotNumber, TypedSlot,
    # object model functions
    fieldtype, getfield, setfield!, nfields, throw, tuple, ===, isdefined, eval,
    # sizeof    # not exported, to avoid conflicting with Base.sizeof
    # type reflection
    issubtype, typeof, isa, typeassert,
    # method reflection
    applicable, invoke,
    # constants
    nothing, Main

const AnyVector = Array{Any,1}

abstract type Number end
abstract type Real     <: Number end
abstract type AbstractFloat <: Real end
abstract type Integer  <: Real end
abstract type Signed   <: Integer end
abstract type Unsigned <: Integer end

primitive type Float16 <: AbstractFloat 16 end
primitive type Float32 <: AbstractFloat 32 end
primitive type Float64 <: AbstractFloat 64 end

#primitive type Bool <: Integer 8 end
primitive type Char 32 end

primitive type Int8    <: Signed   8 end
#primitive type UInt8   <: Unsigned 8 end
primitive type Int16   <: Signed   16 end
primitive type UInt16  <: Unsigned 16 end
#primitive type Int32   <: Signed   32 end
primitive type UInt32  <: Unsigned 32 end
#primitive type Int64   <: Signed   64 end
primitive type UInt64  <: Unsigned 64 end
primitive type Int128  <: Signed   128 end
primitive type UInt128 <: Unsigned 128 end

if Int === Int64
    const UInt = UInt64
else
    const UInt = UInt32
end

function Typeof end
ccall(:jl_toplevel_eval_in, Any, (Any, Any),
      Core, quote
      (f::typeof(Typeof))(x) = ($(_expr(:meta,:nospecialize,:x)); isa(x,Type) ? Type{x} : typeof(x))
      end)

macro nospecialize(x)
    _expr(:meta, :nospecialize, x)
end

Expr(@nospecialize args...) = _expr(args...)

abstract type Exception end
mutable struct ErrorException <: Exception
    msg::AbstractString
    ErrorException(msg::AbstractString) = new(msg)
end

macro _noinline_meta()
    Expr(:meta, :noinline)
end

struct BoundsError        <: Exception
    a::Any
    i::Any
    BoundsError() = new()
    BoundsError(@nospecialize(a)) = (@_noinline_meta; new(a))
    BoundsError(@nospecialize(a), i) = (@_noinline_meta; new(a,i))
end
struct DivideError        <: Exception end
struct OverflowError      <: Exception end
struct OutOfMemoryError   <: Exception end
struct ReadOnlyMemoryError<: Exception end
struct SegmentationFault  <: Exception end
struct StackOverflowError <: Exception end
struct UndefRefError      <: Exception end
struct UndefVarError      <: Exception
    var::Symbol
end
struct InterruptException <: Exception end
struct DomainError <: Exception
    val
    msg
    DomainError(@nospecialize(val)) = (@_noinline_meta; new(val))
    DomainError(@nospecialize(val), @nospecialize(msg)) = (@_noinline_meta; new(val, msg))
end
mutable struct TypeError <: Exception
    func::Symbol
    context::AbstractString
    expected::Type
    got
end
struct InexactError <: Exception
    func::Symbol
    T::Type
    val

    InexactError(f::Symbol, @nospecialize(T), @nospecialize(val)) = (@_noinline_meta; new(f, T, val))
end

abstract type DirectIndexString <: AbstractString end

String(s::String) = s  # no constructor yet

# This should always be inlined
getptls() = ccall(:jl_get_ptls_states, Ptr{Void}, ())

include(m::Module, fname::String) = ccall(:jl_load_, Any, (Any, Any), m, fname)

eval(@nospecialize(e)) = eval(Main, e)
eval(m::Module, @nospecialize(e)) = ccall(:jl_toplevel_eval_in, Any, (Any, Any), m, e)

kwfunc(@nospecialize(f)) = ccall(:jl_get_keyword_sorter, Any, (Any,), f)

kwftype(@nospecialize(t)) = typeof(ccall(:jl_get_kwsorter, Any, (Any,), t))

mutable struct Box
    contents::Any
    Box(@nospecialize(x)) = new(x)
    Box() = new()
end

# constructors for built-in types

mutable struct WeakRef
    value
    WeakRef() = WeakRef(nothing)
    WeakRef(@nospecialize(v)) = ccall(:jl_gc_new_weakref_th, Ref{WeakRef},
                                      (Ptr{Void}, Any), getptls(), v)
end

TypeVar(n::Symbol) =
    ccall(:jl_new_typevar, Ref{TypeVar}, (Any, Any, Any), n, Union{}, Any)
TypeVar(n::Symbol, @nospecialize(ub)) =
    ccall(:jl_new_typevar, Ref{TypeVar}, (Any, Any, Any), n, Union{}, ub)
TypeVar(n::Symbol, @nospecialize(lb), @nospecialize(ub)) =
    ccall(:jl_new_typevar, Ref{TypeVar}, (Any, Any, Any), n, lb, ub)

UnionAll(v::TypeVar, @nospecialize(t)) = ccall(:jl_type_unionall, Any, (Any, Any), v, t)

Void() = nothing

(::Type{Tuple{}})() = () # Tuple{}()

struct VecElement{T}
    value::T
    VecElement{T}(value::T) where {T} = new(value) # disable converting constructor in Core
end
VecElement(arg::T) where {T} = VecElement{T}(arg)

# used by lowering of splicing unquote
splicedexpr(hd::Symbol, args::Array{Any,1}) = (e=Expr(hd); e.args=args; e)

_new(typ::Symbol, argty::Symbol) = eval(Core, :((::Type{$typ})(@nospecialize n::$argty) = $(Expr(:new, typ, :n))))
_new(:LabelNode, :Int)
_new(:GotoNode, :Int)
_new(:NewvarNode, :SlotNumber)
_new(:QuoteNode, :Any)
_new(:SSAValue, :Int)
eval(Core, :((::Type{LineNumberNode})(l::Int) = $(Expr(:new, :LineNumberNode, :l, nothing))))
eval(Core, :((::Type{LineNumberNode})(l::Int, @nospecialize(f)) = $(Expr(:new, :LineNumberNode, :l, :f))))
eval(Core, :((::Type{GlobalRef})(m::Module, s::Symbol) = $(Expr(:new, :GlobalRef, :m, :s))))
eval(Core, :((::Type{SlotNumber})(n::Int) = $(Expr(:new, :SlotNumber, :n))))
eval(Core, :((::Type{TypedSlot})(n::Int, @nospecialize(t)) = $(Expr(:new, :TypedSlot, :n, :t))))

Module(name::Symbol=:anonymous, std_imports::Bool=true) = ccall(:jl_f_new_module, Ref{Module}, (Any, Bool), name, std_imports)

Task(@nospecialize(f)) = ccall(:jl_new_task, Ref{Task}, (Any, Int), f, 0)

# simple convert for use by constructors of types in Core
# note that there is no actual conversion defined here,
# so the methods and ccall's in Core aren't permitted to use convert
convert(::Type{Any}, @nospecialize(x)) = x
convert(::Type{T}, x::T) where {T} = x
cconvert(::Type{T}, x) where {T} = convert(T, x)
unsafe_convert(::Type{T}, x::T) where {T} = x

const NTuple{N,T} = Tuple{Vararg{T,N}}

# primitive array constructors
Array{T,N}(d::NTuple{N,Int}) where {T,N} =
    ccall(:jl_new_array, Array{T,N}, (Any, Any), Array{T,N}, d)
Array{T,1}(d::NTuple{1,Int}) where {T} = Array{T,1}(getfield(d,1))
Array{T,2}(d::NTuple{2,Int}) where {T} = Array{T,2}(getfield(d,1), getfield(d,2))
Array{T,3}(d::NTuple{3,Int}) where {T} = Array{T,3}(getfield(d,1), getfield(d,2), getfield(d,3))
Array{T,N}(d::Vararg{Int,N}) where {T,N} = ccall(:jl_new_array, Array{T,N}, (Any, Any), Array{T,N}, d)
Array{T,1}(m::Int) where {T} = ccall(:jl_alloc_array_1d, Array{T,1}, (Any, Int), Array{T,1}, m)
Array{T,2}(m::Int, n::Int) where {T} =
    ccall(:jl_alloc_array_2d, Array{T,2}, (Any, Int, Int), Array{T,2}, m, n)
Array{T,3}(m::Int, n::Int, o::Int) where {T} =
    ccall(:jl_alloc_array_3d, Array{T,3}, (Any, Int, Int, Int), Array{T,3}, m, n, o)

Array{T}(d::NTuple{N,Int}) where {T,N} = Array{T,N}(d)
Array{T}(m::Int) where {T} = Array{T,1}(m)
Array{T}(m::Int, n::Int) where {T} = Array{T,2}(m, n)
Array{T}(m::Int, n::Int, o::Int) where {T} = Array{T,3}(m, n, o)

Array{T,1}() where {T} = Array{T,1}(0)

# primitive Symbol constructors
function Symbol(s::String)
    return ccall(:jl_symbol_n, Ref{Symbol}, (Ptr{UInt8}, Int),
                 ccall(:jl_string_ptr, Ptr{UInt8}, (Any,), s),
                 sizeof(s))
end
function Symbol(a::Array{UInt8,1})
    return ccall(:jl_symbol_n, Ref{Symbol}, (Ptr{UInt8}, Int),
                 ccall(:jl_array_ptr, Ptr{UInt8}, (Any,), a),
                 Intrinsics.arraylen(a))
end

# docsystem basics
macro doc(x...)
    atdoc(__source__, __module__, x...)
end
macro __doc__(x)
    Expr(:escape, Expr(:block, Expr(:meta, :doc), x))
end
macro doc_str(s)
    Expr(:escape, s)
end
atdoc     = (source, mod, str, expr) -> Expr(:escape, expr)
atdoc!(λ) = global atdoc = λ

# simple stand-alone print definitions for debugging
abstract type IO end
mutable struct CoreSTDOUT <: IO end
mutable struct CoreSTDERR <: IO end
const STDOUT = CoreSTDOUT()
const STDERR = CoreSTDERR()
io_pointer(::CoreSTDOUT) = Intrinsics.pointerref(Intrinsics.cglobal(:jl_uv_stdout, Ptr{Void}), 1, 1)
io_pointer(::CoreSTDERR) = Intrinsics.pointerref(Intrinsics.cglobal(:jl_uv_stderr, Ptr{Void}), 1, 1)

unsafe_write(io::IO, x::Ptr{UInt8}, nb::UInt) =
    (ccall(:jl_uv_puts, Void, (Ptr{Void}, Ptr{UInt8}, UInt), io_pointer(io), x, nb); nb)
unsafe_write(io::IO, x::Ptr{UInt8}, nb::Int) =
    (ccall(:jl_uv_puts, Void, (Ptr{Void}, Ptr{UInt8}, Int), io_pointer(io), x, nb); nb)
write(io::IO, x::UInt8) =
    (ccall(:jl_uv_putb, Void, (Ptr{Void}, UInt8), io_pointer(io), x); 1)
function write(io::IO, x::String)
    nb = sizeof(x)
    unsafe_write(io, ccall(:jl_string_ptr, Ptr{UInt8}, (Any,), x), nb)
    return nb
end

show(io::IO, @nospecialize x) = ccall(:jl_static_show, Void, (Ptr{Void}, Any), io_pointer(io), x)
print(io::IO, x::Char) = ccall(:jl_uv_putc, Void, (Ptr{Void}, Char), io_pointer(io), x)
print(io::IO, x::String) = (write(io, x); nothing)
print(io::IO, @nospecialize x) = show(io, x)
print(io::IO, @nospecialize(x), @nospecialize a...) = (print(io, x); print(io, a...))
println(io::IO) = (write(io, 0x0a); nothing) # 0x0a = '\n'
println(io::IO, @nospecialize x...) = (print(io, x...); println(io))

show(@nospecialize a) = show(STDOUT, a)
print(@nospecialize a...) = print(STDOUT, a...)
println(@nospecialize a...) = println(STDOUT, a...)

ccall(:jl_set_istopmod, Void, (Any, Bool), Core, true)


text:
module cosmosis

# double, array, grid

datablock_status = Int32
datablock = Ptr{Cvoid}

option_section = "module_options"

struct BlockError <: Exception
    code::datablock_status
    msg::String

    function BlockError(code::datablock_status)
        new(code, error_names[code])
    end
    function BlockError(code::datablock_status, msg)
        new(code, error_names[code] * ": " * msg)
    end
end
Base.showerror(io::IO, e::BlockError) = print(io, e.msg)

error_names = [
    "CosmoSIS: Success",
    "CosmoSIS: Datablock is Null",
    "CosmoSIS: Section name is null",
    "CosmoSIS: Section not found",
    "CosmoSIS: Name is Null",
    "CosmoSIS: Name not found",
    "CosmoSIS: Name already exists",
    "CosmoSIS: Value is null",
    "CosmoSIS: Wrong value type",
    "CosmoSIS: Memory allocation error",
    "CosmoSIS: Size is null",
    "CosmoSIS: Size not positive",
    "CosmoSIS: Size is insufficient",
    "CosmoSIS: Dimensionality not positive",
    "CosmoSIS: Number of dimensions too large",
    "CosmoSIS: Dimensions do notmarch",
    "CosmoSIS: Extents are null",
    "CosmoSIS: Extents do not match dimension",
    "CosmoSIS: Internal logic error: please open an issue"
]

function make_datablock()
    res = ccall((:make_c_datablock, "libcosmosis.so"), datablock, ())
    res
end

function put_int(block::datablock, section, name, value)
    res = ccall((:c_datablock_put_int, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Int32),
            block, section, name, value)
    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * "name was " * string(name) * "value was " * string(value)))
    end
    res
end

function get_int(block, section, name)
    value = Ref{Int32}()
    res = ccall((:c_datablock_get_int, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Ref{Int32}),
            block, section, name, value)
    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end
    value[]
end

function put_double(block::datablock, section, name, value)
    res = ccall((:c_datablock_put_double, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Cdouble),
            block, section, name, value)
    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end
    res
end

function get_double(block, section, name)
    value = Ref{Cdouble}()
    res = ccall((:c_datablock_get_double, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Ref{Cdouble}),
            block, section, name, value)
    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name) * ", value was " * string(value) ))
    end
    value[]
end

function put_bool(block::datablock, section, name, value)
    if ((value!=0) && (value!=1))
        throw(BlockError("Bool values in Julia must be 0 or 1"))
    end
    if (value==0)
        uint_value = UInt8(0)
    elseif (value==1)
        uint_value = UInt8(1)
    else
        throw(ArgumentError("Bool values in Julia must be 0 or 1. You passed: " * string(value)))
    end
    res = ccall((:c_datablock_put_bool, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, UInt8),
            block, section, name, uint_value)
    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name) * ", value was " * string(value) ))
    end
    res
end

function get_bool(block, section, name)
    value = Ref{UInt8}()
    res = ccall((:c_datablock_get_bool, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Ref{UInt8}),
            block, section, name, value)
    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end
    value[]
end

function get_string(block, section, name)
    value = Ref{Cstring}()
    res = ccall((:c_datablock_get_string, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Ref{Cstring}),
            block, section, name, value)
    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end
    unsafe_string(value[])
end

function put_string(block, section, name, value)
    res = ccall((:c_datablock_put_string, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Cstring),
            block, section, name, value)
    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end
    res
end

function put_double_array_nd(block, section, name, value)

    ndim = ndims(value)
    extents = convert(Array{Int32}, collect(size(value)))

    res = ccall((:c_datablock_put_double_array, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Ptr{Cdouble}, Int32, Ptr{Int32}),
            block, section, name, vec(value), ndim, extents)
    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end
    res
end

function get_double_array_nd(block, section, name)

    ndim_ptr = Ref{Int32}()
    res = ccall((:c_datablock_get_array_ndim, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Ref{Int32}),
            block, section, name, ndim_ptr)

    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end

    ndim = ndim_ptr[]

    extents = Array{Int32}(undef, ndim)

    res = ccall((:c_datablock_get_double_array_shape, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Int32, Ptr{Int32}),
            block, section, name, ndim, extents)

    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end

    t = tuple(extents...)

    value = Array{Float64}(undef, t)

    res = ccall((:c_datablock_get_double_array, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Ptr{Cdouble}, Int32, Ptr{Int32}),
            block, section, name, value, ndim, extents)

    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end

    value

end

function put_int_array_nd(block, section, name, value)

    ndim = ndims(value)
    extents = convert(Array{Int32}, collect(size(value)))

    res = ccall((:c_datablock_put_int_array, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Ptr{Int32}, Int32, Ptr{Int32}),
            block, section, name, vec(value), ndim, extents)
    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end
    res
end

function get_int_array_nd(block, section, name)

    ndim_ptr = Ref{Int32}()
    res = ccall((:c_datablock_get_array_ndim, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Ref{Int32}),
            block, section, name, ndim_ptr)

    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end

    ndim = ndim_ptr[]

    extents = Array{Int32}(undef, ndim)

    res = ccall((:c_datablock_get_int_array_shape, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Int32, Ptr{Int32}),
            block, section, name, ndim, extents)

    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end

    t = tuple(extents...)

    value = Array{Int32}(undef, t)

    res = ccall((:c_datablock_get_int_array, "libcosmosis.so"),
            datablock_status,
            (datablock, Cstring, Cstring, Ptr{Int32}, Int32, Ptr{Int32}),
            block, section, name, value, ndim, extents)

    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end

    value

end

function put_double_array_1d(block, section, name, value)

    sz = Int32(length(value))

    res = ccall((:c_datablock_put_double_array_1d, "libcosmosis.so"),
        datablock_status,
        (datablock, Cstring, Cstring, Ptr{Float64}, Int32),
        block, section, name, value, sz)

    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end

end

function get_double_array_1d(block, section, name)

    sz = ccall((:c_datablock_get_array_length, "libcosmosis.so"),
        Int32,
        (datablock, Cstring, Cstring),
        block, section, name)

    println("size = ", sz)
    if (sz<0)
        throw(BlockError(8, "section was " * string(section) * ", name was " * string(name)))
    end

    sz_ptr = Ref{Int32}()
    value = Array{Float64}(undef, sz)

    println("calling")
    res = ccall((:c_datablock_get_double_array_1d_preallocated, "libcosmosis.so"),
        datablock_status,
        (datablock, Cstring, Cstring, Ptr{Float64}, Ref{Int32}, Int32),
        block, section, name, value, sz_ptr, sz)
    println("out")

    if (res!=0)
        throw(BlockError(res, "section was " * string(section) * ", name was " * string(name)))
    end

    value
end

end

max_stars_repo_name: annis/cosmosis

max_issues_repo_name: annis/cosmosis

max_forks_repo_name: annis/cosmosis


text:
# This file is auto-generated by AWSMetadata.jl
using AWS
using AWS.AWSServices: ssm_incidents
using AWS.Compat
using AWS.UUIDs

"""
    create_replication_set(regions)
    create_replication_set(regions, params::Dict{String,<:Any})

A replication set replicates and encrypts your data to the provided Regions with the
provided KMS key.

# Arguments
- `regions`: The Regions that Incident Manager replicates your data to. You can have up to
  three Regions in your replication set.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientToken"`: A token ensuring that the operation is called only once with the
  specified details.
"""
function create_replication_set(regions; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "POST",
        "/createReplicationSet",
        Dict{String,Any}("regions" => regions, "clientToken" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_replication_set(
    regions, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/createReplicationSet",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}("regions" => regions, "clientToken" => string(uuid4())),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    create_response_plan(incident_template, name)
    create_response_plan(incident_template, name, params::Dict{String,<:Any})

Creates a response plan that automates the initial response to incidents. A response plan
engages contacts, starts chat channel collaboration, and initiates runbooks at the
beginning of an incident.

# Arguments
- `incident_template`: Details used to create an incident when using this response plan.
- `name`: The short format name of the response plan. Can't include spaces.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"actions"`: The actions that the response plan starts at the beginning of an incident.
- `"chatChannel"`: The Chatbot chat channel used for collaboration during an incident.
- `"clientToken"`: A token ensuring that the operation is called only once with the
  specified details.
- `"displayName"`: The long format of the response plan name. This field can contain spaces.
- `"engagements"`: The contacts and escalation plans that the response plan engages during
  an incident.
- `"tags"`: A list of tags that you are adding to the response plan.
"""
function create_response_plan(
    incidentTemplate, name; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/createResponsePlan",
        Dict{String,Any}(
            "incidentTemplate" => incidentTemplate,
            "name" => name,
            "clientToken" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_response_plan(
    incidentTemplate,
    name,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/createResponsePlan",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "incidentTemplate" => incidentTemplate,
                    "name" => name,
                    "clientToken" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    create_timeline_event(event_data, event_time, event_type, incident_record_arn)
    create_timeline_event(event_data, event_time, event_type, incident_record_arn, params::Dict{String,<:Any})

Creates a custom timeline event on the incident details page of an incident record.
Timeline events are automatically created by Incident Manager, marking key moment during an
incident. You can create custom timeline events to mark important events that are
automatically detected by Incident Manager.

# Arguments
- `event_data`: A short description of the event as a valid JSON string. There is no other
  schema imposed.
- `event_time`: The time that the event occurred.
- `event_type`: The type of the event. You can create timeline events of type Custom Event.
- `incident_record_arn`: The Amazon Resource Name (ARN) of the incident record to which the
  event will be added.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientToken"`: A token ensuring that the action is called only once with the specified
  details.
"""
function create_timeline_event(
    eventData,
    eventTime,
    eventType,
    incidentRecordArn;
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/createTimelineEvent",
        Dict{String,Any}(
            "eventData" => eventData,
            "eventTime" => eventTime,
            "eventType" => eventType,
            "incidentRecordArn" => incidentRecordArn,
            "clientToken" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function create_timeline_event(
    eventData,
    eventTime,
    eventType,
    incidentRecordArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/createTimelineEvent",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "eventData" => eventData,
                    "eventTime" => eventTime,
                    "eventType" => eventType,
                    "incidentRecordArn" => incidentRecordArn,
                    "clientToken" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_incident_record(arn)
    delete_incident_record(arn, params::Dict{String,<:Any})

Delete an incident record from Incident Manager.

# Arguments
- `arn`: The Amazon Resource Name (ARN) of the incident record you are deleting.

"""
function delete_incident_record(arn; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "POST",
        "/deleteIncidentRecord",
        Dict{String,Any}("arn" => arn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_incident_record(
    arn, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/deleteIncidentRecord",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("arn" => arn), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_replication_set(arn)
    delete_replication_set(arn, params::Dict{String,<:Any})

Deletes all Regions in your replication set. Deleting the replication set deletes all
Incident Manager data.

# Arguments
- `arn`: The Amazon Resource Name (ARN) of the replication set you're deleting.

"""
function delete_replication_set(arn; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "POST",
        "/deleteReplicationSet",
        Dict{String,Any}("arn" => arn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_replication_set(
    arn, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/deleteReplicationSet",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("arn" => arn), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_resource_policy(policy_id, resource_arn)
    delete_resource_policy(policy_id, resource_arn, params::Dict{String,<:Any})

Deletes the resource policy that Resource Access Manager uses to share your Incident
Manager resource.

# Arguments
- `policy_id`: The ID of the resource policy you're deleting.
- `resource_arn`: The Amazon Resource Name (ARN) of the resource you're deleting the policy
  from.

"""
function delete_resource_policy(
    policyId, resourceArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/deleteResourcePolicy",
        Dict{String,Any}("policyId" => policyId, "resourceArn" => resourceArn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_resource_policy(
    policyId,
    resourceArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/deleteResourcePolicy",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}("policyId" => policyId, "resourceArn" => resourceArn),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_response_plan(arn)
    delete_response_plan(arn, params::Dict{String,<:Any})

Deletes the specified response plan. Deleting a response plan stops all linked CloudWatch
alarms and EventBridge events from creating an incident with this response plan.

# Arguments
- `arn`: The Amazon Resource Name (ARN) of the response plan.

"""
function delete_response_plan(arn; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "POST",
        "/deleteResponsePlan",
        Dict{String,Any}("arn" => arn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_response_plan(
    arn, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/deleteResponsePlan",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("arn" => arn), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    delete_timeline_event(event_id, incident_record_arn)
    delete_timeline_event(event_id, incident_record_arn, params::Dict{String,<:Any})

Deletes a timeline event from an incident.

# Arguments
- `event_id`: The ID of the event you are updating. You can find this by using
  ListTimelineEvents.
- `incident_record_arn`: The Amazon Resource Name (ARN) of the incident that includes the
  timeline event.

"""
function delete_timeline_event(
    eventId, incidentRecordArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/deleteTimelineEvent",
        Dict{String,Any}("eventId" => eventId, "incidentRecordArn" => incidentRecordArn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function delete_timeline_event(
    eventId,
    incidentRecordArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/deleteTimelineEvent",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "eventId" => eventId, "incidentRecordArn" => incidentRecordArn
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_incident_record(arn)
    get_incident_record(arn, params::Dict{String,<:Any})

Returns the details for the specified incident record.

# Arguments
- `arn`: The Amazon Resource Name (ARN) of the incident record.

"""
function get_incident_record(arn; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "GET",
        "/getIncidentRecord",
        Dict{String,Any}("arn" => arn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_incident_record(
    arn, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "GET",
        "/getIncidentRecord",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("arn" => arn), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_replication_set(arn)
    get_replication_set(arn, params::Dict{String,<:Any})

Retrieve your Incident Manager replication set.

# Arguments
- `arn`: The Amazon Resource Name (ARN) of the replication set you want to retrieve.

"""
function get_replication_set(arn; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "GET",
        "/getReplicationSet",
        Dict{String,Any}("arn" => arn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_replication_set(
    arn, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "GET",
        "/getReplicationSet",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("arn" => arn), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_resource_policies(resource_arn)
    get_resource_policies(resource_arn, params::Dict{String,<:Any})

Retrieves the resource policies attached to the specified response plan.

# Arguments
- `resource_arn`: The Amazon Resource Name (ARN) of the response plan with the attached
  resource policy.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The maximum number of resource policies to display per page of results.
- `"nextToken"`: The pagination token to continue to the next page of results.
"""
function get_resource_policies(
    resourceArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/getResourcePolicies",
        Dict{String,Any}("resourceArn" => resourceArn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_resource_policies(
    resourceArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/getResourcePolicies",
        Dict{String,Any}(
            mergewith(_merge, Dict{String,Any}("resourceArn" => resourceArn), params)
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_response_plan(arn)
    get_response_plan(arn, params::Dict{String,<:Any})

Retrieves the details of the specified response plan.

# Arguments
- `arn`: The Amazon Resource Name (ARN) of the response plan.

"""
function get_response_plan(arn; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "GET",
        "/getResponsePlan",
        Dict{String,Any}("arn" => arn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_response_plan(
    arn, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "GET",
        "/getResponsePlan",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("arn" => arn), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    get_timeline_event(event_id, incident_record_arn)
    get_timeline_event(event_id, incident_record_arn, params::Dict{String,<:Any})

Retrieves a timeline event based on its ID and incident record.

# Arguments
- `event_id`: The ID of the event. You can get an event's ID when you create it, or by
  using ListTimelineEvents.
- `incident_record_arn`: The Amazon Resource Name (ARN) of the incident that includes the
  timeline event.

"""
function get_timeline_event(
    eventId, incidentRecordArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "GET",
        "/getTimelineEvent",
        Dict{String,Any}("eventId" => eventId, "incidentRecordArn" => incidentRecordArn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function get_timeline_event(
    eventId,
    incidentRecordArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "GET",
        "/getTimelineEvent",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "eventId" => eventId, "incidentRecordArn" => incidentRecordArn
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    list_incident_records()
    list_incident_records(params::Dict{String,<:Any})

Lists all incident records in your account. Use this command to retrieve the Amazon
Resource Name (ARN) of the incident record you want to update.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"filters"`: Filters the list of incident records through which you are searching. You
  can filter on the following keys:    creationTime     impact     status     createdBy
  Note the following when deciding how to use Filters:   If you don't specify a Filter, the
  response includes all incident records.   If you specify more than one filter in a single
  request, the response returns incident records that match all filters.   If you specify a
  filter with more than one value, the response returns incident records that match any of
  the values provided.
- `"maxResults"`: The maximum number of results per page.
- `"nextToken"`: The pagination token to continue to the next page of results.
"""
function list_incident_records(; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "POST",
        "/listIncidentRecords";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_incident_records(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/listIncidentRecords",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    list_related_items(incident_record_arn)
    list_related_items(incident_record_arn, params::Dict{String,<:Any})

List all related items for an incident record.

# Arguments
- `incident_record_arn`: The Amazon Resource Name (ARN) of the incident record containing
  the listed related items.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The maximum number of related items per page.
- `"nextToken"`: The pagination token to continue to the next page of results.
"""
function list_related_items(
    incidentRecordArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/listRelatedItems",
        Dict{String,Any}("incidentRecordArn" => incidentRecordArn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_related_items(
    incidentRecordArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/listRelatedItems",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("incidentRecordArn" => incidentRecordArn), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    list_replication_sets()
    list_replication_sets(params::Dict{String,<:Any})

Lists details about the replication set configured in your account.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The maximum number of results per page.
- `"nextToken"`: The pagination token to continue to the next page of results.
"""
function list_replication_sets(; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "POST",
        "/listReplicationSets";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_replication_sets(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/listReplicationSets",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    list_response_plans()
    list_response_plans(params::Dict{String,<:Any})

Lists all response plans in your account.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"maxResults"`: The maximum number of response plans per page.
- `"nextToken"`: The pagination token to continue to the next page of results.
"""
function list_response_plans(; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "POST", "/listResponsePlans"; aws_config=aws_config, feature_set=SERVICE_FEATURE_SET
    )
end
function list_response_plans(
    params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/listResponsePlans",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    list_tags_for_resource(resource_arn)
    list_tags_for_resource(resource_arn, params::Dict{String,<:Any})

Lists the tags that are attached to the specified response plan.

# Arguments
- `resource_arn`: The Amazon Resource Name (ARN) of the response plan.

"""
function list_tags_for_resource(
    resourceArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "GET",
        "/tags/$(resourceArn)";
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_tags_for_resource(
    resourceArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "GET",
        "/tags/$(resourceArn)",
        params;
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    list_timeline_events(incident_record_arn)
    list_timeline_events(incident_record_arn, params::Dict{String,<:Any})

Lists timeline events for the specified incident record.

# Arguments
- `incident_record_arn`: The Amazon Resource Name (ARN) of the incident that includes the
  timeline event.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"filters"`: Filters the timeline events based on the provided conditional values. You
  can filter timeline events using the following keys:    eventTime     eventType    Note the
  following when deciding how to use Filters:   If you don't specify a Filter, the response
  includes all timeline events.   If you specify more than one filter in a single request,
  the response returns timeline events that match all filters.   If you specify a filter with
  more than one value, the response returns timeline events that match any of the values
  provided.
- `"maxResults"`: The maximum number of results per page.
- `"nextToken"`: The pagination token to continue to the next page of results.
- `"sortBy"`: Sort by the specified key value pair.
- `"sortOrder"`: Sorts the order of timeline events by the value specified in the sortBy
  field.
"""
function list_timeline_events(
    incidentRecordArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/listTimelineEvents",
        Dict{String,Any}("incidentRecordArn" => incidentRecordArn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function list_timeline_events(
    incidentRecordArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/listTimelineEvents",
        Dict{String,Any}(
            mergewith(
                _merge, Dict{String,Any}("incidentRecordArn" => incidentRecordArn), params
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    put_resource_policy(policy, resource_arn)
    put_resource_policy(policy, resource_arn, params::Dict{String,<:Any})

Adds a resource policy to the specified response plan.

# Arguments
- `policy`: Details of the resource policy.
- `resource_arn`: The Amazon Resource Name (ARN) of the response plan you're adding the
  resource policy to.

"""
function put_resource_policy(
    policy, resourceArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/putResourcePolicy",
        Dict{String,Any}("policy" => policy, "resourceArn" => resourceArn);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function put_resource_policy(
    policy,
    resourceArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/putResourcePolicy",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}("policy" => policy, "resourceArn" => resourceArn),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    start_incident(response_plan_arn)
    start_incident(response_plan_arn, params::Dict{String,<:Any})

Used to start an incident from CloudWatch alarms, EventBridge events, or manually.

# Arguments
- `response_plan_arn`: The Amazon Resource Name (ARN) of the response plan that pre-defines
  summary, chat channels, Amazon SNS topics, runbooks, title, and impact of the incident.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientToken"`: A token ensuring that the operation is called only once with the
  specified details.
- `"impact"`: Defines the impact to the customers. Providing an impact overwrites the
  impact provided by a response plan.  Possible impacts:     1 - Critical impact, this
  typically relates to full application failure that impacts many to all customers.     2 -
  High impact, partial application failure with impact to many customers.    3 - Medium
  impact, the application is providing reduced service to customers.    4 - Low impact,
  customer might aren't impacted by the problem yet.    5 - No impact, customers aren't
  currently impacted but urgent action is needed to avoid impact.
- `"relatedItems"`: Add related items to the incident for other responders to use. Related
  items are AWS resources, external links, or files uploaded to an Amazon S3 bucket.
- `"title"`: Provide a title for the incident. Providing a title overwrites the title
  provided by the response plan.
- `"triggerDetails"`: Details of what created the incident record in Incident Manager.
"""
function start_incident(responsePlanArn; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "POST",
        "/startIncident",
        Dict{String,Any}(
            "responsePlanArn" => responsePlanArn, "clientToken" => string(uuid4())
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function start_incident(
    responsePlanArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/startIncident",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "responsePlanArn" => responsePlanArn, "clientToken" => string(uuid4())
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    tag_resource(resource_arn, tags)
    tag_resource(resource_arn, tags, params::Dict{String,<:Any})

Adds a tag to a response plan.

# Arguments
- `resource_arn`: The Amazon Resource Name (ARN) of the response plan you're adding the
  tags to.
- `tags`: A list of tags that you are adding to the response plan.

"""
function tag_resource(resourceArn, tags; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "POST",
        "/tags/$(resourceArn)",
        Dict{String,Any}("tags" => tags);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function tag_resource(
    resourceArn,
    tags,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/tags/$(resourceArn)",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("tags" => tags), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    untag_resource(resource_arn, tag_keys)
    untag_resource(resource_arn, tag_keys, params::Dict{String,<:Any})

Removes a tag from a resource.

# Arguments
- `resource_arn`: The Amazon Resource Name (ARN) of the response plan you're removing a tag
  from.
- `tag_keys`: The name of the tag you're removing from the response plan.

"""
function untag_resource(
    resourceArn, tagKeys; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "DELETE",
        "/tags/$(resourceArn)",
        Dict{String,Any}("tagKeys" => tagKeys);
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function untag_resource(
    resourceArn,
    tagKeys,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "DELETE",
        "/tags/$(resourceArn)",
        Dict{String,Any}(mergewith(_merge, Dict{String,Any}("tagKeys" => tagKeys), params));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_deletion_protection(arn, deletion_protected)
    update_deletion_protection(arn, deletion_protected, params::Dict{String,<:Any})

Update deletion protection to either allow or deny deletion of the final Region in a
replication set.

# Arguments
- `arn`: The Amazon Resource Name (ARN) of the replication set you're updating.
- `deletion_protected`: Details if deletion protection is enabled or disabled in your
  account.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientToken"`: A token ensuring that the operation is called only once with the
  specified details.
"""
function update_deletion_protection(
    arn, deletionProtected; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/updateDeletionProtection",
        Dict{String,Any}(
            "arn" => arn,
            "deletionProtected" => deletionProtected,
            "clientToken" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_deletion_protection(
    arn,
    deletionProtected,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/updateDeletionProtection",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "arn" => arn,
                    "deletionProtected" => deletionProtected,
                    "clientToken" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_incident_record(arn)
    update_incident_record(arn, params::Dict{String,<:Any})

Update the details of an incident record. You can use this operation to update an incident
record from the defined chat channel. For more information about using actions in chat
channels, see Interacting through chat.

# Arguments
- `arn`: The Amazon Resource Name (ARN) of the incident record you are updating.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"chatChannel"`: The Chatbot chat channel where responders can collaborate.
- `"clientToken"`: A token that ensures that the operation is called only once with the
  specified details.
- `"impact"`: Defines the impact of the incident to customers and applications. Providing
  an impact overwrites the impact provided by the response plan.  Possible impacts:     1 -
  Critical impact, full application failure that impacts many to all customers.     2 - High
  impact, partial application failure with impact to many customers.    3 - Medium impact,
  the application is providing reduced service to customers.    4 - Low impact, customer
  aren't impacted by the problem yet.    5 - No impact, customers aren't currently impacted
  but urgent action is needed to avoid impact.
- `"notificationTargets"`: The Amazon SNS targets that are notified when updates are made
  to an incident. Using multiple SNS topics creates redundancy in the event that a Region is
  down during the incident.
- `"status"`: The status of the incident. An incident can be Open or Resolved.
- `"summary"`: A longer description of what occurred during the incident.
- `"title"`: A brief description of the incident.
"""
function update_incident_record(arn; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "POST",
        "/updateIncidentRecord",
        Dict{String,Any}("arn" => arn, "clientToken" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_incident_record(
    arn, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/updateIncidentRecord",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}("arn" => arn, "clientToken" => string(uuid4())),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_related_items(incident_record_arn, related_items_update)
    update_related_items(incident_record_arn, related_items_update, params::Dict{String,<:Any})

Add or remove related items from the related items tab of an incident record.

# Arguments
- `incident_record_arn`: The Amazon Resource Name (ARN) of the incident record containing
  the related items you are updating.
- `related_items_update`: Details about the item you are adding or deleting.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientToken"`: A token ensuring that the operation is called only once with the
  specified details.
"""
function update_related_items(
    incidentRecordArn, relatedItemsUpdate; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/updateRelatedItems",
        Dict{String,Any}(
            "incidentRecordArn" => incidentRecordArn,
            "relatedItemsUpdate" => relatedItemsUpdate,
            "clientToken" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_related_items(
    incidentRecordArn,
    relatedItemsUpdate,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/updateRelatedItems",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "incidentRecordArn" => incidentRecordArn,
                    "relatedItemsUpdate" => relatedItemsUpdate,
                    "clientToken" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_replication_set(actions, arn)
    update_replication_set(actions, arn, params::Dict{String,<:Any})

Add or delete Regions from your replication set.

# Arguments
- `actions`: An action to add or delete a Region.
- `arn`: The Amazon Resource Name (ARN) of the replication set you're updating.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientToken"`: A token ensuring that the operation is called only once with the
  specified details.
"""
function update_replication_set(
    actions, arn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/updateReplicationSet",
        Dict{String,Any}(
            "actions" => actions, "arn" => arn, "clientToken" => string(uuid4())
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_replication_set(
    actions,
    arn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/updateReplicationSet",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "actions" => actions, "arn" => arn, "clientToken" => string(uuid4())
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_response_plan(arn)
    update_response_plan(arn, params::Dict{String,<:Any})

Updates the specified response plan.

# Arguments
- `arn`: The Amazon Resource Name (ARN) of the response plan.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"actions"`: The actions that this response plan takes at the beginning of an incident.
- `"chatChannel"`: The Chatbot chat channel used for collaboration during an incident. Use
  the empty structure to remove the chat channel from the response plan.
- `"clientToken"`: A token ensuring that the operation is called only once with the
  specified details.
- `"displayName"`: The long format name of the response plan. The display name can't
  contain spaces.
- `"engagements"`: The contacts and escalation plans that Incident Manager engages at the
  start of the incident.
- `"incidentTemplateDedupeString"`: The string Incident Manager uses to prevent duplicate
  incidents from being created by the same incident in the same account.
- `"incidentTemplateImpact"`: Defines the impact to the customers. Providing an impact
  overwrites the impact provided by a response plan.  Possible impacts:     5 - Severe impact
     4 - High impact    3 - Medium impact    2 - Low impact    1 - No impact
- `"incidentTemplateNotificationTargets"`: The Amazon SNS targets that are notified when
  updates are made to an incident.
- `"incidentTemplateSummary"`: A brief summary of the incident. This typically contains
  what has happened, what's currently happening, and next steps.
- `"incidentTemplateTitle"`: The short format name of the incident. The title can't contain
  spaces.
"""
function update_response_plan(arn; aws_config::AbstractAWSConfig=global_aws_config())
    return ssm_incidents(
        "POST",
        "/updateResponsePlan",
        Dict{String,Any}("arn" => arn, "clientToken" => string(uuid4()));
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_response_plan(
    arn, params::AbstractDict{String}; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/updateResponsePlan",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}("arn" => arn, "clientToken" => string(uuid4())),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end

"""
    update_timeline_event(event_id, incident_record_arn)
    update_timeline_event(event_id, incident_record_arn, params::Dict{String,<:Any})

Updates a timeline event. You can update events of type Custom Event.

# Arguments
- `event_id`: The ID of the event you are updating. You can find this by using
  ListTimelineEvents.
- `incident_record_arn`: The Amazon Resource Name (ARN) of the incident that includes the
  timeline event.

# Optional Parameters
Optional parameters can be passed as a `params::Dict{String,<:Any}`. Valid keys are:
- `"clientToken"`: A token ensuring that the operation is called only once with the
  specified details.
- `"eventData"`: A short description of the event.
- `"eventTime"`: The time that the event occurred.
- `"eventType"`: The type of the event. You can update events of type Custom Event.
"""
function update_timeline_event(
    eventId, incidentRecordArn; aws_config::AbstractAWSConfig=global_aws_config()
)
    return ssm_incidents(
        "POST",
        "/updateTimelineEvent",
        Dict{String,Any}(
            "eventId" => eventId,
            "incidentRecordArn" => incidentRecordArn,
            "clientToken" => string(uuid4()),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end
function update_timeline_event(
    eventId,
    incidentRecordArn,
    params::AbstractDict{String};
    aws_config::AbstractAWSConfig=global_aws_config(),
)
    return ssm_incidents(
        "POST",
        "/updateTimelineEvent",
        Dict{String,Any}(
            mergewith(
                _merge,
                Dict{String,Any}(
                    "eventId" => eventId,
                    "incidentRecordArn" => incidentRecordArn,
                    "clientToken" => string(uuid4()),
                ),
                params,
            ),
        );
        aws_config=aws_config,
        feature_set=SERVICE_FEATURE_SET,
    )
end


text:
using Documenter, Flatten

makedocs(
    sitename = "Flatten.jl",
)

deploydocs(
    repo = "github.com/rafaqz/Flatten.jl.git",
)


text:
#-------------------------------------------------------------------
#* EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC.
#*
#* This LIBRARY is free software; you can distribute it and/or modify
#* it under the therms of the ALSOC FREE LICENSE as available at
#* http://www.enq.ufrgs.br/alsoc.
#*
#* EMSO Copyright (C) 2004 - 2007 ALSOC, original code
#* from http://www.rps.eng.br Copyright (C) 2002-2004.
#* All rights reserved.
#*
#* EMSO is distributed under the therms of the ALSOC LICENSE as
#* available at http://www.enq.ufrgs.br/alsoc.
#*--------------------------------------------------------------------
#* Author: Gerson Balbueno Bicca
#* $Id: HairpinIncr.mso								$
#*------------------------------------------------------------------
type HairpinIncr_basic
	HairpinIncr_basic()=begin
		PP=outers.PP
		NComp=outers.NComp
		N=outers.N
		Npoints=outers.Npoints
		Pi=outers.Pi
		DoInner=outers.DoInner
		DiInner=outers.DiInner
		DiOuter=outers.DiOuter
		Lpipe=outers.Lpipe
		Kwall=outers.Kwall
		Rfi=outers.Rfi
		Rfo=outers.Rfo
		new(
			DanaPlugin(Dict{Symbol,Any}(
				:Brief=>"External Physical Properties",
				:Type=>"PP"
			)),
			DanaInteger(Dict{Symbol,Any}(
				:Brief=>"Number of Components"
			)),
			DanaInteger(Dict{Symbol,Any}(
				:Brief=>"Number of zones",
				:Default=>2
			)),
			DanaInteger(Dict{Symbol,Any}(
				:Brief=>"Number of incremental points",
				:Default=>3
			)),
			fill(molweight(Dict{Symbol,Any}(
				:Brief=>"Component Mol Weight"
			)),(NComp)),
			DanaSwitcher(Dict{Symbol,Any}(
				:Brief=>"Flag for Fluid Alocation ",
				:Valid=>["outer","inner"],
				:Default=>"outer"
			)),
			DanaSwitcher(Dict{Symbol,Any}(
				:Brief=>"Inner Flow Regime ",
				:Valid=>["laminar","transition","turbulent"],
				:Default=>"laminar"
			)),
			DanaSwitcher(Dict{Symbol,Any}(
				:Brief=>"Outer Flow Regime ",
				:Valid=>["laminar","transition","turbulent"],
				:Default=>"laminar"
			)),
			DanaSwitcher(Dict{Symbol,Any}(
				:Brief=>"Heat Transfer Correlation in Laminar Flow for the Inner Side",
				:Valid=>["Hausen","Schlunder"],
				:Default=>"Hausen"
			)),
			DanaSwitcher(Dict{Symbol,Any}(
				:Brief=>"Heat Transfer Correlation in Transition Flow for the Inner Side",
				:Valid=>["Gnielinski","Hausen"],
				:Default=>"Gnielinski"
			)),
			DanaSwitcher(Dict{Symbol,Any}(
				:Brief=>"Heat Transfer Correlation in Turbulent Flow for the Inner Side",
				:Valid=>["Petukhov","SiederTate"],
				:Default=>"Petukhov"
			)),
			DanaSwitcher(Dict{Symbol,Any}(
				:Brief=>"Heat Transfer Correlation in Laminar Flow for the Outer Side",
				:Valid=>["Hausen","Schlunder"],
				:Default=>"Hausen"
			)),
			DanaSwitcher(Dict{Symbol,Any}(
				:Brief=>"Heat Transfer Correlation in Transition Flow for the OuterSide",
				:Valid=>["Gnielinski","Hausen"],
				:Default=>"Gnielinski"
			)),
			DanaSwitcher(Dict{Symbol,Any}(
				:Brief=>"Heat Transfer Correlation in Turbulent Flow for the Outer Side",
				:Valid=>["Petukhov","SiederTate"],
				:Default=>"Petukhov"
			)),
			constant(Dict{Symbol,Any}(
				:Brief=>"Pi Number",
				:Default=>3.14159265,
				:Symbol=>"\\pi"
			)),
			length(Dict{Symbol,Any}(
				:Brief=>"Outside Diameter of Inner Pipe",
				:Lower=>1e-6
			)),
			length(Dict{Symbol,Any}(
				:Brief=>"Inside Diameter of Inner Pipe",
				:Lower=>1e-10
			)),
			length(Dict{Symbol,Any}(
				:Brief=>"Inside Diameter of Outer pipe",
				:Lower=>1e-10
			)),
			length(Dict{Symbol,Any}(
				:Brief=>"Effective Tube Length of one segment of Pipe",
				:Lower=>0.1,
				:Symbol=>"L_{pipe}"
			)),
			conductivity(Dict{Symbol,Any}(
				:Brief=>"Tube Wall Material Thermal Conductivity",
				:Default=>1.0,
				:Symbol=>"K_{wall}"
			)),
			positive(Dict{Symbol,Any}(
				:Brief=>"Inside Fouling Resistance",
				:Unit=>"m^2*K/kW",
				:Default=>1e-6,
				:Lower=>0
			)),
			positive(Dict{Symbol,Any}(
				:Brief=>"Outside Fouling Resistance",
				:Unit=>"m^2*K/kW",
				:Default=>1e-6,
				:Lower=>0
			)),
			stream(Dict{Symbol,Any}(
				:Brief=>"Inlet Inner Stream",
				:PosX=>0,
				:PosY=>0.5225,
				:Symbol=>"_{inInner}"
			)),
			stream(Dict{Symbol,Any}(
				:Brief=>"Inlet Outer Stream",
				:PosX=>0.2805,
				:PosY=>0,
				:Symbol=>"_{inOuter}"
			)),
			streamPH(Dict{Symbol,Any}(
				:Brief=>"Outlet Inner Stream",
				:PosX=>1,
				:PosY=>0.5225,
				:Symbol=>"_{outInner}"
			)),
			streamPH(Dict{Symbol,Any}(
				:Brief=>"Outlet Outer Stream",
				:PosX=>0.7264,
				:PosY=>1,
				:Symbol=>"_{outOuter}"
			)),
			Details_Main(Dict{Symbol,Any}(
				:Brief=>"Some Details in the Heat Exchanger",
				:Symbol=>" "
			)),
			Main_Hairpin(Dict{Symbol,Any}(
				:Brief=>"Inner Side of the Heat Exchanger",
				:Symbol=>"_{Inner}"
			)),
			Main_Hairpin(Dict{Symbol,Any}(
				:Brief=>"Outer Side of the Heat Exchanger",
				:Symbol=>"_{Outer}"
			)),
			fill(length(Dict{Symbol,Any}(
				:Brief=>"Incremental Tube Length",
				:Symbol=>"L_{incr}"
			)),(Npoints)),
			[
				:(Outer.Properties.Average.T(1:N) = 0.5*Outer.HeatTransfer.Tlocal(1:N) + 0.5*Outer.HeatTransfer.Tlocal(2:Npoints)),
				:(Inner.Properties.Average.T(1:N) = 0.5*Inner.HeatTransfer.Tlocal(1:N) + 0.5*Inner.HeatTransfer.Tlocal(2:Npoints)),
				:(Outer.Properties.Average.P(1:N) = 0.5*Outer.PressureDrop.Plocal(1:N) + 0.5*Outer.PressureDrop.Plocal(2:Npoints)),
				:(Inner.Properties.Average.P(1:N) = 0.5*Inner.PressureDrop.Plocal(1:N) + 0.5*Inner.PressureDrop.Plocal(2:Npoints)),
				:(Inner.Properties.Wall.Twall = 0.5*Outer.Properties.Average.T + 0.5*Inner.Properties.Average.T),
				:(Outer.Properties.Wall.Twall = 0.5*Outer.Properties.Average.T + 0.5*Inner.Properties.Average.T),
				:(Outer.Properties.Average.Mw = sum(M*InletOuter.z)),
				:(Inner.Properties.Average.Mw = sum(M*InletInner.z)),
				:(Inner.Properties.Inlet.rho = PP.LiquidDensity(InletInner.T,InletInner.P,InletInner.z)),
				:(Inner.Properties.Outlet.rho = PP.LiquidDensity(OutletInner.T,OutletInner.P,OutletInner.z)),
				:(Inner.Properties.Inlet.rho = PP.VapourDensity(InletInner.T,InletInner.P,InletInner.z)),
				:(Inner.Properties.Outlet.rho = PP.VapourDensity(OutletInner.T,OutletInner.P,OutletInner.z)),
				:(Outer.Properties.Inlet.rho = PP.LiquidDensity(InletOuter.T,InletOuter.P,InletOuter.z)),
				:(Outer.Properties.Outlet.rho = PP.LiquidDensity(OutletOuter.T,OutletOuter.P,OutletOuter.z)),
				:(Outer.Properties.Inlet.rho = PP.VapourDensity(InletOuter.T,InletOuter.P,InletOuter.z)),
				:(Outer.Properties.Outlet.rho = PP.VapourDensity(OutletOuter.T,OutletOuter.P,OutletOuter.z)),
				:(Inner.Properties.Average.Cp([1:N]) = PP.LiquidCp(Inner.Properties.Average.T([1:N]),Inner.Properties.Average.P([1:N]),InletInner.z)),
				:(Inner.Properties.Average.rho([1:N]) = PP.LiquidDensity(Inner.Properties.Average.T([1:N]),Inner.Properties.Average.P([1:N]),InletInner.z)),
				:(Inner.Properties.Average.Mu([1:N]) = PP.LiquidViscosity(Inner.Properties.Average.T([1:N]),Inner.Properties.Average.P([1:N]),InletInner.z)),
				:(Inner.Properties.Average.K([1:N]) = PP.LiquidThermalConductivity(Inner.Properties.Average.T([1:N]),Inner.Properties.Average.P([1:N]),InletInner.z)),
				:(Inner.Properties.Wall.Mu([1:N]) = PP.LiquidViscosity(Inner.Properties.Wall.Twall([1:N]),Inner.Properties.Average.P([1:N]),InletInner.z)),
				:(Inner.Properties.Average.Cp([1:N]) = PP.VapourCp(Inner.Properties.Average.T([1:N]),Inner.Properties.Average.P([1:N]),InletInner.z)),
				:(Inner.Properties.Average.rho([1:N]) = PP.VapourDensity(Inner.Properties.Average.T([1:N]),Inner.Properties.Average.P([1:N]),InletInner.z)),
				:(Inner.Properties.Average.Mu([1:N]) = PP.VapourViscosity(Inner.Properties.Average.T([1:N]),Inner.Properties.Average.P([1:N]),InletInner.z)),
				:(Inner.Properties.Average.K([1:N]) = PP.VapourThermalConductivity(Inner.Properties.Average.T([1:N]),Inner.Properties.Average.P([1:N]),InletInner.z)),
				:(Inner.Properties.Wall.Mu([1:N]) = PP.VapourViscosity(Inner.Properties.Wall.Twall([1:N]),Inner.Properties.Average.P([1:N]),InletInner.z)),
				:(Outer.Properties.Average.Cp([1:N]) = PP.LiquidCp(Outer.Properties.Average.T([1:N]),Outer.Properties.Average.P([1:N]),InletOuter.z)),
				:(Outer.Properties.Average.rho([1:N]) = PP.LiquidDensity(Outer.Properties.Average.T([1:N]),Outer.Properties.Average.P([1:N]),InletOuter.z)),
				:(Outer.Properties.Average.Mu([1:N]) = PP.LiquidViscosity(Outer.Properties.Average.T([1:N]),Outer.Properties.Average.P([1:N]),InletOuter.z)),
				:(Outer.Properties.Average.K([1:N]) = PP.LiquidThermalConductivity(Outer.Properties.Average.T([1:N]),Outer.Properties.Average.P([1:N]),InletOuter.z)),
				:(Outer.Properties.Wall.Mu([1:N]) = PP.LiquidViscosity(Outer.Properties.Wall.Twall([1:N]),Outer.Properties.Average.P([1:N]),InletOuter.z)),
				:(Outer.Properties.Average.Cp([1:N]) = PP.VapourCp(Outer.Properties.Average.T([1:N]),Outer.Properties.Average.P([1:N]),InletOuter.z)),
				:(Outer.Properties.Average.rho([1:N]) = PP.VapourDensity(Outer.Properties.Average.T([1:N]),Outer.Properties.Average.P([1:N]),InletOuter.z)),
				:(Outer.Properties.Average.Mu([1:N]) = PP.VapourViscosity(Outer.Properties.Average.T([1:N]),Outer.Properties.Average.P([1:N]),InletOuter.z)),
				:(Outer.Properties.Average.K([1:N]) = PP.VapourThermalConductivity(Outer.Properties.Average.T([1:N]),Outer.Properties.Average.P([1:N]),InletOuter.z)),
				:(Outer.Properties.Wall.Mu([1:N]) = PP.VapourViscosity(Outer.Properties.Wall.Twall([1:N]),Outer.Properties.Average.P([1:N]),InletOuter.z)),
				:(Inner.Properties.Inlet.Fw = sum(M*InletInner.z)*InletInner.F),
				:(Inner.Properties.Outlet.Fw = sum(M*OutletInner.z)*OutletInner.F),
				:(Outer.Properties.Inlet.Fw = sum(M*InletOuter.z)*InletOuter.F),
				:(Outer.Properties.Outlet.Fw = sum(M*OutletOuter.z)*OutletOuter.F),
				:(OutletOuter.F = InletOuter.F),
				:(OutletInner.F = InletInner.F),
				:(OutletOuter.z=InletOuter.z),
				:(OutletInner.z=InletInner.z),
				:(Details.A=Pi*DoInner*Lpipe),
				:(Lincr(1) = 0*"m"),
				:(Lincr([1:N]+1) = [1:N]*abs(Lpipe)/N),
				:(Inner.PressureDrop.fi([1:N])*Inner.PressureDrop.Re([1:N]) = 16),
				:((Inner.PressureDrop.fi([1:N])-0.0035)*(Inner.PressureDrop.Re([1:N])^0.42) = 0.264),
				:((Inner.PressureDrop.fi([1:N])-0.0035)*(Inner.PressureDrop.Re([1:N])^0.42) = 0.264),
				:(Outer.PressureDrop.fi([1:N])*Outer.PressureDrop.Re([1:N]) = 16),
				:((Outer.PressureDrop.fi([1:N])-0.0035)*(Outer.PressureDrop.Re([1:N])^0.42) = 0.264),
				:((Outer.PressureDrop.fi([1:N])-0.0035)*(Outer.PressureDrop.Re([1:N])^0.42) = 0.264),
				:(Inner.HeatTransfer.fi([1:N]) = 1/(0.79*ln(Inner.HeatTransfer.Re([1:N]))-1.64)^2),
				:(Inner.HeatTransfer.Nu([1:N]) = 3.665 + ((0.19*((DiInner/Lpipe)*Inner.HeatTransfer.Re([1:N])*Inner.HeatTransfer.PR([1:N]))^0.8)/(1+0.117*((DiInner/Lpipe)*Inner.HeatTransfer.Re([1:N])*Inner.HeatTransfer.PR([1:N]))^0.467))),
				:(Inner.HeatTransfer.Nu([1:N]) = (49.027896+4.173281*Inner.HeatTransfer.Re([1:N])*Inner.HeatTransfer.PR([1:N])*(DiInner/Lpipe))^(1/3)),
				:(Inner.HeatTransfer.fi([1:N]) = 1/(0.79*ln(Inner.HeatTransfer.Re([1:N]))-1.64)^2),
				:(Inner.HeatTransfer.Nu([1:N])*(1+(12.7*sqrt(0.125*Inner.HeatTransfer.fi([1:N]))*((Inner.HeatTransfer.PR([1:N]))^(2/3) -1))) = 0.125*Inner.HeatTransfer.fi([1:N])*(Inner.HeatTransfer.Re([1:N])-1000)*Inner.HeatTransfer.PR([1:N])),
				:(Inner.HeatTransfer.Nu([1:N]) =0.116*(Inner.HeatTransfer.Re([1:N])^(0.667)-125)*Inner.HeatTransfer.PR([1:N])^(0.333)*(1+(DiInner/Lpipe)^0.667)),
				:(Inner.HeatTransfer.fi([1:N]) = 1/(1.82*log(Inner.HeatTransfer.Re([1:N]))-1.64)^2),
				:(Inner.HeatTransfer.Nu([1:N])*(1.07+(12.7*sqrt(0.125*Inner.HeatTransfer.fi([1:N]))*((Inner.HeatTransfer.PR([1:N]))^(2/3) -1))) = 0.125*Inner.HeatTransfer.fi([1:N])*Inner.HeatTransfer.Re([1:N])*Inner.HeatTransfer.PR([1:N])),
				:(Inner.HeatTransfer.Nu([1:N]) = 0.027*(Inner.HeatTransfer.PR([1:N]))^(1/3)*(Inner.HeatTransfer.Re([1:N]))^(4/5)),
				:(Inner.HeatTransfer.fi([1:N]) = 1/(1.82*log(Inner.HeatTransfer.Re([1:N]))-1.64)^2),
				:(Outer.HeatTransfer.fi([1:N]) = 1/(0.79*ln(Outer.HeatTransfer.Re([1:N]))-1.64)^2),
				:(Outer.HeatTransfer.Nu([1:N]) = 3.665 + ((0.19*((Outer.HeatTransfer.Dh/Lpipe)*Outer.HeatTransfer.Re([1:N])*Outer.HeatTransfer.PR([1:N]))^0.8)/(1+0.117*((Outer.HeatTransfer.Dh/Lpipe)*Outer.HeatTransfer.Re([1:N])*Outer.HeatTransfer.PR([1:N]))^0.467))),
				:(Outer.HeatTransfer.Nu([1:N]) = (49.027896+4.173281*Outer.HeatTransfer.Re([1:N])*Outer.HeatTransfer.PR([1:N])*(Outer.HeatTransfer.Dh/Lpipe))^(1/3)),
				:(Outer.HeatTransfer.fi([1:N]) = 1/(0.79*ln(Outer.HeatTransfer.Re([1:N]))-1.64)^2),
				:(Outer.HeatTransfer.Nu([1:N])*(1+(12.7*sqrt(0.125*Outer.HeatTransfer.fi([1:N]))*((Outer.HeatTransfer.PR([1:N]))^(2/3) -1))) = 0.125*Outer.HeatTransfer.fi([1:N])*(Outer.HeatTransfer.Re([1:N])-1000)*Outer.HeatTransfer.PR([1:N])),
				:(Outer.HeatTransfer.Nu([1:N]) = 0.116*(Outer.HeatTransfer.Re([1:N])^(0.667)-125)*Outer.HeatTransfer.PR([1:N])^(0.333)*(1+(Outer.HeatTransfer.Dh/Lpipe)^0.667)),
				:(Outer.HeatTransfer.fi([1:N]) = 1/(0.79*ln(Outer.HeatTransfer.Re([1:N]))-1.64)^2),
				:(Outer.HeatTransfer.fi([1:N]) = 1/(1.82*log(Outer.HeatTransfer.Re([1:N]))-1.64)^2),
				:(Outer.HeatTransfer.Nu([1:N])*(1.07+(12.7*sqrt(0.125*Outer.HeatTransfer.fi([1:N]))*((Outer.HeatTransfer.PR([1:N]))^(2/3) -1))) = 0.125*Outer.HeatTransfer.fi([1:N])*Outer.HeatTransfer.Re([1:N])*Outer.HeatTransfer.PR([1:N])),
				:(Outer.HeatTransfer.Nu([1:N]) = 0.027*(Outer.HeatTransfer.PR([1:N]))^(1/3)*(Outer.HeatTransfer.Re([1:N]))^(4/5)),
				:(Outer.HeatTransfer.fi([1:N]) = 1/(1.82*log(Outer.HeatTransfer.Re([1:N]))-1.64)^2),
				:(Inner.HeatTransfer.Enth([2:N]) = (1-InletInner.v)*PP.LiquidEnthalpy(Inner.HeatTransfer.Tlocal([2:N]), Inner.PressureDrop.Plocal([2:N]), InletInner.z) + InletInner.v*PP.VapourEnthalpy(Inner.HeatTransfer.Tlocal([2:N]), Inner.PressureDrop.Plocal([2:N]), InletInner.z)),
				:(Outer.HeatTransfer.Enth([2:N]) = (1-InletOuter.v)*PP.LiquidEnthalpy(Outer.HeatTransfer.Tlocal([2:N]), Outer.PressureDrop.Plocal([2:N]), InletOuter.z) + InletOuter.v*PP.VapourEnthalpy(Outer.HeatTransfer.Tlocal([2:N]), Outer.PressureDrop.Plocal([2:N]), InletOuter.z)),
				:(Inner.HeatTransfer.hcoeff = (Inner.HeatTransfer.Nu*Inner.Properties.Average.K/DiInner)*Inner.HeatTransfer.Phi),
				:(Outer.HeatTransfer.hcoeff= (Outer.HeatTransfer.Nu*Outer.Properties.Average.K/Outer.HeatTransfer.Dh)*Outer.HeatTransfer.Phi),
				:(Outer.HeatTransfer.Phi = (Outer.Properties.Average.Mu/Outer.Properties.Wall.Mu)^0.14),
				:(Inner.HeatTransfer.Phi = (Inner.Properties.Average.Mu/Inner.Properties.Wall.Mu)^0.14),
				:(Outer.HeatTransfer.PR = ((Outer.Properties.Average.Cp/Outer.Properties.Average.Mw)*Outer.Properties.Average.Mu)/Outer.Properties.Average.K),
				:(Inner.HeatTransfer.PR = ((Inner.Properties.Average.Cp/Inner.Properties.Average.Mw)*Inner.Properties.Average.Mu)/Inner.Properties.Average.K),
				:(Outer.HeatTransfer.Re = (Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean*Outer.HeatTransfer.Dh)/Outer.Properties.Average.Mu),
				:(Outer.PressureDrop.Re = (Outer.Properties.Average.rho*Outer.HeatTransfer.Vmean*Outer.PressureDrop.Dh)/Outer.Properties.Average.Mu),
				:(Inner.HeatTransfer.Re = (Inner.Properties.Average.rho*Inner.HeatTransfer.Vmean*Inner.HeatTransfer.Dh)/Inner.Properties.Average.Mu),
				:(Inner.PressureDrop.Re = Inner.HeatTransfer.Re),
				:(Outer.HeatTransfer.Vmean*(Outer.HeatTransfer.As*Outer.Properties.Average.rho) = Outer.Properties.Inlet.Fw),
				:(Inner.HeatTransfer.Vmean*(Inner.HeatTransfer.As*Inner.Properties.Average.rho) = Inner.Properties.Inlet.Fw),
				:(Details.Uc*((DoInner/(sum(Inner.HeatTransfer.hcoeff)/N*DiInner) )+(DoInner*ln(DoInner/DiInner)/(2*Kwall))+(1/(sum(Outer.HeatTransfer.hcoeff)/N)))=1),
				:(Details.Ud=1/(Rfi*(DoInner/DiInner) + Rfo + (DoInner/(Inner.HeatTransfer.hcoeff*DiInner) )+(DoInner*ln(DoInner/DiInner)/(2*Kwall))+(1/(Outer.HeatTransfer.hcoeff)))),
				:(Details.Qtotal = sum(Details.Q)),
			],
			[
				"Outer	Stream Average Temperature","Inner Stream Average Temperature","Outer Stream Average Pressure","Inner Stream Average Pressure","Inner Stream Wall Temperature","Outer Stream Wall Temperature","Outer Stream Average Molecular Weight","Inner Stream Average Molecular Weight","Inlet Mass Density Inner Stream","Outlet Mass Density Inner Stream","Inlet Mass Density Inner Stream","Outlet Mass Density Inner Stream","Inlet Mass Density Outer Stream","Outlet Mass Density Outer Stream","Inlet Mass Density Outer Stream","Outlet Mass Density Outer Stream","Average Heat Capacity Inner Stream","Average Mass Density Inner Stream","Average Viscosity Inner Stream","Average	Conductivity Inner Stream","Viscosity Inner Stream at wall temperature","Average Heat Capacity InnerStream","Average Mass Density Inner Stream","Average Viscosity Inner Stream","Average Conductivity Inner Stream","Viscosity Inner Stream at wall temperature","Average Heat Capacity Outer Stream","Average Mass Density Outer Stream","Average Viscosity Outer Stream","Average Conductivity Outer Stream","Viscosity Outer Stream at wall temperature","Average Heat Capacity Outer Stream","Average Mass Density Outer Stream","Average Viscosity Outer Stream","Average Conductivity Outer Stream","Viscosity Outer Stream at wall temperature","Flow Mass Inlet Inner Stream","Flow Mass Outlet Inner Stream","Flow Mass Inlet Outer Stream","Flow Mass Outlet Outer Stream","Molar Balance Outer Stream","Molar Balance Inner Stream","Outer Stream Molar Fraction Constraint","InnerStream Molar Fraction Constraint","Total Exchange Surface Area for one segment of pipe","Pipe Initial Length from Left to Right","Incremental Length","Inner Side Friction Factor for Pressure Drop - laminar Flow","using Turbulent Flow - to be implemented","Inner Side Friction Factor - Turbulent Flow","Outer Side Friction Factor - laminar Flow","using Turbulent Flow - Transition Flow must be implemented","Outer Side Friction Factor - Turbulent Flow","Inner Side Friction Factor for Heat Transfer - laminar Flow","Nusselt Number","Nusselt Number","Inner Side Friction Factor for Heat Transfer - transition Flow","Nusselt Number","Nusselt Number","Inner Side Friction Factor for Heat Transfer - turbulent Flow","Nusselt Number","Nusselt Number","Inner Side Friction Factor for Heat Transfer - turbulent Flow","Outer Side Friction Factor for Heat Transfer - laminar Flow","Nusselt Number","Nusselt Number","Outer Side Friction Factor for Heat Transfer - transition Flow","Nusselt Number","Nusselt Number","Outer Side Friction Factor for Heat Transfer - transition Flow","Outer Side Friction Factor for Heat Transfer - turbulent Flow","Nusselt Number","Nusselt Number","Outer Side Friction Factor for Heat Transfer - turbulent Flow","Incremental Enthalpy Inner Stream","Incremental Enthalpy Outer Stream","Inner Pipe Film Coefficient","Outer Pipe Film Coefficient","Outer Pipe Phi correction","Inner Pipe Phi correction","Outer Pipe Prandtl Number","Inner Pipe Prandtl Number","Outer Pipe Reynolds Number for Heat Transfer","Outer Pipe Reynolds Number for Pressure Drop","Inner Pipe Reynolds Number for Heat Transfer","Inner Pipe Reynolds Number for Pressure Drop","Outer Pipe Velocity","Inner Pipe Velocity","Average Overall Heat Transfer Coefficient Clean","Overall Heat Transfer Coefficient Dirty","Total Duty",
			],
			[:PP,:NComp,:N,:Npoints,:M,:HotSide,:innerFlowRegime,:outerFlowRegime,:InnerLaminarCorrelation,:InnerTransitionCorrelation,:InnerTurbulentCorrelation,:OuterLaminarCorrelation,:OuterTransitionCorrelation,:OuterTurbulentCorrelation,:Pi,:DoInner,:DiInner,:DiOuter,:Lpipe,:Kwall,:Rfi,:Rfo,],
			[:InletInner,:InletOuter,:OutletInner,:OutletOuter,:Details,:Inner,:Outer,:Lincr,]
		)
	end
	PP::DanaPlugin
	NComp::DanaInteger
	N::DanaInteger
	Npoints::DanaInteger
	M::Array{molweight}
	HotSide::DanaSwitcher
	innerFlowRegime::DanaSwitcher
	outerFlowRegime::DanaSwitcher
	InnerLaminarCorrelation::DanaSwitcher
	InnerTransitionCorrelation::DanaSwitcher
	InnerTurbulentCorrelation::DanaSwitcher
	OuterLaminarCorrelation::DanaSwitcher
	OuterTransitionCorrelation::DanaSwitcher
	OuterTurbulentCorrelation::DanaSwitcher
	Pi::constant
	DoInner::length
	DiInner::length
	DiOuter::length
	Lpipe::length
	Kwall::conductivity
	Rfi::positive
	Rfo::positive
	InletInner::stream
	InletOuter::stream
	OutletInner::streamPH
	OutletOuter::streamPH
	Details::Details_Main
	Inner::Main_Hairpin
	Outer::Main_Hairpin
	Lincr::Array{length}
	equations::Array{Expr,1}
	equationNames::Array{String,1}
	parameters::Array{Symbol,1}
	variables::Array{Symbol,1}
	attributes::Dict{Symbol,Any}
end
export HairpinIncr_basic
function set(in::HairpinIncr_basic)
	#"Component Molecular Weight"
	M = PP.MolecularWeight()
	 #"Inner Pipe Cross Sectional Area for Flow"
	Inner.HeatTransfer.As=0.25*Pi*DiInner*DiInner
	 #"Outer Pipe Cross Sectional Area for Flow"
	Outer.HeatTransfer.As=0.25*Pi*(DiOuter*DiOuter - DoInner*DoInner)
	 #"Inner Pipe Hydraulic Diameter for Heat Transfer"
	Inner.HeatTransfer.Dh=DiInner
	 #"Outer Pipe Hydraulic Diameter for Heat Transfer"
	Outer.HeatTransfer.Dh=(DiOuter*DiOuter-DoInner*DoInner)/DoInner
	 #"Inner Pipe Hydraulic Diameter for Pressure Drop"
	Inner.PressureDrop.Dh=DiInner
	 #"Outer Pipe Hydraulic Diameter for Pressure Drop"
	Outer.PressureDrop.Dh=DiOuter-DoInner

end
function setEquationFlow(in::HairpinIncr_basic)
	addEquation(1)
	addEquation(2)
	addEquation(3)
	addEquation(4)
	addEquation(5)
	addEquation(6)
	addEquation(7)
	addEquation(8)
	if InletInner.v == 0
		addEquation(9)
		addEquation(10)
	else
		addEquation(11)
		addEquation(12)
	end
	if InletOuter.v == 0
		addEquation(13)
		addEquation(14)
	else
		addEquation(15)
		addEquation(16)
	end
	if InletInner.v == 0
		addEquation(17)
		addEquation(18)
		addEquation(19)
		addEquation(20)
		addEquation(21)
	else
		addEquation(22)
		addEquation(23)
		addEquation(24)
		addEquation(25)
		addEquation(26)
	end
	if InletOuter.v == 0
		addEquation(27)
		addEquation(28)
		addEquation(29)
		addEquation(30)
		addEquation(31)
	else
		addEquation(32)
		addEquation(33)
		addEquation(34)
		addEquation(35)
		addEquation(36)
	end
	addEquation(37)
	addEquation(38)
	addEquation(39)
	addEquation(40)
	addEquation(41)
	addEquation(42)
	addEquation(43)
	addEquation(44)
	addEquation(45)
	addEquation(46)
	addEquation(47)
	let switch=innerFlowRegime
		if innerFlowRegime==Inner.PressureDrop.Re(i) > 2300
			set(switch,"transition")
		end
		if innerFlowRegime==Inner.PressureDrop.Re(i) < 2300
			set(switch,"laminar")
		end
		if innerFlowRegime==Inner.PressureDrop.Re(i) > 10000
			set(switch,"turbulent")
		end
		if innerFlowRegime==Inner.PressureDrop.Re(i) < 10000
			set(switch,"transition")
		end
		if switch=="laminar"
			addEquation(48)
		elseif switch=="transition"
			addEquation(49)
		elseif switch=="turbulent"
			addEquation(50)
		end
	end
	let switch=outerFlowRegime
		if outerFlowRegime==Outer.PressureDrop.Re(i) > 2300
			set(switch,"transition")
		end
		if outerFlowRegime==Outer.PressureDrop.Re(i) < 2300
			set(switch,"laminar")
		end
		if outerFlowRegime==Outer.PressureDrop.Re(i) > 10000
			set(switch,"turbulent")
		end
		if outerFlowRegime==Outer.PressureDrop.Re(i) < 10000
			set(switch,"transition")
		end
		if switch=="laminar"
			addEquation(51)
		elseif switch=="transition"
			addEquation(52)
		elseif switch=="turbulent"
			addEquation(53)
		end
	end
	let switch=innerFlowRegime
		if innerFlowRegime==Inner.HeatTransfer.Re(i) > 2300
			set(switch,"transition")
		end
		if innerFlowRegime==Inner.HeatTransfer.Re(i) < 2300
			set(switch,"laminar")
		end
		if innerFlowRegime==Inner.HeatTransfer.Re(i) > 10000
			set(switch,"turbulent")
		end
		if innerFlowRegime==Inner.HeatTransfer.Re(i) < 10000
			set(switch,"transition")
		end
		if switch=="laminar"
			addEquation(54)
			let switch=InnerLaminarCorrelation
				if switch=="Hausen"
					addEquation(55)
				elseif switch=="Schlunder"
					addEquation(56)
				end
			end
		elseif switch=="transition"
			addEquation(57)
			let switch=InnerTransitionCorrelation
				if switch=="Gnielinski"
					addEquation(58)
				elseif switch=="Hausen"
					addEquation(59)
				end
			end
		elseif switch=="turbulent"
			let switch=InnerTurbulentCorrelation
				if switch=="Petukhov"
					addEquation(60)
					addEquation(61)
				elseif switch=="SiederTate"
					addEquation(62)
					addEquation(63)
				end
			end
		end
	end
	let switch=outerFlowRegime
		if outerFlowRegime==Outer.HeatTransfer.Re(i) > 2300
			set(switch,"transition")
		end
		if outerFlowRegime==Outer.HeatTransfer.Re(i) < 2300
			set(switch,"laminar")
		end
		if outerFlowRegime==Outer.HeatTransfer.Re(i) > 10000
			set(switch,"turbulent")
		end
		if outerFlowRegime==Outer.HeatTransfer.Re(i) < 10000
			set(switch,"transition")
		end
		if switch=="laminar"
			addEquation(64)
			let switch=OuterLaminarCorrelation
				if switch=="Hausen"
					addEquation(65)
				elseif switch=="Schlunder"
					addEquation(66)
				end
			end
		elseif switch=="transition"
			let switch=OuterTransitionCorrelation
				if switch=="Gnielinski"
					addEquation(67)
					addEquation(68)
				elseif switch=="Hausen"
					addEquation(69)
					addEquation(70)
				end
			end
		elseif switch=="turbulent"
			let switch=OuterTurbulentCorrelation
				if switch=="Petukhov"
					addEquation(71)
					addEquation(72)
				elseif switch=="SiederTate"
					addEquation(73)
					addEquation(74)
				end
			end
		end
	end
	addEquation(75)
	addEquation(76)
	addEquation(77)
	addEquation(78)
	addEquation(79)
	addEquation(80)
	addEquation(81)
	addEquation(82)
	addEquation(83)
	addEquation(84)
	addEquation(85)
	addEquation(86)
	addEquation(87)
	addEquation(88)
	addEquation(89)
	addEquation(90)
	addEquation(91)
end
function atributes(in::HairpinIncr_basic,_::Dict{Symbol,Any})
	fields::Dict{Symbol,Any}=Dict{Symbol,Any}()
	fields[:Pallete]=false
	fields[:Brief]="Incremental Hairpin Heat Exchanger. "
	fields[:Info]="Incremental approach for Hairpin heat exchanger. "
	drive!(fields,_)
	return fields
end
HairpinIncr_basic(_::Dict{Symbol,Any})=begin
	newModel=HairpinIncr_basic()
	newModel.attributes=atributes(newModel,_)
	newModel
end