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>
331 lines
9.8 KiB
Go
Generated
331 lines
9.8 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 NotificationRuleRequest type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &NotificationRuleRequest{}
|
|
|
|
// NotificationRuleRequest NotificationRule Serializer
|
|
type NotificationRuleRequest struct {
|
|
Name string `json:"name"`
|
|
// Select which transports should be used to notify the user. If none are selected, the notification will only be shown in the authentik UI.
|
|
Transports []string `json:"transports,omitempty"`
|
|
// Controls which severity level the created notifications will have.
|
|
Severity *SeverityEnum `json:"severity,omitempty"`
|
|
// Define which group of users this notification should be sent and shown to. If left empty, Notification won't ben sent.
|
|
DestinationGroup NullableString `json:"destination_group,omitempty"`
|
|
// When enabled, notification will be sent to user the user that triggered the event.When destination_group is configured, notification is sent to both.
|
|
DestinationEventUser *bool `json:"destination_event_user,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _NotificationRuleRequest NotificationRuleRequest
|
|
|
|
// NewNotificationRuleRequest instantiates a new NotificationRuleRequest 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 NewNotificationRuleRequest(name string) *NotificationRuleRequest {
|
|
this := NotificationRuleRequest{}
|
|
this.Name = name
|
|
return &this
|
|
}
|
|
|
|
// NewNotificationRuleRequestWithDefaults instantiates a new NotificationRuleRequest 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 NewNotificationRuleRequestWithDefaults() *NotificationRuleRequest {
|
|
this := NotificationRuleRequest{}
|
|
return &this
|
|
}
|
|
|
|
// GetName returns the Name field value
|
|
func (o *NotificationRuleRequest) 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 *NotificationRuleRequest) GetNameOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Name, true
|
|
}
|
|
|
|
// SetName sets field value
|
|
func (o *NotificationRuleRequest) SetName(v string) {
|
|
o.Name = v
|
|
}
|
|
|
|
// GetTransports returns the Transports field value if set, zero value otherwise.
|
|
func (o *NotificationRuleRequest) GetTransports() []string {
|
|
if o == nil || IsNil(o.Transports) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Transports
|
|
}
|
|
|
|
// GetTransportsOk returns a tuple with the Transports field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *NotificationRuleRequest) GetTransportsOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Transports) {
|
|
return nil, false
|
|
}
|
|
return o.Transports, true
|
|
}
|
|
|
|
// HasTransports returns a boolean if a field has been set.
|
|
func (o *NotificationRuleRequest) HasTransports() bool {
|
|
if o != nil && !IsNil(o.Transports) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetTransports gets a reference to the given []string and assigns it to the Transports field.
|
|
func (o *NotificationRuleRequest) SetTransports(v []string) {
|
|
o.Transports = v
|
|
}
|
|
|
|
// GetSeverity returns the Severity field value if set, zero value otherwise.
|
|
func (o *NotificationRuleRequest) GetSeverity() SeverityEnum {
|
|
if o == nil || IsNil(o.Severity) {
|
|
var ret SeverityEnum
|
|
return ret
|
|
}
|
|
return *o.Severity
|
|
}
|
|
|
|
// GetSeverityOk returns a tuple with the Severity field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *NotificationRuleRequest) GetSeverityOk() (*SeverityEnum, bool) {
|
|
if o == nil || IsNil(o.Severity) {
|
|
return nil, false
|
|
}
|
|
return o.Severity, true
|
|
}
|
|
|
|
// HasSeverity returns a boolean if a field has been set.
|
|
func (o *NotificationRuleRequest) HasSeverity() bool {
|
|
if o != nil && !IsNil(o.Severity) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSeverity gets a reference to the given SeverityEnum and assigns it to the Severity field.
|
|
func (o *NotificationRuleRequest) SetSeverity(v SeverityEnum) {
|
|
o.Severity = &v
|
|
}
|
|
|
|
// GetDestinationGroup returns the DestinationGroup field value if set, zero value otherwise (both if not set or set to explicit null).
|
|
func (o *NotificationRuleRequest) GetDestinationGroup() string {
|
|
if o == nil || IsNil(o.DestinationGroup.Get()) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.DestinationGroup.Get()
|
|
}
|
|
|
|
// GetDestinationGroupOk returns a tuple with the DestinationGroup 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 *NotificationRuleRequest) GetDestinationGroupOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return o.DestinationGroup.Get(), o.DestinationGroup.IsSet()
|
|
}
|
|
|
|
// HasDestinationGroup returns a boolean if a field has been set.
|
|
func (o *NotificationRuleRequest) HasDestinationGroup() bool {
|
|
if o != nil && o.DestinationGroup.IsSet() {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDestinationGroup gets a reference to the given NullableString and assigns it to the DestinationGroup field.
|
|
func (o *NotificationRuleRequest) SetDestinationGroup(v string) {
|
|
o.DestinationGroup.Set(&v)
|
|
}
|
|
|
|
// SetDestinationGroupNil sets the value for DestinationGroup to be an explicit nil
|
|
func (o *NotificationRuleRequest) SetDestinationGroupNil() {
|
|
o.DestinationGroup.Set(nil)
|
|
}
|
|
|
|
// UnsetDestinationGroup ensures that no value is present for DestinationGroup, not even an explicit nil
|
|
func (o *NotificationRuleRequest) UnsetDestinationGroup() {
|
|
o.DestinationGroup.Unset()
|
|
}
|
|
|
|
// GetDestinationEventUser returns the DestinationEventUser field value if set, zero value otherwise.
|
|
func (o *NotificationRuleRequest) GetDestinationEventUser() bool {
|
|
if o == nil || IsNil(o.DestinationEventUser) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.DestinationEventUser
|
|
}
|
|
|
|
// GetDestinationEventUserOk returns a tuple with the DestinationEventUser field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *NotificationRuleRequest) GetDestinationEventUserOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.DestinationEventUser) {
|
|
return nil, false
|
|
}
|
|
return o.DestinationEventUser, true
|
|
}
|
|
|
|
// HasDestinationEventUser returns a boolean if a field has been set.
|
|
func (o *NotificationRuleRequest) HasDestinationEventUser() bool {
|
|
if o != nil && !IsNil(o.DestinationEventUser) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDestinationEventUser gets a reference to the given bool and assigns it to the DestinationEventUser field.
|
|
func (o *NotificationRuleRequest) SetDestinationEventUser(v bool) {
|
|
o.DestinationEventUser = &v
|
|
}
|
|
|
|
func (o NotificationRuleRequest) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o NotificationRuleRequest) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["name"] = o.Name
|
|
if !IsNil(o.Transports) {
|
|
toSerialize["transports"] = o.Transports
|
|
}
|
|
if !IsNil(o.Severity) {
|
|
toSerialize["severity"] = o.Severity
|
|
}
|
|
if o.DestinationGroup.IsSet() {
|
|
toSerialize["destination_group"] = o.DestinationGroup.Get()
|
|
}
|
|
if !IsNil(o.DestinationEventUser) {
|
|
toSerialize["destination_event_user"] = o.DestinationEventUser
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *NotificationRuleRequest) 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",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varNotificationRuleRequest := _NotificationRuleRequest{}
|
|
|
|
err = json.Unmarshal(data, &varNotificationRuleRequest)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = NotificationRuleRequest(varNotificationRuleRequest)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "transports")
|
|
delete(additionalProperties, "severity")
|
|
delete(additionalProperties, "destination_group")
|
|
delete(additionalProperties, "destination_event_user")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableNotificationRuleRequest struct {
|
|
value *NotificationRuleRequest
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableNotificationRuleRequest) Get() *NotificationRuleRequest {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableNotificationRuleRequest) Set(val *NotificationRuleRequest) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableNotificationRuleRequest) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableNotificationRuleRequest) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableNotificationRuleRequest(val *NotificationRuleRequest) *NullableNotificationRuleRequest {
|
|
return &NullableNotificationRuleRequest{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableNotificationRuleRequest) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableNotificationRuleRequest) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|