/Pods/FlickrKit/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
- //
- // FKFlickrPhotosCommentsEditComment.m
- // FlickrKit
- //
- // Generated by FKAPIBuilder.
- // Copyright (c) 2013 DevedUp Ltd. All rights reserved. http://www.devedup.com
- //
- // DO NOT MODIFY THIS FILE - IT IS MACHINE GENERATED
- #import "FKFlickrPhotosCommentsEditComment.h"
- @implementation FKFlickrPhotosCommentsEditComment
- - (BOOL) needsLogin {
- return YES;
- }
- - (BOOL) needsSigning {
- return YES;
- }
- - (FKPermission) requiredPerms {
- return 1;
- }
- - (NSString *) name {
- return @"flickr.photos.comments.editComment";
- }
- - (BOOL) isValid:(NSError **)error {
- BOOL valid = YES;
- NSMutableString *errorDescription = [[NSMutableString alloc] initWithString:@"You are missing required params: "];
- if(!self.comment_id) {
- valid = NO;
- [errorDescription appendString:@"'comment_id', "];
- }
- if(!self.comment_text) {
- valid = NO;
- [errorDescription appendString:@"'comment_text', "];
- }
- if(error != NULL) {
- if(!valid) {
- NSDictionary *userInfo = @{NSLocalizedDescriptionKey: errorDescription};
- *error = [NSError errorWithDomain:FKFlickrKitErrorDomain code:FKErrorInvalidArgs userInfo:userInfo];
- }
- }
- return valid;
- }
- - (NSDictionary *) args {
- NSMutableDictionary *args = [NSMutableDictionary dictionary];
- if(self.comment_id) {
- [args setValue:self.comment_id forKey:@"comment_id"];
- }
- if(self.comment_text) {
- [args setValue:self.comment_text forKey:@"comment_text"];
- }
- return [args copy];
- }
- - (NSString *) descriptionForError:(NSInteger)error {
- switch(error) {
- case FKFlickrPhotosCommentsEditCommentError_PhotoNotFound:
- return @"Photo not found.";
- case FKFlickrPhotosCommentsEditCommentError_CommentNotFound:
- return @"Comment not found.";
- case FKFlickrPhotosCommentsEditCommentError_BlankComment:
- return @"Blank comment.";
- case FKFlickrPhotosCommentsEditCommentError_SSLIsRequired:
- return @"SSL is required";
- case FKFlickrPhotosCommentsEditCommentError_InvalidSignature:
- return @"Invalid signature";
- case FKFlickrPhotosCommentsEditCommentError_MissingSignature:
- return @"Missing signature";
- case FKFlickrPhotosCommentsEditCommentError_LoginFailedOrInvalidAuthToken:
- return @"Login failed / Invalid auth token";
- case FKFlickrPhotosCommentsEditCommentError_UserNotLoggedInOrInsufficientPermissions:
- return @"User not logged in / Insufficient permissions";
- case FKFlickrPhotosCommentsEditCommentError_InvalidAPIKey:
- return @"Invalid API Key";
- case FKFlickrPhotosCommentsEditCommentError_ServiceCurrentlyUnavailable:
- return @"Service currently unavailable";
- case FKFlickrPhotosCommentsEditCommentError_WriteOperationFailed:
- return @"Write operation failed";
- case FKFlickrPhotosCommentsEditCommentError_FormatXXXNotFound:
- return @"Format \"xxx\" not found";
- case FKFlickrPhotosCommentsEditCommentError_MethodXXXNotFound:
- return @"Method \"xxx\" not found";
- case FKFlickrPhotosCommentsEditCommentError_InvalidSOAPEnvelope:
- return @"Invalid SOAP envelope";
- case FKFlickrPhotosCommentsEditCommentError_InvalidXMLRPCMethodCall:
- return @"Invalid XML-RPC Method Call";
- case FKFlickrPhotosCommentsEditCommentError_BadURLFound:
- return @"Bad URL found";
-
- default:
- return @"Unknown error code";
- }
- }
- @end