/*
 * This file is generated by jOOQ.
 */
package com.nisemoe.generated.tables.records


import com.nisemoe.generated.tables.OsuApiKeys

import java.time.OffsetDateTime

import org.jooq.Field
import org.jooq.Record1
import org.jooq.Record5
import org.jooq.Row5
import org.jooq.impl.UpdatableRecordImpl


/**
 * This class is generated by jOOQ.
 */
@Suppress("UNCHECKED_CAST")
open class OsuApiKeysRecord private constructor() : UpdatableRecordImpl<OsuApiKeysRecord>(OsuApiKeys.OSU_API_KEYS), Record5<Int?, String?, OffsetDateTime?, Boolean?, Boolean?> {

    open var id: Int?
        set(value): Unit = set(0, value)
        get(): Int? = get(0) as Int?

    open var apiKey: String
        set(value): Unit = set(1, value)
        get(): String = get(1) as String

    open var createdAt: OffsetDateTime?
        set(value): Unit = set(2, value)
        get(): OffsetDateTime? = get(2) as OffsetDateTime?

    @Suppress("INAPPLICABLE_JVM_NAME")
    @set:JvmName("setIsValid")
    open var isValid: Boolean?
        set(value): Unit = set(3, value)
        get(): Boolean? = get(3) as Boolean?

    @Suppress("INAPPLICABLE_JVM_NAME")
    @set:JvmName("setIsActive")
    open var isActive: Boolean?
        set(value): Unit = set(4, value)
        get(): Boolean? = get(4) as Boolean?

    // -------------------------------------------------------------------------
    // Primary key information
    // -------------------------------------------------------------------------

    override fun key(): Record1<Int?> = super.key() as Record1<Int?>

    // -------------------------------------------------------------------------
    // Record5 type implementation
    // -------------------------------------------------------------------------

    override fun fieldsRow(): Row5<Int?, String?, OffsetDateTime?, Boolean?, Boolean?> = super.fieldsRow() as Row5<Int?, String?, OffsetDateTime?, Boolean?, Boolean?>
    override fun valuesRow(): Row5<Int?, String?, OffsetDateTime?, Boolean?, Boolean?> = super.valuesRow() as Row5<Int?, String?, OffsetDateTime?, Boolean?, Boolean?>
    override fun field1(): Field<Int?> = OsuApiKeys.OSU_API_KEYS.ID
    override fun field2(): Field<String?> = OsuApiKeys.OSU_API_KEYS.API_KEY
    override fun field3(): Field<OffsetDateTime?> = OsuApiKeys.OSU_API_KEYS.CREATED_AT
    override fun field4(): Field<Boolean?> = OsuApiKeys.OSU_API_KEYS.IS_VALID
    override fun field5(): Field<Boolean?> = OsuApiKeys.OSU_API_KEYS.IS_ACTIVE
    override fun component1(): Int? = id
    override fun component2(): String = apiKey
    override fun component3(): OffsetDateTime? = createdAt
    override fun component4(): Boolean? = isValid
    override fun component5(): Boolean? = isActive
    override fun value1(): Int? = id
    override fun value2(): String = apiKey
    override fun value3(): OffsetDateTime? = createdAt
    override fun value4(): Boolean? = isValid
    override fun value5(): Boolean? = isActive

    override fun value1(value: Int?): OsuApiKeysRecord {
        set(0, value)
        return this
    }

    override fun value2(value: String?): OsuApiKeysRecord {
        set(1, value)
        return this
    }

    override fun value3(value: OffsetDateTime?): OsuApiKeysRecord {
        set(2, value)
        return this
    }

    override fun value4(value: Boolean?): OsuApiKeysRecord {
        set(3, value)
        return this
    }

    override fun value5(value: Boolean?): OsuApiKeysRecord {
        set(4, value)
        return this
    }

    override fun values(value1: Int?, value2: String?, value3: OffsetDateTime?, value4: Boolean?, value5: Boolean?): OsuApiKeysRecord {
        this.value1(value1)
        this.value2(value2)
        this.value3(value3)
        this.value4(value4)
        this.value5(value5)
        return this
    }

    /**
     * Create a detached, initialised OsuApiKeysRecord
     */
    constructor(id: Int? = null, apiKey: String, createdAt: OffsetDateTime? = null, isValid: Boolean? = null, isActive: Boolean? = null): this() {
        this.id = id
        this.apiKey = apiKey
        this.createdAt = createdAt
        this.isValid = isValid
        this.isActive = isActive
        resetChangedOnNotNull()
    }
}
