-(RKResponseDescriptor *)getCompressorsResponseDescriptor
{
RKObjectMapping *compressors_mapping = [RKObjectMapping mappingForClass:[class_compressors class]];
[compressors_mapping addAttributeMappingsFromDictionary:@{
@"ResponseCode":@"ResponseCode",
@"ResponseType":@"ResponseType",
@"ResponseMessage":@"ResponseMessage"
}];
RKObjectMapping *compressor_mapping = [RKObjectMapping mappingForClass:[class_compressor class]];
[compressor_mapping addAttributeMappingsFromDictionary:@{
@"CmID":@"CmID"
}];
RKObjectMapping *fault_alert_mapping = [RKObjectMapping mappingForClass:[class_fault_alerts class]];
[fault_alert_mapping addAttributeMappingsFromDictionary:@{
@"Message":@"Message"
}];
RKObjectMapping *service_due_alert_mapping = [RKObjectMapping mappingForClass:[class_service_due_alerts class]];
[service_due_alert_mapping addAttributeMappingsFromDictionary:@{
@"Type":@"Type"
}];
[compressor_mapping addPropertyMapping:[RKRelationshipMapping
relationshipMappingFromKeyPath:@"FAlerts"
toKeyPath:@"FAlerts"
withMapping:fault_alert_mapping]];
[compressor_mapping addPropertyMapping:[RKRelationshipMapping
relationshipMappingFromKeyPath:@"SDueAlerts"
toKeyPath:@"SAlerts"
withMapping:service_due_alert_mapping]];
[compressors_mapping addPropertyMapping:[RKRelationshipMapping
relationshipMappingFromKeyPath:@"Cms"
toKeyPath:@"Cms"
withMapping:compressor_mapping]];
NSIndexSet *statusCodes = RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful);
RKResponseDescriptor *responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:compressors_mapping
method:RKRequestMethodGET
pathPattern:nil
keyPath:nil
statusCodes:statusCodes];
return responseDescriptor;
}
No comments:
Post a Comment