mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-02 21:50:55 +00:00
Updates to iOS ApiClient - added getting for for offline state and settings for reachability status. This addresses "Default iOS reachability status #2422"
This commit is contained in:
parent
0941db6fbd
commit
553ebd659a
@ -53,6 +53,10 @@ static void (^reachabilityChangeBlock)(int);
|
||||
cacheEnabled = enabled;
|
||||
}
|
||||
|
||||
+(void) setReachabilityStatus:(AFNetworkReachabilityStatus)status {
|
||||
reachabilityStatus = status;
|
||||
}
|
||||
|
||||
- (void)setHeaderValue:(NSString*) value
|
||||
forKey:(NSString*) forKey {
|
||||
[self.requestSerializer setValue:value forHTTPHeaderField:forKey];
|
||||
@ -238,6 +242,10 @@ static void (^reachabilityChangeBlock)(int);
|
||||
return reachabilityStatus;
|
||||
}
|
||||
|
||||
+(bool) getOfflineState {
|
||||
return offlineState;
|
||||
}
|
||||
|
||||
+(void) setReachabilityChangeBlock:(void(^)(int))changeBlock {
|
||||
reachabilityChangeBlock = changeBlock;
|
||||
}
|
||||
|
@ -64,6 +64,20 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey;
|
||||
*/
|
||||
+(void) setOfflineState:(BOOL) state;
|
||||
|
||||
/**
|
||||
* Gets if the client is unreachable
|
||||
*
|
||||
* @return The client offline state
|
||||
*/
|
||||
+(bool) getOfflineState;
|
||||
|
||||
/**
|
||||
* Sets the client reachability, this may be override by the reachability manager if reachability changes
|
||||
*
|
||||
* @param The client reachability.
|
||||
*/
|
||||
+(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status;
|
||||
|
||||
/**
|
||||
* Gets the client reachability
|
||||
*
|
||||
|
@ -73,6 +73,20 @@ extern NSString *const SWGResponseObjectErrorKey;
|
||||
*/
|
||||
+(void) setOfflineState:(BOOL) state;
|
||||
|
||||
/**
|
||||
* Gets if the client is unreachable
|
||||
*
|
||||
* @return The client offline state
|
||||
*/
|
||||
+(bool) getOfflineState;
|
||||
|
||||
/**
|
||||
* Sets the client reachability, this may be override by the reachability manager if reachability changes
|
||||
*
|
||||
* @param The client reachability.
|
||||
*/
|
||||
+(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status;
|
||||
|
||||
/**
|
||||
* Gets the client reachability
|
||||
*
|
||||
|
@ -53,6 +53,10 @@ static void (^reachabilityChangeBlock)(int);
|
||||
cacheEnabled = enabled;
|
||||
}
|
||||
|
||||
+(void) setReachabilityStatus:(AFNetworkReachabilityStatus)status {
|
||||
reachabilityStatus = status;
|
||||
}
|
||||
|
||||
- (void)setHeaderValue:(NSString*) value
|
||||
forKey:(NSString*) forKey {
|
||||
[self.requestSerializer setValue:value forHTTPHeaderField:forKey];
|
||||
@ -238,6 +242,10 @@ static void (^reachabilityChangeBlock)(int);
|
||||
return reachabilityStatus;
|
||||
}
|
||||
|
||||
+(bool) getOfflineState {
|
||||
return offlineState;
|
||||
}
|
||||
|
||||
+(void) setReachabilityChangeBlock:(void(^)(int))changeBlock {
|
||||
reachabilityChangeBlock = changeBlock;
|
||||
}
|
||||
|
@ -17,4 +17,6 @@
|
||||
|
||||
@property(nonatomic) NSNumber* name;
|
||||
|
||||
@property(nonatomic) NSNumber* snakeCase;
|
||||
|
||||
@end
|
||||
|
@ -20,7 +20,7 @@
|
||||
*/
|
||||
+ (JSONKeyMapper *)keyMapper
|
||||
{
|
||||
return [[JSONKeyMapper alloc] initWithDictionary:@{ @"name": @"name" }];
|
||||
return [[JSONKeyMapper alloc] initWithDictionary:@{ @"name": @"name", @"snake_case": @"snakeCase" }];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
+ (BOOL)propertyIsOptional:(NSString *)propertyName
|
||||
{
|
||||
NSArray *optionalProperties = @[@"name"];
|
||||
NSArray *optionalProperties = @[@"name", @"snakeCase"];
|
||||
|
||||
if ([optionalProperties containsObject:propertyName]) {
|
||||
return YES;
|
||||
|
Loading…
x
Reference in New Issue
Block a user