POST | /users/invite/accept |
---|
import Foundation
import ServiceStack
public class AcceptGuestInvitationRequest : PostOperationUnTenanted<AcceptGuestInvitationResponse>
{
public var token:String?
public var password:String?
public var firstName:String?
public var lastName:String?
public var timezone:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case token
case password
case firstName
case lastName
case timezone
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
token = try container.decodeIfPresent(String.self, forKey: .token)
password = try container.decodeIfPresent(String.self, forKey: .password)
firstName = try container.decodeIfPresent(String.self, forKey: .firstName)
lastName = try container.decodeIfPresent(String.self, forKey: .lastName)
timezone = try container.decodeIfPresent(String.self, forKey: .timezone)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if token != nil { try container.encode(token, forKey: .token) }
if password != nil { try container.encode(password, forKey: .password) }
if firstName != nil { try container.encode(firstName, forKey: .firstName) }
if lastName != nil { try container.encode(lastName, forKey: .lastName) }
if timezone != nil { try container.encode(timezone, forKey: .timezone) }
}
}
public class PostOperationUnTenanted<TResponse : Codable> : IPost, Codable
{
required public init(){}
}
public class AcceptGuestInvitationResponse : Codable
{
public var responseStatus:ResponseStatus?
required public init(){}
}
Swift AcceptGuestInvitationRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /users/invite/accept HTTP/1.1
Host: staging-api.billiecart.com.au
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
token: String,
password: String,
firstName: String,
lastName: String,
timezone: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } } }