/* STACKIT File Storage (SFS) API used to create and manage NFS Shares. API version: 1beta.0.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package sfsbeta import ( "encoding/json" ) // checks if the SnapshotSchedule type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SnapshotSchedule{} /* types and functions for cron */ // isNotNullableString type SnapshotScheduleGetCronAttributeType = *string func getSnapshotScheduleGetCronAttributeTypeOk(arg SnapshotScheduleGetCronAttributeType) (ret SnapshotScheduleGetCronRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setSnapshotScheduleGetCronAttributeType(arg *SnapshotScheduleGetCronAttributeType, val SnapshotScheduleGetCronRetType) { *arg = &val } type SnapshotScheduleGetCronArgType = string type SnapshotScheduleGetCronRetType = string /* types and functions for name */ // isNotNullableString type SnapshotScheduleGetNameAttributeType = *string func getSnapshotScheduleGetNameAttributeTypeOk(arg SnapshotScheduleGetNameAttributeType) (ret SnapshotScheduleGetNameRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setSnapshotScheduleGetNameAttributeType(arg *SnapshotScheduleGetNameAttributeType, val SnapshotScheduleGetNameRetType) { *arg = &val } type SnapshotScheduleGetNameArgType = string type SnapshotScheduleGetNameRetType = string // SnapshotSchedule struct for SnapshotSchedule type SnapshotSchedule struct { // Cron of the Snapshot Schedule (follows the cron schedule expression in Unix-like systems) Cron SnapshotScheduleGetCronAttributeType `json:"cron,omitempty"` // Name of the Snapshot Schedule Name SnapshotScheduleGetNameAttributeType `json:"name,omitempty"` } // NewSnapshotSchedule instantiates a new SnapshotSchedule 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 NewSnapshotSchedule() *SnapshotSchedule { this := SnapshotSchedule{} return &this } // NewSnapshotScheduleWithDefaults instantiates a new SnapshotSchedule 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 NewSnapshotScheduleWithDefaults() *SnapshotSchedule { this := SnapshotSchedule{} return &this } // GetCron returns the Cron field value if set, zero value otherwise. func (o *SnapshotSchedule) GetCron() (res SnapshotScheduleGetCronRetType) { res, _ = o.GetCronOk() return } // GetCronOk returns a tuple with the Cron field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SnapshotSchedule) GetCronOk() (ret SnapshotScheduleGetCronRetType, ok bool) { return getSnapshotScheduleGetCronAttributeTypeOk(o.Cron) } // HasCron returns a boolean if a field has been set. func (o *SnapshotSchedule) HasCron() bool { _, ok := o.GetCronOk() return ok } // SetCron gets a reference to the given string and assigns it to the Cron field. func (o *SnapshotSchedule) SetCron(v SnapshotScheduleGetCronRetType) { setSnapshotScheduleGetCronAttributeType(&o.Cron, v) } // GetName returns the Name field value if set, zero value otherwise. func (o *SnapshotSchedule) GetName() (res SnapshotScheduleGetNameRetType) { res, _ = o.GetNameOk() return } // 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 *SnapshotSchedule) GetNameOk() (ret SnapshotScheduleGetNameRetType, ok bool) { return getSnapshotScheduleGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. func (o *SnapshotSchedule) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. func (o *SnapshotSchedule) SetName(v SnapshotScheduleGetNameRetType) { setSnapshotScheduleGetNameAttributeType(&o.Name, v) } func (o SnapshotSchedule) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getSnapshotScheduleGetCronAttributeTypeOk(o.Cron); ok { toSerialize["Cron"] = val } if val, ok := getSnapshotScheduleGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } return toSerialize, nil } type NullableSnapshotSchedule struct { value *SnapshotSchedule isSet bool } func (v NullableSnapshotSchedule) Get() *SnapshotSchedule { return v.value } func (v *NullableSnapshotSchedule) Set(val *SnapshotSchedule) { v.value = val v.isSet = true } func (v NullableSnapshotSchedule) IsSet() bool { return v.isSet } func (v *NullableSnapshotSchedule) Unset() { v.value = nil v.isSet = false } func NewNullableSnapshotSchedule(val *SnapshotSchedule) *NullableSnapshotSchedule { return &NullableSnapshotSchedule{value: val, isSet: true} } func (v NullableSnapshotSchedule) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableSnapshotSchedule) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }