Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

add deactivateChannel methods #74

Merged
merged 1 commit into from

2 participants

@rrbrambley

No description provided.

@berg
Collaborator

Hey @rrbrambley, does this do everything that this other PR does?

#68

@rrbrambley

er, @berg, whoops. I didn't see that :)

It looks like the only difference is that I have a method that accepts a channel or channelID (similar to all the other methods in that category), whereas @winzig only added one method that accepts a channelID. Doesn't matter to me which gets merged – I just need this feature to get in there somehow.

@berg
Collaborator

Cool. I'll merge yours, then.

@berg berg merged commit 7bc6e3a into joeldev:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 30, 2014
  1. @rrbrambley
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 0 deletions.
  1. +2 −0  ADNKit/ANKClient+ANKChannel.h
  2. +11 −0 ADNKit/ANKClient+ANKChannel.m
View
2  ADNKit/ANKClient+ANKChannel.h
@@ -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
View
11 ADNKit/ANKClient+ANKChannel.m
@@ -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
Something went wrong with that request. Please try again.