Sudo

public struct Sudo

Represents a Sudo.

  • Claims.

    Declaration

    Swift

    public var claims: Set<Claim>
  • Arbitrary metadata set by the backend.

    Declaration

    Swift

    public var metadata: [String : String]
  • Date and time at which this Sudo was created.

    Declaration

    Swift

    public var createdAt: Date
  • Date and time at which this Sudo was updated.

    Declaration

    Swift

    public var updatedAt: Date
  • Current version of this Sudo.

    Declaration

    Swift

    public var version: Int
  • id

    Globally unique identifier of this Sudo. This is generated and set by Sudo service.

    Declaration

    Swift

    public var id: String?
  • Instantiates a Sudo.

    Declaration

    Swift

    public init(
        id: String,
        version: Int,
        createdAt: Date,
        updatedAt: Date
    )

    Parameters

    id

    Unique ID of the Sudo.

    version

    Current version of the Sudo.

    createdAt

    Date and time at which the Sudo was created.

    updatedAt

    Date and time at which the Sudo was last updated.

  • Returns the claim with the specified name.

    Declaration

    Swift

    public func getClaim(name: String) -> Claim?

    Parameters

    name

    Claim name.

    Return Value

    Claim of the specified name.

  • Inserts a new claim into the set. If it already exists then it will be replaced.

    Declaration

    Swift

    public mutating func updateClaim(claim: Claim)

    Parameters

    claim

    Claim insert.

  • Removes the claim with the specified name.

    Declaration

    Swift

    public mutating func removeClaim(name: String)

    Parameters

    name

    Claim name.

Default Sudo schema.

  • Title.

    Declaration

    Swift

    var title: String? { get set }
  • First name.

    Declaration

    Swift

    var firstName: String? { get set }
  • Last name.

    Declaration

    Swift

    var lastName: String? { get set }
  • Label.

    Declaration

    Swift

    var label: String? { get set }
  • Notes.

    Declaration

    Swift

    var notes: String? { get set }
  • External ID associated with this Sudo.

    Declaration

    Swift

    var externalId: String? { get }
  • Avatar image URL.

    Declaration

    Swift

    var avatar: URL? { get set }
  • Instantiates a Sudo.

    Declaration

    Swift

    init(id: String,
         version: Int,
         createdAt: Date,
         updatedAt: Date,
         title: String? = nil,
         firstName: String? = nil,
         lastName: String? = nil,
         label: String? = nil,
         notes: String? = nil,
         avatar: URL? = nil)

    Parameters

    id

    Unique ID of the Sudo.

    version

    Current version of the Sudo.

    createdAt

    Date and time at which the Sudo was created.

    updatedAt

    Date and time at which the Sudo was last updated.

    title

    Title.

    firstName

    First name.

    lastName

    Last name.

    label

    Label.

    notes

    Notes.

    avatar

    Avatar image URL.

  • Instantiates a Sudo.

    Declaration

    Swift

    init(title: String? = nil,
         firstName: String? = nil,
         lastName: String? = nil,
         label: String? = nil,
         notes: String? = nil,
         avatar: URL? = nil)

    Parameters

    title

    Title.

    firstName

    First name.

    lastName

    Last name.

    label

    Label.

    notes

    Notes.

    avatar

    Avatar image URL.

  • Instantiates a Sudo.

    Declaration

    Swift

    init(id: String)

    Parameters

    id

    Unique ID of the Sudo.