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

271 lines
6.9 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 NetworkRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &NetworkRequest{}
// NetworkRequest struct for NetworkRequest
type NetworkRequest struct {
Hostname string `json:"hostname"`
FirewallEnabled *bool `json:"firewall_enabled,omitempty"`
Interfaces []NetworkInterfaceRequest `json:"interfaces"`
Gateway *string `json:"gateway,omitempty"`
AdditionalProperties map[string]interface{}
}
type _NetworkRequest NetworkRequest
// NewNetworkRequest instantiates a new NetworkRequest 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 NewNetworkRequest(hostname string, interfaces []NetworkInterfaceRequest) *NetworkRequest {
this := NetworkRequest{}
this.Hostname = hostname
this.Interfaces = interfaces
return &this
}
// NewNetworkRequestWithDefaults instantiates a new NetworkRequest 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 NewNetworkRequestWithDefaults() *NetworkRequest {
this := NetworkRequest{}
return &this
}
// GetHostname returns the Hostname field value
func (o *NetworkRequest) 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 *NetworkRequest) GetHostnameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Hostname, true
}
// SetHostname sets field value
func (o *NetworkRequest) SetHostname(v string) {
o.Hostname = v
}
// GetFirewallEnabled returns the FirewallEnabled field value if set, zero value otherwise.
func (o *NetworkRequest) 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 *NetworkRequest) 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 *NetworkRequest) 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 *NetworkRequest) SetFirewallEnabled(v bool) {
o.FirewallEnabled = &v
}
// GetInterfaces returns the Interfaces field value
func (o *NetworkRequest) GetInterfaces() []NetworkInterfaceRequest {
if o == nil {
var ret []NetworkInterfaceRequest
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 *NetworkRequest) GetInterfacesOk() ([]NetworkInterfaceRequest, bool) {
if o == nil {
return nil, false
}
return o.Interfaces, true
}
// SetInterfaces sets field value
func (o *NetworkRequest) SetInterfaces(v []NetworkInterfaceRequest) {
o.Interfaces = v
}
// GetGateway returns the Gateway field value if set, zero value otherwise.
func (o *NetworkRequest) 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 *NetworkRequest) 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 *NetworkRequest) 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 *NetworkRequest) SetGateway(v string) {
o.Gateway = &v
}
func (o NetworkRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o NetworkRequest) 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 *NetworkRequest) 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)
}
}
varNetworkRequest := _NetworkRequest{}
err = json.Unmarshal(data, &varNetworkRequest)
if err != nil {
return err
}
*o = NetworkRequest(varNetworkRequest)
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 NullableNetworkRequest struct {
value *NetworkRequest
isSet bool
}
func (v NullableNetworkRequest) Get() *NetworkRequest {
return v.value
}
func (v *NullableNetworkRequest) Set(val *NetworkRequest) {
v.value = val
v.isSet = true
}
func (v NullableNetworkRequest) IsSet() bool {
return v.isSet
}
func (v *NullableNetworkRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNetworkRequest(val *NetworkRequest) *NullableNetworkRequest {
return &NullableNetworkRequest{value: val, isSet: true}
}
func (v NullableNetworkRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNetworkRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}