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

226 lines
5.1 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"
)
// checks if the Worker type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Worker{}
// Worker struct for Worker
type Worker struct {
WorkerId string `json:"worker_id"`
Version string `json:"version"`
VersionMatching bool `json:"version_matching"`
AdditionalProperties map[string]interface{}
}
type _Worker Worker
// NewWorker instantiates a new Worker 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 NewWorker(workerId string, version string, versionMatching bool) *Worker {
this := Worker{}
this.WorkerId = workerId
this.Version = version
this.VersionMatching = versionMatching
return &this
}
// NewWorkerWithDefaults instantiates a new Worker 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 NewWorkerWithDefaults() *Worker {
this := Worker{}
return &this
}
// GetWorkerId returns the WorkerId field value
func (o *Worker) GetWorkerId() string {
if o == nil {
var ret string
return ret
}
return o.WorkerId
}
// GetWorkerIdOk returns a tuple with the WorkerId field value
// and a boolean to check if the value has been set.
func (o *Worker) GetWorkerIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.WorkerId, true
}
// SetWorkerId sets field value
func (o *Worker) SetWorkerId(v string) {
o.WorkerId = v
}
// GetVersion returns the Version field value
func (o *Worker) GetVersion() string {
if o == nil {
var ret string
return ret
}
return o.Version
}
// GetVersionOk returns a tuple with the Version field value
// and a boolean to check if the value has been set.
func (o *Worker) GetVersionOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Version, true
}
// SetVersion sets field value
func (o *Worker) SetVersion(v string) {
o.Version = v
}
// GetVersionMatching returns the VersionMatching field value
func (o *Worker) GetVersionMatching() bool {
if o == nil {
var ret bool
return ret
}
return o.VersionMatching
}
// GetVersionMatchingOk returns a tuple with the VersionMatching field value
// and a boolean to check if the value has been set.
func (o *Worker) GetVersionMatchingOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.VersionMatching, true
}
// SetVersionMatching sets field value
func (o *Worker) SetVersionMatching(v bool) {
o.VersionMatching = v
}
func (o Worker) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Worker) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["worker_id"] = o.WorkerId
toSerialize["version"] = o.Version
toSerialize["version_matching"] = o.VersionMatching
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Worker) 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{
"worker_id",
"version",
"version_matching",
}
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)
}
}
varWorker := _Worker{}
err = json.Unmarshal(data, &varWorker)
if err != nil {
return err
}
*o = Worker(varWorker)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "worker_id")
delete(additionalProperties, "version")
delete(additionalProperties, "version_matching")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableWorker struct {
value *Worker
isSet bool
}
func (v NullableWorker) Get() *Worker {
return v.value
}
func (v *NullableWorker) Set(val *Worker) {
v.value = val
v.isSet = true
}
func (v NullableWorker) IsSet() bool {
return v.isSet
}
func (v *NullableWorker) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableWorker(val *Worker) *NullableWorker {
return &NullableWorker{value: val, isSet: true}
}
func (v NullableWorker) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableWorker) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}