mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-09-13 06:09:21 -04:00
217 lines
5.5 KiB
Go
217 lines
5.5 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 ActivityNotification type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &ActivityNotification{}
|
|
|
|
// ActivityNotification An activity someone is notified about.
|
|
type ActivityNotification struct {
|
|
Topic ActivityTopic `json:"topic"`
|
|
// What happened. Only `mentioned` is supported at the time of writing.
|
|
ActivityType string `json:"activityType"`
|
|
// The app the activity happened in, as an id the server knows.
|
|
TeamsAppId string `json:"teamsAppId"`
|
|
}
|
|
|
|
type _ActivityNotification ActivityNotification
|
|
|
|
// NewActivityNotification instantiates a new ActivityNotification 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 NewActivityNotification(topic ActivityTopic, activityType string, teamsAppId string) *ActivityNotification {
|
|
this := ActivityNotification{}
|
|
this.Topic = topic
|
|
this.ActivityType = activityType
|
|
this.TeamsAppId = teamsAppId
|
|
return &this
|
|
}
|
|
|
|
// NewActivityNotificationWithDefaults instantiates a new ActivityNotification 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 NewActivityNotificationWithDefaults() *ActivityNotification {
|
|
this := ActivityNotification{}
|
|
return &this
|
|
}
|
|
|
|
// GetTopic returns the Topic field value
|
|
func (o *ActivityNotification) GetTopic() ActivityTopic {
|
|
if o == nil {
|
|
var ret ActivityTopic
|
|
return ret
|
|
}
|
|
|
|
return o.Topic
|
|
}
|
|
|
|
// GetTopicOk returns a tuple with the Topic field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ActivityNotification) GetTopicOk() (*ActivityTopic, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.Topic, true
|
|
}
|
|
|
|
// SetTopic sets field value
|
|
func (o *ActivityNotification) SetTopic(v ActivityTopic) {
|
|
o.Topic = v
|
|
}
|
|
|
|
// GetActivityType returns the ActivityType field value
|
|
func (o *ActivityNotification) GetActivityType() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.ActivityType
|
|
}
|
|
|
|
// GetActivityTypeOk returns a tuple with the ActivityType field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ActivityNotification) GetActivityTypeOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.ActivityType, true
|
|
}
|
|
|
|
// SetActivityType sets field value
|
|
func (o *ActivityNotification) SetActivityType(v string) {
|
|
o.ActivityType = v
|
|
}
|
|
|
|
// GetTeamsAppId returns the TeamsAppId field value
|
|
func (o *ActivityNotification) GetTeamsAppId() string {
|
|
if o == nil {
|
|
var ret string
|
|
return ret
|
|
}
|
|
|
|
return o.TeamsAppId
|
|
}
|
|
|
|
// GetTeamsAppIdOk returns a tuple with the TeamsAppId field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *ActivityNotification) GetTeamsAppIdOk() (*string, bool) {
|
|
if o == nil {
|
|
return nil, false
|
|
}
|
|
return &o.TeamsAppId, true
|
|
}
|
|
|
|
// SetTeamsAppId sets field value
|
|
func (o *ActivityNotification) SetTeamsAppId(v string) {
|
|
o.TeamsAppId = v
|
|
}
|
|
|
|
func (o ActivityNotification) MarshalJSON() ([]byte, error) {
|
|
toSerialize,err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o ActivityNotification) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
toSerialize["topic"] = o.Topic
|
|
toSerialize["activityType"] = o.ActivityType
|
|
toSerialize["teamsAppId"] = o.TeamsAppId
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *ActivityNotification) 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{
|
|
"topic",
|
|
"activityType",
|
|
"teamsAppId",
|
|
}
|
|
|
|
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)
|
|
}
|
|
}
|
|
|
|
varActivityNotification := _ActivityNotification{}
|
|
|
|
decoder := json.NewDecoder(bytes.NewReader(data))
|
|
decoder.DisallowUnknownFields()
|
|
err = decoder.Decode(&varActivityNotification)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = ActivityNotification(varActivityNotification)
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableActivityNotification struct {
|
|
value *ActivityNotification
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableActivityNotification) Get() *ActivityNotification {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableActivityNotification) Set(val *ActivityNotification) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableActivityNotification) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableActivityNotification) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableActivityNotification(val *ActivityNotification) *NullableActivityNotification {
|
|
return &NullableActivityNotification{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableActivityNotification) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableActivityNotification) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|
|
|
|
|