Permalink
Browse files

Adds support for new Assignees API.

  • Loading branch information...
1 parent 46b2d7d commit e995f26b762c3aed8252b36a97996577c5a78f53 Owain R Hunt committed Aug 1, 2012
Showing with 24 additions and 2 deletions.
  1. +6 −0 UAGithubEngine/UAGithubEngine.h
  2. +16 −2 UAGithubEngine/UAGithubEngine.m
  3. +2 −0 UAGithubEngine/UAGithubEngineRequestTypes.h
@@ -77,6 +77,12 @@ typedef void (^UAGithubEngineFailureBlock)(NSError *);
- (void)deleteIssue:(NSInteger)issueNumber inRepository:(NSString *)repositoryPath success:(UAGithubEngineBooleanSuccessBlock)successBlock failure:(UAGithubEngineFailureBlock)failureBlock;
+#pragma mark Assignees
+
+- (void)assigneesForRepository:(NSString *)repositoryPath success:(UAGithubEngineSuccessBlock)successBlock failure:(UAGithubEngineFailureBlock)failureBlock;
+- (void)user:(NSString *)user isAssigneeForRepository:(NSString *)repositoryPath success:(UAGithubEngineBooleanSuccessBlock)successBlock failure:(UAGithubEngineFailureBlock)failureBlock;
+
+
#pragma mark Comments
- (void)commentsForIssue:(NSInteger)issueNumber forRepository:(NSString *)repositoryPath success:(UAGithubEngineSuccessBlock)successBlock failure:(UAGithubEngineFailureBlock)failureBlock;
@@ -531,13 +531,13 @@ - (void)issue:(NSInteger)issueNumber inRepository:(NSString *)repositoryPath suc
- (void)editIssue:(NSInteger)issueNumber inRepository:(NSString *)repositoryPath withDictionary:(NSDictionary *)issueDictionary success:(UAGithubEngineSuccessBlock)successBlock failure:(UAGithubEngineFailureBlock)failureBlock
{
- [self invoke:^(id self){[self sendRequest:[NSString stringWithFormat:@"repos/%@/issues/%ld", repositoryPath, issueNumber] requestType:UAGithubIssueEditRequest responseType:UAGithubIssueResponse withParameters:issueDictionary error:nil];} success:successBlock failure:failureBlock];
+ [self invoke:^(id self){[self sendRequest:[NSString stringWithFormat:@"repos/%@/issues/%ld", repositoryPath, issueNumber] requestType:UAGithubIssueEditRequest responseType:UAGithubIssueResponse withParameters:issueDictionary error:nil];} success:successBlock failure:failureBlock];
}
- (void)addIssueForRepository:(NSString *)repositoryPath withDictionary:(NSDictionary *)issueDictionary success:(UAGithubEngineSuccessBlock)successBlock failure:(UAGithubEngineFailureBlock)failureBlock
{
- [self invoke:^(id self){[self sendRequest:[NSString stringWithFormat:@"repos/%@/issues", repositoryPath] requestType:UAGithubIssueAddRequest responseType:UAGithubIssueResponse withParameters:issueDictionary error:nil];} success:successBlock failure:failureBlock];
+ [self invoke:^(id self){[self sendRequest:[NSString stringWithFormat:@"repos/%@/issues", repositoryPath] requestType:UAGithubIssueAddRequest responseType:UAGithubIssueResponse withParameters:issueDictionary error:nil];} success:successBlock failure:failureBlock];
}
@@ -561,6 +561,20 @@ - (void)deleteIssue:(NSInteger)issueNumber inRepository:(NSString *)repositoryPa
}
+#pragma mark Assignees
+
+- (void)assigneesForRepository:(NSString *)repositoryPath success:(UAGithubEngineSuccessBlock)successBlock failure:(UAGithubEngineFailureBlock)failureBlock
+{
+ [self invoke:^(id self) { [self sendRequest:[NSString stringWithFormat:@"/repos/%@/assignees", repositoryPath] requestType:UAGithubAssigneesRequest responseType:UAGithubUsersResponse error:nil];} success:successBlock failure:failureBlock];
+}
+
+
+- (void)user:(NSString *)user isAssigneeForRepository:(NSString *)repositoryPath success:(UAGithubEngineBooleanSuccessBlock)successBlock failure:(UAGithubEngineFailureBlock)failureBlock
+{
+ [self invoke:^(id self){[self sendRequest:[NSString stringWithFormat:@"/repos/%@/assignees/%@", repositoryPath, user] requestType:UAGithubAssigneeRequest responseType:UAGithubNoContentResponse error:nil];} booleanSuccess:successBlock failure:failureBlock];
+}
+
+
#pragma mark Comments
- (void)commentsForIssue:(NSInteger)issueNumber forRepository:(NSString *)repositoryPath success:(UAGithubEngineSuccessBlock)successBlock failure:(UAGithubEngineFailureBlock)failureBlock
@@ -160,6 +160,8 @@ typedef enum UAGithubRequestType
UAGithubTeamRepositoryManagershipStatusRequest, // Get whether a team manages a specific repository
UAGithubTeamRepositoryManagershipAddRequest, // Add a specific repository to a team
UAGithubTeamRepositoryManagershipRemoveRequest, // Remove a specific repository from a team
+ UAGithubAssigneesRequest, // Get one or more assignees
+ UAGithubAssigneeRequest, // Get whether one user is an assignee on a repository
} UAGithubRequestType;

0 comments on commit e995f26

Please sign in to comment.