1use crate::{ffi, Auth};
7use glib::prelude::*;
8
9glib::wrapper! {
10 #[doc(alias = "SoupAuthBasic")]
11 pub struct AuthBasic(Object<ffi::SoupAuthBasic>) @extends Auth;
12
13 match fn {
14 type_ => || ffi::soup_auth_basic_get_type(),
15 }
16}
17
18impl AuthBasic {
19 pub fn builder() -> AuthBasicBuilder {
24 AuthBasicBuilder::new()
25 }
26}
27
28#[must_use = "The builder must be built to be used"]
33pub struct AuthBasicBuilder {
34 builder: glib::object::ObjectBuilder<'static, AuthBasic>,
35}
36
37impl AuthBasicBuilder {
38 fn new() -> Self {
39 Self {
40 builder: glib::object::Object::builder(),
41 }
42 }
43
44 pub fn authority(self, authority: impl Into<glib::GString>) -> Self {
45 Self {
46 builder: self.builder.property("authority", authority.into()),
47 }
48 }
49
50 pub fn is_for_proxy(self, is_for_proxy: bool) -> Self {
51 Self {
52 builder: self.builder.property("is-for-proxy", is_for_proxy),
53 }
54 }
55
56 pub fn realm(self, realm: impl Into<glib::GString>) -> Self {
57 Self {
58 builder: self.builder.property("realm", realm.into()),
59 }
60 }
61
62 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
65 pub fn build(self) -> AuthBasic {
66 self.builder.build()
67 }
68}