mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-18 03:19:51 +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>
353 lines
8.5 KiB
Go
Generated
353 lines
8.5 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 Hardware type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Hardware{}
|
|
|
|
// Hardware struct for Hardware
|
|
type Hardware struct {
|
|
Model *string `json:"model,omitempty"`
|
|
Manufacturer *string `json:"manufacturer,omitempty"`
|
|
Serial string `json:"serial"`
|
|
CpuName *string `json:"cpu_name,omitempty"`
|
|
CpuCount *int32 `json:"cpu_count,omitempty"`
|
|
MemoryBytes *int64 `json:"memory_bytes,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _Hardware Hardware
|
|
|
|
// NewHardware instantiates a new Hardware 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 NewHardware(serial string) *Hardware {
|
|
this := Hardware{}
|
|
this.Serial = serial
|
|
return &this
|
|
}
|
|
|
|
// NewHardwareWithDefaults instantiates a new Hardware 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 NewHardwareWithDefaults() *Hardware {
|
|
this := Hardware{}
|
|
return &this
|
|
}
|
|
|
|
// GetModel returns the Model field value if set, zero value otherwise.
|
|
func (o *Hardware) GetModel() string {
|
|
if o == nil || IsNil(o.Model) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Model
|
|
}
|
|
|
|
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Hardware) GetModelOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Model) {
|
|
return nil, false
|
|
}
|
|
return o.Model, true
|
|
}
|
|
|
|
// HasModel returns a boolean if a field has been set.
|
|
func (o *Hardware) HasModel() bool {
|
|
if o != nil && !IsNil(o.Model) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetModel gets a reference to the given string and assigns it to the Model field.
|
|
func (o *Hardware) SetModel(v string) {
|
|
o.Model = &v
|
|
}
|
|
|
|
// GetManufacturer returns the Manufacturer field value if set, zero value otherwise.
|
|
func (o *Hardware) GetManufacturer() string {
|
|
if o == nil || IsNil(o.Manufacturer) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Manufacturer
|
|
}
|
|
|
|
// GetManufacturerOk returns a tuple with the Manufacturer field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Hardware) GetManufacturerOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Manufacturer) {
|
|
return nil, false
|
|
}
|
|
return o.Manufacturer, true
|
|
}
|
|
|
|
// HasManufacturer returns a boolean if a field has been set.
|
|
func (o *Hardware) HasManufacturer() bool {
|
|
if o != nil && !IsNil(o.Manufacturer) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetManufacturer gets a reference to the given string and assigns it to the Manufacturer field.
|
|
func (o *Hardware) SetManufacturer(v string) {
|
|
o.Manufacturer = &v
|
|
}
|
|
|
|
// GetSerial returns the Serial field value
|
|
func (o *Hardware) GetSerial() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Serial
|
|
}
|
|
|
|
// GetSerialOk returns a tuple with the Serial field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Hardware) GetSerialOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Serial, true
|
|
}
|
|
|
|
// SetSerial sets field value
|
|
func (o *Hardware) SetSerial(v string) {
|
|
o.Serial = v
|
|
}
|
|
|
|
// GetCpuName returns the CpuName field value if set, zero value otherwise.
|
|
func (o *Hardware) GetCpuName() string {
|
|
if o == nil || IsNil(o.CpuName) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.CpuName
|
|
}
|
|
|
|
// GetCpuNameOk returns a tuple with the CpuName field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Hardware) GetCpuNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.CpuName) {
|
|
return nil, false
|
|
}
|
|
return o.CpuName, true
|
|
}
|
|
|
|
// HasCpuName returns a boolean if a field has been set.
|
|
func (o *Hardware) HasCpuName() bool {
|
|
if o != nil && !IsNil(o.CpuName) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCpuName gets a reference to the given string and assigns it to the CpuName field.
|
|
func (o *Hardware) SetCpuName(v string) {
|
|
o.CpuName = &v
|
|
}
|
|
|
|
// GetCpuCount returns the CpuCount field value if set, zero value otherwise.
|
|
func (o *Hardware) GetCpuCount() int32 {
|
|
if o == nil || IsNil(o.CpuCount) {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
return *o.CpuCount
|
|
}
|
|
|
|
// GetCpuCountOk returns a tuple with the CpuCount field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Hardware) GetCpuCountOk() (*int32, bool) {
|
|
if o == nil || IsNil(o.CpuCount) {
|
|
return nil, false
|
|
}
|
|
return o.CpuCount, true
|
|
}
|
|
|
|
// HasCpuCount returns a boolean if a field has been set.
|
|
func (o *Hardware) HasCpuCount() bool {
|
|
if o != nil && !IsNil(o.CpuCount) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCpuCount gets a reference to the given int32 and assigns it to the CpuCount field.
|
|
func (o *Hardware) SetCpuCount(v int32) {
|
|
o.CpuCount = &v
|
|
}
|
|
|
|
// GetMemoryBytes returns the MemoryBytes field value if set, zero value otherwise.
|
|
func (o *Hardware) GetMemoryBytes() int64 {
|
|
if o == nil || IsNil(o.MemoryBytes) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.MemoryBytes
|
|
}
|
|
|
|
// GetMemoryBytesOk returns a tuple with the MemoryBytes field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Hardware) GetMemoryBytesOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.MemoryBytes) {
|
|
return nil, false
|
|
}
|
|
return o.MemoryBytes, true
|
|
}
|
|
|
|
// HasMemoryBytes returns a boolean if a field has been set.
|
|
func (o *Hardware) HasMemoryBytes() bool {
|
|
if o != nil && !IsNil(o.MemoryBytes) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMemoryBytes gets a reference to the given int64 and assigns it to the MemoryBytes field.
|
|
func (o *Hardware) SetMemoryBytes(v int64) {
|
|
o.MemoryBytes = &v
|
|
}
|
|
|
|
func (o Hardware) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o Hardware) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Model) {
|
|
toSerialize["model"] = o.Model
|
|
}
|
|
if !IsNil(o.Manufacturer) {
|
|
toSerialize["manufacturer"] = o.Manufacturer
|
|
}
|
|
toSerialize["serial"] = o.Serial
|
|
if !IsNil(o.CpuName) {
|
|
toSerialize["cpu_name"] = o.CpuName
|
|
}
|
|
if !IsNil(o.CpuCount) {
|
|
toSerialize["cpu_count"] = o.CpuCount
|
|
}
|
|
if !IsNil(o.MemoryBytes) {
|
|
toSerialize["memory_bytes"] = o.MemoryBytes
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *Hardware) 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{
|
|
"serial",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varHardware := _Hardware{}
|
|
|
|
err = json.Unmarshal(data, &varHardware)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = Hardware(varHardware)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "model")
|
|
delete(additionalProperties, "manufacturer")
|
|
delete(additionalProperties, "serial")
|
|
delete(additionalProperties, "cpu_name")
|
|
delete(additionalProperties, "cpu_count")
|
|
delete(additionalProperties, "memory_bytes")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableHardware struct {
|
|
value *Hardware
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableHardware) Get() *Hardware {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableHardware) Set(val *Hardware) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableHardware) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableHardware) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableHardware(val *Hardware) *NullableHardware {
|
|
return &NullableHardware{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableHardware) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableHardware) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|