{- |
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'.

/Since: 2.26/
-}

#define ENABLE_OVERLOADING \
       (!defined(__HADDOCK_VERSION__))

module GI.Gio.Objects.ProxyAddress
    ( 

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


 -- * Methods
-- ** getDestinationHostname #method:getDestinationHostname#

#if ENABLE_OVERLOADING
    ProxyAddressGetDestinationHostnameMethodInfo,
#endif
    proxyAddressGetDestinationHostname      ,


-- ** getDestinationPort #method:getDestinationPort#

#if ENABLE_OVERLOADING
    ProxyAddressGetDestinationPortMethodInfo,
#endif
    proxyAddressGetDestinationPort          ,


-- ** getDestinationProtocol #method:getDestinationProtocol#

#if ENABLE_OVERLOADING
    ProxyAddressGetDestinationProtocolMethodInfo,
#endif
    proxyAddressGetDestinationProtocol      ,


-- ** getPassword #method:getPassword#

#if ENABLE_OVERLOADING
    ProxyAddressGetPasswordMethodInfo       ,
#endif
    proxyAddressGetPassword                 ,


-- ** getProtocol #method:getProtocol#

#if ENABLE_OVERLOADING
    ProxyAddressGetProtocolMethodInfo       ,
#endif
    proxyAddressGetProtocol                 ,


-- ** getUri #method:getUri#

#if ENABLE_OVERLOADING
    ProxyAddressGetUriMethodInfo            ,
#endif
    proxyAddressGetUri                      ,


-- ** getUsername #method:getUsername#

#if ENABLE_OVERLOADING
    ProxyAddressGetUsernameMethodInfo       ,
#endif
    proxyAddressGetUsername                 ,


-- ** new #method:new#

    proxyAddressNew                         ,




 -- * Properties
-- ** destinationHostname #attr:destinationHostname#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    ProxyAddressDestinationHostnamePropertyInfo,
#endif
    constructProxyAddressDestinationHostname,
    getProxyAddressDestinationHostname      ,
#if ENABLE_OVERLOADING
    proxyAddressDestinationHostname         ,
#endif


-- ** destinationPort #attr:destinationPort#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    ProxyAddressDestinationPortPropertyInfo ,
#endif
    constructProxyAddressDestinationPort    ,
    getProxyAddressDestinationPort          ,
#if ENABLE_OVERLOADING
    proxyAddressDestinationPort             ,
#endif


-- ** destinationProtocol #attr:destinationProtocol#
{- | The protocol being spoke to the destination host, or 'Nothing' if
the 'GI.Gio.Objects.ProxyAddress.ProxyAddress' doesn\'t know.

/Since: 2.34/
-}
#if ENABLE_OVERLOADING
    ProxyAddressDestinationProtocolPropertyInfo,
#endif
    constructProxyAddressDestinationProtocol,
    getProxyAddressDestinationProtocol      ,
#if ENABLE_OVERLOADING
    proxyAddressDestinationProtocol         ,
#endif


-- ** password #attr:password#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    ProxyAddressPasswordPropertyInfo        ,
#endif
    constructProxyAddressPassword           ,
    getProxyAddressPassword                 ,
#if ENABLE_OVERLOADING
    proxyAddressPassword                    ,
#endif


-- ** protocol #attr:protocol#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    ProxyAddressProtocolPropertyInfo        ,
#endif
    constructProxyAddressProtocol           ,
    getProxyAddressProtocol                 ,
#if ENABLE_OVERLOADING
    proxyAddressProtocol                    ,
#endif


-- ** uri #attr:uri#
{- | The URI string that the proxy was constructed from (or 'Nothing'
if the creator didn\'t specify this).

/Since: 2.34/
-}
#if ENABLE_OVERLOADING
    ProxyAddressUriPropertyInfo             ,
#endif
    constructProxyAddressUri                ,
    getProxyAddressUri                      ,
#if ENABLE_OVERLOADING
    proxyAddressUri                         ,
#endif


-- ** username #attr:username#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    ProxyAddressUsernamePropertyInfo        ,
#endif
    constructProxyAddressUsername           ,
    getProxyAddressUsername                 ,
#if ENABLE_OVERLOADING
    proxyAddressUsername                    ,
#endif




    ) 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.GValue as B.GValue
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

-- | Memory-managed wrapper type.
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 :: ProxyAddress -> IO GType
gobjectType _ = IO GType
c_g_proxy_address_get_type
    

-- | Type class for types which can be safely cast to `ProxyAddress`, for instance with `toProxyAddress`.
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

-- | Cast to `ProxyAddress`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toProxyAddress :: (MonadIO m, IsProxyAddress o) => o -> m ProxyAddress
toProxyAddress :: o -> m ProxyAddress
toProxyAddress = IO ProxyAddress -> m ProxyAddress
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ProxyAddress -> m ProxyAddress)
-> (o -> IO ProxyAddress) -> o -> m ProxyAddress
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr ProxyAddress -> ProxyAddress) -> o -> IO ProxyAddress
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr ProxyAddress -> ProxyAddress
ProxyAddress

