/* 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 ProcessRequest type satisfies the MappedNullable interface at compile time var _ MappedNullable = &ProcessRequest{} // ProcessRequest struct for ProcessRequest type ProcessRequest struct { Id int32 `json:"id"` Name string `json:"name"` User *string `json:"user,omitempty"` AdditionalProperties map[string]interface{} } type _ProcessRequest ProcessRequest // NewProcessRequest instantiates a new ProcessRequest 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 NewProcessRequest(id int32, name string) *ProcessRequest { this := ProcessRequest{} this.Id = id this.Name = name return &this } // NewProcessRequestWithDefaults instantiates a new ProcessRequest 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 NewProcessRequestWithDefaults() *ProcessRequest { this := ProcessRequest{} return &this } // GetId returns the Id field value func (o *ProcessRequest) GetId() int32 { if o == nil { var ret int32 return ret } return o.Id } // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. func (o *ProcessRequest) GetIdOk() (*int32, bool) { if o == nil { return nil, false } return &o.Id, true } // SetId sets field value func (o *ProcessRequest) SetId(v int32) { o.Id = v } // GetName returns the Name field value func (o *ProcessRequest) 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 *ProcessRequest) GetNameOk() (*string, bool) { if o == nil { return nil, false } return &o.Name, true } // SetName sets field value func (o *ProcessRequest) SetName(v string) { o.Name = v } // GetUser returns the User field value if set, zero value otherwise. func (o *ProcessRequest) GetUser() string { if o == nil || IsNil(o.User) { var ret string return ret } return *o.User } // GetUserOk returns a tuple with the User field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ProcessRequest) GetUserOk() (*string, bool) { if o == nil || IsNil(o.User) { return nil, false } return o.User, true } // HasUser returns a boolean if a field has been set. func (o *ProcessRequest) HasUser() bool { if o != nil && !IsNil(o.User) { return true } return false } // SetUser gets a reference to the given string and assigns it to the User field. func (o *ProcessRequest) SetUser(v string) { o.User = &v } func (o ProcessRequest) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o ProcessRequest) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} toSerialize["id"] = o.Id toSerialize["name"] = o.Name if !IsNil(o.User) { toSerialize["user"] = o.User } for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *ProcessRequest) 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{ "id", "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) } } varProcessRequest := _ProcessRequest{} err = json.Unmarshal(data, &varProcessRequest) if err != nil { return err } *o = ProcessRequest(varProcessRequest) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "id") delete(additionalProperties, "name") delete(additionalProperties, "user") o.AdditionalProperties = additionalProperties } return err } type NullableProcessRequest struct { value *ProcessRequest isSet bool } func (v NullableProcessRequest) Get() *ProcessRequest { return v.value } func (v *NullableProcessRequest) Set(val *ProcessRequest) { v.value = val v.isSet = true } func (v NullableProcessRequest) IsSet() bool { return v.isSet } func (v *NullableProcessRequest) Unset() { v.value = nil v.isSet = false } func NewNullableProcessRequest(val *ProcessRequest) *NullableProcessRequest { return &NullableProcessRequest{value: val, isSet: true} } func (v NullableProcessRequest) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableProcessRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }