mirror of
https://github.com/goauthentik/authentik.git
synced 2026-06-18 03:19:51 +03:00
2f70351c90
* 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>
426 lines
11 KiB
Go
Generated
426 lines
11 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 Notification type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Notification{}
|
|
|
|
// Notification Notification Serializer
|
|
type Notification struct {
|
|
Pk string `json:"pk"`
|
|
Severity SeverityEnum `json:"severity"`
|
|
Body string `json:"body"`
|
|
Hyperlink NullableString `json:"hyperlink,omitempty"`
|
|
HyperlinkLabel NullableString `json:"hyperlink_label,omitempty"`
|
|
Created time.Time `json:"created"`
|
|
Event *Event `json:"event,omitempty"`
|
|
Seen *bool `json:"seen,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _Notification Notification
|
|
|
|
// NewNotification instantiates a new Notification 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 NewNotification(pk string, severity SeverityEnum, body string, created time.Time) *Notification {
|
|
this := Notification{}
|
|
this.Pk = pk
|
|
this.Severity = severity
|
|
this.Body = body
|
|
this.Created = created
|
|
return &this
|
|
}
|
|
|
|
// NewNotificationWithDefaults instantiates a new Notification 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 NewNotificationWithDefaults() *Notification {
|
|
this := Notification{}
|
|
return &this
|
|
}
|
|
|
|
// GetPk returns the Pk field value
|
|
func (o *Notification) GetPk() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Pk
|
|
}
|
|
|
|
// GetPkOk returns a tuple with the Pk field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Notification) GetPkOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Pk, true
|
|
}
|
|
|
|
// SetPk sets field value
|
|
func (o *Notification) SetPk(v string) {
|
|
o.Pk = v
|
|
}
|
|
|
|
// GetSeverity returns the Severity field value
|
|
func (o *Notification) GetSeverity() SeverityEnum {
|
|
if o == nil {
|
|
var ret SeverityEnum
|
|
return ret
|
|
}
|
|
|
|
return o.Severity
|
|
}
|
|
|
|
// GetSeverityOk returns a tuple with the Severity field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Notification) GetSeverityOk() (*SeverityEnum, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Severity, true
|
|
}
|
|
|
|
// SetSeverity sets field value
|
|
func (o *Notification) SetSeverity(v SeverityEnum) {
|
|
o.Severity = v
|
|
}
|
|
|
|
// GetBody returns the Body field value
|
|
func (o *Notification) GetBody() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Body
|
|
}
|
|
|
|
// GetBodyOk returns a tuple with the Body field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Notification) GetBodyOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Body, true
|
|
}
|
|
|
|
// SetBody sets field value
|
|
func (o *Notification) SetBody(v string) {
|
|
o.Body = v
|
|
}
|
|
|
|
// GetHyperlink returns the Hyperlink field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *Notification) GetHyperlink() string {
|
|
if o == nil || IsNil(o.Hyperlink.Get()) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Hyperlink.Get()
|
|
}
|
|
|
|
// GetHyperlinkOk returns a tuple with the Hyperlink 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 *Notification) GetHyperlinkOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.Hyperlink.Get(), o.Hyperlink.IsSet()
|
|
}
|
|
|
|
// HasHyperlink returns a boolean if a field has been set.
|
|
func (o *Notification) HasHyperlink() bool {
|
|
if o != nil && o.Hyperlink.IsSet() {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHyperlink gets a reference to the given NullableString and assigns it to the Hyperlink field.
|
|
func (o *Notification) SetHyperlink(v string) {
|
|
o.Hyperlink.Set(&v)
|
|
}
|
|
|
|
// SetHyperlinkNil sets the value for Hyperlink to be an explicit nil
|
|
func (o *Notification) SetHyperlinkNil() {
|
|
o.Hyperlink.Set(nil)
|
|
}
|
|
|
|
// UnsetHyperlink ensures that no value is present for Hyperlink, not even an explicit nil
|
|
func (o *Notification) UnsetHyperlink() {
|
|
o.Hyperlink.Unset()
|
|
}
|
|
|
|
// GetHyperlinkLabel returns the HyperlinkLabel field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *Notification) GetHyperlinkLabel() string {
|
|
if o == nil || IsNil(o.HyperlinkLabel.Get()) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.HyperlinkLabel.Get()
|
|
}
|
|
|
|
// GetHyperlinkLabelOk returns a tuple with the HyperlinkLabel 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 *Notification) GetHyperlinkLabelOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.HyperlinkLabel.Get(), o.HyperlinkLabel.IsSet()
|
|
}
|
|
|
|
// HasHyperlinkLabel returns a boolean if a field has been set.
|
|
func (o *Notification) HasHyperlinkLabel() bool {
|
|
if o != nil && o.HyperlinkLabel.IsSet() {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHyperlinkLabel gets a reference to the given NullableString and assigns it to the HyperlinkLabel field.
|
|
func (o *Notification) SetHyperlinkLabel(v string) {
|
|
o.HyperlinkLabel.Set(&v)
|
|
}
|
|
|
|
// SetHyperlinkLabelNil sets the value for HyperlinkLabel to be an explicit nil
|
|
func (o *Notification) SetHyperlinkLabelNil() {
|
|
o.HyperlinkLabel.Set(nil)
|
|
}
|
|
|
|
// UnsetHyperlinkLabel ensures that no value is present for HyperlinkLabel, not even an explicit nil
|
|
func (o *Notification) UnsetHyperlinkLabel() {
|
|
o.HyperlinkLabel.Unset()
|
|
}
|
|
|
|
// GetCreated returns the Created field value
|
|
func (o *Notification) GetCreated() time.Time {
|
|
if o == nil {
|
|
var ret time.Time
|
|
return ret
|
|
}
|
|
|
|
return o.Created
|
|
}
|
|
|
|
// GetCreatedOk returns a tuple with the Created field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Notification) GetCreatedOk() (*time.Time, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Created, true
|
|
}
|
|
|
|
// SetCreated sets field value
|
|
func (o *Notification) SetCreated(v time.Time) {
|
|
o.Created = v
|
|
}
|
|
|
|
// GetEvent returns the Event field value if set, zero value otherwise.
|
|
func (o *Notification) GetEvent() Event {
|
|
if o == nil || IsNil(o.Event) {
|
|
var ret Event
|
|
return ret
|
|
}
|
|
return *o.Event
|
|
}
|
|
|
|
// GetEventOk returns a tuple with the Event field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Notification) GetEventOk() (*Event, bool) {
|
|
if o == nil || IsNil(o.Event) {
|
|
return nil, false
|
|
}
|
|
return o.Event, true
|
|
}
|
|
|
|
// HasEvent returns a boolean if a field has been set.
|
|
func (o *Notification) HasEvent() bool {
|
|
if o != nil && !IsNil(o.Event) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetEvent gets a reference to the given Event and assigns it to the Event field.
|
|
func (o *Notification) SetEvent(v Event) {
|
|
o.Event = &v
|
|
}
|
|
|
|
// GetSeen returns the Seen field value if set, zero value otherwise.
|
|
func (o *Notification) GetSeen() bool {
|
|
if o == nil || IsNil(o.Seen) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Seen
|
|
}
|
|
|
|
// GetSeenOk returns a tuple with the Seen field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Notification) GetSeenOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Seen) {
|
|
return nil, false
|
|
}
|
|
return o.Seen, true
|
|
}
|
|
|
|
// HasSeen returns a boolean if a field has been set.
|
|
func (o *Notification) HasSeen() bool {
|
|
if o != nil && !IsNil(o.Seen) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSeen gets a reference to the given bool and assigns it to the Seen field.
|
|
func (o *Notification) SetSeen(v bool) {
|
|
o.Seen = &v
|
|
}
|
|
|
|
func (o Notification) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o Notification) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["pk"] = o.Pk
|
|
toSerialize["severity"] = o.Severity
|
|
toSerialize["body"] = o.Body
|
|
if o.Hyperlink.IsSet() {
|
|
toSerialize["hyperlink"] = o.Hyperlink.Get()
|
|
}
|
|
if o.HyperlinkLabel.IsSet() {
|
|
toSerialize["hyperlink_label"] = o.HyperlinkLabel.Get()
|
|
}
|
|
toSerialize["created"] = o.Created
|
|
if !IsNil(o.Event) {
|
|
toSerialize["event"] = o.Event
|
|
}
|
|
if !IsNil(o.Seen) {
|
|
toSerialize["seen"] = o.Seen
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *Notification) 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{
|
|
"pk",
|
|
"severity",
|
|
"body",
|
|
"created",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varNotification := _Notification{}
|
|
|
|
err = json.Unmarshal(data, &varNotification)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = Notification(varNotification)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "pk")
|
|
delete(additionalProperties, "severity")
|
|
delete(additionalProperties, "body")
|
|
delete(additionalProperties, "hyperlink")
|
|
delete(additionalProperties, "hyperlink_label")
|
|
delete(additionalProperties, "created")
|
|
delete(additionalProperties, "event")
|
|
delete(additionalProperties, "seen")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableNotification struct {
|
|
value *Notification
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableNotification) Get() *Notification {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableNotification) Set(val *Notification) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableNotification) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableNotification) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableNotification(val *Notification) *NullableNotification {
|
|
return &NullableNotification{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableNotification) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableNotification) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|