1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;

use crate::*;

extern_protocol!(
    pub unsafe trait NSURLAuthenticationChallengeSender: NSObjectProtocol {
        #[cfg(feature = "NSURLCredential")]
        #[method(useCredential:forAuthenticationChallenge:)]
        unsafe fn useCredential_forAuthenticationChallenge(
            &self,
            credential: &NSURLCredential,
            challenge: &NSURLAuthenticationChallenge,
        );

        #[method(continueWithoutCredentialForAuthenticationChallenge:)]
        unsafe fn continueWithoutCredentialForAuthenticationChallenge(
            &self,
            challenge: &NSURLAuthenticationChallenge,
        );

        #[method(cancelAuthenticationChallenge:)]
        unsafe fn cancelAuthenticationChallenge(&self, challenge: &NSURLAuthenticationChallenge);

        #[optional]
        #[method(performDefaultHandlingForAuthenticationChallenge:)]
        unsafe fn performDefaultHandlingForAuthenticationChallenge(
            &self,
            challenge: &NSURLAuthenticationChallenge,
        );

        #[optional]
        #[method(rejectProtectionSpaceAndContinueWithChallenge:)]
        unsafe fn rejectProtectionSpaceAndContinueWithChallenge(
            &self,
            challenge: &NSURLAuthenticationChallenge,
        );
    }

    unsafe impl ProtocolType for dyn NSURLAuthenticationChallengeSender {}
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSURLAuthenticationChallenge;

    unsafe impl ClassType for NSURLAuthenticationChallenge {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl Send for NSURLAuthenticationChallenge {}

unsafe impl Sync for NSURLAuthenticationChallenge {}

#[cfg(feature = "NSObject")]
unsafe impl NSCoding for NSURLAuthenticationChallenge {}

unsafe impl NSObjectProtocol for NSURLAuthenticationChallenge {}

#[cfg(feature = "NSObject")]
unsafe impl NSSecureCoding for NSURLAuthenticationChallenge {}

extern_methods!(
    unsafe impl NSURLAuthenticationChallenge {
        #[cfg(all(
            feature = "NSError",
            feature = "NSURLCredential",
            feature = "NSURLProtectionSpace",
            feature = "NSURLResponse"
        ))]
        #[method_id(@__retain_semantics Init initWithProtectionSpace:proposedCredential:previousFailureCount:failureResponse:error:sender:)]
        pub unsafe fn initWithProtectionSpace_proposedCredential_previousFailureCount_failureResponse_error_sender(
            this: Allocated<Self>,
            space: &NSURLProtectionSpace,
            credential: Option<&NSURLCredential>,
            previous_failure_count: NSInteger,
            response: Option<&NSURLResponse>,
            error: Option<&NSError>,
            sender: &ProtocolObject<dyn NSURLAuthenticationChallengeSender>,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithAuthenticationChallenge:sender:)]
        pub unsafe fn initWithAuthenticationChallenge_sender(
            this: Allocated<Self>,
            challenge: &NSURLAuthenticationChallenge,
            sender: &ProtocolObject<dyn NSURLAuthenticationChallengeSender>,
        ) -> Retained<Self>;

        #[cfg(feature = "NSURLProtectionSpace")]
        #[method_id(@__retain_semantics Other protectionSpace)]
        pub unsafe fn protectionSpace(&self) -> Retained<NSURLProtectionSpace>;

        #[cfg(feature = "NSURLCredential")]
        #[method_id(@__retain_semantics Other proposedCredential)]
        pub unsafe fn proposedCredential(&self) -> Option<Retained<NSURLCredential>>;

        #[method(previousFailureCount)]
        pub unsafe fn previousFailureCount(&self) -> NSInteger;

        #[cfg(feature = "NSURLResponse")]
        #[method_id(@__retain_semantics Other failureResponse)]
        pub unsafe fn failureResponse(&self) -> Option<Retained<NSURLResponse>>;

        #[cfg(feature = "NSError")]
        #[method_id(@__retain_semantics Other error)]
        pub unsafe fn error(&self) -> Option<Retained<NSError>>;

        #[method_id(@__retain_semantics Other sender)]
        pub unsafe fn sender(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn NSURLAuthenticationChallengeSender>>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl NSURLAuthenticationChallenge {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);