Files
authentik/packages/client-go/model_device.go
T
Marc 'risson' Schmitt 2f70351c90 packages/client-go: init (#21139)
* packages/client-go: init

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>

* format

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* remove mod/sum

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix translate

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* no go replace

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* update rust makefile with pwd

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>

* fix build

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix docs

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* don't need a version ig?

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* exclude go client from cspell

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* fix main docker build

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
Co-authored-by: Jens Langhammer <jens@goauthentik.io>
2026-03-25 15:26:50 +01:00

500 lines
12 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 Device type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Device{}
// Device Serializer for authenticator devices
type Device struct {
// Return object's verbose_name
VerboseName string `json:"verbose_name"`
// Return object's plural verbose_name
VerboseNamePlural string `json:"verbose_name_plural"`
// Return internal model name
MetaModelName string `json:"meta_model_name"`
Pk string `json:"pk"`
Name string `json:"name"`
// Get type of device
Type string `json:"type"`
Confirmed bool `json:"confirmed"`
Created time.Time `json:"created"`
LastUpdated time.Time `json:"last_updated"`
LastUsed NullableTime `json:"last_used"`
// Get extra description
ExtraDescription NullableString `json:"extra_description"`
// Get external Device ID
ExternalId NullableString `json:"external_id"`
AdditionalProperties map[string]interface{}
}
type _Device Device
// NewDevice instantiates a new Device 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 NewDevice(verboseName string, verboseNamePlural string, metaModelName string, pk string, name string, type_ string, confirmed bool, created time.Time, lastUpdated time.Time, lastUsed NullableTime, extraDescription NullableString, externalId NullableString) *Device {
this := Device{}
this.VerboseName = verboseName
this.VerboseNamePlural = verboseNamePlural
this.MetaModelName = metaModelName
this.Pk = pk
this.Name = name
this.Type = type_
this.Confirmed = confirmed
this.Created = created
this.LastUpdated = lastUpdated
this.LastUsed = lastUsed
this.ExtraDescription = extraDescription
this.ExternalId = externalId
return &this
}
// NewDeviceWithDefaults instantiates a new Device 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 NewDeviceWithDefaults() *Device {
this := Device{}
return &this
}
// GetVerboseName returns the VerboseName field value
func (o *Device) GetVerboseName() string {
if o == nil {
var ret string
return ret
}
return o.VerboseName
}
// GetVerboseNameOk returns a tuple with the VerboseName field value
// and a boolean to check if the value has been set.
func (o *Device) GetVerboseNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.VerboseName, true
}
// SetVerboseName sets field value
func (o *Device) SetVerboseName(v string) {
o.VerboseName = v
}
// GetVerboseNamePlural returns the VerboseNamePlural field value
func (o *Device) GetVerboseNamePlural() string {
if o == nil {
var ret string
return ret
}
return o.VerboseNamePlural
}
// GetVerboseNamePluralOk returns a tuple with the VerboseNamePlural field value
// and a boolean to check if the value has been set.
func (o *Device) GetVerboseNamePluralOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.VerboseNamePlural, true
}
// SetVerboseNamePlural sets field value
func (o *Device) SetVerboseNamePlural(v string) {
o.VerboseNamePlural = v
}
// GetMetaModelName returns the MetaModelName field value
func (o *Device) GetMetaModelName() string {
if o == nil {
var ret string
return ret
}
return o.MetaModelName
}
// GetMetaModelNameOk returns a tuple with the MetaModelName field value
// and a boolean to check if the value has been set.
func (o *Device) GetMetaModelNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.MetaModelName, true
}
// SetMetaModelName sets field value
func (o *Device) SetMetaModelName(v string) {
o.MetaModelName = v
}
// GetPk returns the Pk field value
func (o *Device) GetPk() string {
if o == nil {
var ret string
return ret
}
return o.Pk
}
// GetPkOk returns a tuple with the Pk field value
// and a boolean to check if the value has been set.
func (o *Device) GetPkOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Pk, true
}
// SetPk sets field value
func (o *Device) SetPk(v string) {
o.Pk = v
}
// GetName returns the Name field value
func (o *Device) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *Device) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *Device) SetName(v string) {
o.Name = v
}
// GetType returns the Type field value
func (o *Device) GetType() string {
if o == nil {
var ret string
return ret
}
return o.Type
}
// GetTypeOk returns a tuple with the Type field value
// and a boolean to check if the value has been set.
func (o *Device) GetTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Type, true
}
// SetType sets field value
func (o *Device) SetType(v string) {
o.Type = v
}
// GetConfirmed returns the Confirmed field value
func (o *Device) GetConfirmed() bool {
if o == nil {
var ret bool
return ret
}
return o.Confirmed
}
// GetConfirmedOk returns a tuple with the Confirmed field value
// and a boolean to check if the value has been set.
func (o *Device) GetConfirmedOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.Confirmed, true
}
// SetConfirmed sets field value
func (o *Device) SetConfirmed(v bool) {
o.Confirmed = v
}
// GetCreated returns the Created field value
func (o *Device) GetCreated() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.Created
}
// GetCreatedOk returns a tuple with the Created field value
// and a boolean to check if the value has been set.
func (o *Device) GetCreatedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.Created, true
}
// SetCreated sets field value
func (o *Device) SetCreated(v time.Time) {
o.Created = v
}
// GetLastUpdated returns the LastUpdated field value
func (o *Device) GetLastUpdated() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.LastUpdated
}
// GetLastUpdatedOk returns a tuple with the LastUpdated field value
// and a boolean to check if the value has been set.
func (o *Device) GetLastUpdatedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.LastUpdated, true
}
// SetLastUpdated sets field value
func (o *Device) SetLastUpdated(v time.Time) {
o.LastUpdated = v
}
// GetLastUsed returns the LastUsed field value
// If the value is explicit nil, the zero value for time.Time will be returned
func (o *Device) GetLastUsed() time.Time {
if o == nil || o.LastUsed.Get() == nil {
var ret time.Time
return ret
}
return *o.LastUsed.Get()
}
// GetLastUsedOk returns a tuple with the LastUsed 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 *Device) GetLastUsedOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.LastUsed.Get(), o.LastUsed.IsSet()
}
// SetLastUsed sets field value
func (o *Device) SetLastUsed(v time.Time) {
o.LastUsed.Set(&v)
}
// GetExtraDescription returns the ExtraDescription field value
// If the value is explicit nil, the zero value for string will be returned
func (o *Device) GetExtraDescription() string {
if o == nil || o.ExtraDescription.Get() == nil {
var ret string
return ret
}
return *o.ExtraDescription.Get()
}
// GetExtraDescriptionOk returns a tuple with the ExtraDescription 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 *Device) GetExtraDescriptionOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ExtraDescription.Get(), o.ExtraDescription.IsSet()
}
// SetExtraDescription sets field value
func (o *Device) SetExtraDescription(v string) {
o.ExtraDescription.Set(&v)
}
// GetExternalId returns the ExternalId field value
// If the value is explicit nil, the zero value for string will be returned
func (o *Device) GetExternalId() string {
if o == nil || o.ExternalId.Get() == nil {
var ret string
return ret
}
return *o.ExternalId.Get()
}
// GetExternalIdOk returns a tuple with the ExternalId 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 *Device) GetExternalIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ExternalId.Get(), o.ExternalId.IsSet()
}
// SetExternalId sets field value
func (o *Device) SetExternalId(v string) {
o.ExternalId.Set(&v)
}
func (o Device) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Device) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["verbose_name"] = o.VerboseName
toSerialize["verbose_name_plural"] = o.VerboseNamePlural
toSerialize["meta_model_name"] = o.MetaModelName
toSerialize["pk"] = o.Pk
toSerialize["name"] = o.Name
toSerialize["type"] = o.Type
toSerialize["confirmed"] = o.Confirmed
toSerialize["created"] = o.Created
toSerialize["last_updated"] = o.LastUpdated
toSerialize["last_used"] = o.LastUsed.Get()
toSerialize["extra_description"] = o.ExtraDescription.Get()
toSerialize["external_id"] = o.ExternalId.Get()
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Device) 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{
"verbose_name",
"verbose_name_plural",
"meta_model_name",
"pk",
"name",
"type",
"confirmed",
"created",
"last_updated",
"last_used",
"extra_description",
"external_id",
}
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)
}
}
varDevice := _Device{}
err = json.Unmarshal(data, &varDevice)
if err != nil {
return err
}
*o = Device(varDevice)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "verbose_name")
delete(additionalProperties, "verbose_name_plural")
delete(additionalProperties, "meta_model_name")
delete(additionalProperties, "pk")
delete(additionalProperties, "name")
delete(additionalProperties, "type")
delete(additionalProperties, "confirmed")
delete(additionalProperties, "created")
delete(additionalProperties, "last_updated")
delete(additionalProperties, "last_used")
delete(additionalProperties, "extra_description")
delete(additionalProperties, "external_id")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableDevice struct {
value *Device
isSet bool
}
func (v NullableDevice) Get() *Device {
return v.value
}
func (v *NullableDevice) Set(val *Device) {
v.value = val
v.isSet = true
}
func (v NullableDevice) IsSet() bool {
return v.isSet
}
func (v *NullableDevice) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDevice(val *Device) *NullableDevice {
return &NullableDevice{value: val, isSet: true}
}
func (v NullableDevice) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDevice) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}