Skip to content

Commit

Permalink
refactor(example): add request to listSearchOption
Browse files Browse the repository at this point in the history
Signed-off-by: Hector Rondon <hrondon@teclib.com>
  • Loading branch information
Hector Rondon authored and ajsb85 committed Oct 4, 2018
1 parent f0a55f9 commit f1e8a22
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions Example/Source/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class ViewController: UIViewController {
}

func requestInitSession() {
GlpiRequest.initSessionByUserToken(userToken: "L8B3f4iiNIjg8W2Kla1AXFjJsYrWxVqDozMzq2G7") { data, _, _ in
GlpiRequest.initSessionByUserToken(userToken: "HcA74wARMoEF8IXVfasNsX2FDufzaS7JMFT84FoC") { data, _, _ in
self.responseAPI = [AnyObject]()
self.loadResponse(endpoint: "initSession", result: self.objectToString(data as Any))
}
Expand All @@ -116,43 +116,47 @@ class ViewController: UIViewController {
GlpiRequest.getMyProfiles { data, _, _ in
self.loadResponse(endpoint: "getMyProfiles", result: self.objectToString(data as Any))
}

GlpiRequest.getActiveProfile { data, _, _ in
self.loadResponse(endpoint: "getActiveProfile", result: self.objectToString(data as Any))

GlpiRequest.changeActiveProfile(profileID: "4", completion: { _, _, _ in
self.loadResponse(endpoint: "changeActiveProfile", result: "")
})
}

GlpiRequest.getMyEntities { data, _, _ in
self.loadResponse(endpoint: "getMyEntities", result: self.objectToString(data as Any))
}

GlpiRequest.getActiveEntities { data, _, _ in
self.loadResponse(endpoint: "getActiveEntities", result: self.objectToString(data as Any))

GlpiRequest.changeActiveEntities(entitiesID: "0", completion: { data, _, _ in
self.loadResponse(endpoint: "changeActiveEntities", result: self.objectToString(data as Any))
})
}

GlpiRequest.getFullSession { data, _, _ in
self.loadResponse(endpoint: "getFullSession", result: self.objectToString(data as Any))
}

GlpiRequest.getAllItems(itemType: .Computer, queryString: nil) { data, _, _ in
self.loadResponse(endpoint: "getAllItems", result: self.objectToString(data as Any))
}

GlpiRequest.getItem(itemType: .Computer, itemID: 3, queryString: nil) { data, _, _ in
self.loadResponse(endpoint: "getAnItem", result: self.objectToString(data as Any))
}

GlpiRequest.getSubItems(itemType: .Computer, itemID: 3, subItemType: .ComputerModel, queryString: nil) { data, _, _ in
self.loadResponse(endpoint: "getSubItems", result: self.objectToString(data as Any))
}

GlpiRequest.listSearchOptions(itemType: .Computer) { data, _, _ in
self.loadResponse(endpoint: "listSearchOptions", result: self.objectToString(data as Any))
}

}

func requestKillSession() {
Expand Down

0 comments on commit f1e8a22

Please sign in to comment.