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

331 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"
"time"
)
// checks if the EnrollmentTokenRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EnrollmentTokenRequest{}
// EnrollmentTokenRequest struct for EnrollmentTokenRequest
type EnrollmentTokenRequest struct {
DeviceGroup NullableString `json:"device_group,omitempty"`
Connector string `json:"connector"`
Name string `json:"name"`
Expiring *bool `json:"expiring,omitempty"`
Expires NullableTime `json:"expires,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EnrollmentTokenRequest EnrollmentTokenRequest
// NewEnrollmentTokenRequest instantiates a new EnrollmentTokenRequest 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 NewEnrollmentTokenRequest(connector string, name string) *EnrollmentTokenRequest {
this := EnrollmentTokenRequest{}
this.Connector = connector
this.Name = name
return &this
}
// NewEnrollmentTokenRequestWithDefaults instantiates a new EnrollmentTokenRequest 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 NewEnrollmentTokenRequestWithDefaults() *EnrollmentTokenRequest {
this := EnrollmentTokenRequest{}
return &this
}
// GetDeviceGroup returns the DeviceGroup field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EnrollmentTokenRequest) GetDeviceGroup() string {
if o == nil || IsNil(o.DeviceGroup.Get()) {
var ret string
return ret
}
return *o.DeviceGroup.Get()
}
// GetDeviceGroupOk returns a tuple with the DeviceGroup field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EnrollmentTokenRequest) GetDeviceGroupOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.DeviceGroup.Get(), o.DeviceGroup.IsSet()
}
// HasDeviceGroup returns a boolean if a field has been set.
func (o *EnrollmentTokenRequest) HasDeviceGroup() bool {
if o != nil && o.DeviceGroup.IsSet() {
return true
}
return false
}
// SetDeviceGroup gets a reference to the given NullableString and assigns it to the DeviceGroup field.
func (o *EnrollmentTokenRequest) SetDeviceGroup(v string) {
o.DeviceGroup.Set(&v)
}
// SetDeviceGroupNil sets the value for DeviceGroup to be an explicit nil
func (o *EnrollmentTokenRequest) SetDeviceGroupNil() {
o.DeviceGroup.Set(nil)
}
// UnsetDeviceGroup ensures that no value is present for DeviceGroup, not even an explicit nil
func (o *EnrollmentTokenRequest) UnsetDeviceGroup() {
o.DeviceGroup.Unset()
}
// GetConnector returns the Connector field value
func (o *EnrollmentTokenRequest) GetConnector() string {
if o == nil {
var ret string
return ret
}
return o.Connector
}
// GetConnectorOk returns a tuple with the Connector field value
// and a boolean to check if the value has been set.
func (o *EnrollmentTokenRequest) GetConnectorOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Connector, true
}
// SetConnector sets field value
func (o *EnrollmentTokenRequest) SetConnector(v string) {
o.Connector = v
}
// GetName returns the Name field value
func (o *EnrollmentTokenRequest) 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 *EnrollmentTokenRequest) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *EnrollmentTokenRequest) SetName(v string) {
o.Name = v
}
// GetExpiring returns the Expiring field value if set, zero value otherwise.
func (o *EnrollmentTokenRequest) GetExpiring() bool {
if o == nil || IsNil(o.Expiring) {
var ret bool
return ret
}
return *o.Expiring
}
// GetExpiringOk returns a tuple with the Expiring field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EnrollmentTokenRequest) GetExpiringOk() (*bool, bool) {
if o == nil || IsNil(o.Expiring) {
return nil, false
}
return o.Expiring, true
}
// HasExpiring returns a boolean if a field has been set.
func (o *EnrollmentTokenRequest) HasExpiring() bool {
if o != nil && !IsNil(o.Expiring) {
return true
}
return false
}
// SetExpiring gets a reference to the given bool and assigns it to the Expiring field.
func (o *EnrollmentTokenRequest) SetExpiring(v bool) {
o.Expiring = &v
}
// GetExpires returns the Expires field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EnrollmentTokenRequest) GetExpires() time.Time {
if o == nil || IsNil(o.Expires.Get()) {
var ret time.Time
return ret
}
return *o.Expires.Get()
}
// GetExpiresOk returns a tuple with the Expires field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *EnrollmentTokenRequest) GetExpiresOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.Expires.Get(), o.Expires.IsSet()
}
// HasExpires returns a boolean if a field has been set.
func (o *EnrollmentTokenRequest) HasExpires() bool {
if o != nil && o.Expires.IsSet() {
return true
}
return false
}
// SetExpires gets a reference to the given NullableTime and assigns it to the Expires field.
func (o *EnrollmentTokenRequest) SetExpires(v time.Time) {
o.Expires.Set(&v)
}
// SetExpiresNil sets the value for Expires to be an explicit nil
func (o *EnrollmentTokenRequest) SetExpiresNil() {
o.Expires.Set(nil)
}
// UnsetExpires ensures that no value is present for Expires, not even an explicit nil
func (o *EnrollmentTokenRequest) UnsetExpires() {
o.Expires.Unset()
}
func (o EnrollmentTokenRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EnrollmentTokenRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.DeviceGroup.IsSet() {
toSerialize["device_group"] = o.DeviceGroup.Get()
}
toSerialize["connector"] = o.Connector
toSerialize["name"] = o.Name
if !IsNil(o.Expiring) {
toSerialize["expiring"] = o.Expiring
}
if o.Expires.IsSet() {
toSerialize["expires"] = o.Expires.Get()
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EnrollmentTokenRequest) 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{
"connector",
"name",
}
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)
}
}
varEnrollmentTokenRequest := _EnrollmentTokenRequest{}
err = json.Unmarshal(data, &varEnrollmentTokenRequest)
if err != nil {
return err
}
*o = EnrollmentTokenRequest(varEnrollmentTokenRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "device_group")
delete(additionalProperties, "connector")
delete(additionalProperties, "name")
delete(additionalProperties, "expiring")
delete(additionalProperties, "expires")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEnrollmentTokenRequest struct {
value *EnrollmentTokenRequest
isSet bool
}
func (v NullableEnrollmentTokenRequest) Get() *EnrollmentTokenRequest {
return v.value
}
func (v *NullableEnrollmentTokenRequest) Set(val *EnrollmentTokenRequest) {
v.value = val
v.isSet = true
}
func (v NullableEnrollmentTokenRequest) IsSet() bool {
return v.isSet
}
func (v *NullableEnrollmentTokenRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEnrollmentTokenRequest(val *EnrollmentTokenRequest) *NullableEnrollmentTokenRequest {
return &NullableEnrollmentTokenRequest{value: val, isSet: true}
}
func (v NullableEnrollmentTokenRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEnrollmentTokenRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}