Files
sdk/model_audit_act.go

231 lines
5.4 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"
)
// checks if the AuditAct type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AuditAct{}
// AuditAct struct for AuditAct
type AuditAct struct {
// Name is the operator's IAM username.
Name *string `json:"name,omitempty"`
// Owner is the org of the operator's IAM row: \"admin\" for a SuperAdmin.
Owner *string `json:"owner,omitempty"`
// Sub is the operator's IAM subject.
Sub *string `json:"sub,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AuditAct AuditAct
// NewAuditAct instantiates a new AuditAct 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 NewAuditAct() *AuditAct {
this := AuditAct{}
return &this
}
// NewAuditActWithDefaults instantiates a new AuditAct 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 NewAuditActWithDefaults() *AuditAct {
this := AuditAct{}
return &this
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *AuditAct) 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 *AuditAct) 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 *AuditAct) 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 *AuditAct) SetName(v string) {
o.Name = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *AuditAct) 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 *AuditAct) 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 *AuditAct) 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 *AuditAct) SetOwner(v string) {
o.Owner = &v
}
// GetSub returns the Sub field value if set, zero value otherwise.
func (o *AuditAct) GetSub() string {
if o == nil || IsNil(o.Sub) {
var ret string
return ret
}
return *o.Sub
}
// GetSubOk returns a tuple with the Sub field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuditAct) GetSubOk() (*string, bool) {
if o == nil || IsNil(o.Sub) {
return nil, false
}
return o.Sub, true
}
// HasSub returns a boolean if a field has been set.
func (o *AuditAct) HasSub() bool {
if o != nil && !IsNil(o.Sub) {
return true
}
return false
}
// SetSub gets a reference to the given string and assigns it to the Sub field.
func (o *AuditAct) SetSub(v string) {
o.Sub = &v
}
func (o AuditAct) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AuditAct) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.Sub) {
toSerialize["sub"] = o.Sub
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AuditAct) UnmarshalJSON(data []byte) (err error) {
varAuditAct := _AuditAct{}
err = json.Unmarshal(data, &varAuditAct)
if err != nil {
return err
}
*o = AuditAct(varAuditAct)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "name")
delete(additionalProperties, "owner")
delete(additionalProperties, "sub")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAuditAct struct {
value *AuditAct
isSet bool
}
func (v NullableAuditAct) Get() *AuditAct {
return v.value
}
func (v *NullableAuditAct) Set(val *AuditAct) {
v.value = val
v.isSet = true
}
func (v NullableAuditAct) IsSet() bool {
return v.isSet
}
func (v *NullableAuditAct) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAuditAct(val *AuditAct) *NullableAuditAct {
return &NullableAuditAct{value: val, isSet: true}
}
func (v NullableAuditAct) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAuditAct) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}