mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-18 19:38:07 +03:00
5108be6554
* api: cleanup choice enums Signed-off-by: Jens Langhammer <jens@goauthentik.io> * more names Signed-off-by: Jens Langhammer <jens@goauthentik.io> * unrelated Signed-off-by: Jens Langhammer <jens@goauthentik.io> * rework Signed-off-by: Jens Langhammer <jens@goauthentik.io> * gen Signed-off-by: Jens Langhammer <jens@goauthentik.io> * update web Signed-off-by: Jens Langhammer <jens@goauthentik.io> * format Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix? Signed-off-by: Jens Langhammer <jens@goauthentik.io> * fix tests Signed-off-by: Jens Langhammer <jens@goauthentik.io> * try custom template Signed-off-by: Jens Langhammer <jens@goauthentik.io> * sed it instead? Signed-off-by: Jens Langhammer <jens@goauthentik.io> * correct sed Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io>
661 lines
16 KiB
Go
Generated
661 lines
16 KiB
Go
Generated
/*
|
|
authentik
|
|
|
|
Making authentication simple.
|
|
|
|
API version: 2026.5.0-rc1
|
|
Contact: hello@goauthentik.io
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package api
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
// checks if the Task type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Task{}
|
|
|
|
// Task struct for Task
|
|
type Task struct {
|
|
MessageId *string `json:"message_id,omitempty"`
|
|
// Queue name
|
|
QueueName *string `json:"queue_name,omitempty"`
|
|
// Dramatiq actor name
|
|
ActorName string `json:"actor_name"`
|
|
// Task status
|
|
State *TaskStatusEnum `json:"state,omitempty"`
|
|
// Task last modified time
|
|
Mtime *time.Time `json:"mtime,omitempty"`
|
|
// Number of retries
|
|
Retries *int64 `json:"retries,omitempty"`
|
|
// Planned execution time
|
|
Eta NullableTime `json:"eta,omitempty"`
|
|
RelObjAppLabel string `json:"rel_obj_app_label"`
|
|
RelObjModel string `json:"rel_obj_model"`
|
|
RelObjId NullableString `json:"rel_obj_id,omitempty"`
|
|
Uid string `json:"uid"`
|
|
Logs []LogEvent `json:"logs"`
|
|
PreviousLogs []LogEvent `json:"previous_logs"`
|
|
AggregatedStatus TaskAggregatedStatusEnum `json:"aggregated_status"`
|
|
Description NullableString `json:"description"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _Task Task
|
|
|
|
// NewTask instantiates a new Task object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewTask(actorName string, relObjAppLabel string, relObjModel string, uid string, logs []LogEvent, previousLogs []LogEvent, aggregatedStatus TaskAggregatedStatusEnum, description NullableString) *Task {
|
|
this := Task{}
|
|
this.ActorName = actorName
|
|
this.RelObjAppLabel = relObjAppLabel
|
|
this.RelObjModel = relObjModel
|
|
this.Uid = uid
|
|
this.Logs = logs
|
|
this.PreviousLogs = previousLogs
|
|
this.AggregatedStatus = aggregatedStatus
|
|
this.Description = description
|
|
return &this
|
|
}
|
|
|
|
// NewTaskWithDefaults instantiates a new Task object
|
|
// This constructor will only assign default values to properties that have it defined,
|
|
// but it doesn't guarantee that properties required by API are set
|
|
func NewTaskWithDefaults() *Task {
|
|
this := Task{}
|
|
return &this
|
|
}
|
|
|
|
// GetMessageId returns the MessageId field value if set, zero value otherwise.
|
|
func (o *Task) GetMessageId() string {
|
|
if o == nil || IsNil(o.MessageId) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.MessageId
|
|
}
|
|
|
|
// GetMessageIdOk returns a tuple with the MessageId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Task) GetMessageIdOk() (*string, bool) {
|
|
if o == nil || IsNil(o.MessageId) {
|
|
return nil, false
|
|
}
|
|
return o.MessageId, true
|
|
}
|
|
|
|
// HasMessageId returns a boolean if a field has been set.
|
|
func (o *Task) HasMessageId() bool {
|
|
if o != nil && !IsNil(o.MessageId) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMessageId gets a reference to the given string and assigns it to the MessageId field.
|
|
func (o *Task) SetMessageId(v string) {
|
|
o.MessageId = &v
|
|
}
|
|
|
|
// GetQueueName returns the QueueName field value if set, zero value otherwise.
|
|
func (o *Task) GetQueueName() string {
|
|
if o == nil || IsNil(o.QueueName) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.QueueName
|
|
}
|
|
|
|
// GetQueueNameOk returns a tuple with the QueueName field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Task) GetQueueNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.QueueName) {
|
|
return nil, false
|
|
}
|
|
return o.QueueName, true
|
|
}
|
|
|
|
// HasQueueName returns a boolean if a field has been set.
|
|
func (o *Task) HasQueueName() bool {
|
|
if o != nil && !IsNil(o.QueueName) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetQueueName gets a reference to the given string and assigns it to the QueueName field.
|
|
func (o *Task) SetQueueName(v string) {
|
|
o.QueueName = &v
|
|
}
|
|
|
|
// GetActorName returns the ActorName field value
|
|
func (o *Task) GetActorName() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.ActorName
|
|
}
|
|
|
|
// GetActorNameOk returns a tuple with the ActorName field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Task) GetActorNameOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.ActorName, true
|
|
}
|
|
|
|
// SetActorName sets field value
|
|
func (o *Task) SetActorName(v string) {
|
|
o.ActorName = v
|
|
}
|
|
|
|
// GetState returns the State field value if set, zero value otherwise.
|
|
func (o *Task) GetState() TaskStatusEnum {
|
|
if o == nil || IsNil(o.State) {
|
|
var ret TaskStatusEnum
|
|
return ret
|
|
}
|
|
return *o.State
|
|
}
|
|
|
|
// GetStateOk returns a tuple with the State field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Task) GetStateOk() (*TaskStatusEnum, bool) {
|
|
if o == nil || IsNil(o.State) {
|
|
return nil, false
|
|
}
|
|
return o.State, true
|
|
}
|
|
|
|
// HasState returns a boolean if a field has been set.
|
|
func (o *Task) HasState() bool {
|
|
if o != nil && !IsNil(o.State) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetState gets a reference to the given TaskStatusEnum and assigns it to the State field.
|
|
func (o *Task) SetState(v TaskStatusEnum) {
|
|
o.State = &v
|
|
}
|
|
|
|
// GetMtime returns the Mtime field value if set, zero value otherwise.
|
|
func (o *Task) GetMtime() time.Time {
|
|
if o == nil || IsNil(o.Mtime) {
|
|
var ret time.Time
|
|
return ret
|
|
}
|
|
return *o.Mtime
|
|
}
|
|
|
|
// GetMtimeOk returns a tuple with the Mtime field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Task) GetMtimeOk() (*time.Time, bool) {
|
|
if o == nil || IsNil(o.Mtime) {
|
|
return nil, false
|
|
}
|
|
return o.Mtime, true
|
|
}
|
|
|
|
// HasMtime returns a boolean if a field has been set.
|
|
func (o *Task) HasMtime() bool {
|
|
if o != nil && !IsNil(o.Mtime) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMtime gets a reference to the given time.Time and assigns it to the Mtime field.
|
|
func (o *Task) SetMtime(v time.Time) {
|
|
o.Mtime = &v
|
|
}
|
|
|
|
// GetRetries returns the Retries field value if set, zero value otherwise.
|
|
func (o *Task) GetRetries() int64 {
|
|
if o == nil || IsNil(o.Retries) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Retries
|
|
}
|
|
|
|
// GetRetriesOk returns a tuple with the Retries field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Task) GetRetriesOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Retries) {
|
|
return nil, false
|
|
}
|
|
return o.Retries, true
|
|
}
|
|
|
|
// HasRetries returns a boolean if a field has been set.
|
|
func (o *Task) HasRetries() bool {
|
|
if o != nil && !IsNil(o.Retries) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRetries gets a reference to the given int64 and assigns it to the Retries field.
|
|
func (o *Task) SetRetries(v int64) {
|
|
o.Retries = &v
|
|
}
|
|
|
|
// GetEta returns the Eta field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *Task) GetEta() time.Time {
|
|
if o == nil || IsNil(o.Eta.Get()) {
|
|
var ret time.Time
|
|
return ret
|
|
}
|
|
return *o.Eta.Get()
|
|
}
|
|
|
|
// GetEtaOk returns a tuple with the Eta field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *Task) GetEtaOk() (*time.Time, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.Eta.Get(), o.Eta.IsSet()
|
|
}
|
|
|
|
// HasEta returns a boolean if a field has been set.
|
|
func (o *Task) HasEta() bool {
|
|
if o != nil && o.Eta.IsSet() {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEta gets a reference to the given NullableTime and assigns it to the Eta field.
|
|
func (o *Task) SetEta(v time.Time) {
|
|
o.Eta.Set(&v)
|
|
}
|
|
|
|
// SetEtaNil sets the value for Eta to be an explicit nil
|
|
func (o *Task) SetEtaNil() {
|
|
o.Eta.Set(nil)
|
|
}
|
|
|
|
// UnsetEta ensures that no value is present for Eta, not even an explicit nil
|
|
func (o *Task) UnsetEta() {
|
|
o.Eta.Unset()
|
|
}
|
|
|
|
// GetRelObjAppLabel returns the RelObjAppLabel field value
|
|
func (o *Task) GetRelObjAppLabel() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.RelObjAppLabel
|
|
}
|
|
|
|
// GetRelObjAppLabelOk returns a tuple with the RelObjAppLabel field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Task) GetRelObjAppLabelOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.RelObjAppLabel, true
|
|
}
|
|
|
|
// SetRelObjAppLabel sets field value
|
|
func (o *Task) SetRelObjAppLabel(v string) {
|
|
o.RelObjAppLabel = v
|
|
}
|
|
|
|
// GetRelObjModel returns the RelObjModel field value
|
|
func (o *Task) GetRelObjModel() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.RelObjModel
|
|
}
|
|
|
|
// GetRelObjModelOk returns a tuple with the RelObjModel field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Task) GetRelObjModelOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.RelObjModel, true
|
|
}
|
|
|
|
// SetRelObjModel sets field value
|
|
func (o *Task) SetRelObjModel(v string) {
|
|
o.RelObjModel = v
|
|
}
|
|
|
|
// GetRelObjId returns the RelObjId field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *Task) GetRelObjId() string {
|
|
if o == nil || IsNil(o.RelObjId.Get()) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.RelObjId.Get()
|
|
}
|
|
|
|
// GetRelObjIdOk returns a tuple with the RelObjId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *Task) GetRelObjIdOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.RelObjId.Get(), o.RelObjId.IsSet()
|
|
}
|
|
|
|
// HasRelObjId returns a boolean if a field has been set.
|
|
func (o *Task) HasRelObjId() bool {
|
|
if o != nil && o.RelObjId.IsSet() {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRelObjId gets a reference to the given NullableString and assigns it to the RelObjId field.
|
|
func (o *Task) SetRelObjId(v string) {
|
|
o.RelObjId.Set(&v)
|
|
}
|
|
|
|
// SetRelObjIdNil sets the value for RelObjId to be an explicit nil
|
|
func (o *Task) SetRelObjIdNil() {
|
|
o.RelObjId.Set(nil)
|
|
}
|
|
|
|
// UnsetRelObjId ensures that no value is present for RelObjId, not even an explicit nil
|
|
func (o *Task) UnsetRelObjId() {
|
|
o.RelObjId.Unset()
|
|
}
|
|
|
|
// GetUid returns the Uid field value
|
|
func (o *Task) GetUid() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Uid
|
|
}
|
|
|
|
// GetUidOk returns a tuple with the Uid field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Task) GetUidOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Uid, true
|
|
}
|
|
|
|
// SetUid sets field value
|
|
func (o *Task) SetUid(v string) {
|
|
o.Uid = v
|
|
}
|
|
|
|
// GetLogs returns the Logs field value
|
|
func (o *Task) GetLogs() []LogEvent {
|
|
if o == nil {
|
|
var ret []LogEvent
|
|
return ret
|
|
}
|
|
|
|
return o.Logs
|
|
}
|
|
|
|
// GetLogsOk returns a tuple with the Logs field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Task) GetLogsOk() ([]LogEvent, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.Logs, true
|
|
}
|
|
|
|
// SetLogs sets field value
|
|
func (o *Task) SetLogs(v []LogEvent) {
|
|
o.Logs = v
|
|
}
|
|
|
|
// GetPreviousLogs returns the PreviousLogs field value
|
|
func (o *Task) GetPreviousLogs() []LogEvent {
|
|
if o == nil {
|
|
var ret []LogEvent
|
|
return ret
|
|
}
|
|
|
|
return o.PreviousLogs
|
|
}
|
|
|
|
// GetPreviousLogsOk returns a tuple with the PreviousLogs field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Task) GetPreviousLogsOk() ([]LogEvent, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.PreviousLogs, true
|
|
}
|
|
|
|
// SetPreviousLogs sets field value
|
|
func (o *Task) SetPreviousLogs(v []LogEvent) {
|
|
o.PreviousLogs = v
|
|
}
|
|
|
|
// GetAggregatedStatus returns the AggregatedStatus field value
|
|
func (o *Task) GetAggregatedStatus() TaskAggregatedStatusEnum {
|
|
if o == nil {
|
|
var ret TaskAggregatedStatusEnum
|
|
return ret
|
|
}
|
|
|
|
return o.AggregatedStatus
|
|
}
|
|
|
|
// GetAggregatedStatusOk returns a tuple with the AggregatedStatus field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Task) GetAggregatedStatusOk() (*TaskAggregatedStatusEnum, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.AggregatedStatus, true
|
|
}
|
|
|
|
// SetAggregatedStatus sets field value
|
|
func (o *Task) SetAggregatedStatus(v TaskAggregatedStatusEnum) {
|
|
o.AggregatedStatus = v
|
|
}
|
|
|
|
// GetDescription returns the Description field value
|
|
// If the value is explicit nil, the zero value for string will be returned
|
|
func (o *Task) GetDescription() string {
|
|
if o == nil || o.Description.Get() == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return *o.Description.Get()
|
|
}
|
|
|
|
// GetDescriptionOk returns a tuple with the Description field value
|
|
// and a boolean to check if the value has been set.
|
|
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
|
func (o *Task) GetDescriptionOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.Description.Get(), o.Description.IsSet()
|
|
}
|
|
|
|
// SetDescription sets field value
|
|
func (o *Task) SetDescription(v string) {
|
|
o.Description.Set(&v)
|
|
}
|
|
|
|
func (o Task) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o Task) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.MessageId) {
|
|
toSerialize["message_id"] = o.MessageId
|
|
}
|
|
if !IsNil(o.QueueName) {
|
|
toSerialize["queue_name"] = o.QueueName
|
|
}
|
|
toSerialize["actor_name"] = o.ActorName
|
|
if !IsNil(o.State) {
|
|
toSerialize["state"] = o.State
|
|
}
|
|
if !IsNil(o.Mtime) {
|
|
toSerialize["mtime"] = o.Mtime
|
|
}
|
|
if !IsNil(o.Retries) {
|
|
toSerialize["retries"] = o.Retries
|
|
}
|
|
if o.Eta.IsSet() {
|
|
toSerialize["eta"] = o.Eta.Get()
|
|
}
|
|
toSerialize["rel_obj_app_label"] = o.RelObjAppLabel
|
|
toSerialize["rel_obj_model"] = o.RelObjModel
|
|
if o.RelObjId.IsSet() {
|
|
toSerialize["rel_obj_id"] = o.RelObjId.Get()
|
|
}
|
|
toSerialize["uid"] = o.Uid
|
|
toSerialize["logs"] = o.Logs
|
|
toSerialize["previous_logs"] = o.PreviousLogs
|
|
toSerialize["aggregated_status"] = o.AggregatedStatus
|
|
toSerialize["description"] = o.Description.Get()
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *Task) UnmarshalJSON(data []byte) (err error) {
|
|
// This validates that all required properties are included in the JSON object
|
|
// by unmarshalling the object into a generic map with string keys and checking
|
|
// that every required field exists as a key in the generic map.
|
|
requiredProperties := []string{
|
|
"actor_name",
|
|
"rel_obj_app_label",
|
|
"rel_obj_model",
|
|
"uid",
|
|
"logs",
|
|
"previous_logs",
|
|
"aggregated_status",
|
|
"description",
|
|
}
|
|
|
|
allProperties := make(map[string]interface{})
|
|
|
|
err = json.Unmarshal(data, &allProperties)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
for _, requiredProperty := range requiredProperties {
|
|
if _, exists := allProperties[requiredProperty]; !exists {
|
|
return fmt.Errorf("no value given for required property %v", requiredProperty)
|
|
}
|
|
}
|
|
|
|
varTask := _Task{}
|
|
|
|
err = json.Unmarshal(data, &varTask)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = Task(varTask)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "message_id")
|
|
delete(additionalProperties, "queue_name")
|
|
delete(additionalProperties, "actor_name")
|
|
delete(additionalProperties, "state")
|
|
delete(additionalProperties, "mtime")
|
|
delete(additionalProperties, "retries")
|
|
delete(additionalProperties, "eta")
|
|
delete(additionalProperties, "rel_obj_app_label")
|
|
delete(additionalProperties, "rel_obj_model")
|
|
delete(additionalProperties, "rel_obj_id")
|
|
delete(additionalProperties, "uid")
|
|
delete(additionalProperties, "logs")
|
|
delete(additionalProperties, "previous_logs")
|
|
delete(additionalProperties, "aggregated_status")
|
|
delete(additionalProperties, "description")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTask struct {
|
|
value *Task
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTask) Get() *Task {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTask) Set(val *Task) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTask) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTask) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTask(val *Task) *NullableTask {
|
|
return &NullableTask{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTask) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTask) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|