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

353 lines
9.0 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 HardwareRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &HardwareRequest{}
// HardwareRequest struct for HardwareRequest
type HardwareRequest 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 _HardwareRequest HardwareRequest
// NewHardwareRequest instantiates a new HardwareRequest 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 NewHardwareRequest(serial string) *HardwareRequest {
this := HardwareRequest{}
this.Serial = serial
return &this
}
// NewHardwareRequestWithDefaults instantiates a new HardwareRequest 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 NewHardwareRequestWithDefaults() *HardwareRequest {
this := HardwareRequest{}
return &this
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *HardwareRequest) 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 *HardwareRequest) 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 *HardwareRequest) 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 *HardwareRequest) SetModel(v string) {
o.Model = &v
}
// GetManufacturer returns the Manufacturer field value if set, zero value otherwise.
func (o *HardwareRequest) 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 *HardwareRequest) 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 *HardwareRequest) 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 *HardwareRequest) SetManufacturer(v string) {
o.Manufacturer = &v
}
// GetSerial returns the Serial field value
func (o *HardwareRequest) 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 *HardwareRequest) GetSerialOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Serial, true
}
// SetSerial sets field value
func (o *HardwareRequest) SetSerial(v string) {
o.Serial = v
}
// GetCpuName returns the CpuName field value if set, zero value otherwise.
func (o *HardwareRequest) 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 *HardwareRequest) 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 *HardwareRequest) 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 *HardwareRequest) SetCpuName(v string) {
o.CpuName = &v
}
// GetCpuCount returns the CpuCount field value if set, zero value otherwise.
func (o *HardwareRequest) 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 *HardwareRequest) 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 *HardwareRequest) 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 *HardwareRequest) SetCpuCount(v int32) {
o.CpuCount = &v
}
// GetMemoryBytes returns the MemoryBytes field value if set, zero value otherwise.
func (o *HardwareRequest) 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 *HardwareRequest) 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 *HardwareRequest) 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 *HardwareRequest) SetMemoryBytes(v int64) {
o.MemoryBytes = &v
}
func (o HardwareRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o HardwareRequest) 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 *HardwareRequest) 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)
}
}
varHardwareRequest := _HardwareRequest{}
err = json.Unmarshal(data, &varHardwareRequest)
if err != nil {
return err
}
*o = HardwareRequest(varHardwareRequest)
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 NullableHardwareRequest struct {
value *HardwareRequest
isSet bool
}
func (v NullableHardwareRequest) Get() *HardwareRequest {
return v.value
}
func (v *NullableHardwareRequest) Set(val *HardwareRequest) {
v.value = val
v.isSet = true
}
func (v NullableHardwareRequest) IsSet() bool {
return v.isSet
}
func (v *NullableHardwareRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableHardwareRequest(val *HardwareRequest) *NullableHardwareRequest {
return &NullableHardwareRequest{value: val, isSet: true}
}
func (v NullableHardwareRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableHardwareRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}