From 0d604dfb9b515146a749c03c21f2d25f5467b675 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 19 Jun 2024 10:43:25 +0200 Subject: [PATCH] feat(ocis): bump libre-graph-api-go Signed-off-by: jkoberg --- go.mod | 2 +- go.sum | 4 +- .../owncloud/libre-graph-api-go/README.md | 5 + .../libre-graph-api-go/api_activities.go | 137 +++++++++++ .../owncloud/libre-graph-api-go/client.go | 3 + .../libre-graph-api-go/model_activity.go | 213 ++++++++++++++++++ .../model_activity_template.go | 194 ++++++++++++++++ .../model_activity_times.go | 158 +++++++++++++ .../model_collection_of_activities.go | 124 ++++++++++ vendor/modules.txt | 2 +- 10 files changed, 838 insertions(+), 4 deletions(-) create mode 100644 vendor/github.com/owncloud/libre-graph-api-go/api_activities.go create mode 100644 vendor/github.com/owncloud/libre-graph-api-go/model_activity.go create mode 100644 vendor/github.com/owncloud/libre-graph-api-go/model_activity_template.go create mode 100644 vendor/github.com/owncloud/libre-graph-api-go/model_activity_times.go create mode 100644 vendor/github.com/owncloud/libre-graph-api-go/model_collection_of_activities.go diff --git a/go.mod b/go.mod index b8792fbb0..20a0e946c 100644 --- a/go.mod +++ b/go.mod @@ -72,7 +72,7 @@ require ( github.com/onsi/gomega v1.33.1 github.com/open-policy-agent/opa v0.65.0 github.com/orcaman/concurrent-map v1.0.0 - github.com/owncloud/libre-graph-api-go v1.0.5-0.20240529101512-a631b9eeddb3 + github.com/owncloud/libre-graph-api-go v1.0.5-0.20240618162722-2298241331d1 github.com/pkg/errors v0.9.1 github.com/pkg/xattr v0.4.9 github.com/prometheus/client_golang v1.19.1 diff --git a/go.sum b/go.sum index 99a2eec78..a016609a2 100644 --- a/go.sum +++ b/go.sum @@ -1805,8 +1805,8 @@ github.com/oracle/oci-go-sdk v24.3.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35uk github.com/orcaman/concurrent-map v1.0.0 h1:I/2A2XPCb4IuQWcQhBhSwGfiuybl/J0ev9HDbW65HOY= github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= github.com/ovh/go-ovh v1.1.0/go.mod h1:AxitLZ5HBRPyUd+Zl60Ajaag+rNTdVXWIkzfrVuTXWA= -github.com/owncloud/libre-graph-api-go v1.0.5-0.20240529101512-a631b9eeddb3 h1:2pMI03tU/IWc+Y4p1doTaTE1zrAR55RYOzYrt57/aPA= -github.com/owncloud/libre-graph-api-go v1.0.5-0.20240529101512-a631b9eeddb3/go.mod h1:yXI+rmE8yYx+ZsGVrnCpprw/gZMcxjwntnX2y2+VKxY= +github.com/owncloud/libre-graph-api-go v1.0.5-0.20240618162722-2298241331d1 h1:w1OhLyFevK8NCYn50TEsDpInk/T6qVk/v1LDca6Zx8Y= +github.com/owncloud/libre-graph-api-go v1.0.5-0.20240618162722-2298241331d1/go.mod h1:yXI+rmE8yYx+ZsGVrnCpprw/gZMcxjwntnX2y2+VKxY= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= github.com/pablodz/inotifywaitgo v0.0.6 h1:BTjQfnixXwG7oYmlIiyhWA6iyO9BtxatB3YgiibOTFc= diff --git a/vendor/github.com/owncloud/libre-graph-api-go/README.md b/vendor/github.com/owncloud/libre-graph-api-go/README.md index d1e630879..c6ceee694 100644 --- a/vendor/github.com/owncloud/libre-graph-api-go/README.md +++ b/vendor/github.com/owncloud/libre-graph-api-go/README.md @@ -78,6 +78,7 @@ All URIs are relative to *https://ocis.ocis-traefik.latest.owncloud.works/graph* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*ActivitiesApi* | [**GetActivities**](docs/ActivitiesApi.md#getactivities) | **Get** /v1beta1/extensions/org.libregraph/activities | Get activities *ApplicationsApi* | [**GetApplication**](docs/ApplicationsApi.md#getapplication) | **Get** /v1.0/applications/{application-id} | Get application by id *ApplicationsApi* | [**ListApplications**](docs/ApplicationsApi.md#listapplications) | **Get** /v1.0/applications | Get all applications *DriveItemApi* | [**DeleteDriveItem**](docs/DriveItemApi.md#deletedriveitem) | **Delete** /v1beta1/drives/{drive-id}/items/{item-id} | Delete a DriveItem. @@ -168,6 +169,9 @@ Class | Method | HTTP request | Description ## Documentation For Models + - [Activity](docs/Activity.md) + - [ActivityTemplate](docs/ActivityTemplate.md) + - [ActivityTimes](docs/ActivityTimes.md) - [AppRole](docs/AppRole.md) - [AppRoleAssignment](docs/AppRoleAssignment.md) - [Application](docs/Application.md) @@ -175,6 +179,7 @@ Class | Method | HTTP request | Description - [ClassMemberReference](docs/ClassMemberReference.md) - [ClassReference](docs/ClassReference.md) - [ClassTeacherReference](docs/ClassTeacherReference.md) + - [CollectionOfActivities](docs/CollectionOfActivities.md) - [CollectionOfAppRoleAssignments](docs/CollectionOfAppRoleAssignments.md) - [CollectionOfApplications](docs/CollectionOfApplications.md) - [CollectionOfClass](docs/CollectionOfClass.md) diff --git a/vendor/github.com/owncloud/libre-graph-api-go/api_activities.go b/vendor/github.com/owncloud/libre-graph-api-go/api_activities.go new file mode 100644 index 000000000..7b859a7b2 --- /dev/null +++ b/vendor/github.com/owncloud/libre-graph-api-go/api_activities.go @@ -0,0 +1,137 @@ +/* +Libre Graph API + +Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + +API version: v1.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package libregraph + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + +// ActivitiesApiService ActivitiesApi service +type ActivitiesApiService service + +type ApiGetActivitiesRequest struct { + ctx context.Context + ApiService *ActivitiesApiService + kql *string +} + +func (r ApiGetActivitiesRequest) Kql(kql string) ApiGetActivitiesRequest { + r.kql = &kql + return r +} + +func (r ApiGetActivitiesRequest) Execute() (*CollectionOfActivities, *http.Response, error) { + return r.ApiService.GetActivitiesExecute(r) +} + +/* +GetActivities Get activities + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiGetActivitiesRequest +*/ +func (a *ActivitiesApiService) GetActivities(ctx context.Context) ApiGetActivitiesRequest { + return ApiGetActivitiesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return CollectionOfActivities +func (a *ActivitiesApiService) GetActivitiesExecute(r ApiGetActivitiesRequest) (*CollectionOfActivities, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CollectionOfActivities + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActivitiesApiService.GetActivities") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1beta1/extensions/org.libregraph/activities" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.kql != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "kql", r.kql, "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + var v OdataError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/vendor/github.com/owncloud/libre-graph-api-go/client.go b/vendor/github.com/owncloud/libre-graph-api-go/client.go index fcfbb7b78..285f371c1 100644 --- a/vendor/github.com/owncloud/libre-graph-api-go/client.go +++ b/vendor/github.com/owncloud/libre-graph-api-go/client.go @@ -48,6 +48,8 @@ type APIClient struct { // API Services + ActivitiesApi *ActivitiesApiService + ApplicationsApi *ApplicationsApiService DriveItemApi *DriveItemApiService @@ -111,6 +113,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services + c.ActivitiesApi = (*ActivitiesApiService)(&c.common) c.ApplicationsApi = (*ApplicationsApiService)(&c.common) c.DriveItemApi = (*DriveItemApiService)(&c.common) c.DrivesApi = (*DrivesApiService)(&c.common) diff --git a/vendor/github.com/owncloud/libre-graph-api-go/model_activity.go b/vendor/github.com/owncloud/libre-graph-api-go/model_activity.go new file mode 100644 index 000000000..74d4b8590 --- /dev/null +++ b/vendor/github.com/owncloud/libre-graph-api-go/model_activity.go @@ -0,0 +1,213 @@ +/* +Libre Graph API + +Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + +API version: v1.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package libregraph + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Activity type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Activity{} + +// Activity Represents activity. +type Activity struct { + // Activity ID. + Id string `json:"id"` + Times ActivityTimes `json:"times"` + Template ActivityTemplate `json:"template"` +} + +type _Activity Activity + +// NewActivity instantiates a new Activity 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 NewActivity(id string, times ActivityTimes, template ActivityTemplate) *Activity { + this := Activity{} + this.Id = id + this.Times = times + this.Template = template + return &this +} + +// NewActivityWithDefaults instantiates a new Activity 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 NewActivityWithDefaults() *Activity { + this := Activity{} + return &this +} + +// GetId returns the Id field value +func (o *Activity) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Activity) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Activity) SetId(v string) { + o.Id = v +} + +// GetTimes returns the Times field value +func (o *Activity) GetTimes() ActivityTimes { + if o == nil { + var ret ActivityTimes + return ret + } + + return o.Times +} + +// GetTimesOk returns a tuple with the Times field value +// and a boolean to check if the value has been set. +func (o *Activity) GetTimesOk() (*ActivityTimes, bool) { + if o == nil { + return nil, false + } + return &o.Times, true +} + +// SetTimes sets field value +func (o *Activity) SetTimes(v ActivityTimes) { + o.Times = v +} + +// GetTemplate returns the Template field value +func (o *Activity) GetTemplate() ActivityTemplate { + if o == nil { + var ret ActivityTemplate + return ret + } + + return o.Template +} + +// GetTemplateOk returns a tuple with the Template field value +// and a boolean to check if the value has been set. +func (o *Activity) GetTemplateOk() (*ActivityTemplate, bool) { + if o == nil { + return nil, false + } + return &o.Template, true +} + +// SetTemplate sets field value +func (o *Activity) SetTemplate(v ActivityTemplate) { + o.Template = v +} + +func (o Activity) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Activity) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["times"] = o.Times + toSerialize["template"] = o.Template + return toSerialize, nil +} + +func (o *Activity) 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{ + "id", + "times", + "template", + } + + 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) + } + } + + varActivity := _Activity{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActivity) + + if err != nil { + return err + } + + *o = Activity(varActivity) + + return err +} + +type NullableActivity struct { + value *Activity + isSet bool +} + +func (v NullableActivity) Get() *Activity { + return v.value +} + +func (v *NullableActivity) Set(val *Activity) { + v.value = val + v.isSet = true +} + +func (v NullableActivity) IsSet() bool { + return v.isSet +} + +func (v *NullableActivity) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActivity(val *Activity) *NullableActivity { + return &NullableActivity{value: val, isSet: true} +} + +func (v NullableActivity) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActivity) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/owncloud/libre-graph-api-go/model_activity_template.go b/vendor/github.com/owncloud/libre-graph-api-go/model_activity_template.go new file mode 100644 index 000000000..75bcadb89 --- /dev/null +++ b/vendor/github.com/owncloud/libre-graph-api-go/model_activity_template.go @@ -0,0 +1,194 @@ +/* +Libre Graph API + +Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + +API version: v1.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package libregraph + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ActivityTemplate type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActivityTemplate{} + +// ActivityTemplate struct for ActivityTemplate +type ActivityTemplate struct { + // Activity description. + Message string `json:"message"` + // Activity description variables. + Variables map[string]interface{} `json:"variables,omitempty"` +} + +type _ActivityTemplate ActivityTemplate + +// NewActivityTemplate instantiates a new ActivityTemplate 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 NewActivityTemplate(message string) *ActivityTemplate { + this := ActivityTemplate{} + this.Message = message + return &this +} + +// NewActivityTemplateWithDefaults instantiates a new ActivityTemplate 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 NewActivityTemplateWithDefaults() *ActivityTemplate { + this := ActivityTemplate{} + return &this +} + +// GetMessage returns the Message field value +func (o *ActivityTemplate) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ActivityTemplate) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *ActivityTemplate) SetMessage(v string) { + o.Message = v +} + +// GetVariables returns the Variables field value if set, zero value otherwise. +func (o *ActivityTemplate) GetVariables() map[string]interface{} { + if o == nil || IsNil(o.Variables) { + var ret map[string]interface{} + return ret + } + return o.Variables +} + +// GetVariablesOk returns a tuple with the Variables field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ActivityTemplate) GetVariablesOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Variables) { + return map[string]interface{}{}, false + } + return o.Variables, true +} + +// HasVariables returns a boolean if a field has been set. +func (o *ActivityTemplate) HasVariables() bool { + if o != nil && !IsNil(o.Variables) { + return true + } + + return false +} + +// SetVariables gets a reference to the given map[string]interface{} and assigns it to the Variables field. +func (o *ActivityTemplate) SetVariables(v map[string]interface{}) { + o.Variables = v +} + +func (o ActivityTemplate) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActivityTemplate) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + if !IsNil(o.Variables) { + toSerialize["variables"] = o.Variables + } + return toSerialize, nil +} + +func (o *ActivityTemplate) 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{ + "message", + } + + 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) + } + } + + varActivityTemplate := _ActivityTemplate{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActivityTemplate) + + if err != nil { + return err + } + + *o = ActivityTemplate(varActivityTemplate) + + return err +} + +type NullableActivityTemplate struct { + value *ActivityTemplate + isSet bool +} + +func (v NullableActivityTemplate) Get() *ActivityTemplate { + return v.value +} + +func (v *NullableActivityTemplate) Set(val *ActivityTemplate) { + v.value = val + v.isSet = true +} + +func (v NullableActivityTemplate) IsSet() bool { + return v.isSet +} + +func (v *NullableActivityTemplate) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActivityTemplate(val *ActivityTemplate) *NullableActivityTemplate { + return &NullableActivityTemplate{value: val, isSet: true} +} + +func (v NullableActivityTemplate) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActivityTemplate) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/owncloud/libre-graph-api-go/model_activity_times.go b/vendor/github.com/owncloud/libre-graph-api-go/model_activity_times.go new file mode 100644 index 000000000..d6970a375 --- /dev/null +++ b/vendor/github.com/owncloud/libre-graph-api-go/model_activity_times.go @@ -0,0 +1,158 @@ +/* +Libre Graph API + +Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + +API version: v1.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package libregraph + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the ActivityTimes type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ActivityTimes{} + +// ActivityTimes struct for ActivityTimes +type ActivityTimes struct { + // Timestamp of the activity. + RecordedTime time.Time `json:"recordedTime"` +} + +type _ActivityTimes ActivityTimes + +// NewActivityTimes instantiates a new ActivityTimes 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 NewActivityTimes(recordedTime time.Time) *ActivityTimes { + this := ActivityTimes{} + this.RecordedTime = recordedTime + return &this +} + +// NewActivityTimesWithDefaults instantiates a new ActivityTimes 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 NewActivityTimesWithDefaults() *ActivityTimes { + this := ActivityTimes{} + return &this +} + +// GetRecordedTime returns the RecordedTime field value +func (o *ActivityTimes) GetRecordedTime() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.RecordedTime +} + +// GetRecordedTimeOk returns a tuple with the RecordedTime field value +// and a boolean to check if the value has been set. +func (o *ActivityTimes) GetRecordedTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.RecordedTime, true +} + +// SetRecordedTime sets field value +func (o *ActivityTimes) SetRecordedTime(v time.Time) { + o.RecordedTime = v +} + +func (o ActivityTimes) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ActivityTimes) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["recordedTime"] = o.RecordedTime + return toSerialize, nil +} + +func (o *ActivityTimes) 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{ + "recordedTime", + } + + 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) + } + } + + varActivityTimes := _ActivityTimes{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varActivityTimes) + + if err != nil { + return err + } + + *o = ActivityTimes(varActivityTimes) + + return err +} + +type NullableActivityTimes struct { + value *ActivityTimes + isSet bool +} + +func (v NullableActivityTimes) Get() *ActivityTimes { + return v.value +} + +func (v *NullableActivityTimes) Set(val *ActivityTimes) { + v.value = val + v.isSet = true +} + +func (v NullableActivityTimes) IsSet() bool { + return v.isSet +} + +func (v *NullableActivityTimes) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableActivityTimes(val *ActivityTimes) *NullableActivityTimes { + return &NullableActivityTimes{value: val, isSet: true} +} + +func (v NullableActivityTimes) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableActivityTimes) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/github.com/owncloud/libre-graph-api-go/model_collection_of_activities.go b/vendor/github.com/owncloud/libre-graph-api-go/model_collection_of_activities.go new file mode 100644 index 000000000..3ebfd31fb --- /dev/null +++ b/vendor/github.com/owncloud/libre-graph-api-go/model_collection_of_activities.go @@ -0,0 +1,124 @@ +/* +Libre Graph API + +Libre Graph is a free API for cloud collaboration inspired by the MS Graph API. + +API version: v1.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package libregraph + +import ( + "encoding/json" +) + +// checks if the CollectionOfActivities type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CollectionOfActivities{} + +// CollectionOfActivities struct for CollectionOfActivities +type CollectionOfActivities struct { + Value []Activity `json:"value,omitempty"` +} + +// NewCollectionOfActivities instantiates a new CollectionOfActivities 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 NewCollectionOfActivities() *CollectionOfActivities { + this := CollectionOfActivities{} + return &this +} + +// NewCollectionOfActivitiesWithDefaults instantiates a new CollectionOfActivities 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 NewCollectionOfActivitiesWithDefaults() *CollectionOfActivities { + this := CollectionOfActivities{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *CollectionOfActivities) GetValue() []Activity { + if o == nil || IsNil(o.Value) { + var ret []Activity + return ret + } + return o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CollectionOfActivities) GetValueOk() ([]Activity, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *CollectionOfActivities) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given []Activity and assigns it to the Value field. +func (o *CollectionOfActivities) SetValue(v []Activity) { + o.Value = v +} + +func (o CollectionOfActivities) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CollectionOfActivities) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableCollectionOfActivities struct { + value *CollectionOfActivities + isSet bool +} + +func (v NullableCollectionOfActivities) Get() *CollectionOfActivities { + return v.value +} + +func (v *NullableCollectionOfActivities) Set(val *CollectionOfActivities) { + v.value = val + v.isSet = true +} + +func (v NullableCollectionOfActivities) IsSet() bool { + return v.isSet +} + +func (v *NullableCollectionOfActivities) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCollectionOfActivities(val *CollectionOfActivities) *NullableCollectionOfActivities { + return &NullableCollectionOfActivities{value: val, isSet: true} +} + +func (v NullableCollectionOfActivities) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCollectionOfActivities) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index f94a8a8e0..eee2a2cc1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1623,7 +1623,7 @@ github.com/opentracing/opentracing-go/log # github.com/orcaman/concurrent-map v1.0.0 ## explicit github.com/orcaman/concurrent-map -# github.com/owncloud/libre-graph-api-go v1.0.5-0.20240529101512-a631b9eeddb3 +# github.com/owncloud/libre-graph-api-go v1.0.5-0.20240618162722-2298241331d1 ## explicit; go 1.18 github.com/owncloud/libre-graph-api-go # github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c