| Requires any of the roles: | superadmin, bookingsupplier-administrator-write, bookingsupplier-administrator-read |
| GET | /feature | List the feature flag catalog | Returns the catalog of feature flags. Available to SuperAdmin, ApplicationAdmin, and ApplicationAdminRead. Inactive flags are included. |
|---|
import Foundation
import ServiceStack
// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
public class FeatureFlagCatalogQuery : QueryDb2<FeatureFlag, FeatureFlagAdminResponse>
{
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 FeatureFlag : BaseModel
{
public var id:Int
// @Required()
// @StringLength(100)
public var name:String?
// @Required()
public var isActive:Bool?
// @Required()
public var isPublic:Bool?
// @Required()
public var companyAdminCanToggle:Bool?
// @Required()
public var createdDate:Date?
public var modifiedDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
case name
case isActive
case isPublic
case companyAdminCanToggle
case createdDate
case modifiedDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(Int.self, forKey: .id)
name = try container.decodeIfPresent(String.self, forKey: .name)
isActive = try container.decodeIfPresent(Bool.self, forKey: .isActive)
isPublic = try container.decodeIfPresent(Bool.self, forKey: .isPublic)
companyAdminCanToggle = try container.decodeIfPresent(Bool.self, forKey: .companyAdminCanToggle)
createdDate = try container.decodeIfPresent(Date.self, forKey: .createdDate)
modifiedDate = try container.decodeIfPresent(Date.self, forKey: .modifiedDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if id != nil { try container.encode(id, forKey: .id) }
if name != nil { try container.encode(name, forKey: .name) }
if isActive != nil { try container.encode(isActive, forKey: .isActive) }
if isPublic != nil { try container.encode(isPublic, forKey: .isPublic) }
if companyAdminCanToggle != nil { try container.encode(companyAdminCanToggle, forKey: .companyAdminCanToggle) }
if createdDate != nil { try container.encode(createdDate, forKey: .createdDate) }
if modifiedDate != nil { try container.encode(modifiedDate, forKey: .modifiedDate) }
}
}
public class BaseModel : Codable
{
required public init(){}
}
public class FeatureFlagAdminResponse : Codable
{
public var id:Int
public var name:String
public var isActive:Bool
public var isPublic:Bool
public var companyAdminCanToggle:Bool
public var createdDate:Date
public var modifiedDate:Date?
public var responseStatus:ResponseStatus
required public init(){}
}
public class AccessKeyTypeResponse : Codable
{
public var id:Int
public var keyType:String
public var Description:String
required public init(){}
}
Swift FeatureFlagCatalogQuery DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /feature HTTP/1.1 Host: api.bookmore.com Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{"Offset":0,"Total":0,"Results":[{"Id":0,"Name":"String","IsActive":false,"IsPublic":false,"CompanyAdminCanToggle":false,"ModifiedDate":"0001-01-01T00:00:00","ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}],"Meta":{"String":"String"},"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}}}