All Verbs | /technology/query |
---|
import Foundation
import ServiceStack
public class QueryTechnology : QueryDb2<Technology, TechnologyView>
{
public var ids:[Int]
public var name:String
public var vendorName:String
public var nameContains:String
public var vendorNameContains:String
public var descriptionContains:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case ids
case name
case vendorName
case nameContains
case vendorNameContains
case descriptionContains
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
ids = try container.decodeIfPresent([Int].self, forKey: .ids) ?? []
name = try container.decodeIfPresent(String.self, forKey: .name)
vendorName = try container.decodeIfPresent(String.self, forKey: .vendorName)
nameContains = try container.decodeIfPresent(String.self, forKey: .nameContains)
vendorNameContains = try container.decodeIfPresent(String.self, forKey: .vendorNameContains)
descriptionContains = try container.decodeIfPresent(String.self, forKey: .descriptionContains)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if ids != nil { try container.encode(ids, forKey: .ids) }
if name != nil { try container.encode(name, forKey: .name) }
if vendorName != nil { try container.encode(vendorName, forKey: .vendorName) }
if nameContains != nil { try container.encode(nameContains, forKey: .nameContains) }
if vendorNameContains != nil { try container.encode(vendorNameContains, forKey: .vendorNameContains) }
if descriptionContains != nil { try container.encode(descriptionContains, forKey: .descriptionContains) }
}
}
public class Technology : TechnologyBase
{
required public init(){ super.init() }
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
}
}
public class TechnologyBase : Codable
{
public var id:Int
public var name:String
public var vendorName:String
public var vendorUrl:String
public var productUrl:String
public var logoUrl:String
public var Description:String
public var created:Date
public var createdBy:String
public var lastModified:Date
public var lastModifiedBy:String
public var ownerId:String
public var slug:String
public var logoApproved:Bool
public var isLocked:Bool
public var tier:TechnologyTier
public var lastStatusUpdate:Date?
public var organizationId:Int?
public var commentsPostId:Int?
public var viewCount:Int
public var favCount:Int
required public init(){}
}
public enum TechnologyTier : String, Codable
{
case ProgrammingLanguage
case Client
case Http
case Server
case Data
case SoftwareInfrastructure
case OperatingSystem
case HardwareInfrastructure
case ThirdPartyServices
}
public class TechnologyView : Codable
{
public var id:Int?
public var name:String
public var vendorName:String
public var vendorUrl:String
public var productUrl:String
public var logoUrl:String
public var Description:String
public var created:Date?
public var createdBy:String
public var lastModified:Date?
public var lastModifiedBy:String
public var ownerId:String
public var slug:String
public var logoApproved:Bool?
public var isLocked:Bool?
public var tier:TechnologyTier?
public var lastStatusUpdate:Date?
public var organizationId:Int?
public var commentsPostId:Int?
public var viewCount:Int?
public var favCount:Int?
required public init(){}
}
public class Post : Codable
{
public var id:Int
public var organizationId:Int
public var userId:Int
public var type:PostType
public var categoryId:Int
public var title:String
public var slug:String
public var url:String
public var imageUrl:String
// @StringLength(Int32.max)
public var content:String
// @StringLength(Int32.max)
public var contentHtml:String
public var pinCommentId:Int?
public var technologyIds:[Int]
public var fromDate:Date?
public var toDate:Date?
public var location:String
public var metaType:String
public var meta:String
public var approved:Bool
public var upVotes:Int
public var downVotes:Int
public var points:Int
public var views:Int
public var favorites:Int
public var subscribers:Int
public var replyCount:Int
public var commentsCount:Int
public var wordCount:Int
public var reportCount:Int
public var linksCount:Int
public var linkedToCount:Int
public var score:Int
public var rank:Int
public var labels:[String]
public var refUserIds:[Int]
public var refLinks:[String]
public var muteUserIds:[Int]
public var lastCommentDate:Date?
public var lastCommentId:Int?
public var lastCommentUserId:Int?
public var deleted:Date?
public var deletedBy:String
public var locked:Date?
public var lockedBy:String
public var hidden:Date?
public var hiddenBy:String
public var status:String
public var statusDate:Date?
public var statusBy:String
public var archived:Bool
public var bumped:Date?
public var created:Date
public var createdBy:String
public var modified:Date
public var modifiedBy:String
public var refId:Int?
public var refSource:String
public var refUrn:String
required public init(){}
}
public enum PostType : String, Codable
{
case Announcement
case Post
case Showcase
case Question
case Request
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /technology/query HTTP/1.1
Host: techstacks.io
Accept: application/json
Content-Type: application/json
Content-Length: length
{"ids":[0],"name":"String","vendorName":"String","nameContains":"String","vendorNameContains":"String","descriptionContains":"String","skip":0,"take":0,"orderBy":"String","orderByDesc":"String","include":"String","fields":"String","meta":{"String":"String"}}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"offset":0,"total":0,"results":[{"id":0,"name":"String","vendorName":"String","vendorUrl":"String","productUrl":"String","logoUrl":"String","description":"String","created":"0001-01-01T00:00:00.0000000","createdBy":"String","lastModified":"0001-01-01T00:00:00.0000000","lastModifiedBy":"String","ownerId":"String","slug":"String","logoApproved":false,"isLocked":false,"tier":"ProgrammingLanguage","lastStatusUpdate":"0001-01-01T00:00:00.0000000","organizationId":0,"commentsPostId":0,"viewCount":0,"favCount":0}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}