use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern "C" {
pub static AAAttributionErrorDomain: &'static NSErrorDomain;
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AAAttributionErrorCode(pub NSInteger);
impl AAAttributionErrorCode {
#[doc(alias = "AAAttributionErrorCodeNetworkError")]
pub const NetworkError: Self = Self(1);
#[doc(alias = "AAAttributionErrorCodeInternalError")]
pub const InternalError: Self = Self(2);
#[doc(alias = "AAAttributionErrorCodePlatformNotSupported")]
pub const PlatformNotSupported: Self = Self(3);
}
unsafe impl Encode for AAAttributionErrorCode {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for AAAttributionErrorCode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct AAAttribution;
);
extern_conformance!(
unsafe impl NSObjectProtocol for AAAttribution {}
);
impl AAAttribution {
extern_methods!(
#[unsafe(method(attributionTokenWithError:_))]
#[unsafe(method_family = none)]
pub unsafe fn attributionTokenWithError() -> Result<Retained<NSString>, Retained<NSError>>;
);
}
impl AAAttribution {
extern_methods!(
#[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>;
);
}