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

271 lines
6.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 Network type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Network{}
// Network struct for Network
type Network struct {
Hostname string `json:"hostname"`
FirewallEnabled *bool `json:"firewall_enabled,omitempty"`
Interfaces []NetworkInterface `json:"interfaces"`
Gateway *string `json:"gateway,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Network Network
// NewNetwork instantiates a new Network 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 NewNetwork(hostname string, interfaces []NetworkInterface) *Network {
this := Network{}
this.Hostname = hostname
this.Interfaces = interfaces
return &this
}
// NewNetworkWithDefaults instantiates a new Network 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 NewNetworkWithDefaults() *Network {
this := Network{}
return &this
}
// GetHostname returns the Hostname field value
func (o *Network) GetHostname() string {
if o == nil {
var ret string
return ret
}
return o.Hostname
}
// GetHostnameOk returns a tuple with the Hostname field value
// and a boolean to check if the value has been set.
func (o *Network) GetHostnameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Hostname, true
}
// SetHostname sets field value
func (o *Network) SetHostname(v string) {
o.Hostname = v
}
// GetFirewallEnabled returns the FirewallEnabled field value if set, zero value otherwise.
func (o *Network) GetFirewallEnabled() bool {
if o == nil || IsNil(o.FirewallEnabled) {
var ret bool
return ret
}
return *o.FirewallEnabled
}
// GetFirewallEnabledOk returns a tuple with the FirewallEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Network) GetFirewallEnabledOk() (*bool, bool) {
if o == nil || IsNil(o.FirewallEnabled) {
return nil, false
}
return o.FirewallEnabled, true
}
// HasFirewallEnabled returns a boolean if a field has been set.
func (o *Network) HasFirewallEnabled() bool {
if o != nil && !IsNil(o.FirewallEnabled) {
return true
}
return false
}
// SetFirewallEnabled gets a reference to the given bool and assigns it to the FirewallEnabled field.
func (o *Network) SetFirewallEnabled(v bool) {
o.FirewallEnabled = &v
}
// GetInterfaces returns the Interfaces field value
func (o *Network) GetInterfaces() []NetworkInterface {
if o == nil {
var ret []NetworkInterface
return ret
}
return o.Interfaces
}
// GetInterfacesOk returns a tuple with the Interfaces field value
// and a boolean to check if the value has been set.
func (o *Network) GetInterfacesOk() ([]NetworkInterface, bool) {
if o == nil {
return nil, false
}
return o.Interfaces, true
}
// SetInterfaces sets field value
func (o *Network) SetInterfaces(v []NetworkInterface) {
o.Interfaces = v
}
// GetGateway returns the Gateway field value if set, zero value otherwise.
func (o *Network) GetGateway() string {
if o == nil || IsNil(o.Gateway) {
var ret string
return ret
}
return *o.Gateway
}
// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Network) GetGatewayOk() (*string, bool) {
if o == nil || IsNil(o.Gateway) {
return nil, false
}
return o.Gateway, true
}
// HasGateway returns a boolean if a field has been set.
func (o *Network) HasGateway() bool {
if o != nil && !IsNil(o.Gateway) {
return true
}
return false
}
// SetGateway gets a reference to the given string and assigns it to the Gateway field.
func (o *Network) SetGateway(v string) {
o.Gateway = &v
}
func (o Network) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Network) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["hostname"] = o.Hostname
if !IsNil(o.FirewallEnabled) {
toSerialize["firewall_enabled"] = o.FirewallEnabled
}
toSerialize["interfaces"] = o.Interfaces
if !IsNil(o.Gateway) {
toSerialize["gateway"] = o.Gateway
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Network) 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{
"hostname",
"interfaces",
}
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)
}
}
varNetwork := _Network{}
err = json.Unmarshal(data, &varNetwork)
if err != nil {
return err
}
*o = Network(varNetwork)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "hostname")
delete(additionalProperties, "firewall_enabled")
delete(additionalProperties, "interfaces")
delete(additionalProperties, "gateway")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableNetwork struct {
value *Network
isSet bool
}
func (v NullableNetwork) Get() *Network {
return v.value
}
func (v *NullableNetwork) Set(val *Network) {
v.value = val
v.isSet = true
}
func (v NullableNetwork) IsSet() bool {
return v.isSet
}
func (v *NullableNetwork) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNetwork(val *Network) *NullableNetwork {
return &NullableNetwork{value: val, isSet: true}
}
func (v NullableNetwork) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNetwork) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}