// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT

#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
use crate::ConnectionMultiConnect;
#[cfg(any(feature = "v1_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
use crate::Metered;
use crate::Setting;
#[cfg(any(feature = "v1_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
use crate::SettingConnectionAutoconnectSlaves;
#[cfg(any(feature = "v1_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
use crate::SettingConnectionLldp;
#[cfg(any(feature = "v1_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
use crate::SettingConnectionLlmnr;
#[cfg(any(feature = "v1_12", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
use crate::SettingConnectionMdns;
use glib::object::Cast;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
use glib::ToValue;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem::transmute;

glib::wrapper! {
    #[doc(alias = "NMSettingConnection")]
    pub struct SettingConnection(Object<ffi::NMSettingConnection, ffi::NMSettingConnectionClass>) @extends Setting;

    match fn {
        type_ => || ffi::nm_setting_connection_get_type(),
    }
}

impl SettingConnection {
    /// Creates a new [`SettingConnection`][crate::SettingConnection] object with default values.
    ///
    /// # Returns
    ///
    /// the new empty [`SettingConnection`][crate::SettingConnection] object
    #[doc(alias = "nm_setting_connection_new")]
    pub fn new() -> SettingConnection {
        unsafe { Setting::from_glib_full(ffi::nm_setting_connection_new()).unsafe_cast() }
    }

    /// Adds a permission to the connection's permission list. At this time, only
    /// the "user" permission type is supported, and `pitem` must be a username. See
    /// `property::SettingConnection::permissions`: for more details.
    /// ## `ptype`
    /// the permission type; at this time only "user" is supported
    /// ## `pitem`
    /// the permission item formatted as required for `ptype`
    /// ## `detail`
    /// unused at this time; must be [`None`]
    ///
    /// # Returns
    ///
    /// [`true`] if the permission was unique and was successfully added to the
    /// list, [`false`] if `ptype` or `pitem` was invalid.
    /// If the permission was already present in the list, it will not be added
    /// a second time but [`true`] will be returned. Note that before 1.28, in this
    /// case [`false`] would be returned.
    #[doc(alias = "nm_setting_connection_add_permission")]
    pub fn add_permission(&self, ptype: &str, pitem: &str, detail: Option<&str>) -> bool {
        unsafe {
            from_glib(ffi::nm_setting_connection_add_permission(
                self.to_glib_none().0,
                ptype.to_glib_none().0,
                pitem.to_glib_none().0,
                detail.to_glib_none().0,
            ))
        }
    }

    /// Adds a new secondary connection UUID to the setting.
    /// ## `sec_uuid`
    /// the secondary connection UUID to add
    ///
    /// # Returns
    ///
    /// [`true`] if the secondary connection UUID was added; [`false`] if the UUID
    /// was already present
    #[doc(alias = "nm_setting_connection_add_secondary")]
    pub fn add_secondary(&self, sec_uuid: &str) -> bool {
        unsafe {
            from_glib(ffi::nm_setting_connection_add_secondary(
                self.to_glib_none().0,
                sec_uuid.to_glib_none().0,
            ))
        }
    }

    /// Returns the value contained in the `property::SettingConnection::auth-retries` property.
    ///
    /// # Returns
    ///
    /// the configured authentication retries. Zero means
    /// infinity and -1 means a global default value.
    #[cfg(any(feature = "v1_10", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
    #[doc(alias = "nm_setting_connection_get_auth_retries")]
    #[doc(alias = "get_auth_retries")]
    pub fn auth_retries(&self) -> i32 {
        unsafe { ffi::nm_setting_connection_get_auth_retries(self.to_glib_none().0) }
    }

    /// Returns the `property::SettingConnection::autoconnect` property of the connection.
    ///
    /// # Returns
    ///
    /// the connection's autoconnect behavior
    #[doc(alias = "nm_setting_connection_get_autoconnect")]
    #[doc(alias = "get_autoconnect")]
    pub fn is_autoconnect(&self) -> bool {
        unsafe {
            from_glib(ffi::nm_setting_connection_get_autoconnect(
                self.to_glib_none().0,
            ))
        }
    }

    /// Returns the `property::SettingConnection::autoconnect-priority` property of the connection.
    /// The higher number, the higher priority.
    ///
    /// # Returns
    ///
    /// the connection's autoconnect priority
    #[doc(alias = "nm_setting_connection_get_autoconnect_priority")]
    #[doc(alias = "get_autoconnect_priority")]
    pub fn autoconnect_priority(&self) -> i32 {
        unsafe { ffi::nm_setting_connection_get_autoconnect_priority(self.to_glib_none().0) }
    }

    /// Returns the `property::SettingConnection::autoconnect-retries` property of the connection.
    /// Zero means infinite, -1 means the global default value.
    ///
    /// # Returns
    ///
    /// the connection's autoconnect retries
    #[cfg(any(feature = "v1_6", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_6")))]
    #[doc(alias = "nm_setting_connection_get_autoconnect_retries")]
    #[doc(alias = "get_autoconnect_retries")]
    pub fn autoconnect_retries(&self) -> i32 {
        unsafe { ffi::nm_setting_connection_get_autoconnect_retries(self.to_glib_none().0) }
    }

