ObjcGitlabApi 1.1.0

ObjcGitlabApi 1.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Unclaimed.


Downloads

Total10
Week0
Month4

Installs

Apps5
powered by Segment

GitHub

Stars15
Watchers6
Forks2
Issues0
Contributors2
Pull Requests0

Code

Files73
LOCLines of Code 3,613


  • By
  • Jeff Trespalacios and Jon Staff

objc-gitlab-api

An Objective-C Gitlab Wrapper


To include this library just add the following to your projects Podfile.

pod 'ObjcGitlabApi', '~> 1.0'

Usage


All of the calls to the API are executed from the singleton GLGitlabApi which uses blocks for the callbacks on each request. Each call returns the operation that it begins so that it maybe canceled if necessary.

Login

Logging in will return the information for the user requesting the login.

[[GLGitlabApi sharedInstance] loginToHost:@"http://gitlab.example.com"
                                 username:@"exampleuser"
                                 password:@"password"
                                  success:^(GLUser *user) {
                                        // Perform additional work here
                                    }
                                  failure:^(NSError *error) {
                                        // Handle login failure
                                    }];

Fetching projects

To get all projects for a user you would use the following method:

[[GLGitlabApi sharedInstance] getUsersProjectsSuccess:^(NSArray *projects) {
                                            // Process projects
                                        }
                                               failure:^(NSError *error) {
                                            // Handle error
                                        }];

Fetch details about a project:

[[GLGitlabApi sharedInstance] getProjectWithId:1
                                       success:^(GLProject *project) {
                                         // Perform additional work here
                                     }
                                       failure:^(NSError *error) {
                                        // Handle error here
                                     }];

The remaining calls in the api follow a similar pattern.

Model Objects

The library contains a collection of model objects to manage the data passed back and forth between the api and the library. It includes the following objects:

  • GLBranch
  • GLCommit
  • GLDiff
  • GLEvent
  • GLFile
  • GLGroup
  • GLIssue
  • GLMergeRequest
  • GLMilestone
  • GLNamespace
  • GLNote
  • GLProject
  • GLSnippet
  • GLTag
  • GLUser