diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/README.md b/vendor/github.com/opencloud-eu/libre-graph-api-go/README.md index 3d0e9dc3cb..dd97b8c214 100644 --- a/vendor/github.com/opencloud-eu/libre-graph-api-go/README.md +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/README.md @@ -158,6 +158,7 @@ Class | Method | HTTP request | Description *MeUserApi* | [**UpdateOwnUser**](docs/MeUserApi.md#updateownuser) | **Patch** /v1.0/me | Update the current user *RoleManagementApi* | [**GetPermissionRoleDefinition**](docs/RoleManagementApi.md#getpermissionroledefinition) | **Get** /v1beta1/roleManagement/permissions/roleDefinitions/{role-id} | Get unifiedRoleDefinition *RoleManagementApi* | [**ListPermissionRoleDefinitions**](docs/RoleManagementApi.md#listpermissionroledefinitions) | **Get** /v1beta1/roleManagement/permissions/roleDefinitions | List roleDefinitions +*SearchApi* | [**SearchQuery**](docs/SearchApi.md#searchquery) | **Post** /v1beta1/search/query | Search for resources *TagsApi* | [**AssignTags**](docs/TagsApi.md#assigntags) | **Put** /v1.0/extensions/org.libregraph/tags | Assign tags to a resource *TagsApi* | [**GetTags**](docs/TagsApi.md#gettags) | **Get** /v1.0/extensions/org.libregraph/tags | Get all known tags *TagsApi* | [**UnassignTags**](docs/TagsApi.md#unassigntags) | **Delete** /v1.0/extensions/org.libregraph/tags | Unassign tags from a resource @@ -178,10 +179,13 @@ Class | Method | HTTP request | Description - [Activity](docs/Activity.md) - [ActivityTemplate](docs/ActivityTemplate.md) - [ActivityTimes](docs/ActivityTimes.md) + - [AggregationOption](docs/AggregationOption.md) - [AppRole](docs/AppRole.md) - [AppRoleAssignment](docs/AppRoleAssignment.md) - [Application](docs/Application.md) - [Audio](docs/Audio.md) + - [BucketAggregationRange](docs/BucketAggregationRange.md) + - [BucketDefinition](docs/BucketDefinition.md) - [ClassMemberReference](docs/ClassMemberReference.md) - [ClassReference](docs/ClassReference.md) - [ClassTeacherReference](docs/ClassTeacherReference.md) @@ -243,6 +247,15 @@ Class | Method | HTTP request | Description - [Quota](docs/Quota.md) - [Recipient](docs/Recipient.md) - [RemoteItem](docs/RemoteItem.md) + - [SearchAggregation](docs/SearchAggregation.md) + - [SearchBucket](docs/SearchBucket.md) + - [SearchHit](docs/SearchHit.md) + - [SearchHitsContainer](docs/SearchHitsContainer.md) + - [SearchQuery](docs/SearchQuery.md) + - [SearchQuery200Response](docs/SearchQuery200Response.md) + - [SearchQueryRequest](docs/SearchQueryRequest.md) + - [SearchRequest](docs/SearchRequest.md) + - [SearchResponse](docs/SearchResponse.md) - [SharePointIdentitySet](docs/SharePointIdentitySet.md) - [SharingInvitation](docs/SharingInvitation.md) - [SharingLink](docs/SharingLink.md) diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/api_search.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/api_search.go new file mode 100644 index 0000000000..a1e3045fa0 --- /dev/null +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/api_search.go @@ -0,0 +1,156 @@ +/* +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 ( + "bytes" + "context" + "io" + "net/http" + "net/url" +) + + +// SearchApiService SearchApi service +type SearchApiService service + +type ApiSearchQueryRequest struct { + ctx context.Context + ApiService *SearchApiService + searchQueryRequest *SearchQueryRequest +} + +func (r ApiSearchQueryRequest) SearchQueryRequest(searchQueryRequest SearchQueryRequest) ApiSearchQueryRequest { + r.searchQueryRequest = &searchQueryRequest + return r +} + +func (r ApiSearchQueryRequest) Execute() (*SearchQuery200Response, *http.Response, error) { + return r.ApiService.SearchQueryExecute(r) +} + +/* +SearchQuery Search for resources + +Run a specified search query. Search results are provided in the response. + +The search endpoint allows clients to search for resources across all +accessible spaces and retrieve aggregated metadata (facets) about the +result set. + +Aggregations can be used to group results by properties such as file type, +author, or any indexed metadata field. This is useful for building faceted +search UIs or computing statistics about the result set. + +The query string uses KQL (Keyword Query Language) syntax for filtering. + +This endpoint is inspired by the +[MS Graph Search API](https://learn.microsoft.com/en-us/graph/api/search-query) +and follows the same request/response structure for compatibility. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiSearchQueryRequest +*/ +func (a *SearchApiService) SearchQuery(ctx context.Context) ApiSearchQueryRequest { + return ApiSearchQueryRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return SearchQuery200Response +func (a *SearchApiService) SearchQueryExecute(r ApiSearchQueryRequest) (*SearchQuery200Response, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SearchQuery200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SearchApiService.SearchQuery") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/v1beta1/search/query" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.searchQueryRequest == nil { + return localVarReturnValue, nil, reportError("searchQueryRequest is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // 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 + } + // body params + localVarPostBody = r.searchQueryRequest + 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/opencloud-eu/libre-graph-api-go/client.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/client.go index 5b3222ebf3..0fb69b7e1f 100644 --- a/vendor/github.com/opencloud-eu/libre-graph-api-go/client.go +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/client.go @@ -93,6 +93,8 @@ type APIClient struct { RoleManagementApi *RoleManagementApiService + SearchApi *SearchApiService + TagsApi *TagsApiService UserApi *UserApiService @@ -142,6 +144,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.MePhotoApi = (*MePhotoApiService)(&c.common) c.MeUserApi = (*MeUserApiService)(&c.common) c.RoleManagementApi = (*RoleManagementApiService)(&c.common) + c.SearchApi = (*SearchApiService)(&c.common) c.TagsApi = (*TagsApiService)(&c.common) c.UserApi = (*UserApiService)(&c.common) c.UserAppRoleAssignmentApi = (*UserAppRoleAssignmentApiService)(&c.common) diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/model_aggregation_option.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_aggregation_option.go new file mode 100644 index 0000000000..b15616c7fa --- /dev/null +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_aggregation_option.go @@ -0,0 +1,306 @@ +/* +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 AggregationOption type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AggregationOption{} + +// AggregationOption Specifies an aggregation that should be computed and returned alongside search results. Follows the [MS Graph aggregationOption](https://learn.microsoft.com/en-us/graph/api/resources/aggregationoption) resource type. For string fields, terms aggregations return the distinct values and their counts. For numeric and date fields, range aggregations can be defined using the `ranges` property of `bucketDefinition`. +type AggregationOption struct { + // Specifies the field in the schema of the specified entity type that the aggregation should be computed on. Required. Examples: `audio.artist`, `audio.genre`, `audio.year`, `mimeType`. + Field string `json:"field"` + // The number of `searchBucket` resources to be returned. This is optional and only applies to terms aggregations. Combined with `bucketDefinition.sortBy` and `bucketDefinition.isDescending` to produce the top N results by count or key. When not specified, all buckets are returned. + Size *int32 `json:"size,omitempty"` + BucketDefinition *BucketDefinition `json:"bucketDefinition,omitempty"` + // Nested aggregations computed within each bucket of this aggregation. Libregraph extension not present in MS Graph. Backends that don't support native composite aggregations (e.g. bleve) emulate them by walking the matched result set; OpenSearch translates them to native composite aggregations. + SubAggregations []AggregationOption `json:"subAggregations,omitempty"` + // When set, this aggregation is a scalar metric over `field` rather than a bucket aggregation: `size` and `bucketDefinition` are ignored, and the corresponding `searchAggregation` in the response carries a `value` rather than `buckets`. Libregraph extension not present in MS Graph. `avg` is not a simple reducer (averages of averages are not averages) — the backend carries `(sum, count)` internally and emits only `value` on the outermost merge. + MetricKind *string `json:"metricKind,omitempty"` +} + +type _AggregationOption AggregationOption + +// NewAggregationOption instantiates a new AggregationOption 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 NewAggregationOption(field string) *AggregationOption { + this := AggregationOption{} + this.Field = field + return &this +} + +// NewAggregationOptionWithDefaults instantiates a new AggregationOption 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 NewAggregationOptionWithDefaults() *AggregationOption { + this := AggregationOption{} + return &this +} + +// GetField returns the Field field value +func (o *AggregationOption) GetField() string { + if o == nil { + var ret string + return ret + } + + return o.Field +} + +// GetFieldOk returns a tuple with the Field field value +// and a boolean to check if the value has been set. +func (o *AggregationOption) GetFieldOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Field, true +} + +// SetField sets field value +func (o *AggregationOption) SetField(v string) { + o.Field = v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *AggregationOption) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AggregationOption) GetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *AggregationOption) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *AggregationOption) SetSize(v int32) { + o.Size = &v +} + +// GetBucketDefinition returns the BucketDefinition field value if set, zero value otherwise. +func (o *AggregationOption) GetBucketDefinition() BucketDefinition { + if o == nil || IsNil(o.BucketDefinition) { + var ret BucketDefinition + return ret + } + return *o.BucketDefinition +} + +// GetBucketDefinitionOk returns a tuple with the BucketDefinition field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AggregationOption) GetBucketDefinitionOk() (*BucketDefinition, bool) { + if o == nil || IsNil(o.BucketDefinition) { + return nil, false + } + return o.BucketDefinition, true +} + +// HasBucketDefinition returns a boolean if a field has been set. +func (o *AggregationOption) HasBucketDefinition() bool { + if o != nil && !IsNil(o.BucketDefinition) { + return true + } + + return false +} + +// SetBucketDefinition gets a reference to the given BucketDefinition and assigns it to the BucketDefinition field. +func (o *AggregationOption) SetBucketDefinition(v BucketDefinition) { + o.BucketDefinition = &v +} + +// GetSubAggregations returns the SubAggregations field value if set, zero value otherwise. +func (o *AggregationOption) GetSubAggregations() []AggregationOption { + if o == nil || IsNil(o.SubAggregations) { + var ret []AggregationOption + return ret + } + return o.SubAggregations +} + +// GetSubAggregationsOk returns a tuple with the SubAggregations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AggregationOption) GetSubAggregationsOk() ([]AggregationOption, bool) { + if o == nil || IsNil(o.SubAggregations) { + return nil, false + } + return o.SubAggregations, true +} + +// HasSubAggregations returns a boolean if a field has been set. +func (o *AggregationOption) HasSubAggregations() bool { + if o != nil && !IsNil(o.SubAggregations) { + return true + } + + return false +} + +// SetSubAggregations gets a reference to the given []AggregationOption and assigns it to the SubAggregations field. +func (o *AggregationOption) SetSubAggregations(v []AggregationOption) { + o.SubAggregations = v +} + +// GetMetricKind returns the MetricKind field value if set, zero value otherwise. +func (o *AggregationOption) GetMetricKind() string { + if o == nil || IsNil(o.MetricKind) { + var ret string + return ret + } + return *o.MetricKind +} + +// GetMetricKindOk returns a tuple with the MetricKind field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AggregationOption) GetMetricKindOk() (*string, bool) { + if o == nil || IsNil(o.MetricKind) { + return nil, false + } + return o.MetricKind, true +} + +// HasMetricKind returns a boolean if a field has been set. +func (o *AggregationOption) HasMetricKind() bool { + if o != nil && !IsNil(o.MetricKind) { + return true + } + + return false +} + +// SetMetricKind gets a reference to the given string and assigns it to the MetricKind field. +func (o *AggregationOption) SetMetricKind(v string) { + o.MetricKind = &v +} + +func (o AggregationOption) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AggregationOption) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["field"] = o.Field + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.BucketDefinition) { + toSerialize["bucketDefinition"] = o.BucketDefinition + } + if !IsNil(o.SubAggregations) { + toSerialize["subAggregations"] = o.SubAggregations + } + if !IsNil(o.MetricKind) { + toSerialize["metricKind"] = o.MetricKind + } + return toSerialize, nil +} + +func (o *AggregationOption) 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{ + "field", + } + + 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) + } + } + + varAggregationOption := _AggregationOption{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAggregationOption) + + if err != nil { + return err + } + + *o = AggregationOption(varAggregationOption) + + return err +} + +type NullableAggregationOption struct { + value *AggregationOption + isSet bool +} + +func (v NullableAggregationOption) Get() *AggregationOption { + return v.value +} + +func (v *NullableAggregationOption) Set(val *AggregationOption) { + v.value = val + v.isSet = true +} + +func (v NullableAggregationOption) IsSet() bool { + return v.isSet +} + +func (v *NullableAggregationOption) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAggregationOption(val *AggregationOption) *NullableAggregationOption { + return &NullableAggregationOption{value: val, isSet: true} +} + +func (v NullableAggregationOption) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAggregationOption) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/model_bucket_aggregation_range.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_bucket_aggregation_range.go new file mode 100644 index 0000000000..441a85736b --- /dev/null +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_bucket_aggregation_range.go @@ -0,0 +1,164 @@ +/* +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" +) + +// checks if the BucketAggregationRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BucketAggregationRange{} + +// BucketAggregationRange Specifies the lower and upper bound to compute a range aggregation bucket. At least one of `from` or `to` must be provided. +type BucketAggregationRange struct { + // Defines the lower bound from which to compute the aggregation. The value is always a string. Numeric bounds must be provided as their string representation (e.g. `\"1980\"`). Date bounds must use the `YYYY-MM-DDTHH:mm:ssZ` format. Optional if `to` is provided. + From *string + // Defines the upper bound up to which to compute the aggregation. The value is always a string. Numeric bounds must be provided as their string representation (e.g. `\"2000\"`). Date bounds must use the `YYYY-MM-DDTHH:mm:ssZ` format. Optional if `from` is provided. + To *string +} + +// NewBucketAggregationRange instantiates a new BucketAggregationRange 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 NewBucketAggregationRange() *BucketAggregationRange { + this := BucketAggregationRange{} + return &this +} + +// NewBucketAggregationRangeWithDefaults instantiates a new BucketAggregationRange 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 NewBucketAggregationRangeWithDefaults() *BucketAggregationRange { + this := BucketAggregationRange{} + return &this +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *BucketAggregationRange) GetFrom() string { + if o == nil || IsNil(o.From) { + var ret string + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BucketAggregationRange) GetFromOk() (*string, bool) { + if o == nil || IsNil(o.From) { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *BucketAggregationRange) HasFrom() bool { + if o != nil && !IsNil(o.From) { + return true + } + + return false +} + +// SetFrom gets a reference to the given string and assigns it to the From field. +func (o *BucketAggregationRange) SetFrom(v string) { + o.From = &v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *BucketAggregationRange) GetTo() string { + if o == nil || IsNil(o.To) { + var ret string + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BucketAggregationRange) GetToOk() (*string, bool) { + if o == nil || IsNil(o.To) { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *BucketAggregationRange) HasTo() bool { + if o != nil && !IsNil(o.To) { + return true + } + + return false +} + +// SetTo gets a reference to the given string and assigns it to the To field. +func (o *BucketAggregationRange) SetTo(v string) { + o.To = &v +} + +func (o BucketAggregationRange) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BucketAggregationRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.From) { + toSerialize["from"] = o.From + } + if !IsNil(o.To) { + toSerialize["to"] = o.To + } + return toSerialize, nil +} + +type NullableBucketAggregationRange struct { + value *BucketAggregationRange + isSet bool +} + +func (v NullableBucketAggregationRange) Get() *BucketAggregationRange { + return v.value +} + +func (v *NullableBucketAggregationRange) Set(val *BucketAggregationRange) { + v.value = val + v.isSet = true +} + +func (v NullableBucketAggregationRange) IsSet() bool { + return v.isSet +} + +func (v *NullableBucketAggregationRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBucketAggregationRange(val *BucketAggregationRange) *NullableBucketAggregationRange { + return &NullableBucketAggregationRange{value: val, isSet: true} +} + +func (v NullableBucketAggregationRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBucketAggregationRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/model_bucket_definition.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_bucket_definition.go new file mode 100644 index 0000000000..69fc7e9b6b --- /dev/null +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_bucket_definition.go @@ -0,0 +1,278 @@ +/* +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 BucketDefinition type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BucketDefinition{} + +// BucketDefinition Provides the details of how to generate the aggregation buckets in the response. Follows the [MS Graph bucketAggregationDefinition](https://learn.microsoft.com/en-us/graph/api/resources/bucketaggregationdefinition) resource type. +type BucketDefinition struct { + // The possible values are `count` to sort by the number of matches in the aggregation, `keyAsString` to sort alphabetically based on the key in the aggregation, and `keyAsNumber` to sort numerically based on the key in the aggregation. Required. + SortBy string `json:"sortBy"` + // Set to `true` to specify the sort order as descending. Optional, defaults to `false` (ascending). + IsDescending *bool `json:"isDescending,omitempty"` + // The minimum number of items that should be present in the aggregation for the bucket to be returned in the response. Optional, default is 0. + MinimumCount *int32 `json:"minimumCount,omitempty"` + // Specifies the manual ranges to compute the aggregation buckets. This is only valid for non-string facets of date or numeric type. Optional. Follows the [MS Graph bucketAggregationRange](https://learn.microsoft.com/en-us/graph/api/resources/bucketaggregationrange) resource type. + Ranges []BucketAggregationRange `json:"ranges,omitempty"` +} + +type _BucketDefinition BucketDefinition + +// NewBucketDefinition instantiates a new BucketDefinition 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 NewBucketDefinition(sortBy string) *BucketDefinition { + this := BucketDefinition{} + this.SortBy = sortBy + var isDescending bool = false + this.IsDescending = &isDescending + var minimumCount int32 = 0 + this.MinimumCount = &minimumCount + return &this +} + +// NewBucketDefinitionWithDefaults instantiates a new BucketDefinition 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 NewBucketDefinitionWithDefaults() *BucketDefinition { + this := BucketDefinition{} + var isDescending bool = false + this.IsDescending = &isDescending + var minimumCount int32 = 0 + this.MinimumCount = &minimumCount + return &this +} + +// GetSortBy returns the SortBy field value +func (o *BucketDefinition) GetSortBy() string { + if o == nil { + var ret string + return ret + } + + return o.SortBy +} + +// GetSortByOk returns a tuple with the SortBy field value +// and a boolean to check if the value has been set. +func (o *BucketDefinition) GetSortByOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.SortBy, true +} + +// SetSortBy sets field value +func (o *BucketDefinition) SetSortBy(v string) { + o.SortBy = v +} + +// GetIsDescending returns the IsDescending field value if set, zero value otherwise. +func (o *BucketDefinition) GetIsDescending() bool { + if o == nil || IsNil(o.IsDescending) { + var ret bool + return ret + } + return *o.IsDescending +} + +// GetIsDescendingOk returns a tuple with the IsDescending field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BucketDefinition) GetIsDescendingOk() (*bool, bool) { + if o == nil || IsNil(o.IsDescending) { + return nil, false + } + return o.IsDescending, true +} + +// HasIsDescending returns a boolean if a field has been set. +func (o *BucketDefinition) HasIsDescending() bool { + if o != nil && !IsNil(o.IsDescending) { + return true + } + + return false +} + +// SetIsDescending gets a reference to the given bool and assigns it to the IsDescending field. +func (o *BucketDefinition) SetIsDescending(v bool) { + o.IsDescending = &v +} + +// GetMinimumCount returns the MinimumCount field value if set, zero value otherwise. +func (o *BucketDefinition) GetMinimumCount() int32 { + if o == nil || IsNil(o.MinimumCount) { + var ret int32 + return ret + } + return *o.MinimumCount +} + +// GetMinimumCountOk returns a tuple with the MinimumCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BucketDefinition) GetMinimumCountOk() (*int32, bool) { + if o == nil || IsNil(o.MinimumCount) { + return nil, false + } + return o.MinimumCount, true +} + +// HasMinimumCount returns a boolean if a field has been set. +func (o *BucketDefinition) HasMinimumCount() bool { + if o != nil && !IsNil(o.MinimumCount) { + return true + } + + return false +} + +// SetMinimumCount gets a reference to the given int32 and assigns it to the MinimumCount field. +func (o *BucketDefinition) SetMinimumCount(v int32) { + o.MinimumCount = &v +} + +// GetRanges returns the Ranges field value if set, zero value otherwise. +func (o *BucketDefinition) GetRanges() []BucketAggregationRange { + if o == nil || IsNil(o.Ranges) { + var ret []BucketAggregationRange + return ret + } + return o.Ranges +} + +// GetRangesOk returns a tuple with the Ranges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BucketDefinition) GetRangesOk() ([]BucketAggregationRange, bool) { + if o == nil || IsNil(o.Ranges) { + return nil, false + } + return o.Ranges, true +} + +// HasRanges returns a boolean if a field has been set. +func (o *BucketDefinition) HasRanges() bool { + if o != nil && !IsNil(o.Ranges) { + return true + } + + return false +} + +// SetRanges gets a reference to the given []BucketAggregationRange and assigns it to the Ranges field. +func (o *BucketDefinition) SetRanges(v []BucketAggregationRange) { + o.Ranges = v +} + +func (o BucketDefinition) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BucketDefinition) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["sortBy"] = o.SortBy + if !IsNil(o.IsDescending) { + toSerialize["isDescending"] = o.IsDescending + } + if !IsNil(o.MinimumCount) { + toSerialize["minimumCount"] = o.MinimumCount + } + if !IsNil(o.Ranges) { + toSerialize["ranges"] = o.Ranges + } + return toSerialize, nil +} + +func (o *BucketDefinition) 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{ + "sortBy", + } + + 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) + } + } + + varBucketDefinition := _BucketDefinition{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBucketDefinition) + + if err != nil { + return err + } + + *o = BucketDefinition(varBucketDefinition) + + return err +} + +type NullableBucketDefinition struct { + value *BucketDefinition + isSet bool +} + +func (v NullableBucketDefinition) Get() *BucketDefinition { + return v.value +} + +func (v *NullableBucketDefinition) Set(val *BucketDefinition) { + v.value = val + v.isSet = true +} + +func (v NullableBucketDefinition) IsSet() bool { + return v.isSet +} + +func (v *NullableBucketDefinition) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBucketDefinition(val *BucketDefinition) *NullableBucketDefinition { + return &NullableBucketDefinition{value: val, isSet: true} +} + +func (v NullableBucketDefinition) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBucketDefinition) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_aggregation.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_aggregation.go new file mode 100644 index 0000000000..9520b9f235 --- /dev/null +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_aggregation.go @@ -0,0 +1,238 @@ +/* +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" +) + +// checks if the SearchAggregation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SearchAggregation{} + +// SearchAggregation Provides the details of a search aggregation in the search response. Follows the [MS Graph searchAggregation](https://learn.microsoft.com/en-us/graph/api/resources/searchaggregation) resource type. +type SearchAggregation struct { + // Defines the field in the request on which the aggregation was computed. + Field *string `json:"field,omitempty"` + // Defines the computed buckets for this aggregation. Buckets are sorted according to the `sortBy` and `isDescending` specified in the `bucketDefinition` of the corresponding `aggregationOption`. + Buckets []SearchBucket `json:"buckets,omitempty"` + // Scalar result for metric aggregations (`metricKind` set on the corresponding `aggregationOption`). Undefined for terms or range aggregations. Libregraph extension not present in MS Graph. + Value *float64 `json:"value,omitempty"` + // Echoes the `metricKind` of the corresponding `aggregationOption`, allowing consumers (and the search service's cross-space merge layer) to pick the right reducer when combining results. Libregraph extension. + MetricKind *string `json:"metricKind,omitempty"` +} + +// NewSearchAggregation instantiates a new SearchAggregation 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 NewSearchAggregation() *SearchAggregation { + this := SearchAggregation{} + return &this +} + +// NewSearchAggregationWithDefaults instantiates a new SearchAggregation 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 NewSearchAggregationWithDefaults() *SearchAggregation { + this := SearchAggregation{} + return &this +} + +// GetField returns the Field field value if set, zero value otherwise. +func (o *SearchAggregation) GetField() string { + if o == nil || IsNil(o.Field) { + var ret string + return ret + } + return *o.Field +} + +// GetFieldOk returns a tuple with the Field field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchAggregation) GetFieldOk() (*string, bool) { + if o == nil || IsNil(o.Field) { + return nil, false + } + return o.Field, true +} + +// HasField returns a boolean if a field has been set. +func (o *SearchAggregation) HasField() bool { + if o != nil && !IsNil(o.Field) { + return true + } + + return false +} + +// SetField gets a reference to the given string and assigns it to the Field field. +func (o *SearchAggregation) SetField(v string) { + o.Field = &v +} + +// GetBuckets returns the Buckets field value if set, zero value otherwise. +func (o *SearchAggregation) GetBuckets() []SearchBucket { + if o == nil || IsNil(o.Buckets) { + var ret []SearchBucket + return ret + } + return o.Buckets +} + +// GetBucketsOk returns a tuple with the Buckets field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchAggregation) GetBucketsOk() ([]SearchBucket, bool) { + if o == nil || IsNil(o.Buckets) { + return nil, false + } + return o.Buckets, true +} + +// HasBuckets returns a boolean if a field has been set. +func (o *SearchAggregation) HasBuckets() bool { + if o != nil && !IsNil(o.Buckets) { + return true + } + + return false +} + +// SetBuckets gets a reference to the given []SearchBucket and assigns it to the Buckets field. +func (o *SearchAggregation) SetBuckets(v []SearchBucket) { + o.Buckets = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *SearchAggregation) GetValue() float64 { + if o == nil || IsNil(o.Value) { + var ret float64 + 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 *SearchAggregation) GetValueOk() (*float64, 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 *SearchAggregation) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given float64 and assigns it to the Value field. +func (o *SearchAggregation) SetValue(v float64) { + o.Value = &v +} + +// GetMetricKind returns the MetricKind field value if set, zero value otherwise. +func (o *SearchAggregation) GetMetricKind() string { + if o == nil || IsNil(o.MetricKind) { + var ret string + return ret + } + return *o.MetricKind +} + +// GetMetricKindOk returns a tuple with the MetricKind field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchAggregation) GetMetricKindOk() (*string, bool) { + if o == nil || IsNil(o.MetricKind) { + return nil, false + } + return o.MetricKind, true +} + +// HasMetricKind returns a boolean if a field has been set. +func (o *SearchAggregation) HasMetricKind() bool { + if o != nil && !IsNil(o.MetricKind) { + return true + } + + return false +} + +// SetMetricKind gets a reference to the given string and assigns it to the MetricKind field. +func (o *SearchAggregation) SetMetricKind(v string) { + o.MetricKind = &v +} + +func (o SearchAggregation) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SearchAggregation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Field) { + toSerialize["field"] = o.Field + } + if !IsNil(o.Buckets) { + toSerialize["buckets"] = o.Buckets + } + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + if !IsNil(o.MetricKind) { + toSerialize["metricKind"] = o.MetricKind + } + return toSerialize, nil +} + +type NullableSearchAggregation struct { + value *SearchAggregation + isSet bool +} + +func (v NullableSearchAggregation) Get() *SearchAggregation { + return v.value +} + +func (v *NullableSearchAggregation) Set(val *SearchAggregation) { + v.value = val + v.isSet = true +} + +func (v NullableSearchAggregation) IsSet() bool { + return v.isSet +} + +func (v *NullableSearchAggregation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSearchAggregation(val *SearchAggregation) *NullableSearchAggregation { + return &NullableSearchAggregation{value: val, isSet: true} +} + +func (v NullableSearchAggregation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSearchAggregation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_bucket.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_bucket.go new file mode 100644 index 0000000000..0d647bbf90 --- /dev/null +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_bucket.go @@ -0,0 +1,238 @@ +/* +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" +) + +// checks if the SearchBucket type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SearchBucket{} + +// SearchBucket Represents a single bucket in a search aggregation result. Follows the [MS Graph searchBucket](https://learn.microsoft.com/en-us/graph/api/resources/searchbucket) resource type. +type SearchBucket struct { + // The discrete value of the field that was used to compute the aggregation. For terms aggregations this is the field value. For range aggregations this is a string representation of the range. + Key *string `json:"key,omitempty"` + // The approximate number of search matches that share the same value specified in the `key` property. + Count *int64 `json:"count,omitempty"` + // A token containing the encoded filter to aggregate search matches to the specific key value. To use the filter, pass the token as part of the `aggregationFilters` property in a subsequent `searchRequest`, in the format `\"{field}:\\\"{aggregationFilterToken}\\\"\"`. + AggregationFilterToken *string `json:"aggregationFilterToken,omitempty"` + // Nested aggregation results, one per sub-aggregation requested on the parent `aggregationOption`. Libregraph extension not present in MS Graph. + SubAggregations []SearchAggregation `json:"subAggregations,omitempty"` +} + +// NewSearchBucket instantiates a new SearchBucket 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 NewSearchBucket() *SearchBucket { + this := SearchBucket{} + return &this +} + +// NewSearchBucketWithDefaults instantiates a new SearchBucket 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 NewSearchBucketWithDefaults() *SearchBucket { + this := SearchBucket{} + return &this +} + +// GetKey returns the Key field value if set, zero value otherwise. +func (o *SearchBucket) GetKey() string { + if o == nil || IsNil(o.Key) { + var ret string + return ret + } + return *o.Key +} + +// GetKeyOk returns a tuple with the Key field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchBucket) GetKeyOk() (*string, bool) { + if o == nil || IsNil(o.Key) { + return nil, false + } + return o.Key, true +} + +// HasKey returns a boolean if a field has been set. +func (o *SearchBucket) HasKey() bool { + if o != nil && !IsNil(o.Key) { + return true + } + + return false +} + +// SetKey gets a reference to the given string and assigns it to the Key field. +func (o *SearchBucket) SetKey(v string) { + o.Key = &v +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *SearchBucket) GetCount() int64 { + if o == nil || IsNil(o.Count) { + var ret int64 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchBucket) GetCountOk() (*int64, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *SearchBucket) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int64 and assigns it to the Count field. +func (o *SearchBucket) SetCount(v int64) { + o.Count = &v +} + +// GetAggregationFilterToken returns the AggregationFilterToken field value if set, zero value otherwise. +func (o *SearchBucket) GetAggregationFilterToken() string { + if o == nil || IsNil(o.AggregationFilterToken) { + var ret string + return ret + } + return *o.AggregationFilterToken +} + +// GetAggregationFilterTokenOk returns a tuple with the AggregationFilterToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchBucket) GetAggregationFilterTokenOk() (*string, bool) { + if o == nil || IsNil(o.AggregationFilterToken) { + return nil, false + } + return o.AggregationFilterToken, true +} + +// HasAggregationFilterToken returns a boolean if a field has been set. +func (o *SearchBucket) HasAggregationFilterToken() bool { + if o != nil && !IsNil(o.AggregationFilterToken) { + return true + } + + return false +} + +// SetAggregationFilterToken gets a reference to the given string and assigns it to the AggregationFilterToken field. +func (o *SearchBucket) SetAggregationFilterToken(v string) { + o.AggregationFilterToken = &v +} + +// GetSubAggregations returns the SubAggregations field value if set, zero value otherwise. +func (o *SearchBucket) GetSubAggregations() []SearchAggregation { + if o == nil || IsNil(o.SubAggregations) { + var ret []SearchAggregation + return ret + } + return o.SubAggregations +} + +// GetSubAggregationsOk returns a tuple with the SubAggregations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchBucket) GetSubAggregationsOk() ([]SearchAggregation, bool) { + if o == nil || IsNil(o.SubAggregations) { + return nil, false + } + return o.SubAggregations, true +} + +// HasSubAggregations returns a boolean if a field has been set. +func (o *SearchBucket) HasSubAggregations() bool { + if o != nil && !IsNil(o.SubAggregations) { + return true + } + + return false +} + +// SetSubAggregations gets a reference to the given []SearchAggregation and assigns it to the SubAggregations field. +func (o *SearchBucket) SetSubAggregations(v []SearchAggregation) { + o.SubAggregations = v +} + +func (o SearchBucket) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SearchBucket) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Key) { + toSerialize["key"] = o.Key + } + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.AggregationFilterToken) { + toSerialize["aggregationFilterToken"] = o.AggregationFilterToken + } + if !IsNil(o.SubAggregations) { + toSerialize["subAggregations"] = o.SubAggregations + } + return toSerialize, nil +} + +type NullableSearchBucket struct { + value *SearchBucket + isSet bool +} + +func (v NullableSearchBucket) Get() *SearchBucket { + return v.value +} + +func (v *NullableSearchBucket) Set(val *SearchBucket) { + v.value = val + v.isSet = true +} + +func (v NullableSearchBucket) IsSet() bool { + return v.isSet +} + +func (v *NullableSearchBucket) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSearchBucket(val *SearchBucket) *NullableSearchBucket { + return &NullableSearchBucket{value: val, isSet: true} +} + +func (v NullableSearchBucket) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSearchBucket) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_hit.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_hit.go new file mode 100644 index 0000000000..393a273630 --- /dev/null +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_hit.go @@ -0,0 +1,237 @@ +/* +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" +) + +// checks if the SearchHit type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SearchHit{} + +// SearchHit Represents an individual search result. Follows the [MS Graph searchHit](https://learn.microsoft.com/en-us/graph/api/resources/searchhit) resource type. +type SearchHit struct { + // The internal identifier for the item. + HitId *string `json:"hitId,omitempty"` + // The rank or the order of the result. + Rank *int32 `json:"rank,omitempty"` + // A summary of the result, if a summary is available. + Summary *string `json:"summary,omitempty"` + Resource *DriveItem `json:"resource,omitempty"` +} + +// NewSearchHit instantiates a new SearchHit 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 NewSearchHit() *SearchHit { + this := SearchHit{} + return &this +} + +// NewSearchHitWithDefaults instantiates a new SearchHit 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 NewSearchHitWithDefaults() *SearchHit { + this := SearchHit{} + return &this +} + +// GetHitId returns the HitId field value if set, zero value otherwise. +func (o *SearchHit) GetHitId() string { + if o == nil || IsNil(o.HitId) { + var ret string + return ret + } + return *o.HitId +} + +// GetHitIdOk returns a tuple with the HitId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchHit) GetHitIdOk() (*string, bool) { + if o == nil || IsNil(o.HitId) { + return nil, false + } + return o.HitId, true +} + +// HasHitId returns a boolean if a field has been set. +func (o *SearchHit) HasHitId() bool { + if o != nil && !IsNil(o.HitId) { + return true + } + + return false +} + +// SetHitId gets a reference to the given string and assigns it to the HitId field. +func (o *SearchHit) SetHitId(v string) { + o.HitId = &v +} + +// GetRank returns the Rank field value if set, zero value otherwise. +func (o *SearchHit) GetRank() int32 { + if o == nil || IsNil(o.Rank) { + var ret int32 + return ret + } + return *o.Rank +} + +// GetRankOk returns a tuple with the Rank field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchHit) GetRankOk() (*int32, bool) { + if o == nil || IsNil(o.Rank) { + return nil, false + } + return o.Rank, true +} + +// HasRank returns a boolean if a field has been set. +func (o *SearchHit) HasRank() bool { + if o != nil && !IsNil(o.Rank) { + return true + } + + return false +} + +// SetRank gets a reference to the given int32 and assigns it to the Rank field. +func (o *SearchHit) SetRank(v int32) { + o.Rank = &v +} + +// GetSummary returns the Summary field value if set, zero value otherwise. +func (o *SearchHit) GetSummary() string { + if o == nil || IsNil(o.Summary) { + var ret string + return ret + } + return *o.Summary +} + +// GetSummaryOk returns a tuple with the Summary field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchHit) GetSummaryOk() (*string, bool) { + if o == nil || IsNil(o.Summary) { + return nil, false + } + return o.Summary, true +} + +// HasSummary returns a boolean if a field has been set. +func (o *SearchHit) HasSummary() bool { + if o != nil && !IsNil(o.Summary) { + return true + } + + return false +} + +// SetSummary gets a reference to the given string and assigns it to the Summary field. +func (o *SearchHit) SetSummary(v string) { + o.Summary = &v +} + +// GetResource returns the Resource field value if set, zero value otherwise. +func (o *SearchHit) GetResource() DriveItem { + if o == nil || IsNil(o.Resource) { + var ret DriveItem + return ret + } + return *o.Resource +} + +// GetResourceOk returns a tuple with the Resource field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchHit) GetResourceOk() (*DriveItem, bool) { + if o == nil || IsNil(o.Resource) { + return nil, false + } + return o.Resource, true +} + +// HasResource returns a boolean if a field has been set. +func (o *SearchHit) HasResource() bool { + if o != nil && !IsNil(o.Resource) { + return true + } + + return false +} + +// SetResource gets a reference to the given DriveItem and assigns it to the Resource field. +func (o *SearchHit) SetResource(v DriveItem) { + o.Resource = &v +} + +func (o SearchHit) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SearchHit) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.HitId) { + toSerialize["hitId"] = o.HitId + } + if !IsNil(o.Rank) { + toSerialize["rank"] = o.Rank + } + if !IsNil(o.Summary) { + toSerialize["summary"] = o.Summary + } + if !IsNil(o.Resource) { + toSerialize["resource"] = o.Resource + } + return toSerialize, nil +} + +type NullableSearchHit struct { + value *SearchHit + isSet bool +} + +func (v NullableSearchHit) Get() *SearchHit { + return v.value +} + +func (v *NullableSearchHit) Set(val *SearchHit) { + v.value = val + v.isSet = true +} + +func (v NullableSearchHit) IsSet() bool { + return v.isSet +} + +func (v *NullableSearchHit) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSearchHit(val *SearchHit) *NullableSearchHit { + return &NullableSearchHit{value: val, isSet: true} +} + +func (v NullableSearchHit) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSearchHit) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_hits_container.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_hits_container.go new file mode 100644 index 0000000000..7e549d3b09 --- /dev/null +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_hits_container.go @@ -0,0 +1,238 @@ +/* +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" +) + +// checks if the SearchHitsContainer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SearchHitsContainer{} + +// SearchHitsContainer Contains a collection of search results. Follows the [MS Graph searchHitsContainer](https://learn.microsoft.com/en-us/graph/api/resources/searchhitscontainer) resource type. +type SearchHitsContainer struct { + // A collection of the search results. + Hits []SearchHit `json:"hits,omitempty"` + // The total number of results. Note this is not the number of results on the page, but the total number of results satisfying the query. + Total *int64 `json:"total,omitempty"` + // Provides information if more results are available. Based on this information, you can adjust the `from` and `size` properties of the `searchRequest` accordingly. + MoreResultsAvailable *bool `json:"moreResultsAvailable,omitempty"` + // Contains the collection of aggregations computed based on the provided `aggregationOption` definitions in the request. + Aggregations []SearchAggregation `json:"aggregations,omitempty"` +} + +// NewSearchHitsContainer instantiates a new SearchHitsContainer 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 NewSearchHitsContainer() *SearchHitsContainer { + this := SearchHitsContainer{} + return &this +} + +// NewSearchHitsContainerWithDefaults instantiates a new SearchHitsContainer 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 NewSearchHitsContainerWithDefaults() *SearchHitsContainer { + this := SearchHitsContainer{} + return &this +} + +// GetHits returns the Hits field value if set, zero value otherwise. +func (o *SearchHitsContainer) GetHits() []SearchHit { + if o == nil || IsNil(o.Hits) { + var ret []SearchHit + return ret + } + return o.Hits +} + +// GetHitsOk returns a tuple with the Hits field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchHitsContainer) GetHitsOk() ([]SearchHit, bool) { + if o == nil || IsNil(o.Hits) { + return nil, false + } + return o.Hits, true +} + +// HasHits returns a boolean if a field has been set. +func (o *SearchHitsContainer) HasHits() bool { + if o != nil && !IsNil(o.Hits) { + return true + } + + return false +} + +// SetHits gets a reference to the given []SearchHit and assigns it to the Hits field. +func (o *SearchHitsContainer) SetHits(v []SearchHit) { + o.Hits = v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *SearchHitsContainer) GetTotal() int64 { + if o == nil || IsNil(o.Total) { + var ret int64 + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchHitsContainer) GetTotalOk() (*int64, bool) { + if o == nil || IsNil(o.Total) { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *SearchHitsContainer) HasTotal() bool { + if o != nil && !IsNil(o.Total) { + return true + } + + return false +} + +// SetTotal gets a reference to the given int64 and assigns it to the Total field. +func (o *SearchHitsContainer) SetTotal(v int64) { + o.Total = &v +} + +// GetMoreResultsAvailable returns the MoreResultsAvailable field value if set, zero value otherwise. +func (o *SearchHitsContainer) GetMoreResultsAvailable() bool { + if o == nil || IsNil(o.MoreResultsAvailable) { + var ret bool + return ret + } + return *o.MoreResultsAvailable +} + +// GetMoreResultsAvailableOk returns a tuple with the MoreResultsAvailable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchHitsContainer) GetMoreResultsAvailableOk() (*bool, bool) { + if o == nil || IsNil(o.MoreResultsAvailable) { + return nil, false + } + return o.MoreResultsAvailable, true +} + +// HasMoreResultsAvailable returns a boolean if a field has been set. +func (o *SearchHitsContainer) HasMoreResultsAvailable() bool { + if o != nil && !IsNil(o.MoreResultsAvailable) { + return true + } + + return false +} + +// SetMoreResultsAvailable gets a reference to the given bool and assigns it to the MoreResultsAvailable field. +func (o *SearchHitsContainer) SetMoreResultsAvailable(v bool) { + o.MoreResultsAvailable = &v +} + +// GetAggregations returns the Aggregations field value if set, zero value otherwise. +func (o *SearchHitsContainer) GetAggregations() []SearchAggregation { + if o == nil || IsNil(o.Aggregations) { + var ret []SearchAggregation + return ret + } + return o.Aggregations +} + +// GetAggregationsOk returns a tuple with the Aggregations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchHitsContainer) GetAggregationsOk() ([]SearchAggregation, bool) { + if o == nil || IsNil(o.Aggregations) { + return nil, false + } + return o.Aggregations, true +} + +// HasAggregations returns a boolean if a field has been set. +func (o *SearchHitsContainer) HasAggregations() bool { + if o != nil && !IsNil(o.Aggregations) { + return true + } + + return false +} + +// SetAggregations gets a reference to the given []SearchAggregation and assigns it to the Aggregations field. +func (o *SearchHitsContainer) SetAggregations(v []SearchAggregation) { + o.Aggregations = v +} + +func (o SearchHitsContainer) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SearchHitsContainer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Hits) { + toSerialize["hits"] = o.Hits + } + if !IsNil(o.Total) { + toSerialize["total"] = o.Total + } + if !IsNil(o.MoreResultsAvailable) { + toSerialize["moreResultsAvailable"] = o.MoreResultsAvailable + } + if !IsNil(o.Aggregations) { + toSerialize["aggregations"] = o.Aggregations + } + return toSerialize, nil +} + +type NullableSearchHitsContainer struct { + value *SearchHitsContainer + isSet bool +} + +func (v NullableSearchHitsContainer) Get() *SearchHitsContainer { + return v.value +} + +func (v *NullableSearchHitsContainer) Set(val *SearchHitsContainer) { + v.value = val + v.isSet = true +} + +func (v NullableSearchHitsContainer) IsSet() bool { + return v.isSet +} + +func (v *NullableSearchHitsContainer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSearchHitsContainer(val *SearchHitsContainer) *NullableSearchHitsContainer { + return &NullableSearchHitsContainer{value: val, isSet: true} +} + +func (v NullableSearchHitsContainer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSearchHitsContainer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_query.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_query.go new file mode 100644 index 0000000000..8eada60d93 --- /dev/null +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_query.go @@ -0,0 +1,159 @@ +/* +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 SearchQuery type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SearchQuery{} + +// SearchQuery Represents the search query. Follows the [MS Graph searchQuery](https://learn.microsoft.com/en-us/graph/api/resources/searchquery) resource type. +type SearchQuery struct { + // The search query string in KQL (Keyword Query Language) format. The query string can contain free-text keywords and property filters. Examples: - `budget report` — free text search - `mediatype:audio` — filter by media type - `audio.artist:\"Pink Floyd\"` — filter by audio metadata - `audio.genre:Rock AND audio.year:1979` — combined filters + QueryString string `json:"queryString"` +} + +type _SearchQuery SearchQuery + +// NewSearchQuery instantiates a new SearchQuery 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 NewSearchQuery(queryString string) *SearchQuery { + this := SearchQuery{} + this.QueryString = queryString + return &this +} + +// NewSearchQueryWithDefaults instantiates a new SearchQuery 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 NewSearchQueryWithDefaults() *SearchQuery { + this := SearchQuery{} + return &this +} + +// GetQueryString returns the QueryString field value +func (o *SearchQuery) GetQueryString() string { + if o == nil { + var ret string + return ret + } + + return o.QueryString +} + +// GetQueryStringOk returns a tuple with the QueryString field value +// and a boolean to check if the value has been set. +func (o *SearchQuery) GetQueryStringOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.QueryString, true +} + +// SetQueryString sets field value +func (o *SearchQuery) SetQueryString(v string) { + o.QueryString = v +} + +func (o SearchQuery) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SearchQuery) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["queryString"] = o.QueryString + return toSerialize, nil +} + +func (o *SearchQuery) 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{ + "queryString", + } + + 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) + } + } + + varSearchQuery := _SearchQuery{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSearchQuery) + + if err != nil { + return err + } + + *o = SearchQuery(varSearchQuery) + + return err +} + +type NullableSearchQuery struct { + value *SearchQuery + isSet bool +} + +func (v NullableSearchQuery) Get() *SearchQuery { + return v.value +} + +func (v *NullableSearchQuery) Set(val *SearchQuery) { + v.value = val + v.isSet = true +} + +func (v NullableSearchQuery) IsSet() bool { + return v.isSet +} + +func (v *NullableSearchQuery) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSearchQuery(val *SearchQuery) *NullableSearchQuery { + return &NullableSearchQuery{value: val, isSet: true} +} + +func (v NullableSearchQuery) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSearchQuery) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_query_200_response.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_query_200_response.go new file mode 100644 index 0000000000..7a2fef6ac9 --- /dev/null +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_query_200_response.go @@ -0,0 +1,127 @@ +/* +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" +) + +// checks if the SearchQuery200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SearchQuery200Response{} + +// SearchQuery200Response struct for SearchQuery200Response +type SearchQuery200Response struct { + // A collection of search response objects, one per request. + Value []SearchResponse `json:"value,omitempty"` +} + +// NewSearchQuery200Response instantiates a new SearchQuery200Response 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 NewSearchQuery200Response() *SearchQuery200Response { + this := SearchQuery200Response{} + return &this +} + +// NewSearchQuery200ResponseWithDefaults instantiates a new SearchQuery200Response 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 NewSearchQuery200ResponseWithDefaults() *SearchQuery200Response { + this := SearchQuery200Response{} + return &this +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *SearchQuery200Response) GetValue() []SearchResponse { + if o == nil || IsNil(o.Value) { + var ret []SearchResponse + 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 *SearchQuery200Response) GetValueOk() ([]SearchResponse, 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 *SearchQuery200Response) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given []SearchResponse and assigns it to the Value field. +func (o *SearchQuery200Response) SetValue(v []SearchResponse) { + o.Value = v +} + +func (o SearchQuery200Response) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SearchQuery200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +type NullableSearchQuery200Response struct { + value *SearchQuery200Response + isSet bool +} + +func (v NullableSearchQuery200Response) Get() *SearchQuery200Response { + return v.value +} + +func (v *NullableSearchQuery200Response) Set(val *SearchQuery200Response) { + v.value = val + v.isSet = true +} + +func (v NullableSearchQuery200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableSearchQuery200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSearchQuery200Response(val *SearchQuery200Response) *NullableSearchQuery200Response { + return &NullableSearchQuery200Response{value: val, isSet: true} +} + +func (v NullableSearchQuery200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSearchQuery200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_query_request.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_query_request.go new file mode 100644 index 0000000000..f74fed3f76 --- /dev/null +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_query_request.go @@ -0,0 +1,159 @@ +/* +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 SearchQueryRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SearchQueryRequest{} + +// SearchQueryRequest struct for SearchQueryRequest +type SearchQueryRequest struct { + // A collection of one or more search requests. + Requests []SearchRequest `json:"requests"` +} + +type _SearchQueryRequest SearchQueryRequest + +// NewSearchQueryRequest instantiates a new SearchQueryRequest 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 NewSearchQueryRequest(requests []SearchRequest) *SearchQueryRequest { + this := SearchQueryRequest{} + this.Requests = requests + return &this +} + +// NewSearchQueryRequestWithDefaults instantiates a new SearchQueryRequest 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 NewSearchQueryRequestWithDefaults() *SearchQueryRequest { + this := SearchQueryRequest{} + return &this +} + +// GetRequests returns the Requests field value +func (o *SearchQueryRequest) GetRequests() []SearchRequest { + if o == nil { + var ret []SearchRequest + return ret + } + + return o.Requests +} + +// GetRequestsOk returns a tuple with the Requests field value +// and a boolean to check if the value has been set. +func (o *SearchQueryRequest) GetRequestsOk() ([]SearchRequest, bool) { + if o == nil { + return nil, false + } + return o.Requests, true +} + +// SetRequests sets field value +func (o *SearchQueryRequest) SetRequests(v []SearchRequest) { + o.Requests = v +} + +func (o SearchQueryRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SearchQueryRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["requests"] = o.Requests + return toSerialize, nil +} + +func (o *SearchQueryRequest) 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{ + "requests", + } + + 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) + } + } + + varSearchQueryRequest := _SearchQueryRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSearchQueryRequest) + + if err != nil { + return err + } + + *o = SearchQueryRequest(varSearchQueryRequest) + + return err +} + +type NullableSearchQueryRequest struct { + value *SearchQueryRequest + isSet bool +} + +func (v NullableSearchQueryRequest) Get() *SearchQueryRequest { + return v.value +} + +func (v *NullableSearchQueryRequest) Set(val *SearchQueryRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSearchQueryRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSearchQueryRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSearchQueryRequest(val *SearchQueryRequest) *NullableSearchQueryRequest { + return &NullableSearchQueryRequest{value: val, isSet: true} +} + +func (v NullableSearchQueryRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSearchQueryRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_request.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_request.go new file mode 100644 index 0000000000..5d17d3f37b --- /dev/null +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_request.go @@ -0,0 +1,343 @@ +/* +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 SearchRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SearchRequest{} + +// SearchRequest Represents an individual search request within a search query. Follows the [MS Graph searchRequest](https://learn.microsoft.com/en-us/graph/api/resources/searchrequest) resource type. +type SearchRequest struct { + // One or more types of resources expected in the response. Currently only `driveItem` is supported. + EntityTypes []string `json:"entityTypes"` + Query SearchQuery `json:"query"` + // Specifies the offset for the search results. Offset 0 returns the very first result. Used together with the `size` property for pagination. + From *int32 `json:"from,omitempty"` + // The size of the page to be retrieved. The maximum value is 500. Set to 0 to return only aggregations without any hits. + Size *int32 `json:"size,omitempty"` + // Specifies aggregations (also known as refiners or facets) to be returned alongside the search results. Optional. + Aggregations []AggregationOption `json:"aggregations,omitempty"` + // Contains one or more filters to obtain search results narrowed down to a specific value of a field. Build this filter based on a prior search that aggregates by the same field. From the response of the prior search, identify the `searchBucket` that filters results to the specific value of the field, use the string in its `aggregationFilterToken` property, and build an aggregation filter string in the format `\"{field}:\\\"{aggregationFilterToken}\\\"\"`. Multiple filters can be provided as separate array items. This results in a logical AND between the filters. + AggregationFilters []string `json:"aggregationFilters,omitempty"` +} + +type _SearchRequest SearchRequest + +// NewSearchRequest instantiates a new SearchRequest 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 NewSearchRequest(entityTypes []string, query SearchQuery) *SearchRequest { + this := SearchRequest{} + this.EntityTypes = entityTypes + this.Query = query + var from int32 = 0 + this.From = &from + var size int32 = 25 + this.Size = &size + return &this +} + +// NewSearchRequestWithDefaults instantiates a new SearchRequest 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 NewSearchRequestWithDefaults() *SearchRequest { + this := SearchRequest{} + var from int32 = 0 + this.From = &from + var size int32 = 25 + this.Size = &size + return &this +} + +// GetEntityTypes returns the EntityTypes field value +func (o *SearchRequest) GetEntityTypes() []string { + if o == nil { + var ret []string + return ret + } + + return o.EntityTypes +} + +// GetEntityTypesOk returns a tuple with the EntityTypes field value +// and a boolean to check if the value has been set. +func (o *SearchRequest) GetEntityTypesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.EntityTypes, true +} + +// SetEntityTypes sets field value +func (o *SearchRequest) SetEntityTypes(v []string) { + o.EntityTypes = v +} + +// GetQuery returns the Query field value +func (o *SearchRequest) GetQuery() SearchQuery { + if o == nil { + var ret SearchQuery + return ret + } + + return o.Query +} + +// GetQueryOk returns a tuple with the Query field value +// and a boolean to check if the value has been set. +func (o *SearchRequest) GetQueryOk() (*SearchQuery, bool) { + if o == nil { + return nil, false + } + return &o.Query, true +} + +// SetQuery sets field value +func (o *SearchRequest) SetQuery(v SearchQuery) { + o.Query = v +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *SearchRequest) GetFrom() int32 { + if o == nil || IsNil(o.From) { + var ret int32 + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchRequest) GetFromOk() (*int32, bool) { + if o == nil || IsNil(o.From) { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *SearchRequest) HasFrom() bool { + if o != nil && !IsNil(o.From) { + return true + } + + return false +} + +// SetFrom gets a reference to the given int32 and assigns it to the From field. +func (o *SearchRequest) SetFrom(v int32) { + o.From = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *SearchRequest) GetSize() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchRequest) GetSizeOk() (*int32, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *SearchRequest) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int32 and assigns it to the Size field. +func (o *SearchRequest) SetSize(v int32) { + o.Size = &v +} + +// GetAggregations returns the Aggregations field value if set, zero value otherwise. +func (o *SearchRequest) GetAggregations() []AggregationOption { + if o == nil || IsNil(o.Aggregations) { + var ret []AggregationOption + return ret + } + return o.Aggregations +} + +// GetAggregationsOk returns a tuple with the Aggregations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchRequest) GetAggregationsOk() ([]AggregationOption, bool) { + if o == nil || IsNil(o.Aggregations) { + return nil, false + } + return o.Aggregations, true +} + +// HasAggregations returns a boolean if a field has been set. +func (o *SearchRequest) HasAggregations() bool { + if o != nil && !IsNil(o.Aggregations) { + return true + } + + return false +} + +// SetAggregations gets a reference to the given []AggregationOption and assigns it to the Aggregations field. +func (o *SearchRequest) SetAggregations(v []AggregationOption) { + o.Aggregations = v +} + +// GetAggregationFilters returns the AggregationFilters field value if set, zero value otherwise. +func (o *SearchRequest) GetAggregationFilters() []string { + if o == nil || IsNil(o.AggregationFilters) { + var ret []string + return ret + } + return o.AggregationFilters +} + +// GetAggregationFiltersOk returns a tuple with the AggregationFilters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchRequest) GetAggregationFiltersOk() ([]string, bool) { + if o == nil || IsNil(o.AggregationFilters) { + return nil, false + } + return o.AggregationFilters, true +} + +// HasAggregationFilters returns a boolean if a field has been set. +func (o *SearchRequest) HasAggregationFilters() bool { + if o != nil && !IsNil(o.AggregationFilters) { + return true + } + + return false +} + +// SetAggregationFilters gets a reference to the given []string and assigns it to the AggregationFilters field. +func (o *SearchRequest) SetAggregationFilters(v []string) { + o.AggregationFilters = v +} + +func (o SearchRequest) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SearchRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["entityTypes"] = o.EntityTypes + toSerialize["query"] = o.Query + if !IsNil(o.From) { + toSerialize["from"] = o.From + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Aggregations) { + toSerialize["aggregations"] = o.Aggregations + } + if !IsNil(o.AggregationFilters) { + toSerialize["aggregationFilters"] = o.AggregationFilters + } + return toSerialize, nil +} + +func (o *SearchRequest) 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{ + "entityTypes", + "query", + } + + 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) + } + } + + varSearchRequest := _SearchRequest{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSearchRequest) + + if err != nil { + return err + } + + *o = SearchRequest(varSearchRequest) + + return err +} + +type NullableSearchRequest struct { + value *SearchRequest + isSet bool +} + +func (v NullableSearchRequest) Get() *SearchRequest { + return v.value +} + +func (v *NullableSearchRequest) Set(val *SearchRequest) { + v.value = val + v.isSet = true +} + +func (v NullableSearchRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableSearchRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSearchRequest(val *SearchRequest) *NullableSearchRequest { + return &NullableSearchRequest{value: val, isSet: true} +} + +func (v NullableSearchRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSearchRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + + diff --git a/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_response.go b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_response.go new file mode 100644 index 0000000000..a148990531 --- /dev/null +++ b/vendor/github.com/opencloud-eu/libre-graph-api-go/model_search_response.go @@ -0,0 +1,164 @@ +/* +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" +) + +// checks if the SearchResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SearchResponse{} + +// SearchResponse Represents the response for an individual search request. Follows the [MS Graph searchResponse](https://learn.microsoft.com/en-us/graph/api/resources/searchresponse) resource type. +type SearchResponse struct { + // Contains the search terms sent in the initial search query. + SearchTerms []string `json:"searchTerms,omitempty"` + // A collection of search result sets. One for each entity type that was queried. + HitsContainers []SearchHitsContainer `json:"hitsContainers,omitempty"` +} + +// NewSearchResponse instantiates a new SearchResponse 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 NewSearchResponse() *SearchResponse { + this := SearchResponse{} + return &this +} + +// NewSearchResponseWithDefaults instantiates a new SearchResponse 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 NewSearchResponseWithDefaults() *SearchResponse { + this := SearchResponse{} + return &this +} + +// GetSearchTerms returns the SearchTerms field value if set, zero value otherwise. +func (o *SearchResponse) GetSearchTerms() []string { + if o == nil || IsNil(o.SearchTerms) { + var ret []string + return ret + } + return o.SearchTerms +} + +// GetSearchTermsOk returns a tuple with the SearchTerms field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchResponse) GetSearchTermsOk() ([]string, bool) { + if o == nil || IsNil(o.SearchTerms) { + return nil, false + } + return o.SearchTerms, true +} + +// HasSearchTerms returns a boolean if a field has been set. +func (o *SearchResponse) HasSearchTerms() bool { + if o != nil && !IsNil(o.SearchTerms) { + return true + } + + return false +} + +// SetSearchTerms gets a reference to the given []string and assigns it to the SearchTerms field. +func (o *SearchResponse) SetSearchTerms(v []string) { + o.SearchTerms = v +} + +// GetHitsContainers returns the HitsContainers field value if set, zero value otherwise. +func (o *SearchResponse) GetHitsContainers() []SearchHitsContainer { + if o == nil || IsNil(o.HitsContainers) { + var ret []SearchHitsContainer + return ret + } + return o.HitsContainers +} + +// GetHitsContainersOk returns a tuple with the HitsContainers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SearchResponse) GetHitsContainersOk() ([]SearchHitsContainer, bool) { + if o == nil || IsNil(o.HitsContainers) { + return nil, false + } + return o.HitsContainers, true +} + +// HasHitsContainers returns a boolean if a field has been set. +func (o *SearchResponse) HasHitsContainers() bool { + if o != nil && !IsNil(o.HitsContainers) { + return true + } + + return false +} + +// SetHitsContainers gets a reference to the given []SearchHitsContainer and assigns it to the HitsContainers field. +func (o *SearchResponse) SetHitsContainers(v []SearchHitsContainer) { + o.HitsContainers = v +} + +func (o SearchResponse) MarshalJSON() ([]byte, error) { + toSerialize,err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SearchResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SearchTerms) { + toSerialize["searchTerms"] = o.SearchTerms + } + if !IsNil(o.HitsContainers) { + toSerialize["hitsContainers"] = o.HitsContainers + } + return toSerialize, nil +} + +type NullableSearchResponse struct { + value *SearchResponse + isSet bool +} + +func (v NullableSearchResponse) Get() *SearchResponse { + return v.value +} + +func (v *NullableSearchResponse) Set(val *SearchResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSearchResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSearchResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSearchResponse(val *SearchResponse) *NullableSearchResponse { + return &NullableSearchResponse{value: val, isSet: true} +} + +func (v NullableSearchResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSearchResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +