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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// An archive of assets that the system downloads together.
///
/// An instance of this class can be invalidated when the asset pack that it represents is updated on the server.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/backgroundassets/baassetpack?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct BAAssetPack;
);
unsafe impl Send for BAAssetPack {}
unsafe impl Sync for BAAssetPack {}
extern_conformance!(
unsafe impl NSObjectProtocol for BAAssetPack {}
);
impl BAAssetPack {
extern_methods!(
/// A unique identifier for the asset pack.
#[unsafe(method(identifier))]
#[unsafe(method_family = none)]
pub unsafe fn identifier(&self) -> Retained<NSString>;
/// The size of the download file containing the asset pack in bytes.
///
/// This is different than the installation size, which could be larger.
#[unsafe(method(downloadSize))]
#[unsafe(method_family = none)]
pub unsafe fn downloadSize(&self) -> NSInteger;
/// The asset pack’s version number
#[unsafe(method(version))]
#[unsafe(method_family = none)]
pub unsafe fn version(&self) -> NSInteger;
/// JSON-encoded custom information that’s associated with the asset pack.
///
/// This property is `nil` for Apple-hosted asset packs.
#[unsafe(method(userInfo))]
#[unsafe(method_family = none)]
pub unsafe fn userInfo(&self) -> Option<Retained<NSData>>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[cfg(feature = "BADownload")]
/// Creates a download object for the asset pack that you schedule using a download manager.
/// - Remark: Use this method in your main app; use ``BAAssetPack/downloadForContentRequest:`` instead in your downloader extension.
#[unsafe(method(download))]
#[unsafe(method_family = none)]
pub unsafe fn download(&self) -> Retained<BADownload>;
#[cfg(all(feature = "BADownload", feature = "BATypes"))]
/// Creates a download object for the asset pack that you schedule using a download manager.
/// - Parameter contentRequest: The content request for the current extension invocation.
/// - Returns: A download object.
/// - Remark: Use this method in your downloader extension; use ``BAAssetPack/download`` instead in your main app.
#[unsafe(method(downloadForContentRequest:))]
#[unsafe(method_family = none)]
pub unsafe fn downloadForContentRequest(
&self,
content_request: BAContentRequest,
) -> Retained<BADownload>;
);
}