    /// Returns the `property::SettingConnection::autoconnect-slaves` property of the connection.
    ///
    /// # Returns
    ///
    /// whether slaves of the connection should be activated together
    ///  with the connection.
    #[cfg(any(feature = "v1_2", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
    #[doc(alias = "nm_setting_connection_get_autoconnect_slaves")]
    #[doc(alias = "get_autoconnect_slaves")]
    pub fn autoconnect_slaves(&self) -> SettingConnectionAutoconnectSlaves {
        unsafe {
            from_glib(ffi::nm_setting_connection_get_autoconnect_slaves(
                self.to_glib_none().0,
            ))
        }
    }

    /// Returns the `property::SettingConnection::type` property of the connection.
    ///
    /// # Returns
    ///
    /// the connection type
    #[doc(alias = "nm_setting_connection_get_connection_type")]
    #[doc(alias = "get_connection_type")]
    pub fn connection_type(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::nm_setting_connection_get_connection_type(
                self.to_glib_none().0,
            ))
        }
    }

    ///
    /// # Returns
    ///
    /// the value contained in the `property::SettingConnection::gateway-ping-timeout`
    /// property.
    #[doc(alias = "nm_setting_connection_get_gateway_ping_timeout")]
    #[doc(alias = "get_gateway_ping_timeout")]
    pub fn gateway_ping_timeout(&self) -> u32 {
        unsafe { ffi::nm_setting_connection_get_gateway_ping_timeout(self.to_glib_none().0) }
    }

    /// Returns the `property::SettingConnection::id` property of the connection.
    ///
    /// # Returns
    ///
    /// the connection ID
    #[doc(alias = "nm_setting_connection_get_id")]
    #[doc(alias = "get_id")]
    pub fn id(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::nm_setting_connection_get_id(self.to_glib_none().0)) }
    }

    /// Returns the `property::SettingConnection::interface-name` property of the connection.
    ///
    /// # Returns
    ///
    /// the connection's interface name
    #[doc(alias = "nm_setting_connection_get_interface_name")]
    #[doc(alias = "get_interface_name")]
    pub fn interface_name(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::nm_setting_connection_get_interface_name(
                self.to_glib_none().0,
            ))
        }
    }

    /// Returns the `property::SettingConnection::lldp` property of the connection.
    ///
    /// # Returns
    ///
    /// a `NMSettingConnectionLldp` which indicates whether LLDP must be
    /// enabled for the connection.
    #[cfg(any(feature = "v1_2", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
    #[doc(alias = "nm_setting_connection_get_lldp")]
    #[doc(alias = "get_lldp")]
    pub fn lldp(&self) -> SettingConnectionLldp {
        unsafe { from_glib(ffi::nm_setting_connection_get_lldp(self.to_glib_none().0)) }
    }

    ///
    /// # Returns
    ///
    /// the `property::SettingConnection::llmnr` property of the setting.
    #[cfg(any(feature = "v1_14", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
    #[doc(alias = "nm_setting_connection_get_llmnr")]
    #[doc(alias = "get_llmnr")]
    pub fn llmnr(&self) -> SettingConnectionLlmnr {
        unsafe { from_glib(ffi::nm_setting_connection_get_llmnr(self.to_glib_none().0)) }
    }

    /// Returns the `property::SettingConnection::master` property of the connection.
    ///
    /// # Returns
    ///
    /// interface name of the master device or UUID of the master
    /// connection.
    #[doc(alias = "nm_setting_connection_get_master")]
    #[doc(alias = "get_master")]
    pub fn master(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::nm_setting_connection_get_master(self.to_glib_none().0)) }
    }

    ///
    /// # Returns
    ///
    /// the `property::SettingConnection::mdns` property of the setting.
    #[cfg(any(feature = "v1_12", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
    #[doc(alias = "nm_setting_connection_get_mdns")]
    #[doc(alias = "get_mdns")]
    pub fn mdns(&self) -> SettingConnectionMdns {
        unsafe { from_glib(ffi::nm_setting_connection_get_mdns(self.to_glib_none().0)) }
    }

    ///
    /// # Returns
    ///
    /// the `property::SettingConnection::metered` property of the setting.
    #[cfg(any(feature = "v1_2", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
    #[doc(alias = "nm_setting_connection_get_metered")]
    #[doc(alias = "get_metered")]
    pub fn metered(&self) -> Metered {
        unsafe {
            from_glib(ffi::nm_setting_connection_get_metered(
                self.to_glib_none().0,
            ))
        }
    }

    /// Returns the value contained in the `property::SettingConnection::mud-url`
    /// property.
    #[cfg(any(feature = "v1_26", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_26")))]
    #[doc(alias = "nm_setting_connection_get_mud_url")]
    #[doc(alias = "get_mud_url")]
    pub fn mud_url(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::nm_setting_connection_get_mud_url(
                self.to_glib_none().0,
            ))
        }
    }

    ///
    /// # Returns
    ///
    /// the `property::SettingConnection::multi-connect` property of the connection.
    #[cfg(any(feature = "v1_14", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
    #[doc(alias = "nm_setting_connection_get_multi_connect")]
    #[doc(alias = "get_multi_connect")]
    pub fn multi_connect(&self) -> ConnectionMultiConnect {
        unsafe {
            from_glib(ffi::nm_setting_connection_get_multi_connect(
                self.to_glib_none().0,
            ))
        }
    }

    /// Returns the number of entries in the `property::SettingConnection::permissions`
    /// property of this setting.
    ///
    /// # Returns
    ///
    /// the number of permissions entries
    #[doc(alias = "nm_setting_connection_get_num_permissions")]
    #[doc(alias = "get_num_permissions")]
    pub fn num_permissions(&self) -> u32 {
        unsafe { ffi::nm_setting_connection_get_num_permissions(self.to_glib_none().0) }
    }

    ///
    /// # Returns
    ///
    /// the number of configured secondary connection UUIDs
    #[doc(alias = "nm_setting_connection_get_num_secondaries")]
    #[doc(alias = "get_num_secondaries")]
    pub fn num_secondaries(&self) -> u32 {
        unsafe { ffi::nm_setting_connection_get_num_secondaries(self.to_glib_none().0) }
    }

    /// Returns the `property::SettingConnection::read-only` property of the connection.
    ///
    /// # Returns
    ///
    /// [`true`] if the connection is read-only, [`false`] if it is not
    #[doc(alias = "nm_setting_connection_get_read_only")]
    #[doc(alias = "get_read_only")]
    pub fn is_read_only(&self) -> bool {
        unsafe {
            from_glib(ffi::nm_setting_connection_get_read_only(
                self.to_glib_none().0,
            ))
        }
    }

    /// ## `idx`
    /// the zero-based index of the secondary connection UUID entry.
    ///  Access one past the length of secondaries is ok and will return
    ///  [`None`]. Otherwise, it is a user error.
    ///
    /// # Returns
    ///
    /// the secondary connection UUID at index `idx` or
    ///  [`None`] if `idx` is the number of secondaries.
    #[doc(alias = "nm_setting_connection_get_secondary")]
    #[doc(alias = "get_secondary")]
    pub fn secondary(&self, idx: u32) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::nm_setting_connection_get_secondary(
                self.to_glib_none().0,
                idx,
            ))
        }
    }

    /// Returns the `property::SettingConnection::slave-type` property of the connection.
    ///
    /// # Returns
    ///
    /// the type of slave this connection is, if any
    #[doc(alias = "nm_setting_connection_get_slave_type")]
    #[doc(alias = "get_slave_type")]
    pub fn slave_type(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::nm_setting_connection_get_slave_type(
                self.to_glib_none().0,
            ))
        }
    }

    /// Returns the `property::SettingConnection::stable_id` property of the connection.
    ///
    /// # Returns
    ///
    /// the stable-id for the connection
    #[cfg(any(feature = "v1_4", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_4")))]
    #[doc(alias = "nm_setting_connection_get_stable_id")]
    #[doc(alias = "get_stable_id")]
    pub fn stable_id(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::nm_setting_connection_get_stable_id(
                self.to_glib_none().0,
            ))
        }
    }

    /// Returns the `property::SettingConnection::timestamp` property of the connection.
    ///
    /// # Returns
    ///
    /// the connection's timestamp
    #[doc(alias = "nm_setting_connection_get_timestamp")]
    #[doc(alias = "get_timestamp")]
    pub fn timestamp(&self) -> u64 {
        unsafe { ffi::nm_setting_connection_get_timestamp(self.to_glib_none().0) }
    }

    /// Returns the `property::SettingConnection::uuid` property of the connection.
    ///
    /// # Returns
    ///
    /// the connection UUID
    #[doc(alias = "nm_setting_connection_get_uuid")]
    #[doc(alias = "get_uuid")]
    pub fn uuid(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::nm_setting_connection_get_uuid(self.to_glib_none().0)) }
    }

    ///
    /// # Returns
    ///
    /// the [`SETTING_CONNECTION_WAIT_DEVICE_TIMEOUT`][crate::SETTING_CONNECTION_WAIT_DEVICE_TIMEOUT] property with
    ///  the timeout in milliseconds. -1 is the default.
    #[cfg(any(feature = "v1_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
    #[doc(alias = "nm_setting_connection_get_wait_device_timeout")]
    #[doc(alias = "get_wait_device_timeout")]
    pub fn wait_device_timeout(&self) -> i32 {
        unsafe { ffi::nm_setting_connection_get_wait_device_timeout(self.to_glib_none().0) }
    }

    /// Returns the `property::SettingConnection::zone` property of the connection.
    ///
    /// # Returns
    ///
    /// the trust level of a connection
    #[doc(alias = "nm_setting_connection_get_zone")]
    #[doc(alias = "get_zone")]
    pub fn zone(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::nm_setting_connection_get_zone(self.to_glib_none().0)) }
    }

    /// ## `type_`
    /// the setting name (ie [`SETTING_BOND_SETTING_NAME`][crate::SETTING_BOND_SETTING_NAME]) to be matched
    /// against `self`'s slave type
    ///
    /// # Returns
    ///
    /// [`true`] if connection is of the given slave `type_`
    #[doc(alias = "nm_setting_connection_is_slave_type")]
    pub fn is_slave_type(&self, type_: &str) -> bool {
        unsafe {
            from_glib(ffi::nm_setting_connection_is_slave_type(
                self.to_glib_none().0,
                type_.to_glib_none().0,
            ))
        }
    }

    /// Checks whether the given username is allowed to view/access this connection.
    /// ## `uname`
    /// the user name to check permissions for
    ///
    /// # Returns
    ///
    /// [`true`] if the requested user is allowed to view this connection,
    /// [`false`] if the given user is not allowed to view this connection
    #[doc(alias = "nm_setting_connection_permissions_user_allowed")]
    pub fn permissions_user_allowed(&self, uname: &str) -> bool {
        unsafe {
            from_glib(ffi::nm_setting_connection_permissions_user_allowed(
                self.to_glib_none().0,
                uname.to_glib_none().0,
            ))
        }
    }

    /// Removes the permission at index `idx` from the connection.
    /// ## `idx`
    /// the zero-based index of the permission to remove
    #[doc(alias = "nm_setting_connection_remove_permission")]
    pub fn remove_permission(&self, idx: u32) {
        unsafe {
            ffi::nm_setting_connection_remove_permission(self.to_glib_none().0, idx);
        }
    }

    /// Removes the permission from the connection.
    /// At this time, only the "user" permission type is supported, and `pitem` must
    /// be a username. See `property::SettingConnection::permissions`: for more details.
    /// ## `ptype`
    /// the permission type; at this time only "user" is supported
    /// ## `pitem`
    /// the permission item formatted as required for `ptype`
    /// ## `detail`
    /// unused at this time; must be [`None`]
    ///
    /// # Returns
    ///
    /// [`true`] if the permission was found and removed; [`false`] if it was not.
    #[doc(alias = "nm_setting_connection_remove_permission_by_value")]
    pub fn remove_permission_by_value(
        &self,
        ptype: &str,
        pitem: &str,
        detail: Option<&str>,
    ) -> bool {
        unsafe {
            from_glib(ffi::nm_setting_connection_remove_permission_by_value(
                self.to_glib_none().0,
                ptype.to_glib_none().0,
                pitem.to_glib_none().0,
                detail.to_glib_none().0,
            ))
        }
    }

    /// Removes the secondary connection UUID at index `idx`.
    /// ## `idx`
    /// index number of the secondary connection UUID
    #[doc(alias = "nm_setting_connection_remove_secondary")]
    pub fn remove_secondary(&self, idx: u32) {
        unsafe {
            ffi::nm_setting_connection_remove_secondary(self.to_glib_none().0, idx);
        }
    }

    /// Removes the secondary connection UUID `sec_uuid`.
    /// ## `sec_uuid`
    /// the secondary connection UUID to remove
    ///
    /// # Returns
    ///
    /// [`true`] if the secondary connection UUID was found and removed; [`false`] if it was not.
    #[doc(alias = "nm_setting_connection_remove_secondary_by_value")]
    pub fn remove_secondary_by_value(&self, sec_uuid: &str) -> bool {
        unsafe {
            from_glib(ffi::nm_setting_connection_remove_secondary_by_value(
                self.to_glib_none().0,
                sec_uuid.to_glib_none().0,
            ))
        }
    }

    /// The number of retries for the authentication. Zero means to try indefinitely; -1 means
    /// to use a global default. If the global default is not set, the authentication
    /// retries for 3 times before failing the connection.
    ///
    /// Currently, this only applies to 802-1x authentication.
    #[cfg(any(feature = "v1_10", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
    #[doc(alias = "auth-retries")]
    pub fn set_auth_retries(&self, auth_retries: i32) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"auth-retries\0".as_ptr() as *const _,
                auth_retries.to_value().to_glib_none().0,
            );
        }
    }

    /// Whether or not the connection should be automatically connected by
    /// NetworkManager when the resources for the connection are available.
    /// [`true`] to automatically activate the connection, [`false`] to require manual
    /// intervention to activate the connection.
    ///
    /// Note that autoconnect is not implemented for VPN profiles. See
    /// `property::SettingConnection::secondaries` as an alternative to automatically
    /// connect VPN profiles.
    pub fn set_autoconnect(&self, autoconnect: bool) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"autoconnect\0".as_ptr() as *const _,
                autoconnect.to_value().to_glib_none().0,
            );
        }
    }

    /// The autoconnect priority. If the connection is set to autoconnect,
    /// connections with higher priority will be preferred. Defaults to 0.
    /// The higher number means higher priority.
    #[doc(alias = "autoconnect-priority")]
    pub fn set_autoconnect_priority(&self, autoconnect_priority: i32) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"autoconnect-priority\0".as_ptr() as *const _,
                autoconnect_priority.to_value().to_glib_none().0,
            );
        }
    }

    /// The number of times a connection should be tried when autoactivating before
    /// giving up. Zero means forever, -1 means the global default (4 times if not
    /// overridden). Setting this to 1 means to try activation only once before
    /// blocking autoconnect. Note that after a timeout, NetworkManager will try
    /// to autoconnect again.
    #[doc(alias = "autoconnect-retries")]
    pub fn get_property_autoconnect_retries(&self) -> i32 {
        unsafe {
            let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
            glib::gobject_ffi::g_object_get_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"autoconnect-retries\0".as_ptr() as *const _,
                value.to_glib_none_mut().0,
            );
            value
                .get()
                .expect("Return Value for property `autoconnect-retries` getter")
        }
    }

    /// The number of times a connection should be tried when autoactivating before
    /// giving up. Zero means forever, -1 means the global default (4 times if not
    /// overridden). Setting this to 1 means to try activation only once before
    /// blocking autoconnect. Note that after a timeout, NetworkManager will try
    /// to autoconnect again.
    #[doc(alias = "autoconnect-retries")]
    pub fn set_autoconnect_retries(&self, autoconnect_retries: i32) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"autoconnect-retries\0".as_ptr() as *const _,
                autoconnect_retries.to_value().to_glib_none().0,
            );
        }
    }

    /// Whether or not slaves of this connection should be automatically brought up
    /// when NetworkManager activates this connection. This only has a real effect
    /// for master connections. The properties `property::SettingConnection::autoconnect`,
    /// `property::SettingConnection::autoconnect-priority` and `property::SettingConnection::autoconnect-retries`
    /// are unrelated to this setting.
    /// The permitted values are: 0: leave slave connections untouched,
    /// 1: activate all the slave connections with this connection, -1: default.
    /// If -1 (default) is set, global connection.autoconnect-slaves is read to
    /// determine the real value. If it is default as well, this fallbacks to 0.
    #[cfg(any(feature = "v1_2", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
    #[doc(alias = "autoconnect-slaves")]
    pub fn set_autoconnect_slaves(&self, autoconnect_slaves: SettingConnectionAutoconnectSlaves) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"autoconnect-slaves\0".as_ptr() as *const _,
                autoconnect_slaves.to_value().to_glib_none().0,
            );
        }
    }

    /// If greater than zero, delay success of IP addressing until either the
    /// timeout is reached, or an IP gateway replies to a ping.
    #[doc(alias = "gateway-ping-timeout")]
    pub fn set_gateway_ping_timeout(&self, gateway_ping_timeout: u32) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"gateway-ping-timeout\0".as_ptr() as *const _,
                gateway_ping_timeout.to_value().to_glib_none().0,
            );
        }
    }

    /// A human readable unique identifier for the connection, like "Work Wi-Fi"
    /// or "T-Mobile 3G".
    pub fn set_id(&self, id: Option<&str>) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"id\0".as_ptr() as *const _,
                id.to_value().to_glib_none().0,
            );
        }
    }

    /// The name of the network interface this connection is bound to. If not
    /// set, then the connection can be attached to any interface of the
    /// appropriate type (subject to restrictions imposed by other settings).
    ///
    /// For software devices this specifies the name of the created device.
    ///
    /// For connection types where interface names cannot easily be made
    /// persistent (e.g. mobile broadband or USB Ethernet), this property should
    /// not be used. Setting this property restricts the interfaces a connection
    /// can be used with, and if interface names change or are reordered the
    /// connection may be applied to the wrong interface.
    #[doc(alias = "interface-name")]
    pub fn set_interface_name(&self, interface_name: Option<&str>) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"interface-name\0".as_ptr() as *const _,
                interface_name.to_value().to_glib_none().0,
            );
        }
    }

    /// Whether LLDP is enabled for the connection.
    #[cfg(any(feature = "v1_2", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
    pub fn set_lldp(&self, lldp: i32) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"lldp\0".as_ptr() as *const _,
                lldp.to_value().to_glib_none().0,
            );
        }
    }

    /// Whether Link-Local Multicast Name Resolution (LLMNR) is enabled
    /// for the connection. LLMNR is a protocol based on the Domain Name
    /// System (DNS) packet format that allows both IPv4 and IPv6 hosts
    /// to perform name resolution for hosts on the same local link.
    ///
    /// The permitted values are: "yes" (2) register hostname and resolving
    /// for the connection, "no" (0) disable LLMNR for the interface, "resolve"
    /// (1) do not register hostname but allow resolving of LLMNR host names
    /// If unspecified, "default" ultimately depends on the DNS plugin (which
    /// for systemd-resolved currently means "yes").
    ///
    /// This feature requires a plugin which supports LLMNR. Otherwise, the
    /// setting has no effect. One such plugin is dns-systemd-resolved.
    #[cfg(any(feature = "v1_14", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
    pub fn set_llmnr(&self, llmnr: i32) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"llmnr\0".as_ptr() as *const _,
                llmnr.to_value().to_glib_none().0,
            );
        }
    }

    /// Interface name of the master device or UUID of the master connection.
    pub fn set_master(&self, master: Option<&str>) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"master\0".as_ptr() as *const _,
                master.to_value().to_glib_none().0,
            );
        }
    }

    /// Whether mDNS is enabled for the connection.
    ///
    /// The permitted values are: "yes" (2) register hostname and resolving
    /// for the connection, "no" (0) disable mDNS for the interface, "resolve"
    /// (1) do not register hostname but allow resolving of mDNS host names
    /// and "default" (-1) to allow lookup of a global default in NetworkManager.conf.
    /// If unspecified, "default" ultimately depends on the DNS plugin (which
    /// for systemd-resolved currently means "no").
    ///
    /// This feature requires a plugin which supports mDNS. Otherwise, the
    /// setting has no effect. One such plugin is dns-systemd-resolved.
    #[cfg(any(feature = "v1_12", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
    pub fn set_mdns(&self, mdns: i32) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"mdns\0".as_ptr() as *const _,
                mdns.to_value().to_glib_none().0,
            );
        }
    }

    /// Whether the connection is metered.
    ///
    /// When updating this property on a currently activated connection,
    /// the change takes effect immediately.
    #[cfg(any(feature = "v1_2", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
    pub fn set_metered(&self, metered: Metered) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"metered\0".as_ptr() as *const _,
                metered.to_value().to_glib_none().0,
            );
        }
    }

    /// If configured, set to a Manufacturer Usage Description (MUD) URL that points
    /// to manufacturer-recommended network policies for IoT devices. It is transmitted
    /// as a DHCPv4 or DHCPv6 option. The value must be a valid URL starting with "https://".
    ///
    /// The special value "none" is allowed to indicate that no MUD URL is used.
    ///
    /// If the per-profile value is unspecified (the default), a global connection default gets
    /// consulted. If still unspecified, the ultimate default is "none".
    #[cfg(any(feature = "v1_26", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_26")))]
    #[doc(alias = "mud-url")]
    pub fn set_mud_url(&self, mud_url: Option<&str>) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"mud-url\0".as_ptr() as *const _,
                mud_url.to_value().to_glib_none().0,
            );
        }
    }

    /// Specifies whether the profile can be active multiple times at a particular
    /// moment. The value is of type [`ConnectionMultiConnect`][crate::ConnectionMultiConnect].
    #[cfg(any(feature = "v1_14", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
    #[doc(alias = "multi-connect")]
    pub fn set_multi_connect(&self, multi_connect: i32) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"multi-connect\0".as_ptr() as *const _,
                multi_connect.to_value().to_glib_none().0,
            );
        }
    }

    /// An array of strings defining what access a given user has to this
    /// connection. If this is [`None`] or empty, all users are allowed to access
    /// this connection; otherwise users are allowed if and only if they are in
    /// this list. When this is not empty, the connection can be active only when
    /// one of the specified users is logged into an active session. Each entry
    /// is of the form "[type]:[id]:[reserved]"; for example, "user:dcbw:blah".
    ///
    /// At this time only the "user" [type] is allowed. Any other values are
    /// ignored and reserved for future use. [id] is the username that this
    /// permission refers to, which may not contain the ":" character. Any
    /// [reserved] information present must be ignored and is reserved for future
    /// use. All of [type], [id], and [reserved] must be valid UTF-8.
    pub fn permissions(&self) -> Vec<glib::GString> {
        unsafe {
            let mut value =
                glib::Value::from_type(<Vec<glib::GString> as StaticType>::static_type());
            glib::gobject_ffi::g_object_get_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"permissions\0".as_ptr() as *const _,
                value.to_glib_none_mut().0,
            );
            value
                .get()
                .expect("Return Value for property `permissions` getter")
        }
    }

    /// An array of strings defining what access a given user has to this
    /// connection. If this is [`None`] or empty, all users are allowed to access
    /// this connection; otherwise users are allowed if and only if they are in
    /// this list. When this is not empty, the connection can be active only when
    /// one of the specified users is logged into an active session. Each entry
    /// is of the form "[type]:[id]:[reserved]"; for example, "user:dcbw:blah".
    ///
    /// At this time only the "user" [type] is allowed. Any other values are
    /// ignored and reserved for future use. [id] is the username that this
    /// permission refers to, which may not contain the ":" character. Any
    /// [reserved] information present must be ignored and is reserved for future
    /// use. All of [type], [id], and [reserved] must be valid UTF-8.
    pub fn set_permissions(&self, permissions: &[&str]) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"permissions\0".as_ptr() as *const _,
                permissions.to_value().to_glib_none().0,
            );
        }
    }

    /// [`false`] if the connection can be modified using the provided settings
    /// service's D-Bus interface with the right privileges, or [`true`] if the
    /// connection is read-only and cannot be modified.
    #[doc(alias = "read-only")]
    pub fn set_read_only(&self, read_only: bool) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"read-only\0".as_ptr() as *const _,
                read_only.to_value().to_glib_none().0,
            );
        }
    }

    /// List of connection UUIDs that should be activated when the base
    /// connection itself is activated. Currently, only VPN connections are
    /// supported.
    pub fn secondaries(&self) -> Vec<glib::GString> {
        unsafe {
            let mut value =
                glib::Value::from_type(<Vec<glib::GString> as StaticType>::static_type());
            glib::gobject_ffi::g_object_get_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"secondaries\0".as_ptr() as *const _,
                value.to_glib_none_mut().0,
            );
            value
                .get()
                .expect("Return Value for property `secondaries` getter")
        }
    }

    /// List of connection UUIDs that should be activated when the base
    /// connection itself is activated. Currently, only VPN connections are
    /// supported.
    pub fn set_secondaries(&self, secondaries: &[&str]) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"secondaries\0".as_ptr() as *const _,
                secondaries.to_value().to_glib_none().0,
            );
        }
    }

    /// Setting name of the device type of this slave's master connection (eg,
    /// [`SETTING_BOND_SETTING_NAME`][crate::SETTING_BOND_SETTING_NAME]), or [`None`] if this connection is not a
    /// slave.
    #[doc(alias = "slave-type")]
    pub fn set_slave_type(&self, slave_type: Option<&str>) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"slave-type\0".as_ptr() as *const _,
                slave_type.to_value().to_glib_none().0,
            );
        }
    }

    /// This represents the identity of the connection used for various purposes.
    /// It allows to configure multiple profiles to share the identity. Also,
    /// the stable-id can contain placeholders that are substituted dynamically and
    /// deterministically depending on the context.
    ///
    /// The stable-id is used for generating IPv6 stable private addresses
    /// with ipv6.addr-gen-mode=stable-privacy. It is also used to seed the
    /// generated cloned MAC address for ethernet.cloned-mac-address=stable
    /// and wifi.cloned-mac-address=stable. It is also used as DHCP client
    /// identifier with ipv4.dhcp-client-id=stable and to derive the DHCP
    /// DUID with ipv6.dhcp-duid=stable-[llt,ll,uuid].
    ///
    /// Note that depending on the context where it is used, other parameters are
    /// also seeded into the generation algorithm. For example, a per-host key
    /// is commonly also included, so that different systems end up generating
    /// different IDs. Or with ipv6.addr-gen-mode=stable-privacy, also the device's
    /// name is included, so that different interfaces yield different addresses.
    /// The per-host key is the identity of your machine and stored in /var/lib/NetworkManager/secret-key.
    ///
    /// The '$' character is treated special to perform dynamic substitutions
    /// at runtime. Currently, supported are "${CONNECTION}", "${DEVICE}", "${MAC}",
    /// "${BOOT}", "${RANDOM}".
    /// These effectively create unique IDs per-connection, per-device, per-boot,
    /// or every time. Note that "${DEVICE}" corresponds to the interface name of the
    /// device and "${MAC}" is the permanent MAC address of the device.
    /// Any unrecognized patterns following '$' are treated verbatim, however
    /// are reserved for future use. You are thus advised to avoid '$' or
    /// escape it as "$$".
    /// For example, set it to "${CONNECTION}-${BOOT}-${DEVICE}" to create a unique id for
    /// this connection that changes with every reboot and differs depending on the
    /// interface where the profile activates.
    ///
    /// If the value is unset, a global connection default is consulted. If the
    /// value is still unset, the default is similar to "${CONNECTION}" and uses
    /// a unique, fixed ID for the connection.
    #[cfg(any(feature = "v1_4", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_4")))]
    #[doc(alias = "stable-id")]
    pub fn set_stable_id(&self, stable_id: Option<&str>) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"stable-id\0".as_ptr() as *const _,
                stable_id.to_value().to_glib_none().0,
            );
        }
    }

    /// The time, in seconds since the Unix Epoch, that the connection was last
    /// _successfully_ fully activated.
    ///
    /// NetworkManager updates the connection timestamp periodically when the
    /// connection is active to ensure that an active connection has the latest
    /// timestamp. The property is only meant for reading (changes to this
    /// property will not be preserved).
    pub fn set_timestamp(&self, timestamp: u64) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"timestamp\0".as_ptr() as *const _,
                timestamp.to_value().to_glib_none().0,
            );
        }
    }

    /// Base type of the connection. For hardware-dependent connections, should
    /// contain the setting name of the hardware-type specific setting (ie,
    /// "802-3-ethernet" or "802-11-wireless" or "bluetooth", etc), and for
    /// non-hardware dependent connections like VPN or otherwise, should contain
    /// the setting name of that setting type (ie, "vpn" or "bridge", etc).
    #[doc(alias = "type")]
    pub fn type_(&self) -> Option<glib::GString> {
        unsafe {
            let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
            glib::gobject_ffi::g_object_get_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"type\0".as_ptr() as *const _,
                value.to_glib_none_mut().0,
            );
            value
                .get()
                .expect("Return Value for property `type` getter")
        }
    }

    /// Base type of the connection. For hardware-dependent connections, should
    /// contain the setting name of the hardware-type specific setting (ie,
    /// "802-3-ethernet" or "802-11-wireless" or "bluetooth", etc), and for
    /// non-hardware dependent connections like VPN or otherwise, should contain
    /// the setting name of that setting type (ie, "vpn" or "bridge", etc).
    #[doc(alias = "type")]
    pub fn set_type(&self, type_: Option<&str>) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"type\0".as_ptr() as *const _,
                type_.to_value().to_glib_none().0,
            );
        }
    }

    /// A universally unique identifier for the connection, for example generated
    /// with libuuid. It should be assigned when the connection is created, and
    /// never changed as long as the connection still applies to the same
    /// network. For example, it should not be changed when the
    /// `property::SettingConnection::id` property or [`SettingIP4Config`][crate::SettingIP4Config] changes, but
    /// might need to be re-created when the Wi-Fi SSID, mobile broadband network
    /// provider, or `property::SettingConnection::type` property changes.
    ///
    /// The UUID must be in the format "2815492f-7e56-435e-b2e9-246bd7cdc664"
    /// (ie, contains only hexadecimal characters and "-"). A suitable UUID may
    /// be generated by [`utils_uuid_generate()`][crate::utils_uuid_generate()] or
    /// `nm_uuid_generate_from_string_str()`.
    pub fn set_uuid(&self, uuid: Option<&str>) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"uuid\0".as_ptr() as *const _,
                uuid.to_value().to_glib_none().0,
            );
        }
    }

    /// Timeout in milliseconds to wait for device at startup.
    /// During boot, devices may take a while to be detected by the driver.
    /// This property will cause to delay NetworkManager-wait-online.service
    /// and nm-online to give the device a chance to appear. This works by
    /// waiting for the given timeout until a compatible device for the
    /// profile is available and managed.
    ///
    /// The value 0 means no wait time. The default value is -1, which
    /// currently has the same meaning as no wait time.
    #[cfg(any(feature = "v1_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
    #[doc(alias = "wait-device-timeout")]
    pub fn set_wait_device_timeout(&self, wait_device_timeout: i32) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"wait-device-timeout\0".as_ptr() as *const _,
                wait_device_timeout.to_value().to_glib_none().0,
            );
        }
    }

    /// The trust level of a the connection. Free form case-insensitive string
    /// (for example "Home", "Work", "Public"). [`None`] or unspecified zone means
    /// the connection will be placed in the default zone as defined by the
    /// firewall.
    ///
    /// When updating this property on a currently activated connection,
    /// the change takes effect immediately.
    pub fn set_zone(&self, zone: Option<&str>) {
        unsafe {
            glib::gobject_ffi::g_object_set_property(
                self.as_ptr() as *mut glib::gobject_ffi::GObject,
                b"zone\0".as_ptr() as *const _,
                zone.to_value().to_glib_none().0,
            );
        }
    }

    #[cfg(any(feature = "v1_10", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
    #[doc(alias = "auth-retries")]
    pub fn connect_auth_retries_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_auth_retries_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::auth-retries\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_auth_retries_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "autoconnect")]
    pub fn connect_autoconnect_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_autoconnect_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::autoconnect\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_autoconnect_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "autoconnect-priority")]
    pub fn connect_autoconnect_priority_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn notify_autoconnect_priority_trampoline<
            F: Fn(&SettingConnection) + 'static,
        >(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::autoconnect-priority\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_autoconnect_priority_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "autoconnect-retries")]
    pub fn connect_autoconnect_retries_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn notify_autoconnect_retries_trampoline<
            F: Fn(&SettingConnection) + 'static,
        >(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::autoconnect-retries\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_autoconnect_retries_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(any(feature = "v1_2", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
    #[doc(alias = "autoconnect-slaves")]
    pub fn connect_autoconnect_slaves_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn notify_autoconnect_slaves_trampoline<
            F: Fn(&SettingConnection) + 'static,
        >(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::autoconnect-slaves\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_autoconnect_slaves_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "gateway-ping-timeout")]
    pub fn connect_gateway_ping_timeout_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn notify_gateway_ping_timeout_trampoline<
            F: Fn(&SettingConnection) + 'static,
        >(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::gateway-ping-timeout\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_gateway_ping_timeout_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "id")]
    pub fn connect_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_id_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::id\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_id_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "interface-name")]
    pub fn connect_interface_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_interface_name_trampoline<
            F: Fn(&SettingConnection) + 'static,
        >(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::interface-name\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_interface_name_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(any(feature = "v1_2", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
    #[doc(alias = "lldp")]
    pub fn connect_lldp_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_lldp_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::lldp\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_lldp_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(any(feature = "v1_14", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
    #[doc(alias = "llmnr")]
    pub fn connect_llmnr_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_llmnr_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::llmnr\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_llmnr_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "master")]
    pub fn connect_master_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_master_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::master\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_master_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(any(feature = "v1_12", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
    #[doc(alias = "mdns")]
    pub fn connect_mdns_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_mdns_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::mdns\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_mdns_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(any(feature = "v1_2", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_2")))]
    #[doc(alias = "metered")]
    pub fn connect_metered_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_metered_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::metered\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_metered_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(any(feature = "v1_26", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_26")))]
    #[doc(alias = "mud-url")]
    pub fn connect_mud_url_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_mud_url_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::mud-url\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_mud_url_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(any(feature = "v1_14", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
    #[doc(alias = "multi-connect")]
    pub fn connect_multi_connect_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_multi_connect_trampoline<
            F: Fn(&SettingConnection) + 'static,
        >(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::multi-connect\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_multi_connect_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "permissions")]
    pub fn connect_permissions_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_permissions_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::permissions\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_permissions_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "read-only")]
    pub fn connect_read_only_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_read_only_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::read-only\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_read_only_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "secondaries")]
    pub fn connect_secondaries_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_secondaries_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::secondaries\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_secondaries_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "slave-type")]
    pub fn connect_slave_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_slave_type_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::slave-type\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_slave_type_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(any(feature = "v1_4", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_4")))]
    #[doc(alias = "stable-id")]
    pub fn connect_stable_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_stable_id_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::stable-id\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_stable_id_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "timestamp")]
    pub fn connect_timestamp_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_timestamp_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::timestamp\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_timestamp_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "type")]
    pub fn connect_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_type_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::type\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_type_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "uuid")]
    pub fn connect_uuid_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_uuid_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::uuid\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_uuid_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[cfg(any(feature = "v1_20", feature = "dox"))]
    #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_20")))]
    #[doc(alias = "wait-device-timeout")]
    pub fn connect_wait_device_timeout_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F,
    ) -> SignalHandlerId {
        unsafe extern "C" fn notify_wait_device_timeout_trampoline<
            F: Fn(&SettingConnection) + 'static,
        >(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::wait-device-timeout\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_wait_device_timeout_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }

    #[doc(alias = "zone")]
    pub fn connect_zone_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_zone_trampoline<F: Fn(&SettingConnection) + 'static>(
            this: *mut ffi::NMSettingConnection,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(&from_glib_borrow(this))
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::zone\0".as_ptr() as *const _,
                Some(transmute::<_, unsafe extern "C" fn()>(
                    notify_zone_trampoline::<F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }
}

impl Default for SettingConnection {
    fn default() -> Self {
        Self::new()
    }
}

impl fmt::Display for SettingConnection {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str("SettingConnection")
    }
}
