mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-18 11:29:26 +03:00
2f70351c90
* 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>
319 lines
7.7 KiB
Go
Generated
319 lines
7.7 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 Version type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Version{}
|
|
|
|
// Version Get running and latest version.
|
|
type Version struct {
|
|
// Get current version
|
|
VersionCurrent string `json:"version_current"`
|
|
// Get latest version from cache
|
|
VersionLatest string `json:"version_latest"`
|
|
// Check if latest version is valid
|
|
VersionLatestValid bool `json:"version_latest_valid"`
|
|
// Get build hash, if version is not latest or released
|
|
BuildHash string `json:"build_hash"`
|
|
// Check if we're running the latest version
|
|
Outdated bool `json:"outdated"`
|
|
// Check if any outpost is outdated/has a version mismatch
|
|
OutpostOutdated bool `json:"outpost_outdated"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _Version Version
|
|
|
|
// NewVersion instantiates a new Version 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 NewVersion(versionCurrent string, versionLatest string, versionLatestValid bool, buildHash string, outdated bool, outpostOutdated bool) *Version {
|
|
this := Version{}
|
|
this.VersionCurrent = versionCurrent
|
|
this.VersionLatest = versionLatest
|
|
this.VersionLatestValid = versionLatestValid
|
|
this.BuildHash = buildHash
|
|
this.Outdated = outdated
|
|
this.OutpostOutdated = outpostOutdated
|
|
return &this
|
|
}
|
|
|
|
// NewVersionWithDefaults instantiates a new Version 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 NewVersionWithDefaults() *Version {
|
|
this := Version{}
|
|
return &this
|
|
}
|
|
|
|
// GetVersionCurrent returns the VersionCurrent field value
|
|
func (o *Version) GetVersionCurrent() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.VersionCurrent
|
|
}
|
|
|
|
// GetVersionCurrentOk returns a tuple with the VersionCurrent field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Version) GetVersionCurrentOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.VersionCurrent, true
|
|
}
|
|
|
|
// SetVersionCurrent sets field value
|
|
func (o *Version) SetVersionCurrent(v string) {
|
|
o.VersionCurrent = v
|
|
}
|
|
|
|
// GetVersionLatest returns the VersionLatest field value
|
|
func (o *Version) GetVersionLatest() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.VersionLatest
|
|
}
|
|
|
|
// GetVersionLatestOk returns a tuple with the VersionLatest field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Version) GetVersionLatestOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.VersionLatest, true
|
|
}
|
|
|
|
// SetVersionLatest sets field value
|
|
func (o *Version) SetVersionLatest(v string) {
|
|
o.VersionLatest = v
|
|
}
|
|
|
|
// GetVersionLatestValid returns the VersionLatestValid field value
|
|
func (o *Version) GetVersionLatestValid() bool {
|
|
if o == nil {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
|
|
return o.VersionLatestValid
|
|
}
|
|
|
|
// GetVersionLatestValidOk returns a tuple with the VersionLatestValid field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Version) GetVersionLatestValidOk() (*bool, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.VersionLatestValid, true
|
|
}
|
|
|
|
// SetVersionLatestValid sets field value
|
|
func (o *Version) SetVersionLatestValid(v bool) {
|
|
o.VersionLatestValid = v
|
|
}
|
|
|
|
// GetBuildHash returns the BuildHash field value
|
|
func (o *Version) GetBuildHash() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.BuildHash
|
|
}
|
|
|
|
// GetBuildHashOk returns a tuple with the BuildHash field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Version) GetBuildHashOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.BuildHash, true
|
|
}
|
|
|
|
// SetBuildHash sets field value
|
|
func (o *Version) SetBuildHash(v string) {
|
|
o.BuildHash = v
|
|
}
|
|
|
|
// GetOutdated returns the Outdated field value
|
|
func (o *Version) GetOutdated() bool {
|
|
if o == nil {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
|
|
return o.Outdated
|
|
}
|
|
|
|
// GetOutdatedOk returns a tuple with the Outdated field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Version) GetOutdatedOk() (*bool, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Outdated, true
|
|
}
|
|
|
|
// SetOutdated sets field value
|
|
func (o *Version) SetOutdated(v bool) {
|
|
o.Outdated = v
|
|
}
|
|
|
|
// GetOutpostOutdated returns the OutpostOutdated field value
|
|
func (o *Version) GetOutpostOutdated() bool {
|
|
if o == nil {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
|
|
return o.OutpostOutdated
|
|
}
|
|
|
|
// GetOutpostOutdatedOk returns a tuple with the OutpostOutdated field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Version) GetOutpostOutdatedOk() (*bool, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.OutpostOutdated, true
|
|
}
|
|
|
|
// SetOutpostOutdated sets field value
|
|
func (o *Version) SetOutpostOutdated(v bool) {
|
|
o.OutpostOutdated = v
|
|
}
|
|
|
|
func (o Version) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o Version) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["version_current"] = o.VersionCurrent
|
|
toSerialize["version_latest"] = o.VersionLatest
|
|
toSerialize["version_latest_valid"] = o.VersionLatestValid
|
|
toSerialize["build_hash"] = o.BuildHash
|
|
toSerialize["outdated"] = o.Outdated
|
|
toSerialize["outpost_outdated"] = o.OutpostOutdated
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *Version) 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{
|
|
"version_current",
|
|
"version_latest",
|
|
"version_latest_valid",
|
|
"build_hash",
|
|
"outdated",
|
|
"outpost_outdated",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varVersion := _Version{}
|
|
|
|
err = json.Unmarshal(data, &varVersion)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = Version(varVersion)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "version_current")
|
|
delete(additionalProperties, "version_latest")
|
|
delete(additionalProperties, "version_latest_valid")
|
|
delete(additionalProperties, "build_hash")
|
|
delete(additionalProperties, "outdated")
|
|
delete(additionalProperties, "outpost_outdated")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableVersion struct {
|
|
value *Version
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableVersion) Get() *Version {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableVersion) Set(val *Version) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableVersion) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableVersion) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableVersion(val *Version) *NullableVersion {
|
|
return &NullableVersion{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableVersion) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableVersion) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|