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

613 lines
17 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 LifecycleRule type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LifecycleRule{}
// LifecycleRule Mixin to validate that a valid enterprise license exists before allowing to save the object
type LifecycleRule struct {
Id string `json:"id"`
Name string `json:"name"`
ContentType ContentTypeEnum `json:"content_type"`
ObjectId NullableString `json:"object_id,omitempty"`
Interval *string `json:"interval,omitempty"`
GracePeriod *string `json:"grace_period,omitempty"`
ReviewerGroups []string `json:"reviewer_groups,omitempty"`
ReviewerGroupsObj []ReviewerGroup `json:"reviewer_groups_obj"`
MinReviewers *int32 `json:"min_reviewers,omitempty"`
MinReviewersIsPerGroup *bool `json:"min_reviewers_is_per_group,omitempty"`
Reviewers []string `json:"reviewers"`
ReviewersObj []ReviewerUser `json:"reviewers_obj"`
// Select which transports should be used to notify the reviewers. If none are selected, the notification will only be shown in the authentik UI.
NotificationTransports []string `json:"notification_transports,omitempty"`
TargetVerbose string `json:"target_verbose"`
AdditionalProperties map[string]interface{}
}
type _LifecycleRule LifecycleRule
// NewLifecycleRule instantiates a new LifecycleRule 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 NewLifecycleRule(id string, name string, contentType ContentTypeEnum, reviewerGroupsObj []ReviewerGroup, reviewers []string, reviewersObj []ReviewerUser, targetVerbose string) *LifecycleRule {
this := LifecycleRule{}
this.Id = id
this.Name = name
this.ContentType = contentType
this.ReviewerGroupsObj = reviewerGroupsObj
this.Reviewers = reviewers
this.ReviewersObj = reviewersObj
this.TargetVerbose = targetVerbose
return &this
}
// NewLifecycleRuleWithDefaults instantiates a new LifecycleRule 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 NewLifecycleRuleWithDefaults() *LifecycleRule {
this := LifecycleRule{}
return &this
}
// GetId returns the Id field value
func (o *LifecycleRule) GetId() string {
if o == nil {
var ret string
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 *LifecycleRule) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *LifecycleRule) SetId(v string) {
o.Id = v
}
// GetName returns the Name field value
func (o *LifecycleRule) 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 *LifecycleRule) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *LifecycleRule) SetName(v string) {
o.Name = v
}
// GetContentType returns the ContentType field value
func (o *LifecycleRule) GetContentType() ContentTypeEnum {
if o == nil {
var ret ContentTypeEnum
return ret
}
return o.ContentType
}
// GetContentTypeOk returns a tuple with the ContentType field value
// and a boolean to check if the value has been set.
func (o *LifecycleRule) GetContentTypeOk() (*ContentTypeEnum, bool) {
if o == nil {
return nil, false
}
return &o.ContentType, true
}
// SetContentType sets field value
func (o *LifecycleRule) SetContentType(v ContentTypeEnum) {
o.ContentType = v
}
// GetObjectId returns the ObjectId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *LifecycleRule) GetObjectId() string {
if o == nil || IsNil(o.ObjectId.Get()) {
var ret string
return ret
}
return *o.ObjectId.Get()
}
// GetObjectIdOk returns a tuple with the ObjectId 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 *LifecycleRule) GetObjectIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ObjectId.Get(), o.ObjectId.IsSet()
}
// HasObjectId returns a boolean if a field has been set.
func (o *LifecycleRule) HasObjectId() bool {
if o != nil && o.ObjectId.IsSet() {
return true
}
return false
}
// SetObjectId gets a reference to the given NullableString and assigns it to the ObjectId field.
func (o *LifecycleRule) SetObjectId(v string) {
o.ObjectId.Set(&v)
}
// SetObjectIdNil sets the value for ObjectId to be an explicit nil
func (o *LifecycleRule) SetObjectIdNil() {
o.ObjectId.Set(nil)
}
// UnsetObjectId ensures that no value is present for ObjectId, not even an explicit nil
func (o *LifecycleRule) UnsetObjectId() {
o.ObjectId.Unset()
}
// GetInterval returns the Interval field value if set, zero value otherwise.
func (o *LifecycleRule) GetInterval() string {
if o == nil || IsNil(o.Interval) {
var ret string
return ret
}
return *o.Interval
}
// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LifecycleRule) GetIntervalOk() (*string, bool) {
if o == nil || IsNil(o.Interval) {
return nil, false
}
return o.Interval, true
}
// HasInterval returns a boolean if a field has been set.
func (o *LifecycleRule) HasInterval() bool {
if o != nil && !IsNil(o.Interval) {
return true
}
return false
}
// SetInterval gets a reference to the given string and assigns it to the Interval field.
func (o *LifecycleRule) SetInterval(v string) {
o.Interval = &v
}
// GetGracePeriod returns the GracePeriod field value if set, zero value otherwise.
func (o *LifecycleRule) GetGracePeriod() string {
if o == nil || IsNil(o.GracePeriod) {
var ret string
return ret
}
return *o.GracePeriod
}
// GetGracePeriodOk returns a tuple with the GracePeriod field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LifecycleRule) GetGracePeriodOk() (*string, bool) {
if o == nil || IsNil(o.GracePeriod) {
return nil, false
}
return o.GracePeriod, true
}
// HasGracePeriod returns a boolean if a field has been set.
func (o *LifecycleRule) HasGracePeriod() bool {
if o != nil && !IsNil(o.GracePeriod) {
return true
}
return false
}
// SetGracePeriod gets a reference to the given string and assigns it to the GracePeriod field.
func (o *LifecycleRule) SetGracePeriod(v string) {
o.GracePeriod = &v
}
// GetReviewerGroups returns the ReviewerGroups field value if set, zero value otherwise.
func (o *LifecycleRule) GetReviewerGroups() []string {
if o == nil || IsNil(o.ReviewerGroups) {
var ret []string
return ret
}
return o.ReviewerGroups
}
// GetReviewerGroupsOk returns a tuple with the ReviewerGroups field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LifecycleRule) GetReviewerGroupsOk() ([]string, bool) {
if o == nil || IsNil(o.ReviewerGroups) {
return nil, false
}
return o.ReviewerGroups, true
}
// HasReviewerGroups returns a boolean if a field has been set.
func (o *LifecycleRule) HasReviewerGroups() bool {
if o != nil && !IsNil(o.ReviewerGroups) {
return true
}
return false
}
// SetReviewerGroups gets a reference to the given []string and assigns it to the ReviewerGroups field.
func (o *LifecycleRule) SetReviewerGroups(v []string) {
o.ReviewerGroups = v
}
// GetReviewerGroupsObj returns the ReviewerGroupsObj field value
func (o *LifecycleRule) GetReviewerGroupsObj() []ReviewerGroup {
if o == nil {
var ret []ReviewerGroup
return ret
}
return o.ReviewerGroupsObj
}
// GetReviewerGroupsObjOk returns a tuple with the ReviewerGroupsObj field value
// and a boolean to check if the value has been set.
func (o *LifecycleRule) GetReviewerGroupsObjOk() ([]ReviewerGroup, bool) {
if o == nil {
return nil, false
}
return o.ReviewerGroupsObj, true
}
// SetReviewerGroupsObj sets field value
func (o *LifecycleRule) SetReviewerGroupsObj(v []ReviewerGroup) {
o.ReviewerGroupsObj = v
}
// GetMinReviewers returns the MinReviewers field value if set, zero value otherwise.
func (o *LifecycleRule) GetMinReviewers() int32 {
if o == nil || IsNil(o.MinReviewers) {
var ret int32
return ret
}
return *o.MinReviewers
}
// GetMinReviewersOk returns a tuple with the MinReviewers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LifecycleRule) GetMinReviewersOk() (*int32, bool) {
if o == nil || IsNil(o.MinReviewers) {
return nil, false
}
return o.MinReviewers, true
}
// HasMinReviewers returns a boolean if a field has been set.
func (o *LifecycleRule) HasMinReviewers() bool {
if o != nil && !IsNil(o.MinReviewers) {
return true
}
return false
}
// SetMinReviewers gets a reference to the given int32 and assigns it to the MinReviewers field.
func (o *LifecycleRule) SetMinReviewers(v int32) {
o.MinReviewers = &v
}
// GetMinReviewersIsPerGroup returns the MinReviewersIsPerGroup field value if set, zero value otherwise.
func (o *LifecycleRule) GetMinReviewersIsPerGroup() bool {
if o == nil || IsNil(o.MinReviewersIsPerGroup) {
var ret bool
return ret
}
return *o.MinReviewersIsPerGroup
}
// GetMinReviewersIsPerGroupOk returns a tuple with the MinReviewersIsPerGroup field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LifecycleRule) GetMinReviewersIsPerGroupOk() (*bool, bool) {
if o == nil || IsNil(o.MinReviewersIsPerGroup) {
return nil, false
}
return o.MinReviewersIsPerGroup, true
}
// HasMinReviewersIsPerGroup returns a boolean if a field has been set.
func (o *LifecycleRule) HasMinReviewersIsPerGroup() bool {
if o != nil && !IsNil(o.MinReviewersIsPerGroup) {
return true
}
return false
}
// SetMinReviewersIsPerGroup gets a reference to the given bool and assigns it to the MinReviewersIsPerGroup field.
func (o *LifecycleRule) SetMinReviewersIsPerGroup(v bool) {
o.MinReviewersIsPerGroup = &v
}
// GetReviewers returns the Reviewers field value
func (o *LifecycleRule) GetReviewers() []string {
if o == nil {
var ret []string
return ret
}
return o.Reviewers
}
// GetReviewersOk returns a tuple with the Reviewers field value
// and a boolean to check if the value has been set.
func (o *LifecycleRule) GetReviewersOk() ([]string, bool) {
if o == nil {
return nil, false
}
return o.Reviewers, true
}
// SetReviewers sets field value
func (o *LifecycleRule) SetReviewers(v []string) {
o.Reviewers = v
}
// GetReviewersObj returns the ReviewersObj field value
func (o *LifecycleRule) GetReviewersObj() []ReviewerUser {
if o == nil {
var ret []ReviewerUser
return ret
}
return o.ReviewersObj
}
// GetReviewersObjOk returns a tuple with the ReviewersObj field value
// and a boolean to check if the value has been set.
func (o *LifecycleRule) GetReviewersObjOk() ([]ReviewerUser, bool) {
if o == nil {
return nil, false
}
return o.ReviewersObj, true
}
// SetReviewersObj sets field value
func (o *LifecycleRule) SetReviewersObj(v []ReviewerUser) {
o.ReviewersObj = v
}
// GetNotificationTransports returns the NotificationTransports field value if set, zero value otherwise.
func (o *LifecycleRule) GetNotificationTransports() []string {
if o == nil || IsNil(o.NotificationTransports) {
var ret []string
return ret
}
return o.NotificationTransports
}
// GetNotificationTransportsOk returns a tuple with the NotificationTransports field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LifecycleRule) GetNotificationTransportsOk() ([]string, bool) {
if o == nil || IsNil(o.NotificationTransports) {
return nil, false
}
return o.NotificationTransports, true
}
// HasNotificationTransports returns a boolean if a field has been set.
func (o *LifecycleRule) HasNotificationTransports() bool {
if o != nil && !IsNil(o.NotificationTransports) {
return true
}
return false
}
// SetNotificationTransports gets a reference to the given []string and assigns it to the NotificationTransports field.
func (o *LifecycleRule) SetNotificationTransports(v []string) {
o.NotificationTransports = v
}
// GetTargetVerbose returns the TargetVerbose field value
func (o *LifecycleRule) GetTargetVerbose() string {
if o == nil {
var ret string
return ret
}
return o.TargetVerbose
}
// GetTargetVerboseOk returns a tuple with the TargetVerbose field value
// and a boolean to check if the value has been set.
func (o *LifecycleRule) GetTargetVerboseOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.TargetVerbose, true
}
// SetTargetVerbose sets field value
func (o *LifecycleRule) SetTargetVerbose(v string) {
o.TargetVerbose = v
}
func (o LifecycleRule) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LifecycleRule) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
toSerialize["name"] = o.Name
toSerialize["content_type"] = o.ContentType
if o.ObjectId.IsSet() {
toSerialize["object_id"] = o.ObjectId.Get()
}
if !IsNil(o.Interval) {
toSerialize["interval"] = o.Interval
}
if !IsNil(o.GracePeriod) {
toSerialize["grace_period"] = o.GracePeriod
}
if !IsNil(o.ReviewerGroups) {
toSerialize["reviewer_groups"] = o.ReviewerGroups
}
toSerialize["reviewer_groups_obj"] = o.ReviewerGroupsObj
if !IsNil(o.MinReviewers) {
toSerialize["min_reviewers"] = o.MinReviewers
}
if !IsNil(o.MinReviewersIsPerGroup) {
toSerialize["min_reviewers_is_per_group"] = o.MinReviewersIsPerGroup
}
toSerialize["reviewers"] = o.Reviewers
toSerialize["reviewers_obj"] = o.ReviewersObj
if !IsNil(o.NotificationTransports) {
toSerialize["notification_transports"] = o.NotificationTransports
}
toSerialize["target_verbose"] = o.TargetVerbose
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LifecycleRule) 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",
"content_type",
"reviewer_groups_obj",
"reviewers",
"reviewers_obj",
"target_verbose",
}
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)
}
}
varLifecycleRule := _LifecycleRule{}
err = json.Unmarshal(data, &varLifecycleRule)
if err != nil {
return err
}
*o = LifecycleRule(varLifecycleRule)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "id")
delete(additionalProperties, "name")
delete(additionalProperties, "content_type")
delete(additionalProperties, "object_id")
delete(additionalProperties, "interval")
delete(additionalProperties, "grace_period")
delete(additionalProperties, "reviewer_groups")
delete(additionalProperties, "reviewer_groups_obj")
delete(additionalProperties, "min_reviewers")
delete(additionalProperties, "min_reviewers_is_per_group")
delete(additionalProperties, "reviewers")
delete(additionalProperties, "reviewers_obj")
delete(additionalProperties, "notification_transports")
delete(additionalProperties, "target_verbose")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLifecycleRule struct {
value *LifecycleRule
isSet bool
}
func (v NullableLifecycleRule) Get() *LifecycleRule {
return v.value
}
func (v *NullableLifecycleRule) Set(val *LifecycleRule) {
v.value = val
v.isSet = true
}
func (v NullableLifecycleRule) IsSet() bool {
return v.isSet
}
func (v *NullableLifecycleRule) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLifecycleRule(val *LifecycleRule) *NullableLifecycleRule {
return &NullableLifecycleRule{value: val, isSet: true}
}
func (v NullableLifecycleRule) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLifecycleRule) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}