# Source: amqp0-9-1.extended.xml
# This file is automatically generated.
# Do not edit this file by hand.
# Make changes to gen.jl or the source specification instead.

const AMQP_VERSION = v"0.9.1"
const AMQP_DEFAULT_PORT = 5672
const AMQPS_DEFAULT_PORT = 5671

# Constants
const FrameMethod = 1
const FrameHeader = 2
const FrameBody = 3
const FrameHeartbeat = 8
const FrameMinSize = 4096
const ReplySuccess = 200

# Error Codes
const SoftErrorContentTooLarge = 311
const SoftErrorNoConsumers = 313
const HardErrorConnectionForced = 320
const HardErrorInvalidPath = 402
const SoftErrorAccessRefused = 403
const SoftErrorNotFound = 404
const SoftErrorResourceLocked = 405
const SoftErrorPreconditionFailed = 406
const HardErrorFrameError = 501
const HardErrorSyntaxError = 502
const HardErrorCommandInvalid = 503
const HardErrorChannelError = 504
const HardErrorUnexpectedFrame = 505
const HardErrorResourceError = 506
const HardErrorNotAllowed = 530
const HardErrorNotImplemented = 540
const HardErrorInternalError = 541

# Domains
const TAMQPConsumerTag = TAMQPShortStr
const TAMQPDeliveryTag = Int64
const TAMQPExchangeName = TAMQPShortStr
const TAMQPNoAck = TAMQPBit
const TAMQPNoLocal = TAMQPBit
const TAMQPNoWait = TAMQPBit
const TAMQPPath = TAMQPShortStr
const TAMQPPeerProperties = TAMQPFieldTable
const TAMQPQueueName = TAMQPShortStr
const TAMQPRedelivered = TAMQPBit
const TAMQPMessageCount = Int32
const TAMQPReplyCode = Int16
const TAMQPReplyText = TAMQPShortStr
# end Domains

