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

275 lines
7.6 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 CertificateGenerationRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CertificateGenerationRequest{}
// CertificateGenerationRequest Certificate generation parameters
type CertificateGenerationRequest struct {
CommonName string `json:"common_name"`
SubjectAltName *string `json:"subject_alt_name,omitempty"`
ValidityDays int32 `json:"validity_days"`
Alg *AlgEnum `json:"alg,omitempty"`
AdditionalProperties map[string]interface{}
}
type _CertificateGenerationRequest CertificateGenerationRequest
// NewCertificateGenerationRequest instantiates a new CertificateGenerationRequest 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 NewCertificateGenerationRequest(commonName string, validityDays int32) *CertificateGenerationRequest {
this := CertificateGenerationRequest{}
this.CommonName = commonName
this.ValidityDays = validityDays
var alg AlgEnum = ALGENUM_RSA
this.Alg = &alg
return &this
}
// NewCertificateGenerationRequestWithDefaults instantiates a new CertificateGenerationRequest 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 NewCertificateGenerationRequestWithDefaults() *CertificateGenerationRequest {
this := CertificateGenerationRequest{}
var alg AlgEnum = ALGENUM_RSA
this.Alg = &alg
return &this
}
// GetCommonName returns the CommonName field value
func (o *CertificateGenerationRequest) GetCommonName() string {
if o == nil {
var ret string
return ret
}
return o.CommonName
}
// GetCommonNameOk returns a tuple with the CommonName field value
// and a boolean to check if the value has been set.
func (o *CertificateGenerationRequest) GetCommonNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CommonName, true
}
// SetCommonName sets field value
func (o *CertificateGenerationRequest) SetCommonName(v string) {
o.CommonName = v
}
// GetSubjectAltName returns the SubjectAltName field value if set, zero value otherwise.
func (o *CertificateGenerationRequest) GetSubjectAltName() string {
if o == nil || IsNil(o.SubjectAltName) {
var ret string
return ret
}
return *o.SubjectAltName
}
// GetSubjectAltNameOk returns a tuple with the SubjectAltName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CertificateGenerationRequest) GetSubjectAltNameOk() (*string, bool) {
if o == nil || IsNil(o.SubjectAltName) {
return nil, false
}
return o.SubjectAltName, true
}
// HasSubjectAltName returns a boolean if a field has been set.
func (o *CertificateGenerationRequest) HasSubjectAltName() bool {
if o != nil && !IsNil(o.SubjectAltName) {
return true
}
return false
}
// SetSubjectAltName gets a reference to the given string and assigns it to the SubjectAltName field.
func (o *CertificateGenerationRequest) SetSubjectAltName(v string) {
o.SubjectAltName = &v
}
// GetValidityDays returns the ValidityDays field value
func (o *CertificateGenerationRequest) GetValidityDays() int32 {
if o == nil {
var ret int32
return ret
}
return o.ValidityDays
}
// GetValidityDaysOk returns a tuple with the ValidityDays field value
// and a boolean to check if the value has been set.
func (o *CertificateGenerationRequest) GetValidityDaysOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.ValidityDays, true
}
// SetValidityDays sets field value
func (o *CertificateGenerationRequest) SetValidityDays(v int32) {
o.ValidityDays = v
}
// GetAlg returns the Alg field value if set, zero value otherwise.
func (o *CertificateGenerationRequest) GetAlg() AlgEnum {
if o == nil || IsNil(o.Alg) {
var ret AlgEnum
return ret
}
return *o.Alg
}
// GetAlgOk returns a tuple with the Alg field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CertificateGenerationRequest) GetAlgOk() (*AlgEnum, bool) {
if o == nil || IsNil(o.Alg) {
return nil, false
}
return o.Alg, true
}
// HasAlg returns a boolean if a field has been set.
func (o *CertificateGenerationRequest) HasAlg() bool {
if o != nil && !IsNil(o.Alg) {
return true
}
return false
}
// SetAlg gets a reference to the given AlgEnum and assigns it to the Alg field.
func (o *CertificateGenerationRequest) SetAlg(v AlgEnum) {
o.Alg = &v
}
func (o CertificateGenerationRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CertificateGenerationRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["common_name"] = o.CommonName
if !IsNil(o.SubjectAltName) {
toSerialize["subject_alt_name"] = o.SubjectAltName
}
toSerialize["validity_days"] = o.ValidityDays
if !IsNil(o.Alg) {
toSerialize["alg"] = o.Alg
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *CertificateGenerationRequest) 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{
"common_name",
"validity_days",
}
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)
}
}
varCertificateGenerationRequest := _CertificateGenerationRequest{}
err = json.Unmarshal(data, &varCertificateGenerationRequest)
if err != nil {
return err
}
*o = CertificateGenerationRequest(varCertificateGenerationRequest)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "common_name")
delete(additionalProperties, "subject_alt_name")
delete(additionalProperties, "validity_days")
delete(additionalProperties, "alg")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableCertificateGenerationRequest struct {
value *CertificateGenerationRequest
isSet bool
}
func (v NullableCertificateGenerationRequest) Get() *CertificateGenerationRequest {
return v.value
}
func (v *NullableCertificateGenerationRequest) Set(val *CertificateGenerationRequest) {
v.value = val
v.isSet = true
}
func (v NullableCertificateGenerationRequest) IsSet() bool {
return v.isSet
}
func (v *NullableCertificateGenerationRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCertificateGenerationRequest(val *CertificateGenerationRequest) *NullableCertificateGenerationRequest {
return &NullableCertificateGenerationRequest{value: val, isSet: true}
}
func (v NullableCertificateGenerationRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCertificateGenerationRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}