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>
374 lines
9.4 KiB
Go
Generated
374 lines
9.4 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 TelegramAuthRequest type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &TelegramAuthRequest{}
|
|
|
|
// TelegramAuthRequest struct for TelegramAuthRequest
|
|
type TelegramAuthRequest struct {
|
|
Id int32 `json:"id"`
|
|
FirstName *string `json:"first_name,omitempty"`
|
|
LastName *string `json:"last_name,omitempty"`
|
|
Username *string `json:"username,omitempty"`
|
|
PhotoUrl *string `json:"photo_url,omitempty"`
|
|
AuthDate int32 `json:"auth_date"`
|
|
Hash string `json:"hash"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _TelegramAuthRequest TelegramAuthRequest
|
|
|
|
// NewTelegramAuthRequest instantiates a new TelegramAuthRequest 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 NewTelegramAuthRequest(id int32, authDate int32, hash string) *TelegramAuthRequest {
|
|
this := TelegramAuthRequest{}
|
|
this.Id = id
|
|
this.AuthDate = authDate
|
|
this.Hash = hash
|
|
return &this
|
|
}
|
|
|
|
// NewTelegramAuthRequestWithDefaults instantiates a new TelegramAuthRequest 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 NewTelegramAuthRequestWithDefaults() *TelegramAuthRequest {
|
|
this := TelegramAuthRequest{}
|
|
return &this
|
|
}
|
|
|
|
// GetId returns the Id field value
|
|
func (o *TelegramAuthRequest) GetId() int32 {
|
|
if o == nil {
|
|
var ret int32
|
|
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 *TelegramAuthRequest) GetIdOk() (*int32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Id, true
|
|
}
|
|
|
|
// SetId sets field value
|
|
func (o *TelegramAuthRequest) SetId(v int32) {
|
|
o.Id = v
|
|
}
|
|
|
|
// GetFirstName returns the FirstName field value if set, zero value otherwise.
|
|
func (o *TelegramAuthRequest) GetFirstName() string {
|
|
if o == nil || IsNil(o.FirstName) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.FirstName
|
|
}
|
|
|
|
// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TelegramAuthRequest) GetFirstNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.FirstName) {
|
|
return nil, false
|
|
}
|
|
return o.FirstName, true
|
|
}
|
|
|
|
// HasFirstName returns a boolean if a field has been set.
|
|
func (o *TelegramAuthRequest) HasFirstName() bool {
|
|
if o != nil && !IsNil(o.FirstName) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetFirstName gets a reference to the given string and assigns it to the FirstName field.
|
|
func (o *TelegramAuthRequest) SetFirstName(v string) {
|
|
o.FirstName = &v
|
|
}
|
|
|
|
// GetLastName returns the LastName field value if set, zero value otherwise.
|
|
func (o *TelegramAuthRequest) GetLastName() string {
|
|
if o == nil || IsNil(o.LastName) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.LastName
|
|
}
|
|
|
|
// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TelegramAuthRequest) GetLastNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.LastName) {
|
|
return nil, false
|
|
}
|
|
return o.LastName, true
|
|
}
|
|
|
|
// HasLastName returns a boolean if a field has been set.
|
|
func (o *TelegramAuthRequest) HasLastName() bool {
|
|
if o != nil && !IsNil(o.LastName) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLastName gets a reference to the given string and assigns it to the LastName field.
|
|
func (o *TelegramAuthRequest) SetLastName(v string) {
|
|
o.LastName = &v
|
|
}
|
|
|
|
// GetUsername returns the Username field value if set, zero value otherwise.
|
|
func (o *TelegramAuthRequest) GetUsername() string {
|
|
if o == nil || IsNil(o.Username) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Username
|
|
}
|
|
|
|
// GetUsernameOk returns a tuple with the Username field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TelegramAuthRequest) GetUsernameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Username) {
|
|
return nil, false
|
|
}
|
|
return o.Username, true
|
|
}
|
|
|
|
// HasUsername returns a boolean if a field has been set.
|
|
func (o *TelegramAuthRequest) HasUsername() bool {
|
|
if o != nil && !IsNil(o.Username) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetUsername gets a reference to the given string and assigns it to the Username field.
|
|
func (o *TelegramAuthRequest) SetUsername(v string) {
|
|
o.Username = &v
|
|
}
|
|
|
|
// GetPhotoUrl returns the PhotoUrl field value if set, zero value otherwise.
|
|
func (o *TelegramAuthRequest) GetPhotoUrl() string {
|
|
if o == nil || IsNil(o.PhotoUrl) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.PhotoUrl
|
|
}
|
|
|
|
// GetPhotoUrlOk returns a tuple with the PhotoUrl field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TelegramAuthRequest) GetPhotoUrlOk() (*string, bool) {
|
|
if o == nil || IsNil(o.PhotoUrl) {
|
|
return nil, false
|
|
}
|
|
return o.PhotoUrl, true
|
|
}
|
|
|
|
// HasPhotoUrl returns a boolean if a field has been set.
|
|
func (o *TelegramAuthRequest) HasPhotoUrl() bool {
|
|
if o != nil && !IsNil(o.PhotoUrl) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPhotoUrl gets a reference to the given string and assigns it to the PhotoUrl field.
|
|
func (o *TelegramAuthRequest) SetPhotoUrl(v string) {
|
|
o.PhotoUrl = &v
|
|
}
|
|
|
|
// GetAuthDate returns the AuthDate field value
|
|
func (o *TelegramAuthRequest) GetAuthDate() int32 {
|
|
if o == nil {
|
|
var ret int32
|
|
return ret
|
|
}
|
|
|
|
return o.AuthDate
|
|
}
|
|
|
|
// GetAuthDateOk returns a tuple with the AuthDate field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TelegramAuthRequest) GetAuthDateOk() (*int32, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.AuthDate, true
|
|
}
|
|
|
|
// SetAuthDate sets field value
|
|
func (o *TelegramAuthRequest) SetAuthDate(v int32) {
|
|
o.AuthDate = v
|
|
}
|
|
|
|
// GetHash returns the Hash field value
|
|
func (o *TelegramAuthRequest) GetHash() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Hash
|
|
}
|
|
|
|
// GetHashOk returns a tuple with the Hash field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *TelegramAuthRequest) GetHashOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Hash, true
|
|
}
|
|
|
|
// SetHash sets field value
|
|
func (o *TelegramAuthRequest) SetHash(v string) {
|
|
o.Hash = v
|
|
}
|
|
|
|
func (o TelegramAuthRequest) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o TelegramAuthRequest) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["id"] = o.Id
|
|
if !IsNil(o.FirstName) {
|
|
toSerialize["first_name"] = o.FirstName
|
|
}
|
|
if !IsNil(o.LastName) {
|
|
toSerialize["last_name"] = o.LastName
|
|
}
|
|
if !IsNil(o.Username) {
|
|
toSerialize["username"] = o.Username
|
|
}
|
|
if !IsNil(o.PhotoUrl) {
|
|
toSerialize["photo_url"] = o.PhotoUrl
|
|
}
|
|
toSerialize["auth_date"] = o.AuthDate
|
|
toSerialize["hash"] = o.Hash
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *TelegramAuthRequest) 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",
|
|
"auth_date",
|
|
"hash",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varTelegramAuthRequest := _TelegramAuthRequest{}
|
|
|
|
err = json.Unmarshal(data, &varTelegramAuthRequest)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = TelegramAuthRequest(varTelegramAuthRequest)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "first_name")
|
|
delete(additionalProperties, "last_name")
|
|
delete(additionalProperties, "username")
|
|
delete(additionalProperties, "photo_url")
|
|
delete(additionalProperties, "auth_date")
|
|
delete(additionalProperties, "hash")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableTelegramAuthRequest struct {
|
|
value *TelegramAuthRequest
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableTelegramAuthRequest) Get() *TelegramAuthRequest {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableTelegramAuthRequest) Set(val *TelegramAuthRequest) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableTelegramAuthRequest) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableTelegramAuthRequest) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableTelegramAuthRequest(val *TelegramAuthRequest) *NullableTelegramAuthRequest {
|
|
return &NullableTelegramAuthRequest{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableTelegramAuthRequest) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableTelegramAuthRequest) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|