use crate::common::*;
use crate::Foundation::*;
typed_extensible_enum!(
pub type NSHTTPCookiePropertyKey = NSString;
);
typed_enum!(
pub type NSHTTPCookieStringPolicy = NSString;
);
extern_static!(NSHTTPCookieName: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookieValue: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookieOriginURL: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookieVersion: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookieDomain: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookiePath: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookieSecure: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookieExpires: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookieComment: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookieCommentURL: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookieDiscard: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookieMaximumAge: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookiePort: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookieSameSitePolicy: &'static NSHTTPCookiePropertyKey);
extern_static!(NSHTTPCookieSameSiteLax: &'static NSHTTPCookieStringPolicy);
extern_static!(NSHTTPCookieSameSiteStrict: &'static NSHTTPCookieStringPolicy);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSHTTPCookie")]
pub struct NSHTTPCookie;
#[cfg(feature = "Foundation_NSHTTPCookie")]
unsafe impl ClassType for NSHTTPCookie {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
#[cfg(feature = "Foundation_NSHTTPCookie")]
unsafe impl Send for NSHTTPCookie {}
#[cfg(feature = "Foundation_NSHTTPCookie")]
unsafe impl Sync for NSHTTPCookie {}
#[cfg(feature = "Foundation_NSHTTPCookie")]
unsafe impl NSObjectProtocol for NSHTTPCookie {}
extern_methods!(
#[cfg(feature = "Foundation_NSHTTPCookie")]
unsafe impl NSHTTPCookie {
#[cfg(feature = "Foundation_NSDictionary")]
#[method_id(@__retain_semantics Init initWithProperties:)]
pub unsafe fn initWithProperties(
this: Allocated<Self>,
properties: &NSDictionary<NSHTTPCookiePropertyKey, AnyObject>,
) -> Option<Id<Self>>;
#[cfg(feature = "Foundation_NSDictionary")]
#[method_id(@__retain_semantics Other cookieWithProperties:)]
pub unsafe fn cookieWithProperties(
properties: &NSDictionary<NSHTTPCookiePropertyKey, AnyObject>,
) -> Option<Id<NSHTTPCookie>>;
#[cfg(all(
feature = "Foundation_NSArray",
feature = "Foundation_NSDictionary",
feature = "Foundation_NSString"
))]
#[method_id(@__retain_semantics Other requestHeaderFieldsWithCookies:)]
pub unsafe fn requestHeaderFieldsWithCookies(
cookies: &NSArray<NSHTTPCookie>,
) -> Id<NSDictionary<NSString, NSString>>;
#[cfg(all(
feature = "Foundation_NSArray",
feature = "Foundation_NSDictionary",
feature = "Foundation_NSString",
feature = "Foundation_NSURL"
))]
#[method_id(@__retain_semantics Other cookiesWithResponseHeaderFields:forURL:)]
pub unsafe fn cookiesWithResponseHeaderFields_forURL(
header_fields: &NSDictionary<NSString, NSString>,
url: &NSURL,
) -> Id<NSArray<NSHTTPCookie>>;
#[cfg(feature = "Foundation_NSDictionary")]
#[method_id(@__retain_semantics Other properties)]
pub unsafe fn properties(
&self,
) -> Option<Id<NSDictionary<NSHTTPCookiePropertyKey, AnyObject>>>;
#[method(version)]
pub unsafe fn version(&self) -> NSUInteger;
#[cfg(feature = "Foundation_NSString")]
#[method_id(@__retain_semantics Other name)]
pub unsafe fn name(&self) -> Id<NSString>;
#[cfg(feature = "Foundation_NSString")]
#[method_id(@__retain_semantics Other value)]
pub unsafe fn value(&self) -> Id<NSString>;
#[cfg(feature = "Foundation_NSDate")]
#[method_id(@__retain_semantics Other expiresDate)]
pub unsafe fn expiresDate(&self) -> Option<Id<NSDate>>;
#[method(isSessionOnly)]
pub unsafe fn isSessionOnly(&self) -> bool;
#[cfg(feature = "Foundation_NSString")]
#[method_id(@__retain_semantics Other domain)]
pub unsafe fn domain(&self) -> Id<NSString>;
#[cfg(feature = "Foundation_NSString")]
#[method_id(@__retain_semantics Other path)]
pub unsafe fn path(&self) -> Id<NSString>;
#[method(isSecure)]
pub unsafe fn isSecure(&self) -> bool;
#[method(isHTTPOnly)]
pub unsafe fn isHTTPOnly(&self) -> bool;
#[cfg(feature = "Foundation_NSString")]
#[method_id(@__retain_semantics Other comment)]
pub unsafe fn comment(&self) -> Option<Id<NSString>>;
#[cfg(feature = "Foundation_NSURL")]
#[method_id(@__retain_semantics Other commentURL)]
pub unsafe fn commentURL(&self) -> Option<Id<NSURL>>;
#[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSNumber"))]
#[method_id(@__retain_semantics Other portList)]
pub unsafe fn portList(&self) -> Option<Id<NSArray<NSNumber>>>;
#[method_id(@__retain_semantics Other sameSitePolicy)]
pub unsafe fn sameSitePolicy(&self) -> Option<Id<NSHTTPCookieStringPolicy>>;
}
);
extern_methods!(
#[cfg(feature = "Foundation_NSHTTPCookie")]
unsafe impl NSHTTPCookie {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self>;
}
);