mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-09-14 23:00:31 -04:00
308 lines
9.6 KiB
Go
308 lines
9.6 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"
|
|
"bytes"
|
|
"fmt"
|
|
)
|
|
|
|
// checks if the LivePhoto type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &LivePhoto{}
|
|
|
|
// LivePhoto Apple Live Photo metadata. A Live Photo is a pair of files sharing one content identifier: a still image (HEIC or JPEG) and a short QuickTime video. Unlike a Motion Photo, the two parts are separate driveItems. The presence of this facet indicates the item was captured as part of a Live Photo; the counterpart is the driveItem whose livePhoto facet carries the same contentId. Whether an item is the still image or the video half follows from its photo/video facets and MIME type. There is no public file format specification; the metadata keys are documented as AVFoundation metadata identifiers: https://developer.apple.com/documentation/avfoundation/avmetadataidentifier On the still image they are stored in the Apple maker note, on the video as com.apple.quicktime.* QuickTime metadata keys.
|
|
type LivePhoto struct {
|
|
// Identifier (UUID) shared by the still image and the paired video of one Live Photo. Read-only.
|
|
ContentId string `json:"contentId"`
|
|
// Time in microseconds within the paired video at which the still image was captured. The value comes from the video file only: it is the presentation time of the com.apple.quicktime.still-image-time timed metadata sample in the QuickTime movie, so it is only present on the video half. The still image carries no reliable equivalent (the Apple maker note tag 0x0017, historically documented as a derivable video index, does not encode a usable time on current iOS versions). If absent, readers should use a timestamp near the middle of the video track. Read-only.
|
|
StillImageTimeUs *int64 `json:"stillImageTimeUs,omitempty"`
|
|
// True if the device decided automatically whether to capture the Live Photo video (com.apple.quicktime.live-photo.auto). Only present on the video half. Read-only.
|
|
Auto *bool `json:"auto,omitempty"`
|
|
// Score between 0 and 1 rating how interesting the motion clip is, used by readers to decide whether to autoplay it (com.apple.quicktime.live-photo.vitality-score). Only present on the video half. Read-only.
|
|
VitalityScore *float64 `json:"vitalityScore,omitempty"`
|
|
// Version of the algorithm that produced vitalityScore (com.apple.quicktime.live-photo.vitality-scoring-version). Only present on the video half. Read-only.
|
|
VitalityScoringVersion *int64 `json:"vitalityScoringVersion,omitempty"`
|
|
}
|
|
|
|
type _LivePhoto LivePhoto
|
|
|
|
// NewLivePhoto instantiates a new LivePhoto 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 NewLivePhoto(contentId string) *LivePhoto {
|
|
this := LivePhoto{}
|
|
this.ContentId = contentId
|
|
return &this
|
|
}
|
|
|
|
// NewLivePhotoWithDefaults instantiates a new LivePhoto 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 NewLivePhotoWithDefaults() *LivePhoto {
|
|
this := LivePhoto{}
|
|
return &this
|
|
}
|
|
|
|
// GetContentId returns the ContentId field value
|
|
func (o *LivePhoto) GetContentId() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.ContentId
|
|
}
|
|
|
|
// GetContentIdOk returns a tuple with the ContentId field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LivePhoto) GetContentIdOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.ContentId, true
|
|
}
|
|
|
|
// SetContentId sets field value
|
|
func (o *LivePhoto) SetContentId(v string) {
|
|
o.ContentId = v
|
|
}
|
|
|
|
// GetStillImageTimeUs returns the StillImageTimeUs field value if set, zero value otherwise.
|
|
func (o *LivePhoto) GetStillImageTimeUs() int64 {
|
|
if o == nil || IsNil(o.StillImageTimeUs) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.StillImageTimeUs
|
|
}
|
|
|
|
// GetStillImageTimeUsOk returns a tuple with the StillImageTimeUs field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LivePhoto) GetStillImageTimeUsOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.StillImageTimeUs) {
|
|
return nil, false
|
|
}
|
|
return o.StillImageTimeUs, true
|
|
}
|
|
|
|
// HasStillImageTimeUs returns a boolean if a field has been set.
|
|
func (o *LivePhoto) HasStillImageTimeUs() bool {
|
|
if o != nil && !IsNil(o.StillImageTimeUs) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetStillImageTimeUs gets a reference to the given int64 and assigns it to the StillImageTimeUs field.
|
|
func (o *LivePhoto) SetStillImageTimeUs(v int64) {
|
|
o.StillImageTimeUs = &v
|
|
}
|
|
|
|
// GetAuto returns the Auto field value if set, zero value otherwise.
|
|
func (o *LivePhoto) GetAuto() bool {
|
|
if o == nil || IsNil(o.Auto) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Auto
|
|
}
|
|
|
|
// GetAutoOk returns a tuple with the Auto field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LivePhoto) GetAutoOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Auto) {
|
|
return nil, false
|
|
}
|
|
return o.Auto, true
|
|
}
|
|
|
|
// HasAuto returns a boolean if a field has been set.
|
|
func (o *LivePhoto) HasAuto() bool {
|
|
if o != nil && !IsNil(o.Auto) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAuto gets a reference to the given bool and assigns it to the Auto field.
|
|
func (o *LivePhoto) SetAuto(v bool) {
|
|
o.Auto = &v
|
|
}
|
|
|
|
// GetVitalityScore returns the VitalityScore field value if set, zero value otherwise.
|
|
func (o *LivePhoto) GetVitalityScore() float64 {
|
|
if o == nil || IsNil(o.VitalityScore) {
|
|
var ret float64
|
|
return ret
|
|
}
|
|
return *o.VitalityScore
|
|
}
|
|
|
|
// GetVitalityScoreOk returns a tuple with the VitalityScore field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LivePhoto) GetVitalityScoreOk() (*float64, bool) {
|
|
if o == nil || IsNil(o.VitalityScore) {
|
|
return nil, false
|
|
}
|
|
return o.VitalityScore, true
|
|
}
|
|
|
|
// HasVitalityScore returns a boolean if a field has been set.
|
|
func (o *LivePhoto) HasVitalityScore() bool {
|
|
if o != nil && !IsNil(o.VitalityScore) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVitalityScore gets a reference to the given float64 and assigns it to the VitalityScore field.
|
|
func (o *LivePhoto) SetVitalityScore(v float64) {
|
|
o.VitalityScore = &v
|
|
}
|
|
|
|
// GetVitalityScoringVersion returns the VitalityScoringVersion field value if set, zero value otherwise.
|
|
func (o *LivePhoto) GetVitalityScoringVersion() int64 {
|
|
if o == nil || IsNil(o.VitalityScoringVersion) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.VitalityScoringVersion
|
|
}
|
|
|
|
// GetVitalityScoringVersionOk returns a tuple with the VitalityScoringVersion field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *LivePhoto) GetVitalityScoringVersionOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.VitalityScoringVersion) {
|
|
return nil, false
|
|
}
|
|
return o.VitalityScoringVersion, true
|
|
}
|
|
|
|
// HasVitalityScoringVersion returns a boolean if a field has been set.
|
|
func (o *LivePhoto) HasVitalityScoringVersion() bool {
|
|
if o != nil && !IsNil(o.VitalityScoringVersion) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVitalityScoringVersion gets a reference to the given int64 and assigns it to the VitalityScoringVersion field.
|
|
func (o *LivePhoto) SetVitalityScoringVersion(v int64) {
|
|
o.VitalityScoringVersion = &v
|
|
}
|
|
|
|
func (o LivePhoto) MarshalJSON() ([]byte, error) {
|
|
toSerialize,err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o LivePhoto) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["contentId"] = o.ContentId
|
|
if !IsNil(o.StillImageTimeUs) {
|
|
toSerialize["stillImageTimeUs"] = o.StillImageTimeUs
|
|
}
|
|
if !IsNil(o.Auto) {
|
|
toSerialize["auto"] = o.Auto
|
|
}
|
|
if !IsNil(o.VitalityScore) {
|
|
toSerialize["vitalityScore"] = o.VitalityScore
|
|
}
|
|
if !IsNil(o.VitalityScoringVersion) {
|
|
toSerialize["vitalityScoringVersion"] = o.VitalityScoringVersion
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *LivePhoto) UnmarshalJSON(data []byte) (err error) {
|
|
// This validates that all required properties are included in the JSON object
|
|
// by unmarshalling the object into a generic map with string keys and checking
|
|
// that every required field exists as a key in the generic map.
|
|
requiredProperties := []string{
|
|
"contentId",
|
|
}
|
|
|
|
allProperties := make(map[string]interface{})
|
|
|
|
err = json.Unmarshal(data, &allProperties)
|
|
|
|
if err != nil {
|
|
return err;
|
|
}
|
|
|
|
for _, requiredProperty := range(requiredProperties) {
|
|
if _, exists := allProperties[requiredProperty]; !exists {
|
|
return fmt.Errorf("no value given for required property %v", requiredProperty)
|
|
}
|
|
}
|
|
|
|
varLivePhoto := _LivePhoto{}
|
|
|
|
decoder := json.NewDecoder(bytes.NewReader(data))
|
|
decoder.DisallowUnknownFields()
|
|
err = decoder.Decode(&varLivePhoto)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = LivePhoto(varLivePhoto)
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableLivePhoto struct {
|
|
value *LivePhoto
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableLivePhoto) Get() *LivePhoto {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableLivePhoto) Set(val *LivePhoto) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableLivePhoto) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableLivePhoto) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableLivePhoto(val *LivePhoto) *NullableLivePhoto {
|
|
return &NullableLivePhoto{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableLivePhoto) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableLivePhoto) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|
|
|