/Pods/FlickrKit/Classes/Model/Generated/Photos/Geo/FKFlickrPhotosGeoSetPerms.m

https://gitlab.com/vicrius/flickrVisualizer · Objective C · 127 lines · 103 code · 16 blank · 8 comment · 13 complexity · 8fcd4aaf3dc44096e118f3bdf8100016 MD5 · raw file

  1. //
  2. // FKFlickrPhotosGeoSetPerms.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 "FKFlickrPhotosGeoSetPerms.h"
  10. @implementation FKFlickrPhotosGeoSetPerms
  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.geo.setPerms";
  22. }
  23. - (BOOL) isValid:(NSError **)error {
  24. BOOL valid = YES;
  25. NSMutableString *errorDescription = [[NSMutableString alloc] initWithString:@"You are missing required params: "];
  26. if(!self.is_public) {
  27. valid = NO;
  28. [errorDescription appendString:@"'is_public', "];
  29. }
  30. if(!self.is_contact) {
  31. valid = NO;
  32. [errorDescription appendString:@"'is_contact', "];
  33. }
  34. if(!self.is_friend) {
  35. valid = NO;
  36. [errorDescription appendString:@"'is_friend', "];
  37. }
  38. if(!self.is_family) {
  39. valid = NO;
  40. [errorDescription appendString:@"'is_family', "];
  41. }
  42. if(!self.photo_id) {
  43. valid = NO;
  44. [errorDescription appendString:@"'photo_id', "];
  45. }
  46. if(error != NULL) {
  47. if(!valid) {
  48. NSDictionary *userInfo = @{NSLocalizedDescriptionKey: errorDescription};
  49. *error = [NSError errorWithDomain:FKFlickrKitErrorDomain code:FKErrorInvalidArgs userInfo:userInfo];
  50. }
  51. }
  52. return valid;
  53. }
  54. - (NSDictionary *) args {
  55. NSMutableDictionary *args = [NSMutableDictionary dictionary];
  56. if(self.is_public) {
  57. [args setValue:self.is_public forKey:@"is_public"];
  58. }
  59. if(self.is_contact) {
  60. [args setValue:self.is_contact forKey:@"is_contact"];
  61. }
  62. if(self.is_friend) {
  63. [args setValue:self.is_friend forKey:@"is_friend"];
  64. }
  65. if(self.is_family) {
  66. [args setValue:self.is_family forKey:@"is_family"];
  67. }
  68. if(self.photo_id) {
  69. [args setValue:self.photo_id forKey:@"photo_id"];
  70. }
  71. return [args copy];
  72. }
  73. - (NSString *) descriptionForError:(NSInteger)error {
  74. switch(error) {
  75. case FKFlickrPhotosGeoSetPermsError_PhotoNotFound:
  76. return @"Photo not found";
  77. case FKFlickrPhotosGeoSetPermsError_PhotoHasNoLocationInformation:
  78. return @"Photo has no location information";
  79. case FKFlickrPhotosGeoSetPermsError_RequiredArgumentsMissing:
  80. return @"Required arguments missing.";
  81. case FKFlickrPhotosGeoSetPermsError_SSLIsRequired:
  82. return @"SSL is required";
  83. case FKFlickrPhotosGeoSetPermsError_InvalidSignature:
  84. return @"Invalid signature";
  85. case FKFlickrPhotosGeoSetPermsError_MissingSignature:
  86. return @"Missing signature";
  87. case FKFlickrPhotosGeoSetPermsError_LoginFailedOrInvalidAuthToken:
  88. return @"Login failed / Invalid auth token";
  89. case FKFlickrPhotosGeoSetPermsError_UserNotLoggedInOrInsufficientPermissions:
  90. return @"User not logged in / Insufficient permissions";
  91. case FKFlickrPhotosGeoSetPermsError_InvalidAPIKey:
  92. return @"Invalid API Key";
  93. case FKFlickrPhotosGeoSetPermsError_ServiceCurrentlyUnavailable:
  94. return @"Service currently unavailable";
  95. case FKFlickrPhotosGeoSetPermsError_WriteOperationFailed:
  96. return @"Write operation failed";
  97. case FKFlickrPhotosGeoSetPermsError_FormatXXXNotFound:
  98. return @"Format \"xxx\" not found";
  99. case FKFlickrPhotosGeoSetPermsError_MethodXXXNotFound:
  100. return @"Method \"xxx\" not found";
  101. case FKFlickrPhotosGeoSetPermsError_InvalidSOAPEnvelope:
  102. return @"Invalid SOAP envelope";
  103. case FKFlickrPhotosGeoSetPermsError_InvalidXMLRPCMethodCall:
  104. return @"Invalid XML-RPC Method Call";
  105. case FKFlickrPhotosGeoSetPermsError_BadURLFound:
  106. return @"Bad URL found";
  107. default:
  108. return @"Unknown error code";
  109. }
  110. }
  111. @end