# Classes
const CLASS_MAP = Dict{TAMQPClassId,ClassSpec}(
    10 => ClassSpec(10, :Connection, Dict{TAMQPMethodId, MethodSpec}(
        10 => MethodSpec(10, :Start, :StartOk, Pair{Symbol,DataType}[
            :VersionMajor => UInt8
            , :VersionMinor => UInt8
            , :ServerProperties => TAMQPPeerProperties
            , :Mechanisms => TAMQPLongStr
            , :Locales => TAMQPLongStr
        ]) # method Start
        , 11 => MethodSpec(11, :StartOk, :Nothing, Pair{Symbol,DataType}[
            :ClientProperties => TAMQPPeerProperties
            , :Mechanism => TAMQPShortStr
            , :Response => TAMQPLongStr
            , :Locale => TAMQPShortStr
        ]) # method StartOk
        , 20 => MethodSpec(20, :Secure, :SecureOk, Pair{Symbol,DataType}[
            :Challenge => TAMQPLongStr
        ]) # method Secure
        , 21 => MethodSpec(21, :SecureOk, :Nothing, Pair{Symbol,DataType}[
            :Response => TAMQPLongStr
        ]) # method SecureOk
        , 30 => MethodSpec(30, :Tune, :TuneOk, Pair{Symbol,DataType}[
            :ChannelMax => Int16
            , :FrameMax => Int32
            , :Heartbeat => Int16
        ]) # method Tune
        , 31 => MethodSpec(31, :TuneOk, :Nothing, Pair{Symbol,DataType}[
            :ChannelMax => Int16
            , :FrameMax => Int32
            , :Heartbeat => Int16
        ]) # method TuneOk
        , 40 => MethodSpec(40, :Open, :OpenOk, Pair{Symbol,DataType}[
            :VirtualHost => TAMQPPath
            , :Reserved1 => TAMQPShortStr
            , :Reserved2 => TAMQPBit
        ]) # method Open
        , 41 => MethodSpec(41, :OpenOk, :Nothing, Pair{Symbol,DataType}[
            :Reserved1 => TAMQPShortStr
        ]) # method OpenOk
        , 50 => MethodSpec(50, :Close, :CloseOk, Pair{Symbol,DataType}[
            :ReplyCode => TAMQPReplyCode
            , :ReplyText => TAMQPReplyText
            , :ClassId => UInt16
            , :MethodId => UInt16
        ]) # method Close
        , 51 => MethodSpec(51, :CloseOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method CloseOk
        , 60 => MethodSpec(60, :Blocked, :Nothing, Pair{Symbol,DataType}[
            :Reason => TAMQPShortStr
        ]) # method Blocked
        , 61 => MethodSpec(61, :Unblocked, :Nothing, Pair{Symbol,DataType}[
        ]) # method Unblocked
    )) # class Connection
    , 20 => ClassSpec(20, :Channel, Dict{TAMQPMethodId, MethodSpec}(
        10 => MethodSpec(10, :Open, :OpenOk, Pair{Symbol,DataType}[
            :Reserved1 => TAMQPShortStr
        ]) # method Open
        , 11 => MethodSpec(11, :OpenOk, :Nothing, Pair{Symbol,DataType}[
            :Reserved1 => TAMQPLongStr
        ]) # method OpenOk
        , 20 => MethodSpec(20, :Flow, :FlowOk, Pair{Symbol,DataType}[
            :Active => TAMQPBit
        ]) # method Flow
        , 21 => MethodSpec(21, :FlowOk, :Nothing, Pair{Symbol,DataType}[
            :Active => TAMQPBit
        ]) # method FlowOk
        , 40 => MethodSpec(40, :Close, :CloseOk, Pair{Symbol,DataType}[
            :ReplyCode => TAMQPReplyCode
            , :ReplyText => TAMQPReplyText
            , :ClassId => UInt16
            , :MethodId => UInt16
        ]) # method Close
        , 41 => MethodSpec(41, :CloseOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method CloseOk
    )) # class Channel
    , 40 => ClassSpec(40, :Exchange, Dict{TAMQPMethodId, MethodSpec}(
        10 => MethodSpec(10, :Declare, :DeclareOk, Pair{Symbol,DataType}[
            :Reserved1 => Int16
            , :Exchange => TAMQPExchangeName
            , :Type => TAMQPShortStr
            , :Passive => TAMQPBit
            , :Durable => TAMQPBit
            , :AutoDelete => TAMQPBit
            , :Internal => TAMQPBit
            , :NoWait => TAMQPNoWait
            , :Arguments => TAMQPFieldTable
        ]) # method Declare
        , 11 => MethodSpec(11, :DeclareOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method DeclareOk
        , 20 => MethodSpec(20, :Delete, :DeleteOk, Pair{Symbol,DataType}[
            :Reserved1 => Int16
            , :Exchange => TAMQPExchangeName
            , :IfUnused => TAMQPBit
            , :NoWait => TAMQPNoWait
        ]) # method Delete
        , 21 => MethodSpec(21, :DeleteOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method DeleteOk
        , 30 => MethodSpec(30, :Bind, :BindOk, Pair{Symbol,DataType}[
            :Reserved1 => Int16
            , :Destination => TAMQPExchangeName
            , :Source => TAMQPExchangeName
            , :RoutingKey => TAMQPShortStr
            , :NoWait => TAMQPNoWait
            , :Arguments => TAMQPFieldTable
        ]) # method Bind
        , 31 => MethodSpec(31, :BindOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method BindOk
        , 40 => MethodSpec(40, :Unbind, :UnbindOk, Pair{Symbol,DataType}[
            :Reserved1 => Int16
            , :Destination => TAMQPExchangeName
            , :Source => TAMQPExchangeName
            , :RoutingKey => TAMQPShortStr
            , :NoWait => TAMQPNoWait
            , :Arguments => TAMQPFieldTable
        ]) # method Unbind
        , 51 => MethodSpec(51, :UnbindOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method UnbindOk
    )) # class Exchange
    , 50 => ClassSpec(50, :Queue, Dict{TAMQPMethodId, MethodSpec}(
        10 => MethodSpec(10, :Declare, :DeclareOk, Pair{Symbol,DataType}[
            :Reserved1 => Int16
            , :Queue => TAMQPQueueName
            , :Passive => TAMQPBit
            , :Durable => TAMQPBit
            , :Exclusive => TAMQPBit
            , :AutoDelete => TAMQPBit
            , :NoWait => TAMQPNoWait
            , :Arguments => TAMQPFieldTable
        ]) # method Declare
        , 11 => MethodSpec(11, :DeclareOk, :Nothing, Pair{Symbol,DataType}[
            :Queue => TAMQPQueueName
            , :MessageCount => TAMQPMessageCount
            , :ConsumerCount => Int32
        ]) # method DeclareOk
        , 20 => MethodSpec(20, :Bind, :BindOk, Pair{Symbol,DataType}[
            :Reserved1 => Int16
            , :Queue => TAMQPQueueName
            , :Exchange => TAMQPExchangeName
            , :RoutingKey => TAMQPShortStr
            , :NoWait => TAMQPNoWait
            , :Arguments => TAMQPFieldTable
        ]) # method Bind
        , 21 => MethodSpec(21, :BindOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method BindOk
        , 50 => MethodSpec(50, :Unbind, :UnbindOk, Pair{Symbol,DataType}[
            :Reserved1 => Int16
            , :Queue => TAMQPQueueName
            , :Exchange => TAMQPExchangeName
            , :RoutingKey => TAMQPShortStr
            , :Arguments => TAMQPFieldTable
        ]) # method Unbind
        , 51 => MethodSpec(51, :UnbindOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method UnbindOk
        , 30 => MethodSpec(30, :Purge, :PurgeOk, Pair{Symbol,DataType}[
            :Reserved1 => Int16
            , :Queue => TAMQPQueueName
            , :NoWait => TAMQPNoWait
        ]) # method Purge
        , 31 => MethodSpec(31, :PurgeOk, :Nothing, Pair{Symbol,DataType}[
            :MessageCount => TAMQPMessageCount
        ]) # method PurgeOk
        , 40 => MethodSpec(40, :Delete, :DeleteOk, Pair{Symbol,DataType}[
            :Reserved1 => Int16
            , :Queue => TAMQPQueueName
            , :IfUnused => TAMQPBit
            , :IfEmpty => TAMQPBit
            , :NoWait => TAMQPNoWait
        ]) # method Delete
        , 41 => MethodSpec(41, :DeleteOk, :Nothing, Pair{Symbol,DataType}[
            :MessageCount => TAMQPMessageCount
        ]) # method DeleteOk
    )) # class Queue
    , 60 => ClassSpec(60, :Basic, Dict{TAMQPMethodId, MethodSpec}(
        10 => MethodSpec(10, :Qos, :QosOk, Pair{Symbol,DataType}[
            :PrefetchSize => Int32
            , :PrefetchCount => Int16
            , :Global => TAMQPBit
        ]) # method Qos
        , 11 => MethodSpec(11, :QosOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method QosOk
        , 20 => MethodSpec(20, :Consume, :ConsumeOk, Pair{Symbol,DataType}[
            :Reserved1 => Int16
            , :Queue => TAMQPQueueName
            , :ConsumerTag => TAMQPConsumerTag
            , :NoLocal => TAMQPNoLocal
            , :NoAck => TAMQPNoAck
            , :Exclusive => TAMQPBit
            , :NoWait => TAMQPNoWait
            , :Arguments => TAMQPFieldTable
        ]) # method Consume
        , 21 => MethodSpec(21, :ConsumeOk, :Nothing, Pair{Symbol,DataType}[
            :ConsumerTag => TAMQPConsumerTag
        ]) # method ConsumeOk
        , 30 => MethodSpec(30, :Cancel, :CancelOk, Pair{Symbol,DataType}[
            :ConsumerTag => TAMQPConsumerTag
            , :NoWait => TAMQPNoWait
        ]) # method Cancel
        , 31 => MethodSpec(31, :CancelOk, :Nothing, Pair{Symbol,DataType}[
            :ConsumerTag => TAMQPConsumerTag
        ]) # method CancelOk
        , 40 => MethodSpec(40, :Publish, :Nothing, Pair{Symbol,DataType}[
            :Reserved1 => Int16
            , :Exchange => TAMQPExchangeName
            , :RoutingKey => TAMQPShortStr
            , :Mandatory => TAMQPBit
            , :Immediate => TAMQPBit
        ]) # method Publish
        , 50 => MethodSpec(50, :Return, :Nothing, Pair{Symbol,DataType}[
            :ReplyCode => TAMQPReplyCode
            , :ReplyText => TAMQPReplyText
            , :Exchange => TAMQPExchangeName
            , :RoutingKey => TAMQPShortStr
        ]) # method Return
        , 60 => MethodSpec(60, :Deliver, :Nothing, Pair{Symbol,DataType}[
            :ConsumerTag => TAMQPConsumerTag
            , :DeliveryTag => TAMQPDeliveryTag
            , :Redelivered => TAMQPRedelivered
            , :Exchange => TAMQPExchangeName
            , :RoutingKey => TAMQPShortStr
        ]) # method Deliver
        , 70 => MethodSpec(70, :Get, :GetOk, Pair{Symbol,DataType}[
            :Reserved1 => Int16
            , :Queue => TAMQPQueueName
            , :NoAck => TAMQPNoAck
        ]) # method Get
        , 71 => MethodSpec(71, :GetOk, :Nothing, Pair{Symbol,DataType}[
            :DeliveryTag => TAMQPDeliveryTag
            , :Redelivered => TAMQPRedelivered
            , :Exchange => TAMQPExchangeName
            , :RoutingKey => TAMQPShortStr
            , :MessageCount => TAMQPMessageCount
        ]) # method GetOk
        , 72 => MethodSpec(72, :GetEmpty, :Nothing, Pair{Symbol,DataType}[
            :Reserved1 => TAMQPShortStr
        ]) # method GetEmpty
        , 80 => MethodSpec(80, :Ack, :Nothing, Pair{Symbol,DataType}[
            :DeliveryTag => TAMQPDeliveryTag
            , :Multiple => TAMQPBit
        ]) # method Ack
        , 90 => MethodSpec(90, :Reject, :Nothing, Pair{Symbol,DataType}[
            :DeliveryTag => TAMQPDeliveryTag
            , :Requeue => TAMQPBit
        ]) # method Reject
        , 100 => MethodSpec(100, :RecoverAsync, :Nothing, Pair{Symbol,DataType}[
            :Requeue => TAMQPBit
        ]) # method RecoverAsync
        , 110 => MethodSpec(110, :Recover, :Nothing, Pair{Symbol,DataType}[
            :Requeue => TAMQPBit
        ]) # method Recover
        , 111 => MethodSpec(111, :RecoverOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method RecoverOk
        , 120 => MethodSpec(120, :Nack, :Nothing, Pair{Symbol,DataType}[
            :DeliveryTag => TAMQPDeliveryTag
            , :Multiple => TAMQPBit
            , :Requeue => TAMQPBit
        ]) # method Nack
    )) # class Basic
    , 90 => ClassSpec(90, :Tx, Dict{TAMQPMethodId, MethodSpec}(
        10 => MethodSpec(10, :Select, :SelectOk, Pair{Symbol,DataType}[
        ]) # method Select
        , 11 => MethodSpec(11, :SelectOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method SelectOk
        , 20 => MethodSpec(20, :Commit, :CommitOk, Pair{Symbol,DataType}[
        ]) # method Commit
        , 21 => MethodSpec(21, :CommitOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method CommitOk
        , 30 => MethodSpec(30, :Rollback, :RollbackOk, Pair{Symbol,DataType}[
        ]) # method Rollback
        , 31 => MethodSpec(31, :RollbackOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method RollbackOk
    )) # class Tx
    , 85 => ClassSpec(85, :Confirm, Dict{TAMQPMethodId, MethodSpec}(
        10 => MethodSpec(10, :Select, :SelectOk, Pair{Symbol,DataType}[
            :Nowait => TAMQPBit
        ]) # method Select
        , 11 => MethodSpec(11, :SelectOk, :Nothing, Pair{Symbol,DataType}[
        ]) # method SelectOk
    )) # class Confirm
) # CLASS_MAP")

function make_classmethod_map()
    cmmap = Dict{Tuple{Symbol,Symbol},MethodSpec}()
    for v in values(CLASS_MAP)
        for m in values(v.method_map)
            cmmap[(v.name,m.name)] = m
        end
    end
    cmmap
end

const CLASSNAME_MAP = Dict{Symbol,ClassSpec}(v.name => v for v in values(CLASS_MAP))
const CLASSMETHODNAME_MAP = make_classmethod_map()
# end Classes

# end generated code
