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
172extern_conformance!(
173 unsafe impl NSObjectProtocol for NSHTTPCookie {}
174);
175
176impl NSHTTPCookie {
177 extern_methods!(
178 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
179 /// Initialize a NSHTTPCookie object with a dictionary of
180 /// parameters
181 ///
182 /// Parameter `properties`: The dictionary of properties to be used to
183 /// initialize this cookie.
184 ///
185 /// Supported dictionary keys and value types for the
186 /// given dictionary are as follows.
187 ///
188 /// All properties can handle an NSString value, but some can also
189 /// handle other types.
190 ///
191 /// <table border="1" cellspacing="2" cellpadding="4">
192 /// <tr>
193 /// <th>
194 /// Property key constant
195 /// </th>
196 /// <th>
197 /// Type of value
198 /// </th>
199 /// <th>
200 /// Required
201 /// </th>
202 /// <th>
203 /// Description
204 /// </th>
205 /// </tr>
206 /// <tr>
207 /// <td>
208 /// NSHTTPCookieComment
209 /// </td>
210 /// <td>
211 /// NSString
212 /// </td>
213 /// <td>
214 /// NO
215 /// </td>
216 /// <td>
217 /// Comment for the cookie. Only valid for version 1 cookies and
218 /// later. Default is nil.
219 /// </td>
220 /// </tr>
221 /// <tr>
222 /// <td>
223 /// NSHTTPCookieCommentURL
224 /// </td>
225 /// <td>
226 /// NSURL or NSString
227 /// </td>
228 /// <td>
229 /// NO
230 /// </td>
231 /// <td>
232 /// Comment URL for the cookie. Only valid for version 1 cookies
233 /// and later. Default is nil.
234 /// </td>
235 /// </tr>
236 /// <tr>
237 /// <td>
238 /// NSHTTPCookieDomain
239 /// </td>
240 /// <td>
241 /// NSString
242 /// </td>
243 /// <td>
244 /// Special, a value for either NSHTTPCookieOriginURL or
245 /// NSHTTPCookieDomain must be specified.
246 /// </td>
247 /// <td>
248 /// Domain for the cookie. Inferred from the value for
249 /// NSHTTPCookieOriginURL if not provided.
250 /// </td>
251 /// </tr>
252 /// <tr>
253 /// <td>
254 /// NSHTTPCookieDiscard
255 /// </td>
256 /// <td>
257 /// NSString
258 /// </td>
259 /// <td>
260 /// NO
261 /// </td>
262 /// <td>
263 /// A string stating whether the cookie should be discarded at
264 /// the end of the session. String value must be either "TRUE" or
265 /// "FALSE". Default is "FALSE", unless this is cookie is version
266 /// 1 or greater and a value for NSHTTPCookieMaximumAge is not
267 /// specified, in which case it is assumed "TRUE".
268 /// </td>
269 /// </tr>
270 /// <tr>
271 /// <td>
272 /// NSHTTPCookieExpires
273 /// </td>
274 /// <td>
275 /// NSDate or NSString
276 /// </td>
277 /// <td>
278 /// NO
279 /// </td>
280 /// <td>
281 /// Expiration date for the cookie. Used only for version 0
282 /// cookies. Ignored for version 1 or greater.
283 /// </td>
284 /// </tr>
285 /// <tr>
286 /// <td>
287 /// NSHTTPCookieMaximumAge
288 /// </td>
289 /// <td>
290 /// NSString
291 /// </td>
292 /// <td>
293 /// NO
294 /// </td>
295 /// <td>
296 /// A string containing an integer value stating how long in
297 /// seconds the cookie should be kept, at most. Only valid for
298 /// version 1 cookies and later. Default is "0".
299 /// </td>
300 /// </tr>
301 /// <tr>
302 /// <td>
303 /// NSHTTPCookieName
304 /// </td>
305 /// <td>
306 /// NSString
307 /// </td>
308 /// <td>
309 /// YES
310 /// </td>
311 /// <td>
312 /// Name of the cookie
313 /// </td>
314 /// </tr>
315 /// <tr>
316 /// <td>
317 /// NSHTTPCookieOriginURL
318 /// </td>
319 /// <td>
320 /// NSURL or NSString
321 /// </td>
322 /// <td>
323 /// Special, a value for either NSHTTPCookieOriginURL or
324 /// NSHTTPCookieDomain must be specified.
325 /// </td>
326 /// <td>
327 /// URL that set this cookie. Used as default for other fields
328 /// as noted.
329 /// </td>
330 /// </tr>
331 /// <tr>
332 /// <td>
333 /// NSHTTPCookiePath
334 /// </td>
335 /// <td>
336 /// NSString
337 /// </td>
338 /// <td>
339 /// NO
340 /// </td>
341 /// <td>
342 /// Path for the cookie. Inferred from the value for
343 /// NSHTTPCookieOriginURL if not provided. Default is "/".
344 /// </td>
345 /// </tr>
346 /// <tr>
347 /// <td>
348 /// NSHTTPCookiePort
349 /// </td>
350 /// <td>
351 /// NSString
352 /// </td>
353 /// <td>
354 /// NO
355 /// </td>
356 /// <td>
357 /// comma-separated integer values specifying the ports for the
358 /// cookie. Only valid for version 1 cookies and later. Default is
359 /// empty string ("").
360 /// </td>
361 /// </tr>
362 /// <tr>
363 /// <td>
364 /// NSHTTPCookieSecure
365 /// </td>
366 /// <td>
367 /// NSString
368 /// </td>
369 /// <td>
370 /// NO
371 /// </td>
372 /// <td>
373 /// A string stating whether the cookie should be transmitted
374 /// only over secure channels. String value must be either "TRUE"
375 /// or "FALSE". Default is "FALSE".
376 /// </td>
377 /// </tr>
378 /// <tr>
379 /// <td>
380 /// NSHTTPCookieValue
381 /// </td>
382 /// <td>
383 /// NSString
384 /// </td>
385 /// <td>
386 /// YES
387 /// </td>
388 /// <td>
389 /// Value of the cookie
390 /// </td>
391 /// </tr>
392 /// <tr>
393 /// <td>
394 /// NSHTTPCookieVersion
395 /// </td>
396 /// <td>
397 /// NSString
398 /// </td>
399 /// <td>
400 /// NO
401 /// </td>
402 /// <td>
403 /// Specifies the version of the cookie. Must be either "0" or
404 /// "1". Default is "0".
405 /// </td>
406 /// </tr>
407 /// <tr>
408 /// <td>
409 /// NSHTTPCookieSetByJavaScript
410 /// </td>
411 /// <td>
412 /// NSNumber
413 /// </td>
414 /// <td>
415 /// NO
416 /// </td>
417 /// <td>
418 /// `true`if the cookie is set via JavaScript.
419 /// `false`if the cookie
420 /// is not set via JavaScript
421 /// </td>
422 /// </tr>
423 /// </table>
424 /// <p>
425 /// All other keys are ignored.
426 ///
427 /// Returns: An initialized NSHTTPCookie, or nil if the set of
428 /// dictionary keys is invalid, for example because a required key is
429 /// missing, or a recognized key maps to an illegal value.
430 #[unsafe(method(initWithProperties:))]
431 #[unsafe(method_family = init)]
432 pub unsafe fn initWithProperties(
433 this: Allocated<Self>,
434 properties: &NSDictionary<NSHTTPCookiePropertyKey, AnyObject>,
435 ) -> Option<Retained<Self>>;
436
437 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
438 /// Allocates and initializes an NSHTTPCookie with the given
439 /// dictionary.
440 ///
441 /// See the NSHTTPCookie
442 /// <tt>
443 /// -initWithProperties:
444 /// </tt>
445 /// method for more information on the constraints imposed on the
446 /// dictionary, and for descriptions of the supported keys and values.
447 ///
448 /// Parameter `properties`: The dictionary to use to initialize this cookie.
449 ///
450 /// Returns: A newly-created and autoreleased NSHTTPCookie instance, or
451 /// nil if the set of dictionary keys is invalid, for example because
452 /// a required key is missing, or a recognized key maps to an illegal
453 /// value.
454 #[unsafe(method(cookieWithProperties:))]
455 #[unsafe(method_family = none)]
456 pub unsafe fn cookieWithProperties(
457 properties: &NSDictionary<NSHTTPCookiePropertyKey, AnyObject>,
458 ) -> Option<Retained<NSHTTPCookie>>;
459
460 #[cfg(all(feature = "NSArray", feature = "NSDictionary", feature = "NSString"))]
461 /// Return a dictionary of header fields that can be used to add the
462 /// specified cookies to the request.
463 ///
464 /// Parameter `cookies`: The cookies to turn into request headers.
465 ///
466 /// Returns: An NSDictionary where the keys are header field names, and the values
467 /// are the corresponding header field values.
468 #[unsafe(method(requestHeaderFieldsWithCookies:))]
469 #[unsafe(method_family = none)]
470 pub unsafe fn requestHeaderFieldsWithCookies(
471 cookies: &NSArray<NSHTTPCookie>,
472 ) -> Retained<NSDictionary<NSString, NSString>>;
473
474 #[cfg(all(
475 feature = "NSArray",
476 feature = "NSDictionary",
477 feature = "NSString",
478 feature = "NSURL"
479 ))]
480 /// Return an array of cookies parsed from the specified response header fields and URL.
481 ///
482 /// Parameter `headerFields`: The response header fields to check for cookies.
483 ///
484 /// Parameter `URL`: The URL that the cookies came from - relevant to how the cookies are interpreted.
485 ///
486 /// Returns: An NSArray of NSHTTPCookie objects
487 ///
488 /// This method will ignore irrelevant header fields so
489 /// you can pass a dictionary containing data other than cookie data.
490 #[unsafe(method(cookiesWithResponseHeaderFields:forURL:))]
491 #[unsafe(method_family = none)]
492 pub unsafe fn cookiesWithResponseHeaderFields_forURL(
493 header_fields: &NSDictionary<NSString, NSString>,
494 url: &NSURL,
495 ) -> Retained<NSArray<NSHTTPCookie>>;
496
497 #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
498 /// Returns a dictionary representation of the receiver.
499 ///
500 /// This method returns a dictionary representation of the
501 /// NSHTTPCookie which can be saved and passed to
502 /// <tt>
503 /// -initWithProperties:
504 /// </tt>
505 /// or
506 /// <tt>
507 /// +cookieWithProperties:
508 /// </tt>
509 /// later to reconstitute an equivalent cookie.
510 /// <p>
511 /// See the NSHTTPCookie
512 /// <tt>
513 /// -initWithProperties:
514 /// </tt>
515 /// method for
516 /// more information on the constraints imposed on the dictionary, and
517 /// for descriptions of the supported keys and values.
518 ///
519 /// Returns: The dictionary representation of the receiver.
520 #[unsafe(method(properties))]
521 #[unsafe(method_family = none)]
522 pub unsafe fn properties(
523 &self,
524 ) -> Option<Retained<NSDictionary<NSHTTPCookiePropertyKey, AnyObject>>>;
525
526 /// Returns the version of the receiver.
527 ///
528 /// Version 0 maps to "old-style" Netscape cookies.
529 /// Version 1 maps to RFC2965 cookies. There may be future versions.
530 ///
531 /// Returns: the version of the receiver.
532 #[unsafe(method(version))]
533 #[unsafe(method_family = none)]
534 pub unsafe fn version(&self) -> NSUInteger;
535
536 #[cfg(feature = "NSString")]
537 /// Returns the name of the receiver.
538 ///
539 /// Returns: the name of the receiver.
540 #[unsafe(method(name))]
541 #[unsafe(method_family = none)]
542 pub unsafe fn name(&self) -> Retained<NSString>;
543
544 #[cfg(feature = "NSString")]
545 /// Returns the value of the receiver.
546 ///
547 /// Returns: the value of the receiver.
548 #[unsafe(method(value))]
549 #[unsafe(method_family = none)]
550 pub unsafe fn value(&self) -> Retained<NSString>;
551
552 #[cfg(feature = "NSDate")]
553 /// Returns the expires date of the receiver.
554 ///
555 /// Returns: the expires date of the receiver.
556 ///
557 /// The expires date is the date when the cookie should be
558 /// deleted. The result will be nil if there is no specific expires
559 /// date. This will be the case only for "session-only" cookies.
560 ///
561 /// Returns: The expires date of the receiver.
562 #[unsafe(method(expiresDate))]
563 #[unsafe(method_family = none)]
564 pub unsafe fn expiresDate(&self) -> Option<Retained<NSDate>>;
565
566 /// Returns whether the receiver is session-only.
567 ///
568 /// Returns: YES if this receiver should be discarded at the end of the
569 /// session (regardless of expiration date), NO if receiver need not
570 /// be discarded at the end of the session.
571 #[unsafe(method(isSessionOnly))]
572 #[unsafe(method_family = none)]
573 pub unsafe fn isSessionOnly(&self) -> bool;
574
575 #[cfg(feature = "NSString")]
576 /// Returns the domain of the receiver.
577 ///
578 /// This value specifies URL domain to which the cookie
579 /// should be sent. A domain with a leading dot means the cookie
580 /// should be sent to subdomains as well, assuming certain other
581 /// restrictions are valid. See RFC 2965 for more detail.
582 ///
583 /// Returns: The domain of the receiver.
584 #[unsafe(method(domain))]
585 #[unsafe(method_family = none)]
586 pub unsafe fn domain(&self) -> Retained<NSString>;
587
588 #[cfg(feature = "NSString")]
589 /// Returns the path of the receiver.
590 ///
591 /// This value specifies the URL path under the cookie's
592 /// domain for which this cookie should be sent. The cookie will also
593 /// be sent for children of that path, so "/" is the most general.
594 ///
595 /// Returns: The path of the receiver.
596 #[unsafe(method(path))]
597 #[unsafe(method_family = none)]
598 pub unsafe fn path(&self) -> Retained<NSString>;
599
600 /// Returns whether the receiver should be sent only over
601 /// secure channels
602 ///
603 /// Cookies may be marked secure by a server (or by a javascript).
604 /// Cookies marked as such must only be sent via an encrypted connection to
605 /// trusted servers (i.e. via SSL or TLS), and should not be delivered to any
606 /// javascript applications to prevent cross-site scripting vulnerabilities.
607 ///
608 /// Returns: YES if this cookie should be sent only over secure channels,
609 /// NO otherwise.
610 #[unsafe(method(isSecure))]
611 #[unsafe(method_family = none)]
612 pub unsafe fn isSecure(&self) -> bool;
613
614 /// Returns whether the receiver should only be sent to HTTP servers
615 /// per RFC 2965
616 ///
617 /// Cookies may be marked as HTTPOnly by a server (or by a javascript).
618 /// Cookies marked as such must only be sent via HTTP Headers in HTTP Requests
619 /// for URL's that match both the path and domain of the respective Cookies.
620 /// Specifically these cookies should not be delivered to any javascript
621 /// applications to prevent cross-site scripting vulnerabilities.
622 ///
623 /// Returns: YES if this cookie should only be sent via HTTP headers,
624 /// NO otherwise.
625 #[unsafe(method(isHTTPOnly))]
626 #[unsafe(method_family = none)]
627 pub unsafe fn isHTTPOnly(&self) -> bool;
628
629 #[cfg(feature = "NSString")]
630 /// Returns the comment of the receiver.
631 ///
632 /// This value specifies a string which is suitable for
633 /// presentation to the user explaining the contents and purpose of this
634 /// cookie. It may be nil.
635 ///
636 /// Returns: The comment of the receiver, or nil if the receiver has no
637 /// comment.
638 #[unsafe(method(comment))]
639 #[unsafe(method_family = none)]
640 pub unsafe fn comment(&self) -> Option<Retained<NSString>>;
641
642 #[cfg(feature = "NSURL")]
643 /// Returns the comment URL of the receiver.
644 ///
645 /// This value specifies a URL which is suitable for
646 /// presentation to the user as a link for further information about
647 /// this cookie. It may be nil.
648 ///
649 /// Returns: The comment URL of the receiver, or nil if the receiver
650 /// has no comment URL.
651 #[unsafe(method(commentURL))]
652 #[unsafe(method_family = none)]
653 pub unsafe fn commentURL(&self) -> Option<Retained<NSURL>>;
654
655 #[cfg(all(feature = "NSArray", feature = "NSValue"))]
656 /// Returns the list ports to which the receiver should be
657 /// sent.
658 ///
659 /// This value specifies an NSArray of NSNumbers
660 /// (containing integers) which specify the only ports to which this
661 /// cookie should be sent.
662 ///
663 /// Returns: The list ports to which the receiver should be sent. The
664 /// array may be nil, in which case this cookie can be sent to any
665 /// port.
666 #[unsafe(method(portList))]
667 #[unsafe(method_family = none)]
668 pub unsafe fn portList(&self) -> Option<Retained<NSArray<NSNumber>>>;
669
670 #[cfg(feature = "NSString")]
671 /// Returns the value of the same site attribute on the cookie.
672 ///
673 /// Cookies can be marked with an attribute Strict or Lax.
674 /// Cookies marked with "strict" (NSHTTPCookieSameSiteStrict) are not sent along with cross-site requests.
675 /// Cookies marked with "lax" (NSHTTPCookieSameSiteLax) sent along cross-site requests provided the
676 /// cross-site requests are top-level-requests (one that changes the url in the address bar).
677 /// The attribute value is canonicalized and stored. Any value other than the default (strict and lax) will be ignored.
678 ///
679 /// Returns: strict or lax. The result could also be nil, in which case the
680 /// cookie will be sent along with all cross-site requests.
681 #[unsafe(method(sameSitePolicy))]
682 #[unsafe(method_family = none)]
683 pub unsafe fn sameSitePolicy(&self) -> Option<Retained<NSHTTPCookieStringPolicy>>;
684 );
685}
686
687/// Methods declared on superclass `NSObject`.
688impl NSHTTPCookie {
689 extern_methods!(
690 #[unsafe(method(init))]
691 #[unsafe(method_family = init)]
692 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
693
694 #[unsafe(method(new))]
695 #[unsafe(method_family = new)]
696 pub unsafe fn new() -> Retained<Self>;
697 );
698}