Files
sdk/model_iam_key.go

1019 lines
28 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
"time"
)
// checks if the IamKey type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IamKey{}
// IamKey struct for IamKey
type IamKey struct {
// AccessKey (pk-*) is the publishable identifier and lookup index; AccessSecret (sk-*) is the confidential secret. AccessSecret IS NOT PERSISTED for a key minted at or after the digest change: it carries the secret out to its holder once, in the mint response, and the row keeps only AccessSecretDigest. It stays on the struct because that one-time reveal is the whole point of minting, and it stays in the schema because rows written before the change still hold a plaintext secret that the resolver drains on first use.
AccessKey *string `json:"accessKey,omitempty"`
AccessSecret *string `json:"accessSecret,omitempty"`
// AccessSecretDigest is how a presented secret finds its key: the resolver digests what the caller sent and looks THAT up. It is what lets the row hold no plaintext and still be found in one indexed read — a salted hash cannot be looked up by value, which is the reason the plaintext was here.
AccessSecretDigest *string `json:"accessSecretDigest,omitempty"`
// Act is the durable, opt-in grant that lets this key act FOR a user in its own org — the credential behind as(): presenting it authorizes minting a short-lived, user-bound token for a member of the key's tenant. Default false, so a server key mints nothing on anyone's behalf until the grant is set deliberately — the capability is never inherited by every key. It is confined at mint time to the key's OWN Owner, and a reserved-org or SuperAdmin target is refused, so the grant reaches only ordinary members of the one tenant that holds the key.
Act *bool `json:"act,omitempty"`
Application *string `json:"application,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
// CreatedTime and UpdatedTime are RFC3339 audit stamps carried as strings for byte-parity with the v1 row (orm.Model separately tracks CreatedAt / UpdatedAt as time.Time for the store's own lifecycle).
CreatedTime *string `json:"createdTime,omitempty"`
Deleted *bool `json:"deleted,omitempty"`
// DisplayName is the human-facing label.
DisplayName *string `json:"displayName,omitempty"`
// ExpireTime is when the key stops being honored (empty = never). State is the lifecycle flag (\"Active\", \"test\", …); \"test\" mints test-env credentials instead of live ones.
ExpireTime *string `json:"expireTime,omitempty"`
// Persisted fields
Id *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Organization *string `json:"organization,omitempty"`
// Owner is the tenant that holds the key; Name is unique within Owner.
Owner *string `json:"owner,omitempty"`
// Prefix is the head of the credential the holder presents — the sk- of a secret key, the pk- of a publishable one — recorded when the key is minted (PrefixOf). It lets a listing say which string a row is, and is far too short to use: the secret itself is never stored.
Prefix *string `json:"prefix,omitempty"`
RevokeTime *string `json:"revokeTime,omitempty"`
// Revoker is who revoked the key and RevokeTime when. Revoking sets State to KeyStateRevoked and keeps the row, so the key is still listed and its history can be read; the resolvers refuse it, and no update reopens it.
Revoker *string `json:"revoker,omitempty"`
// Scope is the key's ACCESS CLASS, orthogonal to Type (which names the bound principal). Empty (the default, \"secret\") is a full key: a pk- publishable half AND a confidential sk- half, the sk- authenticating a server-side reader. KeyScopePublish is a WRITE-ONLY publishable key — a pk- half only, no secret — that resolves to just an ORG (never a principal) at the ingest endpoint and is safe to ship in client JS. A missing value on an existing row reads as the default, so every pre-Scope key is a secret key unchanged.
Scope *string `json:"scope,omitempty"`
State *string `json:"state,omitempty"`
// Type is the scope the key is bound to — \"Organization\", \"Application\", \"User\", or \"General\" — and Organization / Application / User name the concrete principal for whichever scope Type selects.
Type *string `json:"type,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
UpdatedTime *string `json:"updatedTime,omitempty"`
// UsedTime is when the key was last presented and resolved. A list read fills it from the key's Sighting; the key row itself never holds it, so recording a use never rewrites the row a person may be editing.
UsedTime *string `json:"usedTime,omitempty"`
User *string `json:"user,omitempty"`
AdditionalProperties map[string]interface{}
}
type _IamKey IamKey
// NewIamKey instantiates a new IamKey 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 NewIamKey() *IamKey {
this := IamKey{}
return &this
}
// NewIamKeyWithDefaults instantiates a new IamKey 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 NewIamKeyWithDefaults() *IamKey {
this := IamKey{}
return &this
}
// GetAccessKey returns the AccessKey field value if set, zero value otherwise.
func (o *IamKey) GetAccessKey() string {
if o == nil || IsNil(o.AccessKey) {
var ret string
return ret
}
return *o.AccessKey
}
// GetAccessKeyOk returns a tuple with the AccessKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetAccessKeyOk() (*string, bool) {
if o == nil || IsNil(o.AccessKey) {
return nil, false
}
return o.AccessKey, true
}
// HasAccessKey returns a boolean if a field has been set.
func (o *IamKey) HasAccessKey() bool {
if o != nil && !IsNil(o.AccessKey) {
return true
}
return false
}
// SetAccessKey gets a reference to the given string and assigns it to the AccessKey field.
func (o *IamKey) SetAccessKey(v string) {
o.AccessKey = &v
}
// GetAccessSecret returns the AccessSecret field value if set, zero value otherwise.
func (o *IamKey) GetAccessSecret() string {
if o == nil || IsNil(o.AccessSecret) {
var ret string
return ret
}
return *o.AccessSecret
}
// GetAccessSecretOk returns a tuple with the AccessSecret field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetAccessSecretOk() (*string, bool) {
if o == nil || IsNil(o.AccessSecret) {
return nil, false
}
return o.AccessSecret, true
}
// HasAccessSecret returns a boolean if a field has been set.
func (o *IamKey) HasAccessSecret() bool {
if o != nil && !IsNil(o.AccessSecret) {
return true
}
return false
}
// SetAccessSecret gets a reference to the given string and assigns it to the AccessSecret field.
func (o *IamKey) SetAccessSecret(v string) {
o.AccessSecret = &v
}
// GetAccessSecretDigest returns the AccessSecretDigest field value if set, zero value otherwise.
func (o *IamKey) GetAccessSecretDigest() string {
if o == nil || IsNil(o.AccessSecretDigest) {
var ret string
return ret
}
return *o.AccessSecretDigest
}
// GetAccessSecretDigestOk returns a tuple with the AccessSecretDigest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetAccessSecretDigestOk() (*string, bool) {
if o == nil || IsNil(o.AccessSecretDigest) {
return nil, false
}
return o.AccessSecretDigest, true
}
// HasAccessSecretDigest returns a boolean if a field has been set.
func (o *IamKey) HasAccessSecretDigest() bool {
if o != nil && !IsNil(o.AccessSecretDigest) {
return true
}
return false
}
// SetAccessSecretDigest gets a reference to the given string and assigns it to the AccessSecretDigest field.
func (o *IamKey) SetAccessSecretDigest(v string) {
o.AccessSecretDigest = &v
}
// GetAct returns the Act field value if set, zero value otherwise.
func (o *IamKey) GetAct() bool {
if o == nil || IsNil(o.Act) {
var ret bool
return ret
}
return *o.Act
}
// GetActOk returns a tuple with the Act field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetActOk() (*bool, bool) {
if o == nil || IsNil(o.Act) {
return nil, false
}
return o.Act, true
}
// HasAct returns a boolean if a field has been set.
func (o *IamKey) HasAct() bool {
if o != nil && !IsNil(o.Act) {
return true
}
return false
}
// SetAct gets a reference to the given bool and assigns it to the Act field.
func (o *IamKey) SetAct(v bool) {
o.Act = &v
}
// GetApplication returns the Application field value if set, zero value otherwise.
func (o *IamKey) GetApplication() string {
if o == nil || IsNil(o.Application) {
var ret string
return ret
}
return *o.Application
}
// GetApplicationOk returns a tuple with the Application field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetApplicationOk() (*string, bool) {
if o == nil || IsNil(o.Application) {
return nil, false
}
return o.Application, true
}
// HasApplication returns a boolean if a field has been set.
func (o *IamKey) HasApplication() bool {
if o != nil && !IsNil(o.Application) {
return true
}
return false
}
// SetApplication gets a reference to the given string and assigns it to the Application field.
func (o *IamKey) SetApplication(v string) {
o.Application = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *IamKey) 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 *IamKey) 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 *IamKey) 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 *IamKey) SetCreatedAt(v time.Time) {
o.CreatedAt = &v
}
// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise.
func (o *IamKey) GetCreatedTime() string {
if o == nil || IsNil(o.CreatedTime) {
var ret string
return ret
}
return *o.CreatedTime
}
// GetCreatedTimeOk returns a tuple with the CreatedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetCreatedTimeOk() (*string, bool) {
if o == nil || IsNil(o.CreatedTime) {
return nil, false
}
return o.CreatedTime, true
}
// HasCreatedTime returns a boolean if a field has been set.
func (o *IamKey) HasCreatedTime() bool {
if o != nil && !IsNil(o.CreatedTime) {
return true
}
return false
}
// SetCreatedTime gets a reference to the given string and assigns it to the CreatedTime field.
func (o *IamKey) SetCreatedTime(v string) {
o.CreatedTime = &v
}
// GetDeleted returns the Deleted field value if set, zero value otherwise.
func (o *IamKey) GetDeleted() bool {
if o == nil || IsNil(o.Deleted) {
var ret bool
return ret
}
return *o.Deleted
}
// GetDeletedOk returns a tuple with the Deleted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetDeletedOk() (*bool, bool) {
if o == nil || IsNil(o.Deleted) {
return nil, false
}
return o.Deleted, true
}
// HasDeleted returns a boolean if a field has been set.
func (o *IamKey) HasDeleted() bool {
if o != nil && !IsNil(o.Deleted) {
return true
}
return false
}
// SetDeleted gets a reference to the given bool and assigns it to the Deleted field.
func (o *IamKey) SetDeleted(v bool) {
o.Deleted = &v
}
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *IamKey) GetDisplayName() string {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
return *o.DisplayName
}
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetDisplayNameOk() (*string, bool) {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
}
// HasDisplayName returns a boolean if a field has been set.
func (o *IamKey) HasDisplayName() bool {
if o != nil && !IsNil(o.DisplayName) {
return true
}
return false
}
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
func (o *IamKey) SetDisplayName(v string) {
o.DisplayName = &v
}
// GetExpireTime returns the ExpireTime field value if set, zero value otherwise.
func (o *IamKey) GetExpireTime() string {
if o == nil || IsNil(o.ExpireTime) {
var ret string
return ret
}
return *o.ExpireTime
}
// GetExpireTimeOk returns a tuple with the ExpireTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetExpireTimeOk() (*string, bool) {
if o == nil || IsNil(o.ExpireTime) {
return nil, false
}
return o.ExpireTime, true
}
// HasExpireTime returns a boolean if a field has been set.
func (o *IamKey) HasExpireTime() bool {
if o != nil && !IsNil(o.ExpireTime) {
return true
}
return false
}
// SetExpireTime gets a reference to the given string and assigns it to the ExpireTime field.
func (o *IamKey) SetExpireTime(v string) {
o.ExpireTime = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *IamKey) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *IamKey) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *IamKey) SetId(v string) {
o.Id = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *IamKey) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *IamKey) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *IamKey) SetName(v string) {
o.Name = &v
}
// GetOrganization returns the Organization field value if set, zero value otherwise.
func (o *IamKey) GetOrganization() string {
if o == nil || IsNil(o.Organization) {
var ret string
return ret
}
return *o.Organization
}
// GetOrganizationOk returns a tuple with the Organization field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetOrganizationOk() (*string, bool) {
if o == nil || IsNil(o.Organization) {
return nil, false
}
return o.Organization, true
}
// HasOrganization returns a boolean if a field has been set.
func (o *IamKey) HasOrganization() bool {
if o != nil && !IsNil(o.Organization) {
return true
}
return false
}
// SetOrganization gets a reference to the given string and assigns it to the Organization field.
func (o *IamKey) SetOrganization(v string) {
o.Organization = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *IamKey) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *IamKey) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *IamKey) SetOwner(v string) {
o.Owner = &v
}
// GetPrefix returns the Prefix field value if set, zero value otherwise.
func (o *IamKey) GetPrefix() string {
if o == nil || IsNil(o.Prefix) {
var ret string
return ret
}
return *o.Prefix
}
// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetPrefixOk() (*string, bool) {
if o == nil || IsNil(o.Prefix) {
return nil, false
}
return o.Prefix, true
}
// HasPrefix returns a boolean if a field has been set.
func (o *IamKey) HasPrefix() bool {
if o != nil && !IsNil(o.Prefix) {
return true
}
return false
}
// SetPrefix gets a reference to the given string and assigns it to the Prefix field.
func (o *IamKey) SetPrefix(v string) {
o.Prefix = &v
}
// GetRevokeTime returns the RevokeTime field value if set, zero value otherwise.
func (o *IamKey) GetRevokeTime() string {
if o == nil || IsNil(o.RevokeTime) {
var ret string
return ret
}
return *o.RevokeTime
}
// GetRevokeTimeOk returns a tuple with the RevokeTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetRevokeTimeOk() (*string, bool) {
if o == nil || IsNil(o.RevokeTime) {
return nil, false
}
return o.RevokeTime, true
}
// HasRevokeTime returns a boolean if a field has been set.
func (o *IamKey) HasRevokeTime() bool {
if o != nil && !IsNil(o.RevokeTime) {
return true
}
return false
}
// SetRevokeTime gets a reference to the given string and assigns it to the RevokeTime field.
func (o *IamKey) SetRevokeTime(v string) {
o.RevokeTime = &v
}
// GetRevoker returns the Revoker field value if set, zero value otherwise.
func (o *IamKey) GetRevoker() string {
if o == nil || IsNil(o.Revoker) {
var ret string
return ret
}
return *o.Revoker
}
// GetRevokerOk returns a tuple with the Revoker field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetRevokerOk() (*string, bool) {
if o == nil || IsNil(o.Revoker) {
return nil, false
}
return o.Revoker, true
}
// HasRevoker returns a boolean if a field has been set.
func (o *IamKey) HasRevoker() bool {
if o != nil && !IsNil(o.Revoker) {
return true
}
return false
}
// SetRevoker gets a reference to the given string and assigns it to the Revoker field.
func (o *IamKey) SetRevoker(v string) {
o.Revoker = &v
}
// GetScope returns the Scope field value if set, zero value otherwise.
func (o *IamKey) GetScope() string {
if o == nil || IsNil(o.Scope) {
var ret string
return ret
}
return *o.Scope
}
// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetScopeOk() (*string, bool) {
if o == nil || IsNil(o.Scope) {
return nil, false
}
return o.Scope, true
}
// HasScope returns a boolean if a field has been set.
func (o *IamKey) HasScope() bool {
if o != nil && !IsNil(o.Scope) {
return true
}
return false
}
// SetScope gets a reference to the given string and assigns it to the Scope field.
func (o *IamKey) SetScope(v string) {
o.Scope = &v
}
// GetState returns the State field value if set, zero value otherwise.
func (o *IamKey) GetState() string {
if o == nil || IsNil(o.State) {
var ret string
return ret
}
return *o.State
}
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetStateOk() (*string, bool) {
if o == nil || IsNil(o.State) {
return nil, false
}
return o.State, true
}
// HasState returns a boolean if a field has been set.
func (o *IamKey) HasState() bool {
if o != nil && !IsNil(o.State) {
return true
}
return false
}
// SetState gets a reference to the given string and assigns it to the State field.
func (o *IamKey) SetState(v string) {
o.State = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *IamKey) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *IamKey) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *IamKey) SetType(v string) {
o.Type = &v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *IamKey) GetUpdatedAt() time.Time {
if o == nil || IsNil(o.UpdatedAt) {
var ret time.Time
return ret
}
return *o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetUpdatedAtOk() (*time.Time, bool) {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *IamKey) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field.
func (o *IamKey) SetUpdatedAt(v time.Time) {
o.UpdatedAt = &v
}
// GetUpdatedTime returns the UpdatedTime field value if set, zero value otherwise.
func (o *IamKey) GetUpdatedTime() string {
if o == nil || IsNil(o.UpdatedTime) {
var ret string
return ret
}
return *o.UpdatedTime
}
// GetUpdatedTimeOk returns a tuple with the UpdatedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetUpdatedTimeOk() (*string, bool) {
if o == nil || IsNil(o.UpdatedTime) {
return nil, false
}
return o.UpdatedTime, true
}
// HasUpdatedTime returns a boolean if a field has been set.
func (o *IamKey) HasUpdatedTime() bool {
if o != nil && !IsNil(o.UpdatedTime) {
return true
}
return false
}
// SetUpdatedTime gets a reference to the given string and assigns it to the UpdatedTime field.
func (o *IamKey) SetUpdatedTime(v string) {
o.UpdatedTime = &v
}
// GetUsedTime returns the UsedTime field value if set, zero value otherwise.
func (o *IamKey) GetUsedTime() string {
if o == nil || IsNil(o.UsedTime) {
var ret string
return ret
}
return *o.UsedTime
}
// GetUsedTimeOk returns a tuple with the UsedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetUsedTimeOk() (*string, bool) {
if o == nil || IsNil(o.UsedTime) {
return nil, false
}
return o.UsedTime, true
}
// HasUsedTime returns a boolean if a field has been set.
func (o *IamKey) HasUsedTime() bool {
if o != nil && !IsNil(o.UsedTime) {
return true
}
return false
}
// SetUsedTime gets a reference to the given string and assigns it to the UsedTime field.
func (o *IamKey) SetUsedTime(v string) {
o.UsedTime = &v
}
// GetUser returns the User field value if set, zero value otherwise.
func (o *IamKey) GetUser() string {
if o == nil || IsNil(o.User) {
var ret string
return ret
}
return *o.User
}
// GetUserOk returns a tuple with the User field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IamKey) GetUserOk() (*string, bool) {
if o == nil || IsNil(o.User) {
return nil, false
}
return o.User, true
}
// HasUser returns a boolean if a field has been set.
func (o *IamKey) HasUser() bool {
if o != nil && !IsNil(o.User) {
return true
}
return false
}
// SetUser gets a reference to the given string and assigns it to the User field.
func (o *IamKey) SetUser(v string) {
o.User = &v
}
func (o IamKey) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IamKey) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AccessKey) {
toSerialize["accessKey"] = o.AccessKey
}
if !IsNil(o.AccessSecret) {
toSerialize["accessSecret"] = o.AccessSecret
}
if !IsNil(o.AccessSecretDigest) {
toSerialize["accessSecretDigest"] = o.AccessSecretDigest
}
if !IsNil(o.Act) {
toSerialize["act"] = o.Act
}
if !IsNil(o.Application) {
toSerialize["application"] = o.Application
}
if !IsNil(o.CreatedAt) {
toSerialize["createdAt"] = o.CreatedAt
}
if !IsNil(o.CreatedTime) {
toSerialize["createdTime"] = o.CreatedTime
}
if !IsNil(o.Deleted) {
toSerialize["deleted"] = o.Deleted
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
if !IsNil(o.ExpireTime) {
toSerialize["expireTime"] = o.ExpireTime
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Organization) {
toSerialize["organization"] = o.Organization
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.Prefix) {
toSerialize["prefix"] = o.Prefix
}
if !IsNil(o.RevokeTime) {
toSerialize["revokeTime"] = o.RevokeTime
}
if !IsNil(o.Revoker) {
toSerialize["revoker"] = o.Revoker
}
if !IsNil(o.Scope) {
toSerialize["scope"] = o.Scope
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.UpdatedAt) {
toSerialize["updatedAt"] = o.UpdatedAt
}
if !IsNil(o.UpdatedTime) {
toSerialize["updatedTime"] = o.UpdatedTime
}
if !IsNil(o.UsedTime) {
toSerialize["usedTime"] = o.UsedTime
}
if !IsNil(o.User) {
toSerialize["user"] = o.User
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *IamKey) UnmarshalJSON(data []byte) (err error) {
varIamKey := _IamKey{}
err = json.Unmarshal(data, &varIamKey)
if err != nil {
return err
}
*o = IamKey(varIamKey)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "accessKey")
delete(additionalProperties, "accessSecret")
delete(additionalProperties, "accessSecretDigest")
delete(additionalProperties, "act")
delete(additionalProperties, "application")
delete(additionalProperties, "createdAt")
delete(additionalProperties, "createdTime")
delete(additionalProperties, "deleted")
delete(additionalProperties, "displayName")
delete(additionalProperties, "expireTime")
delete(additionalProperties, "id")
delete(additionalProperties, "name")
delete(additionalProperties, "organization")
delete(additionalProperties, "owner")
delete(additionalProperties, "prefix")
delete(additionalProperties, "revokeTime")
delete(additionalProperties, "revoker")
delete(additionalProperties, "scope")
delete(additionalProperties, "state")
delete(additionalProperties, "type")
delete(additionalProperties, "updatedAt")
delete(additionalProperties, "updatedTime")
delete(additionalProperties, "usedTime")
delete(additionalProperties, "user")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIamKey struct {
value *IamKey
isSet bool
}
func (v NullableIamKey) Get() *IamKey {
return v.value
}
func (v *NullableIamKey) Set(val *IamKey) {
v.value = val
v.isSet = true
}
func (v NullableIamKey) IsSet() bool {
return v.isSet
}
func (v *NullableIamKey) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIamKey(val *IamKey) *NullableIamKey {
return &NullableIamKey{value: val, isSet: true}
}
func (v NullableIamKey) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIamKey) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}