Files
opencloud/vendor/github.com/opencloud-eu/libre-graph-api-go/model_lock_info.go
T

277 lines
7.7 KiB
Go

/*
Libre Graph API
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
API version: v1.0.8
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package libregraph
import (
"encoding/json"
"time"
)
// checks if the LockInfo type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LockInfo{}
// LockInfo Read-only lock metadata for a file, matching the MS Graph beta lockInfo resource. Indicates whether the file is locked, the kind of lock, when it was created, when it expires and who holds it.
type LockInfo struct {
// The type of lock currently held on the file. OpenCloud currently only issues exclusive locks, same as MS Graph, even if it defines more. Read-only.
LockType *string `json:"lockType,omitempty"`
// The date and time when the lock was created, in UTC. Read-only.
CreatedDateTime *time.Time `json:"createdDateTime,omitempty"`
// The date and time when the lock expires, in UTC. Read-only.
ExpirationDateTime *time.Time `json:"expirationDateTime,omitempty"`
// The collection of users that currently hold the lock on the file. Read-only.
Owners []Identity `json:"owners,omitempty"`
// Name of the application holding the lock, for example an office application. Not part of MS Graph. Read-only.
LibreGraphAppName *string `json:"@libre.graph.appName,omitempty"`
}
// NewLockInfo instantiates a new LockInfo 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 NewLockInfo() *LockInfo {
this := LockInfo{}
return &this
}
// NewLockInfoWithDefaults instantiates a new LockInfo 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 NewLockInfoWithDefaults() *LockInfo {
this := LockInfo{}
return &this
}
// GetLockType returns the LockType field value if set, zero value otherwise.
func (o *LockInfo) GetLockType() string {
if o == nil || IsNil(o.LockType) {
var ret string
return ret
}
return *o.LockType
}
// GetLockTypeOk returns a tuple with the LockType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LockInfo) GetLockTypeOk() (*string, bool) {
if o == nil || IsNil(o.LockType) {
return nil, false
}
return o.LockType, true
}
// HasLockType returns a boolean if a field has been set.
func (o *LockInfo) HasLockType() bool {
if o != nil && !IsNil(o.LockType) {
return true
}
return false
}
// SetLockType gets a reference to the given string and assigns it to the LockType field.
func (o *LockInfo) SetLockType(v string) {
o.LockType = &v
}
// GetCreatedDateTime returns the CreatedDateTime field value if set, zero value otherwise.
func (o *LockInfo) GetCreatedDateTime() time.Time {
if o == nil || IsNil(o.CreatedDateTime) {
var ret time.Time
return ret
}
return *o.CreatedDateTime
}
// GetCreatedDateTimeOk returns a tuple with the CreatedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LockInfo) GetCreatedDateTimeOk() (*time.Time, bool) {
if o == nil || IsNil(o.CreatedDateTime) {
return nil, false
}
return o.CreatedDateTime, true
}
// HasCreatedDateTime returns a boolean if a field has been set.
func (o *LockInfo) HasCreatedDateTime() bool {
if o != nil && !IsNil(o.CreatedDateTime) {
return true
}
return false
}
// SetCreatedDateTime gets a reference to the given time.Time and assigns it to the CreatedDateTime field.
func (o *LockInfo) SetCreatedDateTime(v time.Time) {
o.CreatedDateTime = &v
}
// GetExpirationDateTime returns the ExpirationDateTime field value if set, zero value otherwise.
func (o *LockInfo) GetExpirationDateTime() time.Time {
if o == nil || IsNil(o.ExpirationDateTime) {
var ret time.Time
return ret
}
return *o.ExpirationDateTime
}
// GetExpirationDateTimeOk returns a tuple with the ExpirationDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LockInfo) GetExpirationDateTimeOk() (*time.Time, bool) {
if o == nil || IsNil(o.ExpirationDateTime) {
return nil, false
}
return o.ExpirationDateTime, true
}
// HasExpirationDateTime returns a boolean if a field has been set.
func (o *LockInfo) HasExpirationDateTime() bool {
if o != nil && !IsNil(o.ExpirationDateTime) {
return true
}
return false
}
// SetExpirationDateTime gets a reference to the given time.Time and assigns it to the ExpirationDateTime field.
func (o *LockInfo) SetExpirationDateTime(v time.Time) {
o.ExpirationDateTime = &v
}
// GetOwners returns the Owners field value if set, zero value otherwise.
func (o *LockInfo) GetOwners() []Identity {
if o == nil || IsNil(o.Owners) {
var ret []Identity
return ret
}
return o.Owners
}
// GetOwnersOk returns a tuple with the Owners field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LockInfo) GetOwnersOk() ([]Identity, bool) {
if o == nil || IsNil(o.Owners) {
return nil, false
}
return o.Owners, true
}
// HasOwners returns a boolean if a field has been set.
func (o *LockInfo) HasOwners() bool {
if o != nil && !IsNil(o.Owners) {
return true
}
return false
}
// SetOwners gets a reference to the given []Identity and assigns it to the Owners field.
func (o *LockInfo) SetOwners(v []Identity) {
o.Owners = v
}
// GetLibreGraphAppName returns the LibreGraphAppName field value if set, zero value otherwise.
func (o *LockInfo) GetLibreGraphAppName() string {
if o == nil || IsNil(o.LibreGraphAppName) {
var ret string
return ret
}
return *o.LibreGraphAppName
}
// GetLibreGraphAppNameOk returns a tuple with the LibreGraphAppName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LockInfo) GetLibreGraphAppNameOk() (*string, bool) {
if o == nil || IsNil(o.LibreGraphAppName) {
return nil, false
}
return o.LibreGraphAppName, true
}
// HasLibreGraphAppName returns a boolean if a field has been set.
func (o *LockInfo) HasLibreGraphAppName() bool {
if o != nil && !IsNil(o.LibreGraphAppName) {
return true
}
return false
}
// SetLibreGraphAppName gets a reference to the given string and assigns it to the LibreGraphAppName field.
func (o *LockInfo) SetLibreGraphAppName(v string) {
o.LibreGraphAppName = &v
}
func (o LockInfo) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LockInfo) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.LockType) {
toSerialize["lockType"] = o.LockType
}
if !IsNil(o.CreatedDateTime) {
toSerialize["createdDateTime"] = o.CreatedDateTime
}
if !IsNil(o.ExpirationDateTime) {
toSerialize["expirationDateTime"] = o.ExpirationDateTime
}
if !IsNil(o.Owners) {
toSerialize["owners"] = o.Owners
}
if !IsNil(o.LibreGraphAppName) {
toSerialize["@libre.graph.appName"] = o.LibreGraphAppName
}
return toSerialize, nil
}
type NullableLockInfo struct {
value *LockInfo
isSet bool
}
func (v NullableLockInfo) Get() *LockInfo {
return v.value
}
func (v *NullableLockInfo) Set(val *LockInfo) {
v.value = val
v.isSet = true
}
func (v NullableLockInfo) IsSet() bool {
return v.isSet
}
func (v *NullableLockInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLockInfo(val *LockInfo) *NullableLockInfo {
return &NullableLockInfo{value: val, isSet: true}
}
func (v NullableLockInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLockInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}