Files
upstream-ory-kratos/pkg/client-go/model_pin_config.go
upstream-mirror c60cc7ca75
Some checks failed
CI / Run tests and lints (push) Failing after 29s
CI / Build CLI docs (push) Has been skipped
CI / Run Playwright end-to-end tests (mysql) (push) Failing after 3s
CI / Run Playwright end-to-end tests (postgres) (push) Failing after 2s
CI / Run Playwright end-to-end tests (sqlite) (push) Failing after 3s
CodeQL / Analyze (go) (push) Failing after 4s
CodeQL / Analyze (javascript) (push) Failing after 3s
Docker Image Scanners / scanners (push) Failing after 4s
Synchronize Issue Labels / Synchronize Issue Labels (push) Has been skipped
CI / Run end-to-end tests (postgres) (push) Failing after 19s
CI / Run end-to-end tests (sqlite) (push) Failing after 2s
CI / Run Playwright end-to-end tests (cockroach) (push) Failing after 2s
CI / Draft newsletter (push) Has been skipped
CI / Generate release (push) Has been skipped
CI / Pending approval Slack notification (push) Has been skipped
CI / Send newsletter (push) Has been skipped
snapshot of https://github.com/ory/kratos.git (master, 2026-09-15; blobs > 131072B omitted)
2026-09-15 21:19:12 +05:00

271 lines
7.3 KiB
Go

/*
Ory Identities API
This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.
API version:
Contact: office@ory.sh
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package client
import (
"encoding/json"
"time"
)
// checks if the PINConfig type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PINConfig{}
// PINConfig The pin_secret field holds only the at-rest ciphertext; the plaintext exists transiently in server memory during verification and is invalidated once the key locks.
type PINConfig struct {
// When the pin_secret was first issued.
CreatedAt *time.Time `json:"created_at,omitempty"`
// The number of consecutive wrong-PIN attempts so far; the key locks when it reaches the configured maximum (pin_max_attempts, default 5).
FailedAttempts *int32 `json:"failed_attempts,omitempty"`
// The at-rest ciphertext of the pin_secret. It never leaves the server and is cleared once the key locks.
PinSecret *string `json:"pin_secret,omitempty"`
// When the pin_secret was last rotated. Omitted if the secret was never rotated.
RotatedAt *time.Time `json:"rotated_at,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PINConfig PINConfig
// NewPINConfig instantiates a new PINConfig 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 NewPINConfig() *PINConfig {
this := PINConfig{}
return &this
}
// NewPINConfigWithDefaults instantiates a new PINConfig 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 NewPINConfigWithDefaults() *PINConfig {
this := PINConfig{}
return &this
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *PINConfig) GetCreatedAt() time.Time {
if o == nil || IsNil(o.CreatedAt) {
var ret time.Time
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PINConfig) GetCreatedAtOk() (*time.Time, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *PINConfig) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
func (o *PINConfig) SetCreatedAt(v time.Time) {
o.CreatedAt = &v
}
// GetFailedAttempts returns the FailedAttempts field value if set, zero value otherwise.
func (o *PINConfig) GetFailedAttempts() int32 {
if o == nil || IsNil(o.FailedAttempts) {
var ret int32
return ret
}
return *o.FailedAttempts
}
// GetFailedAttemptsOk returns a tuple with the FailedAttempts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PINConfig) GetFailedAttemptsOk() (*int32, bool) {
if o == nil || IsNil(o.FailedAttempts) {
return nil, false
}
return o.FailedAttempts, true
}
// HasFailedAttempts returns a boolean if a field has been set.
func (o *PINConfig) HasFailedAttempts() bool {
if o != nil && !IsNil(o.FailedAttempts) {
return true
}
return false
}
// SetFailedAttempts gets a reference to the given int32 and assigns it to the FailedAttempts field.
func (o *PINConfig) SetFailedAttempts(v int32) {
o.FailedAttempts = &v
}
// GetPinSecret returns the PinSecret field value if set, zero value otherwise.
func (o *PINConfig) GetPinSecret() string {
if o == nil || IsNil(o.PinSecret) {
var ret string
return ret
}
return *o.PinSecret
}
// GetPinSecretOk returns a tuple with the PinSecret field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PINConfig) GetPinSecretOk() (*string, bool) {
if o == nil || IsNil(o.PinSecret) {
return nil, false
}
return o.PinSecret, true
}
// HasPinSecret returns a boolean if a field has been set.
func (o *PINConfig) HasPinSecret() bool {
if o != nil && !IsNil(o.PinSecret) {
return true
}
return false
}
// SetPinSecret gets a reference to the given string and assigns it to the PinSecret field.
func (o *PINConfig) SetPinSecret(v string) {
o.PinSecret = &v
}
// GetRotatedAt returns the RotatedAt field value if set, zero value otherwise.
func (o *PINConfig) GetRotatedAt() time.Time {
if o == nil || IsNil(o.RotatedAt) {
var ret time.Time
return ret
}
return *o.RotatedAt
}
// GetRotatedAtOk returns a tuple with the RotatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PINConfig) GetRotatedAtOk() (*time.Time, bool) {
if o == nil || IsNil(o.RotatedAt) {
return nil, false
}
return o.RotatedAt, true
}
// HasRotatedAt returns a boolean if a field has been set.
func (o *PINConfig) HasRotatedAt() bool {
if o != nil && !IsNil(o.RotatedAt) {
return true
}
return false
}
// SetRotatedAt gets a reference to the given time.Time and assigns it to the RotatedAt field.
func (o *PINConfig) SetRotatedAt(v time.Time) {
o.RotatedAt = &v
}
func (o PINConfig) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PINConfig) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreatedAt) {
toSerialize["created_at"] = o.CreatedAt
}
if !IsNil(o.FailedAttempts) {
toSerialize["failed_attempts"] = o.FailedAttempts
}
if !IsNil(o.PinSecret) {
toSerialize["pin_secret"] = o.PinSecret
}
if !IsNil(o.RotatedAt) {
toSerialize["rotated_at"] = o.RotatedAt
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PINConfig) UnmarshalJSON(data []byte) (err error) {
varPINConfig := _PINConfig{}
err = json.Unmarshal(data, &varPINConfig)
if err != nil {
return err
}
*o = PINConfig(varPINConfig)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "created_at")
delete(additionalProperties, "failed_attempts")
delete(additionalProperties, "pin_secret")
delete(additionalProperties, "rotated_at")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePINConfig struct {
value *PINConfig
isSet bool
}
func (v NullablePINConfig) Get() *PINConfig {
return v.value
}
func (v *NullablePINConfig) Set(val *PINConfig) {
v.value = val
v.isSet = true
}
func (v NullablePINConfig) IsSet() bool {
return v.isSet
}
func (v *NullablePINConfig) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePINConfig(val *PINConfig) *NullablePINConfig {
return &NullablePINConfig{value: val, isSet: true}
}
func (v NullablePINConfig) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePINConfig) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}