-- | A convenience alias for `Nothing` :: `Maybe` `ProxyAddress`.
noProxyAddress :: Maybe ProxyAddress
noProxyAddress :: Maybe ProxyAddress
noProxyAddress = Maybe ProxyAddress
forall a. Maybe a
Nothing

#if ENABLE_OVERLOADING
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 "getv" o = GObject.Object.ObjectGetvMethodInfo
    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 "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
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif

#endif

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

{- |
Get the value of the “@destination-hostname@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' proxyAddress #destinationHostname
@
-}
getProxyAddressDestinationHostname :: (MonadIO m, IsProxyAddress o) => o -> m T.Text
getProxyAddressDestinationHostname :: o -> m Text
getProxyAddressDestinationHostname obj :: o
obj = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getProxyAddressDestinationHostname" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
getObjectPropertyString o
obj "destination-hostname"

{- |
Construct a `GValueConstruct` with valid value for the “@destination-hostname@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructProxyAddressDestinationHostname :: (IsProxyAddress o) => T.Text -> IO (GValueConstruct o)
constructProxyAddressDestinationHostname :: Text -> IO (GValueConstruct o)
constructProxyAddressDestinationHostname val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
constructObjectPropertyString "destination-hostname" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

#if ENABLE_OVERLOADING
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
#endif

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

{- |
Get the value of the “@destination-port@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' proxyAddress #destinationPort
@
-}
getProxyAddressDestinationPort :: (MonadIO m, IsProxyAddress o) => o -> m Word32
getProxyAddressDestinationPort :: o -> m Word32
getProxyAddressDestinationPort obj :: o
obj = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word32
forall a. GObject a => a -> String -> IO Word32
getObjectPropertyUInt32 o
obj "destination-port"

{- |
Construct a `GValueConstruct` with valid value for the “@destination-port@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructProxyAddressDestinationPort :: (IsProxyAddress o) => Word32 -> IO (GValueConstruct o)
constructProxyAddressDestinationPort :: Word32 -> IO (GValueConstruct o)
constructProxyAddressDestinationPort val :: Word32
val = String -> Word32 -> IO (GValueConstruct o)
forall o. String -> Word32 -> IO (GValueConstruct o)
constructObjectPropertyUInt32 "destination-port" Word32
val

#if ENABLE_OVERLOADING
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
#endif

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

{- |
Get the value of the “@destination-protocol@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' proxyAddress #destinationProtocol
@
-}
getProxyAddressDestinationProtocol :: (MonadIO m, IsProxyAddress o) => o -> m T.Text
getProxyAddressDestinationProtocol :: o -> m Text
getProxyAddressDestinationProtocol obj :: o
obj = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getProxyAddressDestinationProtocol" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
getObjectPropertyString o
obj "destination-protocol"

{- |
Construct a `GValueConstruct` with valid value for the “@destination-protocol@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructProxyAddressDestinationProtocol :: (IsProxyAddress o) => T.Text -> IO (GValueConstruct o)
constructProxyAddressDestinationProtocol :: Text -> IO (GValueConstruct o)
constructProxyAddressDestinationProtocol val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
constructObjectPropertyString "destination-protocol" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

#if ENABLE_OVERLOADING
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
#endif

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

{- |
Get the value of the “@password@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' proxyAddress #password
@
-}
getProxyAddressPassword :: (MonadIO m, IsProxyAddress o) => o -> m T.Text
getProxyAddressPassword :: o -> m Text
getProxyAddressPassword obj :: o
obj = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getProxyAddressPassword" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
getObjectPropertyString o
obj "password"

{- |
Construct a `GValueConstruct` with valid value for the “@password@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructProxyAddressPassword :: (IsProxyAddress o) => T.Text -> IO (GValueConstruct o)
constructProxyAddressPassword :: Text -> IO (GValueConstruct o)
constructProxyAddressPassword val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
constructObjectPropertyString "password" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

#if ENABLE_OVERLOADING
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
#endif

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

{- |
Get the value of the “@protocol@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' proxyAddress #protocol
@
-}
getProxyAddressProtocol :: (MonadIO m, IsProxyAddress o) => o -> m T.Text
getProxyAddressProtocol :: o -> m Text
getProxyAddressProtocol obj :: o
obj = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getProxyAddressProtocol" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
getObjectPropertyString o
obj "protocol"

{- |
Construct a `GValueConstruct` with valid value for the “@protocol@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructProxyAddressProtocol :: (IsProxyAddress o) => T.Text -> IO (GValueConstruct o)
constructProxyAddressProtocol :: Text -> IO (GValueConstruct o)
constructProxyAddressProtocol val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
constructObjectPropertyString "protocol" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

#if ENABLE_OVERLOADING
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
#endif

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

{- |
Get the value of the “@uri@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' proxyAddress #uri
@
-}
getProxyAddressUri :: (MonadIO m, IsProxyAddress o) => o -> m T.Text
getProxyAddressUri :: o -> m Text
getProxyAddressUri obj :: o
obj = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getProxyAddressUri" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
getObjectPropertyString o
obj "uri"

{- |
Construct a `GValueConstruct` with valid value for the “@uri@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructProxyAddressUri :: (IsProxyAddress o) => T.Text -> IO (GValueConstruct o)
constructProxyAddressUri :: Text -> IO (GValueConstruct o)
constructProxyAddressUri val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
constructObjectPropertyString "uri" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

#if ENABLE_OVERLOADING
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
#endif

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

{- |
Get the value of the “@username@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' proxyAddress #username
@
-}
getProxyAddressUsername :: (MonadIO m, IsProxyAddress o) => o -> m T.Text
getProxyAddressUsername :: o -> m Text
getProxyAddressUsername obj :: o
obj = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getProxyAddressUsername" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
getObjectPropertyString o
obj "username"

{- |
Construct a `GValueConstruct` with valid value for the “@username@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructProxyAddressUsername :: (IsProxyAddress o) => T.Text -> IO (GValueConstruct o)
constructProxyAddressUsername :: Text -> IO (GValueConstruct o)
constructProxyAddressUsername val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
constructObjectPropertyString "username" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

#if ENABLE_OVERLOADING
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
#endif

#if ENABLE_OVERLOADING
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, *)])
#endif

#if ENABLE_OVERLOADING
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

#endif

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

#endif

-- 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 :: a
-> Word16
-> Text
-> Text
-> Word16
-> Maybe Text
-> Maybe Text
-> m ProxyAddress
proxyAddressNew inetaddr :: a
inetaddr port :: Word16
port protocol :: Text
protocol destHostname :: Text
destHostname destPort :: Word16
destPort username :: Maybe Text
username password :: Maybe Text
password = IO ProxyAddress -> m ProxyAddress
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ProxyAddress -> m ProxyAddress)
-> IO ProxyAddress -> m ProxyAddress
forall a b. (a -> b) -> a -> b
$ do
    Ptr InetAddress
inetaddr' <- a -> IO (Ptr InetAddress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
inetaddr
    CString
protocol' <- Text -> IO CString
textToCString Text
protocol
    CString
destHostname' <- Text -> IO CString
textToCString Text
destHostname
    CString
maybeUsername <- case Maybe Text
username of
        Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
        Just jUsername :: Text
jUsername -> do
            CString
jUsername' <- Text -> IO CString
textToCString Text
jUsername
            CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jUsername'
    CString
maybePassword <- case Maybe Text
password of
        Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
        Just jPassword :: Text
jPassword -> do
            CString
jPassword' <- Text -> IO CString
textToCString Text
jPassword
            CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jPassword'
    Ptr ProxyAddress
result <- Ptr InetAddress
-> Word16
-> CString
-> CString
-> Word16
-> CString
-> CString
-> IO (Ptr ProxyAddress)
g_proxy_address_new Ptr InetAddress
inetaddr' Word16
port CString
protocol' CString
destHostname' Word16
destPort CString
maybeUsername CString
maybePassword
    Text -> Ptr ProxyAddress -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "proxyAddressNew" Ptr ProxyAddress
result
    ProxyAddress
result' <- ((ManagedPtr ProxyAddress -> ProxyAddress)
-> Ptr ProxyAddress -> IO ProxyAddress
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ProxyAddress -> ProxyAddress
ProxyAddress) Ptr ProxyAddress
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
inetaddr
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
protocol'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
destHostname'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeUsername
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybePassword
    ProxyAddress -> IO ProxyAddress
forall (m :: * -> *) a. Monad m => a -> m a
return ProxyAddress
result'

#if ENABLE_OVERLOADING
#endif

-- 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 :: a -> m Text
proxyAddressGetDestinationHostname proxy :: a
proxy = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr ProxyAddress
proxy' <- a -> IO (Ptr ProxyAddress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
    CString
result <- Ptr ProxyAddress -> IO CString
g_proxy_address_get_destination_hostname Ptr ProxyAddress
proxy'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "proxyAddressGetDestinationHostname" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

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

#endif

-- 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 :: a -> m Word16
proxyAddressGetDestinationPort proxy :: a
proxy = IO Word16 -> m Word16
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word16 -> m Word16) -> IO Word16 -> m Word16
forall a b. (a -> b) -> a -> b
$ do
    Ptr ProxyAddress
proxy' <- a -> IO (Ptr ProxyAddress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
    Word16
result <- Ptr ProxyAddress -> IO Word16
g_proxy_address_get_destination_port Ptr ProxyAddress
proxy'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
    Word16 -> IO Word16
forall (m :: * -> *) a. Monad m => a -> m a
return Word16
result

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

#endif

-- 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 :: a -> m Text
proxyAddressGetDestinationProtocol proxy :: a
proxy = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr ProxyAddress
proxy' <- a -> IO (Ptr ProxyAddress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
    CString
result <- Ptr ProxyAddress -> IO CString
g_proxy_address_get_destination_protocol Ptr ProxyAddress
proxy'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "proxyAddressGetDestinationProtocol" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

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

#endif

-- 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 :: a -> m Text
proxyAddressGetPassword proxy :: a
proxy = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr ProxyAddress
proxy' <- a -> IO (Ptr ProxyAddress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
    CString
result <- Ptr ProxyAddress -> IO CString
g_proxy_address_get_password Ptr ProxyAddress
proxy'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "proxyAddressGetPassword" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

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

#endif

-- 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 :: a -> m Text
proxyAddressGetProtocol proxy :: a
proxy = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr ProxyAddress
proxy' <- a -> IO (Ptr ProxyAddress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
    CString
result <- Ptr ProxyAddress -> IO CString
g_proxy_address_get_protocol Ptr ProxyAddress
proxy'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "proxyAddressGetProtocol" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

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

#endif

-- 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 :: a -> m Text
proxyAddressGetUri proxy :: a
proxy = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr ProxyAddress
proxy' <- a -> IO (Ptr ProxyAddress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
    CString
result <- Ptr ProxyAddress -> IO CString
g_proxy_address_get_uri Ptr ProxyAddress
proxy'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "proxyAddressGetUri" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

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

#endif

-- 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 :: a -> m Text
proxyAddressGetUsername proxy :: a
proxy = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr ProxyAddress
proxy' <- a -> IO (Ptr ProxyAddress)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
proxy
    CString
result <- Ptr ProxyAddress -> IO CString
g_proxy_address_get_username Ptr ProxyAddress
proxy'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "proxyAddressGetUsername" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
proxy
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

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

#endif