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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT

use crate::{ffi, RemoteType};
use glib::{
    prelude::*,
    signal::{connect_raw, SignalHandlerId},
    translate::*,
};
use std::boxed::Box as Box_;

glib::wrapper! {
    ///
    ///
    /// ## Properties
    ///
    ///
    /// #### `name`
    ///  Name of the remote, as used in configuration files and when interfacing
    /// with OSTree. This is typically human readable, but could be generated, and
    /// must conform to `ostree_validate_remote_name()`. It should typically not be
    /// presented in the UI.
    ///
    /// Readable | Writeable
    ///
    ///
    /// #### `type`
    ///  The type of the remote: whether it comes from static configuration files
    /// ([`RemoteType::Static`][crate::RemoteType::Static]) or has been dynamically found from the local
    /// network or a mounted USB drive ([`RemoteType::Lan`][crate::RemoteType::Lan],
    /// [`RemoteType::Usb`][crate::RemoteType::Usb]). Dynamic remotes may be added and removed over
    /// time.
    ///
    /// Readable | Writeable | Construct Only
    ///
    /// # Implements
    ///
    /// [`RemoteExt`][trait@crate::prelude::RemoteExt]
    #[doc(alias = "FlatpakRemote")]
    pub struct Remote(Object<ffi::FlatpakRemote, ffi::FlatpakRemoteClass>);

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

impl Remote {
    pub const NONE: Option<&'static Remote> = None;

    /// Returns a new remote object which can be used to configure a new remote.
    ///
    /// Note: This is a local configuration object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] or [`InstallationExt::add_remote()`][crate::prelude::InstallationExt::add_remote()] for the changes to take
    /// effect.
    /// ## `name`
    /// a name
    ///
    /// # Returns
    ///
    /// a new [`Remote`][crate::Remote]
    #[doc(alias = "flatpak_remote_new")]
    pub fn new(name: &str) -> Remote {
        assert_initialized_main_thread!();
        unsafe { from_glib_full(ffi::flatpak_remote_new(name.to_glib_none().0)) }
    }

    /// Returns a new pre-filled remote object which can be used to configure a new remote.
    /// The fields in the remote are filled in according to the values in the
    /// passed in flatpakrepo file.
    ///
    /// Note: This is a local configuration object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] or [`InstallationExt::add_remote()`][crate::prelude::InstallationExt::add_remote()] for the changes to take
    /// effect.
    /// ## `name`
    /// a name
    /// ## `data`
    /// The content of a flatpakrepo file
    ///
    /// # Returns
    ///
    /// a new [`Remote`][crate::Remote], or [`None`] on error
    #[cfg(feature = "v1_3_4")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_3_4")))]
    #[doc(alias = "flatpak_remote_new_from_file")]
    #[doc(alias = "new_from_file")]
    pub fn from_file(name: &str, data: &glib::Bytes) -> Result<Remote, glib::Error> {
        assert_initialized_main_thread!();
        unsafe {
            let mut error = std::ptr::null_mut();
            let ret = ffi::flatpak_remote_new_from_file(
                name.to_glib_none().0,
                data.to_glib_none().0,
                &mut error,
            );
            if error.is_null() {
                Ok(from_glib_full(ret))
            } else {
                Err(from_glib_full(error))
            }
        }
    }

    // rustdoc-stripper-ignore-next
    /// Creates a new builder-pattern struct instance to construct [`Remote`] objects.
    ///
    /// This method returns an instance of [`RemoteBuilder`](crate::builders::RemoteBuilder) which can be used to create [`Remote`] objects.
    pub fn builder() -> RemoteBuilder {
        RemoteBuilder::new()
    }
}

impl Default for Remote {
    fn default() -> Self {
        glib::object::Object::new::<Self>()
    }
}

// rustdoc-stripper-ignore-next
/// A [builder-pattern] type to construct [`Remote`] objects.
///
/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
#[must_use = "The builder must be built to be used"]
pub struct RemoteBuilder {
    builder: glib::object::ObjectBuilder<'static, Remote>,
}

impl RemoteBuilder {
    fn new() -> Self {
        Self {
            builder: glib::object::Object::builder(),
        }
    }

    /// Name of the remote, as used in configuration files and when interfacing
    /// with OSTree. This is typically human readable, but could be generated, and
    /// must conform to `ostree_validate_remote_name()`. It should typically not be
    /// presented in the UI.
    pub fn name(self, name: impl Into<glib::GString>) -> Self {
        Self {
            builder: self.builder.property("name", name.into()),
        }
    }

    pub fn type_(self, type_: RemoteType) -> Self {
        Self {
            builder: self.builder.property("type", type_),
        }
    }

    // rustdoc-stripper-ignore-next
    /// Build the [`Remote`].
    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
    pub fn build(self) -> Remote {
        self.builder.build()
    }
}

mod sealed {
    pub trait Sealed {}
    impl<T: super::IsA<super::Remote>> Sealed for T {}
}

/// Trait containing all [`struct@Remote`] methods.
///
/// # Implementors
///
/// [`Remote`][struct@crate::Remote]
pub trait RemoteExt: IsA<Remote> + sealed::Sealed + 'static {
    /// Returns the directory where this remote will store locally cached
    /// appstream information for the specified `arch`.
    /// ## `arch`
    /// which architecture to fetch (default: current architecture)
    ///
    /// # Returns
    ///
    /// a [`gio::File`][crate::gio::File]
    #[doc(alias = "flatpak_remote_get_appstream_dir")]
    #[doc(alias = "get_appstream_dir")]
    fn appstream_dir(&self, arch: Option<&str>) -> Option<gio::File> {
        unsafe {
            from_glib_full(ffi::flatpak_remote_get_appstream_dir(
                self.as_ref().to_glib_none().0,
                arch.to_glib_none().0,
            ))
        }
    }

    /// Returns the timestamp file that will be updated whenever the appstream information
    /// has been updated (or tried to update) for the specified `arch`.
    /// ## `arch`
    /// which architecture to fetch (default: current architecture)
    ///
    /// # Returns
    ///
    /// a [`gio::File`][crate::gio::File]
    #[doc(alias = "flatpak_remote_get_appstream_timestamp")]
    #[doc(alias = "get_appstream_timestamp")]
    fn appstream_timestamp(&self, arch: Option<&str>) -> Option<gio::File> {
        unsafe {
            from_glib_full(ffi::flatpak_remote_get_appstream_timestamp(
                self.as_ref().to_glib_none().0,
                arch.to_glib_none().0,
            ))
        }
    }

    /// Returns the repository collection ID of this remote, if set.
    ///
    /// # Returns
    ///
    /// the collection ID, or [`None`] if unset
    #[doc(alias = "flatpak_remote_get_collection_id")]
    #[doc(alias = "get_collection_id")]
    fn collection_id(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::flatpak_remote_get_collection_id(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the comment of the remote.
    ///
    /// # Returns
    ///
    /// the comment
    #[cfg(feature = "v1_4")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
    #[doc(alias = "flatpak_remote_get_comment")]
    #[doc(alias = "get_comment")]
    fn comment(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::flatpak_remote_get_comment(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the default branch configured for the remote.
    ///
    /// # Returns
    ///
    /// the default branch, or [`None`]
    #[doc(alias = "flatpak_remote_get_default_branch")]
    #[doc(alias = "get_default_branch")]
    fn default_branch(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::flatpak_remote_get_default_branch(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the description of the remote.
    ///
    /// # Returns
    ///
    /// the description
    #[cfg(feature = "v1_4")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
    #[doc(alias = "flatpak_remote_get_description")]
    #[doc(alias = "get_description")]
    fn description(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::flatpak_remote_get_description(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns whether this remote is disabled.
    ///
    /// # Returns
    ///
    /// whether the remote is marked as disabled
    #[doc(alias = "flatpak_remote_get_disabled")]
    #[doc(alias = "get_disabled")]
    fn is_disabled(&self) -> bool {
        unsafe {
            from_glib(ffi::flatpak_remote_get_disabled(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the filter file of the remote.
    ///
    /// # Returns
    ///
    /// a pathname to a filter file
    #[cfg(feature = "v1_4")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
    #[doc(alias = "flatpak_remote_get_filter")]
    #[doc(alias = "get_filter")]
    fn filter(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::flatpak_remote_get_filter(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns whether GPG verification is enabled for the remote.
    ///
    /// # Returns
    ///
    /// whether GPG verification is enabled
    #[doc(alias = "flatpak_remote_get_gpg_verify")]
    #[doc(alias = "get_gpg_verify")]
    fn is_gpg_verify(&self) -> bool {
        unsafe {
            from_glib(ffi::flatpak_remote_get_gpg_verify(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the homepage url of the remote.
    ///
    /// # Returns
    ///
    /// the homepage url
    #[cfg(feature = "v1_4")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
    #[doc(alias = "flatpak_remote_get_homepage")]
    #[doc(alias = "get_homepage")]
    fn homepage(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::flatpak_remote_get_homepage(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the icon url of the remote.
    ///
    /// # Returns
    ///
    /// the icon url
    #[cfg(feature = "v1_4")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
    #[doc(alias = "flatpak_remote_get_icon")]
    #[doc(alias = "get_icon")]
    fn icon(&self) -> Option<glib::GString> {
        unsafe { from_glib_full(ffi::flatpak_remote_get_icon(self.as_ref().to_glib_none().0)) }
    }

    #[cfg(feature = "v1_1_1")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_1_1")))]
    #[doc(alias = "flatpak_remote_get_main_ref")]
    #[doc(alias = "get_main_ref")]
    fn main_ref(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::flatpak_remote_get_main_ref(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the name of the remote repository.
    ///
    /// # Returns
    ///
    /// the name
    #[doc(alias = "flatpak_remote_get_name")]
    #[doc(alias = "get_name")]
    fn name(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::flatpak_remote_get_name(self.as_ref().to_glib_none().0)) }
    }

    /// Returns whether this remote should be used to find dependencies.
    ///
    /// # Returns
    ///
    /// whether the remote is marked as "don't use for dependencies"
    #[doc(alias = "flatpak_remote_get_nodeps")]
    #[doc(alias = "get_nodeps")]
    fn is_nodeps(&self) -> bool {
        unsafe {
            from_glib(ffi::flatpak_remote_get_nodeps(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns whether this remote should be used to list applications.
    ///
    /// # Returns
    ///
    /// whether the remote is marked as "don't enumerate"
    #[doc(alias = "flatpak_remote_get_noenumerate")]
    #[doc(alias = "get_noenumerate")]
    fn is_noenumerate(&self) -> bool {
        unsafe {
            from_glib(ffi::flatpak_remote_get_noenumerate(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the priority for the remote.
    ///
    /// # Returns
    ///
    /// the priority
    #[doc(alias = "flatpak_remote_get_prio")]
    #[doc(alias = "get_prio")]
    fn prio(&self) -> i32 {
        unsafe { ffi::flatpak_remote_get_prio(self.as_ref().to_glib_none().0) }
    }

    /// Get the value of [`type`][struct@crate::Remote#type].
    ///
    /// # Returns
    ///
    /// the type of remote this is
    #[doc(alias = "flatpak_remote_get_remote_type")]
    #[doc(alias = "get_remote_type")]
    fn remote_type(&self) -> RemoteType {
        unsafe {
            from_glib(ffi::flatpak_remote_get_remote_type(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the title of the remote.
    ///
    /// # Returns
    ///
    /// the title
    #[doc(alias = "flatpak_remote_get_title")]
    #[doc(alias = "get_title")]
    fn title(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_full(ffi::flatpak_remote_get_title(
                self.as_ref().to_glib_none().0,
            ))
        }
    }

    /// Returns the repository URL of this remote.
    ///
    /// # Returns
    ///
    /// the URL
    #[doc(alias = "flatpak_remote_get_url")]
    #[doc(alias = "get_url")]
    fn url(&self) -> Option<glib::GString> {
        unsafe { from_glib_full(ffi::flatpak_remote_get_url(self.as_ref().to_glib_none().0)) }
    }

    /// Sets the repository collection ID of this remote.
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `collection_id`
    /// The new collection ID, or [`None`] to unset
    #[doc(alias = "flatpak_remote_set_collection_id")]
    fn set_collection_id(&self, collection_id: Option<&str>) {
        unsafe {
            ffi::flatpak_remote_set_collection_id(
                self.as_ref().to_glib_none().0,
                collection_id.to_glib_none().0,
            );
        }
    }

    /// Sets the comment of this remote.
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `comment`
    /// The new comment
    #[cfg(feature = "v1_4")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
    #[doc(alias = "flatpak_remote_set_comment")]
    fn set_comment(&self, comment: &str) {
        unsafe {
            ffi::flatpak_remote_set_comment(
                self.as_ref().to_glib_none().0,
                comment.to_glib_none().0,
            );
        }
    }

    /// Sets the default branch configured for this remote.
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `default_branch`
    /// The new default_branch, or [`None`] to unset
    #[doc(alias = "flatpak_remote_set_default_branch")]
    fn set_default_branch(&self, default_branch: &str) {
        unsafe {
            ffi::flatpak_remote_set_default_branch(
                self.as_ref().to_glib_none().0,
                default_branch.to_glib_none().0,
            );
        }
    }

    /// Sets the description of this remote.
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `description`
    /// The new description
    #[cfg(feature = "v1_4")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
    #[doc(alias = "flatpak_remote_set_description")]
    fn set_description(&self, description: &str) {
        unsafe {
            ffi::flatpak_remote_set_description(
                self.as_ref().to_glib_none().0,
                description.to_glib_none().0,
            );
        }
    }

    /// Sets the disabled config of this remote. See [`is_disabled()`][Self::is_disabled()].
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `disabled`
    /// a bool
    #[doc(alias = "flatpak_remote_set_disabled")]
    fn set_disabled(&self, disabled: bool) {
        unsafe {
            ffi::flatpak_remote_set_disabled(self.as_ref().to_glib_none().0, disabled.into_glib());
        }
    }

    /// Sets a filter for this remote.
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `filter_path`
    /// The pathname of the new filter file
    #[cfg(feature = "v1_4")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
    #[doc(alias = "flatpak_remote_set_filter")]
    fn set_filter(&self, filter_path: &str) {
        unsafe {
            ffi::flatpak_remote_set_filter(
                self.as_ref().to_glib_none().0,
                filter_path.to_glib_none().0,
            );
        }
    }

    /// Sets the trusted gpg key for this remote.
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `gpg_key`
    /// a [`glib::Bytes`][crate::glib::Bytes] with gpg binary key data
    #[doc(alias = "flatpak_remote_set_gpg_key")]
    fn set_gpg_key(&self, gpg_key: &glib::Bytes) {
        unsafe {
            ffi::flatpak_remote_set_gpg_key(
                self.as_ref().to_glib_none().0,
                gpg_key.to_glib_none().0,
            );
        }
    }

    /// Sets the gpg_verify config of this remote. See [`is_gpg_verify()`][Self::is_gpg_verify()].
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `gpg_verify`
    /// a bool
    #[doc(alias = "flatpak_remote_set_gpg_verify")]
    fn set_gpg_verify(&self, gpg_verify: bool) {
        unsafe {
            ffi::flatpak_remote_set_gpg_verify(
                self.as_ref().to_glib_none().0,
                gpg_verify.into_glib(),
            );
        }
    }

    /// Sets the homepage of this remote.
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `homepage`
    /// The new homepage
    #[cfg(feature = "v1_4")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
    #[doc(alias = "flatpak_remote_set_homepage")]
    fn set_homepage(&self, homepage: &str) {
        unsafe {
            ffi::flatpak_remote_set_homepage(
                self.as_ref().to_glib_none().0,
                homepage.to_glib_none().0,
            );
        }
    }

    /// Sets the homepage of this remote.
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `icon`
    /// The new homepage
    #[cfg(feature = "v1_4")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
    #[doc(alias = "flatpak_remote_set_icon")]
    fn set_icon(&self, icon: &str) {
        unsafe {
            ffi::flatpak_remote_set_icon(self.as_ref().to_glib_none().0, icon.to_glib_none().0);
        }
    }

    #[cfg(feature = "v1_1_1")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v1_1_1")))]
    #[doc(alias = "flatpak_remote_set_main_ref")]
    fn set_main_ref(&self, main_ref: &str) {
        unsafe {
            ffi::flatpak_remote_set_main_ref(
                self.as_ref().to_glib_none().0,
                main_ref.to_glib_none().0,
            );
        }
    }

    /// Sets the nodeps config of this remote. See [`is_nodeps()`][Self::is_nodeps()].
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `nodeps`
    /// a bool
    #[doc(alias = "flatpak_remote_set_nodeps")]
    fn set_nodeps(&self, nodeps: bool) {
        unsafe {
            ffi::flatpak_remote_set_nodeps(self.as_ref().to_glib_none().0, nodeps.into_glib());
        }
    }

    /// Sets the noenumeration config of this remote. See [`is_noenumerate()`][Self::is_noenumerate()].
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `noenumerate`
    /// a bool
    #[doc(alias = "flatpak_remote_set_noenumerate")]
    fn set_noenumerate(&self, noenumerate: bool) {
        unsafe {
            ffi::flatpak_remote_set_noenumerate(
                self.as_ref().to_glib_none().0,
                noenumerate.into_glib(),
            );
        }
    }

    /// Sets the prio config of this remote. See [`prio()`][Self::prio()].
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `prio`
    /// a bool
    #[doc(alias = "flatpak_remote_set_prio")]
    fn set_prio(&self, prio: i32) {
        unsafe {
            ffi::flatpak_remote_set_prio(self.as_ref().to_glib_none().0, prio);
        }
    }

    /// Sets the repository title of this remote.
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `title`
    /// The new title, or [`None`] to unset
    #[doc(alias = "flatpak_remote_set_title")]
    fn set_title(&self, title: &str) {
        unsafe {
            ffi::flatpak_remote_set_title(self.as_ref().to_glib_none().0, title.to_glib_none().0);
        }
    }

    /// Sets the repository URL of this remote.
    ///
    /// Note: This is a local modification of this object, you must commit changes
    /// using [`InstallationExt::modify_remote()`][crate::prelude::InstallationExt::modify_remote()] for the changes to take
    /// effect.
    /// ## `url`
    /// The new url
    #[doc(alias = "flatpak_remote_set_url")]
    fn set_url(&self, url: &str) {
        unsafe {
            ffi::flatpak_remote_set_url(self.as_ref().to_glib_none().0, url.to_glib_none().0);
        }
    }

    /// Name of the remote, as used in configuration files and when interfacing
    /// with OSTree. This is typically human readable, but could be generated, and
    /// must conform to `ostree_validate_remote_name()`. It should typically not be
    /// presented in the UI.
    fn set_name(&self, name: Option<&str>) {
        ObjectExt::set_property(self.as_ref(), "name", name)
    }

    /// The type of the remote: whether it comes from static configuration files
    /// ([`RemoteType::Static`][crate::RemoteType::Static]) or has been dynamically found from the local
    /// network or a mounted USB drive ([`RemoteType::Lan`][crate::RemoteType::Lan],
    /// [`RemoteType::Usb`][crate::RemoteType::Usb]). Dynamic remotes may be added and removed over
    /// time.
    #[doc(alias = "type")]
    fn type_(&self) -> RemoteType {
        ObjectExt::property(self.as_ref(), "type")
    }

    #[doc(alias = "name")]
    fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
        unsafe extern "C" fn notify_name_trampoline<P: IsA<Remote>, F: Fn(&P) + 'static>(
            this: *mut ffi::FlatpakRemote,
            _param_spec: glib::ffi::gpointer,
            f: glib::ffi::gpointer,
        ) {
            let f: &F = &*(f as *const F);
            f(Remote::from_glib_borrow(this).unsafe_cast_ref())
        }
        unsafe {
            let f: Box_<F> = Box_::new(f);
            connect_raw(
                self.as_ptr() as *mut _,
                b"notify::name\0".as_ptr() as *const _,
                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
                    notify_name_trampoline::<Self, F> as *const (),
                )),
                Box_::into_raw(f),
            )
        }
    }
}

impl<O: IsA<Remote>> RemoteExt for O {}