Skip to content

Commit

Permalink
feat(request): create structure to handle parameters in getSubItems
Browse files Browse the repository at this point in the history
  • Loading branch information
Hector Rondon authored and ajsb85 committed Oct 27, 2017
1 parent d358cc8 commit 70709d1
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Source/QueryString.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,40 @@ public struct QueryString {
}
}
}

public struct GetSubItems {
public var expandDropdowns: Bool?
public var getHateoas: Bool?
public var onlyId: Bool?
public var range: String?
public var sort: Int?
public var order: orderType?

public init() {}

var queryString: [String: AnyObject] {
get {
var query = [String: AnyObject]()
if expandDropdowns != nil {
query["expand_dropdowns"] = expandDropdowns as AnyObject
}
if getHateoas != nil {
query["get_hateoas"] = getHateoas as AnyObject
}
if onlyId != nil {
query["only_id"] = onlyId as AnyObject
}
if range != nil {
query["range"] = range as AnyObject
}
if sort != nil {
query["sort"] = sort as AnyObject
}
if order != nil {
query["order"] = order as AnyObject
}
return query
}
}
}
}

0 comments on commit 70709d1

Please sign in to comment.