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

349 lines
9.1 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 DiskRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DiskRequest{}
// DiskRequest struct for DiskRequest
type DiskRequest struct {
Name string `json:"name"`
Mountpoint string `json:"mountpoint"`
Label *string `json:"label,omitempty"`
CapacityTotalBytes *int64 `json:"capacity_total_bytes,omitempty"`
CapacityUsedBytes *int64 `json:"capacity_used_bytes,omitempty"`
EncryptionEnabled *bool `json:"encryption_enabled,omitempty"`
AdditionalProperties map[string]interface{}
}
type _DiskRequest DiskRequest
// NewDiskRequest instantiates a new DiskRequest 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 NewDiskRequest(name string, mountpoint string) *DiskRequest {
this := DiskRequest{}
this.Name = name
this.Mountpoint = mountpoint
var encryptionEnabled bool = false
this.EncryptionEnabled = &encryptionEnabled
return &this
}
// NewDiskRequestWithDefaults instantiates a new DiskRequest 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 NewDiskRequestWithDefaults() *DiskRequest {
this := DiskRequest{}
var encryptionEnabled bool = false
this.EncryptionEnabled = &encryptionEnabled
return &this
}
// GetName returns the Name field value
func (o *DiskRequest) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *DiskRequest) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *DiskRequest) SetName(v string) {
o.Name = v
}
// GetMountpoint returns the Mountpoint field value
func (o *DiskRequest) GetMountpoint() string {
if o == nil {
var ret string
return ret
}
return o.Mountpoint
}
// GetMountpointOk returns a tuple with the Mountpoint field value
// and a boolean to check if the value has been set.
func (o *DiskRequest) GetMountpointOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Mountpoint, true
}
// SetMountpoint sets field value
func (o *DiskRequest) SetMountpoint(v string) {
o.Mountpoint = v
}
// GetLabel returns the Label field value if set, zero value otherwise.
func (o *DiskRequest) GetLabel() string {
if o == nil || IsNil(o.Label) {
var ret string
return ret
}
return *o.Label
}
// GetLabelOk returns a tuple with the Label field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskRequest) GetLabelOk() (*string, bool) {
if o == nil || IsNil(o.Label) {
return nil, false
}
return o.Label, true
}
// HasLabel returns a boolean if a field has been set.
func (o *DiskRequest) HasLabel() bool {
if o != nil && !IsNil(o.Label) {
return true
}
return false
}
// SetLabel gets a reference to the given string and assigns it to the Label field.
func (o *DiskRequest) SetLabel(v string) {
o.Label = &v
}
// GetCapacityTotalBytes returns the CapacityTotalBytes field value if set, zero value otherwise.
func (o *DiskRequest) GetCapacityTotalBytes() int64 {
if o == nil || IsNil(o.CapacityTotalBytes) {
var ret int64
return ret
}
return *o.CapacityTotalBytes
}
// GetCapacityTotalBytesOk returns a tuple with the CapacityTotalBytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskRequest) GetCapacityTotalBytesOk() (*int64, bool) {
if o == nil || IsNil(o.CapacityTotalBytes) {
return nil, false
}
return o.CapacityTotalBytes, true
}
// HasCapacityTotalBytes returns a boolean if a field has been set.
func (o *DiskRequest) HasCapacityTotalBytes() bool {
if o != nil && !IsNil(o.CapacityTotalBytes) {
return true
}
return false
}
// SetCapacityTotalBytes gets a reference to the given int64 and assigns it to the CapacityTotalBytes field.
func (o *DiskRequest) SetCapacityTotalBytes(v int64) {
o.CapacityTotalBytes = &v
}
// GetCapacityUsedBytes returns the CapacityUsedBytes field value if set, zero value otherwise.
func (o *DiskRequest) GetCapacityUsedBytes() int64 {
if o == nil || IsNil(o.CapacityUsedBytes) {
var ret int64
return ret
}
return *o.CapacityUsedBytes
}
// GetCapacityUsedBytesOk returns a tuple with the CapacityUsedBytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskRequest) GetCapacityUsedBytesOk() (*int64, bool) {
if o == nil || IsNil(o.CapacityUsedBytes) {
return nil, false
}
return o.CapacityUsedBytes, true
}
// HasCapacityUsedBytes returns a boolean if a field has been set.
func (o *DiskRequest) HasCapacityUsedBytes() bool {
if o != nil && !IsNil(o.CapacityUsedBytes) {
return true
}
return false
}
// SetCapacityUsedBytes gets a reference to the given int64 and assigns it to the CapacityUsedBytes field.
func (o *DiskRequest) SetCapacityUsedBytes(v int64) {
o.CapacityUsedBytes = &v
}
// GetEncryptionEnabled returns the EncryptionEnabled field value if set, zero value otherwise.
func (o *DiskRequest) GetEncryptionEnabled() bool {
if o == nil || IsNil(o.EncryptionEnabled) {
var ret bool
return ret
}
return *o.EncryptionEnabled
}
// GetEncryptionEnabledOk returns a tuple with the EncryptionEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DiskRequest) GetEncryptionEnabledOk() (*bool, bool) {
if o == nil || IsNil(o.EncryptionEnabled) {
return nil, false
}
return o.EncryptionEnabled, true
}
// HasEncryptionEnabled returns a boolean if a field has been set.
func (o *DiskRequest) HasEncryptionEnabled() bool {
if o != nil && !IsNil(o.EncryptionEnabled) {
return true
}
return false
}
// SetEncryptionEnabled gets a reference to the given bool and assigns it to the EncryptionEnabled field.
func (o *DiskRequest) SetEncryptionEnabled(v bool) {
o.EncryptionEnabled = &v
}
func (o DiskRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DiskRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["name"] = o.Name
toSerialize["mountpoint"] = o.Mountpoint
if !IsNil(o.Label) {
toSerialize["label"] = o.Label
}
if !IsNil(o.CapacityTotalBytes) {
toSerialize["capacity_total_bytes"] = o.CapacityTotalBytes
}
if !IsNil(o.CapacityUsedBytes) {
toSerialize["capacity_used_bytes"] = o.CapacityUsedBytes
}
if !IsNil(o.EncryptionEnabled) {
toSerialize["encryption_enabled"] = o.EncryptionEnabled
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *DiskRequest) 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{
"name",
"mountpoint",
}
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)
}
}
varDiskRequest := _DiskRequest{}
err = json.Unmarshal(data, &varDiskRequest)
if err != nil {
return err
}
*o = DiskRequest(varDiskRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "name")
delete(additionalProperties, "mountpoint")
delete(additionalProperties, "label")
delete(additionalProperties, "capacity_total_bytes")
delete(additionalProperties, "capacity_used_bytes")
delete(additionalProperties, "encryption_enabled")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableDiskRequest struct {
value *DiskRequest
isSet bool
}
func (v NullableDiskRequest) Get() *DiskRequest {
return v.value
}
func (v *NullableDiskRequest) Set(val *DiskRequest) {
v.value = val
v.isSet = true
}
func (v NullableDiskRequest) IsSet() bool {
return v.isSet
}
func (v *NullableDiskRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDiskRequest(val *DiskRequest) *NullableDiskRequest {
return &NullableDiskRequest{value: val, isSet: true}
}
func (v NullableDiskRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDiskRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}