Skip to content

Commit

Permalink
Merge pull request #74 from rrbrambley/master
Browse files Browse the repository at this point in the history
add deactivateChannel methods
  • Loading branch information
berg committed Jan 31, 2014
2 parents 00dcd2a + fe1cb7f commit 7bc6e3a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ADNKit/ANKClient+ANKChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,6 @@
- (ANKJSONRequestOperation *)unmuteChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler;
- (ANKJSONRequestOperation *)unmuteChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler;

- (ANKJSONRequestOperation *)deactivateChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler;
- (ANKJSONRequestOperation *)deactivateChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler;
@end
11 changes: 11 additions & 0 deletions ADNKit/ANKClient+ANKChannel.m
Original file line number Diff line number Diff line change
Expand Up @@ -247,5 +247,16 @@ - (ANKJSONRequestOperation *)unmuteChannelWithID:(NSString *)channelID completio
failure:[self failureHandlerForClientHandler:completionHandler]];
}

// http://developers.app.net/docs/resources/channel/lifecycle/#deactivate-a-channel

- (ANKJSONRequestOperation *)deactivateChannel:(ANKChannel *)channel completion:(ANKClientCompletionBlock)completionHandler {
return [self deactivateChannelWithID:channel.channelID completion:completionHandler];
}

- (ANKJSONRequestOperation *)deactivateChannelWithID:(NSString *)channelID completion:(ANKClientCompletionBlock)completionHandler {
return [self enqueueDELETEPath:[NSString stringWithFormat:@"channels/%@", channelID]
parameters:nil
success:[self successHandlerForResourceClass:[ANKChannel class] clientHandler:completionHandler]
failure:[self failureHandlerForClientHandler:completionHandler]];
}
@end

0 comments on commit 7bc6e3a

Please sign in to comment.