PageRenderTime 52ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/FlickrKit-master/Classes/Model/Generated/Photos/Comments/FKFlickrPhotosCommentsEditComment.m

https://gitlab.com/vicrius/flickrVisualizer
Objective C | 106 lines | 82 code | 16 blank | 8 comment | 7 complexity | 2c310dba6be4361e22577648ba6735b2 MD5 | raw file
  1. //
  2. // FKFlickrPhotosCommentsEditComment.m
  3. // FlickrKit
  4. //
  5. // Generated by FKAPIBuilder.
  6. // Copyright (c) 2013 DevedUp Ltd. All rights reserved. http://www.devedup.com
  7. //
  8. // DO NOT MODIFY THIS FILE - IT IS MACHINE GENERATED
  9. #import "FKFlickrPhotosCommentsEditComment.h"
  10. @implementation FKFlickrPhotosCommentsEditComment
  11. - (BOOL) needsLogin {
  12. return YES;
  13. }
  14. - (BOOL) needsSigning {
  15. return YES;
  16. }
  17. - (FKPermission) requiredPerms {
  18. return 1;
  19. }
  20. - (NSString *) name {
  21. return @"flickr.photos.comments.editComment";
  22. }
  23. - (BOOL) isValid:(NSError **)error {
  24. BOOL valid = YES;
  25. NSMutableString *errorDescription = [[NSMutableString alloc] initWithString:@"You are missing required params: "];
  26. if(!self.comment_id) {
  27. valid = NO;
  28. [errorDescription appendString:@"'comment_id', "];
  29. }
  30. if(!self.comment_text) {
  31. valid = NO;
  32. [errorDescription appendString:@"'comment_text', "];
  33. }
  34. if(error != NULL) {
  35. if(!valid) {
  36. NSDictionary *userInfo = @{NSLocalizedDescriptionKey: errorDescription};
  37. *error = [NSError errorWithDomain:FKFlickrKitErrorDomain code:FKErrorInvalidArgs userInfo:userInfo];
  38. }
  39. }
  40. return valid;
  41. }
  42. - (NSDictionary *) args {
  43. NSMutableDictionary *args = [NSMutableDictionary dictionary];
  44. if(self.comment_id) {
  45. [args setValue:self.comment_id forKey:@"comment_id"];
  46. }
  47. if(self.comment_text) {
  48. [args setValue:self.comment_text forKey:@"comment_text"];
  49. }
  50. return [args copy];
  51. }
  52. - (NSString *) descriptionForError:(NSInteger)error {
  53. switch(error) {
  54. case FKFlickrPhotosCommentsEditCommentError_PhotoNotFound:
  55. return @"Photo not found.";
  56. case FKFlickrPhotosCommentsEditCommentError_CommentNotFound:
  57. return @"Comment not found.";
  58. case FKFlickrPhotosCommentsEditCommentError_BlankComment:
  59. return @"Blank comment.";
  60. case FKFlickrPhotosCommentsEditCommentError_SSLIsRequired:
  61. return @"SSL is required";
  62. case FKFlickrPhotosCommentsEditCommentError_InvalidSignature:
  63. return @"Invalid signature";
  64. case FKFlickrPhotosCommentsEditCommentError_MissingSignature:
  65. return @"Missing signature";
  66. case FKFlickrPhotosCommentsEditCommentError_LoginFailedOrInvalidAuthToken:
  67. return @"Login failed / Invalid auth token";
  68. case FKFlickrPhotosCommentsEditCommentError_UserNotLoggedInOrInsufficientPermissions:
  69. return @"User not logged in / Insufficient permissions";
  70. case FKFlickrPhotosCommentsEditCommentError_InvalidAPIKey:
  71. return @"Invalid API Key";
  72. case FKFlickrPhotosCommentsEditCommentError_ServiceCurrentlyUnavailable:
  73. return @"Service currently unavailable";
  74. case FKFlickrPhotosCommentsEditCommentError_WriteOperationFailed:
  75. return @"Write operation failed";
  76. case FKFlickrPhotosCommentsEditCommentError_FormatXXXNotFound:
  77. return @"Format \"xxx\" not found";
  78. case FKFlickrPhotosCommentsEditCommentError_MethodXXXNotFound:
  79. return @"Method \"xxx\" not found";
  80. case FKFlickrPhotosCommentsEditCommentError_InvalidSOAPEnvelope:
  81. return @"Invalid SOAP envelope";
  82. case FKFlickrPhotosCommentsEditCommentError_InvalidXMLRPCMethodCall:
  83. return @"Invalid XML-RPC Method Call";
  84. case FKFlickrPhotosCommentsEditCommentError_BadURLFound:
  85. return @"Bad URL found";
  86. default:
  87. return @"Unknown error code";
  88. }
  89. }
  90. @end