{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

Support for proxied 'GI.Gio.Objects.InetSocketAddress.InetSocketAddress'.
-}

module GI.Gio.Objects.ProxyAddress
    ( 

-- * Exported types
    ProxyAddress(..)                        ,
    IsProxyAddress                          ,
    toProxyAddress                          ,
    noProxyAddress                          ,


 -- * Methods
-- ** getDestinationHostname #method:getDestinationHostname#
    ProxyAddressGetDestinationHostnameMethodInfo,
    proxyAddressGetDestinationHostname      ,


-- ** getDestinationPort #method:getDestinationPort#
    ProxyAddressGetDestinationPortMethodInfo,
    proxyAddressGetDestinationPort          ,


-- ** getDestinationProtocol #method:getDestinationProtocol#
    ProxyAddressGetDestinationProtocolMethodInfo,
    proxyAddressGetDestinationProtocol      ,


-- ** getPassword #method:getPassword#
    ProxyAddressGetPasswordMethodInfo       ,
    proxyAddressGetPassword                 ,


-- ** getProtocol #method:getProtocol#
    ProxyAddressGetProtocolMethodInfo       ,
    proxyAddressGetProtocol                 ,


-- ** getUri #method:getUri#
    ProxyAddressGetUriMethodInfo            ,
    proxyAddressGetUri                      ,


-- ** getUsername #method:getUsername#
    ProxyAddressGetUsernameMethodInfo       ,
    proxyAddressGetUsername                 ,


-- ** new #method:new#
    proxyAddressNew                         ,




 -- * Properties
-- ** destinationHostname #attr:destinationHostname#
    ProxyAddressDestinationHostnamePropertyInfo,
    constructProxyAddressDestinationHostname,
    getProxyAddressDestinationHostname      ,
    proxyAddressDestinationHostname         ,


-- ** destinationPort #attr:destinationPort#
    ProxyAddressDestinationPortPropertyInfo ,
    constructProxyAddressDestinationPort    ,
    getProxyAddressDestinationPort          ,
    proxyAddressDestinationPort             ,


-- ** destinationProtocol #attr:destinationProtocol#
    ProxyAddressDestinationProtocolPropertyInfo,
    constructProxyAddressDestinationProtocol,
    getProxyAddressDestinationProtocol      ,
    proxyAddressDestinationProtocol         ,


-- ** password #attr:password#
    ProxyAddressPasswordPropertyInfo        ,
    constructProxyAddressPassword           ,
    getProxyAddressPassword                 ,
    proxyAddressPassword                    ,


-- ** protocol #attr:protocol#
    ProxyAddressProtocolPropertyInfo        ,
    constructProxyAddressProtocol           ,
    getProxyAddressProtocol                 ,
    proxyAddressProtocol                    ,


-- ** uri #attr:uri#
    ProxyAddressUriPropertyInfo             ,
    constructProxyAddressUri                ,
    getProxyAddressUri                      ,
    proxyAddressUri                         ,


-- ** username #attr:username#
    ProxyAddressUsernamePropertyInfo        ,
    constructProxyAddressUsername           ,
    getProxyAddressUsername                 ,
    proxyAddressUsername                    ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.SocketConnectable as Gio.SocketConnectable
import {-# SOURCE #-} qualified GI.Gio.Objects.InetAddress as Gio.InetAddress
import {-# SOURCE #-} qualified GI.Gio.Objects.InetSocketAddress as Gio.InetSocketAddress
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddress as Gio.SocketAddress

newtype ProxyAddress = ProxyAddress (ManagedPtr ProxyAddress)
foreign import ccall "g_proxy_address_get_type"
    c_g_proxy_address_get_type :: IO GType

instance GObject ProxyAddress where
    gobjectType _ = c_g_proxy_address_get_type
    

class GObject o => IsProxyAddress o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError ProxyAddress a) =>
    IsProxyAddress a
#endif
instance IsProxyAddress ProxyAddress
instance Gio.InetSocketAddress.IsInetSocketAddress ProxyAddress
instance Gio.SocketAddress.IsSocketAddress ProxyAddress
instance GObject.Object.IsObject ProxyAddress
instance Gio.SocketConnectable.IsSocketConnectable ProxyAddress

toProxyAddress :: IsProxyAddress o => o -> IO ProxyAddress
toProxyAddress = unsafeCastTo ProxyAddress

noProxyAddress :: Maybe ProxyAddress
noProxyAddress = Nothing

type family ResolveProxyAddressMethod (t :: Symbol) (o :: *) :: * where
    ResolveProxyAddressMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveProxyAddressMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveProxyAddressMethod "enumerate" o = Gio.SocketConnectable.SocketConnectableEnumerateMethodInfo
    ResolveProxyAddressMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveProxyAddressMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveProxyAddressMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveProxyAddressMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveProxyAddressMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveProxyAddressMethod "proxyEnumerate" o = Gio.SocketConnectable.SocketConnectableProxyEnumerateMethodInfo
    ResolveProxyAddressMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveProxyAddressMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveProxyAddressMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveProxyAddressMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveProxyAddressMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveProxyAddressMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveProxyAddressMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveProxyAddressMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveProxyAddressMethod "toNative" o = Gio.SocketAddress.SocketAddressToNativeMethodInfo
    ResolveProxyAddressMethod "toString" o = Gio.SocketConnectable.SocketConnectableToStringMethodInfo
    ResolveProxyAddressMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveProxyAddressMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveProxyAddressMethod "getAddress" o = Gio.InetSocketAddress.InetSocketAddressGetAddressMethodInfo
    ResolveProxyAddressMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveProxyAddressMethod "getDestinationHostname" o = ProxyAddressGetDestinationHostnameMethodInfo
    ResolveProxyAddressMethod "getDestinationPort" o = ProxyAddressGetDestinationPortMethodInfo
    ResolveProxyAddressMethod "getDestinationProtocol" o = ProxyAddressGetDestinationProtocolMethodInfo
    ResolveProxyAddressMethod "getFamily" o = Gio.SocketAddress.SocketAddressGetFamilyMethodInfo
    ResolveProxyAddressMethod "getFlowinfo" o = Gio.InetSocketAddress.InetSocketAddressGetFlowinfoMethodInfo
    ResolveProxyAddressMethod "getNativeSize" o = Gio.SocketAddress.SocketAddressGetNativeSizeMethodInfo
    ResolveProxyAddressMethod "getPassword" o = ProxyAddressGetPasswordMethodInfo
    ResolveProxyAddressMethod "getPort" o = Gio.InetSocketAddress.InetSocketAddressGetPortMethodInfo
    ResolveProxyAddressMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveProxyAddressMethod "getProtocol" o = ProxyAddressGetProtocolMethodInfo
    ResolveProxyAddressMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveProxyAddressMethod "getScopeId" o = Gio.InetSocketAddress.InetSocketAddressGetScopeIdMethodInfo
    ResolveProxyAddressMethod "getUri" o = ProxyAddressGetUriMethodInfo
    ResolveProxyAddressMethod "getUsername" o = ProxyAddressGetUsernameMethodInfo
    ResolveProxyAddressMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveProxyAddressMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveProxyAddressMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveProxyAddressMethod t ProxyAddress, O.MethodInfo info ProxyAddress p) => O.IsLabelProxy t (ProxyAddress -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveProxyAddressMethod t ProxyAddress, O.MethodInfo info ProxyAddress p) => O.IsLabel t (ProxyAddress -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- VVV Prop "destination-hostname"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

getProxyAddressDestinationHostname :: (MonadIO m, IsProxyAddress o) => o -> m T.Text
getProxyAddressDestinationHostname obj = liftIO $ checkUnexpectedNothing "getProxyAddressDestinationHostname" $ getObjectPropertyString obj "destination-hostname"

constructProxyAddressDestinationHostname :: (IsProxyAddress o) => T.Text -> IO (GValueConstruct o)
constructProxyAddressDestinationHostname val = constructObjectPropertyString "destination-hostname" (Just val)

data ProxyAddressDestinationHostnamePropertyInfo
instance AttrInfo ProxyAddressDestinationHostnamePropertyInfo where
    type AttrAllowedOps ProxyAddressDestinationHostnamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ProxyAddressDestinationHostnamePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint ProxyAddressDestinationHostnamePropertyInfo = IsProxyAddress
    type AttrGetType ProxyAddressDestinationHostnamePropertyInfo = T.Text
    type AttrLabel ProxyAddressDestinationHostnamePropertyInfo = "destination-hostname"
    type AttrOrigin ProxyAddressDestinationHostnamePropertyInfo = ProxyAddress
    attrGet _ = getProxyAddressDestinationHostname
    attrSet _ = undefined
    attrConstruct _ = constructProxyAddressDestinationHostname
    attrClear _ = undefined

-- VVV Prop "destination-port"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getProxyAddressDestinationPort :: (MonadIO m, IsProxyAddress o) => o -> m Word32
getProxyAddressDestinationPort obj = liftIO $ getObjectPropertyUInt32 obj "destination-port"

constructProxyAddressDestinationPort :: (IsProxyAddress o) => Word32 -> IO (GValueConstruct o)
constructProxyAddressDestinationPort val = constructObjectPropertyUInt32 "destination-port" val

data ProxyAddressDestinationPortPropertyInfo
instance AttrInfo ProxyAddressDestinationPortPropertyInfo where
    type AttrAllowedOps ProxyAddressDestinationPortPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ProxyAddressDestinationPortPropertyInfo = (~) Word32
    type AttrBaseTypeConstraint ProxyAddressDestinationPortPropertyInfo = IsProxyAddress
    type AttrGetType ProxyAddressDestinationPortPropertyInfo = Word32
    type AttrLabel ProxyAddressDestinationPortPropertyInfo = "destination-port"
    type AttrOrigin ProxyAddressDestinationPortPropertyInfo = ProxyAddress
    attrGet _ = getProxyAddressDestinationPort
    attrSet _ = undefined
    attrConstruct _ = constructProxyAddressDestinationPort
    attrClear _ = undefined

-- VVV Prop "destination-protocol"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

getProxyAddressDestinationProtocol :: (MonadIO m, IsProxyAddress o) => o -> m T.Text
getProxyAddressDestinationProtocol obj = liftIO $ checkUnexpectedNothing "getProxyAddressDestinationProtocol" $ getObjectPropertyString obj "destination-protocol"

constructProxyAddressDestinationProtocol :: (IsProxyAddress o) => T.Text -> IO (GValueConstruct o)
constructProxyAddressDestinationProtocol val = constructObjectPropertyString "destination-protocol" (Just val)

data ProxyAddressDestinationProtocolPropertyInfo
instance AttrInfo ProxyAddressDestinationProtocolPropertyInfo where
    type AttrAllowedOps ProxyAddressDestinationProtocolPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ProxyAddressDestinationProtocolPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint ProxyAddressDestinationProtocolPropertyInfo = IsProxyAddress
    type AttrGetType ProxyAddressDestinationProtocolPropertyInfo = T.Text
    type AttrLabel ProxyAddressDestinationProtocolPropertyInfo = "destination-protocol"
    type AttrOrigin ProxyAddressDestinationProtocolPropertyInfo = ProxyAddress
    attrGet _ = getProxyAddressDestinationProtocol
    attrSet _ = undefined
    attrConstruct _ = constructProxyAddressDestinationProtocol
    attrClear _ = undefined

-- VVV Prop "password"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

getProxyAddressPassword :: (MonadIO m, IsProxyAddress o) => o -> m T.Text
getProxyAddressPassword obj = liftIO $ checkUnexpectedNothing "getProxyAddressPassword" $ getObjectPropertyString obj "password"

constructProxyAddressPassword :: (IsProxyAddress o) => T.Text -> IO (GValueConstruct o)
constructProxyAddressPassword val = constructObjectPropertyString "password" (Just val)

data ProxyAddressPasswordPropertyInfo
instance AttrInfo ProxyAddressPasswordPropertyInfo where
    type AttrAllowedOps ProxyAddressPasswordPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ProxyAddressPasswordPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint ProxyAddressPasswordPropertyInfo = IsProxyAddress
    type AttrGetType ProxyAddressPasswordPropertyInfo = T.Text
    type AttrLabel ProxyAddressPasswordPropertyInfo = "password"
    type AttrOrigin ProxyAddressPasswordPropertyInfo = ProxyAddress
    attrGet _ = getProxyAddressPassword
    attrSet _ = undefined
    attrConstruct _ = constructProxyAddressPassword
    attrClear _ = undefined

-- VVV Prop "protocol"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

getProxyAddressProtocol :: (MonadIO m, IsProxyAddress o) => o -> m T.Text
getProxyAddressProtocol obj = liftIO $ checkUnexpectedNothing "getProxyAddressProtocol" $ getObjectPropertyString obj "protocol"

constructProxyAddressProtocol :: (IsProxyAddress o) => T.Text -> IO (GValueConstruct o)
constructProxyAddressProtocol val = constructObjectPropertyString "protocol" (Just val)

data ProxyAddressProtocolPropertyInfo
instance AttrInfo ProxyAddressProtocolPropertyInfo where
    type AttrAllowedOps ProxyAddressProtocolPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ProxyAddressProtocolPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint ProxyAddressProtocolPropertyInfo = IsProxyAddress
    type AttrGetType ProxyAddressProtocolPropertyInfo = T.Text
    type AttrLabel ProxyAddressProtocolPropertyInfo = "protocol"
    type AttrOrigin ProxyAddressProtocolPropertyInfo = ProxyAddress
    attrGet _ = getProxyAddressProtocol
    attrSet _ = undefined
    attrConstruct _ = constructProxyAddressProtocol
    attrClear _ = undefined

-- VVV Prop "uri"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

getProxyAddressUri :: (MonadIO m, IsProxyAddress o) => o -> m T.Text
getProxyAddressUri obj = liftIO $ checkUnexpectedNothing "getProxyAddressUri" $ getObjectPropertyString obj "uri"

constructProxyAddressUri :: (IsProxyAddress o) => T.Text -> IO (GValueConstruct o)
constructProxyAddressUri val = constructObjectPropertyString "uri" (Just val)

data ProxyAddressUriPropertyInfo
instance AttrInfo ProxyAddressUriPropertyInfo where
    type AttrAllowedOps ProxyAddressUriPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ProxyAddressUriPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint ProxyAddressUriPropertyInfo = IsProxyAddress
    type AttrGetType ProxyAddressUriPropertyInfo = T.Text
    type AttrLabel ProxyAddressUriPropertyInfo = "uri"
    type AttrOrigin ProxyAddressUriPropertyInfo = ProxyAddress
    attrGet _ = getProxyAddressUri
    attrSet _ = undefined
    attrConstruct _ = constructProxyAddressUri
    attrClear _ = undefined

-- VVV Prop "username"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

getProxyAddressUsername :: (MonadIO m, IsProxyAddress o) => o -> m T.Text
getProxyAddressUsername obj = liftIO $ checkUnexpectedNothing "getProxyAddressUsername" $ getObjectPropertyString obj "username"

constructProxyAddressUsername :: (IsProxyAddress o) => T.Text -> IO (GValueConstruct o)
constructProxyAddressUsername val = constructObjectPropertyString "username" (Just val)

data ProxyAddressUsernamePropertyInfo
instance AttrInfo ProxyAddressUsernamePropertyInfo where
    type AttrAllowedOps ProxyAddressUsernamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ProxyAddressUsernamePropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint ProxyAddressUsernamePropertyInfo = IsProxyAddress
    type AttrGetType ProxyAddressUsernamePropertyInfo = T.Text
    type AttrLabel ProxyAddressUsernamePropertyInfo = "username"
    type AttrOrigin ProxyAddressUsernamePropertyInfo = ProxyAddress
    attrGet _ = getProxyAddressUsername
    attrSet _ = undefined
    attrConstruct _ = constructProxyAddressUsername
    attrClear _ = undefined

instance O.HasAttributeList ProxyAddress
type instance O.AttributeList ProxyAddress = ProxyAddressAttributeList
type ProxyAddressAttributeList = ('[ '("address", Gio.InetSocketAddress.InetSocketAddressAddressPropertyInfo), '("destinationHostname", ProxyAddressDestinationHostnamePropertyInfo), '("destinationPort", ProxyAddressDestinationPortPropertyInfo), '("destinationProtocol", ProxyAddressDestinationProtocolPropertyInfo), '("family", Gio.SocketAddress.SocketAddressFamilyPropertyInfo), '("flowinfo", Gio.InetSocketAddress.InetSocketAddressFlowinfoPropertyInfo), '("password", ProxyAddressPasswordPropertyInfo), '("port", Gio.InetSocketAddress.InetSocketAddressPortPropertyInfo), '("protocol", ProxyAddressProtocolPropertyInfo), '("scopeId", Gio.InetSocketAddress.InetSocketAddressScopeIdPropertyInfo), '("uri", ProxyAddressUriPropertyInfo), '("username", ProxyAddressUsernamePropertyInfo)] :: [(Symbol, *)])

proxyAddressDestinationHostname :: AttrLabelProxy "destinationHostname"
proxyAddressDestinationHostname = AttrLabelProxy

proxyAddressDestinationPort :: AttrLabelProxy "destinationPort"
proxyAddressDestinationPort = AttrLabelProxy

proxyAddressDestinationProtocol :: AttrLabelProxy "destinationProtocol"
proxyAddressDestinationProtocol = AttrLabelProxy

proxyAddressPassword :: AttrLabelProxy "password"
proxyAddressPassword = AttrLabelProxy

proxyAddressProtocol :: AttrLabelProxy "protocol"
proxyAddressProtocol = AttrLabelProxy

proxyAddressUri :: AttrLabelProxy "uri"
proxyAddressUri = AttrLabelProxy

proxyAddressUsername :: AttrLabelProxy "username"
proxyAddressUsername = AttrLabelProxy

type instance O.SignalList ProxyAddress = ProxyAddressSignalList
type ProxyAddressSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method ProxyAddress::new
-- method type : Constructor
-- Args : [Arg {argCName = "inetaddr", argType = TInterface (Name {namespace = "Gio", name = "InetAddress"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The proxy server #GInetAddress.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "port", argType = TBasicType TUInt16, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The proxy server port.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "protocol", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The proxy protocol to support, in lower case (e.g. socks, http).", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dest_hostname", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The destination hostname the proxy should tunnel to.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "dest_port", argType = TBasicType TUInt16, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The destination port to tunnel to.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "username", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The username to authenticate to the proxy server\n    (or %NULL).", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "password", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "The password to authenticate to the proxy server\n    (or %NULL).", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "ProxyAddress"}))
-- throws : False
-- Skip return : False

foreign import ccall "g_proxy_address_new" g_proxy_address_new :: 
    Ptr Gio.InetAddress.InetAddress ->      -- inetaddr : TInterface (Name {namespace = "Gio", name = "InetAddress"})
    Word16 ->                               -- port : TBasicType TUInt16
    CString ->                              -- protocol : TBasicType TUTF8
    CString ->                              -- dest_hostname : TBasicType TUTF8
    Word16 ->                               -- dest_port : TBasicType TUInt16
    CString ->                              -- username : TBasicType TUTF8
    CString ->                              -- password : TBasicType TUTF8
    IO (Ptr ProxyAddress)

{- |
Creates a new 'GI.Gio.Objects.ProxyAddress.ProxyAddress' for /@inetaddr@/ with /@protocol@/ that should
tunnel through /@destHostname@/ and /@destPort@/.

(Note that this method doesn\'t set the 'GI.Gio.Objects.ProxyAddress.ProxyAddress':@/uri/@ or
'GI.Gio.Objects.ProxyAddress.ProxyAddress':@/destination-protocol/@ fields; use @/g_object_new()/@
directly if you want to set those.)

@since 2.26
-}
proxyAddressNew ::
    (B.CallStack.HasCallStack, MonadIO m, Gio.InetAddress.IsInetAddress a) =>
    a
    {- ^ /@inetaddr@/: The proxy server 'GI.Gio.Objects.InetAddress.InetAddress'. -}
    -> Word16
    {- ^ /@port@/: The proxy server port. -}
    -> T.Text
    {- ^ /@protocol@/: The proxy protocol to support, in lower case (e.g. socks, http). -}
    -> T.Text
    {- ^ /@destHostname@/: The destination hostname the proxy should tunnel to. -}
    -> Word16
    {- ^ /@destPort@/: The destination port to tunnel to. -}
    -> Maybe (T.Text)
    {- ^ /@username@/: The username to authenticate to the proxy server
    (or 'Nothing'). -}
    -> Maybe (T.Text)
    {- ^ /@password@/: The password to authenticate to the proxy server
    (or 'Nothing'). -}
    -> m ProxyAddress
    {- ^ __Returns:__ a new 'GI.Gio.Objects.ProxyAddress.ProxyAddress' -}
proxyAddressNew inetaddr port protocol destHostname destPort username password = liftIO $ do
    inetaddr' <- unsafeManagedPtrCastPtr inetaddr
    protocol' <- textToCString protocol
    destHostname' <- textToCString destHostname
    maybeUsername <- case username of
        Nothing -> return nullPtr
        Just jUsername -> do
            jUsername' <- textToCString jUsername
            return jUsername'
    maybePassword <- case password of
        Nothing -> return nullPtr
        Just jPassword -> do
            jPassword' <- textToCString jPassword
            return jPassword'
    result <- g_proxy_address_new inetaddr' port protocol' destHostname' destPort maybeUsername maybePassword
    checkUnexpectedReturnNULL "proxyAddressNew" result
    result' <- (wrapObject ProxyAddress) result
    touchManagedPtr inetaddr
    freeMem protocol'
    freeMem destHostname'
    freeMem maybeUsername
    freeMem maybePassword
    return result'

-- method ProxyAddress::get_destination_hostname
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proxy", argType = TInterface (Name {namespace = "Gio", name = "ProxyAddress"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GProxyAddress", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "g_proxy_address_get_destination_hostname" g_proxy_address_get_destination_hostname :: 
    Ptr ProxyAddress ->                     -- proxy : TInterface (Name {namespace = "Gio", name = "ProxyAddress"})
    IO CString

{- |
Gets /@proxy@/\'s destination hostname; that is, the name of the host
that will be connected to via the proxy, not the name of the proxy
itself.

@since 2.26
-}
proxyAddressGetDestinationHostname ::
    (B.CallStack.HasCallStack, MonadIO m, IsProxyAddress a) =>
    a
    {- ^ /@proxy@/: a 'GI.Gio.Objects.ProxyAddress.ProxyAddress' -}
    -> m T.Text
    {- ^ __Returns:__ the /@proxy@/\'s destination hostname -}
proxyAddressGetDestinationHostname proxy = liftIO $ do
    proxy' <- unsafeManagedPtrCastPtr proxy
    result <- g_proxy_address_get_destination_hostname proxy'
    checkUnexpectedReturnNULL "proxyAddressGetDestinationHostname" result
    result' <- cstringToText result
    touchManagedPtr proxy
    return result'

data ProxyAddressGetDestinationHostnameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsProxyAddress a) => O.MethodInfo ProxyAddressGetDestinationHostnameMethodInfo a signature where
    overloadedMethod _ = proxyAddressGetDestinationHostname

-- method ProxyAddress::get_destination_port
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proxy", argType = TInterface (Name {namespace = "Gio", name = "ProxyAddress"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GProxyAddress", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt16)
-- throws : False
-- Skip return : False

foreign import ccall "g_proxy_address_get_destination_port" g_proxy_address_get_destination_port :: 
    Ptr ProxyAddress ->                     -- proxy : TInterface (Name {namespace = "Gio", name = "ProxyAddress"})
    IO Word16

{- |
Gets /@proxy@/\'s destination port; that is, the port on the
destination host that will be connected to via the proxy, not the
port number of the proxy itself.

@since 2.26
-}
proxyAddressGetDestinationPort ::
    (B.CallStack.HasCallStack, MonadIO m, IsProxyAddress a) =>
    a
    {- ^ /@proxy@/: a 'GI.Gio.Objects.ProxyAddress.ProxyAddress' -}
    -> m Word16
    {- ^ __Returns:__ the /@proxy@/\'s destination port -}
proxyAddressGetDestinationPort proxy = liftIO $ do
    proxy' <- unsafeManagedPtrCastPtr proxy
    result <- g_proxy_address_get_destination_port proxy'
    touchManagedPtr proxy
    return result

data ProxyAddressGetDestinationPortMethodInfo
instance (signature ~ (m Word16), MonadIO m, IsProxyAddress a) => O.MethodInfo ProxyAddressGetDestinationPortMethodInfo a signature where
    overloadedMethod _ = proxyAddressGetDestinationPort

-- method ProxyAddress::get_destination_protocol
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proxy", argType = TInterface (Name {namespace = "Gio", name = "ProxyAddress"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GProxyAddress", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "g_proxy_address_get_destination_protocol" g_proxy_address_get_destination_protocol :: 
    Ptr ProxyAddress ->                     -- proxy : TInterface (Name {namespace = "Gio", name = "ProxyAddress"})
    IO CString

{- |
Gets the protocol that is being spoken to the destination
server; eg, \"http\" or \"ftp\".

@since 2.34
-}
proxyAddressGetDestinationProtocol ::
    (B.CallStack.HasCallStack, MonadIO m, IsProxyAddress a) =>
    a
    {- ^ /@proxy@/: a 'GI.Gio.Objects.ProxyAddress.ProxyAddress' -}
    -> m T.Text
    {- ^ __Returns:__ the /@proxy@/\'s destination protocol -}
proxyAddressGetDestinationProtocol proxy = liftIO $ do
    proxy' <- unsafeManagedPtrCastPtr proxy
    result <- g_proxy_address_get_destination_protocol proxy'
    checkUnexpectedReturnNULL "proxyAddressGetDestinationProtocol" result
    result' <- cstringToText result
    touchManagedPtr proxy
    return result'

data ProxyAddressGetDestinationProtocolMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsProxyAddress a) => O.MethodInfo ProxyAddressGetDestinationProtocolMethodInfo a signature where
    overloadedMethod _ = proxyAddressGetDestinationProtocol

-- method ProxyAddress::get_password
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proxy", argType = TInterface (Name {namespace = "Gio", name = "ProxyAddress"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GProxyAddress", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "g_proxy_address_get_password" g_proxy_address_get_password :: 
    Ptr ProxyAddress ->                     -- proxy : TInterface (Name {namespace = "Gio", name = "ProxyAddress"})
    IO CString

{- |
Gets /@proxy@/\'s password.

@since 2.26
-}
proxyAddressGetPassword ::
    (B.CallStack.HasCallStack, MonadIO m, IsProxyAddress a) =>
    a
    {- ^ /@proxy@/: a 'GI.Gio.Objects.ProxyAddress.ProxyAddress' -}
    -> m T.Text
    {- ^ __Returns:__ the /@proxy@/\'s password -}
proxyAddressGetPassword proxy = liftIO $ do
    proxy' <- unsafeManagedPtrCastPtr proxy
    result <- g_proxy_address_get_password proxy'
    checkUnexpectedReturnNULL "proxyAddressGetPassword" result
    result' <- cstringToText result
    touchManagedPtr proxy
    return result'

data ProxyAddressGetPasswordMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsProxyAddress a) => O.MethodInfo ProxyAddressGetPasswordMethodInfo a signature where
    overloadedMethod _ = proxyAddressGetPassword

-- method ProxyAddress::get_protocol
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proxy", argType = TInterface (Name {namespace = "Gio", name = "ProxyAddress"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GProxyAddress", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "g_proxy_address_get_protocol" g_proxy_address_get_protocol :: 
    Ptr ProxyAddress ->                     -- proxy : TInterface (Name {namespace = "Gio", name = "ProxyAddress"})
    IO CString

{- |
Gets /@proxy@/\'s protocol. eg, \"socks\" or \"http\"

@since 2.26
-}
proxyAddressGetProtocol ::
    (B.CallStack.HasCallStack, MonadIO m, IsProxyAddress a) =>
    a
    {- ^ /@proxy@/: a 'GI.Gio.Objects.ProxyAddress.ProxyAddress' -}
    -> m T.Text
    {- ^ __Returns:__ the /@proxy@/\'s protocol -}
proxyAddressGetProtocol proxy = liftIO $ do
    proxy' <- unsafeManagedPtrCastPtr proxy
    result <- g_proxy_address_get_protocol proxy'
    checkUnexpectedReturnNULL "proxyAddressGetProtocol" result
    result' <- cstringToText result
    touchManagedPtr proxy
    return result'

data ProxyAddressGetProtocolMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsProxyAddress a) => O.MethodInfo ProxyAddressGetProtocolMethodInfo a signature where
    overloadedMethod _ = proxyAddressGetProtocol

-- method ProxyAddress::get_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proxy", argType = TInterface (Name {namespace = "Gio", name = "ProxyAddress"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GProxyAddress", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "g_proxy_address_get_uri" g_proxy_address_get_uri :: 
    Ptr ProxyAddress ->                     -- proxy : TInterface (Name {namespace = "Gio", name = "ProxyAddress"})
    IO CString

{- |
Gets the proxy URI that /@proxy@/ was constructed from.

@since 2.34
-}
proxyAddressGetUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsProxyAddress a) =>
    a
    {- ^ /@proxy@/: a 'GI.Gio.Objects.ProxyAddress.ProxyAddress' -}
    -> m T.Text
    {- ^ __Returns:__ the /@proxy@/\'s URI, or 'Nothing' if unknown -}
proxyAddressGetUri proxy = liftIO $ do
    proxy' <- unsafeManagedPtrCastPtr proxy
    result <- g_proxy_address_get_uri proxy'
    checkUnexpectedReturnNULL "proxyAddressGetUri" result
    result' <- cstringToText result
    touchManagedPtr proxy
    return result'

data ProxyAddressGetUriMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsProxyAddress a) => O.MethodInfo ProxyAddressGetUriMethodInfo a signature where
    overloadedMethod _ = proxyAddressGetUri

-- method ProxyAddress::get_username
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "proxy", argType = TInterface (Name {namespace = "Gio", name = "ProxyAddress"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GProxyAddress", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "g_proxy_address_get_username" g_proxy_address_get_username :: 
    Ptr ProxyAddress ->                     -- proxy : TInterface (Name {namespace = "Gio", name = "ProxyAddress"})
    IO CString

{- |
Gets /@proxy@/\'s username.

@since 2.26
-}
proxyAddressGetUsername ::
    (B.CallStack.HasCallStack, MonadIO m, IsProxyAddress a) =>
    a
    {- ^ /@proxy@/: a 'GI.Gio.Objects.ProxyAddress.ProxyAddress' -}
    -> m T.Text
    {- ^ __Returns:__ the /@proxy@/\'s username -}
proxyAddressGetUsername proxy = liftIO $ do
    proxy' <- unsafeManagedPtrCastPtr proxy
    result <- g_proxy_address_get_username proxy'
    checkUnexpectedReturnNULL "proxyAddressGetUsername" result
    result' <- cstringToText result
    touchManagedPtr proxy
    return result'

data ProxyAddressGetUsernameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsProxyAddress a) => O.MethodInfo ProxyAddressGetUsernameMethodInfo a signature where
    overloadedMethod _ = proxyAddressGetUsername