use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct HKGAD7AssessmentRisk(pub NSInteger);
impl HKGAD7AssessmentRisk {
#[doc(alias = "HKGAD7AssessmentRiskNoneToMinimal")]
pub const NoneToMinimal: Self = Self(1);
#[doc(alias = "HKGAD7AssessmentRiskMild")]
pub const Mild: Self = Self(2);
#[doc(alias = "HKGAD7AssessmentRiskModerate")]
pub const Moderate: Self = Self(3);
#[doc(alias = "HKGAD7AssessmentRiskSevere")]
pub const Severe: Self = Self(4);
}
unsafe impl Encode for HKGAD7AssessmentRisk {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for HKGAD7AssessmentRisk {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct HKGAD7AssessmentAnswer(pub NSInteger);
impl HKGAD7AssessmentAnswer {
#[doc(alias = "HKGAD7AssessmentAnswerNotAtAll")]
pub const NotAtAll: Self = Self(0);
#[doc(alias = "HKGAD7AssessmentAnswerSeveralDays")]
pub const SeveralDays: Self = Self(1);
#[doc(alias = "HKGAD7AssessmentAnswerMoreThanHalfTheDays")]
pub const MoreThanHalfTheDays: Self = Self(2);
#[doc(alias = "HKGAD7AssessmentAnswerNearlyEveryDay")]
pub const NearlyEveryDay: Self = Self(3);
}
unsafe impl Encode for HKGAD7AssessmentAnswer {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for HKGAD7AssessmentAnswer {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern "C-unwind" {
pub fn HKMinimumScoreForGAD7AssessmentRisk(risk: HKGAD7AssessmentRisk) -> NSInteger;
}
extern "C-unwind" {
pub fn HKMaximumScoreForGAD7AssessmentRisk(risk: HKGAD7AssessmentRisk) -> NSInteger;
}
extern_class!(
#[unsafe(super(HKScoredAssessment, HKSample, HKObject, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(
feature = "HKObject",
feature = "HKSample",
feature = "HKScoredAssessment"
))]
pub struct HKGAD7Assessment;
);
#[cfg(all(
feature = "HKObject",
feature = "HKSample",
feature = "HKScoredAssessment"
))]
unsafe impl Send for HKGAD7Assessment {}
#[cfg(all(
feature = "HKObject",
feature = "HKSample",
feature = "HKScoredAssessment"
))]
unsafe impl Sync for HKGAD7Assessment {}
#[cfg(all(
feature = "HKObject",
feature = "HKSample",
feature = "HKScoredAssessment"
))]
extern_conformance!(
unsafe impl NSCoding for HKGAD7Assessment {}
);
#[cfg(all(
feature = "HKObject",
feature = "HKSample",
feature = "HKScoredAssessment"
))]
extern_conformance!(
unsafe impl NSCopying for HKGAD7Assessment {}
);
#[cfg(all(
feature = "HKObject",
feature = "HKSample",
feature = "HKScoredAssessment"
))]
unsafe impl CopyingHelper for HKGAD7Assessment {
type Result = Self;
}
#[cfg(all(
feature = "HKObject",
feature = "HKSample",
feature = "HKScoredAssessment"
))]
extern_conformance!(
unsafe impl NSObjectProtocol for HKGAD7Assessment {}
);
#[cfg(all(
feature = "HKObject",
feature = "HKSample",
feature = "HKScoredAssessment"
))]
extern_conformance!(
unsafe impl NSSecureCoding for HKGAD7Assessment {}
);
#[cfg(all(
feature = "HKObject",
feature = "HKSample",
feature = "HKScoredAssessment"
))]
impl HKGAD7Assessment {
extern_methods!(
#[unsafe(method(answers))]
#[unsafe(method_family = none)]
pub unsafe fn answers(&self) -> Retained<NSArray<NSNumber>>;
#[unsafe(method(risk))]
#[unsafe(method_family = none)]
pub unsafe fn risk(&self) -> HKGAD7AssessmentRisk;
#[unsafe(method(assessmentWithDate:answers:))]
#[unsafe(method_family = none)]
pub unsafe fn assessmentWithDate_answers(
date: &NSDate,
answers: &NSArray<NSNumber>,
) -> Retained<Self>;
#[unsafe(method(assessmentWithDate:answers:metadata:))]
#[unsafe(method_family = none)]
pub unsafe fn assessmentWithDate_answers_metadata(
date: &NSDate,
answers: &NSArray<NSNumber>,
metadata: Option<&NSDictionary<NSString, AnyObject>>,
) -> Retained<Self>;
#[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>;
);
}