/* 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 IdentityCredentialsLookupSecretCode type satisfies the MappedNullable interface at compile time var _ MappedNullable = &IdentityCredentialsLookupSecretCode{} // IdentityCredentialsLookupSecretCode Recovery codes can be used once and are invalidated after use. type IdentityCredentialsLookupSecretCode struct { // A recovery code Code *string `json:"code,omitempty"` UsedAt *time.Time `json:"used_at,omitempty"` AdditionalProperties map[string]interface{} } type _IdentityCredentialsLookupSecretCode IdentityCredentialsLookupSecretCode // NewIdentityCredentialsLookupSecretCode instantiates a new IdentityCredentialsLookupSecretCode 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 NewIdentityCredentialsLookupSecretCode() *IdentityCredentialsLookupSecretCode { this := IdentityCredentialsLookupSecretCode{} return &this } // NewIdentityCredentialsLookupSecretCodeWithDefaults instantiates a new IdentityCredentialsLookupSecretCode 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 NewIdentityCredentialsLookupSecretCodeWithDefaults() *IdentityCredentialsLookupSecretCode { this := IdentityCredentialsLookupSecretCode{} return &this } // GetCode returns the Code field value if set, zero value otherwise. func (o *IdentityCredentialsLookupSecretCode) GetCode() string { if o == nil || IsNil(o.Code) { var ret string return ret } return *o.Code } // GetCodeOk returns a tuple with the Code field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IdentityCredentialsLookupSecretCode) GetCodeOk() (*string, bool) { if o == nil || IsNil(o.Code) { return nil, false } return o.Code, true } // HasCode returns a boolean if a field has been set. func (o *IdentityCredentialsLookupSecretCode) HasCode() bool { if o != nil && !IsNil(o.Code) { return true } return false } // SetCode gets a reference to the given string and assigns it to the Code field. func (o *IdentityCredentialsLookupSecretCode) SetCode(v string) { o.Code = &v } // GetUsedAt returns the UsedAt field value if set, zero value otherwise. func (o *IdentityCredentialsLookupSecretCode) GetUsedAt() time.Time { if o == nil || IsNil(o.UsedAt) { var ret time.Time return ret } return *o.UsedAt } // GetUsedAtOk returns a tuple with the UsedAt field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *IdentityCredentialsLookupSecretCode) GetUsedAtOk() (*time.Time, bool) { if o == nil || IsNil(o.UsedAt) { return nil, false } return o.UsedAt, true } // HasUsedAt returns a boolean if a field has been set. func (o *IdentityCredentialsLookupSecretCode) HasUsedAt() bool { if o != nil && !IsNil(o.UsedAt) { return true } return false } // SetUsedAt gets a reference to the given time.Time and assigns it to the UsedAt field. func (o *IdentityCredentialsLookupSecretCode) SetUsedAt(v time.Time) { o.UsedAt = &v } func (o IdentityCredentialsLookupSecretCode) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { return []byte{}, err } return json.Marshal(toSerialize) } func (o IdentityCredentialsLookupSecretCode) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if !IsNil(o.Code) { toSerialize["code"] = o.Code } if !IsNil(o.UsedAt) { toSerialize["used_at"] = o.UsedAt } for key, value := range o.AdditionalProperties { toSerialize[key] = value } return toSerialize, nil } func (o *IdentityCredentialsLookupSecretCode) UnmarshalJSON(data []byte) (err error) { varIdentityCredentialsLookupSecretCode := _IdentityCredentialsLookupSecretCode{} err = json.Unmarshal(data, &varIdentityCredentialsLookupSecretCode) if err != nil { return err } *o = IdentityCredentialsLookupSecretCode(varIdentityCredentialsLookupSecretCode) additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "code") delete(additionalProperties, "used_at") o.AdditionalProperties = additionalProperties } return err } type NullableIdentityCredentialsLookupSecretCode struct { value *IdentityCredentialsLookupSecretCode isSet bool } func (v NullableIdentityCredentialsLookupSecretCode) Get() *IdentityCredentialsLookupSecretCode { return v.value } func (v *NullableIdentityCredentialsLookupSecretCode) Set(val *IdentityCredentialsLookupSecretCode) { v.value = val v.isSet = true } func (v NullableIdentityCredentialsLookupSecretCode) IsSet() bool { return v.isSet } func (v *NullableIdentityCredentialsLookupSecretCode) Unset() { v.value = nil v.isSet = false } func NewNullableIdentityCredentialsLookupSecretCode(val *IdentityCredentialsLookupSecretCode) *NullableIdentityCredentialsLookupSecretCode { return &NullableIdentityCredentialsLookupSecretCode{value: val, isSet: true} } func (v NullableIdentityCredentialsLookupSecretCode) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableIdentityCredentialsLookupSecretCode) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }