objc2_foundation/generated/
NSHTTPCookie.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiepropertykey?language=objc)
9// NS_TYPED_EXTENSIBLE_ENUM
10#[cfg(feature = "NSString")]
11pub type NSHTTPCookiePropertyKey = NSString;
12
13/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiestringpolicy?language=objc)
14// NS_TYPED_ENUM
15#[cfg(feature = "NSString")]
16pub type NSHTTPCookieStringPolicy = NSString;
17
18extern "C" {
19    /// Key for cookie name
20    ///
21    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiename?language=objc)
22    #[cfg(feature = "NSString")]
23    pub static NSHTTPCookieName: &'static NSHTTPCookiePropertyKey;
24}
25
26extern "C" {
27    /// Key for cookie value
28    ///
29    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookievalue?language=objc)
30    #[cfg(feature = "NSString")]
31    pub static NSHTTPCookieValue: &'static NSHTTPCookiePropertyKey;
32}
33
34extern "C" {
35    /// Key for cookie origin URL
36    ///
37    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookieoriginurl?language=objc)
38    #[cfg(feature = "NSString")]
39    pub static NSHTTPCookieOriginURL: &'static NSHTTPCookiePropertyKey;
40}
41
42extern "C" {
43    /// Key for cookie version
44    ///
45    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookieversion?language=objc)
46    #[cfg(feature = "NSString")]
47    pub static NSHTTPCookieVersion: &'static NSHTTPCookiePropertyKey;
48}
49
50extern "C" {
51    /// Key for cookie domain
52    ///
53    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiedomain?language=objc)
54    #[cfg(feature = "NSString")]
55    pub static NSHTTPCookieDomain: &'static NSHTTPCookiePropertyKey;
56}
57
58extern "C" {
59    /// Key for cookie path
60    ///
61    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiepath?language=objc)
62    #[cfg(feature = "NSString")]
63    pub static NSHTTPCookiePath: &'static NSHTTPCookiePropertyKey;
64}
65
66extern "C" {
67    /// Key for cookie secure flag
68    ///
69    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiesecure?language=objc)
70    #[cfg(feature = "NSString")]
71    pub static NSHTTPCookieSecure: &'static NSHTTPCookiePropertyKey;
72}
73
74extern "C" {
75    /// Key for cookie expiration date
76    ///
77    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookieexpires?language=objc)
78    #[cfg(feature = "NSString")]
79    pub static NSHTTPCookieExpires: &'static NSHTTPCookiePropertyKey;
80}
81
82extern "C" {
83    /// Key for cookie comment text
84    ///
85    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiecomment?language=objc)
86    #[cfg(feature = "NSString")]
87    pub static NSHTTPCookieComment: &'static NSHTTPCookiePropertyKey;
88}
89
90extern "C" {
91    /// Key for cookie comment URL
92    ///
93    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiecommenturl?language=objc)
94    #[cfg(feature = "NSString")]
95    pub static NSHTTPCookieCommentURL: &'static NSHTTPCookiePropertyKey;
96}
97
98extern "C" {
99    /// Key for cookie discard (session-only) flag
100    ///
101    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiediscard?language=objc)
102    #[cfg(feature = "NSString")]
103    pub static NSHTTPCookieDiscard: &'static NSHTTPCookiePropertyKey;
104}
105
106extern "C" {
107    /// Key for cookie maximum age (an alternate way of specifying the expiration)
108    ///
109    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiemaximumage?language=objc)
110    #[cfg(feature = "NSString")]
111    pub static NSHTTPCookieMaximumAge: &'static NSHTTPCookiePropertyKey;
112}
113
114extern "C" {
115    /// Key for cookie ports
116    ///
117    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookieport?language=objc)
118    #[cfg(feature = "NSString")]
119    pub static NSHTTPCookiePort: &'static NSHTTPCookiePropertyKey;
120}
121
122extern "C" {
123    /// An NSString object indicating that the cookie is set via JavaScript.
124    ///
125    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiesetbyjavascript?language=objc)
126    #[cfg(feature = "NSString")]
127    pub static NSHTTPCookieSetByJavaScript: &'static NSHTTPCookiePropertyKey;
128}
129
130extern "C" {
131    /// Key for cookie same site
132    ///
133    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiesamesitepolicy?language=objc)
134    #[cfg(feature = "NSString")]
135    pub static NSHTTPCookieSameSitePolicy: &'static NSHTTPCookiePropertyKey;
136}
137
138extern "C" {
139    /// String constant "lax" to be used as a value for the property key NSHTTPCookieSameSite
140    ///
141    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiesamesitelax?language=objc)
142    #[cfg(feature = "NSString")]
143    pub static NSHTTPCookieSameSiteLax: &'static NSHTTPCookieStringPolicy;
144}
145
146extern "C" {
147    /// String constant "strict" to be used as a value for the property key NSHTTPCookieSameSite
148    ///
149    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookiesamesitestrict?language=objc)
150    #[cfg(feature = "NSString")]
151    pub static NSHTTPCookieSameSiteStrict: &'static NSHTTPCookieStringPolicy;
152}
153
154extern_class!(
155    /// NSHTTPCookie represents an http cookie.
156    ///
157    /// A NSHTTPCookie instance represents a single http cookie. It is
158    /// an immutable object initialized from a dictionary that contains
159    /// the various cookie attributes. It has accessors to get the various
160    /// attributes of a cookie.
161    ///
162    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nshttpcookie?language=objc)
163    #[unsafe(super(NSObject))]
164    #[derive(Debug, PartialEq, Eq, Hash)]
165    pub struct NSHTTPCookie;
166);
167
168unsafe impl Send for NSHTTPCookie {}
169
170unsafe impl Sync for NSHTTPCookie {}
171
172unsafe impl NSObjectProtocol for NSHTTPCookie {}
173
174impl NSHTTPCookie {
175    extern_methods!(
176        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
177        /// Initialize a NSHTTPCookie object with a dictionary of
178        /// parameters
179        ///
180        /// Parameter `properties`: The dictionary of properties to be used to
181        /// initialize this cookie.
182        ///
183        /// Supported dictionary keys and value types for the
184        /// given dictionary are as follows.
185        ///
186        /// All properties can handle an NSString value, but some can also
187        /// handle other types.
188        ///
189        /// <table border="1" cellspacing="2" cellpadding="4">
190        /// <tr>
191        /// <th>
192        /// Property key constant
193        /// </th>
194        /// <th>
195        /// Type of value
196        /// </th>
197        /// <th>
198        /// Required
199        /// </th>
200        /// <th>
201        /// Description
202        /// </th>
203        /// </tr>
204        /// <tr>
205        /// <td>
206        /// NSHTTPCookieComment
207        /// </td>
208        /// <td>
209        /// NSString
210        /// </td>
211        /// <td>
212        /// NO
213        /// </td>
214        /// <td>
215        /// Comment for the cookie. Only valid for version 1 cookies and
216        /// later. Default is nil.
217        /// </td>
218        /// </tr>
219        /// <tr>
220        /// <td>
221        /// NSHTTPCookieCommentURL
222        /// </td>
223        /// <td>
224        /// NSURL or NSString
225        /// </td>
226        /// <td>
227        /// NO
228        /// </td>
229        /// <td>
230        /// Comment URL for the cookie. Only valid for version 1 cookies
231        /// and later. Default is nil.
232        /// </td>
233        /// </tr>
234        /// <tr>
235        /// <td>
236        /// NSHTTPCookieDomain
237        /// </td>
238        /// <td>
239        /// NSString
240        /// </td>
241        /// <td>
242        /// Special, a value for either NSHTTPCookieOriginURL or
243        /// NSHTTPCookieDomain must be specified.
244        /// </td>
245        /// <td>
246        /// Domain for the cookie. Inferred from the value for
247        /// NSHTTPCookieOriginURL if not provided.
248        /// </td>
249        /// </tr>
250        /// <tr>
251        /// <td>
252        /// NSHTTPCookieDiscard
253        /// </td>
254        /// <td>
255        /// NSString
256        /// </td>
257        /// <td>
258        /// NO
259        /// </td>
260        /// <td>
261        /// A string stating whether the cookie should be discarded at
262        /// the end of the session. String value must be either "TRUE" or
263        /// "FALSE". Default is "FALSE", unless this is cookie is version
264        /// 1 or greater and a value for NSHTTPCookieMaximumAge is not
265        /// specified, in which case it is assumed "TRUE".
266        /// </td>
267        /// </tr>
268        /// <tr>
269        /// <td>
270        /// NSHTTPCookieExpires
271        /// </td>
272        /// <td>
273        /// NSDate or NSString
274        /// </td>
275        /// <td>
276        /// NO
277        /// </td>
278        /// <td>
279        /// Expiration date for the cookie. Used only for version 0
280        /// cookies. Ignored for version 1 or greater.
281        /// </td>
282        /// </tr>
283        /// <tr>
284        /// <td>
285        /// NSHTTPCookieMaximumAge
286        /// </td>
287        /// <td>
288        /// NSString
289        /// </td>
290        /// <td>
291        /// NO
292        /// </td>
293        /// <td>
294        /// A string containing an integer value stating how long in
295        /// seconds the cookie should be kept, at most. Only valid for
296        /// version 1 cookies and later. Default is "0".
297        /// </td>
298        /// </tr>
299        /// <tr>
300        /// <td>
301        /// NSHTTPCookieName
302        /// </td>
303        /// <td>
304        /// NSString
305        /// </td>
306        /// <td>
307        /// YES
308        /// </td>
309        /// <td>
310        /// Name of the cookie
311        /// </td>
312        /// </tr>
313        /// <tr>
314        /// <td>
315        /// NSHTTPCookieOriginURL
316        /// </td>
317        /// <td>
318        /// NSURL or NSString
319        /// </td>
320        /// <td>
321        /// Special, a value for either NSHTTPCookieOriginURL or
322        /// NSHTTPCookieDomain must be specified.
323        /// </td>
324        /// <td>
325        /// URL that set this cookie. Used as default for other fields
326        /// as noted.
327        /// </td>
328        /// </tr>
329        /// <tr>
330        /// <td>
331        /// NSHTTPCookiePath
332        /// </td>
333        /// <td>
334        /// NSString
335        /// </td>
336        /// <td>
337        /// NO
338        /// </td>
339        /// <td>
340        /// Path for the cookie. Inferred from the value for
341        /// NSHTTPCookieOriginURL if not provided. Default is "/".
342        /// </td>
343        /// </tr>
344        /// <tr>
345        /// <td>
346        /// NSHTTPCookiePort
347        /// </td>
348        /// <td>
349        /// NSString
350        /// </td>
351        /// <td>
352        /// NO
353        /// </td>
354        /// <td>
355        /// comma-separated integer values specifying the ports for the
356        /// cookie. Only valid for version 1 cookies and later. Default is
357        /// empty string ("").
358        /// </td>
359        /// </tr>
360        /// <tr>
361        /// <td>
362        /// NSHTTPCookieSecure
363        /// </td>
364        /// <td>
365        /// NSString
366        /// </td>
367        /// <td>
368        /// NO
369        /// </td>
370        /// <td>
371        /// A string stating whether the cookie should be transmitted
372        /// only over secure channels. String value must be either "TRUE"
373        /// or "FALSE". Default is "FALSE".
374        /// </td>
375        /// </tr>
376        /// <tr>
377        /// <td>
378        /// NSHTTPCookieValue
379        /// </td>
380        /// <td>
381        /// NSString
382        /// </td>
383        /// <td>
384        /// YES
385        /// </td>
386        /// <td>
387        /// Value of the cookie
388        /// </td>
389        /// </tr>
390        /// <tr>
391        /// <td>
392        /// NSHTTPCookieVersion
393        /// </td>
394        /// <td>
395        /// NSString
396        /// </td>
397        /// <td>
398        /// NO
399        /// </td>
400        /// <td>
401        /// Specifies the version of the cookie. Must be either "0" or
402        /// "1". Default is "0".
403        /// </td>
404        /// </tr>
405        /// <tr>
406        /// <td>
407        /// NSHTTPCookieSetByJavaScript
408        /// </td>
409        /// <td>
410        /// NSNumber
411        /// </td>
412        /// <td>
413        /// NO
414        /// </td>
415        /// <td>
416        /// `true`if the cookie is set via JavaScript.
417        /// `false`if the cookie
418        /// is not set via JavaScript
419        /// </td>
420        /// </tr>
421        /// </table>
422        /// <p>
423        /// All other keys are ignored.
424        ///
425        /// Returns: An initialized NSHTTPCookie, or nil if the set of
426        /// dictionary keys is invalid, for example because a required key is
427        /// missing, or a recognized key maps to an illegal value.
428        #[unsafe(method(initWithProperties:))]
429        #[unsafe(method_family = init)]
430        pub unsafe fn initWithProperties(
431            this: Allocated<Self>,
432            properties: &NSDictionary<NSHTTPCookiePropertyKey, AnyObject>,
433        ) -> Option<Retained<Self>>;
434
435        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
436        /// Allocates and initializes an NSHTTPCookie with the given
437        /// dictionary.
438        ///
439        /// See the NSHTTPCookie
440        /// <tt>
441        /// -initWithProperties:
442        /// </tt>
443        /// method for more information on the constraints imposed on the
444        /// dictionary, and for descriptions of the supported keys and values.
445        ///
446        /// Parameter `properties`: The dictionary to use to initialize this cookie.
447        ///
448        /// Returns: A newly-created and autoreleased NSHTTPCookie instance, or
449        /// nil if the set of dictionary keys is invalid, for example because
450        /// a required key is missing, or a recognized key maps to an illegal
451        /// value.
452        #[unsafe(method(cookieWithProperties:))]
453        #[unsafe(method_family = none)]
454        pub unsafe fn cookieWithProperties(
455            properties: &NSDictionary<NSHTTPCookiePropertyKey, AnyObject>,
456        ) -> Option<Retained<NSHTTPCookie>>;
457
458        #[cfg(all(feature = "NSArray", feature = "NSDictionary", feature = "NSString"))]
459        /// Return a dictionary of header fields that can be used to add the
460        /// specified cookies to the request.
461        ///
462        /// Parameter `cookies`: The cookies to turn into request headers.
463        ///
464        /// Returns: An NSDictionary where the keys are header field names, and the values
465        /// are the corresponding header field values.
466        #[unsafe(method(requestHeaderFieldsWithCookies:))]
467        #[unsafe(method_family = none)]
468        pub unsafe fn requestHeaderFieldsWithCookies(
469            cookies: &NSArray<NSHTTPCookie>,
470        ) -> Retained<NSDictionary<NSString, NSString>>;
471
472        #[cfg(all(
473            feature = "NSArray",
474            feature = "NSDictionary",
475            feature = "NSString",
476            feature = "NSURL"
477        ))]
478        /// Return an array of cookies parsed from the specified response header fields and URL.
479        ///
480        /// Parameter `headerFields`: The response header fields to check for cookies.
481        ///
482        /// Parameter `URL`: The URL that the cookies came from - relevant to how the cookies are interpreted.
483        ///
484        /// Returns: An NSArray of NSHTTPCookie objects
485        ///
486        /// This method will ignore irrelevant header fields so
487        /// you can pass a dictionary containing data other than cookie data.
488        #[unsafe(method(cookiesWithResponseHeaderFields:forURL:))]
489        #[unsafe(method_family = none)]
490        pub unsafe fn cookiesWithResponseHeaderFields_forURL(
491            header_fields: &NSDictionary<NSString, NSString>,
492            url: &NSURL,
493        ) -> Retained<NSArray<NSHTTPCookie>>;
494
495        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
496        /// Returns a dictionary representation of the receiver.
497        ///
498        /// This method returns a dictionary representation of the
499        /// NSHTTPCookie which can be saved and passed to
500        /// <tt>
501        /// -initWithProperties:
502        /// </tt>
503        /// or
504        /// <tt>
505        /// +cookieWithProperties:
506        /// </tt>
507        /// later to reconstitute an equivalent cookie.
508        /// <p>
509        /// See the NSHTTPCookie
510        /// <tt>
511        /// -initWithProperties:
512        /// </tt>
513        /// method for
514        /// more information on the constraints imposed on the dictionary, and
515        /// for descriptions of the supported keys and values.
516        ///
517        /// Returns: The dictionary representation of the receiver.
518        #[unsafe(method(properties))]
519        #[unsafe(method_family = none)]
520        pub unsafe fn properties(
521            &self,
522        ) -> Option<Retained<NSDictionary<NSHTTPCookiePropertyKey, AnyObject>>>;
523
524        /// Returns the version of the receiver.
525        ///
526        /// Version 0 maps to "old-style" Netscape cookies.
527        /// Version 1 maps to RFC2965 cookies. There may be future versions.
528        ///
529        /// Returns: the version of the receiver.
530        #[unsafe(method(version))]
531        #[unsafe(method_family = none)]
532        pub unsafe fn version(&self) -> NSUInteger;
533
534        #[cfg(feature = "NSString")]
535        /// Returns the name of the receiver.
536        ///
537        /// Returns: the name of the receiver.
538        #[unsafe(method(name))]
539        #[unsafe(method_family = none)]
540        pub unsafe fn name(&self) -> Retained<NSString>;
541
542        #[cfg(feature = "NSString")]
543        /// Returns the value of the receiver.
544        ///
545        /// Returns: the value of the receiver.
546        #[unsafe(method(value))]
547        #[unsafe(method_family = none)]
548        pub unsafe fn value(&self) -> Retained<NSString>;
549
550        #[cfg(feature = "NSDate")]
551        /// Returns the expires date of the receiver.
552        ///
553        /// Returns: the expires date of the receiver.
554        ///
555        /// The expires date is the date when the cookie should be
556        /// deleted. The result will be nil if there is no specific expires
557        /// date. This will be the case only for "session-only" cookies.
558        ///
559        /// Returns: The expires date of the receiver.
560        #[unsafe(method(expiresDate))]
561        #[unsafe(method_family = none)]
562        pub unsafe fn expiresDate(&self) -> Option<Retained<NSDate>>;
563
564        /// Returns whether the receiver is session-only.
565        ///
566        /// Returns: YES if this receiver should be discarded at the end of the
567        /// session (regardless of expiration date), NO if receiver need not
568        /// be discarded at the end of the session.
569        #[unsafe(method(isSessionOnly))]
570        #[unsafe(method_family = none)]
571        pub unsafe fn isSessionOnly(&self) -> bool;
572
573        #[cfg(feature = "NSString")]
574        /// Returns the domain of the receiver.
575        ///
576        /// This value specifies URL domain to which the cookie
577        /// should be sent. A domain with a leading dot means the cookie
578        /// should be sent to subdomains as well, assuming certain other
579        /// restrictions are valid. See RFC 2965 for more detail.
580        ///
581        /// Returns: The domain of the receiver.
582        #[unsafe(method(domain))]
583        #[unsafe(method_family = none)]
584        pub unsafe fn domain(&self) -> Retained<NSString>;
585
586        #[cfg(feature = "NSString")]
587        /// Returns the path of the receiver.
588        ///
589        /// This value specifies the URL path under the cookie's
590        /// domain for which this cookie should be sent. The cookie will also
591        /// be sent for children of that path, so "/" is the most general.
592        ///
593        /// Returns: The path of the receiver.
594        #[unsafe(method(path))]
595        #[unsafe(method_family = none)]
596        pub unsafe fn path(&self) -> Retained<NSString>;
597
598        /// Returns whether the receiver should be sent only over
599        /// secure channels
600        ///
601        /// Cookies may be marked secure by a server (or by a javascript).
602        /// Cookies marked as such must only be sent via an encrypted connection to
603        /// trusted servers (i.e. via SSL or TLS), and should not be delivered to any
604        /// javascript applications to prevent cross-site scripting vulnerabilities.
605        ///
606        /// Returns: YES if this cookie should be sent only over secure channels,
607        /// NO otherwise.
608        #[unsafe(method(isSecure))]
609        #[unsafe(method_family = none)]
610        pub unsafe fn isSecure(&self) -> bool;
611
612        /// Returns whether the receiver should only be sent to HTTP servers
613        /// per RFC 2965
614        ///
615        /// Cookies may be marked as HTTPOnly by a server (or by a javascript).
616        /// Cookies marked as such must only be sent via HTTP Headers in HTTP Requests
617        /// for URL's that match both the path and domain of the respective Cookies.
618        /// Specifically these cookies should not be delivered to any javascript
619        /// applications to prevent cross-site scripting vulnerabilities.
620        ///
621        /// Returns: YES if this cookie should only be sent via HTTP headers,
622        /// NO otherwise.
623        #[unsafe(method(isHTTPOnly))]
624        #[unsafe(method_family = none)]
625        pub unsafe fn isHTTPOnly(&self) -> bool;
626
627        #[cfg(feature = "NSString")]
628        /// Returns the comment of the receiver.
629        ///
630        /// This value specifies a string which is suitable for
631        /// presentation to the user explaining the contents and purpose of this
632        /// cookie. It may be nil.
633        ///
634        /// Returns: The comment of the receiver, or nil if the receiver has no
635        /// comment.
636        #[unsafe(method(comment))]
637        #[unsafe(method_family = none)]
638        pub unsafe fn comment(&self) -> Option<Retained<NSString>>;
639
640        #[cfg(feature = "NSURL")]
641        /// Returns the comment URL of the receiver.
642        ///
643        /// This value specifies a URL which is suitable for
644        /// presentation to the user as a link for further information about
645        /// this cookie. It may be nil.
646        ///
647        /// Returns: The comment URL of the receiver, or nil if the receiver
648        /// has no comment URL.
649        #[unsafe(method(commentURL))]
650        #[unsafe(method_family = none)]
651        pub unsafe fn commentURL(&self) -> Option<Retained<NSURL>>;
652
653        #[cfg(all(feature = "NSArray", feature = "NSValue"))]
654        /// Returns the list ports to which the receiver should be
655        /// sent.
656        ///
657        /// This value specifies an NSArray of NSNumbers
658        /// (containing integers) which specify the only ports to which this
659        /// cookie should be sent.
660        ///
661        /// Returns: The list ports to which the receiver should be sent. The
662        /// array may be nil, in which case this cookie can be sent to any
663        /// port.
664        #[unsafe(method(portList))]
665        #[unsafe(method_family = none)]
666        pub unsafe fn portList(&self) -> Option<Retained<NSArray<NSNumber>>>;
667
668        #[cfg(feature = "NSString")]
669        /// Returns the value of the same site attribute on the cookie.
670        ///
671        /// Cookies can be marked with an attribute Strict or Lax.
672        /// Cookies marked with "strict" (NSHTTPCookieSameSiteStrict) are not sent along with cross-site requests.
673        /// Cookies marked with "lax" (NSHTTPCookieSameSiteLax) sent along cross-site requests provided the
674        /// cross-site requests are top-level-requests (one that changes the url in the address bar).
675        /// The attribute value is canonicalized and stored. Any value other than the default (strict and lax) will be ignored.
676        ///
677        /// Returns: strict or lax. The result could also be nil, in which case the
678        /// cookie will be sent along with all cross-site requests.
679        #[unsafe(method(sameSitePolicy))]
680        #[unsafe(method_family = none)]
681        pub unsafe fn sameSitePolicy(&self) -> Option<Retained<NSHTTPCookieStringPolicy>>;
682    );
683}
684
685/// Methods declared on superclass `NSObject`.
686impl NSHTTPCookie {
687    extern_methods!(
688        #[unsafe(method(init))]
689        #[unsafe(method_family = init)]
690        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
691
692        #[unsafe(method(new))]
693        #[unsafe(method_family = new)]
694        pub unsafe fn new() -> Retained<Self>;
695    );
696}