@@ -67,165 +67,22 @@ class NoAPISecret(LoginRadiusExceptions):
67
67
Raised on construction of the LoginRadius object,
68
68
if no API_SECRET has been set for the class.
69
69
"""
70
-
71
- def __init__ (self , version ):
72
- self .version = str (version )
73
-
70
+ def __init__ (self ):
71
+ pass
72
+
74
73
def __str__ (self ):
75
74
return "No API_SECRET set. Please initialize a API_SECRET first.\n " \
76
75
+ "ie. LoginRadius.API_SECRET = \" Really_Secret_Key\" "
77
76
78
77
class NoAPIKey (LoginRadiusExceptions ):
78
+
79
79
"""
80
80
Raised on construction of the LoginRadius object,
81
81
if no API_KEY has been set for the class.
82
82
"""
83
-
84
- def __init__ (self , version ):
85
- self .version = str (version )
86
-
87
- def __str__ (self ):
88
- return "No API_KEY set. Please initialize a APP_KEY first.\n " \
89
- + "ie. LoginRadius.API_Key = \" Really_Application_Key\" "
90
-
91
- class MissingJsonResponseParameter (LoginRadiusExceptions ):
92
- """
93
- Raised if construction of namedtuple would fail
94
- because missing expected response from LoginRadius API.
95
- """
96
-
97
- def __init__ (self , missing_parameter , raw = None ):
98
- self .missing_parameter = missing_parameter
99
- self .raw = raw
100
-
101
- def __str__ (self ):
102
- exception_string = "Expected parameter from JSON response does not exist." + \
103
- " Expected: " + self .missing_parameter + " but was not in" + \
104
- " the dictionary."
105
- if self .raw :
106
- exception_string += " Instead, we got: " + str (self .raw )
107
- return exception_string
108
-
109
- class TokenExpired (LoginRadiusExceptions ):
110
- """
111
- Raised if the request cannot be completed because the access token has expired.
112
- """
113
-
114
- def __init__ (self , time ):
115
- self .time = time
116
-
117
- def __str__ (self ):
118
- return "The request cannot be completed because the token has expired. " + \
119
- "The token expired on: " + self .time
120
-
121
- class FeatureNotSupported (LoginRadiusExceptions ):
122
- """
123
- Raised if the request cannot be completed because your account/API access does not include this.
124
- """
125
-
126
- def __init__ (self ):
127
- pass
128
-
129
- def __str__ (self ):
130
- return "Your LoginRadius site doesn't have permission to access this endpoint, please contact " + \
131
- "LoginRadius support if you need more information."
132
-
133
- class UnknownJsonError (LoginRadiusExceptions ):
134
- """
135
- Raised if cannot determine error number from Json
136
- """
137
-
138
- def __init__ (self , result ):
139
- self .result = result
140
-
141
- def __str__ (self ):
142
- return str (self .result )
143
-
144
- class APIKeyInvalid (LoginRadiusExceptions ):
145
- """
146
- Raised if you entered your API wrong, or not at all.
147
- """
148
-
149
83
def __init__ (self ):
150
84
pass
151
-
152
- def __str__ (self ):
153
- return "The LoginRadius API Key is not valid, please double check your account."
154
-
155
- class APISecretInvalid (LoginRadiusExceptions ):
156
- """
157
- Raised if you your API Secret is invalid.
158
- """
159
-
160
- def __init__ (self ):
161
- pass
162
-
163
- def __str__ (self ):
164
- return "The LoginRadius API Secret is not valid, please double check your account."
165
-
166
- class InvalidRequestToken (LoginRadiusExceptions ):
167
- """
168
- Raised if you your request token is invalid from the POST request.
169
- """
170
-
171
- def __init__ (self ):
172
- pass
173
-
174
- def __str__ (self ):
175
- return "The LoginRadius Request Token is invalid, please verify the authentication response."
176
-
177
- class RequestTokenExpired (LoginRadiusExceptions ):
178
- """
179
- Raised if you your request token has expired from the POST request.
180
- """
181
-
182
- def __init__ (self ):
183
- pass
184
-
185
- def __str__ (self ):
186
- return "The LoginRadius Request Token has expired, please verify the authentication response."
187
-
188
- class InvalidAccessToken (LoginRadiusExceptions ):
189
- """
190
- Raised if you access token is invalid.
191
- """
192
-
193
- def __init__ (self ):
194
- pass
195
-
196
- def __str__ (self ):
197
- return "The LoginRadius Access Token has expired, please get a new token from the LoginRadius API."
198
-
199
- class ParameterMissing (LoginRadiusExceptions ):
200
- """
201
- Raised if a parameter in the GET or POST request is missing.
202
- """
203
-
204
- def __init__ (self ):
205
- pass
206
-
207
- def __str__ (self ):
208
- return "A parameter is missing in the request, please check all parameters in the API call."
209
-
210
- class ParameterNotFormatted (LoginRadiusExceptions ):
211
- """
212
- Raised if a parameter in the GET or POST request is not formatted properly for the provider.
213
- """
214
-
215
- def __init__ (self ):
216
- pass
217
-
218
- def __str__ (self ):
219
- return "A parameter is not formatted well in the request, please check all the parameters in the API call."
220
-
221
- class EndPointNotSupported (LoginRadiusExceptions ):
222
- """
223
- Raised if a the endpoint is not supported by the provider which correlates to the token.
224
- """
225
-
226
- def __init__ (self ):
227
- pass
228
-
229
- def __str__ (self ):
230
- return "The requested endpoint is not supported by the current ID provider, " + \
231
- "please check the API support page at http://www.loginradius.com/datapoints"
85
+
86
+ def __str__ (self ):
87
+ return "No API_KEY set. Please initialize a APP_KEY first.\n " \
88
+ + "ie. LoginRadius.API_Key = \" Really_Application_Key\" "
0 commit comments