{
    "content": [
        {
            "type": "text",
            "text": "# Net::XMPP::IQ (perldoc)\n\n## NAME\n\nNet::XMPP::IQ - XMPP Info/Query Module\n\n## SYNOPSIS\n\nNet::XMPP::IQ is a companion to the Net::XMPP module. It\nprovides the user a simple interface to set and retrieve all\nparts of an XMPP IQ.\n\n## DESCRIPTION\n\nNet::XMPP::IQ differs from the other Net::XMPP::* modules in that\nthe XMLNS of the query is split out into a submodule under\nIQ.  For specifics on each module please view the documentation\nfor the Net::XMPP::Namespaces module.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (5 subsections)\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::XMPP::IQ",
        "section": "",
        "mode": "perldoc",
        "summary": "Net::XMPP::IQ - XMPP Info/Query Module",
        "synopsis": "Net::XMPP::IQ is a companion to the Net::XMPP module. It\nprovides the user a simple interface to set and retrieve all\nparts of an XMPP IQ.",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 36,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "General functions",
                        "lines": 6
                    },
                    {
                        "name": "Retrieval functions",
                        "lines": 45
                    },
                    {
                        "name": "Creation functions",
                        "lines": 64
                    },
                    {
                        "name": "Removal functions",
                        "lines": 25
                    },
                    {
                        "name": "Test functions",
                        "lines": 33
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Net::XMPP::IQ - XMPP Info/Query Module\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "Net::XMPP::IQ is a companion to the Net::XMPP module. It\nprovides the user a simple interface to set and retrieve all\nparts of an XMPP IQ.\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Net::XMPP::IQ differs from the other Net::XMPP::* modules in that\nthe XMLNS of the query is split out into a submodule under\nIQ.  For specifics on each module please view the documentation\nfor the Net::XMPP::Namespaces module.\n\nA Net::XMPP::IQ object is passed to the callback function for the\nmessage.  Also, the first argument to the callback functions is the\nsession ID from XML::Stream.  There are some cases where you might\nwant this information, like if you created a Client that connects to\ntwo servers at once, or for writing a mini server.\n\nuse Net::XMPP;\n\nsub iq {\nmy ($sid,$IQ) = @;\n.\n.\nmy $reply = $IQ->Reply();\nmy $replyQuery->GetQuery();\n.\n}\n\nYou now have access to all of the retrieval functions available.\n\nTo create a new iq to send to the server:\n\nuse Net::XMPP;\n\n$IQ = Net::XMPP::IQ->new();\n$IQType = $IQ->NewChild( type );\n$IQType->SetXXXXX(\"yyyyy\");\n\nNow you can call the creation functions for the IQ, and for the\n<query/> on the new query object itself.  See below for the <iq/>\nfunctions, and in each query module for those functions.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "General functions",
                        "content": "Reply(%args) - Creates a return <iq/> with the to and from\nfilled in correctly, and a query object already\nadded in.  The %args that you pass are passed\nto SetIQ() and will overwrite the IQ settings\nthat Reply sets.\n"
                    },
                    {
                        "name": "Retrieval functions",
                        "content": "GetTo()      - returns either a string with the JID, or a\nGetTo(\"jid\")   Net::XMPP::JID object for the person who is\ngoing to receive the <iq/>.  To get the JID\nobject set the string to \"jid\", otherwise leave\nblank for the text string.\n\n$to    = $IQ->GetTo();\n$toJID = $IQ->GetTo(\"jid\");\n\nGetFrom()      -  returns either a string with the JID, or a\nGetFrom(\"jid\")    Net::XMPP::JID object for the person who\nsent the <iq/>.  To get the JID object set\nthe string to \"jid\", otherwise leave blank for the\ntext string.\n\n$from    = $IQ->GetFrom();\n$fromJID = $IQ->GetFrom(\"jid\");\n\nGetType() - returns a string with the type <iq/> this is.\n\n$type = $IQ->GetType();\n\nGetID() - returns an integer with the id of the <iq/>.\n\n$id = $IQ->GetID();\n\nGetError() - returns a string with the text description of the error.\n\n$error = $IQ->GetError();\n\nGetErrorCode() - returns a string with the code of error.\n\n$errorCode = $IQ->GetErrorCode();\n\nGetQuery() - returns a Net::XMPP::Stanza object that contains the data\nin the query of the <iq/>.  Basically, it returns the\nfirst child in the <iq/>.\n\n$query = $IQ->GetQuery();\n\nGetQueryXMLNS() - returns a string with the namespace of the query\nfor this <iq/>, if one exists.\n\n$xmlns = $IQ->GetQueryXMLNS();\n"
                    },
                    {
                        "name": "Creation functions",
                        "content": "SetIQ(to=>string|JID,    - set multiple fields in the <iq/> at one\nfrom=>string|JID,    time.  This is a cumulative and over\nid=>string,          writing action.  If you set the \"to\"\ntype=>string,        attribute twice, the second setting is\nerrorcode=>string,   what is used.  If you set the status, and\nerror=>string)       then set the priority then both will be in\nthe <iq/> tag.  For valid settings read the\nspecific Set functions below.\n\n$IQ->SetIQ(type=>\"get\",\nto=>\"bob\\@jabber.org\");\n\n$IQ->SetIQ(to=>\"bob\\@jabber.org\",\nerrorcode=>403,\nerror=>\"Permission Denied\");\n\nSetTo(string) - sets the to attribute.  You can either pass a string\nSetTo(JID)      or a JID object.  They must be a valid Jabber\nIdentifiers or the server will return an error message.\n(ie.  bob@jabber.org, etc...)\n\n$IQ->SetTo(\"bob\\@jabber.org\");\n\nSetFrom(string) - sets the from attribute.  You can either pass a\nSetFrom(JID)      string or a JID object.  They must be a valid JIDs\nor the server will return an error message.\n(ie.  bob@jabber.org, etc...)\n\n$IQ->SetFrom(\"me\\@jabber.org\");\n\nSetType(string) - sets the type attribute.  Valid settings are:\n\nget      request information\nset      set information\nresult   results of a get\nerror    there was an error\n\n$IQ->SetType(\"set\");\n\nSetErrorCode(string) - sets the error code of the <iq/>.\n\n$IQ->SetErrorCode(403);\n\nSetError(string) - sets the error string of the <iq/>.\n\n$IQ->SetError(\"Permission Denied\");\n\nNewChild(string) - creates a new Net::XMPP::Stanza object with the\nnamespace in the string.  In order for this\nfunction to work with a custom namespace, you\nmust define and register that namespace with the\nIQ module.  For more information please read the\ndocumentation for Net::XMPP::Stanza.\n\n$queryObj = $IQ->NewChild(\"jabber:iq:auth\");\n$queryObj = $IQ->NewChild(\"jabber:iq:roster\");\n\nReply(hash) - creates a new IQ object and populates the to/from\nfields.  If you specify a hash the same as with SetIQ\nthen those values will override the Reply values.\n\n$iqReply = $IQ->Reply();\n$iqReply = $IQ->Reply(type=>\"result\");\n"
                    },
                    {
                        "name": "Removal functions",
                        "content": "RemoveTo() - removes the to attribute from the <iq/>.\n\n$IQ->RemoveTo();\n\nRemoveFrom() - removes the from attribute from the <iq/>.\n\n$IQ->RemoveFrom();\n\nRemoveID() - removes the id attribute from the <iq/>.\n\n$IQ->RemoveID();\n\nRemoveType() - removes the type attribute from the <iq/>.\n\n$IQ->RemoveType();\n\nRemoveError() - removes the <error/> element from the <iq/>.\n\n$IQ->RemoveError();\n\nRemoveErrorCode() - removes the code attribute from the <error/>\nelement in the <iq/>.\n\n$IQ->RemoveErrorCode();\n"
                    },
                    {
                        "name": "Test functions",
                        "content": "DefinedTo() - returns 1 if the to attribute is defined in the <iq/>,\n0 otherwise.\n\n$test = $IQ->DefinedTo();\n\nDefinedFrom() - returns 1 if the from attribute is defined in the\n<iq/>, 0 otherwise.\n\n$test = $IQ->DefinedFrom();\n\nDefinedID() - returns 1 if the id attribute is defined in the <iq/>,\n0 otherwise.\n\n$test = $IQ->DefinedID();\n\nDefinedType() - returns 1 if the type attribute is defined in the\n<iq/>, 0 otherwise.\n\n$test = $IQ->DefinedType();\n\nDefinedError() - returns 1 if <error/> is defined in the <iq/>,\n0 otherwise.\n\n$test = $IQ->DefinedError();\n\nDefinedErrorCode() - returns 1 if the code attribute is defined in\n<error/>, 0 otherwise.\n\n$test = $IQ->DefinedErrorCode();\n\nDefinedQuery() - returns 1 if there is at least one namespaced\nchild in the object.\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Originally authored by Ryan Eatmon.\n\nPreviously maintained by Eric Hacker.\n\nCurrently maintained by Darian Anthony Patrick.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "This module is free software, you can redistribute it and/or modify it under the LGPL 2.1.\n",
                "subsections": []
            }
        }
    }
}