mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-09-13 06:09:21 -04:00
191 lines
4.4 KiB
Go
191 lines
4.4 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 ActivityTopic type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ActivityTopic{}
|
|
|
|
// ActivityTopic What an activity happened on.
|
|
type ActivityTopic struct {
|
|
// How to read the value. Only `text` is supported at the time of writing. built from it.
|
|
Source string `json:"source"`
|
|
// With the source `text`, the id of the resource the activity happened on.
|
|
Value string `json:"value"`
|
|
}
|
|
|
|
type _ActivityTopic ActivityTopic
|
|
|
|
// NewActivityTopic instantiates a new ActivityTopic 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 NewActivityTopic(source string, value string) *ActivityTopic {
|
|
this := ActivityTopic{}
|
|
this.Source = source
|
|
this.Value = value
|
|
return &this
|
|
}
|
|
|
|
// NewActivityTopicWithDefaults instantiates a new ActivityTopic 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 NewActivityTopicWithDefaults() *ActivityTopic {
|
|
this := ActivityTopic{}
|
|
var source string = "text"
|
|
this.Source = source
|
|
return &this
|
|
}
|
|
|
|
// GetSource returns the Source field value
|
|
func (o *ActivityTopic) GetSource() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Source
|
|
}
|
|
|
|
// GetSourceOk returns a tuple with the Source field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ActivityTopic) GetSourceOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Source, true
|
|
}
|
|
|
|
// SetSource sets field value
|
|
func (o *ActivityTopic) SetSource(v string) {
|
|
o.Source = v
|
|
}
|
|
|
|
// GetValue returns the Value field value
|
|
func (o *ActivityTopic) GetValue() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.Value
|
|
}
|
|
|
|
// GetValueOk returns a tuple with the Value field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ActivityTopic) GetValueOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Value, true
|
|
}
|
|
|
|
// SetValue sets field value
|
|
func (o *ActivityTopic) SetValue(v string) {
|
|
o.Value = v
|
|
}
|
|
|
|
func (o ActivityTopic) MarshalJSON() ([]byte, error) {
|
|
toSerialize,err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ActivityTopic) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["source"] = o.Source
|
|
toSerialize["value"] = o.Value
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ActivityTopic) 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{
|
|
"source",
|
|
"value",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varActivityTopic := _ActivityTopic{}
|
|
|
|
decoder := json.NewDecoder(bytes.NewReader(data))
|
|
decoder.DisallowUnknownFields()
|
|
err = decoder.Decode(&varActivityTopic)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ActivityTopic(varActivityTopic)
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableActivityTopic struct {
|
|
value *ActivityTopic
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableActivityTopic) Get() *ActivityTopic {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableActivityTopic) Set(val *ActivityTopic) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableActivityTopic) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableActivityTopic) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableActivityTopic(val *ActivityTopic) *NullableActivityTopic {
|
|
return &NullableActivityTopic{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableActivityTopic) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableActivityTopic) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|
|
|