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

497 lines
14 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 LifecycleRuleRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LifecycleRuleRequest{}
// LifecycleRuleRequest Mixin to validate that a valid enterprise license exists before allowing to save the object
type LifecycleRuleRequest struct {
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"`
MinReviewers *int32 `json:"min_reviewers,omitempty"`
MinReviewersIsPerGroup *bool `json:"min_reviewers_is_per_group,omitempty"`
Reviewers []string `json:"reviewers"`
// 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"`
AdditionalProperties map[string]interface{}
}
type _LifecycleRuleRequest LifecycleRuleRequest
// NewLifecycleRuleRequest instantiates a new LifecycleRuleRequest 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 NewLifecycleRuleRequest(name string, contentType ContentTypeEnum, reviewers []string) *LifecycleRuleRequest {
this := LifecycleRuleRequest{}
this.Name = name
this.ContentType = contentType
this.Reviewers = reviewers
return &this
}
// NewLifecycleRuleRequestWithDefaults instantiates a new LifecycleRuleRequest 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 NewLifecycleRuleRequestWithDefaults() *LifecycleRuleRequest {
this := LifecycleRuleRequest{}
return &this
}
// GetName returns the Name field value
func (o *LifecycleRuleRequest) 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 *LifecycleRuleRequest) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *LifecycleRuleRequest) SetName(v string) {
o.Name = v
}
// GetContentType returns the ContentType field value
func (o *LifecycleRuleRequest) 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 *LifecycleRuleRequest) GetContentTypeOk() (*ContentTypeEnum, bool) {
if o == nil {
return nil, false
}
return &o.ContentType, true
}
// SetContentType sets field value
func (o *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) SetObjectId(v string) {
o.ObjectId.Set(&v)
}
// SetObjectIdNil sets the value for ObjectId to be an explicit nil
func (o *LifecycleRuleRequest) SetObjectIdNil() {
o.ObjectId.Set(nil)
}
// UnsetObjectId ensures that no value is present for ObjectId, not even an explicit nil
func (o *LifecycleRuleRequest) UnsetObjectId() {
o.ObjectId.Unset()
}
// GetInterval returns the Interval field value if set, zero value otherwise.
func (o *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) SetInterval(v string) {
o.Interval = &v
}
// GetGracePeriod returns the GracePeriod field value if set, zero value otherwise.
func (o *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) SetGracePeriod(v string) {
o.GracePeriod = &v
}
// GetReviewerGroups returns the ReviewerGroups field value if set, zero value otherwise.
func (o *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) SetReviewerGroups(v []string) {
o.ReviewerGroups = v
}
// GetMinReviewers returns the MinReviewers field value if set, zero value otherwise.
func (o *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) SetMinReviewers(v int32) {
o.MinReviewers = &v
}
// GetMinReviewersIsPerGroup returns the MinReviewersIsPerGroup field value if set, zero value otherwise.
func (o *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) SetMinReviewersIsPerGroup(v bool) {
o.MinReviewersIsPerGroup = &v
}
// GetReviewers returns the Reviewers field value
func (o *LifecycleRuleRequest) 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 *LifecycleRuleRequest) GetReviewersOk() ([]string, bool) {
if o == nil {
return nil, false
}
return o.Reviewers, true
}
// SetReviewers sets field value
func (o *LifecycleRuleRequest) SetReviewers(v []string) {
o.Reviewers = v
}
// GetNotificationTransports returns the NotificationTransports field value if set, zero value otherwise.
func (o *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) 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 *LifecycleRuleRequest) SetNotificationTransports(v []string) {
o.NotificationTransports = v
}
func (o LifecycleRuleRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LifecycleRuleRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
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
}
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
if !IsNil(o.NotificationTransports) {
toSerialize["notification_transports"] = o.NotificationTransports
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LifecycleRuleRequest) 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",
"content_type",
"reviewers",
}
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)
}
}
varLifecycleRuleRequest := _LifecycleRuleRequest{}
err = json.Unmarshal(data, &varLifecycleRuleRequest)
if err != nil {
return err
}
*o = LifecycleRuleRequest(varLifecycleRuleRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "name")
delete(additionalProperties, "content_type")
delete(additionalProperties, "object_id")
delete(additionalProperties, "interval")
delete(additionalProperties, "grace_period")
delete(additionalProperties, "reviewer_groups")
delete(additionalProperties, "min_reviewers")
delete(additionalProperties, "min_reviewers_is_per_group")
delete(additionalProperties, "reviewers")
delete(additionalProperties, "notification_transports")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLifecycleRuleRequest struct {
value *LifecycleRuleRequest
isSet bool
}
func (v NullableLifecycleRuleRequest) Get() *LifecycleRuleRequest {
return v.value
}
func (v *NullableLifecycleRuleRequest) Set(val *LifecycleRuleRequest) {
v.value = val
v.isSet = true
}
func (v NullableLifecycleRuleRequest) IsSet() bool {
return v.isSet
}
func (v *NullableLifecycleRuleRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLifecycleRuleRequest(val *LifecycleRuleRequest) *NullableLifecycleRuleRequest {
return &NullableLifecycleRuleRequest{value: val, isSet: true}
}
func (v NullableLifecycleRuleRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLifecycleRuleRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}