Files
authentik/packages/client-go/model_web_authn_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

316 lines
7.6 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 WebAuthnDevice type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &WebAuthnDevice{}
// WebAuthnDevice Serializer for WebAuthn authenticator devices
type WebAuthnDevice struct {
Pk int32 `json:"pk"`
Name string `json:"name"`
CreatedOn time.Time `json:"created_on"`
DeviceType NullableWebAuthnDeviceType `json:"device_type"`
Aaguid string `json:"aaguid"`
User PartialUser `json:"user"`
AdditionalProperties map[string]interface{}
}
type _WebAuthnDevice WebAuthnDevice
// NewWebAuthnDevice instantiates a new WebAuthnDevice 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 NewWebAuthnDevice(pk int32, name string, createdOn time.Time, deviceType NullableWebAuthnDeviceType, aaguid string, user PartialUser) *WebAuthnDevice {
this := WebAuthnDevice{}
this.Pk = pk
this.Name = name
this.CreatedOn = createdOn
this.DeviceType = deviceType
this.Aaguid = aaguid
this.User = user
return &this
}
// NewWebAuthnDeviceWithDefaults instantiates a new WebAuthnDevice 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 NewWebAuthnDeviceWithDefaults() *WebAuthnDevice {
this := WebAuthnDevice{}
return &this
}
// GetPk returns the Pk field value
func (o *WebAuthnDevice) GetPk() int32 {
if o == nil {
var ret int32
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 *WebAuthnDevice) GetPkOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Pk, true
}
// SetPk sets field value
func (o *WebAuthnDevice) SetPk(v int32) {
o.Pk = v
}
// GetName returns the Name field value
func (o *WebAuthnDevice) 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 *WebAuthnDevice) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *WebAuthnDevice) SetName(v string) {
o.Name = v
}
// GetCreatedOn returns the CreatedOn field value
func (o *WebAuthnDevice) GetCreatedOn() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.CreatedOn
}
// GetCreatedOnOk returns a tuple with the CreatedOn field value
// and a boolean to check if the value has been set.
func (o *WebAuthnDevice) GetCreatedOnOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.CreatedOn, true
}
// SetCreatedOn sets field value
func (o *WebAuthnDevice) SetCreatedOn(v time.Time) {
o.CreatedOn = v
}
// GetDeviceType returns the DeviceType field value
// If the value is explicit nil, the zero value for WebAuthnDeviceType will be returned
func (o *WebAuthnDevice) GetDeviceType() WebAuthnDeviceType {
if o == nil || o.DeviceType.Get() == nil {
var ret WebAuthnDeviceType
return ret
}
return *o.DeviceType.Get()
}
// GetDeviceTypeOk returns a tuple with the DeviceType 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 *WebAuthnDevice) GetDeviceTypeOk() (*WebAuthnDeviceType, bool) {
if o == nil {
return nil, false
}
return o.DeviceType.Get(), o.DeviceType.IsSet()
}
// SetDeviceType sets field value
func (o *WebAuthnDevice) SetDeviceType(v WebAuthnDeviceType) {
o.DeviceType.Set(&v)
}
// GetAaguid returns the Aaguid field value
func (o *WebAuthnDevice) GetAaguid() string {
if o == nil {
var ret string
return ret
}
return o.Aaguid
}
// GetAaguidOk returns a tuple with the Aaguid field value
// and a boolean to check if the value has been set.
func (o *WebAuthnDevice) GetAaguidOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Aaguid, true
}
// SetAaguid sets field value
func (o *WebAuthnDevice) SetAaguid(v string) {
o.Aaguid = v
}
// GetUser returns the User field value
func (o *WebAuthnDevice) GetUser() PartialUser {
if o == nil {
var ret PartialUser
return ret
}
return o.User
}
// GetUserOk returns a tuple with the User field value
// and a boolean to check if the value has been set.
func (o *WebAuthnDevice) GetUserOk() (*PartialUser, bool) {
if o == nil {
return nil, false
}
return &o.User, true
}
// SetUser sets field value
func (o *WebAuthnDevice) SetUser(v PartialUser) {
o.User = v
}
func (o WebAuthnDevice) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o WebAuthnDevice) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["pk"] = o.Pk
toSerialize["name"] = o.Name
toSerialize["created_on"] = o.CreatedOn
toSerialize["device_type"] = o.DeviceType.Get()
toSerialize["aaguid"] = o.Aaguid
toSerialize["user"] = o.User
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *WebAuthnDevice) 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{
"pk",
"name",
"created_on",
"device_type",
"aaguid",
"user",
}
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)
}
}
varWebAuthnDevice := _WebAuthnDevice{}
err = json.Unmarshal(data, &varWebAuthnDevice)
if err != nil {
return err
}
*o = WebAuthnDevice(varWebAuthnDevice)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "pk")
delete(additionalProperties, "name")
delete(additionalProperties, "created_on")
delete(additionalProperties, "device_type")
delete(additionalProperties, "aaguid")
delete(additionalProperties, "user")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableWebAuthnDevice struct {
value *WebAuthnDevice
isSet bool
}
func (v NullableWebAuthnDevice) Get() *WebAuthnDevice {
return v.value
}
func (v *NullableWebAuthnDevice) Set(val *WebAuthnDevice) {
v.value = val
v.isSet = true
}
func (v NullableWebAuthnDevice) IsSet() bool {
return v.isSet
}
func (v *NullableWebAuthnDevice) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWebAuthnDevice(val *WebAuthnDevice) *NullableWebAuthnDevice {
return &NullableWebAuthnDevice{value: val, isSet: true}
}
func (v NullableWebAuthnDevice) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWebAuthnDevice) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}