objc2-background-assets 0.3.2

Bindings to the BackgroundAssets framework
Documentation
//! 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!(
    /// [Apple's documentation](https://developer.apple.com/documentation/backgroundassets/baurldownload?language=objc)
    #[unsafe(super(BADownload, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "BADownload")]
    pub struct BAURLDownload;
);

#[cfg(feature = "BADownload")]
unsafe impl Send for BAURLDownload {}

#[cfg(feature = "BADownload")]
unsafe impl Sync for BAURLDownload {}

#[cfg(feature = "BADownload")]
extern_conformance!(
    unsafe impl NSCoding for BAURLDownload {}
);

#[cfg(feature = "BADownload")]
extern_conformance!(
    unsafe impl NSCopying for BAURLDownload {}
);

#[cfg(feature = "BADownload")]
unsafe impl CopyingHelper for BAURLDownload {
    type Result = Self;
}

#[cfg(feature = "BADownload")]
extern_conformance!(
    unsafe impl NSObjectProtocol for BAURLDownload {}
);

#[cfg(feature = "BADownload")]
extern_conformance!(
    unsafe impl NSSecureCoding for BAURLDownload {}
);

#[cfg(feature = "BADownload")]
impl BAURLDownload {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        /// Constructs a download object to represent the download of a asset located inside of the provided
        /// `request.`
        /// Parameter `identifier`: A unique identifier that is used to track the download across the app and extension.
        ///
        /// Parameter `request`: The request used to perform the download. The URL provided inside of the request must be a https scheme.
        ///
        /// Parameter `fileSize`: The size of the file to download. This field must be accurate in order to show the user accurate progress during app installation.
        /// If the size does not match the file being downloaded, then the download will fail.
        ///
        /// Parameter `applicationGroupIdentifier`: The identifier of the application group that should used to store the finished download.
        #[unsafe(method(initWithIdentifier:request:fileSize:applicationGroupIdentifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithIdentifier_request_fileSize_applicationGroupIdentifier(
            this: Allocated<Self>,
            identifier: &NSString,
            request: &NSURLRequest,
            file_size: NSUInteger,
            application_group_identifier: &NSString,
        ) -> Retained<Self>;

        /// Constructs a download object to represent the download of a asset located inside of the provided
        /// `request.`
        /// Parameter `identifier`: A unique identifier that is used to track the download across the app and extension.
        ///
        /// Parameter `request`: The request used to perform the download. The URL provided inside of the request must be a https scheme.
        ///
        /// Parameter `essential`: Whether the download is essential. See
        /// `BADownload.isEssential.`Default is false.
        ///
        /// Parameter `fileSize`: The size of the file to download. This field must be accurate in order to show the user accurate progress during app installation.
        /// If the size does not match the file being downloaded, then the download will fail.
        ///
        /// Parameter `applicationGroupIdentifier`: The identifier of the application group that should used to store the finished download.
        ///
        /// Parameter `priority`: A priority between
        /// `BADownloaderPriorityMin`-
        /// `BADownloaderPriorityMax`which is used to order the downloads for this process.
        /// It is recommended to use
        /// `BADownloaderPriorityDefault`if download priority does not matter.
        #[unsafe(method(initWithIdentifier:request:essential:fileSize:applicationGroupIdentifier:priority:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithIdentifier_request_essential_fileSize_applicationGroupIdentifier_priority(
            this: Allocated<Self>,
            identifier: &NSString,
            request: &NSURLRequest,
            essential: bool,
            file_size: NSUInteger,
            application_group_identifier: &NSString,
            priority: BADownloaderPriority,
        ) -> Retained<Self>;

        /// Constructs a download object to represent the download of a asset located inside of the provided
        /// `request.`
        /// Parameter `identifier`: A unique identifier that is used to track the download across the app and extension.
        ///
        /// Parameter `request`: The request used to perform the download. The URL provided inside of the request must be a https scheme.
        ///
        /// Parameter `applicationGroupIdentifier`: The identifier of the application group that should used to store the finished download.
        #[deprecated]
        #[unsafe(method(initWithIdentifier:request:applicationGroupIdentifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithIdentifier_request_applicationGroupIdentifier(
            this: Allocated<Self>,
            identifier: &NSString,
            request: &NSURLRequest,
            application_group_identifier: &NSString,
        ) -> Retained<Self>;

        /// Constructs a download object to represent the download of a asset located inside of the provided
        /// `request.`
        /// Parameter `identifier`: A unique identifier that is used to track the download across the app and extension.
        ///
        /// Parameter `request`: The request used to perform the download. The URL provided inside of the request must be a https scheme.
        ///
        /// Parameter `applicationGroupIdentifier`: The identifier of the application group that should used to store the finished download.
        ///
        /// Parameter `priority`: A priority between
        /// `BADownloaderPriorityMin`-
        /// `BADownloaderPriorityMax`which is used to order the downloads for this process.
        /// It is recommended to use
        /// `BADownloaderPriorityDefault`if download priority does not matter.
        #[deprecated]
        #[unsafe(method(initWithIdentifier:request:applicationGroupIdentifier:priority:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithIdentifier_request_applicationGroupIdentifier_priority(
            this: Allocated<Self>,
            identifier: &NSString,
            request: &NSURLRequest,
            application_group_identifier: &NSString,
            priority: BADownloaderPriority,
        ) -> Retained<Self>;
    );
}