1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from webkit-gir-files
// DO NOT EDIT

use crate::{ffi, ITPFirstParty};
use glib::translate::*;

glib::wrapper! {
    /// Describes a third party origin.
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct ITPThirdParty(Shared<ffi::WebKitITPThirdParty>);

    match fn {
        ref => |ptr| ffi::webkit_itp_third_party_ref(ptr),
        unref => |ptr| ffi::webkit_itp_third_party_unref(ptr),
        type_ => || ffi::webkit_itp_third_party_get_type(),
    }
}

impl ITPThirdParty {
    /// Get the domain name of @self.
    ///
    /// # Returns
    ///
    /// the domain name
    #[doc(alias = "webkit_itp_third_party_get_domain")]
    #[doc(alias = "get_domain")]
    pub fn domain(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::webkit_itp_third_party_get_domain(
                self.to_glib_none().0,
            ))
        }
    }

    /// Get the list of #WebKitITPFirstParty under which @self has been seen.
    ///
    /// # Returns
    ///
    /// a #GList of #WebKitITPFirstParty
    #[doc(alias = "webkit_itp_third_party_get_first_parties")]
    #[doc(alias = "get_first_parties")]
    pub fn first_parties(&self) -> Vec<ITPFirstParty> {
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::webkit_itp_third_party_get_first_parties(
                self.to_glib_none().0,
            ))
        }
    }
}