Bump libre-graph-go to latest main branch

To get sharing endpoints and audio/photo/location facets
This commit is contained in:
Ralf Haferkamp
2023-10-19 10:17:22 +02:00
committed by Ralf Haferkamp
parent 62d8a03400
commit b436e49f19
99 changed files with 7070 additions and 1527 deletions

2
go.mod
View File

@@ -65,7 +65,7 @@ require (
github.com/onsi/gomega v1.27.10
github.com/open-policy-agent/opa v0.51.0
github.com/orcaman/concurrent-map v1.0.0
github.com/owncloud/libre-graph-api-go v1.0.5-0.20230710073250-9e5acb4b5838
github.com/owncloud/libre-graph-api-go v1.0.5-0.20231019070917-17ae03ef40e4
github.com/pkg/errors v0.9.1
github.com/pkg/xattr v0.4.9
github.com/prometheus/client_golang v1.17.0

5
go.sum
View File

@@ -1769,8 +1769,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.20230710073250-9e5acb4b5838 h1:1pS1yRXaUO9vpC2k7X5gAIx+l2qyqX0H86WmRouC9i4=
github.com/owncloud/libre-graph-api-go v1.0.5-0.20230710073250-9e5acb4b5838/go.mod h1:iKdVH6nYpI8RBeK9sjeLfzrPByST6r9d+NG2IJHoJmU=
github.com/owncloud/libre-graph-api-go v1.0.5-0.20231019070917-17ae03ef40e4 h1:W2X4DGGEuNUeGCKOUK8c2NAC4kva8jq9knuv5ePLUiE=
github.com/owncloud/libre-graph-api-go v1.0.5-0.20231019070917-17ae03ef40e4/go.mod h1:v2aAl5IwEI8t+GmcWvBd+bvJMYp9Vf1hekLuRf0UnEs=
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/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
@@ -2295,7 +2295,6 @@ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210323180902-22b0adad7558/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=

View File

@@ -15,7 +15,6 @@ Install the following dependencies:
```shell
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
```
@@ -85,6 +84,12 @@ Class | Method | HTTP request | Description
*DrivesApi* | [**GetDrive**](docs/DrivesApi.md#getdrive) | **Get** /drives/{drive-id} | Get drive by id
*DrivesApi* | [**UpdateDrive**](docs/DrivesApi.md#updatedrive) | **Patch** /drives/{drive-id} | Update the drive
*DrivesGetDrivesApi* | [**ListAllDrives**](docs/DrivesGetDrivesApi.md#listalldrives) | **Get** /drives | Get all available drives
*DrivesPermissionsApi* | [**CreateLink**](docs/DrivesPermissionsApi.md#createlink) | **Post** /drives/{drive-id}/items/{item-id}/createLink | Create a sharing link for a DriveItem
*DrivesPermissionsApi* | [**DeletePermission**](docs/DrivesPermissionsApi.md#deletepermission) | **Delete** /drives/{drive-id}/items/{item-id}/permissions/{perm-id} | Delete entity from groups
*DrivesPermissionsApi* | [**GetPermission**](docs/DrivesPermissionsApi.md#getpermission) | **Get** /drives/{drive-id}/items/{item-id}/permissions/{perm-id} | Get sharing permission for a file or folder
*DrivesPermissionsApi* | [**Invite**](docs/DrivesPermissionsApi.md#invite) | **Post** /drives/{drive-id}/items/{item-id}/invite | Send a sharing invitation
*DrivesPermissionsApi* | [**ListPermissions**](docs/DrivesPermissionsApi.md#listpermissions) | **Get** /drives/{drive-id}/items/{item-id}/permissions | List the effective sharing permissions on a driveItem.
*DrivesPermissionsApi* | [**UpdatePermission**](docs/DrivesPermissionsApi.md#updatepermission) | **Patch** /drives/{drive-id}/items/{item-id}/permissions/{perm-id} | Update sharing permission
*DrivesRootApi* | [**GetRoot**](docs/DrivesRootApi.md#getroot) | **Get** /drives/{drive-id}/root | Get root from arbitrary space
*EducationClassApi* | [**AddUserToClass**](docs/EducationClassApi.md#addusertoclass) | **Post** /education/classes/{class-id}/members/$ref | Assign a user to a class
*EducationClassApi* | [**CreateClass**](docs/EducationClassApi.md#createclass) | **Post** /education/classes | Add new education class
@@ -123,10 +128,14 @@ Class | Method | HTTP request | Description
*GroupsApi* | [**ListGroups**](docs/GroupsApi.md#listgroups) | **Get** /groups | Get entities from groups
*MeChangepasswordApi* | [**ChangeOwnPassword**](docs/MeChangepasswordApi.md#changeownpassword) | **Post** /me/changePassword | Chanage your own password
*MeDriveApi* | [**GetHome**](docs/MeDriveApi.md#gethome) | **Get** /me/drive | Get personal space for user
*MeDriveApi* | [**ListSharedByMe**](docs/MeDriveApi.md#listsharedbyme) | **Get** /me/drive/sharedByMe | Get a list of driveItem objects shared by the current user.
*MeDriveApi* | [**ListSharedWithMe**](docs/MeDriveApi.md#listsharedwithme) | **Get** /me/drive/sharedWithMe | Get a list of driveItem objects shared with the owner of a drive.
*MeDriveRootApi* | [**HomeGetRoot**](docs/MeDriveRootApi.md#homegetroot) | **Get** /me/drive/root | Get root from personal space
*MeDriveRootChildrenApi* | [**HomeGetChildren**](docs/MeDriveRootChildrenApi.md#homegetchildren) | **Get** /me/drive/root/children | Get children from drive
*MeDrivesApi* | [**ListMyDrives**](docs/MeDrivesApi.md#listmydrives) | **Get** /me/drives | Get all drives where the current user is a regular member of
*MeUserApi* | [**GetOwnUser**](docs/MeUserApi.md#getownuser) | **Get** /me | Get current user
*RoleManagementApi* | [**GetPermissionRoleDefinition**](docs/RoleManagementApi.md#getpermissionroledefinition) | **Get** /roleManagement/permissions/roleDefinitions/{role-id} | Get unifiedRoleDefinition
*RoleManagementApi* | [**ListPermissionRoleDefinitions**](docs/RoleManagementApi.md#listpermissionroledefinitions) | **Get** /roleManagement/permissions/roleDefinitions | List roleDefinitions
*TagsApi* | [**AssignTags**](docs/TagsApi.md#assigntags) | **Put** /extensions/org.libregraph/tags | Assign tags to a resource
*TagsApi* | [**GetTags**](docs/TagsApi.md#gettags) | **Get** /extensions/org.libregraph/tags | Get all known tags
*TagsApi* | [**UnassignTags**](docs/TagsApi.md#unassigntags) | **Delete** /extensions/org.libregraph/tags | Unassign tags from a resource
@@ -146,6 +155,7 @@ Class | Method | HTTP request | Description
- [AppRole](docs/AppRole.md)
- [AppRoleAssignment](docs/AppRoleAssignment.md)
- [Application](docs/Application.md)
- [Audio](docs/Audio.md)
- [ClassMemberReference](docs/ClassMemberReference.md)
- [ClassReference](docs/ClassReference.md)
- [ClassTeacherReference](docs/ClassTeacherReference.md)
@@ -153,12 +163,14 @@ Class | Method | HTTP request | Description
- [CollectionOfApplications](docs/CollectionOfApplications.md)
- [CollectionOfClass](docs/CollectionOfClass.md)
- [CollectionOfDriveItems](docs/CollectionOfDriveItems.md)
- [CollectionOfDriveItems1](docs/CollectionOfDriveItems1.md)
- [CollectionOfDrives](docs/CollectionOfDrives.md)
- [CollectionOfDrives1](docs/CollectionOfDrives1.md)
- [CollectionOfEducationClass](docs/CollectionOfEducationClass.md)
- [CollectionOfEducationUser](docs/CollectionOfEducationUser.md)
- [CollectionOfEducationUser1](docs/CollectionOfEducationUser1.md)
- [CollectionOfGroup](docs/CollectionOfGroup.md)
- [CollectionOfPermissions](docs/CollectionOfPermissions.md)
- [CollectionOfSchools](docs/CollectionOfSchools.md)
- [CollectionOfTags](docs/CollectionOfTags.md)
- [CollectionOfUser](docs/CollectionOfUser.md)
@@ -167,6 +179,9 @@ Class | Method | HTTP request | Description
- [DirectoryObject](docs/DirectoryObject.md)
- [Drive](docs/Drive.md)
- [DriveItem](docs/DriveItem.md)
- [DriveItemCreateLink](docs/DriveItemCreateLink.md)
- [DriveItemInvite](docs/DriveItemInvite.md)
- [DriveRecipient](docs/DriveRecipient.md)
- [EducationClass](docs/EducationClass.md)
- [EducationOrganization](docs/EducationOrganization.md)
- [EducationSchool](docs/EducationSchool.md)
@@ -177,6 +192,7 @@ Class | Method | HTTP request | Description
- [FileSystemInfo](docs/FileSystemInfo.md)
- [Folder](docs/Folder.md)
- [FolderView](docs/FolderView.md)
- [GeoCoordinates](docs/GeoCoordinates.md)
- [Group](docs/Group.md)
- [Hashes](docs/Hashes.md)
- [Identity](docs/Identity.md)
@@ -192,19 +208,27 @@ Class | Method | HTTP request | Description
- [PasswordChange](docs/PasswordChange.md)
- [PasswordProfile](docs/PasswordProfile.md)
- [Permission](docs/Permission.md)
- [Photo](docs/Photo.md)
- [Quota](docs/Quota.md)
- [RemoteItem](docs/RemoteItem.md)
- [SharePointIdentitySet](docs/SharePointIdentitySet.md)
- [Shared](docs/Shared.md)
- [SharingLink](docs/SharingLink.md)
- [SharingLinkType](docs/SharingLinkType.md)
- [SpecialFolder](docs/SpecialFolder.md)
- [TagAssignment](docs/TagAssignment.md)
- [TagUnassignment](docs/TagUnassignment.md)
- [Trash](docs/Trash.md)
- [UnifiedRoleDefinition](docs/UnifiedRoleDefinition.md)
- [UnifiedRolePermission](docs/UnifiedRolePermission.md)
- [User](docs/User.md)
## Documentation For Authorization
Authentication schemes defined for the API:
### openId
### bearerAuth

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
@@ -63,7 +63,7 @@ func (a *ApplicationsApiService) GetApplicationExecute(r ApiGetApplicationReques
}
localVarPath := localBasePath + "/applications/{application-id}"
localVarPath = strings.Replace(localVarPath, "{"+"application-id"+"}", url.PathEscape(parameterToString(r.applicationId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"application-id"+"}", url.PathEscape(parameterValueToString(r.applicationId, "applicationId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -96,9 +96,9 @@ func (a *ApplicationsApiService) GetApplicationExecute(r ApiGetApplicationReques
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -114,6 +114,7 @@ func (a *ApplicationsApiService) GetApplicationExecute(r ApiGetApplicationReques
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -200,9 +201,9 @@ func (a *ApplicationsApiService) ListApplicationsExecute(r ApiListApplicationsRe
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -218,6 +219,7 @@ func (a *ApplicationsApiService) ListApplicationsExecute(r ApiListApplicationsRe
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
@@ -104,9 +104,9 @@ func (a *DrivesApiService) CreateDriveExecute(r ApiCreateDriveRequest) (*Drive,
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -122,6 +122,7 @@ func (a *DrivesApiService) CreateDriveExecute(r ApiCreateDriveRequest) (*Drive,
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -184,7 +185,7 @@ func (a *DrivesApiService) DeleteDriveExecute(r ApiDeleteDriveRequest) (*http.Re
}
localVarPath := localBasePath + "/drives/{drive-id}"
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterToString(r.driveId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -208,7 +209,7 @@ func (a *DrivesApiService) DeleteDriveExecute(r ApiDeleteDriveRequest) (*http.Re
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.ifMatch != nil {
localVarHeaderParams["If-Match"] = parameterToString(*r.ifMatch, "")
parameterAddToHeaderOrQuery(localVarHeaderParams, "If-Match", r.ifMatch, "")
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
@@ -220,9 +221,9 @@ func (a *DrivesApiService) DeleteDriveExecute(r ApiDeleteDriveRequest) (*http.Re
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -238,6 +239,7 @@ func (a *DrivesApiService) DeleteDriveExecute(r ApiDeleteDriveRequest) (*http.Re
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -286,7 +288,7 @@ func (a *DrivesApiService) GetDriveExecute(r ApiGetDriveRequest) (*Drive, *http.
}
localVarPath := localBasePath + "/drives/{drive-id}"
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterToString(r.driveId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -319,9 +321,9 @@ func (a *DrivesApiService) GetDriveExecute(r ApiGetDriveRequest) (*Drive, *http.
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -337,6 +339,7 @@ func (a *DrivesApiService) GetDriveExecute(r ApiGetDriveRequest) (*Drive, *http.
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -401,7 +404,7 @@ func (a *DrivesApiService) UpdateDriveExecute(r ApiUpdateDriveRequest) (*Drive,
}
localVarPath := localBasePath + "/drives/{drive-id}"
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterToString(r.driveId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -439,9 +442,9 @@ func (a *DrivesApiService) UpdateDriveExecute(r ApiUpdateDriveRequest) (*Drive,
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -457,6 +460,7 @@ func (a *DrivesApiService) UpdateDriveExecute(r ApiUpdateDriveRequest) (*Drive,
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
)
@@ -79,10 +79,10 @@ func (a *DrivesGetDrivesApiService) ListAllDrivesExecute(r ApiListAllDrivesReque
localVarFormParams := url.Values{}
if r.orderby != nil {
localVarQueryParams.Add("$orderby", parameterToString(*r.orderby, ""))
parameterAddToHeaderOrQuery(localVarQueryParams, "$orderby", r.orderby, "")
}
if r.filter != nil {
localVarQueryParams.Add("$filter", parameterToString(*r.filter, ""))
parameterAddToHeaderOrQuery(localVarQueryParams, "$filter", r.filter, "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@@ -111,9 +111,9 @@ func (a *DrivesGetDrivesApiService) ListAllDrivesExecute(r ApiListAllDrivesReque
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -129,6 +129,7 @@ func (a *DrivesGetDrivesApiService) ListAllDrivesExecute(r ApiListAllDrivesReque
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -0,0 +1,793 @@
/*
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"
"strings"
)
// DrivesPermissionsApiService DrivesPermissionsApi service
type DrivesPermissionsApiService service
type ApiCreateLinkRequest struct {
ctx context.Context
ApiService *DrivesPermissionsApiService
driveId string
itemId string
driveItemCreateLink *DriveItemCreateLink
}
// In the request body, provide a JSON object with the following parameters.
func (r ApiCreateLinkRequest) DriveItemCreateLink(driveItemCreateLink DriveItemCreateLink) ApiCreateLinkRequest {
r.driveItemCreateLink = &driveItemCreateLink
return r
}
func (r ApiCreateLinkRequest) Execute() (*Permission, *http.Response, error) {
return r.ApiService.CreateLinkExecute(r)
}
/*
CreateLink Create a sharing link for a DriveItem
You can use the createLink action to share a driveItem via a sharing link.
The response will be a permission object with the link facet containing the created link details.
## Link types
For now, The following values are allowed for the type parameter.
| Value | Display name | Description |
| -------------- | ----------------- | --------------------------------------------------------------- |
| view | View | Creates a read-only link to the driveItem. |
| upload | Upload | Creates a read-write link to the folder driveItem. |
| edit | Edit | Creates a read-write link to the driveItem. |
| createOnly | File Drop | Creates an upload-only link to the folder driveItem. |
| blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. |
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param driveId key: id of drive
@param itemId key: id of item
@return ApiCreateLinkRequest
*/
func (a *DrivesPermissionsApiService) CreateLink(ctx context.Context, driveId string, itemId string) ApiCreateLinkRequest {
return ApiCreateLinkRequest{
ApiService: a,
ctx: ctx,
driveId: driveId,
itemId: itemId,
}
}
// Execute executes the request
// @return Permission
func (a *DrivesPermissionsApiService) CreateLinkExecute(r ApiCreateLinkRequest) (*Permission, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Permission
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesPermissionsApiService.CreateLink")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/drives/{drive-id}/items/{item-id}/createLink"
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// 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.driveItemCreateLink
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
}
type ApiDeletePermissionRequest struct {
ctx context.Context
ApiService *DrivesPermissionsApiService
driveId string
itemId string
permId string
}
func (r ApiDeletePermissionRequest) Execute() (*http.Response, error) {
return r.ApiService.DeletePermissionExecute(r)
}
/*
DeletePermission Delete entity from groups
Remove access to a DriveItem.
Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param driveId key: id of drive
@param itemId key: id of item
@param permId key: id of permission
@return ApiDeletePermissionRequest
*/
func (a *DrivesPermissionsApiService) DeletePermission(ctx context.Context, driveId string, itemId string, permId string) ApiDeletePermissionRequest {
return ApiDeletePermissionRequest{
ApiService: a,
ctx: ctx,
driveId: driveId,
itemId: itemId,
permId: permId,
}
}
// Execute executes the request
func (a *DrivesPermissionsApiService) DeletePermissionExecute(r ApiDeletePermissionRequest) (*http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesPermissionsApiService.DeletePermission")
if err != nil {
return nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/drives/{drive-id}/items/{item-id}/permissions/{perm-id}"
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"perm-id"+"}", url.PathEscape(parameterValueToString(r.permId, "permId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// 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 nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return 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 localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
return localVarHTTPResponse, nil
}
type ApiGetPermissionRequest struct {
ctx context.Context
ApiService *DrivesPermissionsApiService
driveId string
itemId string
permId string
}
func (r ApiGetPermissionRequest) Execute() (*Permission, *http.Response, error) {
return r.ApiService.GetPermissionExecute(r)
}
/*
GetPermission Get sharing permission for a file or folder
Return the effective sharing permission for a particular permission resource.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param driveId key: id of drive
@param itemId key: id of item
@param permId key: id of permission
@return ApiGetPermissionRequest
*/
func (a *DrivesPermissionsApiService) GetPermission(ctx context.Context, driveId string, itemId string, permId string) ApiGetPermissionRequest {
return ApiGetPermissionRequest{
ApiService: a,
ctx: ctx,
driveId: driveId,
itemId: itemId,
permId: permId,
}
}
// Execute executes the request
// @return Permission
func (a *DrivesPermissionsApiService) GetPermissionExecute(r ApiGetPermissionRequest) (*Permission, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Permission
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesPermissionsApiService.GetPermission")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/drives/{drive-id}/items/{item-id}/permissions/{perm-id}"
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"perm-id"+"}", url.PathEscape(parameterValueToString(r.permId, "permId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// 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
}
type ApiInviteRequest struct {
ctx context.Context
ApiService *DrivesPermissionsApiService
driveId string
itemId string
driveItemInvite *DriveItemInvite
}
// In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles.
func (r ApiInviteRequest) DriveItemInvite(driveItemInvite DriveItemInvite) ApiInviteRequest {
r.driveItemInvite = &driveItemInvite
return r
}
func (r ApiInviteRequest) Execute() (*Permission, *http.Response, error) {
return r.ApiService.InviteExecute(r)
}
/*
Invite Send a sharing invitation
Sends a sharing invitation for a `driveItem`. A sharing invitation provides permissions to the
recipients and optionally sends them an email with a sharing link.
The response will be a permission object with the grantedToV2 property containing the created grant details.
## Roles property values
For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param driveId key: id of drive
@param itemId key: id of item
@return ApiInviteRequest
*/
func (a *DrivesPermissionsApiService) Invite(ctx context.Context, driveId string, itemId string) ApiInviteRequest {
return ApiInviteRequest{
ApiService: a,
ctx: ctx,
driveId: driveId,
itemId: itemId,
}
}
// Execute executes the request
// @return Permission
func (a *DrivesPermissionsApiService) InviteExecute(r ApiInviteRequest) (*Permission, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Permission
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesPermissionsApiService.Invite")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/drives/{drive-id}/items/{item-id}/invite"
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// 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.driveItemInvite
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,
}
if localVarHTTPResponse.StatusCode == 400 {
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
}
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
}
type ApiListPermissionsRequest struct {
ctx context.Context
ApiService *DrivesPermissionsApiService
driveId string
itemId string
}
func (r ApiListPermissionsRequest) Execute() (*CollectionOfPermissions, *http.Response, error) {
return r.ApiService.ListPermissionsExecute(r)
}
/*
ListPermissions List the effective sharing permissions on a driveItem.
The permissions collection includes potentially sensitive information and may not be available for every caller.
* For the owner of the item, all sharing permissions will be returned. This includes co-owners.
* For a non-owner caller, only the sharing permissions that apply to the caller are returned.
* Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission.
All permission objects have an `id`. A permission representing
* a link has the `link` facet filled with details.
* a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param driveId key: id of drive
@param itemId key: id of item
@return ApiListPermissionsRequest
*/
func (a *DrivesPermissionsApiService) ListPermissions(ctx context.Context, driveId string, itemId string) ApiListPermissionsRequest {
return ApiListPermissionsRequest{
ApiService: a,
ctx: ctx,
driveId: driveId,
itemId: itemId,
}
}
// Execute executes the request
// @return CollectionOfPermissions
func (a *DrivesPermissionsApiService) ListPermissionsExecute(r ApiListPermissionsRequest) (*CollectionOfPermissions, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *CollectionOfPermissions
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesPermissionsApiService.ListPermissions")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/drives/{drive-id}/items/{item-id}/permissions"
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// 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
}
type ApiUpdatePermissionRequest struct {
ctx context.Context
ApiService *DrivesPermissionsApiService
driveId string
itemId string
permId string
permission *Permission
}
// New property values
func (r ApiUpdatePermissionRequest) Permission(permission Permission) ApiUpdatePermissionRequest {
r.permission = &permission
return r
}
func (r ApiUpdatePermissionRequest) Execute() (*Permission, *http.Response, error) {
return r.ApiService.UpdatePermissionExecute(r)
}
/*
UpdatePermission Update sharing permission
Update the properties of a sharing permission by patching the permission resource.
Only the `roles`, `expirationDateTime` and `password` properties can be modified this way.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param driveId key: id of drive
@param itemId key: id of item
@param permId key: id of permission
@return ApiUpdatePermissionRequest
*/
func (a *DrivesPermissionsApiService) UpdatePermission(ctx context.Context, driveId string, itemId string, permId string) ApiUpdatePermissionRequest {
return ApiUpdatePermissionRequest{
ApiService: a,
ctx: ctx,
driveId: driveId,
itemId: itemId,
permId: permId,
}
}
// Execute executes the request
// @return Permission
func (a *DrivesPermissionsApiService) UpdatePermissionExecute(r ApiUpdatePermissionRequest) (*Permission, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Permission
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesPermissionsApiService.UpdatePermission")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/drives/{drive-id}/items/{item-id}/permissions/{perm-id}"
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"perm-id"+"}", url.PathEscape(parameterValueToString(r.permId, "permId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.permission == nil {
return localVarReturnValue, nil, reportError("permission 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.permission
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
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
@@ -63,7 +63,7 @@ func (a *DrivesRootApiService) GetRootExecute(r ApiGetRootRequest) (*DriveItem,
}
localVarPath := localBasePath + "/drives/{drive-id}/root"
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterToString(r.driveId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -96,9 +96,9 @@ func (a *DrivesRootApiService) GetRootExecute(r ApiGetRootRequest) (*DriveItem,
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -114,6 +114,7 @@ func (a *DrivesRootApiService) GetRootExecute(r ApiGetRootRequest) (*DriveItem,
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
@@ -68,7 +68,7 @@ func (a *EducationClassApiService) AddUserToClassExecute(r ApiAddUserToClassRequ
}
localVarPath := localBasePath + "/education/classes/{class-id}/members/$ref"
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterToString(r.classId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -106,9 +106,9 @@ func (a *EducationClassApiService) AddUserToClassExecute(r ApiAddUserToClassRequ
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -124,6 +124,7 @@ func (a *EducationClassApiService) AddUserToClassExecute(r ApiAddUserToClassRequ
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -213,9 +214,9 @@ func (a *EducationClassApiService) CreateClassExecute(r ApiCreateClassRequest) (
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -231,6 +232,7 @@ func (a *EducationClassApiService) CreateClassExecute(r ApiCreateClassRequest) (
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -286,7 +288,7 @@ func (a *EducationClassApiService) DeleteClassExecute(r ApiDeleteClassRequest) (
}
localVarPath := localBasePath + "/education/classes/{class-id}"
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterToString(r.classId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -319,9 +321,9 @@ func (a *EducationClassApiService) DeleteClassExecute(r ApiDeleteClassRequest) (
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -337,6 +339,7 @@ func (a *EducationClassApiService) DeleteClassExecute(r ApiDeleteClassRequest) (
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -386,8 +389,8 @@ func (a *EducationClassApiService) DeleteUserFromClassExecute(r ApiDeleteUserFro
}
localVarPath := localBasePath + "/education/classes/{class-id}/members/{user-id}/$ref"
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterToString(r.classId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterToString(r.userId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -420,9 +423,9 @@ func (a *EducationClassApiService) DeleteUserFromClassExecute(r ApiDeleteUserFro
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -438,6 +441,7 @@ func (a *EducationClassApiService) DeleteUserFromClassExecute(r ApiDeleteUserFro
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -486,7 +490,7 @@ func (a *EducationClassApiService) GetClassExecute(r ApiGetClassRequest) (*Educa
}
localVarPath := localBasePath + "/education/classes/{class-id}"
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterToString(r.classId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -519,9 +523,9 @@ func (a *EducationClassApiService) GetClassExecute(r ApiGetClassRequest) (*Educa
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -537,6 +541,7 @@ func (a *EducationClassApiService) GetClassExecute(r ApiGetClassRequest) (*Educa
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -594,7 +599,7 @@ func (a *EducationClassApiService) ListClassMembersExecute(r ApiListClassMembers
}
localVarPath := localBasePath + "/education/classes/{class-id}/members"
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterToString(r.classId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -627,9 +632,9 @@ func (a *EducationClassApiService) ListClassMembersExecute(r ApiListClassMembers
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -645,6 +650,7 @@ func (a *EducationClassApiService) ListClassMembersExecute(r ApiListClassMembers
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -731,9 +737,9 @@ func (a *EducationClassApiService) ListClassesExecute(r ApiListClassesRequest) (
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -749,6 +755,7 @@ func (a *EducationClassApiService) ListClassesExecute(r ApiListClassesRequest) (
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -813,7 +820,7 @@ func (a *EducationClassApiService) UpdateClassExecute(r ApiUpdateClassRequest) (
}
localVarPath := localBasePath + "/education/classes/{class-id}"
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterToString(r.classId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -851,9 +858,9 @@ func (a *EducationClassApiService) UpdateClassExecute(r ApiUpdateClassRequest) (
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -869,6 +876,7 @@ func (a *EducationClassApiService) UpdateClassExecute(r ApiUpdateClassRequest) (
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
@@ -68,7 +68,7 @@ func (a *EducationClassTeachersApiService) AddTeacherToClassExecute(r ApiAddTeac
}
localVarPath := localBasePath + "/education/classes/{class-id}/teachers/$ref"
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterToString(r.classId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -106,9 +106,9 @@ func (a *EducationClassTeachersApiService) AddTeacherToClassExecute(r ApiAddTeac
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -124,6 +124,7 @@ func (a *EducationClassTeachersApiService) AddTeacherToClassExecute(r ApiAddTeac
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -173,8 +174,8 @@ func (a *EducationClassTeachersApiService) DeleteTeacherFromClassExecute(r ApiDe
}
localVarPath := localBasePath + "/education/classes/{class-id}/teachers/{user-id}/$ref"
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterToString(r.classId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterToString(r.userId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -207,9 +208,9 @@ func (a *EducationClassTeachersApiService) DeleteTeacherFromClassExecute(r ApiDe
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -225,6 +226,7 @@ func (a *EducationClassTeachersApiService) DeleteTeacherFromClassExecute(r ApiDe
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -273,7 +275,7 @@ func (a *EducationClassTeachersApiService) GetTeachersExecute(r ApiGetTeachersRe
}
localVarPath := localBasePath + "/education/classes/{class-id}/teachers"
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterToString(r.classId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -306,9 +308,9 @@ func (a *EducationClassTeachersApiService) GetTeachersExecute(r ApiGetTeachersRe
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -324,6 +326,7 @@ func (a *EducationClassTeachersApiService) GetTeachersExecute(r ApiGetTeachersRe
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
@@ -68,7 +68,7 @@ func (a *EducationSchoolApiService) AddClassToSchoolExecute(r ApiAddClassToSchoo
}
localVarPath := localBasePath + "/education/schools/{school-id}/classes/$ref"
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterToString(r.schoolId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterValueToString(r.schoolId, "schoolId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -106,9 +106,9 @@ func (a *EducationSchoolApiService) AddClassToSchoolExecute(r ApiAddClassToSchoo
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -124,6 +124,7 @@ func (a *EducationSchoolApiService) AddClassToSchoolExecute(r ApiAddClassToSchoo
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -177,7 +178,7 @@ func (a *EducationSchoolApiService) AddUserToSchoolExecute(r ApiAddUserToSchoolR
}
localVarPath := localBasePath + "/education/schools/{school-id}/users/$ref"
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterToString(r.schoolId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterValueToString(r.schoolId, "schoolId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -215,9 +216,9 @@ func (a *EducationSchoolApiService) AddUserToSchoolExecute(r ApiAddUserToSchoolR
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -233,6 +234,7 @@ func (a *EducationSchoolApiService) AddUserToSchoolExecute(r ApiAddUserToSchoolR
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -322,9 +324,9 @@ func (a *EducationSchoolApiService) CreateSchoolExecute(r ApiCreateSchoolRequest
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -340,6 +342,7 @@ func (a *EducationSchoolApiService) CreateSchoolExecute(r ApiCreateSchoolRequest
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -398,8 +401,8 @@ func (a *EducationSchoolApiService) DeleteClassFromSchoolExecute(r ApiDeleteClas
}
localVarPath := localBasePath + "/education/schools/{school-id}/classes/{class-id}/$ref"
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterToString(r.schoolId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterToString(r.classId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterValueToString(r.schoolId, "schoolId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -432,9 +435,9 @@ func (a *EducationSchoolApiService) DeleteClassFromSchoolExecute(r ApiDeleteClas
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -450,6 +453,7 @@ func (a *EducationSchoolApiService) DeleteClassFromSchoolExecute(r ApiDeleteClas
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -498,7 +502,7 @@ func (a *EducationSchoolApiService) DeleteSchoolExecute(r ApiDeleteSchoolRequest
}
localVarPath := localBasePath + "/education/schools/{school-id}"
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterToString(r.schoolId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterValueToString(r.schoolId, "schoolId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -531,9 +535,9 @@ func (a *EducationSchoolApiService) DeleteSchoolExecute(r ApiDeleteSchoolRequest
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -549,6 +553,7 @@ func (a *EducationSchoolApiService) DeleteSchoolExecute(r ApiDeleteSchoolRequest
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -598,8 +603,8 @@ func (a *EducationSchoolApiService) DeleteUserFromSchoolExecute(r ApiDeleteUserF
}
localVarPath := localBasePath + "/education/schools/{school-id}/users/{user-id}/$ref"
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterToString(r.schoolId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterToString(r.userId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterValueToString(r.schoolId, "schoolId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -632,9 +637,9 @@ func (a *EducationSchoolApiService) DeleteUserFromSchoolExecute(r ApiDeleteUserF
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -650,6 +655,7 @@ func (a *EducationSchoolApiService) DeleteUserFromSchoolExecute(r ApiDeleteUserF
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -698,7 +704,7 @@ func (a *EducationSchoolApiService) GetSchoolExecute(r ApiGetSchoolRequest) (*Ed
}
localVarPath := localBasePath + "/education/schools/{school-id}"
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterToString(r.schoolId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterValueToString(r.schoolId, "schoolId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -731,9 +737,9 @@ func (a *EducationSchoolApiService) GetSchoolExecute(r ApiGetSchoolRequest) (*Ed
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -749,6 +755,7 @@ func (a *EducationSchoolApiService) GetSchoolExecute(r ApiGetSchoolRequest) (*Ed
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -806,7 +813,7 @@ func (a *EducationSchoolApiService) ListSchoolClassesExecute(r ApiListSchoolClas
}
localVarPath := localBasePath + "/education/schools/{school-id}/classes"
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterToString(r.schoolId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterValueToString(r.schoolId, "schoolId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -839,9 +846,9 @@ func (a *EducationSchoolApiService) ListSchoolClassesExecute(r ApiListSchoolClas
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -857,6 +864,7 @@ func (a *EducationSchoolApiService) ListSchoolClassesExecute(r ApiListSchoolClas
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -914,7 +922,7 @@ func (a *EducationSchoolApiService) ListSchoolUsersExecute(r ApiListSchoolUsersR
}
localVarPath := localBasePath + "/education/schools/{school-id}/users"
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterToString(r.schoolId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterValueToString(r.schoolId, "schoolId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -947,9 +955,9 @@ func (a *EducationSchoolApiService) ListSchoolUsersExecute(r ApiListSchoolUsersR
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -965,6 +973,7 @@ func (a *EducationSchoolApiService) ListSchoolUsersExecute(r ApiListSchoolUsersR
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -1051,9 +1060,9 @@ func (a *EducationSchoolApiService) ListSchoolsExecute(r ApiListSchoolsRequest)
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -1069,6 +1078,7 @@ func (a *EducationSchoolApiService) ListSchoolsExecute(r ApiListSchoolsRequest)
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -1133,7 +1143,7 @@ func (a *EducationSchoolApiService) UpdateSchoolExecute(r ApiUpdateSchoolRequest
}
localVarPath := localBasePath + "/education/schools/{school-id}"
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterToString(r.schoolId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"school-id"+"}", url.PathEscape(parameterValueToString(r.schoolId, "schoolId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -1171,9 +1181,9 @@ func (a *EducationSchoolApiService) UpdateSchoolExecute(r ApiUpdateSchoolRequest
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -1189,6 +1199,7 @@ func (a *EducationSchoolApiService) UpdateSchoolExecute(r ApiUpdateSchoolRequest
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
@@ -104,9 +104,9 @@ func (a *EducationUserApiService) CreateEducationUserExecute(r ApiCreateEducatio
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -122,6 +122,7 @@ func (a *EducationUserApiService) CreateEducationUserExecute(r ApiCreateEducatio
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -177,7 +178,7 @@ func (a *EducationUserApiService) DeleteEducationUserExecute(r ApiDeleteEducatio
}
localVarPath := localBasePath + "/education/users/{user-id}"
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterToString(r.userId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -210,9 +211,9 @@ func (a *EducationUserApiService) DeleteEducationUserExecute(r ApiDeleteEducatio
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -228,6 +229,7 @@ func (a *EducationUserApiService) DeleteEducationUserExecute(r ApiDeleteEducatio
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -283,14 +285,14 @@ func (a *EducationUserApiService) GetEducationUserExecute(r ApiGetEducationUserR
}
localVarPath := localBasePath + "/education/users/{user-id}"
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterToString(r.userId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.expand != nil {
localVarQueryParams.Add("$expand", parameterToString(*r.expand, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "csv")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@@ -319,9 +321,9 @@ func (a *EducationUserApiService) GetEducationUserExecute(r ApiGetEducationUserR
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -337,6 +339,7 @@ func (a *EducationUserApiService) GetEducationUserExecute(r ApiGetEducationUserR
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -411,10 +414,10 @@ func (a *EducationUserApiService) ListEducationUsersExecute(r ApiListEducationUs
localVarFormParams := url.Values{}
if r.orderby != nil {
localVarQueryParams.Add("$orderby", parameterToString(*r.orderby, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$orderby", r.orderby, "csv")
}
if r.expand != nil {
localVarQueryParams.Add("$expand", parameterToString(*r.expand, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "csv")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@@ -443,9 +446,9 @@ func (a *EducationUserApiService) ListEducationUsersExecute(r ApiListEducationUs
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -461,6 +464,7 @@ func (a *EducationUserApiService) ListEducationUsersExecute(r ApiListEducationUs
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -525,7 +529,7 @@ func (a *EducationUserApiService) UpdateEducationUserExecute(r ApiUpdateEducatio
}
localVarPath := localBasePath + "/education/users/{user-id}"
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterToString(r.userId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -563,9 +567,9 @@ func (a *EducationUserApiService) UpdateEducationUserExecute(r ApiUpdateEducatio
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -581,6 +585,7 @@ func (a *EducationUserApiService) UpdateEducationUserExecute(r ApiUpdateEducatio
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
@@ -68,7 +68,7 @@ func (a *GroupApiService) AddMemberExecute(r ApiAddMemberRequest) (*http.Respons
}
localVarPath := localBasePath + "/groups/{group-id}/members/$ref"
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterToString(r.groupId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -106,9 +106,9 @@ func (a *GroupApiService) AddMemberExecute(r ApiAddMemberRequest) (*http.Respons
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -124,6 +124,7 @@ func (a *GroupApiService) AddMemberExecute(r ApiAddMemberRequest) (*http.Respons
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -177,7 +178,7 @@ func (a *GroupApiService) DeleteGroupExecute(r ApiDeleteGroupRequest) (*http.Res
}
localVarPath := localBasePath + "/groups/{group-id}"
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterToString(r.groupId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -201,7 +202,7 @@ func (a *GroupApiService) DeleteGroupExecute(r ApiDeleteGroupRequest) (*http.Res
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.ifMatch != nil {
localVarHeaderParams["If-Match"] = parameterToString(*r.ifMatch, "")
parameterAddToHeaderOrQuery(localVarHeaderParams, "If-Match", r.ifMatch, "")
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
@@ -213,9 +214,9 @@ func (a *GroupApiService) DeleteGroupExecute(r ApiDeleteGroupRequest) (*http.Res
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -231,6 +232,7 @@ func (a *GroupApiService) DeleteGroupExecute(r ApiDeleteGroupRequest) (*http.Res
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -287,8 +289,8 @@ func (a *GroupApiService) DeleteMemberExecute(r ApiDeleteMemberRequest) (*http.R
}
localVarPath := localBasePath + "/groups/{group-id}/members/{directory-object-id}/$ref"
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterToString(r.groupId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"directory-object-id"+"}", url.PathEscape(parameterToString(r.directoryObjectId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"directory-object-id"+"}", url.PathEscape(parameterValueToString(r.directoryObjectId, "directoryObjectId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -312,7 +314,7 @@ func (a *GroupApiService) DeleteMemberExecute(r ApiDeleteMemberRequest) (*http.R
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.ifMatch != nil {
localVarHeaderParams["If-Match"] = parameterToString(*r.ifMatch, "")
parameterAddToHeaderOrQuery(localVarHeaderParams, "If-Match", r.ifMatch, "")
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
@@ -324,9 +326,9 @@ func (a *GroupApiService) DeleteMemberExecute(r ApiDeleteMemberRequest) (*http.R
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -342,6 +344,7 @@ func (a *GroupApiService) DeleteMemberExecute(r ApiDeleteMemberRequest) (*http.R
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -404,17 +407,17 @@ func (a *GroupApiService) GetGroupExecute(r ApiGetGroupRequest) (*Group, *http.R
}
localVarPath := localBasePath + "/groups/{group-id}"
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterToString(r.groupId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.select_ != nil {
localVarQueryParams.Add("$select", parameterToString(*r.select_, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "csv")
}
if r.expand != nil {
localVarQueryParams.Add("$expand", parameterToString(*r.expand, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "csv")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@@ -443,9 +446,9 @@ func (a *GroupApiService) GetGroupExecute(r ApiGetGroupRequest) (*Group, *http.R
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -461,6 +464,7 @@ func (a *GroupApiService) GetGroupExecute(r ApiGetGroupRequest) (*Group, *http.R
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -518,7 +522,7 @@ func (a *GroupApiService) ListMembersExecute(r ApiListMembersRequest) (*Collecti
}
localVarPath := localBasePath + "/groups/{group-id}/members"
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterToString(r.groupId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -551,9 +555,9 @@ func (a *GroupApiService) ListMembersExecute(r ApiListMembersRequest) (*Collecti
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -569,6 +573,7 @@ func (a *GroupApiService) ListMembersExecute(r ApiListMembersRequest) (*Collecti
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -631,7 +636,7 @@ func (a *GroupApiService) UpdateGroupExecute(r ApiUpdateGroupRequest) (*http.Res
}
localVarPath := localBasePath + "/groups/{group-id}"
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterToString(r.groupId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -669,9 +674,9 @@ func (a *GroupApiService) UpdateGroupExecute(r ApiUpdateGroupRequest) (*http.Res
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -687,6 +692,7 @@ func (a *GroupApiService) UpdateGroupExecute(r ApiUpdateGroupRequest) (*http.Res
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
)
@@ -103,9 +103,9 @@ func (a *GroupsApiService) CreateGroupExecute(r ApiCreateGroupRequest) (*Group,
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -121,6 +121,7 @@ func (a *GroupsApiService) CreateGroupExecute(r ApiCreateGroupRequest) (*Group,
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -209,16 +210,16 @@ func (a *GroupsApiService) ListGroupsExecute(r ApiListGroupsRequest) (*Collectio
localVarFormParams := url.Values{}
if r.search != nil {
localVarQueryParams.Add("$search", parameterToString(*r.search, ""))
parameterAddToHeaderOrQuery(localVarQueryParams, "$search", r.search, "")
}
if r.orderby != nil {
localVarQueryParams.Add("$orderby", parameterToString(*r.orderby, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$orderby", r.orderby, "csv")
}
if r.select_ != nil {
localVarQueryParams.Add("$select", parameterToString(*r.select_, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "csv")
}
if r.expand != nil {
localVarQueryParams.Add("$expand", parameterToString(*r.expand, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "csv")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@@ -247,9 +248,9 @@ func (a *GroupsApiService) ListGroupsExecute(r ApiListGroupsRequest) (*Collectio
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -265,6 +266,7 @@ func (a *GroupsApiService) ListGroupsExecute(r ApiListGroupsRequest) (*Collectio
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
)
@@ -101,9 +101,9 @@ func (a *MeChangepasswordApiService) ChangeOwnPasswordExecute(r ApiChangeOwnPass
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -119,6 +119,7 @@ func (a *MeChangepasswordApiService) ChangeOwnPasswordExecute(r ApiChangeOwnPass
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
)
@@ -91,9 +91,9 @@ func (a *MeDriveApiService) GetHomeExecute(r ApiGetHomeRequest) (*Drive, *http.R
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -109,6 +109,223 @@ func (a *MeDriveApiService) GetHomeExecute(r ApiGetHomeRequest) (*Drive, *http.R
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
}
type ApiListSharedByMeRequest struct {
ctx context.Context
ApiService *MeDriveApiService
}
func (r ApiListSharedByMeRequest) Execute() (*CollectionOfDriveItems1, *http.Response, error) {
return r.ApiService.ListSharedByMeExecute(r)
}
/*
ListSharedByMe Get a list of driveItem objects shared by the current user.
The `driveItems` returned from the `sharedByMe` method always include the `permissions` relation that indicates they are shared items.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListSharedByMeRequest
*/
func (a *MeDriveApiService) ListSharedByMe(ctx context.Context) ApiListSharedByMeRequest {
return ApiListSharedByMeRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return CollectionOfDriveItems1
func (a *MeDriveApiService) ListSharedByMeExecute(r ApiListSharedByMeRequest) (*CollectionOfDriveItems1, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *CollectionOfDriveItems1
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeDriveApiService.ListSharedByMe")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/me/drive/sharedByMe"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// 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
}
type ApiListSharedWithMeRequest struct {
ctx context.Context
ApiService *MeDriveApiService
}
func (r ApiListSharedWithMeRequest) Execute() (*CollectionOfDriveItems1, *http.Response, error) {
return r.ApiService.ListSharedWithMeExecute(r)
}
/*
ListSharedWithMe Get a list of driveItem objects shared with the owner of a drive.
The `driveItems` returned from the `sharedWithMe` method always include the `remoteItem` facet that indicates they are items from a different drive.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListSharedWithMeRequest
*/
func (a *MeDriveApiService) ListSharedWithMe(ctx context.Context) ApiListSharedWithMeRequest {
return ApiListSharedWithMeRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return CollectionOfDriveItems1
func (a *MeDriveApiService) ListSharedWithMeExecute(r ApiListSharedWithMeRequest) (*CollectionOfDriveItems1, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *CollectionOfDriveItems1
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeDriveApiService.ListSharedWithMe")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/me/drive/sharedWithMe"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// 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
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
)
@@ -91,9 +91,9 @@ func (a *MeDriveRootApiService) HomeGetRootExecute(r ApiHomeGetRootRequest) (*Dr
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -109,6 +109,7 @@ func (a *MeDriveRootApiService) HomeGetRootExecute(r ApiHomeGetRootRequest) (*Dr
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
)
@@ -91,9 +91,9 @@ func (a *MeDriveRootChildrenApiService) HomeGetChildrenExecute(r ApiHomeGetChild
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -109,6 +109,7 @@ func (a *MeDriveRootChildrenApiService) HomeGetChildrenExecute(r ApiHomeGetChild
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
)
@@ -79,10 +79,10 @@ func (a *MeDrivesApiService) ListMyDrivesExecute(r ApiListMyDrivesRequest) (*Col
localVarFormParams := url.Values{}
if r.orderby != nil {
localVarQueryParams.Add("$orderby", parameterToString(*r.orderby, ""))
parameterAddToHeaderOrQuery(localVarQueryParams, "$orderby", r.orderby, "")
}
if r.filter != nil {
localVarQueryParams.Add("$filter", parameterToString(*r.filter, ""))
parameterAddToHeaderOrQuery(localVarQueryParams, "$filter", r.filter, "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@@ -111,9 +111,9 @@ func (a *MeDrivesApiService) ListMyDrivesExecute(r ApiListMyDrivesRequest) (*Col
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -129,6 +129,7 @@ func (a *MeDrivesApiService) ListMyDrivesExecute(r ApiListMyDrivesRequest) (*Col
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
)
@@ -72,7 +72,7 @@ func (a *MeUserApiService) GetOwnUserExecute(r ApiGetOwnUserRequest) (*User, *ht
localVarFormParams := url.Values{}
if r.expand != nil {
localVarQueryParams.Add("$expand", parameterToString(*r.expand, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "csv")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@@ -101,9 +101,9 @@ func (a *MeUserApiService) GetOwnUserExecute(r ApiGetOwnUserRequest) (*User, *ht
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -119,6 +119,7 @@ func (a *MeUserApiService) GetOwnUserExecute(r ApiGetOwnUserRequest) (*User, *ht
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -0,0 +1,243 @@
/*
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"
"strings"
)
// RoleManagementApiService RoleManagementApi service
type RoleManagementApiService service
type ApiGetPermissionRoleDefinitionRequest struct {
ctx context.Context
ApiService *RoleManagementApiService
roleId string
}
func (r ApiGetPermissionRoleDefinitionRequest) Execute() (*UnifiedRoleDefinition, *http.Response, error) {
return r.ApiService.GetPermissionRoleDefinitionExecute(r)
}
/*
GetPermissionRoleDefinition Get unifiedRoleDefinition
Read the properties and relationships of a `unifiedRoleDefinition` object.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param roleId key: id of roleDefinition
@return ApiGetPermissionRoleDefinitionRequest
*/
func (a *RoleManagementApiService) GetPermissionRoleDefinition(ctx context.Context, roleId string) ApiGetPermissionRoleDefinitionRequest {
return ApiGetPermissionRoleDefinitionRequest{
ApiService: a,
ctx: ctx,
roleId: roleId,
}
}
// Execute executes the request
// @return UnifiedRoleDefinition
func (a *RoleManagementApiService) GetPermissionRoleDefinitionExecute(r ApiGetPermissionRoleDefinitionRequest) (*UnifiedRoleDefinition, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *UnifiedRoleDefinition
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleManagementApiService.GetPermissionRoleDefinition")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/roleManagement/permissions/roleDefinitions/{role-id}"
localVarPath = strings.Replace(localVarPath, "{"+"role-id"+"}", url.PathEscape(parameterValueToString(r.roleId, "roleId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// 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
}
type ApiListPermissionRoleDefinitionsRequest struct {
ctx context.Context
ApiService *RoleManagementApiService
}
func (r ApiListPermissionRoleDefinitionsRequest) Execute() (*UnifiedRoleDefinition, *http.Response, error) {
return r.ApiService.ListPermissionRoleDefinitionsExecute(r)
}
/*
ListPermissionRoleDefinitions List roleDefinitions
Get a list of `unifiedRoleDefinition` objects for the permissions provider. This list determines the roles that can be selected when creating sharing invites.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListPermissionRoleDefinitionsRequest
*/
func (a *RoleManagementApiService) ListPermissionRoleDefinitions(ctx context.Context) ApiListPermissionRoleDefinitionsRequest {
return ApiListPermissionRoleDefinitionsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return UnifiedRoleDefinition
func (a *RoleManagementApiService) ListPermissionRoleDefinitionsExecute(r ApiListPermissionRoleDefinitionsRequest) (*UnifiedRoleDefinition, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *UnifiedRoleDefinition
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleManagementApiService.ListPermissionRoleDefinitions")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/roleManagement/permissions/roleDefinitions"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// 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
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
)
@@ -97,9 +97,9 @@ func (a *TagsApiService) AssignTagsExecute(r ApiAssignTagsRequest) (*http.Respon
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -115,6 +115,7 @@ func (a *TagsApiService) AssignTagsExecute(r ApiAssignTagsRequest) (*http.Respon
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -192,9 +193,9 @@ func (a *TagsApiService) GetTagsExecute(r ApiGetTagsRequest) (*CollectionOfTags,
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -210,6 +211,7 @@ func (a *TagsApiService) GetTagsExecute(r ApiGetTagsRequest) (*CollectionOfTags,
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -302,9 +304,9 @@ func (a *TagsApiService) UnassignTagsExecute(r ApiUnassignTagsRequest) (*http.Re
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -320,6 +322,7 @@ func (a *TagsApiService) UnassignTagsExecute(r ApiUnassignTagsRequest) (*http.Re
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
@@ -68,7 +68,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Respon
}
localVarPath := localBasePath + "/users/{user-id}"
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterToString(r.userId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -92,7 +92,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Respon
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.ifMatch != nil {
localVarHeaderParams["If-Match"] = parameterToString(*r.ifMatch, "")
parameterAddToHeaderOrQuery(localVarHeaderParams, "If-Match", r.ifMatch, "")
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
@@ -104,9 +104,9 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Respon
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -122,6 +122,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Respon
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -175,7 +176,7 @@ func (a *UserApiService) ExportPersonalDataExecute(r ApiExportPersonalDataReques
}
localVarPath := localBasePath + "/users/{user-id}/exportPersonalData"
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterToString(r.userId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -210,9 +211,9 @@ func (a *UserApiService) ExportPersonalDataExecute(r ApiExportPersonalDataReques
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -228,6 +229,7 @@ func (a *UserApiService) ExportPersonalDataExecute(r ApiExportPersonalDataReques
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -290,17 +292,17 @@ func (a *UserApiService) GetUserExecute(r ApiGetUserRequest) (*User, *http.Respo
}
localVarPath := localBasePath + "/users/{user-id}"
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterToString(r.userId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.select_ != nil {
localVarQueryParams.Add("$select", parameterToString(*r.select_, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "csv")
}
if r.expand != nil {
localVarQueryParams.Add("$expand", parameterToString(*r.expand, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "csv")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@@ -329,9 +331,9 @@ func (a *UserApiService) GetUserExecute(r ApiGetUserRequest) (*User, *http.Respo
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -347,6 +349,7 @@ func (a *UserApiService) GetUserExecute(r ApiGetUserRequest) (*User, *http.Respo
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -411,7 +414,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*User, *http
}
localVarPath := localBasePath + "/users/{user-id}"
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterToString(r.userId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -449,9 +452,9 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*User, *http
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -467,6 +470,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*User, *http
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
"strings"
@@ -76,7 +76,7 @@ func (a *UserAppRoleAssignmentApiService) UserCreateAppRoleAssignmentsExecute(r
}
localVarPath := localBasePath + "/users/{user-id}/appRoleAssignments"
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterToString(r.userId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -114,9 +114,9 @@ func (a *UserAppRoleAssignmentApiService) UserCreateAppRoleAssignmentsExecute(r
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -132,6 +132,7 @@ func (a *UserAppRoleAssignmentApiService) UserCreateAppRoleAssignmentsExecute(r
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -197,8 +198,8 @@ func (a *UserAppRoleAssignmentApiService) UserDeleteAppRoleAssignmentsExecute(r
}
localVarPath := localBasePath + "/users/{user-id}/appRoleAssignments/{appRoleAssignment-id}"
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterToString(r.userId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"appRoleAssignment-id"+"}", url.PathEscape(parameterToString(r.appRoleAssignmentId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"appRoleAssignment-id"+"}", url.PathEscape(parameterValueToString(r.appRoleAssignmentId, "appRoleAssignmentId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -222,7 +223,7 @@ func (a *UserAppRoleAssignmentApiService) UserDeleteAppRoleAssignmentsExecute(r
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.ifMatch != nil {
localVarHeaderParams["If-Match"] = parameterToString(*r.ifMatch, "")
parameterAddToHeaderOrQuery(localVarHeaderParams, "If-Match", r.ifMatch, "")
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
@@ -234,9 +235,9 @@ func (a *UserAppRoleAssignmentApiService) UserDeleteAppRoleAssignmentsExecute(r
return localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarHTTPResponse, err
}
@@ -252,6 +253,7 @@ func (a *UserAppRoleAssignmentApiService) UserDeleteAppRoleAssignmentsExecute(r
newErr.error = err.Error()
return localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarHTTPResponse, newErr
}
@@ -302,7 +304,7 @@ func (a *UserAppRoleAssignmentApiService) UserListAppRoleAssignmentsExecute(r Ap
}
localVarPath := localBasePath + "/users/{user-id}/appRoleAssignments"
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterToString(r.userId, "")), -1)
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
@@ -335,9 +337,9 @@ func (a *UserAppRoleAssignmentApiService) UserListAppRoleAssignmentsExecute(r Ap
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -353,6 +355,7 @@ func (a *UserAppRoleAssignmentApiService) UserListAppRoleAssignmentsExecute(r Ap
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -13,7 +13,7 @@ package libregraph
import (
"bytes"
"context"
"io/ioutil"
"io"
"net/http"
"net/url"
)
@@ -103,9 +103,9 @@ func (a *UsersApiService) CreateUserExecute(r ApiCreateUserRequest) (*User, *htt
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -121,6 +121,7 @@ func (a *UsersApiService) CreateUserExecute(r ApiCreateUserRequest) (*User, *htt
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
@@ -216,19 +217,19 @@ func (a *UsersApiService) ListUsersExecute(r ApiListUsersRequest) (*CollectionOf
localVarFormParams := url.Values{}
if r.search != nil {
localVarQueryParams.Add("$search", parameterToString(*r.search, ""))
parameterAddToHeaderOrQuery(localVarQueryParams, "$search", r.search, "")
}
if r.filter != nil {
localVarQueryParams.Add("$filter", parameterToString(*r.filter, ""))
parameterAddToHeaderOrQuery(localVarQueryParams, "$filter", r.filter, "")
}
if r.orderby != nil {
localVarQueryParams.Add("$orderby", parameterToString(*r.orderby, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$orderby", r.orderby, "csv")
}
if r.select_ != nil {
localVarQueryParams.Add("$select", parameterToString(*r.select_, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "csv")
}
if r.expand != nil {
localVarQueryParams.Add("$expand", parameterToString(*r.expand, "csv"))
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "csv")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@@ -257,9 +258,9 @@ func (a *UsersApiService) ListUsersExecute(r ApiListUsersRequest) (*CollectionOf
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
@@ -275,6 +276,7 @@ func (a *UsersApiService) ListUsersExecute(r ApiListUsersRequest) (*CollectionOf
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}

View File

@@ -18,7 +18,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"mime/multipart"
"net/http"
@@ -32,13 +31,13 @@ import (
"strings"
"time"
"unicode/utf8"
"golang.org/x/oauth2"
)
var (
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`)
queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]")
)
// APIClient manages communication with the Libre Graph API API vv1.0.4
@@ -55,6 +54,8 @@ type APIClient struct {
DrivesGetDrivesApi *DrivesGetDrivesApiService
DrivesPermissionsApi *DrivesPermissionsApiService
DrivesRootApi *DrivesRootApiService
EducationClassApi *EducationClassApiService
@@ -81,6 +82,8 @@ type APIClient struct {
MeUserApi *MeUserApiService
RoleManagementApi *RoleManagementApiService
TagsApi *TagsApiService
UserApi *UserApiService
@@ -109,6 +112,7 @@ func NewAPIClient(cfg *Configuration) *APIClient {
c.ApplicationsApi = (*ApplicationsApiService)(&c.common)
c.DrivesApi = (*DrivesApiService)(&c.common)
c.DrivesGetDrivesApi = (*DrivesGetDrivesApiService)(&c.common)
c.DrivesPermissionsApi = (*DrivesPermissionsApiService)(&c.common)
c.DrivesRootApi = (*DrivesRootApiService)(&c.common)
c.EducationClassApi = (*EducationClassApiService)(&c.common)
c.EducationClassTeachersApi = (*EducationClassTeachersApiService)(&c.common)
@@ -122,6 +126,7 @@ func NewAPIClient(cfg *Configuration) *APIClient {
c.MeDriveRootChildrenApi = (*MeDriveRootChildrenApiService)(&c.common)
c.MeDrivesApi = (*MeDrivesApiService)(&c.common)
c.MeUserApi = (*MeUserApiService)(&c.common)
c.RoleManagementApi = (*RoleManagementApiService)(&c.common)
c.TagsApi = (*TagsApiService)(&c.common)
c.UserApi = (*UserApiService)(&c.common)
c.UserAppRoleAssignmentApi = (*UserAppRoleAssignmentApiService)(&c.common)
@@ -177,33 +182,111 @@ func typeCheckParameter(obj interface{}, expected string, name string) error {
// Check the type is as expected.
if reflect.TypeOf(obj).String() != expected {
return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String())
return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String())
}
return nil
}
// parameterToString convert interface{} parameters to string, using a delimiter if format is provided.
func parameterToString(obj interface{}, collectionFormat string) string {
var delimiter string
func parameterValueToString(obj interface{}, key string) string {
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
return fmt.Sprintf("%v", obj)
}
var param, ok = obj.(MappedNullable)
if !ok {
return ""
}
dataMap, err := param.ToMap()
if err != nil {
return ""
}
return fmt.Sprintf("%v", dataMap[key])
}
switch collectionFormat {
case "pipes":
delimiter = "|"
case "ssv":
delimiter = " "
case "tsv":
delimiter = "\t"
case "csv":
delimiter = ","
// parameterAddToHeaderOrQuery adds the provided object to the request header or url query
// supporting deep object syntax
func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) {
var v = reflect.ValueOf(obj)
var value = ""
if v == reflect.ValueOf(nil) {
value = "null"
} else {
switch v.Kind() {
case reflect.Invalid:
value = "invalid"
case reflect.Struct:
if t, ok := obj.(MappedNullable); ok {
dataMap, err := t.ToMap()
if err != nil {
return
}
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType)
return
}
if t, ok := obj.(time.Time); ok {
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType)
return
}
value = v.Type().String() + " value"
case reflect.Slice:
var indValue = reflect.ValueOf(obj)
if indValue == reflect.ValueOf(nil) {
return
}
var lenIndValue = indValue.Len()
for i := 0; i < lenIndValue; i++ {
var arrayValue = indValue.Index(i)
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), collectionType)
}
return
case reflect.Map:
var indValue = reflect.ValueOf(obj)
if indValue == reflect.ValueOf(nil) {
return
}
iter := indValue.MapRange()
for iter.Next() {
k, v := iter.Key(), iter.Value()
parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType)
}
return
case reflect.Interface:
fallthrough
case reflect.Ptr:
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), collectionType)
return
case reflect.Int, reflect.Int8, reflect.Int16,
reflect.Int32, reflect.Int64:
value = strconv.FormatInt(v.Int(), 10)
case reflect.Uint, reflect.Uint8, reflect.Uint16,
reflect.Uint32, reflect.Uint64, reflect.Uintptr:
value = strconv.FormatUint(v.Uint(), 10)
case reflect.Float32, reflect.Float64:
value = strconv.FormatFloat(v.Float(), 'g', -1, 32)
case reflect.Bool:
value = strconv.FormatBool(v.Bool())
case reflect.String:
value = v.String()
default:
value = v.Type().String() + " value"
}
}
if reflect.TypeOf(obj).Kind() == reflect.Slice {
return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]")
} else if t, ok := obj.(time.Time); ok {
return t.Format(time.RFC3339)
switch valuesMap := headerOrQueryParams.(type) {
case url.Values:
if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" {
valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value)
} else {
valuesMap.Add(keyPrefix, value)
}
break
case map[string]string:
valuesMap[keyPrefix] = value
break
}
return fmt.Sprintf("%v", obj)
}
// helper for converting interface{} parameters to json strings
@@ -355,7 +438,11 @@ func (c *APIClient) prepareRequest(
}
// Encode the parameters.
url.RawQuery = query.Encode()
url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string {
pieces := strings.Split(s, "=")
pieces[0] = queryDescape.Replace(pieces[0])
return strings.Join(pieces, "=")
})
// Generate a new request
if body != nil {
@@ -385,22 +472,6 @@ func (c *APIClient) prepareRequest(
// Walk through any authentication.
// OAuth2 authentication
if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok {
// We were able to grab an oauth2 token from the context
var latestToken *oauth2.Token
if latestToken, err = tok.Token(); err != nil {
return nil, err
}
latestToken.SetAuthHeader(localVarRequest)
}
// Basic HTTP Authentication
if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok {
localVarRequest.SetBasicAuth(auth.UserName, auth.Password)
}
// AccessToken Authentication
if auth, ok := ctx.Value(ContextAccessToken).(string); ok {
localVarRequest.Header.Add("Authorization", "Bearer "+auth)
@@ -422,8 +493,21 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err
*s = string(b)
return nil
}
if f, ok := v.(*os.File); ok {
f, err = os.CreateTemp("", "HttpClientFile")
if err != nil {
return
}
_, err = f.Write(b)
if err != nil {
return
}
_, err = f.Seek(0, io.SeekStart)
err = os.Remove(f.Name())
return
}
if f, ok := v.(**os.File); ok {
*f, err = ioutil.TempFile("", "HttpClientFile")
*f, err = os.CreateTemp("", "HttpClientFile")
if err != nil {
return
}
@@ -432,6 +516,7 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err
return
}
_, err = (*f).Seek(0, io.SeekStart)
err = os.Remove((*f).Name())
return
}
if xmlCheck.MatchString(contentType) {
@@ -497,8 +582,8 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e
if reader, ok := body.(io.Reader); ok {
_, err = bodyBuf.ReadFrom(reader)
} else if fp, ok := body.(**os.File); ok {
_, err = bodyBuf.ReadFrom(*fp)
} else if fp, ok := body.(*os.File); ok {
_, err = bodyBuf.ReadFrom(fp)
} else if b, ok := body.([]byte); ok {
_, err = bodyBuf.Write(b)
} else if s, ok := body.(string); ok {
@@ -508,7 +593,11 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e
} else if jsonCheck.MatchString(contentType) {
err = json.NewEncoder(bodyBuf).Encode(body)
} else if xmlCheck.MatchString(contentType) {
err = xml.NewEncoder(bodyBuf).Encode(body)
var bs []byte
bs, err = xml.Marshal(body)
if err == nil {
bodyBuf.Write(bs)
}
}
if err != nil {
@@ -516,7 +605,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e
}
if bodyBuf.Len() == 0 {
err = fmt.Errorf("Invalid body type %s\n", contentType)
err = fmt.Errorf("invalid body type %s\n", contentType)
return nil, err
}
return bodyBuf, nil
@@ -618,3 +707,23 @@ func (e GenericOpenAPIError) Body() []byte {
func (e GenericOpenAPIError) Model() interface{} {
return e.model
}
// format error message using title and detail when model implements rfc7807
func formatErrorMessage(status string, v interface{}) string {
str := ""
metaValue := reflect.ValueOf(v).Elem()
if metaValue.Kind() == reflect.Struct {
field := metaValue.FieldByName("Title")
if field != (reflect.Value{}) {
str = fmt.Sprintf("%s", field.Interface())
}
field = metaValue.FieldByName("Detail")
if field != (reflect.Value{}) {
str = fmt.Sprintf("%s (%s)", str, field.Interface())
}
}
return strings.TrimSpace(fmt.Sprintf("%s %s", status, str))
}

View File

@@ -28,21 +28,9 @@ func (c contextKey) String() string {
}
var (
// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
ContextOAuth2 = contextKey("token")
// ContextBasicAuth takes BasicAuth as authentication for the request.
ContextBasicAuth = contextKey("basic")
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAccessToken = contextKey("accesstoken")
// ContextAPIKeys takes a string apikey as authentication for the request
ContextAPIKeys = contextKey("apiKeys")
// ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request.
ContextHttpSignatureAuth = contextKey("httpsignature")
// ContextServerIndex uses a server configuration from the index.
ContextServerIndex = contextKey("serverIndex")
@@ -126,7 +114,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) {
// URL formats template on a index using given variables
func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) {
if index < 0 || len(sc) <= index {
return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1)
return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1)
}
server := sc[index]
url := server.URL
@@ -141,7 +129,7 @@ func (sc ServerConfigurations) URL(index int, variables map[string]string) (stri
}
}
if !found {
return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues)
return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues)
}
url = strings.Replace(url, "{"+name+"}", value, -1)
} else {

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the AppRole type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AppRole{}
// AppRole struct for AppRole
type AppRole struct {
// Specifies whether this app role can be assigned to users and groups (by setting to ['User']), to other application's (by setting to ['Application'], or both (by setting to ['User', 'Application']). App roles supporting assignment to other applications' service principals are also known as application permissions. The 'Application' value is only supported for app roles defined on application entities.
@@ -46,7 +49,7 @@ func NewAppRoleWithDefaults() *AppRole {
// GetAllowedMemberTypes returns the AllowedMemberTypes field value if set, zero value otherwise.
func (o *AppRole) GetAllowedMemberTypes() []string {
if o == nil || o.AllowedMemberTypes == nil {
if o == nil || IsNil(o.AllowedMemberTypes) {
var ret []string
return ret
}
@@ -56,7 +59,7 @@ func (o *AppRole) GetAllowedMemberTypes() []string {
// GetAllowedMemberTypesOk returns a tuple with the AllowedMemberTypes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AppRole) GetAllowedMemberTypesOk() ([]string, bool) {
if o == nil || o.AllowedMemberTypes == nil {
if o == nil || IsNil(o.AllowedMemberTypes) {
return nil, false
}
return o.AllowedMemberTypes, true
@@ -64,7 +67,7 @@ func (o *AppRole) GetAllowedMemberTypesOk() ([]string, bool) {
// HasAllowedMemberTypes returns a boolean if a field has been set.
func (o *AppRole) HasAllowedMemberTypes() bool {
if o != nil && o.AllowedMemberTypes != nil {
if o != nil && !IsNil(o.AllowedMemberTypes) {
return true
}
@@ -78,7 +81,7 @@ func (o *AppRole) SetAllowedMemberTypes(v []string) {
// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AppRole) GetDescription() string {
if o == nil || o.Description.Get() == nil {
if o == nil || IsNil(o.Description.Get()) {
var ret string
return ret
}
@@ -121,7 +124,7 @@ func (o *AppRole) UnsetDescription() {
// GetDisplayName returns the DisplayName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AppRole) GetDisplayName() string {
if o == nil || o.DisplayName.Get() == nil {
if o == nil || IsNil(o.DisplayName.Get()) {
var ret string
return ret
}
@@ -187,8 +190,16 @@ func (o *AppRole) SetId(v string) {
}
func (o AppRole) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AppRole) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.AllowedMemberTypes != nil {
if !IsNil(o.AllowedMemberTypes) {
toSerialize["allowedMemberTypes"] = o.AllowedMemberTypes
}
if o.Description.IsSet() {
@@ -197,10 +208,8 @@ func (o AppRole) MarshalJSON() ([]byte, error) {
if o.DisplayName.IsSet() {
toSerialize["displayName"] = o.DisplayName.Get()
}
if true {
toSerialize["id"] = o.Id
}
return json.Marshal(toSerialize)
toSerialize["id"] = o.Id
return toSerialize, nil
}
type NullableAppRole struct {

View File

@@ -15,6 +15,9 @@ import (
"time"
)
// checks if the AppRoleAssignment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AppRoleAssignment{}
// AppRoleAssignment struct for AppRoleAssignment
type AppRoleAssignment struct {
// The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only.
@@ -58,7 +61,7 @@ func NewAppRoleAssignmentWithDefaults() *AppRoleAssignment {
// GetId returns the Id field value if set, zero value otherwise.
func (o *AppRoleAssignment) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -68,7 +71,7 @@ func (o *AppRoleAssignment) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AppRoleAssignment) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -76,7 +79,7 @@ func (o *AppRoleAssignment) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *AppRoleAssignment) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -90,7 +93,7 @@ func (o *AppRoleAssignment) SetId(v string) {
// GetDeletedDateTime returns the DeletedDateTime field value if set, zero value otherwise.
func (o *AppRoleAssignment) GetDeletedDateTime() time.Time {
if o == nil || o.DeletedDateTime == nil {
if o == nil || IsNil(o.DeletedDateTime) {
var ret time.Time
return ret
}
@@ -100,7 +103,7 @@ func (o *AppRoleAssignment) GetDeletedDateTime() time.Time {
// GetDeletedDateTimeOk returns a tuple with the DeletedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AppRoleAssignment) GetDeletedDateTimeOk() (*time.Time, bool) {
if o == nil || o.DeletedDateTime == nil {
if o == nil || IsNil(o.DeletedDateTime) {
return nil, false
}
return o.DeletedDateTime, true
@@ -108,7 +111,7 @@ func (o *AppRoleAssignment) GetDeletedDateTimeOk() (*time.Time, bool) {
// HasDeletedDateTime returns a boolean if a field has been set.
func (o *AppRoleAssignment) HasDeletedDateTime() bool {
if o != nil && o.DeletedDateTime != nil {
if o != nil && !IsNil(o.DeletedDateTime) {
return true
}
@@ -146,7 +149,7 @@ func (o *AppRoleAssignment) SetAppRoleId(v string) {
// GetCreatedDateTime returns the CreatedDateTime field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AppRoleAssignment) GetCreatedDateTime() time.Time {
if o == nil || o.CreatedDateTime.Get() == nil {
if o == nil || IsNil(o.CreatedDateTime.Get()) {
var ret time.Time
return ret
}
@@ -189,7 +192,7 @@ func (o *AppRoleAssignment) UnsetCreatedDateTime() {
// GetPrincipalDisplayName returns the PrincipalDisplayName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AppRoleAssignment) GetPrincipalDisplayName() string {
if o == nil || o.PrincipalDisplayName.Get() == nil {
if o == nil || IsNil(o.PrincipalDisplayName.Get()) {
var ret string
return ret
}
@@ -258,7 +261,7 @@ func (o *AppRoleAssignment) SetPrincipalId(v string) {
// GetPrincipalType returns the PrincipalType field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AppRoleAssignment) GetPrincipalType() string {
if o == nil || o.PrincipalType.Get() == nil {
if o == nil || IsNil(o.PrincipalType.Get()) {
var ret string
return ret
}
@@ -301,7 +304,7 @@ func (o *AppRoleAssignment) UnsetPrincipalType() {
// GetResourceDisplayName returns the ResourceDisplayName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AppRoleAssignment) GetResourceDisplayName() string {
if o == nil || o.ResourceDisplayName.Get() == nil {
if o == nil || IsNil(o.ResourceDisplayName.Get()) {
var ret string
return ret
}
@@ -369,35 +372,37 @@ func (o *AppRoleAssignment) SetResourceId(v string) {
}
func (o AppRoleAssignment) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AppRoleAssignment) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if o.DeletedDateTime != nil {
if !IsNil(o.DeletedDateTime) {
toSerialize["deletedDateTime"] = o.DeletedDateTime
}
if true {
toSerialize["appRoleId"] = o.AppRoleId
}
toSerialize["appRoleId"] = o.AppRoleId
if o.CreatedDateTime.IsSet() {
toSerialize["createdDateTime"] = o.CreatedDateTime.Get()
}
if o.PrincipalDisplayName.IsSet() {
toSerialize["principalDisplayName"] = o.PrincipalDisplayName.Get()
}
if true {
toSerialize["principalId"] = o.PrincipalId.Get()
}
toSerialize["principalId"] = o.PrincipalId.Get()
if o.PrincipalType.IsSet() {
toSerialize["principalType"] = o.PrincipalType.Get()
}
if o.ResourceDisplayName.IsSet() {
toSerialize["resourceDisplayName"] = o.ResourceDisplayName.Get()
}
if true {
toSerialize["resourceId"] = o.ResourceId.Get()
}
return json.Marshal(toSerialize)
toSerialize["resourceId"] = o.ResourceId.Get()
return toSerialize, nil
}
type NullableAppRoleAssignment struct {

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the Application type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Application{}
// Application struct for Application
type Application struct {
// The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only.
@@ -68,7 +71,7 @@ func (o *Application) SetId(v string) {
// GetAppRoles returns the AppRoles field value if set, zero value otherwise.
func (o *Application) GetAppRoles() []AppRole {
if o == nil || o.AppRoles == nil {
if o == nil || IsNil(o.AppRoles) {
var ret []AppRole
return ret
}
@@ -78,7 +81,7 @@ func (o *Application) GetAppRoles() []AppRole {
// GetAppRolesOk returns a tuple with the AppRoles field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Application) GetAppRolesOk() ([]AppRole, bool) {
if o == nil || o.AppRoles == nil {
if o == nil || IsNil(o.AppRoles) {
return nil, false
}
return o.AppRoles, true
@@ -86,7 +89,7 @@ func (o *Application) GetAppRolesOk() ([]AppRole, bool) {
// HasAppRoles returns a boolean if a field has been set.
func (o *Application) HasAppRoles() bool {
if o != nil && o.AppRoles != nil {
if o != nil && !IsNil(o.AppRoles) {
return true
}
@@ -100,7 +103,7 @@ func (o *Application) SetAppRoles(v []AppRole) {
// GetDisplayName returns the DisplayName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Application) GetDisplayName() string {
if o == nil || o.DisplayName.Get() == nil {
if o == nil || IsNil(o.DisplayName.Get()) {
var ret string
return ret
}
@@ -142,17 +145,23 @@ func (o *Application) UnsetDisplayName() {
}
func (o Application) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["id"] = o.Id
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
if o.AppRoles != nil {
return json.Marshal(toSerialize)
}
func (o Application) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["id"] = o.Id
if !IsNil(o.AppRoles) {
toSerialize["appRoles"] = o.AppRoles
}
if o.DisplayName.IsSet() {
toSerialize["displayName"] = o.DisplayName.Get()
}
return json.Marshal(toSerialize)
return toSerialize, nil
}
type NullableApplication struct {

View File

@@ -0,0 +1,680 @@
/*
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 Audio type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Audio{}
// Audio The Audio resource groups audio-related properties on an item into a single structure. If a DriveItem has a non-null audio facet, the item represents an audio file. The properties of the Audio resource are populated by extracting metadata from the file.
type Audio struct {
// The title of the album for this audio file.
Album *string `json:"album,omitempty"`
// The artist named on the album for the audio file.
AlbumArtist *string `json:"albumArtist,omitempty"`
// The performing artist for the audio file.
Artist *string `json:"artist,omitempty"`
// Bitrate expressed in kbps.
Bitrate *int64 `json:"bitrate,omitempty"`
// The name of the composer of the audio file.
Composers *string `json:"composers,omitempty"`
// Copyright information for the audio file.
Copyright *string `json:"copyright,omitempty"`
// The number of the disc this audio file came from.
Disc *int32 `json:"disc,omitempty"`
// The total number of discs in this album.
DiscCount *int32 `json:"discCount,omitempty"`
// Duration of the audio file, expressed in milliseconds
Duration *int64 `json:"duration,omitempty"`
// The genre of this audio file.
Genre *string `json:"genre,omitempty"`
// Indicates if the file is protected with digital rights management.
HasDrm *bool `json:"hasDrm,omitempty"`
// Indicates if the file is encoded with a variable bitrate.
IsVariableBitrate *bool `json:"isVariableBitrate,omitempty"`
// The title of the audio file.
Title *string `json:"title,omitempty"`
// The number of the track on the original disc for this audio file.
Track *int32 `json:"track,omitempty"`
// The total number of tracks on the original disc for this audio file.
TrackCount *int32 `json:"trackCount,omitempty"`
// The year the audio file was recorded.
Year *int32 `json:"year,omitempty"`
}
// NewAudio instantiates a new Audio 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 NewAudio() *Audio {
this := Audio{}
return &this
}
// NewAudioWithDefaults instantiates a new Audio 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 NewAudioWithDefaults() *Audio {
this := Audio{}
return &this
}
// GetAlbum returns the Album field value if set, zero value otherwise.
func (o *Audio) GetAlbum() string {
if o == nil || IsNil(o.Album) {
var ret string
return ret
}
return *o.Album
}
// GetAlbumOk returns a tuple with the Album field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetAlbumOk() (*string, bool) {
if o == nil || IsNil(o.Album) {
return nil, false
}
return o.Album, true
}
// HasAlbum returns a boolean if a field has been set.
func (o *Audio) HasAlbum() bool {
if o != nil && !IsNil(o.Album) {
return true
}
return false
}
// SetAlbum gets a reference to the given string and assigns it to the Album field.
func (o *Audio) SetAlbum(v string) {
o.Album = &v
}
// GetAlbumArtist returns the AlbumArtist field value if set, zero value otherwise.
func (o *Audio) GetAlbumArtist() string {
if o == nil || IsNil(o.AlbumArtist) {
var ret string
return ret
}
return *o.AlbumArtist
}
// GetAlbumArtistOk returns a tuple with the AlbumArtist field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetAlbumArtistOk() (*string, bool) {
if o == nil || IsNil(o.AlbumArtist) {
return nil, false
}
return o.AlbumArtist, true
}
// HasAlbumArtist returns a boolean if a field has been set.
func (o *Audio) HasAlbumArtist() bool {
if o != nil && !IsNil(o.AlbumArtist) {
return true
}
return false
}
// SetAlbumArtist gets a reference to the given string and assigns it to the AlbumArtist field.
func (o *Audio) SetAlbumArtist(v string) {
o.AlbumArtist = &v
}
// GetArtist returns the Artist field value if set, zero value otherwise.
func (o *Audio) GetArtist() string {
if o == nil || IsNil(o.Artist) {
var ret string
return ret
}
return *o.Artist
}
// GetArtistOk returns a tuple with the Artist field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetArtistOk() (*string, bool) {
if o == nil || IsNil(o.Artist) {
return nil, false
}
return o.Artist, true
}
// HasArtist returns a boolean if a field has been set.
func (o *Audio) HasArtist() bool {
if o != nil && !IsNil(o.Artist) {
return true
}
return false
}
// SetArtist gets a reference to the given string and assigns it to the Artist field.
func (o *Audio) SetArtist(v string) {
o.Artist = &v
}
// GetBitrate returns the Bitrate field value if set, zero value otherwise.
func (o *Audio) GetBitrate() int64 {
if o == nil || IsNil(o.Bitrate) {
var ret int64
return ret
}
return *o.Bitrate
}
// GetBitrateOk returns a tuple with the Bitrate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetBitrateOk() (*int64, bool) {
if o == nil || IsNil(o.Bitrate) {
return nil, false
}
return o.Bitrate, true
}
// HasBitrate returns a boolean if a field has been set.
func (o *Audio) HasBitrate() bool {
if o != nil && !IsNil(o.Bitrate) {
return true
}
return false
}
// SetBitrate gets a reference to the given int64 and assigns it to the Bitrate field.
func (o *Audio) SetBitrate(v int64) {
o.Bitrate = &v
}
// GetComposers returns the Composers field value if set, zero value otherwise.
func (o *Audio) GetComposers() string {
if o == nil || IsNil(o.Composers) {
var ret string
return ret
}
return *o.Composers
}
// GetComposersOk returns a tuple with the Composers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetComposersOk() (*string, bool) {
if o == nil || IsNil(o.Composers) {
return nil, false
}
return o.Composers, true
}
// HasComposers returns a boolean if a field has been set.
func (o *Audio) HasComposers() bool {
if o != nil && !IsNil(o.Composers) {
return true
}
return false
}
// SetComposers gets a reference to the given string and assigns it to the Composers field.
func (o *Audio) SetComposers(v string) {
o.Composers = &v
}
// GetCopyright returns the Copyright field value if set, zero value otherwise.
func (o *Audio) GetCopyright() string {
if o == nil || IsNil(o.Copyright) {
var ret string
return ret
}
return *o.Copyright
}
// GetCopyrightOk returns a tuple with the Copyright field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetCopyrightOk() (*string, bool) {
if o == nil || IsNil(o.Copyright) {
return nil, false
}
return o.Copyright, true
}
// HasCopyright returns a boolean if a field has been set.
func (o *Audio) HasCopyright() bool {
if o != nil && !IsNil(o.Copyright) {
return true
}
return false
}
// SetCopyright gets a reference to the given string and assigns it to the Copyright field.
func (o *Audio) SetCopyright(v string) {
o.Copyright = &v
}
// GetDisc returns the Disc field value if set, zero value otherwise.
func (o *Audio) GetDisc() int32 {
if o == nil || IsNil(o.Disc) {
var ret int32
return ret
}
return *o.Disc
}
// GetDiscOk returns a tuple with the Disc field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetDiscOk() (*int32, bool) {
if o == nil || IsNil(o.Disc) {
return nil, false
}
return o.Disc, true
}
// HasDisc returns a boolean if a field has been set.
func (o *Audio) HasDisc() bool {
if o != nil && !IsNil(o.Disc) {
return true
}
return false
}
// SetDisc gets a reference to the given int32 and assigns it to the Disc field.
func (o *Audio) SetDisc(v int32) {
o.Disc = &v
}
// GetDiscCount returns the DiscCount field value if set, zero value otherwise.
func (o *Audio) GetDiscCount() int32 {
if o == nil || IsNil(o.DiscCount) {
var ret int32
return ret
}
return *o.DiscCount
}
// GetDiscCountOk returns a tuple with the DiscCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetDiscCountOk() (*int32, bool) {
if o == nil || IsNil(o.DiscCount) {
return nil, false
}
return o.DiscCount, true
}
// HasDiscCount returns a boolean if a field has been set.
func (o *Audio) HasDiscCount() bool {
if o != nil && !IsNil(o.DiscCount) {
return true
}
return false
}
// SetDiscCount gets a reference to the given int32 and assigns it to the DiscCount field.
func (o *Audio) SetDiscCount(v int32) {
o.DiscCount = &v
}
// GetDuration returns the Duration field value if set, zero value otherwise.
func (o *Audio) GetDuration() int64 {
if o == nil || IsNil(o.Duration) {
var ret int64
return ret
}
return *o.Duration
}
// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetDurationOk() (*int64, bool) {
if o == nil || IsNil(o.Duration) {
return nil, false
}
return o.Duration, true
}
// HasDuration returns a boolean if a field has been set.
func (o *Audio) HasDuration() bool {
if o != nil && !IsNil(o.Duration) {
return true
}
return false
}
// SetDuration gets a reference to the given int64 and assigns it to the Duration field.
func (o *Audio) SetDuration(v int64) {
o.Duration = &v
}
// GetGenre returns the Genre field value if set, zero value otherwise.
func (o *Audio) GetGenre() string {
if o == nil || IsNil(o.Genre) {
var ret string
return ret
}
return *o.Genre
}
// GetGenreOk returns a tuple with the Genre field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetGenreOk() (*string, bool) {
if o == nil || IsNil(o.Genre) {
return nil, false
}
return o.Genre, true
}
// HasGenre returns a boolean if a field has been set.
func (o *Audio) HasGenre() bool {
if o != nil && !IsNil(o.Genre) {
return true
}
return false
}
// SetGenre gets a reference to the given string and assigns it to the Genre field.
func (o *Audio) SetGenre(v string) {
o.Genre = &v
}
// GetHasDrm returns the HasDrm field value if set, zero value otherwise.
func (o *Audio) GetHasDrm() bool {
if o == nil || IsNil(o.HasDrm) {
var ret bool
return ret
}
return *o.HasDrm
}
// GetHasDrmOk returns a tuple with the HasDrm field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetHasDrmOk() (*bool, bool) {
if o == nil || IsNil(o.HasDrm) {
return nil, false
}
return o.HasDrm, true
}
// HasHasDrm returns a boolean if a field has been set.
func (o *Audio) HasHasDrm() bool {
if o != nil && !IsNil(o.HasDrm) {
return true
}
return false
}
// SetHasDrm gets a reference to the given bool and assigns it to the HasDrm field.
func (o *Audio) SetHasDrm(v bool) {
o.HasDrm = &v
}
// GetIsVariableBitrate returns the IsVariableBitrate field value if set, zero value otherwise.
func (o *Audio) GetIsVariableBitrate() bool {
if o == nil || IsNil(o.IsVariableBitrate) {
var ret bool
return ret
}
return *o.IsVariableBitrate
}
// GetIsVariableBitrateOk returns a tuple with the IsVariableBitrate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetIsVariableBitrateOk() (*bool, bool) {
if o == nil || IsNil(o.IsVariableBitrate) {
return nil, false
}
return o.IsVariableBitrate, true
}
// HasIsVariableBitrate returns a boolean if a field has been set.
func (o *Audio) HasIsVariableBitrate() bool {
if o != nil && !IsNil(o.IsVariableBitrate) {
return true
}
return false
}
// SetIsVariableBitrate gets a reference to the given bool and assigns it to the IsVariableBitrate field.
func (o *Audio) SetIsVariableBitrate(v bool) {
o.IsVariableBitrate = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *Audio) GetTitle() string {
if o == nil || IsNil(o.Title) {
var ret string
return ret
}
return *o.Title
}
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetTitleOk() (*string, bool) {
if o == nil || IsNil(o.Title) {
return nil, false
}
return o.Title, true
}
// HasTitle returns a boolean if a field has been set.
func (o *Audio) HasTitle() bool {
if o != nil && !IsNil(o.Title) {
return true
}
return false
}
// SetTitle gets a reference to the given string and assigns it to the Title field.
func (o *Audio) SetTitle(v string) {
o.Title = &v
}
// GetTrack returns the Track field value if set, zero value otherwise.
func (o *Audio) GetTrack() int32 {
if o == nil || IsNil(o.Track) {
var ret int32
return ret
}
return *o.Track
}
// GetTrackOk returns a tuple with the Track field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetTrackOk() (*int32, bool) {
if o == nil || IsNil(o.Track) {
return nil, false
}
return o.Track, true
}
// HasTrack returns a boolean if a field has been set.
func (o *Audio) HasTrack() bool {
if o != nil && !IsNil(o.Track) {
return true
}
return false
}
// SetTrack gets a reference to the given int32 and assigns it to the Track field.
func (o *Audio) SetTrack(v int32) {
o.Track = &v
}
// GetTrackCount returns the TrackCount field value if set, zero value otherwise.
func (o *Audio) GetTrackCount() int32 {
if o == nil || IsNil(o.TrackCount) {
var ret int32
return ret
}
return *o.TrackCount
}
// GetTrackCountOk returns a tuple with the TrackCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetTrackCountOk() (*int32, bool) {
if o == nil || IsNil(o.TrackCount) {
return nil, false
}
return o.TrackCount, true
}
// HasTrackCount returns a boolean if a field has been set.
func (o *Audio) HasTrackCount() bool {
if o != nil && !IsNil(o.TrackCount) {
return true
}
return false
}
// SetTrackCount gets a reference to the given int32 and assigns it to the TrackCount field.
func (o *Audio) SetTrackCount(v int32) {
o.TrackCount = &v
}
// GetYear returns the Year field value if set, zero value otherwise.
func (o *Audio) GetYear() int32 {
if o == nil || IsNil(o.Year) {
var ret int32
return ret
}
return *o.Year
}
// GetYearOk returns a tuple with the Year field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Audio) GetYearOk() (*int32, bool) {
if o == nil || IsNil(o.Year) {
return nil, false
}
return o.Year, true
}
// HasYear returns a boolean if a field has been set.
func (o *Audio) HasYear() bool {
if o != nil && !IsNil(o.Year) {
return true
}
return false
}
// SetYear gets a reference to the given int32 and assigns it to the Year field.
func (o *Audio) SetYear(v int32) {
o.Year = &v
}
func (o Audio) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Audio) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Album) {
toSerialize["album"] = o.Album
}
if !IsNil(o.AlbumArtist) {
toSerialize["albumArtist"] = o.AlbumArtist
}
if !IsNil(o.Artist) {
toSerialize["artist"] = o.Artist
}
if !IsNil(o.Bitrate) {
toSerialize["bitrate"] = o.Bitrate
}
if !IsNil(o.Composers) {
toSerialize["composers"] = o.Composers
}
if !IsNil(o.Copyright) {
toSerialize["copyright"] = o.Copyright
}
if !IsNil(o.Disc) {
toSerialize["disc"] = o.Disc
}
if !IsNil(o.DiscCount) {
toSerialize["discCount"] = o.DiscCount
}
if !IsNil(o.Duration) {
toSerialize["duration"] = o.Duration
}
if !IsNil(o.Genre) {
toSerialize["genre"] = o.Genre
}
if !IsNil(o.HasDrm) {
toSerialize["hasDrm"] = o.HasDrm
}
if !IsNil(o.IsVariableBitrate) {
toSerialize["isVariableBitrate"] = o.IsVariableBitrate
}
if !IsNil(o.Title) {
toSerialize["title"] = o.Title
}
if !IsNil(o.Track) {
toSerialize["track"] = o.Track
}
if !IsNil(o.TrackCount) {
toSerialize["trackCount"] = o.TrackCount
}
if !IsNil(o.Year) {
toSerialize["year"] = o.Year
}
return toSerialize, nil
}
type NullableAudio struct {
value *Audio
isSet bool
}
func (v NullableAudio) Get() *Audio {
return v.value
}
func (v *NullableAudio) Set(val *Audio) {
v.value = val
v.isSet = true
}
func (v NullableAudio) IsSet() bool {
return v.isSet
}
func (v *NullableAudio) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAudio(val *Audio) *NullableAudio {
return &NullableAudio{value: val, isSet: true}
}
func (v NullableAudio) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAudio) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the ClassMemberReference type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ClassMemberReference{}
// ClassMemberReference struct for ClassMemberReference
type ClassMemberReference struct {
OdataId *string `json:"@odata.id,omitempty"`
@@ -38,7 +41,7 @@ func NewClassMemberReferenceWithDefaults() *ClassMemberReference {
// GetOdataId returns the OdataId field value if set, zero value otherwise.
func (o *ClassMemberReference) GetOdataId() string {
if o == nil || o.OdataId == nil {
if o == nil || IsNil(o.OdataId) {
var ret string
return ret
}
@@ -48,7 +51,7 @@ func (o *ClassMemberReference) GetOdataId() string {
// GetOdataIdOk returns a tuple with the OdataId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ClassMemberReference) GetOdataIdOk() (*string, bool) {
if o == nil || o.OdataId == nil {
if o == nil || IsNil(o.OdataId) {
return nil, false
}
return o.OdataId, true
@@ -56,7 +59,7 @@ func (o *ClassMemberReference) GetOdataIdOk() (*string, bool) {
// HasOdataId returns a boolean if a field has been set.
func (o *ClassMemberReference) HasOdataId() bool {
if o != nil && o.OdataId != nil {
if o != nil && !IsNil(o.OdataId) {
return true
}
@@ -69,13 +72,21 @@ func (o *ClassMemberReference) SetOdataId(v string) {
}
func (o ClassMemberReference) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.OdataId != nil {
toSerialize["@odata.id"] = o.OdataId
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ClassMemberReference) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.OdataId) {
toSerialize["@odata.id"] = o.OdataId
}
return toSerialize, nil
}
type NullableClassMemberReference struct {
value *ClassMemberReference
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the ClassReference type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ClassReference{}
// ClassReference struct for ClassReference
type ClassReference struct {
OdataId *string `json:"@odata.id,omitempty"`
@@ -38,7 +41,7 @@ func NewClassReferenceWithDefaults() *ClassReference {
// GetOdataId returns the OdataId field value if set, zero value otherwise.
func (o *ClassReference) GetOdataId() string {
if o == nil || o.OdataId == nil {
if o == nil || IsNil(o.OdataId) {
var ret string
return ret
}
@@ -48,7 +51,7 @@ func (o *ClassReference) GetOdataId() string {
// GetOdataIdOk returns a tuple with the OdataId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ClassReference) GetOdataIdOk() (*string, bool) {
if o == nil || o.OdataId == nil {
if o == nil || IsNil(o.OdataId) {
return nil, false
}
return o.OdataId, true
@@ -56,7 +59,7 @@ func (o *ClassReference) GetOdataIdOk() (*string, bool) {
// HasOdataId returns a boolean if a field has been set.
func (o *ClassReference) HasOdataId() bool {
if o != nil && o.OdataId != nil {
if o != nil && !IsNil(o.OdataId) {
return true
}
@@ -69,13 +72,21 @@ func (o *ClassReference) SetOdataId(v string) {
}
func (o ClassReference) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.OdataId != nil {
toSerialize["@odata.id"] = o.OdataId
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ClassReference) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.OdataId) {
toSerialize["@odata.id"] = o.OdataId
}
return toSerialize, nil
}
type NullableClassReference struct {
value *ClassReference
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the ClassTeacherReference type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ClassTeacherReference{}
// ClassTeacherReference struct for ClassTeacherReference
type ClassTeacherReference struct {
OdataId *string `json:"@odata.id,omitempty"`
@@ -38,7 +41,7 @@ func NewClassTeacherReferenceWithDefaults() *ClassTeacherReference {
// GetOdataId returns the OdataId field value if set, zero value otherwise.
func (o *ClassTeacherReference) GetOdataId() string {
if o == nil || o.OdataId == nil {
if o == nil || IsNil(o.OdataId) {
var ret string
return ret
}
@@ -48,7 +51,7 @@ func (o *ClassTeacherReference) GetOdataId() string {
// GetOdataIdOk returns a tuple with the OdataId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ClassTeacherReference) GetOdataIdOk() (*string, bool) {
if o == nil || o.OdataId == nil {
if o == nil || IsNil(o.OdataId) {
return nil, false
}
return o.OdataId, true
@@ -56,7 +59,7 @@ func (o *ClassTeacherReference) GetOdataIdOk() (*string, bool) {
// HasOdataId returns a boolean if a field has been set.
func (o *ClassTeacherReference) HasOdataId() bool {
if o != nil && o.OdataId != nil {
if o != nil && !IsNil(o.OdataId) {
return true
}
@@ -69,13 +72,21 @@ func (o *ClassTeacherReference) SetOdataId(v string) {
}
func (o ClassTeacherReference) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.OdataId != nil {
toSerialize["@odata.id"] = o.OdataId
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ClassTeacherReference) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.OdataId) {
toSerialize["@odata.id"] = o.OdataId
}
return toSerialize, nil
}
type NullableClassTeacherReference struct {
value *ClassTeacherReference
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfAppRoleAssignments type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfAppRoleAssignments{}
// CollectionOfAppRoleAssignments struct for CollectionOfAppRoleAssignments
type CollectionOfAppRoleAssignments struct {
Value []AppRoleAssignment `json:"value,omitempty"`
@@ -39,7 +42,7 @@ func NewCollectionOfAppRoleAssignmentsWithDefaults() *CollectionOfAppRoleAssignm
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfAppRoleAssignments) GetValue() []AppRoleAssignment {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []AppRoleAssignment
return ret
}
@@ -49,7 +52,7 @@ func (o *CollectionOfAppRoleAssignments) GetValue() []AppRoleAssignment {
// 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 *CollectionOfAppRoleAssignments) GetValueOk() ([]AppRoleAssignment, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -57,7 +60,7 @@ func (o *CollectionOfAppRoleAssignments) GetValueOk() ([]AppRoleAssignment, bool
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfAppRoleAssignments) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -71,7 +74,7 @@ func (o *CollectionOfAppRoleAssignments) SetValue(v []AppRoleAssignment) {
// GetOdataNextLink returns the OdataNextLink field value if set, zero value otherwise.
func (o *CollectionOfAppRoleAssignments) GetOdataNextLink() string {
if o == nil || o.OdataNextLink == nil {
if o == nil || IsNil(o.OdataNextLink) {
var ret string
return ret
}
@@ -81,7 +84,7 @@ func (o *CollectionOfAppRoleAssignments) GetOdataNextLink() string {
// GetOdataNextLinkOk returns a tuple with the OdataNextLink field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CollectionOfAppRoleAssignments) GetOdataNextLinkOk() (*string, bool) {
if o == nil || o.OdataNextLink == nil {
if o == nil || IsNil(o.OdataNextLink) {
return nil, false
}
return o.OdataNextLink, true
@@ -89,7 +92,7 @@ func (o *CollectionOfAppRoleAssignments) GetOdataNextLinkOk() (*string, bool) {
// HasOdataNextLink returns a boolean if a field has been set.
func (o *CollectionOfAppRoleAssignments) HasOdataNextLink() bool {
if o != nil && o.OdataNextLink != nil {
if o != nil && !IsNil(o.OdataNextLink) {
return true
}
@@ -102,16 +105,24 @@ func (o *CollectionOfAppRoleAssignments) SetOdataNextLink(v string) {
}
func (o CollectionOfAppRoleAssignments) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
}
if o.OdataNextLink != nil {
toSerialize["@odata.nextLink"] = o.OdataNextLink
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfAppRoleAssignments) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
if !IsNil(o.OdataNextLink) {
toSerialize["@odata.nextLink"] = o.OdataNextLink
}
return toSerialize, nil
}
type NullableCollectionOfAppRoleAssignments struct {
value *CollectionOfAppRoleAssignments
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfApplications type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfApplications{}
// CollectionOfApplications struct for CollectionOfApplications
type CollectionOfApplications struct {
Value []Application `json:"value,omitempty"`
@@ -38,7 +41,7 @@ func NewCollectionOfApplicationsWithDefaults() *CollectionOfApplications {
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfApplications) GetValue() []Application {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []Application
return ret
}
@@ -48,7 +51,7 @@ func (o *CollectionOfApplications) GetValue() []Application {
// 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 *CollectionOfApplications) GetValueOk() ([]Application, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -56,7 +59,7 @@ func (o *CollectionOfApplications) GetValueOk() ([]Application, bool) {
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfApplications) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -69,13 +72,21 @@ func (o *CollectionOfApplications) SetValue(v []Application) {
}
func (o CollectionOfApplications) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfApplications) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableCollectionOfApplications struct {
value *CollectionOfApplications
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfClass type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfClass{}
// CollectionOfClass struct for CollectionOfClass
type CollectionOfClass struct {
Value []EducationClass `json:"value,omitempty"`
@@ -38,7 +41,7 @@ func NewCollectionOfClassWithDefaults() *CollectionOfClass {
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfClass) GetValue() []EducationClass {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []EducationClass
return ret
}
@@ -48,7 +51,7 @@ func (o *CollectionOfClass) GetValue() []EducationClass {
// 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 *CollectionOfClass) GetValueOk() ([]EducationClass, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -56,7 +59,7 @@ func (o *CollectionOfClass) GetValueOk() ([]EducationClass, bool) {
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfClass) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -69,13 +72,21 @@ func (o *CollectionOfClass) SetValue(v []EducationClass) {
}
func (o CollectionOfClass) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfClass) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableCollectionOfClass struct {
value *CollectionOfClass
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfDriveItems type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfDriveItems{}
// CollectionOfDriveItems struct for CollectionOfDriveItems
type CollectionOfDriveItems struct {
Value []DriveItem `json:"value,omitempty"`
@@ -39,7 +42,7 @@ func NewCollectionOfDriveItemsWithDefaults() *CollectionOfDriveItems {
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfDriveItems) GetValue() []DriveItem {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []DriveItem
return ret
}
@@ -49,7 +52,7 @@ func (o *CollectionOfDriveItems) GetValue() []DriveItem {
// 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 *CollectionOfDriveItems) GetValueOk() ([]DriveItem, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -57,7 +60,7 @@ func (o *CollectionOfDriveItems) GetValueOk() ([]DriveItem, bool) {
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfDriveItems) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -71,7 +74,7 @@ func (o *CollectionOfDriveItems) SetValue(v []DriveItem) {
// GetOdataNextLink returns the OdataNextLink field value if set, zero value otherwise.
func (o *CollectionOfDriveItems) GetOdataNextLink() string {
if o == nil || o.OdataNextLink == nil {
if o == nil || IsNil(o.OdataNextLink) {
var ret string
return ret
}
@@ -81,7 +84,7 @@ func (o *CollectionOfDriveItems) GetOdataNextLink() string {
// GetOdataNextLinkOk returns a tuple with the OdataNextLink field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CollectionOfDriveItems) GetOdataNextLinkOk() (*string, bool) {
if o == nil || o.OdataNextLink == nil {
if o == nil || IsNil(o.OdataNextLink) {
return nil, false
}
return o.OdataNextLink, true
@@ -89,7 +92,7 @@ func (o *CollectionOfDriveItems) GetOdataNextLinkOk() (*string, bool) {
// HasOdataNextLink returns a boolean if a field has been set.
func (o *CollectionOfDriveItems) HasOdataNextLink() bool {
if o != nil && o.OdataNextLink != nil {
if o != nil && !IsNil(o.OdataNextLink) {
return true
}
@@ -102,16 +105,24 @@ func (o *CollectionOfDriveItems) SetOdataNextLink(v string) {
}
func (o CollectionOfDriveItems) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
}
if o.OdataNextLink != nil {
toSerialize["@odata.nextLink"] = o.OdataNextLink
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfDriveItems) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
if !IsNil(o.OdataNextLink) {
toSerialize["@odata.nextLink"] = o.OdataNextLink
}
return toSerialize, nil
}
type NullableCollectionOfDriveItems struct {
value *CollectionOfDriveItems
isSet bool

View File

@@ -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 CollectionOfDriveItems1 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfDriveItems1{}
// CollectionOfDriveItems1 struct for CollectionOfDriveItems1
type CollectionOfDriveItems1 struct {
Value []DriveItem `json:"value,omitempty"`
}
// NewCollectionOfDriveItems1 instantiates a new CollectionOfDriveItems1 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 NewCollectionOfDriveItems1() *CollectionOfDriveItems1 {
this := CollectionOfDriveItems1{}
return &this
}
// NewCollectionOfDriveItems1WithDefaults instantiates a new CollectionOfDriveItems1 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 NewCollectionOfDriveItems1WithDefaults() *CollectionOfDriveItems1 {
this := CollectionOfDriveItems1{}
return &this
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfDriveItems1) GetValue() []DriveItem {
if o == nil || IsNil(o.Value) {
var ret []DriveItem
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 *CollectionOfDriveItems1) GetValueOk() ([]DriveItem, 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 *CollectionOfDriveItems1) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given []DriveItem and assigns it to the Value field.
func (o *CollectionOfDriveItems1) SetValue(v []DriveItem) {
o.Value = v
}
func (o CollectionOfDriveItems1) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfDriveItems1) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableCollectionOfDriveItems1 struct {
value *CollectionOfDriveItems1
isSet bool
}
func (v NullableCollectionOfDriveItems1) Get() *CollectionOfDriveItems1 {
return v.value
}
func (v *NullableCollectionOfDriveItems1) Set(val *CollectionOfDriveItems1) {
v.value = val
v.isSet = true
}
func (v NullableCollectionOfDriveItems1) IsSet() bool {
return v.isSet
}
func (v *NullableCollectionOfDriveItems1) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCollectionOfDriveItems1(val *CollectionOfDriveItems1) *NullableCollectionOfDriveItems1 {
return &NullableCollectionOfDriveItems1{value: val, isSet: true}
}
func (v NullableCollectionOfDriveItems1) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCollectionOfDriveItems1) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfDrives type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfDrives{}
// CollectionOfDrives struct for CollectionOfDrives
type CollectionOfDrives struct {
Value []Drive `json:"value,omitempty"`
@@ -39,7 +42,7 @@ func NewCollectionOfDrivesWithDefaults() *CollectionOfDrives {
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfDrives) GetValue() []Drive {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []Drive
return ret
}
@@ -49,7 +52,7 @@ func (o *CollectionOfDrives) GetValue() []Drive {
// 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 *CollectionOfDrives) GetValueOk() ([]Drive, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -57,7 +60,7 @@ func (o *CollectionOfDrives) GetValueOk() ([]Drive, bool) {
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfDrives) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -71,7 +74,7 @@ func (o *CollectionOfDrives) SetValue(v []Drive) {
// GetOdataNextLink returns the OdataNextLink field value if set, zero value otherwise.
func (o *CollectionOfDrives) GetOdataNextLink() string {
if o == nil || o.OdataNextLink == nil {
if o == nil || IsNil(o.OdataNextLink) {
var ret string
return ret
}
@@ -81,7 +84,7 @@ func (o *CollectionOfDrives) GetOdataNextLink() string {
// GetOdataNextLinkOk returns a tuple with the OdataNextLink field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CollectionOfDrives) GetOdataNextLinkOk() (*string, bool) {
if o == nil || o.OdataNextLink == nil {
if o == nil || IsNil(o.OdataNextLink) {
return nil, false
}
return o.OdataNextLink, true
@@ -89,7 +92,7 @@ func (o *CollectionOfDrives) GetOdataNextLinkOk() (*string, bool) {
// HasOdataNextLink returns a boolean if a field has been set.
func (o *CollectionOfDrives) HasOdataNextLink() bool {
if o != nil && o.OdataNextLink != nil {
if o != nil && !IsNil(o.OdataNextLink) {
return true
}
@@ -102,16 +105,24 @@ func (o *CollectionOfDrives) SetOdataNextLink(v string) {
}
func (o CollectionOfDrives) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
}
if o.OdataNextLink != nil {
toSerialize["@odata.nextLink"] = o.OdataNextLink
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfDrives) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
if !IsNil(o.OdataNextLink) {
toSerialize["@odata.nextLink"] = o.OdataNextLink
}
return toSerialize, nil
}
type NullableCollectionOfDrives struct {
value *CollectionOfDrives
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfDrives1 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfDrives1{}
// CollectionOfDrives1 struct for CollectionOfDrives1
type CollectionOfDrives1 struct {
Value []Drive `json:"value,omitempty"`
@@ -38,7 +41,7 @@ func NewCollectionOfDrives1WithDefaults() *CollectionOfDrives1 {
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfDrives1) GetValue() []Drive {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []Drive
return ret
}
@@ -48,7 +51,7 @@ func (o *CollectionOfDrives1) GetValue() []Drive {
// 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 *CollectionOfDrives1) GetValueOk() ([]Drive, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -56,7 +59,7 @@ func (o *CollectionOfDrives1) GetValueOk() ([]Drive, bool) {
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfDrives1) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -69,13 +72,21 @@ func (o *CollectionOfDrives1) SetValue(v []Drive) {
}
func (o CollectionOfDrives1) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfDrives1) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableCollectionOfDrives1 struct {
value *CollectionOfDrives1
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfEducationClass type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfEducationClass{}
// CollectionOfEducationClass struct for CollectionOfEducationClass
type CollectionOfEducationClass struct {
Value []EducationClass `json:"value,omitempty"`
@@ -38,7 +41,7 @@ func NewCollectionOfEducationClassWithDefaults() *CollectionOfEducationClass {
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfEducationClass) GetValue() []EducationClass {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []EducationClass
return ret
}
@@ -48,7 +51,7 @@ func (o *CollectionOfEducationClass) GetValue() []EducationClass {
// 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 *CollectionOfEducationClass) GetValueOk() ([]EducationClass, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -56,7 +59,7 @@ func (o *CollectionOfEducationClass) GetValueOk() ([]EducationClass, bool) {
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfEducationClass) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -69,13 +72,21 @@ func (o *CollectionOfEducationClass) SetValue(v []EducationClass) {
}
func (o CollectionOfEducationClass) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfEducationClass) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableCollectionOfEducationClass struct {
value *CollectionOfEducationClass
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfEducationUser type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfEducationUser{}
// CollectionOfEducationUser struct for CollectionOfEducationUser
type CollectionOfEducationUser struct {
Value []EducationUser `json:"value,omitempty"`
@@ -38,7 +41,7 @@ func NewCollectionOfEducationUserWithDefaults() *CollectionOfEducationUser {
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfEducationUser) GetValue() []EducationUser {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []EducationUser
return ret
}
@@ -48,7 +51,7 @@ func (o *CollectionOfEducationUser) GetValue() []EducationUser {
// 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 *CollectionOfEducationUser) GetValueOk() ([]EducationUser, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -56,7 +59,7 @@ func (o *CollectionOfEducationUser) GetValueOk() ([]EducationUser, bool) {
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfEducationUser) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -69,13 +72,21 @@ func (o *CollectionOfEducationUser) SetValue(v []EducationUser) {
}
func (o CollectionOfEducationUser) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfEducationUser) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableCollectionOfEducationUser struct {
value *CollectionOfEducationUser
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfEducationUser1 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfEducationUser1{}
// CollectionOfEducationUser1 struct for CollectionOfEducationUser1
type CollectionOfEducationUser1 struct {
Value []EducationClass `json:"value,omitempty"`
@@ -38,7 +41,7 @@ func NewCollectionOfEducationUser1WithDefaults() *CollectionOfEducationUser1 {
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfEducationUser1) GetValue() []EducationClass {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []EducationClass
return ret
}
@@ -48,7 +51,7 @@ func (o *CollectionOfEducationUser1) GetValue() []EducationClass {
// 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 *CollectionOfEducationUser1) GetValueOk() ([]EducationClass, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -56,7 +59,7 @@ func (o *CollectionOfEducationUser1) GetValueOk() ([]EducationClass, bool) {
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfEducationUser1) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -69,13 +72,21 @@ func (o *CollectionOfEducationUser1) SetValue(v []EducationClass) {
}
func (o CollectionOfEducationUser1) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfEducationUser1) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableCollectionOfEducationUser1 struct {
value *CollectionOfEducationUser1
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfGroup type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfGroup{}
// CollectionOfGroup struct for CollectionOfGroup
type CollectionOfGroup struct {
Value []Group `json:"value,omitempty"`
@@ -39,7 +42,7 @@ func NewCollectionOfGroupWithDefaults() *CollectionOfGroup {
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfGroup) GetValue() []Group {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []Group
return ret
}
@@ -49,7 +52,7 @@ func (o *CollectionOfGroup) GetValue() []Group {
// 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 *CollectionOfGroup) GetValueOk() ([]Group, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -57,7 +60,7 @@ func (o *CollectionOfGroup) GetValueOk() ([]Group, bool) {
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfGroup) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -71,7 +74,7 @@ func (o *CollectionOfGroup) SetValue(v []Group) {
// GetOdataNextLink returns the OdataNextLink field value if set, zero value otherwise.
func (o *CollectionOfGroup) GetOdataNextLink() string {
if o == nil || o.OdataNextLink == nil {
if o == nil || IsNil(o.OdataNextLink) {
var ret string
return ret
}
@@ -81,7 +84,7 @@ func (o *CollectionOfGroup) GetOdataNextLink() string {
// GetOdataNextLinkOk returns a tuple with the OdataNextLink field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CollectionOfGroup) GetOdataNextLinkOk() (*string, bool) {
if o == nil || o.OdataNextLink == nil {
if o == nil || IsNil(o.OdataNextLink) {
return nil, false
}
return o.OdataNextLink, true
@@ -89,7 +92,7 @@ func (o *CollectionOfGroup) GetOdataNextLinkOk() (*string, bool) {
// HasOdataNextLink returns a boolean if a field has been set.
func (o *CollectionOfGroup) HasOdataNextLink() bool {
if o != nil && o.OdataNextLink != nil {
if o != nil && !IsNil(o.OdataNextLink) {
return true
}
@@ -102,16 +105,24 @@ func (o *CollectionOfGroup) SetOdataNextLink(v string) {
}
func (o CollectionOfGroup) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
}
if o.OdataNextLink != nil {
toSerialize["@odata.nextLink"] = o.OdataNextLink
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfGroup) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
if !IsNil(o.OdataNextLink) {
toSerialize["@odata.nextLink"] = o.OdataNextLink
}
return toSerialize, nil
}
type NullableCollectionOfGroup struct {
value *CollectionOfGroup
isSet bool

View File

@@ -0,0 +1,198 @@
/*
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 CollectionOfPermissions type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfPermissions{}
// CollectionOfPermissions struct for CollectionOfPermissions
type CollectionOfPermissions struct {
// A list of role definitions that can be chosen for the resource.
LibreGraphPermissionsRolesAllowedValues []UnifiedRoleDefinition `json:"@libre.graph.permissions.roles.allowedValues,omitempty"`
// A list of actions that can be chosen for a custom role. Following the CS3 API we can represent the CS3 permissions by mapping them to driveItem properties or relations like this: | [CS3 ResourcePermission](https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.ResourcePermissions) | action | comment | | ------------------------------------------------------------------------------------------------------------ | ------ | ------- | | `stat` | `libre.graph/driveItem/basic/read` | `basic` because it does not include versions or trashed items | | `get_quota` | `libre.graph/driveItem/quota/read` | read only the `quota` property | | `get_path` | `libre.graph/driveItem/path/read` | read only the `path` property | | `move` | `libre.graph/driveItem/path/update` | allows updating the `path` property of a CS3 resource | | `delete` | `libre.graph/driveItem/standard/delete` | `standard` because deleting is a common update operation | | `list_container` | `libre.graph/driveItem/children/read` | | | `create_container` | `libre.graph/driveItem/children/create` | | | `initiate_file_download` | `libre.graph/driveItem/content/read` | `content` is the property read when initiating a download | | `initiate_file_upload` | `libre.graph/driveItem/upload/create` | `uploads` are a separate property. postprocessing creates the `content` | | `add_grant` | `libre.graph/driveItem/permissions/create` | | | `list_grant` | `libre.graph/driveItem/permissions/read` | | | `update_grant` | `libre.graph/driveItem/permissions/update` | | | `remove_grant` | `libre.graph/driveItem/permissions/delete` | | | `deny_grant` | `libre.graph/driveItem/permissions/deny` | uses a non CRUD action `deny` | | `list_file_versions` | `libre.graph/driveItem/versions/read` | `versions` is a `driveItemVersion` collection | | `restore_file_version` | `libre.graph/driveItem/versions/update` | the only `update` action is restore | | `list_recycle` | `libre.graph/driveItem/deleted/read` | reading a driveItem `deleted` property implies listing | | `restore_recycle_item` | `libre.graph/driveItem/deleted/update` | the only `update` action is restore | | `purge_recycle` | `libre.graph/driveItem/deleted/delete` | allows purging deleted `driveItems` |
LibreGraphPermissionsActionsAllowedValues []string `json:"@libre.graph.permissions.actions.allowedValues,omitempty"`
Value []Permission `json:"value,omitempty"`
}
// NewCollectionOfPermissions instantiates a new CollectionOfPermissions 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 NewCollectionOfPermissions() *CollectionOfPermissions {
this := CollectionOfPermissions{}
return &this
}
// NewCollectionOfPermissionsWithDefaults instantiates a new CollectionOfPermissions 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 NewCollectionOfPermissionsWithDefaults() *CollectionOfPermissions {
this := CollectionOfPermissions{}
return &this
}
// GetLibreGraphPermissionsRolesAllowedValues returns the LibreGraphPermissionsRolesAllowedValues field value if set, zero value otherwise.
func (o *CollectionOfPermissions) GetLibreGraphPermissionsRolesAllowedValues() []UnifiedRoleDefinition {
if o == nil || IsNil(o.LibreGraphPermissionsRolesAllowedValues) {
var ret []UnifiedRoleDefinition
return ret
}
return o.LibreGraphPermissionsRolesAllowedValues
}
// GetLibreGraphPermissionsRolesAllowedValuesOk returns a tuple with the LibreGraphPermissionsRolesAllowedValues field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CollectionOfPermissions) GetLibreGraphPermissionsRolesAllowedValuesOk() ([]UnifiedRoleDefinition, bool) {
if o == nil || IsNil(o.LibreGraphPermissionsRolesAllowedValues) {
return nil, false
}
return o.LibreGraphPermissionsRolesAllowedValues, true
}
// HasLibreGraphPermissionsRolesAllowedValues returns a boolean if a field has been set.
func (o *CollectionOfPermissions) HasLibreGraphPermissionsRolesAllowedValues() bool {
if o != nil && !IsNil(o.LibreGraphPermissionsRolesAllowedValues) {
return true
}
return false
}
// SetLibreGraphPermissionsRolesAllowedValues gets a reference to the given []UnifiedRoleDefinition and assigns it to the LibreGraphPermissionsRolesAllowedValues field.
func (o *CollectionOfPermissions) SetLibreGraphPermissionsRolesAllowedValues(v []UnifiedRoleDefinition) {
o.LibreGraphPermissionsRolesAllowedValues = v
}
// GetLibreGraphPermissionsActionsAllowedValues returns the LibreGraphPermissionsActionsAllowedValues field value if set, zero value otherwise.
func (o *CollectionOfPermissions) GetLibreGraphPermissionsActionsAllowedValues() []string {
if o == nil || IsNil(o.LibreGraphPermissionsActionsAllowedValues) {
var ret []string
return ret
}
return o.LibreGraphPermissionsActionsAllowedValues
}
// GetLibreGraphPermissionsActionsAllowedValuesOk returns a tuple with the LibreGraphPermissionsActionsAllowedValues field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CollectionOfPermissions) GetLibreGraphPermissionsActionsAllowedValuesOk() ([]string, bool) {
if o == nil || IsNil(o.LibreGraphPermissionsActionsAllowedValues) {
return nil, false
}
return o.LibreGraphPermissionsActionsAllowedValues, true
}
// HasLibreGraphPermissionsActionsAllowedValues returns a boolean if a field has been set.
func (o *CollectionOfPermissions) HasLibreGraphPermissionsActionsAllowedValues() bool {
if o != nil && !IsNil(o.LibreGraphPermissionsActionsAllowedValues) {
return true
}
return false
}
// SetLibreGraphPermissionsActionsAllowedValues gets a reference to the given []string and assigns it to the LibreGraphPermissionsActionsAllowedValues field.
func (o *CollectionOfPermissions) SetLibreGraphPermissionsActionsAllowedValues(v []string) {
o.LibreGraphPermissionsActionsAllowedValues = v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfPermissions) GetValue() []Permission {
if o == nil || IsNil(o.Value) {
var ret []Permission
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 *CollectionOfPermissions) GetValueOk() ([]Permission, 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 *CollectionOfPermissions) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given []Permission and assigns it to the Value field.
func (o *CollectionOfPermissions) SetValue(v []Permission) {
o.Value = v
}
func (o CollectionOfPermissions) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfPermissions) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.LibreGraphPermissionsRolesAllowedValues) {
toSerialize["@libre.graph.permissions.roles.allowedValues"] = o.LibreGraphPermissionsRolesAllowedValues
}
if !IsNil(o.LibreGraphPermissionsActionsAllowedValues) {
toSerialize["@libre.graph.permissions.actions.allowedValues"] = o.LibreGraphPermissionsActionsAllowedValues
}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableCollectionOfPermissions struct {
value *CollectionOfPermissions
isSet bool
}
func (v NullableCollectionOfPermissions) Get() *CollectionOfPermissions {
return v.value
}
func (v *NullableCollectionOfPermissions) Set(val *CollectionOfPermissions) {
v.value = val
v.isSet = true
}
func (v NullableCollectionOfPermissions) IsSet() bool {
return v.isSet
}
func (v *NullableCollectionOfPermissions) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCollectionOfPermissions(val *CollectionOfPermissions) *NullableCollectionOfPermissions {
return &NullableCollectionOfPermissions{value: val, isSet: true}
}
func (v NullableCollectionOfPermissions) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCollectionOfPermissions) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfSchools type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfSchools{}
// CollectionOfSchools struct for CollectionOfSchools
type CollectionOfSchools struct {
Value []EducationSchool `json:"value,omitempty"`
@@ -38,7 +41,7 @@ func NewCollectionOfSchoolsWithDefaults() *CollectionOfSchools {
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfSchools) GetValue() []EducationSchool {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []EducationSchool
return ret
}
@@ -48,7 +51,7 @@ func (o *CollectionOfSchools) GetValue() []EducationSchool {
// 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 *CollectionOfSchools) GetValueOk() ([]EducationSchool, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -56,7 +59,7 @@ func (o *CollectionOfSchools) GetValueOk() ([]EducationSchool, bool) {
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfSchools) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -69,13 +72,21 @@ func (o *CollectionOfSchools) SetValue(v []EducationSchool) {
}
func (o CollectionOfSchools) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfSchools) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableCollectionOfSchools struct {
value *CollectionOfSchools
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfTags type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfTags{}
// CollectionOfTags struct for CollectionOfTags
type CollectionOfTags struct {
Value []string `json:"value,omitempty"`
@@ -38,7 +41,7 @@ func NewCollectionOfTagsWithDefaults() *CollectionOfTags {
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfTags) GetValue() []string {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []string
return ret
}
@@ -48,7 +51,7 @@ func (o *CollectionOfTags) GetValue() []string {
// 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 *CollectionOfTags) GetValueOk() ([]string, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -56,7 +59,7 @@ func (o *CollectionOfTags) GetValueOk() ([]string, bool) {
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfTags) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -69,13 +72,21 @@ func (o *CollectionOfTags) SetValue(v []string) {
}
func (o CollectionOfTags) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfTags) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableCollectionOfTags struct {
value *CollectionOfTags
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfUser type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfUser{}
// CollectionOfUser struct for CollectionOfUser
type CollectionOfUser struct {
Value []User `json:"value,omitempty"`
@@ -39,7 +42,7 @@ func NewCollectionOfUserWithDefaults() *CollectionOfUser {
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfUser) GetValue() []User {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []User
return ret
}
@@ -49,7 +52,7 @@ func (o *CollectionOfUser) GetValue() []User {
// 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 *CollectionOfUser) GetValueOk() ([]User, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -57,7 +60,7 @@ func (o *CollectionOfUser) GetValueOk() ([]User, bool) {
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfUser) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -71,7 +74,7 @@ func (o *CollectionOfUser) SetValue(v []User) {
// GetOdataNextLink returns the OdataNextLink field value if set, zero value otherwise.
func (o *CollectionOfUser) GetOdataNextLink() string {
if o == nil || o.OdataNextLink == nil {
if o == nil || IsNil(o.OdataNextLink) {
var ret string
return ret
}
@@ -81,7 +84,7 @@ func (o *CollectionOfUser) GetOdataNextLink() string {
// GetOdataNextLinkOk returns a tuple with the OdataNextLink field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CollectionOfUser) GetOdataNextLinkOk() (*string, bool) {
if o == nil || o.OdataNextLink == nil {
if o == nil || IsNil(o.OdataNextLink) {
return nil, false
}
return o.OdataNextLink, true
@@ -89,7 +92,7 @@ func (o *CollectionOfUser) GetOdataNextLinkOk() (*string, bool) {
// HasOdataNextLink returns a boolean if a field has been set.
func (o *CollectionOfUser) HasOdataNextLink() bool {
if o != nil && o.OdataNextLink != nil {
if o != nil && !IsNil(o.OdataNextLink) {
return true
}
@@ -102,16 +105,24 @@ func (o *CollectionOfUser) SetOdataNextLink(v string) {
}
func (o CollectionOfUser) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
}
if o.OdataNextLink != nil {
toSerialize["@odata.nextLink"] = o.OdataNextLink
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfUser) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
if !IsNil(o.OdataNextLink) {
toSerialize["@odata.nextLink"] = o.OdataNextLink
}
return toSerialize, nil
}
type NullableCollectionOfUser struct {
value *CollectionOfUser
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the CollectionOfUsers type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfUsers{}
// CollectionOfUsers struct for CollectionOfUsers
type CollectionOfUsers struct {
Value []User `json:"value,omitempty"`
@@ -38,7 +41,7 @@ func NewCollectionOfUsersWithDefaults() *CollectionOfUsers {
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfUsers) GetValue() []User {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
var ret []User
return ret
}
@@ -48,7 +51,7 @@ func (o *CollectionOfUsers) GetValue() []User {
// 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 *CollectionOfUsers) GetValueOk() ([]User, bool) {
if o == nil || o.Value == nil {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
@@ -56,7 +59,7 @@ func (o *CollectionOfUsers) GetValueOk() ([]User, bool) {
// HasValue returns a boolean if a field has been set.
func (o *CollectionOfUsers) HasValue() bool {
if o != nil && o.Value != nil {
if o != nil && !IsNil(o.Value) {
return true
}
@@ -69,13 +72,21 @@ func (o *CollectionOfUsers) SetValue(v []User) {
}
func (o CollectionOfUsers) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Value != nil {
toSerialize["value"] = o.Value
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfUsers) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableCollectionOfUsers struct {
value *CollectionOfUsers
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the Deleted type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Deleted{}
// Deleted Information about the deleted state of the item. Read-only.
type Deleted struct {
// Represents the state of the deleted item.
@@ -39,7 +42,7 @@ func NewDeletedWithDefaults() *Deleted {
// GetState returns the State field value if set, zero value otherwise.
func (o *Deleted) GetState() string {
if o == nil || o.State == nil {
if o == nil || IsNil(o.State) {
var ret string
return ret
}
@@ -49,7 +52,7 @@ func (o *Deleted) GetState() string {
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Deleted) GetStateOk() (*string, bool) {
if o == nil || o.State == nil {
if o == nil || IsNil(o.State) {
return nil, false
}
return o.State, true
@@ -57,7 +60,7 @@ func (o *Deleted) GetStateOk() (*string, bool) {
// HasState returns a boolean if a field has been set.
func (o *Deleted) HasState() bool {
if o != nil && o.State != nil {
if o != nil && !IsNil(o.State) {
return true
}
@@ -70,13 +73,21 @@ func (o *Deleted) SetState(v string) {
}
func (o Deleted) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.State != nil {
toSerialize["state"] = o.State
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Deleted) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
return toSerialize, nil
}
type NullableDeleted struct {
value *Deleted
isSet bool

View File

@@ -15,6 +15,9 @@ import (
"time"
)
// checks if the DirectoryObject type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DirectoryObject{}
// DirectoryObject Represents a Directory object. Read-only.
type DirectoryObject struct {
// The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only.
@@ -41,7 +44,7 @@ func NewDirectoryObjectWithDefaults() *DirectoryObject {
// GetId returns the Id field value if set, zero value otherwise.
func (o *DirectoryObject) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -51,7 +54,7 @@ func (o *DirectoryObject) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DirectoryObject) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -59,7 +62,7 @@ func (o *DirectoryObject) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *DirectoryObject) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -73,7 +76,7 @@ func (o *DirectoryObject) SetId(v string) {
// GetDeletedDateTime returns the DeletedDateTime field value if set, zero value otherwise.
func (o *DirectoryObject) GetDeletedDateTime() time.Time {
if o == nil || o.DeletedDateTime == nil {
if o == nil || IsNil(o.DeletedDateTime) {
var ret time.Time
return ret
}
@@ -83,7 +86,7 @@ func (o *DirectoryObject) GetDeletedDateTime() time.Time {
// GetDeletedDateTimeOk returns a tuple with the DeletedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DirectoryObject) GetDeletedDateTimeOk() (*time.Time, bool) {
if o == nil || o.DeletedDateTime == nil {
if o == nil || IsNil(o.DeletedDateTime) {
return nil, false
}
return o.DeletedDateTime, true
@@ -91,7 +94,7 @@ func (o *DirectoryObject) GetDeletedDateTimeOk() (*time.Time, bool) {
// HasDeletedDateTime returns a boolean if a field has been set.
func (o *DirectoryObject) HasDeletedDateTime() bool {
if o != nil && o.DeletedDateTime != nil {
if o != nil && !IsNil(o.DeletedDateTime) {
return true
}
@@ -104,16 +107,24 @@ func (o *DirectoryObject) SetDeletedDateTime(v time.Time) {
}
func (o DirectoryObject) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.DeletedDateTime != nil {
toSerialize["deletedDateTime"] = o.DeletedDateTime
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DirectoryObject) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.DeletedDateTime) {
toSerialize["deletedDateTime"] = o.DeletedDateTime
}
return toSerialize, nil
}
type NullableDirectoryObject struct {
value *DirectoryObject
isSet bool

View File

@@ -15,6 +15,9 @@ import (
"time"
)
// checks if the Drive type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Drive{}
// Drive The drive represents a space on the storage.
type Drive struct {
// The unique idenfier for this drive.
@@ -67,7 +70,7 @@ func NewDriveWithDefaults() *Drive {
// GetId returns the Id field value if set, zero value otherwise.
func (o *Drive) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -77,7 +80,7 @@ func (o *Drive) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -85,7 +88,7 @@ func (o *Drive) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *Drive) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -99,7 +102,7 @@ func (o *Drive) SetId(v string) {
// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise.
func (o *Drive) GetCreatedBy() IdentitySet {
if o == nil || o.CreatedBy == nil {
if o == nil || IsNil(o.CreatedBy) {
var ret IdentitySet
return ret
}
@@ -109,7 +112,7 @@ func (o *Drive) GetCreatedBy() IdentitySet {
// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetCreatedByOk() (*IdentitySet, bool) {
if o == nil || o.CreatedBy == nil {
if o == nil || IsNil(o.CreatedBy) {
return nil, false
}
return o.CreatedBy, true
@@ -117,7 +120,7 @@ func (o *Drive) GetCreatedByOk() (*IdentitySet, bool) {
// HasCreatedBy returns a boolean if a field has been set.
func (o *Drive) HasCreatedBy() bool {
if o != nil && o.CreatedBy != nil {
if o != nil && !IsNil(o.CreatedBy) {
return true
}
@@ -131,7 +134,7 @@ func (o *Drive) SetCreatedBy(v IdentitySet) {
// GetCreatedDateTime returns the CreatedDateTime field value if set, zero value otherwise.
func (o *Drive) GetCreatedDateTime() time.Time {
if o == nil || o.CreatedDateTime == nil {
if o == nil || IsNil(o.CreatedDateTime) {
var ret time.Time
return ret
}
@@ -141,7 +144,7 @@ func (o *Drive) GetCreatedDateTime() time.Time {
// GetCreatedDateTimeOk returns a tuple with the CreatedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetCreatedDateTimeOk() (*time.Time, bool) {
if o == nil || o.CreatedDateTime == nil {
if o == nil || IsNil(o.CreatedDateTime) {
return nil, false
}
return o.CreatedDateTime, true
@@ -149,7 +152,7 @@ func (o *Drive) GetCreatedDateTimeOk() (*time.Time, bool) {
// HasCreatedDateTime returns a boolean if a field has been set.
func (o *Drive) HasCreatedDateTime() bool {
if o != nil && o.CreatedDateTime != nil {
if o != nil && !IsNil(o.CreatedDateTime) {
return true
}
@@ -163,7 +166,7 @@ func (o *Drive) SetCreatedDateTime(v time.Time) {
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *Drive) GetDescription() string {
if o == nil || o.Description == nil {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
@@ -173,7 +176,7 @@ func (o *Drive) GetDescription() string {
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetDescriptionOk() (*string, bool) {
if o == nil || o.Description == nil {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
@@ -181,7 +184,7 @@ func (o *Drive) GetDescriptionOk() (*string, bool) {
// HasDescription returns a boolean if a field has been set.
func (o *Drive) HasDescription() bool {
if o != nil && o.Description != nil {
if o != nil && !IsNil(o.Description) {
return true
}
@@ -195,7 +198,7 @@ func (o *Drive) SetDescription(v string) {
// GetETag returns the ETag field value if set, zero value otherwise.
func (o *Drive) GetETag() string {
if o == nil || o.ETag == nil {
if o == nil || IsNil(o.ETag) {
var ret string
return ret
}
@@ -205,7 +208,7 @@ func (o *Drive) GetETag() string {
// GetETagOk returns a tuple with the ETag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetETagOk() (*string, bool) {
if o == nil || o.ETag == nil {
if o == nil || IsNil(o.ETag) {
return nil, false
}
return o.ETag, true
@@ -213,7 +216,7 @@ func (o *Drive) GetETagOk() (*string, bool) {
// HasETag returns a boolean if a field has been set.
func (o *Drive) HasETag() bool {
if o != nil && o.ETag != nil {
if o != nil && !IsNil(o.ETag) {
return true
}
@@ -227,7 +230,7 @@ func (o *Drive) SetETag(v string) {
// GetLastModifiedBy returns the LastModifiedBy field value if set, zero value otherwise.
func (o *Drive) GetLastModifiedBy() IdentitySet {
if o == nil || o.LastModifiedBy == nil {
if o == nil || IsNil(o.LastModifiedBy) {
var ret IdentitySet
return ret
}
@@ -237,7 +240,7 @@ func (o *Drive) GetLastModifiedBy() IdentitySet {
// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetLastModifiedByOk() (*IdentitySet, bool) {
if o == nil || o.LastModifiedBy == nil {
if o == nil || IsNil(o.LastModifiedBy) {
return nil, false
}
return o.LastModifiedBy, true
@@ -245,7 +248,7 @@ func (o *Drive) GetLastModifiedByOk() (*IdentitySet, bool) {
// HasLastModifiedBy returns a boolean if a field has been set.
func (o *Drive) HasLastModifiedBy() bool {
if o != nil && o.LastModifiedBy != nil {
if o != nil && !IsNil(o.LastModifiedBy) {
return true
}
@@ -259,7 +262,7 @@ func (o *Drive) SetLastModifiedBy(v IdentitySet) {
// GetLastModifiedDateTime returns the LastModifiedDateTime field value if set, zero value otherwise.
func (o *Drive) GetLastModifiedDateTime() time.Time {
if o == nil || o.LastModifiedDateTime == nil {
if o == nil || IsNil(o.LastModifiedDateTime) {
var ret time.Time
return ret
}
@@ -269,7 +272,7 @@ func (o *Drive) GetLastModifiedDateTime() time.Time {
// GetLastModifiedDateTimeOk returns a tuple with the LastModifiedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetLastModifiedDateTimeOk() (*time.Time, bool) {
if o == nil || o.LastModifiedDateTime == nil {
if o == nil || IsNil(o.LastModifiedDateTime) {
return nil, false
}
return o.LastModifiedDateTime, true
@@ -277,7 +280,7 @@ func (o *Drive) GetLastModifiedDateTimeOk() (*time.Time, bool) {
// HasLastModifiedDateTime returns a boolean if a field has been set.
func (o *Drive) HasLastModifiedDateTime() bool {
if o != nil && o.LastModifiedDateTime != nil {
if o != nil && !IsNil(o.LastModifiedDateTime) {
return true
}
@@ -315,7 +318,7 @@ func (o *Drive) SetName(v string) {
// GetParentReference returns the ParentReference field value if set, zero value otherwise.
func (o *Drive) GetParentReference() ItemReference {
if o == nil || o.ParentReference == nil {
if o == nil || IsNil(o.ParentReference) {
var ret ItemReference
return ret
}
@@ -325,7 +328,7 @@ func (o *Drive) GetParentReference() ItemReference {
// GetParentReferenceOk returns a tuple with the ParentReference field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetParentReferenceOk() (*ItemReference, bool) {
if o == nil || o.ParentReference == nil {
if o == nil || IsNil(o.ParentReference) {
return nil, false
}
return o.ParentReference, true
@@ -333,7 +336,7 @@ func (o *Drive) GetParentReferenceOk() (*ItemReference, bool) {
// HasParentReference returns a boolean if a field has been set.
func (o *Drive) HasParentReference() bool {
if o != nil && o.ParentReference != nil {
if o != nil && !IsNil(o.ParentReference) {
return true
}
@@ -347,7 +350,7 @@ func (o *Drive) SetParentReference(v ItemReference) {
// GetWebUrl returns the WebUrl field value if set, zero value otherwise.
func (o *Drive) GetWebUrl() string {
if o == nil || o.WebUrl == nil {
if o == nil || IsNil(o.WebUrl) {
var ret string
return ret
}
@@ -357,7 +360,7 @@ func (o *Drive) GetWebUrl() string {
// GetWebUrlOk returns a tuple with the WebUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetWebUrlOk() (*string, bool) {
if o == nil || o.WebUrl == nil {
if o == nil || IsNil(o.WebUrl) {
return nil, false
}
return o.WebUrl, true
@@ -365,7 +368,7 @@ func (o *Drive) GetWebUrlOk() (*string, bool) {
// HasWebUrl returns a boolean if a field has been set.
func (o *Drive) HasWebUrl() bool {
if o != nil && o.WebUrl != nil {
if o != nil && !IsNil(o.WebUrl) {
return true
}
@@ -379,7 +382,7 @@ func (o *Drive) SetWebUrl(v string) {
// GetDriveType returns the DriveType field value if set, zero value otherwise.
func (o *Drive) GetDriveType() string {
if o == nil || o.DriveType == nil {
if o == nil || IsNil(o.DriveType) {
var ret string
return ret
}
@@ -389,7 +392,7 @@ func (o *Drive) GetDriveType() string {
// GetDriveTypeOk returns a tuple with the DriveType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetDriveTypeOk() (*string, bool) {
if o == nil || o.DriveType == nil {
if o == nil || IsNil(o.DriveType) {
return nil, false
}
return o.DriveType, true
@@ -397,7 +400,7 @@ func (o *Drive) GetDriveTypeOk() (*string, bool) {
// HasDriveType returns a boolean if a field has been set.
func (o *Drive) HasDriveType() bool {
if o != nil && o.DriveType != nil {
if o != nil && !IsNil(o.DriveType) {
return true
}
@@ -411,7 +414,7 @@ func (o *Drive) SetDriveType(v string) {
// GetDriveAlias returns the DriveAlias field value if set, zero value otherwise.
func (o *Drive) GetDriveAlias() string {
if o == nil || o.DriveAlias == nil {
if o == nil || IsNil(o.DriveAlias) {
var ret string
return ret
}
@@ -421,7 +424,7 @@ func (o *Drive) GetDriveAlias() string {
// GetDriveAliasOk returns a tuple with the DriveAlias field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetDriveAliasOk() (*string, bool) {
if o == nil || o.DriveAlias == nil {
if o == nil || IsNil(o.DriveAlias) {
return nil, false
}
return o.DriveAlias, true
@@ -429,7 +432,7 @@ func (o *Drive) GetDriveAliasOk() (*string, bool) {
// HasDriveAlias returns a boolean if a field has been set.
func (o *Drive) HasDriveAlias() bool {
if o != nil && o.DriveAlias != nil {
if o != nil && !IsNil(o.DriveAlias) {
return true
}
@@ -443,7 +446,7 @@ func (o *Drive) SetDriveAlias(v string) {
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *Drive) GetOwner() IdentitySet {
if o == nil || o.Owner == nil {
if o == nil || IsNil(o.Owner) {
var ret IdentitySet
return ret
}
@@ -453,7 +456,7 @@ func (o *Drive) GetOwner() IdentitySet {
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetOwnerOk() (*IdentitySet, bool) {
if o == nil || o.Owner == nil {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
@@ -461,7 +464,7 @@ func (o *Drive) GetOwnerOk() (*IdentitySet, bool) {
// HasOwner returns a boolean if a field has been set.
func (o *Drive) HasOwner() bool {
if o != nil && o.Owner != nil {
if o != nil && !IsNil(o.Owner) {
return true
}
@@ -475,7 +478,7 @@ func (o *Drive) SetOwner(v IdentitySet) {
// GetQuota returns the Quota field value if set, zero value otherwise.
func (o *Drive) GetQuota() Quota {
if o == nil || o.Quota == nil {
if o == nil || IsNil(o.Quota) {
var ret Quota
return ret
}
@@ -485,7 +488,7 @@ func (o *Drive) GetQuota() Quota {
// GetQuotaOk returns a tuple with the Quota field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetQuotaOk() (*Quota, bool) {
if o == nil || o.Quota == nil {
if o == nil || IsNil(o.Quota) {
return nil, false
}
return o.Quota, true
@@ -493,7 +496,7 @@ func (o *Drive) GetQuotaOk() (*Quota, bool) {
// HasQuota returns a boolean if a field has been set.
func (o *Drive) HasQuota() bool {
if o != nil && o.Quota != nil {
if o != nil && !IsNil(o.Quota) {
return true
}
@@ -507,7 +510,7 @@ func (o *Drive) SetQuota(v Quota) {
// GetItems returns the Items field value if set, zero value otherwise.
func (o *Drive) GetItems() []DriveItem {
if o == nil || o.Items == nil {
if o == nil || IsNil(o.Items) {
var ret []DriveItem
return ret
}
@@ -517,7 +520,7 @@ func (o *Drive) GetItems() []DriveItem {
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetItemsOk() ([]DriveItem, bool) {
if o == nil || o.Items == nil {
if o == nil || IsNil(o.Items) {
return nil, false
}
return o.Items, true
@@ -525,7 +528,7 @@ func (o *Drive) GetItemsOk() ([]DriveItem, bool) {
// HasItems returns a boolean if a field has been set.
func (o *Drive) HasItems() bool {
if o != nil && o.Items != nil {
if o != nil && !IsNil(o.Items) {
return true
}
@@ -539,7 +542,7 @@ func (o *Drive) SetItems(v []DriveItem) {
// GetRoot returns the Root field value if set, zero value otherwise.
func (o *Drive) GetRoot() DriveItem {
if o == nil || o.Root == nil {
if o == nil || IsNil(o.Root) {
var ret DriveItem
return ret
}
@@ -549,7 +552,7 @@ func (o *Drive) GetRoot() DriveItem {
// GetRootOk returns a tuple with the Root field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetRootOk() (*DriveItem, bool) {
if o == nil || o.Root == nil {
if o == nil || IsNil(o.Root) {
return nil, false
}
return o.Root, true
@@ -557,7 +560,7 @@ func (o *Drive) GetRootOk() (*DriveItem, bool) {
// HasRoot returns a boolean if a field has been set.
func (o *Drive) HasRoot() bool {
if o != nil && o.Root != nil {
if o != nil && !IsNil(o.Root) {
return true
}
@@ -571,7 +574,7 @@ func (o *Drive) SetRoot(v DriveItem) {
// GetSpecial returns the Special field value if set, zero value otherwise.
func (o *Drive) GetSpecial() []DriveItem {
if o == nil || o.Special == nil {
if o == nil || IsNil(o.Special) {
var ret []DriveItem
return ret
}
@@ -581,7 +584,7 @@ func (o *Drive) GetSpecial() []DriveItem {
// GetSpecialOk returns a tuple with the Special field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Drive) GetSpecialOk() ([]DriveItem, bool) {
if o == nil || o.Special == nil {
if o == nil || IsNil(o.Special) {
return nil, false
}
return o.Special, true
@@ -589,7 +592,7 @@ func (o *Drive) GetSpecialOk() ([]DriveItem, bool) {
// HasSpecial returns a boolean if a field has been set.
func (o *Drive) HasSpecial() bool {
if o != nil && o.Special != nil {
if o != nil && !IsNil(o.Special) {
return true
}
@@ -602,61 +605,67 @@ func (o *Drive) SetSpecial(v []DriveItem) {
}
func (o Drive) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.CreatedBy != nil {
toSerialize["createdBy"] = o.CreatedBy
}
if o.CreatedDateTime != nil {
toSerialize["createdDateTime"] = o.CreatedDateTime
}
if o.Description != nil {
toSerialize["description"] = o.Description
}
if o.ETag != nil {
toSerialize["eTag"] = o.ETag
}
if o.LastModifiedBy != nil {
toSerialize["lastModifiedBy"] = o.LastModifiedBy
}
if o.LastModifiedDateTime != nil {
toSerialize["lastModifiedDateTime"] = o.LastModifiedDateTime
}
if true {
toSerialize["name"] = o.Name
}
if o.ParentReference != nil {
toSerialize["parentReference"] = o.ParentReference
}
if o.WebUrl != nil {
toSerialize["webUrl"] = o.WebUrl
}
if o.DriveType != nil {
toSerialize["driveType"] = o.DriveType
}
if o.DriveAlias != nil {
toSerialize["driveAlias"] = o.DriveAlias
}
if o.Owner != nil {
toSerialize["owner"] = o.Owner
}
if o.Quota != nil {
toSerialize["quota"] = o.Quota
}
if o.Items != nil {
toSerialize["items"] = o.Items
}
if o.Root != nil {
toSerialize["root"] = o.Root
}
if o.Special != nil {
toSerialize["special"] = o.Special
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Drive) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.CreatedBy) {
toSerialize["createdBy"] = o.CreatedBy
}
if !IsNil(o.CreatedDateTime) {
toSerialize["createdDateTime"] = o.CreatedDateTime
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.ETag) {
toSerialize["eTag"] = o.ETag
}
if !IsNil(o.LastModifiedBy) {
toSerialize["lastModifiedBy"] = o.LastModifiedBy
}
if !IsNil(o.LastModifiedDateTime) {
toSerialize["lastModifiedDateTime"] = o.LastModifiedDateTime
}
toSerialize["name"] = o.Name
if !IsNil(o.ParentReference) {
toSerialize["parentReference"] = o.ParentReference
}
if !IsNil(o.WebUrl) {
toSerialize["webUrl"] = o.WebUrl
}
if !IsNil(o.DriveType) {
toSerialize["driveType"] = o.DriveType
}
if !IsNil(o.DriveAlias) {
toSerialize["driveAlias"] = o.DriveAlias
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.Quota) {
toSerialize["quota"] = o.Quota
}
if !IsNil(o.Items) {
toSerialize["items"] = o.Items
}
if !IsNil(o.Root) {
toSerialize["root"] = o.Root
}
if !IsNil(o.Special) {
toSerialize["special"] = o.Special
}
return toSerialize, nil
}
type NullableDrive struct {
value *Drive
isSet bool

View File

@@ -15,7 +15,10 @@ import (
"time"
)
// DriveItem Reprensents a resource inside a drive. Read-only.
// checks if the DriveItem type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DriveItem{}
// DriveItem Represents a resource inside a drive. Read-only.
type DriveItem struct {
// Read-only.
Id *string `json:"id,omitempty"`
@@ -43,6 +46,8 @@ type DriveItem struct {
FileSystemInfo *FileSystemInfo `json:"fileSystemInfo,omitempty"`
Folder *Folder `json:"folder,omitempty"`
Image *Image `json:"image,omitempty"`
Photo *Photo `json:"photo,omitempty"`
Location *GeoCoordinates `json:"location,omitempty"`
// If this property is non-null, it indicates that the driveItem is the top-most driveItem in the drive.
Root map[string]interface{} `json:"root,omitempty"`
Trash *Trash `json:"trash,omitempty"`
@@ -56,6 +61,7 @@ type DriveItem struct {
Children []DriveItem `json:"children,omitempty"`
// The set of permissions for the item. Read-only. Nullable.
Permissions []Permission `json:"permissions,omitempty"`
Audio *Audio `json:"audio,omitempty"`
}
// NewDriveItem instantiates a new DriveItem object
@@ -77,7 +83,7 @@ func NewDriveItemWithDefaults() *DriveItem {
// GetId returns the Id field value if set, zero value otherwise.
func (o *DriveItem) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -87,7 +93,7 @@ func (o *DriveItem) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -95,7 +101,7 @@ func (o *DriveItem) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *DriveItem) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -109,7 +115,7 @@ func (o *DriveItem) SetId(v string) {
// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise.
func (o *DriveItem) GetCreatedBy() IdentitySet {
if o == nil || o.CreatedBy == nil {
if o == nil || IsNil(o.CreatedBy) {
var ret IdentitySet
return ret
}
@@ -119,7 +125,7 @@ func (o *DriveItem) GetCreatedBy() IdentitySet {
// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetCreatedByOk() (*IdentitySet, bool) {
if o == nil || o.CreatedBy == nil {
if o == nil || IsNil(o.CreatedBy) {
return nil, false
}
return o.CreatedBy, true
@@ -127,7 +133,7 @@ func (o *DriveItem) GetCreatedByOk() (*IdentitySet, bool) {
// HasCreatedBy returns a boolean if a field has been set.
func (o *DriveItem) HasCreatedBy() bool {
if o != nil && o.CreatedBy != nil {
if o != nil && !IsNil(o.CreatedBy) {
return true
}
@@ -141,7 +147,7 @@ func (o *DriveItem) SetCreatedBy(v IdentitySet) {
// GetCreatedDateTime returns the CreatedDateTime field value if set, zero value otherwise.
func (o *DriveItem) GetCreatedDateTime() time.Time {
if o == nil || o.CreatedDateTime == nil {
if o == nil || IsNil(o.CreatedDateTime) {
var ret time.Time
return ret
}
@@ -151,7 +157,7 @@ func (o *DriveItem) GetCreatedDateTime() time.Time {
// GetCreatedDateTimeOk returns a tuple with the CreatedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetCreatedDateTimeOk() (*time.Time, bool) {
if o == nil || o.CreatedDateTime == nil {
if o == nil || IsNil(o.CreatedDateTime) {
return nil, false
}
return o.CreatedDateTime, true
@@ -159,7 +165,7 @@ func (o *DriveItem) GetCreatedDateTimeOk() (*time.Time, bool) {
// HasCreatedDateTime returns a boolean if a field has been set.
func (o *DriveItem) HasCreatedDateTime() bool {
if o != nil && o.CreatedDateTime != nil {
if o != nil && !IsNil(o.CreatedDateTime) {
return true
}
@@ -173,7 +179,7 @@ func (o *DriveItem) SetCreatedDateTime(v time.Time) {
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *DriveItem) GetDescription() string {
if o == nil || o.Description == nil {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
@@ -183,7 +189,7 @@ func (o *DriveItem) GetDescription() string {
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetDescriptionOk() (*string, bool) {
if o == nil || o.Description == nil {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
@@ -191,7 +197,7 @@ func (o *DriveItem) GetDescriptionOk() (*string, bool) {
// HasDescription returns a boolean if a field has been set.
func (o *DriveItem) HasDescription() bool {
if o != nil && o.Description != nil {
if o != nil && !IsNil(o.Description) {
return true
}
@@ -205,7 +211,7 @@ func (o *DriveItem) SetDescription(v string) {
// GetETag returns the ETag field value if set, zero value otherwise.
func (o *DriveItem) GetETag() string {
if o == nil || o.ETag == nil {
if o == nil || IsNil(o.ETag) {
var ret string
return ret
}
@@ -215,7 +221,7 @@ func (o *DriveItem) GetETag() string {
// GetETagOk returns a tuple with the ETag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetETagOk() (*string, bool) {
if o == nil || o.ETag == nil {
if o == nil || IsNil(o.ETag) {
return nil, false
}
return o.ETag, true
@@ -223,7 +229,7 @@ func (o *DriveItem) GetETagOk() (*string, bool) {
// HasETag returns a boolean if a field has been set.
func (o *DriveItem) HasETag() bool {
if o != nil && o.ETag != nil {
if o != nil && !IsNil(o.ETag) {
return true
}
@@ -237,7 +243,7 @@ func (o *DriveItem) SetETag(v string) {
// GetLastModifiedBy returns the LastModifiedBy field value if set, zero value otherwise.
func (o *DriveItem) GetLastModifiedBy() IdentitySet {
if o == nil || o.LastModifiedBy == nil {
if o == nil || IsNil(o.LastModifiedBy) {
var ret IdentitySet
return ret
}
@@ -247,7 +253,7 @@ func (o *DriveItem) GetLastModifiedBy() IdentitySet {
// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetLastModifiedByOk() (*IdentitySet, bool) {
if o == nil || o.LastModifiedBy == nil {
if o == nil || IsNil(o.LastModifiedBy) {
return nil, false
}
return o.LastModifiedBy, true
@@ -255,7 +261,7 @@ func (o *DriveItem) GetLastModifiedByOk() (*IdentitySet, bool) {
// HasLastModifiedBy returns a boolean if a field has been set.
func (o *DriveItem) HasLastModifiedBy() bool {
if o != nil && o.LastModifiedBy != nil {
if o != nil && !IsNil(o.LastModifiedBy) {
return true
}
@@ -269,7 +275,7 @@ func (o *DriveItem) SetLastModifiedBy(v IdentitySet) {
// GetLastModifiedDateTime returns the LastModifiedDateTime field value if set, zero value otherwise.
func (o *DriveItem) GetLastModifiedDateTime() time.Time {
if o == nil || o.LastModifiedDateTime == nil {
if o == nil || IsNil(o.LastModifiedDateTime) {
var ret time.Time
return ret
}
@@ -279,7 +285,7 @@ func (o *DriveItem) GetLastModifiedDateTime() time.Time {
// GetLastModifiedDateTimeOk returns a tuple with the LastModifiedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetLastModifiedDateTimeOk() (*time.Time, bool) {
if o == nil || o.LastModifiedDateTime == nil {
if o == nil || IsNil(o.LastModifiedDateTime) {
return nil, false
}
return o.LastModifiedDateTime, true
@@ -287,7 +293,7 @@ func (o *DriveItem) GetLastModifiedDateTimeOk() (*time.Time, bool) {
// HasLastModifiedDateTime returns a boolean if a field has been set.
func (o *DriveItem) HasLastModifiedDateTime() bool {
if o != nil && o.LastModifiedDateTime != nil {
if o != nil && !IsNil(o.LastModifiedDateTime) {
return true
}
@@ -301,7 +307,7 @@ func (o *DriveItem) SetLastModifiedDateTime(v time.Time) {
// GetName returns the Name field value if set, zero value otherwise.
func (o *DriveItem) GetName() string {
if o == nil || o.Name == nil {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
@@ -311,7 +317,7 @@ func (o *DriveItem) GetName() string {
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
@@ -319,7 +325,7 @@ func (o *DriveItem) GetNameOk() (*string, bool) {
// HasName returns a boolean if a field has been set.
func (o *DriveItem) HasName() bool {
if o != nil && o.Name != nil {
if o != nil && !IsNil(o.Name) {
return true
}
@@ -333,7 +339,7 @@ func (o *DriveItem) SetName(v string) {
// GetParentReference returns the ParentReference field value if set, zero value otherwise.
func (o *DriveItem) GetParentReference() ItemReference {
if o == nil || o.ParentReference == nil {
if o == nil || IsNil(o.ParentReference) {
var ret ItemReference
return ret
}
@@ -343,7 +349,7 @@ func (o *DriveItem) GetParentReference() ItemReference {
// GetParentReferenceOk returns a tuple with the ParentReference field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetParentReferenceOk() (*ItemReference, bool) {
if o == nil || o.ParentReference == nil {
if o == nil || IsNil(o.ParentReference) {
return nil, false
}
return o.ParentReference, true
@@ -351,7 +357,7 @@ func (o *DriveItem) GetParentReferenceOk() (*ItemReference, bool) {
// HasParentReference returns a boolean if a field has been set.
func (o *DriveItem) HasParentReference() bool {
if o != nil && o.ParentReference != nil {
if o != nil && !IsNil(o.ParentReference) {
return true
}
@@ -365,7 +371,7 @@ func (o *DriveItem) SetParentReference(v ItemReference) {
// GetWebUrl returns the WebUrl field value if set, zero value otherwise.
func (o *DriveItem) GetWebUrl() string {
if o == nil || o.WebUrl == nil {
if o == nil || IsNil(o.WebUrl) {
var ret string
return ret
}
@@ -375,7 +381,7 @@ func (o *DriveItem) GetWebUrl() string {
// GetWebUrlOk returns a tuple with the WebUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetWebUrlOk() (*string, bool) {
if o == nil || o.WebUrl == nil {
if o == nil || IsNil(o.WebUrl) {
return nil, false
}
return o.WebUrl, true
@@ -383,7 +389,7 @@ func (o *DriveItem) GetWebUrlOk() (*string, bool) {
// HasWebUrl returns a boolean if a field has been set.
func (o *DriveItem) HasWebUrl() bool {
if o != nil && o.WebUrl != nil {
if o != nil && !IsNil(o.WebUrl) {
return true
}
@@ -397,7 +403,7 @@ func (o *DriveItem) SetWebUrl(v string) {
// GetContent returns the Content field value if set, zero value otherwise.
func (o *DriveItem) GetContent() string {
if o == nil || o.Content == nil {
if o == nil || IsNil(o.Content) {
var ret string
return ret
}
@@ -407,7 +413,7 @@ func (o *DriveItem) GetContent() string {
// GetContentOk returns a tuple with the Content field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetContentOk() (*string, bool) {
if o == nil || o.Content == nil {
if o == nil || IsNil(o.Content) {
return nil, false
}
return o.Content, true
@@ -415,7 +421,7 @@ func (o *DriveItem) GetContentOk() (*string, bool) {
// HasContent returns a boolean if a field has been set.
func (o *DriveItem) HasContent() bool {
if o != nil && o.Content != nil {
if o != nil && !IsNil(o.Content) {
return true
}
@@ -429,7 +435,7 @@ func (o *DriveItem) SetContent(v string) {
// GetCTag returns the CTag field value if set, zero value otherwise.
func (o *DriveItem) GetCTag() string {
if o == nil || o.CTag == nil {
if o == nil || IsNil(o.CTag) {
var ret string
return ret
}
@@ -439,7 +445,7 @@ func (o *DriveItem) GetCTag() string {
// GetCTagOk returns a tuple with the CTag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetCTagOk() (*string, bool) {
if o == nil || o.CTag == nil {
if o == nil || IsNil(o.CTag) {
return nil, false
}
return o.CTag, true
@@ -447,7 +453,7 @@ func (o *DriveItem) GetCTagOk() (*string, bool) {
// HasCTag returns a boolean if a field has been set.
func (o *DriveItem) HasCTag() bool {
if o != nil && o.CTag != nil {
if o != nil && !IsNil(o.CTag) {
return true
}
@@ -461,7 +467,7 @@ func (o *DriveItem) SetCTag(v string) {
// GetDeleted returns the Deleted field value if set, zero value otherwise.
func (o *DriveItem) GetDeleted() Deleted {
if o == nil || o.Deleted == nil {
if o == nil || IsNil(o.Deleted) {
var ret Deleted
return ret
}
@@ -471,7 +477,7 @@ func (o *DriveItem) GetDeleted() Deleted {
// GetDeletedOk returns a tuple with the Deleted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetDeletedOk() (*Deleted, bool) {
if o == nil || o.Deleted == nil {
if o == nil || IsNil(o.Deleted) {
return nil, false
}
return o.Deleted, true
@@ -479,7 +485,7 @@ func (o *DriveItem) GetDeletedOk() (*Deleted, bool) {
// HasDeleted returns a boolean if a field has been set.
func (o *DriveItem) HasDeleted() bool {
if o != nil && o.Deleted != nil {
if o != nil && !IsNil(o.Deleted) {
return true
}
@@ -493,7 +499,7 @@ func (o *DriveItem) SetDeleted(v Deleted) {
// GetFile returns the File field value if set, zero value otherwise.
func (o *DriveItem) GetFile() OpenGraphFile {
if o == nil || o.File == nil {
if o == nil || IsNil(o.File) {
var ret OpenGraphFile
return ret
}
@@ -503,7 +509,7 @@ func (o *DriveItem) GetFile() OpenGraphFile {
// GetFileOk returns a tuple with the File field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetFileOk() (*OpenGraphFile, bool) {
if o == nil || o.File == nil {
if o == nil || IsNil(o.File) {
return nil, false
}
return o.File, true
@@ -511,7 +517,7 @@ func (o *DriveItem) GetFileOk() (*OpenGraphFile, bool) {
// HasFile returns a boolean if a field has been set.
func (o *DriveItem) HasFile() bool {
if o != nil && o.File != nil {
if o != nil && !IsNil(o.File) {
return true
}
@@ -525,7 +531,7 @@ func (o *DriveItem) SetFile(v OpenGraphFile) {
// GetFileSystemInfo returns the FileSystemInfo field value if set, zero value otherwise.
func (o *DriveItem) GetFileSystemInfo() FileSystemInfo {
if o == nil || o.FileSystemInfo == nil {
if o == nil || IsNil(o.FileSystemInfo) {
var ret FileSystemInfo
return ret
}
@@ -535,7 +541,7 @@ func (o *DriveItem) GetFileSystemInfo() FileSystemInfo {
// GetFileSystemInfoOk returns a tuple with the FileSystemInfo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetFileSystemInfoOk() (*FileSystemInfo, bool) {
if o == nil || o.FileSystemInfo == nil {
if o == nil || IsNil(o.FileSystemInfo) {
return nil, false
}
return o.FileSystemInfo, true
@@ -543,7 +549,7 @@ func (o *DriveItem) GetFileSystemInfoOk() (*FileSystemInfo, bool) {
// HasFileSystemInfo returns a boolean if a field has been set.
func (o *DriveItem) HasFileSystemInfo() bool {
if o != nil && o.FileSystemInfo != nil {
if o != nil && !IsNil(o.FileSystemInfo) {
return true
}
@@ -557,7 +563,7 @@ func (o *DriveItem) SetFileSystemInfo(v FileSystemInfo) {
// GetFolder returns the Folder field value if set, zero value otherwise.
func (o *DriveItem) GetFolder() Folder {
if o == nil || o.Folder == nil {
if o == nil || IsNil(o.Folder) {
var ret Folder
return ret
}
@@ -567,7 +573,7 @@ func (o *DriveItem) GetFolder() Folder {
// GetFolderOk returns a tuple with the Folder field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetFolderOk() (*Folder, bool) {
if o == nil || o.Folder == nil {
if o == nil || IsNil(o.Folder) {
return nil, false
}
return o.Folder, true
@@ -575,7 +581,7 @@ func (o *DriveItem) GetFolderOk() (*Folder, bool) {
// HasFolder returns a boolean if a field has been set.
func (o *DriveItem) HasFolder() bool {
if o != nil && o.Folder != nil {
if o != nil && !IsNil(o.Folder) {
return true
}
@@ -589,7 +595,7 @@ func (o *DriveItem) SetFolder(v Folder) {
// GetImage returns the Image field value if set, zero value otherwise.
func (o *DriveItem) GetImage() Image {
if o == nil || o.Image == nil {
if o == nil || IsNil(o.Image) {
var ret Image
return ret
}
@@ -599,7 +605,7 @@ func (o *DriveItem) GetImage() Image {
// GetImageOk returns a tuple with the Image field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetImageOk() (*Image, bool) {
if o == nil || o.Image == nil {
if o == nil || IsNil(o.Image) {
return nil, false
}
return o.Image, true
@@ -607,7 +613,7 @@ func (o *DriveItem) GetImageOk() (*Image, bool) {
// HasImage returns a boolean if a field has been set.
func (o *DriveItem) HasImage() bool {
if o != nil && o.Image != nil {
if o != nil && !IsNil(o.Image) {
return true
}
@@ -619,9 +625,73 @@ func (o *DriveItem) SetImage(v Image) {
o.Image = &v
}
// GetPhoto returns the Photo field value if set, zero value otherwise.
func (o *DriveItem) GetPhoto() Photo {
if o == nil || IsNil(o.Photo) {
var ret Photo
return ret
}
return *o.Photo
}
// GetPhotoOk returns a tuple with the Photo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetPhotoOk() (*Photo, bool) {
if o == nil || IsNil(o.Photo) {
return nil, false
}
return o.Photo, true
}
// HasPhoto returns a boolean if a field has been set.
func (o *DriveItem) HasPhoto() bool {
if o != nil && !IsNil(o.Photo) {
return true
}
return false
}
// SetPhoto gets a reference to the given Photo and assigns it to the Photo field.
func (o *DriveItem) SetPhoto(v Photo) {
o.Photo = &v
}
// GetLocation returns the Location field value if set, zero value otherwise.
func (o *DriveItem) GetLocation() GeoCoordinates {
if o == nil || IsNil(o.Location) {
var ret GeoCoordinates
return ret
}
return *o.Location
}
// GetLocationOk returns a tuple with the Location field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetLocationOk() (*GeoCoordinates, bool) {
if o == nil || IsNil(o.Location) {
return nil, false
}
return o.Location, true
}
// HasLocation returns a boolean if a field has been set.
func (o *DriveItem) HasLocation() bool {
if o != nil && !IsNil(o.Location) {
return true
}
return false
}
// SetLocation gets a reference to the given GeoCoordinates and assigns it to the Location field.
func (o *DriveItem) SetLocation(v GeoCoordinates) {
o.Location = &v
}
// GetRoot returns the Root field value if set, zero value otherwise.
func (o *DriveItem) GetRoot() map[string]interface{} {
if o == nil || o.Root == nil {
if o == nil || IsNil(o.Root) {
var ret map[string]interface{}
return ret
}
@@ -631,15 +701,15 @@ func (o *DriveItem) GetRoot() map[string]interface{} {
// GetRootOk returns a tuple with the Root field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetRootOk() (map[string]interface{}, bool) {
if o == nil || o.Root == nil {
return nil, false
if o == nil || IsNil(o.Root) {
return map[string]interface{}{}, false
}
return o.Root, true
}
// HasRoot returns a boolean if a field has been set.
func (o *DriveItem) HasRoot() bool {
if o != nil && o.Root != nil {
if o != nil && !IsNil(o.Root) {
return true
}
@@ -653,7 +723,7 @@ func (o *DriveItem) SetRoot(v map[string]interface{}) {
// GetTrash returns the Trash field value if set, zero value otherwise.
func (o *DriveItem) GetTrash() Trash {
if o == nil || o.Trash == nil {
if o == nil || IsNil(o.Trash) {
var ret Trash
return ret
}
@@ -663,7 +733,7 @@ func (o *DriveItem) GetTrash() Trash {
// GetTrashOk returns a tuple with the Trash field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetTrashOk() (*Trash, bool) {
if o == nil || o.Trash == nil {
if o == nil || IsNil(o.Trash) {
return nil, false
}
return o.Trash, true
@@ -671,7 +741,7 @@ func (o *DriveItem) GetTrashOk() (*Trash, bool) {
// HasTrash returns a boolean if a field has been set.
func (o *DriveItem) HasTrash() bool {
if o != nil && o.Trash != nil {
if o != nil && !IsNil(o.Trash) {
return true
}
@@ -685,7 +755,7 @@ func (o *DriveItem) SetTrash(v Trash) {
// GetSpecialFolder returns the SpecialFolder field value if set, zero value otherwise.
func (o *DriveItem) GetSpecialFolder() SpecialFolder {
if o == nil || o.SpecialFolder == nil {
if o == nil || IsNil(o.SpecialFolder) {
var ret SpecialFolder
return ret
}
@@ -695,7 +765,7 @@ func (o *DriveItem) GetSpecialFolder() SpecialFolder {
// GetSpecialFolderOk returns a tuple with the SpecialFolder field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetSpecialFolderOk() (*SpecialFolder, bool) {
if o == nil || o.SpecialFolder == nil {
if o == nil || IsNil(o.SpecialFolder) {
return nil, false
}
return o.SpecialFolder, true
@@ -703,7 +773,7 @@ func (o *DriveItem) GetSpecialFolderOk() (*SpecialFolder, bool) {
// HasSpecialFolder returns a boolean if a field has been set.
func (o *DriveItem) HasSpecialFolder() bool {
if o != nil && o.SpecialFolder != nil {
if o != nil && !IsNil(o.SpecialFolder) {
return true
}
@@ -717,7 +787,7 @@ func (o *DriveItem) SetSpecialFolder(v SpecialFolder) {
// GetRemoteItem returns the RemoteItem field value if set, zero value otherwise.
func (o *DriveItem) GetRemoteItem() RemoteItem {
if o == nil || o.RemoteItem == nil {
if o == nil || IsNil(o.RemoteItem) {
var ret RemoteItem
return ret
}
@@ -727,7 +797,7 @@ func (o *DriveItem) GetRemoteItem() RemoteItem {
// GetRemoteItemOk returns a tuple with the RemoteItem field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetRemoteItemOk() (*RemoteItem, bool) {
if o == nil || o.RemoteItem == nil {
if o == nil || IsNil(o.RemoteItem) {
return nil, false
}
return o.RemoteItem, true
@@ -735,7 +805,7 @@ func (o *DriveItem) GetRemoteItemOk() (*RemoteItem, bool) {
// HasRemoteItem returns a boolean if a field has been set.
func (o *DriveItem) HasRemoteItem() bool {
if o != nil && o.RemoteItem != nil {
if o != nil && !IsNil(o.RemoteItem) {
return true
}
@@ -749,7 +819,7 @@ func (o *DriveItem) SetRemoteItem(v RemoteItem) {
// GetSize returns the Size field value if set, zero value otherwise.
func (o *DriveItem) GetSize() int64 {
if o == nil || o.Size == nil {
if o == nil || IsNil(o.Size) {
var ret int64
return ret
}
@@ -759,7 +829,7 @@ func (o *DriveItem) GetSize() int64 {
// 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 *DriveItem) GetSizeOk() (*int64, bool) {
if o == nil || o.Size == nil {
if o == nil || IsNil(o.Size) {
return nil, false
}
return o.Size, true
@@ -767,7 +837,7 @@ func (o *DriveItem) GetSizeOk() (*int64, bool) {
// HasSize returns a boolean if a field has been set.
func (o *DriveItem) HasSize() bool {
if o != nil && o.Size != nil {
if o != nil && !IsNil(o.Size) {
return true
}
@@ -781,7 +851,7 @@ func (o *DriveItem) SetSize(v int64) {
// GetWebDavUrl returns the WebDavUrl field value if set, zero value otherwise.
func (o *DriveItem) GetWebDavUrl() string {
if o == nil || o.WebDavUrl == nil {
if o == nil || IsNil(o.WebDavUrl) {
var ret string
return ret
}
@@ -791,7 +861,7 @@ func (o *DriveItem) GetWebDavUrl() string {
// GetWebDavUrlOk returns a tuple with the WebDavUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetWebDavUrlOk() (*string, bool) {
if o == nil || o.WebDavUrl == nil {
if o == nil || IsNil(o.WebDavUrl) {
return nil, false
}
return o.WebDavUrl, true
@@ -799,7 +869,7 @@ func (o *DriveItem) GetWebDavUrlOk() (*string, bool) {
// HasWebDavUrl returns a boolean if a field has been set.
func (o *DriveItem) HasWebDavUrl() bool {
if o != nil && o.WebDavUrl != nil {
if o != nil && !IsNil(o.WebDavUrl) {
return true
}
@@ -813,7 +883,7 @@ func (o *DriveItem) SetWebDavUrl(v string) {
// GetChildren returns the Children field value if set, zero value otherwise.
func (o *DriveItem) GetChildren() []DriveItem {
if o == nil || o.Children == nil {
if o == nil || IsNil(o.Children) {
var ret []DriveItem
return ret
}
@@ -823,7 +893,7 @@ func (o *DriveItem) GetChildren() []DriveItem {
// GetChildrenOk returns a tuple with the Children field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetChildrenOk() ([]DriveItem, bool) {
if o == nil || o.Children == nil {
if o == nil || IsNil(o.Children) {
return nil, false
}
return o.Children, true
@@ -831,7 +901,7 @@ func (o *DriveItem) GetChildrenOk() ([]DriveItem, bool) {
// HasChildren returns a boolean if a field has been set.
func (o *DriveItem) HasChildren() bool {
if o != nil && o.Children != nil {
if o != nil && !IsNil(o.Children) {
return true
}
@@ -845,7 +915,7 @@ func (o *DriveItem) SetChildren(v []DriveItem) {
// GetPermissions returns the Permissions field value if set, zero value otherwise.
func (o *DriveItem) GetPermissions() []Permission {
if o == nil || o.Permissions == nil {
if o == nil || IsNil(o.Permissions) {
var ret []Permission
return ret
}
@@ -855,7 +925,7 @@ func (o *DriveItem) GetPermissions() []Permission {
// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetPermissionsOk() ([]Permission, bool) {
if o == nil || o.Permissions == nil {
if o == nil || IsNil(o.Permissions) {
return nil, false
}
return o.Permissions, true
@@ -863,7 +933,7 @@ func (o *DriveItem) GetPermissionsOk() ([]Permission, bool) {
// HasPermissions returns a boolean if a field has been set.
func (o *DriveItem) HasPermissions() bool {
if o != nil && o.Permissions != nil {
if o != nil && !IsNil(o.Permissions) {
return true
}
@@ -875,86 +945,135 @@ func (o *DriveItem) SetPermissions(v []Permission) {
o.Permissions = v
}
// GetAudio returns the Audio field value if set, zero value otherwise.
func (o *DriveItem) GetAudio() Audio {
if o == nil || IsNil(o.Audio) {
var ret Audio
return ret
}
return *o.Audio
}
// GetAudioOk returns a tuple with the Audio field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetAudioOk() (*Audio, bool) {
if o == nil || IsNil(o.Audio) {
return nil, false
}
return o.Audio, true
}
// HasAudio returns a boolean if a field has been set.
func (o *DriveItem) HasAudio() bool {
if o != nil && !IsNil(o.Audio) {
return true
}
return false
}
// SetAudio gets a reference to the given Audio and assigns it to the Audio field.
func (o *DriveItem) SetAudio(v Audio) {
o.Audio = &v
}
func (o DriveItem) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.CreatedBy != nil {
toSerialize["createdBy"] = o.CreatedBy
}
if o.CreatedDateTime != nil {
toSerialize["createdDateTime"] = o.CreatedDateTime
}
if o.Description != nil {
toSerialize["description"] = o.Description
}
if o.ETag != nil {
toSerialize["eTag"] = o.ETag
}
if o.LastModifiedBy != nil {
toSerialize["lastModifiedBy"] = o.LastModifiedBy
}
if o.LastModifiedDateTime != nil {
toSerialize["lastModifiedDateTime"] = o.LastModifiedDateTime
}
if o.Name != nil {
toSerialize["name"] = o.Name
}
if o.ParentReference != nil {
toSerialize["parentReference"] = o.ParentReference
}
if o.WebUrl != nil {
toSerialize["webUrl"] = o.WebUrl
}
if o.Content != nil {
toSerialize["content"] = o.Content
}
if o.CTag != nil {
toSerialize["cTag"] = o.CTag
}
if o.Deleted != nil {
toSerialize["deleted"] = o.Deleted
}
if o.File != nil {
toSerialize["file"] = o.File
}
if o.FileSystemInfo != nil {
toSerialize["fileSystemInfo"] = o.FileSystemInfo
}
if o.Folder != nil {
toSerialize["folder"] = o.Folder
}
if o.Image != nil {
toSerialize["image"] = o.Image
}
if o.Root != nil {
toSerialize["root"] = o.Root
}
if o.Trash != nil {
toSerialize["trash"] = o.Trash
}
if o.SpecialFolder != nil {
toSerialize["specialFolder"] = o.SpecialFolder
}
if o.RemoteItem != nil {
toSerialize["remoteItem"] = o.RemoteItem
}
if o.Size != nil {
toSerialize["size"] = o.Size
}
if o.WebDavUrl != nil {
toSerialize["webDavUrl"] = o.WebDavUrl
}
if o.Children != nil {
toSerialize["children"] = o.Children
}
if o.Permissions != nil {
toSerialize["permissions"] = o.Permissions
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DriveItem) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.CreatedBy) {
toSerialize["createdBy"] = o.CreatedBy
}
if !IsNil(o.CreatedDateTime) {
toSerialize["createdDateTime"] = o.CreatedDateTime
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.ETag) {
toSerialize["eTag"] = o.ETag
}
if !IsNil(o.LastModifiedBy) {
toSerialize["lastModifiedBy"] = o.LastModifiedBy
}
if !IsNil(o.LastModifiedDateTime) {
toSerialize["lastModifiedDateTime"] = o.LastModifiedDateTime
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.ParentReference) {
toSerialize["parentReference"] = o.ParentReference
}
if !IsNil(o.WebUrl) {
toSerialize["webUrl"] = o.WebUrl
}
if !IsNil(o.Content) {
toSerialize["content"] = o.Content
}
if !IsNil(o.CTag) {
toSerialize["cTag"] = o.CTag
}
if !IsNil(o.Deleted) {
toSerialize["deleted"] = o.Deleted
}
if !IsNil(o.File) {
toSerialize["file"] = o.File
}
if !IsNil(o.FileSystemInfo) {
toSerialize["fileSystemInfo"] = o.FileSystemInfo
}
if !IsNil(o.Folder) {
toSerialize["folder"] = o.Folder
}
if !IsNil(o.Image) {
toSerialize["image"] = o.Image
}
if !IsNil(o.Photo) {
toSerialize["photo"] = o.Photo
}
if !IsNil(o.Location) {
toSerialize["location"] = o.Location
}
if !IsNil(o.Root) {
toSerialize["root"] = o.Root
}
if !IsNil(o.Trash) {
toSerialize["trash"] = o.Trash
}
if !IsNil(o.SpecialFolder) {
toSerialize["specialFolder"] = o.SpecialFolder
}
if !IsNil(o.RemoteItem) {
toSerialize["remoteItem"] = o.RemoteItem
}
if !IsNil(o.Size) {
toSerialize["size"] = o.Size
}
if !IsNil(o.WebDavUrl) {
toSerialize["webDavUrl"] = o.WebDavUrl
}
if !IsNil(o.Children) {
toSerialize["children"] = o.Children
}
if !IsNil(o.Permissions) {
toSerialize["permissions"] = o.Permissions
}
if !IsNil(o.Audio) {
toSerialize["audio"] = o.Audio
}
return toSerialize, nil
}
type NullableDriveItem struct {
value *DriveItem
isSet bool

View File

@@ -0,0 +1,236 @@
/*
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"
"time"
)
// checks if the DriveItemCreateLink type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DriveItemCreateLink{}
// DriveItemCreateLink struct for DriveItemCreateLink
type DriveItemCreateLink struct {
Type *SharingLinkType `json:"type,omitempty"`
// Optional. A String with format of yyyy-MM-ddTHH:mm:ssZ of DateTime indicates the expiration time of the permission.
ExpirationDateTime *time.Time `json:"expirationDateTime,omitempty"`
// Optional.The password of the sharing link that is set by the creator.
Password *string `json:"password,omitempty"`
// Provides a user-visible display name of the link. Optional. Libregraph only.
DisplayName *string `json:"displayName,omitempty"`
}
// NewDriveItemCreateLink instantiates a new DriveItemCreateLink 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 NewDriveItemCreateLink() *DriveItemCreateLink {
this := DriveItemCreateLink{}
return &this
}
// NewDriveItemCreateLinkWithDefaults instantiates a new DriveItemCreateLink 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 NewDriveItemCreateLinkWithDefaults() *DriveItemCreateLink {
this := DriveItemCreateLink{}
return &this
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *DriveItemCreateLink) GetType() SharingLinkType {
if o == nil || IsNil(o.Type) {
var ret SharingLinkType
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItemCreateLink) GetTypeOk() (*SharingLinkType, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *DriveItemCreateLink) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given SharingLinkType and assigns it to the Type field.
func (o *DriveItemCreateLink) SetType(v SharingLinkType) {
o.Type = &v
}
// GetExpirationDateTime returns the ExpirationDateTime field value if set, zero value otherwise.
func (o *DriveItemCreateLink) GetExpirationDateTime() time.Time {
if o == nil || IsNil(o.ExpirationDateTime) {
var ret time.Time
return ret
}
return *o.ExpirationDateTime
}
// GetExpirationDateTimeOk returns a tuple with the ExpirationDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItemCreateLink) GetExpirationDateTimeOk() (*time.Time, bool) {
if o == nil || IsNil(o.ExpirationDateTime) {
return nil, false
}
return o.ExpirationDateTime, true
}
// HasExpirationDateTime returns a boolean if a field has been set.
func (o *DriveItemCreateLink) HasExpirationDateTime() bool {
if o != nil && !IsNil(o.ExpirationDateTime) {
return true
}
return false
}
// SetExpirationDateTime gets a reference to the given time.Time and assigns it to the ExpirationDateTime field.
func (o *DriveItemCreateLink) SetExpirationDateTime(v time.Time) {
o.ExpirationDateTime = &v
}
// GetPassword returns the Password field value if set, zero value otherwise.
func (o *DriveItemCreateLink) GetPassword() string {
if o == nil || IsNil(o.Password) {
var ret string
return ret
}
return *o.Password
}
// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItemCreateLink) GetPasswordOk() (*string, bool) {
if o == nil || IsNil(o.Password) {
return nil, false
}
return o.Password, true
}
// HasPassword returns a boolean if a field has been set.
func (o *DriveItemCreateLink) HasPassword() bool {
if o != nil && !IsNil(o.Password) {
return true
}
return false
}
// SetPassword gets a reference to the given string and assigns it to the Password field.
func (o *DriveItemCreateLink) SetPassword(v string) {
o.Password = &v
}
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *DriveItemCreateLink) GetDisplayName() string {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
return *o.DisplayName
}
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItemCreateLink) GetDisplayNameOk() (*string, bool) {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
}
// HasDisplayName returns a boolean if a field has been set.
func (o *DriveItemCreateLink) HasDisplayName() bool {
if o != nil && !IsNil(o.DisplayName) {
return true
}
return false
}
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
func (o *DriveItemCreateLink) SetDisplayName(v string) {
o.DisplayName = &v
}
func (o DriveItemCreateLink) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DriveItemCreateLink) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.ExpirationDateTime) {
toSerialize["expirationDateTime"] = o.ExpirationDateTime
}
if !IsNil(o.Password) {
toSerialize["password"] = o.Password
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
return toSerialize, nil
}
type NullableDriveItemCreateLink struct {
value *DriveItemCreateLink
isSet bool
}
func (v NullableDriveItemCreateLink) Get() *DriveItemCreateLink {
return v.value
}
func (v *NullableDriveItemCreateLink) Set(val *DriveItemCreateLink) {
v.value = val
v.isSet = true
}
func (v NullableDriveItemCreateLink) IsSet() bool {
return v.isSet
}
func (v *NullableDriveItemCreateLink) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDriveItemCreateLink(val *DriveItemCreateLink) *NullableDriveItemCreateLink {
return &NullableDriveItemCreateLink{value: val, isSet: true}
}
func (v NullableDriveItemCreateLink) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDriveItemCreateLink) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -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.4
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package libregraph
import (
"encoding/json"
"time"
)
// checks if the DriveItemInvite type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DriveItemInvite{}
// DriveItemInvite struct for DriveItemInvite
type DriveItemInvite struct {
// A collection of recipients who will receive access and the sharing invitation. Currently, only internal users or gorups are supported.
Recipients []DriveRecipient `json:"recipients,omitempty"`
// Specifies the roles that are to be granted to the recipients of the sharing invitation.
Roles []string `json:"roles,omitempty"`
// Specifies the actions that are to be granted to the recipients of the sharing invitation, in effect creating a custom role.
LibreGraphPermissionsActions []string `json:"@libre.graph.permissions.actions,omitempty"`
// Specifies the dateTime after which the permission expires.
ExpirationDateTime *time.Time `json:"expirationDateTime,omitempty"`
}
// NewDriveItemInvite instantiates a new DriveItemInvite 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 NewDriveItemInvite() *DriveItemInvite {
this := DriveItemInvite{}
return &this
}
// NewDriveItemInviteWithDefaults instantiates a new DriveItemInvite 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 NewDriveItemInviteWithDefaults() *DriveItemInvite {
this := DriveItemInvite{}
return &this
}
// GetRecipients returns the Recipients field value if set, zero value otherwise.
func (o *DriveItemInvite) GetRecipients() []DriveRecipient {
if o == nil || IsNil(o.Recipients) {
var ret []DriveRecipient
return ret
}
return o.Recipients
}
// GetRecipientsOk returns a tuple with the Recipients field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItemInvite) GetRecipientsOk() ([]DriveRecipient, bool) {
if o == nil || IsNil(o.Recipients) {
return nil, false
}
return o.Recipients, true
}
// HasRecipients returns a boolean if a field has been set.
func (o *DriveItemInvite) HasRecipients() bool {
if o != nil && !IsNil(o.Recipients) {
return true
}
return false
}
// SetRecipients gets a reference to the given []DriveRecipient and assigns it to the Recipients field.
func (o *DriveItemInvite) SetRecipients(v []DriveRecipient) {
o.Recipients = v
}
// GetRoles returns the Roles field value if set, zero value otherwise.
func (o *DriveItemInvite) GetRoles() []string {
if o == nil || IsNil(o.Roles) {
var ret []string
return ret
}
return o.Roles
}
// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItemInvite) GetRolesOk() ([]string, bool) {
if o == nil || IsNil(o.Roles) {
return nil, false
}
return o.Roles, true
}
// HasRoles returns a boolean if a field has been set.
func (o *DriveItemInvite) HasRoles() bool {
if o != nil && !IsNil(o.Roles) {
return true
}
return false
}
// SetRoles gets a reference to the given []string and assigns it to the Roles field.
func (o *DriveItemInvite) SetRoles(v []string) {
o.Roles = v
}
// GetLibreGraphPermissionsActions returns the LibreGraphPermissionsActions field value if set, zero value otherwise.
func (o *DriveItemInvite) GetLibreGraphPermissionsActions() []string {
if o == nil || IsNil(o.LibreGraphPermissionsActions) {
var ret []string
return ret
}
return o.LibreGraphPermissionsActions
}
// GetLibreGraphPermissionsActionsOk returns a tuple with the LibreGraphPermissionsActions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItemInvite) GetLibreGraphPermissionsActionsOk() ([]string, bool) {
if o == nil || IsNil(o.LibreGraphPermissionsActions) {
return nil, false
}
return o.LibreGraphPermissionsActions, true
}
// HasLibreGraphPermissionsActions returns a boolean if a field has been set.
func (o *DriveItemInvite) HasLibreGraphPermissionsActions() bool {
if o != nil && !IsNil(o.LibreGraphPermissionsActions) {
return true
}
return false
}
// SetLibreGraphPermissionsActions gets a reference to the given []string and assigns it to the LibreGraphPermissionsActions field.
func (o *DriveItemInvite) SetLibreGraphPermissionsActions(v []string) {
o.LibreGraphPermissionsActions = v
}
// GetExpirationDateTime returns the ExpirationDateTime field value if set, zero value otherwise.
func (o *DriveItemInvite) GetExpirationDateTime() time.Time {
if o == nil || IsNil(o.ExpirationDateTime) {
var ret time.Time
return ret
}
return *o.ExpirationDateTime
}
// GetExpirationDateTimeOk returns a tuple with the ExpirationDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItemInvite) GetExpirationDateTimeOk() (*time.Time, bool) {
if o == nil || IsNil(o.ExpirationDateTime) {
return nil, false
}
return o.ExpirationDateTime, true
}
// HasExpirationDateTime returns a boolean if a field has been set.
func (o *DriveItemInvite) HasExpirationDateTime() bool {
if o != nil && !IsNil(o.ExpirationDateTime) {
return true
}
return false
}
// SetExpirationDateTime gets a reference to the given time.Time and assigns it to the ExpirationDateTime field.
func (o *DriveItemInvite) SetExpirationDateTime(v time.Time) {
o.ExpirationDateTime = &v
}
func (o DriveItemInvite) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DriveItemInvite) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Recipients) {
toSerialize["recipients"] = o.Recipients
}
if !IsNil(o.Roles) {
toSerialize["roles"] = o.Roles
}
if !IsNil(o.LibreGraphPermissionsActions) {
toSerialize["@libre.graph.permissions.actions"] = o.LibreGraphPermissionsActions
}
if !IsNil(o.ExpirationDateTime) {
toSerialize["expirationDateTime"] = o.ExpirationDateTime
}
return toSerialize, nil
}
type NullableDriveItemInvite struct {
value *DriveItemInvite
isSet bool
}
func (v NullableDriveItemInvite) Get() *DriveItemInvite {
return v.value
}
func (v *NullableDriveItemInvite) Set(val *DriveItemInvite) {
v.value = val
v.isSet = true
}
func (v NullableDriveItemInvite) IsSet() bool {
return v.isSet
}
func (v *NullableDriveItemInvite) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDriveItemInvite(val *DriveItemInvite) *NullableDriveItemInvite {
return &NullableDriveItemInvite{value: val, isSet: true}
}
func (v NullableDriveItemInvite) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDriveItemInvite) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -0,0 +1,166 @@
/*
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 DriveRecipient type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DriveRecipient{}
// DriveRecipient Represents a person, group, or other recipient to share a drive item with using the invite action. When using invite to add permissions, the `driveRecipient` object would specify the `email`, `alias`, or `objectId` of the recipient. Only one of these values is required; multiple values are not accepted.
type DriveRecipient struct {
// The unique identifier for the recipient in the directory.
ObjectId *string `json:"objectId,omitempty"`
// When the recipient is referenced by objectId this annotation is used to differentiate `user` and `group` recipients.
LibreGraphRecipientType *string `json:"@libre.graph.recipient.type,omitempty"`
}
// NewDriveRecipient instantiates a new DriveRecipient 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 NewDriveRecipient() *DriveRecipient {
this := DriveRecipient{}
var libreGraphRecipientType string = "user"
this.LibreGraphRecipientType = &libreGraphRecipientType
return &this
}
// NewDriveRecipientWithDefaults instantiates a new DriveRecipient 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 NewDriveRecipientWithDefaults() *DriveRecipient {
this := DriveRecipient{}
var libreGraphRecipientType string = "user"
this.LibreGraphRecipientType = &libreGraphRecipientType
return &this
}
// GetObjectId returns the ObjectId field value if set, zero value otherwise.
func (o *DriveRecipient) GetObjectId() string {
if o == nil || IsNil(o.ObjectId) {
var ret string
return ret
}
return *o.ObjectId
}
// GetObjectIdOk returns a tuple with the ObjectId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveRecipient) GetObjectIdOk() (*string, bool) {
if o == nil || IsNil(o.ObjectId) {
return nil, false
}
return o.ObjectId, true
}
// HasObjectId returns a boolean if a field has been set.
func (o *DriveRecipient) HasObjectId() bool {
if o != nil && !IsNil(o.ObjectId) {
return true
}
return false
}
// SetObjectId gets a reference to the given string and assigns it to the ObjectId field.
func (o *DriveRecipient) SetObjectId(v string) {
o.ObjectId = &v
}
// GetLibreGraphRecipientType returns the LibreGraphRecipientType field value if set, zero value otherwise.
func (o *DriveRecipient) GetLibreGraphRecipientType() string {
if o == nil || IsNil(o.LibreGraphRecipientType) {
var ret string
return ret
}
return *o.LibreGraphRecipientType
}
// GetLibreGraphRecipientTypeOk returns a tuple with the LibreGraphRecipientType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveRecipient) GetLibreGraphRecipientTypeOk() (*string, bool) {
if o == nil || IsNil(o.LibreGraphRecipientType) {
return nil, false
}
return o.LibreGraphRecipientType, true
}
// HasLibreGraphRecipientType returns a boolean if a field has been set.
func (o *DriveRecipient) HasLibreGraphRecipientType() bool {
if o != nil && !IsNil(o.LibreGraphRecipientType) {
return true
}
return false
}
// SetLibreGraphRecipientType gets a reference to the given string and assigns it to the LibreGraphRecipientType field.
func (o *DriveRecipient) SetLibreGraphRecipientType(v string) {
o.LibreGraphRecipientType = &v
}
func (o DriveRecipient) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DriveRecipient) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ObjectId) {
toSerialize["objectId"] = o.ObjectId
}
if !IsNil(o.LibreGraphRecipientType) {
toSerialize["@libre.graph.recipient.type"] = o.LibreGraphRecipientType
}
return toSerialize, nil
}
type NullableDriveRecipient struct {
value *DriveRecipient
isSet bool
}
func (v NullableDriveRecipient) Get() *DriveRecipient {
return v.value
}
func (v *NullableDriveRecipient) Set(val *DriveRecipient) {
v.value = val
v.isSet = true
}
func (v NullableDriveRecipient) IsSet() bool {
return v.isSet
}
func (v *NullableDriveRecipient) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDriveRecipient(val *DriveRecipient) *NullableDriveRecipient {
return &NullableDriveRecipient{value: val, isSet: true}
}
func (v NullableDriveRecipient) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDriveRecipient) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the EducationClass type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EducationClass{}
// EducationClass And extension of group representing a class or course
type EducationClass struct {
// Read-only.
@@ -53,7 +56,7 @@ func NewEducationClassWithDefaults() *EducationClass {
// GetId returns the Id field value if set, zero value otherwise.
func (o *EducationClass) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -63,7 +66,7 @@ func (o *EducationClass) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationClass) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -71,7 +74,7 @@ func (o *EducationClass) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *EducationClass) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -85,7 +88,7 @@ func (o *EducationClass) SetId(v string) {
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *EducationClass) GetDescription() string {
if o == nil || o.Description == nil {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
@@ -95,7 +98,7 @@ func (o *EducationClass) GetDescription() string {
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationClass) GetDescriptionOk() (*string, bool) {
if o == nil || o.Description == nil {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
@@ -103,7 +106,7 @@ func (o *EducationClass) GetDescriptionOk() (*string, bool) {
// HasDescription returns a boolean if a field has been set.
func (o *EducationClass) HasDescription() bool {
if o != nil && o.Description != nil {
if o != nil && !IsNil(o.Description) {
return true
}
@@ -141,7 +144,7 @@ func (o *EducationClass) SetDisplayName(v string) {
// GetMembers returns the Members field value if set, zero value otherwise.
func (o *EducationClass) GetMembers() []User {
if o == nil || o.Members == nil {
if o == nil || IsNil(o.Members) {
var ret []User
return ret
}
@@ -151,7 +154,7 @@ func (o *EducationClass) GetMembers() []User {
// GetMembersOk returns a tuple with the Members field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationClass) GetMembersOk() ([]User, bool) {
if o == nil || o.Members == nil {
if o == nil || IsNil(o.Members) {
return nil, false
}
return o.Members, true
@@ -159,7 +162,7 @@ func (o *EducationClass) GetMembersOk() ([]User, bool) {
// HasMembers returns a boolean if a field has been set.
func (o *EducationClass) HasMembers() bool {
if o != nil && o.Members != nil {
if o != nil && !IsNil(o.Members) {
return true
}
@@ -173,7 +176,7 @@ func (o *EducationClass) SetMembers(v []User) {
// GetMembersodataBind returns the MembersodataBind field value if set, zero value otherwise.
func (o *EducationClass) GetMembersodataBind() []string {
if o == nil || o.MembersodataBind == nil {
if o == nil || IsNil(o.MembersodataBind) {
var ret []string
return ret
}
@@ -183,7 +186,7 @@ func (o *EducationClass) GetMembersodataBind() []string {
// GetMembersodataBindOk returns a tuple with the MembersodataBind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationClass) GetMembersodataBindOk() ([]string, bool) {
if o == nil || o.MembersodataBind == nil {
if o == nil || IsNil(o.MembersodataBind) {
return nil, false
}
return o.MembersodataBind, true
@@ -191,7 +194,7 @@ func (o *EducationClass) GetMembersodataBindOk() ([]string, bool) {
// HasMembersodataBind returns a boolean if a field has been set.
func (o *EducationClass) HasMembersodataBind() bool {
if o != nil && o.MembersodataBind != nil {
if o != nil && !IsNil(o.MembersodataBind) {
return true
}
@@ -229,7 +232,7 @@ func (o *EducationClass) SetClassification(v string) {
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
func (o *EducationClass) GetExternalId() string {
if o == nil || o.ExternalId == nil {
if o == nil || IsNil(o.ExternalId) {
var ret string
return ret
}
@@ -239,7 +242,7 @@ func (o *EducationClass) GetExternalId() string {
// GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationClass) GetExternalIdOk() (*string, bool) {
if o == nil || o.ExternalId == nil {
if o == nil || IsNil(o.ExternalId) {
return nil, false
}
return o.ExternalId, true
@@ -247,7 +250,7 @@ func (o *EducationClass) GetExternalIdOk() (*string, bool) {
// HasExternalId returns a boolean if a field has been set.
func (o *EducationClass) HasExternalId() bool {
if o != nil && o.ExternalId != nil {
if o != nil && !IsNil(o.ExternalId) {
return true
}
@@ -260,31 +263,35 @@ func (o *EducationClass) SetExternalId(v string) {
}
func (o EducationClass) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.Description != nil {
toSerialize["description"] = o.Description
}
if true {
toSerialize["displayName"] = o.DisplayName
}
if o.Members != nil {
toSerialize["members"] = o.Members
}
if o.MembersodataBind != nil {
toSerialize["members@odata.bind"] = o.MembersodataBind
}
if true {
toSerialize["classification"] = o.Classification
}
if o.ExternalId != nil {
toSerialize["externalId"] = o.ExternalId
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EducationClass) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
toSerialize["displayName"] = o.DisplayName
if !IsNil(o.Members) {
toSerialize["members"] = o.Members
}
if !IsNil(o.MembersodataBind) {
toSerialize["members@odata.bind"] = o.MembersodataBind
}
toSerialize["classification"] = o.Classification
if !IsNil(o.ExternalId) {
toSerialize["externalId"] = o.ExternalId
}
return toSerialize, nil
}
type NullableEducationClass struct {
value *EducationClass
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the EducationOrganization type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EducationOrganization{}
// EducationOrganization Abstract. Represents an organization in educational context
type EducationOrganization struct {
// The unique idenfier for an entity. Read-only.
@@ -41,7 +44,7 @@ func NewEducationOrganizationWithDefaults() *EducationOrganization {
// GetId returns the Id field value if set, zero value otherwise.
func (o *EducationOrganization) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -51,7 +54,7 @@ func (o *EducationOrganization) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationOrganization) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -59,7 +62,7 @@ func (o *EducationOrganization) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *EducationOrganization) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -73,7 +76,7 @@ func (o *EducationOrganization) SetId(v string) {
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *EducationOrganization) GetDisplayName() string {
if o == nil || o.DisplayName == nil {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
@@ -83,7 +86,7 @@ func (o *EducationOrganization) GetDisplayName() string {
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationOrganization) GetDisplayNameOk() (*string, bool) {
if o == nil || o.DisplayName == nil {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
@@ -91,7 +94,7 @@ func (o *EducationOrganization) GetDisplayNameOk() (*string, bool) {
// HasDisplayName returns a boolean if a field has been set.
func (o *EducationOrganization) HasDisplayName() bool {
if o != nil && o.DisplayName != nil {
if o != nil && !IsNil(o.DisplayName) {
return true
}
@@ -104,16 +107,24 @@ func (o *EducationOrganization) SetDisplayName(v string) {
}
func (o EducationOrganization) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.DisplayName != nil {
toSerialize["displayName"] = o.DisplayName
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EducationOrganization) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
return toSerialize, nil
}
type NullableEducationOrganization struct {
value *EducationOrganization
isSet bool

View File

@@ -15,6 +15,9 @@ import (
"time"
)
// checks if the EducationSchool type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EducationSchool{}
// EducationSchool Represents a school
type EducationSchool struct {
// The unique idenfier for an entity. Read-only.
@@ -46,7 +49,7 @@ func NewEducationSchoolWithDefaults() *EducationSchool {
// GetId returns the Id field value if set, zero value otherwise.
func (o *EducationSchool) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -56,7 +59,7 @@ func (o *EducationSchool) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationSchool) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -64,7 +67,7 @@ func (o *EducationSchool) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *EducationSchool) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -78,7 +81,7 @@ func (o *EducationSchool) SetId(v string) {
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *EducationSchool) GetDisplayName() string {
if o == nil || o.DisplayName == nil {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
@@ -88,7 +91,7 @@ func (o *EducationSchool) GetDisplayName() string {
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationSchool) GetDisplayNameOk() (*string, bool) {
if o == nil || o.DisplayName == nil {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
@@ -96,7 +99,7 @@ func (o *EducationSchool) GetDisplayNameOk() (*string, bool) {
// HasDisplayName returns a boolean if a field has been set.
func (o *EducationSchool) HasDisplayName() bool {
if o != nil && o.DisplayName != nil {
if o != nil && !IsNil(o.DisplayName) {
return true
}
@@ -110,7 +113,7 @@ func (o *EducationSchool) SetDisplayName(v string) {
// GetSchoolNumber returns the SchoolNumber field value if set, zero value otherwise.
func (o *EducationSchool) GetSchoolNumber() string {
if o == nil || o.SchoolNumber == nil {
if o == nil || IsNil(o.SchoolNumber) {
var ret string
return ret
}
@@ -120,7 +123,7 @@ func (o *EducationSchool) GetSchoolNumber() string {
// GetSchoolNumberOk returns a tuple with the SchoolNumber field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationSchool) GetSchoolNumberOk() (*string, bool) {
if o == nil || o.SchoolNumber == nil {
if o == nil || IsNil(o.SchoolNumber) {
return nil, false
}
return o.SchoolNumber, true
@@ -128,7 +131,7 @@ func (o *EducationSchool) GetSchoolNumberOk() (*string, bool) {
// HasSchoolNumber returns a boolean if a field has been set.
func (o *EducationSchool) HasSchoolNumber() bool {
if o != nil && o.SchoolNumber != nil {
if o != nil && !IsNil(o.SchoolNumber) {
return true
}
@@ -142,7 +145,7 @@ func (o *EducationSchool) SetSchoolNumber(v string) {
// GetTerminationDate returns the TerminationDate field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EducationSchool) GetTerminationDate() time.Time {
if o == nil || o.TerminationDate.Get() == nil {
if o == nil || IsNil(o.TerminationDate.Get()) {
var ret time.Time
return ret
}
@@ -184,20 +187,28 @@ func (o *EducationSchool) UnsetTerminationDate() {
}
func (o EducationSchool) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EducationSchool) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if o.DisplayName != nil {
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
if o.SchoolNumber != nil {
if !IsNil(o.SchoolNumber) {
toSerialize["schoolNumber"] = o.SchoolNumber
}
if o.TerminationDate.IsSet() {
toSerialize["terminationDate"] = o.TerminationDate.Get()
}
return json.Marshal(toSerialize)
return toSerialize, nil
}
type NullableEducationSchool struct {

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the EducationUser type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EducationUser{}
// EducationUser And extension of user with education specific attributes
type EducationUser struct {
// Read-only.
@@ -63,7 +66,7 @@ func NewEducationUserWithDefaults() *EducationUser {
// GetId returns the Id field value if set, zero value otherwise.
func (o *EducationUser) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -73,7 +76,7 @@ func (o *EducationUser) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -81,7 +84,7 @@ func (o *EducationUser) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *EducationUser) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -95,7 +98,7 @@ func (o *EducationUser) SetId(v string) {
// GetAccountEnabled returns the AccountEnabled field value if set, zero value otherwise.
func (o *EducationUser) GetAccountEnabled() bool {
if o == nil || o.AccountEnabled == nil {
if o == nil || IsNil(o.AccountEnabled) {
var ret bool
return ret
}
@@ -105,7 +108,7 @@ func (o *EducationUser) GetAccountEnabled() bool {
// GetAccountEnabledOk returns a tuple with the AccountEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetAccountEnabledOk() (*bool, bool) {
if o == nil || o.AccountEnabled == nil {
if o == nil || IsNil(o.AccountEnabled) {
return nil, false
}
return o.AccountEnabled, true
@@ -113,7 +116,7 @@ func (o *EducationUser) GetAccountEnabledOk() (*bool, bool) {
// HasAccountEnabled returns a boolean if a field has been set.
func (o *EducationUser) HasAccountEnabled() bool {
if o != nil && o.AccountEnabled != nil {
if o != nil && !IsNil(o.AccountEnabled) {
return true
}
@@ -127,7 +130,7 @@ func (o *EducationUser) SetAccountEnabled(v bool) {
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *EducationUser) GetDisplayName() string {
if o == nil || o.DisplayName == nil {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
@@ -137,7 +140,7 @@ func (o *EducationUser) GetDisplayName() string {
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetDisplayNameOk() (*string, bool) {
if o == nil || o.DisplayName == nil {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
@@ -145,7 +148,7 @@ func (o *EducationUser) GetDisplayNameOk() (*string, bool) {
// HasDisplayName returns a boolean if a field has been set.
func (o *EducationUser) HasDisplayName() bool {
if o != nil && o.DisplayName != nil {
if o != nil && !IsNil(o.DisplayName) {
return true
}
@@ -159,7 +162,7 @@ func (o *EducationUser) SetDisplayName(v string) {
// GetDrives returns the Drives field value if set, zero value otherwise.
func (o *EducationUser) GetDrives() []Drive {
if o == nil || o.Drives == nil {
if o == nil || IsNil(o.Drives) {
var ret []Drive
return ret
}
@@ -169,7 +172,7 @@ func (o *EducationUser) GetDrives() []Drive {
// GetDrivesOk returns a tuple with the Drives field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetDrivesOk() ([]Drive, bool) {
if o == nil || o.Drives == nil {
if o == nil || IsNil(o.Drives) {
return nil, false
}
return o.Drives, true
@@ -177,7 +180,7 @@ func (o *EducationUser) GetDrivesOk() ([]Drive, bool) {
// HasDrives returns a boolean if a field has been set.
func (o *EducationUser) HasDrives() bool {
if o != nil && o.Drives != nil {
if o != nil && !IsNil(o.Drives) {
return true
}
@@ -191,7 +194,7 @@ func (o *EducationUser) SetDrives(v []Drive) {
// GetDrive returns the Drive field value if set, zero value otherwise.
func (o *EducationUser) GetDrive() Drive {
if o == nil || o.Drive == nil {
if o == nil || IsNil(o.Drive) {
var ret Drive
return ret
}
@@ -201,7 +204,7 @@ func (o *EducationUser) GetDrive() Drive {
// GetDriveOk returns a tuple with the Drive field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetDriveOk() (*Drive, bool) {
if o == nil || o.Drive == nil {
if o == nil || IsNil(o.Drive) {
return nil, false
}
return o.Drive, true
@@ -209,7 +212,7 @@ func (o *EducationUser) GetDriveOk() (*Drive, bool) {
// HasDrive returns a boolean if a field has been set.
func (o *EducationUser) HasDrive() bool {
if o != nil && o.Drive != nil {
if o != nil && !IsNil(o.Drive) {
return true
}
@@ -223,7 +226,7 @@ func (o *EducationUser) SetDrive(v Drive) {
// GetIdentities returns the Identities field value if set, zero value otherwise.
func (o *EducationUser) GetIdentities() []ObjectIdentity {
if o == nil || o.Identities == nil {
if o == nil || IsNil(o.Identities) {
var ret []ObjectIdentity
return ret
}
@@ -233,7 +236,7 @@ func (o *EducationUser) GetIdentities() []ObjectIdentity {
// GetIdentitiesOk returns a tuple with the Identities field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetIdentitiesOk() ([]ObjectIdentity, bool) {
if o == nil || o.Identities == nil {
if o == nil || IsNil(o.Identities) {
return nil, false
}
return o.Identities, true
@@ -241,7 +244,7 @@ func (o *EducationUser) GetIdentitiesOk() ([]ObjectIdentity, bool) {
// HasIdentities returns a boolean if a field has been set.
func (o *EducationUser) HasIdentities() bool {
if o != nil && o.Identities != nil {
if o != nil && !IsNil(o.Identities) {
return true
}
@@ -255,7 +258,7 @@ func (o *EducationUser) SetIdentities(v []ObjectIdentity) {
// GetMail returns the Mail field value if set, zero value otherwise.
func (o *EducationUser) GetMail() string {
if o == nil || o.Mail == nil {
if o == nil || IsNil(o.Mail) {
var ret string
return ret
}
@@ -265,7 +268,7 @@ func (o *EducationUser) GetMail() string {
// GetMailOk returns a tuple with the Mail field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetMailOk() (*string, bool) {
if o == nil || o.Mail == nil {
if o == nil || IsNil(o.Mail) {
return nil, false
}
return o.Mail, true
@@ -273,7 +276,7 @@ func (o *EducationUser) GetMailOk() (*string, bool) {
// HasMail returns a boolean if a field has been set.
func (o *EducationUser) HasMail() bool {
if o != nil && o.Mail != nil {
if o != nil && !IsNil(o.Mail) {
return true
}
@@ -287,7 +290,7 @@ func (o *EducationUser) SetMail(v string) {
// GetMemberOf returns the MemberOf field value if set, zero value otherwise.
func (o *EducationUser) GetMemberOf() []Group {
if o == nil || o.MemberOf == nil {
if o == nil || IsNil(o.MemberOf) {
var ret []Group
return ret
}
@@ -297,7 +300,7 @@ func (o *EducationUser) GetMemberOf() []Group {
// GetMemberOfOk returns a tuple with the MemberOf field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetMemberOfOk() ([]Group, bool) {
if o == nil || o.MemberOf == nil {
if o == nil || IsNil(o.MemberOf) {
return nil, false
}
return o.MemberOf, true
@@ -305,7 +308,7 @@ func (o *EducationUser) GetMemberOfOk() ([]Group, bool) {
// HasMemberOf returns a boolean if a field has been set.
func (o *EducationUser) HasMemberOf() bool {
if o != nil && o.MemberOf != nil {
if o != nil && !IsNil(o.MemberOf) {
return true
}
@@ -319,7 +322,7 @@ func (o *EducationUser) SetMemberOf(v []Group) {
// GetOnPremisesSamAccountName returns the OnPremisesSamAccountName field value if set, zero value otherwise.
func (o *EducationUser) GetOnPremisesSamAccountName() string {
if o == nil || o.OnPremisesSamAccountName == nil {
if o == nil || IsNil(o.OnPremisesSamAccountName) {
var ret string
return ret
}
@@ -329,7 +332,7 @@ func (o *EducationUser) GetOnPremisesSamAccountName() string {
// GetOnPremisesSamAccountNameOk returns a tuple with the OnPremisesSamAccountName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetOnPremisesSamAccountNameOk() (*string, bool) {
if o == nil || o.OnPremisesSamAccountName == nil {
if o == nil || IsNil(o.OnPremisesSamAccountName) {
return nil, false
}
return o.OnPremisesSamAccountName, true
@@ -337,7 +340,7 @@ func (o *EducationUser) GetOnPremisesSamAccountNameOk() (*string, bool) {
// HasOnPremisesSamAccountName returns a boolean if a field has been set.
func (o *EducationUser) HasOnPremisesSamAccountName() bool {
if o != nil && o.OnPremisesSamAccountName != nil {
if o != nil && !IsNil(o.OnPremisesSamAccountName) {
return true
}
@@ -351,7 +354,7 @@ func (o *EducationUser) SetOnPremisesSamAccountName(v string) {
// GetPasswordProfile returns the PasswordProfile field value if set, zero value otherwise.
func (o *EducationUser) GetPasswordProfile() PasswordProfile {
if o == nil || o.PasswordProfile == nil {
if o == nil || IsNil(o.PasswordProfile) {
var ret PasswordProfile
return ret
}
@@ -361,7 +364,7 @@ func (o *EducationUser) GetPasswordProfile() PasswordProfile {
// GetPasswordProfileOk returns a tuple with the PasswordProfile field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetPasswordProfileOk() (*PasswordProfile, bool) {
if o == nil || o.PasswordProfile == nil {
if o == nil || IsNil(o.PasswordProfile) {
return nil, false
}
return o.PasswordProfile, true
@@ -369,7 +372,7 @@ func (o *EducationUser) GetPasswordProfileOk() (*PasswordProfile, bool) {
// HasPasswordProfile returns a boolean if a field has been set.
func (o *EducationUser) HasPasswordProfile() bool {
if o != nil && o.PasswordProfile != nil {
if o != nil && !IsNil(o.PasswordProfile) {
return true
}
@@ -383,7 +386,7 @@ func (o *EducationUser) SetPasswordProfile(v PasswordProfile) {
// GetSurname returns the Surname field value if set, zero value otherwise.
func (o *EducationUser) GetSurname() string {
if o == nil || o.Surname == nil {
if o == nil || IsNil(o.Surname) {
var ret string
return ret
}
@@ -393,7 +396,7 @@ func (o *EducationUser) GetSurname() string {
// GetSurnameOk returns a tuple with the Surname field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetSurnameOk() (*string, bool) {
if o == nil || o.Surname == nil {
if o == nil || IsNil(o.Surname) {
return nil, false
}
return o.Surname, true
@@ -401,7 +404,7 @@ func (o *EducationUser) GetSurnameOk() (*string, bool) {
// HasSurname returns a boolean if a field has been set.
func (o *EducationUser) HasSurname() bool {
if o != nil && o.Surname != nil {
if o != nil && !IsNil(o.Surname) {
return true
}
@@ -415,7 +418,7 @@ func (o *EducationUser) SetSurname(v string) {
// GetGivenName returns the GivenName field value if set, zero value otherwise.
func (o *EducationUser) GetGivenName() string {
if o == nil || o.GivenName == nil {
if o == nil || IsNil(o.GivenName) {
var ret string
return ret
}
@@ -425,7 +428,7 @@ func (o *EducationUser) GetGivenName() string {
// GetGivenNameOk returns a tuple with the GivenName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetGivenNameOk() (*string, bool) {
if o == nil || o.GivenName == nil {
if o == nil || IsNil(o.GivenName) {
return nil, false
}
return o.GivenName, true
@@ -433,7 +436,7 @@ func (o *EducationUser) GetGivenNameOk() (*string, bool) {
// HasGivenName returns a boolean if a field has been set.
func (o *EducationUser) HasGivenName() bool {
if o != nil && o.GivenName != nil {
if o != nil && !IsNil(o.GivenName) {
return true
}
@@ -447,7 +450,7 @@ func (o *EducationUser) SetGivenName(v string) {
// GetPrimaryRole returns the PrimaryRole field value if set, zero value otherwise.
func (o *EducationUser) GetPrimaryRole() string {
if o == nil || o.PrimaryRole == nil {
if o == nil || IsNil(o.PrimaryRole) {
var ret string
return ret
}
@@ -457,7 +460,7 @@ func (o *EducationUser) GetPrimaryRole() string {
// GetPrimaryRoleOk returns a tuple with the PrimaryRole field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetPrimaryRoleOk() (*string, bool) {
if o == nil || o.PrimaryRole == nil {
if o == nil || IsNil(o.PrimaryRole) {
return nil, false
}
return o.PrimaryRole, true
@@ -465,7 +468,7 @@ func (o *EducationUser) GetPrimaryRoleOk() (*string, bool) {
// HasPrimaryRole returns a boolean if a field has been set.
func (o *EducationUser) HasPrimaryRole() bool {
if o != nil && o.PrimaryRole != nil {
if o != nil && !IsNil(o.PrimaryRole) {
return true
}
@@ -479,7 +482,7 @@ func (o *EducationUser) SetPrimaryRole(v string) {
// GetUserType returns the UserType field value if set, zero value otherwise.
func (o *EducationUser) GetUserType() string {
if o == nil || o.UserType == nil {
if o == nil || IsNil(o.UserType) {
var ret string
return ret
}
@@ -489,7 +492,7 @@ func (o *EducationUser) GetUserType() string {
// GetUserTypeOk returns a tuple with the UserType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUser) GetUserTypeOk() (*string, bool) {
if o == nil || o.UserType == nil {
if o == nil || IsNil(o.UserType) {
return nil, false
}
return o.UserType, true
@@ -497,7 +500,7 @@ func (o *EducationUser) GetUserTypeOk() (*string, bool) {
// HasUserType returns a boolean if a field has been set.
func (o *EducationUser) HasUserType() bool {
if o != nil && o.UserType != nil {
if o != nil && !IsNil(o.UserType) {
return true
}
@@ -510,52 +513,60 @@ func (o *EducationUser) SetUserType(v string) {
}
func (o EducationUser) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.AccountEnabled != nil {
toSerialize["accountEnabled"] = o.AccountEnabled
}
if o.DisplayName != nil {
toSerialize["displayName"] = o.DisplayName
}
if o.Drives != nil {
toSerialize["drives"] = o.Drives
}
if o.Drive != nil {
toSerialize["drive"] = o.Drive
}
if o.Identities != nil {
toSerialize["identities"] = o.Identities
}
if o.Mail != nil {
toSerialize["mail"] = o.Mail
}
if o.MemberOf != nil {
toSerialize["memberOf"] = o.MemberOf
}
if o.OnPremisesSamAccountName != nil {
toSerialize["onPremisesSamAccountName"] = o.OnPremisesSamAccountName
}
if o.PasswordProfile != nil {
toSerialize["passwordProfile"] = o.PasswordProfile
}
if o.Surname != nil {
toSerialize["surname"] = o.Surname
}
if o.GivenName != nil {
toSerialize["givenName"] = o.GivenName
}
if o.PrimaryRole != nil {
toSerialize["primaryRole"] = o.PrimaryRole
}
if o.UserType != nil {
toSerialize["userType"] = o.UserType
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EducationUser) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.AccountEnabled) {
toSerialize["accountEnabled"] = o.AccountEnabled
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
if !IsNil(o.Drives) {
toSerialize["drives"] = o.Drives
}
if !IsNil(o.Drive) {
toSerialize["drive"] = o.Drive
}
if !IsNil(o.Identities) {
toSerialize["identities"] = o.Identities
}
if !IsNil(o.Mail) {
toSerialize["mail"] = o.Mail
}
if !IsNil(o.MemberOf) {
toSerialize["memberOf"] = o.MemberOf
}
if !IsNil(o.OnPremisesSamAccountName) {
toSerialize["onPremisesSamAccountName"] = o.OnPremisesSamAccountName
}
if !IsNil(o.PasswordProfile) {
toSerialize["passwordProfile"] = o.PasswordProfile
}
if !IsNil(o.Surname) {
toSerialize["surname"] = o.Surname
}
if !IsNil(o.GivenName) {
toSerialize["givenName"] = o.GivenName
}
if !IsNil(o.PrimaryRole) {
toSerialize["primaryRole"] = o.PrimaryRole
}
if !IsNil(o.UserType) {
toSerialize["userType"] = o.UserType
}
return toSerialize, nil
}
type NullableEducationUser struct {
value *EducationUser
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the EducationUserReference type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EducationUserReference{}
// EducationUserReference struct for EducationUserReference
type EducationUserReference struct {
OdataId *string `json:"@odata.id,omitempty"`
@@ -38,7 +41,7 @@ func NewEducationUserReferenceWithDefaults() *EducationUserReference {
// GetOdataId returns the OdataId field value if set, zero value otherwise.
func (o *EducationUserReference) GetOdataId() string {
if o == nil || o.OdataId == nil {
if o == nil || IsNil(o.OdataId) {
var ret string
return ret
}
@@ -48,7 +51,7 @@ func (o *EducationUserReference) GetOdataId() string {
// GetOdataIdOk returns a tuple with the OdataId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EducationUserReference) GetOdataIdOk() (*string, bool) {
if o == nil || o.OdataId == nil {
if o == nil || IsNil(o.OdataId) {
return nil, false
}
return o.OdataId, true
@@ -56,7 +59,7 @@ func (o *EducationUserReference) GetOdataIdOk() (*string, bool) {
// HasOdataId returns a boolean if a field has been set.
func (o *EducationUserReference) HasOdataId() bool {
if o != nil && o.OdataId != nil {
if o != nil && !IsNil(o.OdataId) {
return true
}
@@ -69,13 +72,21 @@ func (o *EducationUserReference) SetOdataId(v string) {
}
func (o EducationUserReference) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.OdataId != nil {
toSerialize["@odata.id"] = o.OdataId
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EducationUserReference) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.OdataId) {
toSerialize["@odata.id"] = o.OdataId
}
return toSerialize, nil
}
type NullableEducationUserReference struct {
value *EducationUserReference
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the Entity type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Entity{}
// Entity Represents an entity.
type Entity struct {
// The unique idenfier for an entity. Read-only.
@@ -39,7 +42,7 @@ func NewEntityWithDefaults() *Entity {
// GetId returns the Id field value if set, zero value otherwise.
func (o *Entity) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -49,7 +52,7 @@ func (o *Entity) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Entity) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -57,7 +60,7 @@ func (o *Entity) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *Entity) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -70,13 +73,21 @@ func (o *Entity) SetId(v string) {
}
func (o Entity) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Entity) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
return toSerialize, nil
}
type NullableEntity struct {
value *Entity
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the ExportPersonalDataRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ExportPersonalDataRequest{}
// ExportPersonalDataRequest struct for ExportPersonalDataRequest
type ExportPersonalDataRequest struct {
// the path where the file should be created in the users personal space
@@ -39,7 +42,7 @@ func NewExportPersonalDataRequestWithDefaults() *ExportPersonalDataRequest {
// GetStorageLocation returns the StorageLocation field value if set, zero value otherwise.
func (o *ExportPersonalDataRequest) GetStorageLocation() string {
if o == nil || o.StorageLocation == nil {
if o == nil || IsNil(o.StorageLocation) {
var ret string
return ret
}
@@ -49,7 +52,7 @@ func (o *ExportPersonalDataRequest) GetStorageLocation() string {
// GetStorageLocationOk returns a tuple with the StorageLocation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ExportPersonalDataRequest) GetStorageLocationOk() (*string, bool) {
if o == nil || o.StorageLocation == nil {
if o == nil || IsNil(o.StorageLocation) {
return nil, false
}
return o.StorageLocation, true
@@ -57,7 +60,7 @@ func (o *ExportPersonalDataRequest) GetStorageLocationOk() (*string, bool) {
// HasStorageLocation returns a boolean if a field has been set.
func (o *ExportPersonalDataRequest) HasStorageLocation() bool {
if o != nil && o.StorageLocation != nil {
if o != nil && !IsNil(o.StorageLocation) {
return true
}
@@ -70,13 +73,21 @@ func (o *ExportPersonalDataRequest) SetStorageLocation(v string) {
}
func (o ExportPersonalDataRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.StorageLocation != nil {
toSerialize["storageLocation"] = o.StorageLocation
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ExportPersonalDataRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.StorageLocation) {
toSerialize["storageLocation"] = o.StorageLocation
}
return toSerialize, nil
}
type NullableExportPersonalDataRequest struct {
value *ExportPersonalDataRequest
isSet bool

View File

@@ -15,6 +15,9 @@ import (
"time"
)
// checks if the FileSystemInfo type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FileSystemInfo{}
// FileSystemInfo File system information on client. Read-write.
type FileSystemInfo struct {
// The UTC date and time the file was created on a client.
@@ -44,7 +47,7 @@ func NewFileSystemInfoWithDefaults() *FileSystemInfo {
// GetCreatedDateTime returns the CreatedDateTime field value if set, zero value otherwise.
func (o *FileSystemInfo) GetCreatedDateTime() time.Time {
if o == nil || o.CreatedDateTime == nil {
if o == nil || IsNil(o.CreatedDateTime) {
var ret time.Time
return ret
}
@@ -54,7 +57,7 @@ func (o *FileSystemInfo) GetCreatedDateTime() time.Time {
// GetCreatedDateTimeOk returns a tuple with the CreatedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FileSystemInfo) GetCreatedDateTimeOk() (*time.Time, bool) {
if o == nil || o.CreatedDateTime == nil {
if o == nil || IsNil(o.CreatedDateTime) {
return nil, false
}
return o.CreatedDateTime, true
@@ -62,7 +65,7 @@ func (o *FileSystemInfo) GetCreatedDateTimeOk() (*time.Time, bool) {
// HasCreatedDateTime returns a boolean if a field has been set.
func (o *FileSystemInfo) HasCreatedDateTime() bool {
if o != nil && o.CreatedDateTime != nil {
if o != nil && !IsNil(o.CreatedDateTime) {
return true
}
@@ -76,7 +79,7 @@ func (o *FileSystemInfo) SetCreatedDateTime(v time.Time) {
// GetLastAccessedDateTime returns the LastAccessedDateTime field value if set, zero value otherwise.
func (o *FileSystemInfo) GetLastAccessedDateTime() time.Time {
if o == nil || o.LastAccessedDateTime == nil {
if o == nil || IsNil(o.LastAccessedDateTime) {
var ret time.Time
return ret
}
@@ -86,7 +89,7 @@ func (o *FileSystemInfo) GetLastAccessedDateTime() time.Time {
// GetLastAccessedDateTimeOk returns a tuple with the LastAccessedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FileSystemInfo) GetLastAccessedDateTimeOk() (*time.Time, bool) {
if o == nil || o.LastAccessedDateTime == nil {
if o == nil || IsNil(o.LastAccessedDateTime) {
return nil, false
}
return o.LastAccessedDateTime, true
@@ -94,7 +97,7 @@ func (o *FileSystemInfo) GetLastAccessedDateTimeOk() (*time.Time, bool) {
// HasLastAccessedDateTime returns a boolean if a field has been set.
func (o *FileSystemInfo) HasLastAccessedDateTime() bool {
if o != nil && o.LastAccessedDateTime != nil {
if o != nil && !IsNil(o.LastAccessedDateTime) {
return true
}
@@ -108,7 +111,7 @@ func (o *FileSystemInfo) SetLastAccessedDateTime(v time.Time) {
// GetLastModifiedDateTime returns the LastModifiedDateTime field value if set, zero value otherwise.
func (o *FileSystemInfo) GetLastModifiedDateTime() time.Time {
if o == nil || o.LastModifiedDateTime == nil {
if o == nil || IsNil(o.LastModifiedDateTime) {
var ret time.Time
return ret
}
@@ -118,7 +121,7 @@ func (o *FileSystemInfo) GetLastModifiedDateTime() time.Time {
// GetLastModifiedDateTimeOk returns a tuple with the LastModifiedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FileSystemInfo) GetLastModifiedDateTimeOk() (*time.Time, bool) {
if o == nil || o.LastModifiedDateTime == nil {
if o == nil || IsNil(o.LastModifiedDateTime) {
return nil, false
}
return o.LastModifiedDateTime, true
@@ -126,7 +129,7 @@ func (o *FileSystemInfo) GetLastModifiedDateTimeOk() (*time.Time, bool) {
// HasLastModifiedDateTime returns a boolean if a field has been set.
func (o *FileSystemInfo) HasLastModifiedDateTime() bool {
if o != nil && o.LastModifiedDateTime != nil {
if o != nil && !IsNil(o.LastModifiedDateTime) {
return true
}
@@ -139,19 +142,27 @@ func (o *FileSystemInfo) SetLastModifiedDateTime(v time.Time) {
}
func (o FileSystemInfo) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CreatedDateTime != nil {
toSerialize["createdDateTime"] = o.CreatedDateTime
}
if o.LastAccessedDateTime != nil {
toSerialize["lastAccessedDateTime"] = o.LastAccessedDateTime
}
if o.LastModifiedDateTime != nil {
toSerialize["lastModifiedDateTime"] = o.LastModifiedDateTime
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FileSystemInfo) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreatedDateTime) {
toSerialize["createdDateTime"] = o.CreatedDateTime
}
if !IsNil(o.LastAccessedDateTime) {
toSerialize["lastAccessedDateTime"] = o.LastAccessedDateTime
}
if !IsNil(o.LastModifiedDateTime) {
toSerialize["lastModifiedDateTime"] = o.LastModifiedDateTime
}
return toSerialize, nil
}
type NullableFileSystemInfo struct {
value *FileSystemInfo
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the Folder type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Folder{}
// Folder Folder metadata, if the item is a folder. Read-only.
type Folder struct {
// Number of children contained immediately within this container.
@@ -40,7 +43,7 @@ func NewFolderWithDefaults() *Folder {
// GetChildCount returns the ChildCount field value if set, zero value otherwise.
func (o *Folder) GetChildCount() int32 {
if o == nil || o.ChildCount == nil {
if o == nil || IsNil(o.ChildCount) {
var ret int32
return ret
}
@@ -50,7 +53,7 @@ func (o *Folder) GetChildCount() int32 {
// GetChildCountOk returns a tuple with the ChildCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Folder) GetChildCountOk() (*int32, bool) {
if o == nil || o.ChildCount == nil {
if o == nil || IsNil(o.ChildCount) {
return nil, false
}
return o.ChildCount, true
@@ -58,7 +61,7 @@ func (o *Folder) GetChildCountOk() (*int32, bool) {
// HasChildCount returns a boolean if a field has been set.
func (o *Folder) HasChildCount() bool {
if o != nil && o.ChildCount != nil {
if o != nil && !IsNil(o.ChildCount) {
return true
}
@@ -72,7 +75,7 @@ func (o *Folder) SetChildCount(v int32) {
// GetView returns the View field value if set, zero value otherwise.
func (o *Folder) GetView() FolderView {
if o == nil || o.View == nil {
if o == nil || IsNil(o.View) {
var ret FolderView
return ret
}
@@ -82,7 +85,7 @@ func (o *Folder) GetView() FolderView {
// GetViewOk returns a tuple with the View field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Folder) GetViewOk() (*FolderView, bool) {
if o == nil || o.View == nil {
if o == nil || IsNil(o.View) {
return nil, false
}
return o.View, true
@@ -90,7 +93,7 @@ func (o *Folder) GetViewOk() (*FolderView, bool) {
// HasView returns a boolean if a field has been set.
func (o *Folder) HasView() bool {
if o != nil && o.View != nil {
if o != nil && !IsNil(o.View) {
return true
}
@@ -103,16 +106,24 @@ func (o *Folder) SetView(v FolderView) {
}
func (o Folder) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.ChildCount != nil {
toSerialize["childCount"] = o.ChildCount
}
if o.View != nil {
toSerialize["view"] = o.View
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Folder) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ChildCount) {
toSerialize["childCount"] = o.ChildCount
}
if !IsNil(o.View) {
toSerialize["view"] = o.View
}
return toSerialize, nil
}
type NullableFolder struct {
value *Folder
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the FolderView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FolderView{}
// FolderView A collection of properties defining the recommended view for the folder.
type FolderView struct {
// The method by which the folder should be sorted.
@@ -43,7 +46,7 @@ func NewFolderViewWithDefaults() *FolderView {
// GetSortBy returns the SortBy field value if set, zero value otherwise.
func (o *FolderView) GetSortBy() string {
if o == nil || o.SortBy == nil {
if o == nil || IsNil(o.SortBy) {
var ret string
return ret
}
@@ -53,7 +56,7 @@ func (o *FolderView) GetSortBy() string {
// GetSortByOk returns a tuple with the SortBy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FolderView) GetSortByOk() (*string, bool) {
if o == nil || o.SortBy == nil {
if o == nil || IsNil(o.SortBy) {
return nil, false
}
return o.SortBy, true
@@ -61,7 +64,7 @@ func (o *FolderView) GetSortByOk() (*string, bool) {
// HasSortBy returns a boolean if a field has been set.
func (o *FolderView) HasSortBy() bool {
if o != nil && o.SortBy != nil {
if o != nil && !IsNil(o.SortBy) {
return true
}
@@ -75,7 +78,7 @@ func (o *FolderView) SetSortBy(v string) {
// GetSortOrder returns the SortOrder field value if set, zero value otherwise.
func (o *FolderView) GetSortOrder() string {
if o == nil || o.SortOrder == nil {
if o == nil || IsNil(o.SortOrder) {
var ret string
return ret
}
@@ -85,7 +88,7 @@ func (o *FolderView) GetSortOrder() string {
// GetSortOrderOk returns a tuple with the SortOrder field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FolderView) GetSortOrderOk() (*string, bool) {
if o == nil || o.SortOrder == nil {
if o == nil || IsNil(o.SortOrder) {
return nil, false
}
return o.SortOrder, true
@@ -93,7 +96,7 @@ func (o *FolderView) GetSortOrderOk() (*string, bool) {
// HasSortOrder returns a boolean if a field has been set.
func (o *FolderView) HasSortOrder() bool {
if o != nil && o.SortOrder != nil {
if o != nil && !IsNil(o.SortOrder) {
return true
}
@@ -107,7 +110,7 @@ func (o *FolderView) SetSortOrder(v string) {
// GetViewType returns the ViewType field value if set, zero value otherwise.
func (o *FolderView) GetViewType() string {
if o == nil || o.ViewType == nil {
if o == nil || IsNil(o.ViewType) {
var ret string
return ret
}
@@ -117,7 +120,7 @@ func (o *FolderView) GetViewType() string {
// GetViewTypeOk returns a tuple with the ViewType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FolderView) GetViewTypeOk() (*string, bool) {
if o == nil || o.ViewType == nil {
if o == nil || IsNil(o.ViewType) {
return nil, false
}
return o.ViewType, true
@@ -125,7 +128,7 @@ func (o *FolderView) GetViewTypeOk() (*string, bool) {
// HasViewType returns a boolean if a field has been set.
func (o *FolderView) HasViewType() bool {
if o != nil && o.ViewType != nil {
if o != nil && !IsNil(o.ViewType) {
return true
}
@@ -138,19 +141,27 @@ func (o *FolderView) SetViewType(v string) {
}
func (o FolderView) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.SortBy != nil {
toSerialize["sortBy"] = o.SortBy
}
if o.SortOrder != nil {
toSerialize["sortOrder"] = o.SortOrder
}
if o.ViewType != nil {
toSerialize["viewType"] = o.ViewType
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FolderView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.SortBy) {
toSerialize["sortBy"] = o.SortBy
}
if !IsNil(o.SortOrder) {
toSerialize["sortOrder"] = o.SortOrder
}
if !IsNil(o.ViewType) {
toSerialize["viewType"] = o.ViewType
}
return toSerialize, nil
}
type NullableFolderView struct {
value *FolderView
isSet bool

View File

@@ -0,0 +1,199 @@
/*
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 GeoCoordinates type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &GeoCoordinates{}
// GeoCoordinates The GeoCoordinates resource provides geographic coordinates and elevation of a location based on metadata contained within the file. If a DriveItem has a non-null location facet, the item represents a file with a known location assocaited with it.
type GeoCoordinates struct {
// The altitude (height), in feet, above sea level for the item. Read-only.
Altitude *float64 `json:"altitude,omitempty"`
// The latitude, in decimal, for the item. Read-only.
Latitude *float64 `json:"latitude,omitempty"`
// The longitude, in decimal, for the item. Read-only.
Longitude *float64 `json:"longitude,omitempty"`
}
// NewGeoCoordinates instantiates a new GeoCoordinates 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 NewGeoCoordinates() *GeoCoordinates {
this := GeoCoordinates{}
return &this
}
// NewGeoCoordinatesWithDefaults instantiates a new GeoCoordinates 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 NewGeoCoordinatesWithDefaults() *GeoCoordinates {
this := GeoCoordinates{}
return &this
}
// GetAltitude returns the Altitude field value if set, zero value otherwise.
func (o *GeoCoordinates) GetAltitude() float64 {
if o == nil || IsNil(o.Altitude) {
var ret float64
return ret
}
return *o.Altitude
}
// GetAltitudeOk returns a tuple with the Altitude field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GeoCoordinates) GetAltitudeOk() (*float64, bool) {
if o == nil || IsNil(o.Altitude) {
return nil, false
}
return o.Altitude, true
}
// HasAltitude returns a boolean if a field has been set.
func (o *GeoCoordinates) HasAltitude() bool {
if o != nil && !IsNil(o.Altitude) {
return true
}
return false
}
// SetAltitude gets a reference to the given float64 and assigns it to the Altitude field.
func (o *GeoCoordinates) SetAltitude(v float64) {
o.Altitude = &v
}
// GetLatitude returns the Latitude field value if set, zero value otherwise.
func (o *GeoCoordinates) GetLatitude() float64 {
if o == nil || IsNil(o.Latitude) {
var ret float64
return ret
}
return *o.Latitude
}
// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GeoCoordinates) GetLatitudeOk() (*float64, bool) {
if o == nil || IsNil(o.Latitude) {
return nil, false
}
return o.Latitude, true
}
// HasLatitude returns a boolean if a field has been set.
func (o *GeoCoordinates) HasLatitude() bool {
if o != nil && !IsNil(o.Latitude) {
return true
}
return false
}
// SetLatitude gets a reference to the given float64 and assigns it to the Latitude field.
func (o *GeoCoordinates) SetLatitude(v float64) {
o.Latitude = &v
}
// GetLongitude returns the Longitude field value if set, zero value otherwise.
func (o *GeoCoordinates) GetLongitude() float64 {
if o == nil || IsNil(o.Longitude) {
var ret float64
return ret
}
return *o.Longitude
}
// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *GeoCoordinates) GetLongitudeOk() (*float64, bool) {
if o == nil || IsNil(o.Longitude) {
return nil, false
}
return o.Longitude, true
}
// HasLongitude returns a boolean if a field has been set.
func (o *GeoCoordinates) HasLongitude() bool {
if o != nil && !IsNil(o.Longitude) {
return true
}
return false
}
// SetLongitude gets a reference to the given float64 and assigns it to the Longitude field.
func (o *GeoCoordinates) SetLongitude(v float64) {
o.Longitude = &v
}
func (o GeoCoordinates) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o GeoCoordinates) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Altitude) {
toSerialize["altitude"] = o.Altitude
}
if !IsNil(o.Latitude) {
toSerialize["latitude"] = o.Latitude
}
if !IsNil(o.Longitude) {
toSerialize["longitude"] = o.Longitude
}
return toSerialize, nil
}
type NullableGeoCoordinates struct {
value *GeoCoordinates
isSet bool
}
func (v NullableGeoCoordinates) Get() *GeoCoordinates {
return v.value
}
func (v *NullableGeoCoordinates) Set(val *GeoCoordinates) {
v.value = val
v.isSet = true
}
func (v NullableGeoCoordinates) IsSet() bool {
return v.isSet
}
func (v *NullableGeoCoordinates) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableGeoCoordinates(val *GeoCoordinates) *NullableGeoCoordinates {
return &NullableGeoCoordinates{value: val, isSet: true}
}
func (v NullableGeoCoordinates) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableGeoCoordinates) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the Group type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Group{}
// Group struct for Group
type Group struct {
// Read-only.
@@ -49,7 +52,7 @@ func NewGroupWithDefaults() *Group {
// GetId returns the Id field value if set, zero value otherwise.
func (o *Group) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -59,7 +62,7 @@ func (o *Group) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Group) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -67,7 +70,7 @@ func (o *Group) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *Group) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -81,7 +84,7 @@ func (o *Group) SetId(v string) {
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *Group) GetDescription() string {
if o == nil || o.Description == nil {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
@@ -91,7 +94,7 @@ func (o *Group) GetDescription() string {
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Group) GetDescriptionOk() (*string, bool) {
if o == nil || o.Description == nil {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
@@ -99,7 +102,7 @@ func (o *Group) GetDescriptionOk() (*string, bool) {
// HasDescription returns a boolean if a field has been set.
func (o *Group) HasDescription() bool {
if o != nil && o.Description != nil {
if o != nil && !IsNil(o.Description) {
return true
}
@@ -113,7 +116,7 @@ func (o *Group) SetDescription(v string) {
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *Group) GetDisplayName() string {
if o == nil || o.DisplayName == nil {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
@@ -123,7 +126,7 @@ func (o *Group) GetDisplayName() string {
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Group) GetDisplayNameOk() (*string, bool) {
if o == nil || o.DisplayName == nil {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
@@ -131,7 +134,7 @@ func (o *Group) GetDisplayNameOk() (*string, bool) {
// HasDisplayName returns a boolean if a field has been set.
func (o *Group) HasDisplayName() bool {
if o != nil && o.DisplayName != nil {
if o != nil && !IsNil(o.DisplayName) {
return true
}
@@ -145,7 +148,7 @@ func (o *Group) SetDisplayName(v string) {
// GetGroupTypes returns the GroupTypes field value if set, zero value otherwise.
func (o *Group) GetGroupTypes() []string {
if o == nil || o.GroupTypes == nil {
if o == nil || IsNil(o.GroupTypes) {
var ret []string
return ret
}
@@ -155,7 +158,7 @@ func (o *Group) GetGroupTypes() []string {
// GetGroupTypesOk returns a tuple with the GroupTypes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Group) GetGroupTypesOk() ([]string, bool) {
if o == nil || o.GroupTypes == nil {
if o == nil || IsNil(o.GroupTypes) {
return nil, false
}
return o.GroupTypes, true
@@ -163,7 +166,7 @@ func (o *Group) GetGroupTypesOk() ([]string, bool) {
// HasGroupTypes returns a boolean if a field has been set.
func (o *Group) HasGroupTypes() bool {
if o != nil && o.GroupTypes != nil {
if o != nil && !IsNil(o.GroupTypes) {
return true
}
@@ -177,7 +180,7 @@ func (o *Group) SetGroupTypes(v []string) {
// GetMembers returns the Members field value if set, zero value otherwise.
func (o *Group) GetMembers() []User {
if o == nil || o.Members == nil {
if o == nil || IsNil(o.Members) {
var ret []User
return ret
}
@@ -187,7 +190,7 @@ func (o *Group) GetMembers() []User {
// GetMembersOk returns a tuple with the Members field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Group) GetMembersOk() ([]User, bool) {
if o == nil || o.Members == nil {
if o == nil || IsNil(o.Members) {
return nil, false
}
return o.Members, true
@@ -195,7 +198,7 @@ func (o *Group) GetMembersOk() ([]User, bool) {
// HasMembers returns a boolean if a field has been set.
func (o *Group) HasMembers() bool {
if o != nil && o.Members != nil {
if o != nil && !IsNil(o.Members) {
return true
}
@@ -209,7 +212,7 @@ func (o *Group) SetMembers(v []User) {
// GetMembersodataBind returns the MembersodataBind field value if set, zero value otherwise.
func (o *Group) GetMembersodataBind() []string {
if o == nil || o.MembersodataBind == nil {
if o == nil || IsNil(o.MembersodataBind) {
var ret []string
return ret
}
@@ -219,7 +222,7 @@ func (o *Group) GetMembersodataBind() []string {
// GetMembersodataBindOk returns a tuple with the MembersodataBind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Group) GetMembersodataBindOk() ([]string, bool) {
if o == nil || o.MembersodataBind == nil {
if o == nil || IsNil(o.MembersodataBind) {
return nil, false
}
return o.MembersodataBind, true
@@ -227,7 +230,7 @@ func (o *Group) GetMembersodataBindOk() ([]string, bool) {
// HasMembersodataBind returns a boolean if a field has been set.
func (o *Group) HasMembersodataBind() bool {
if o != nil && o.MembersodataBind != nil {
if o != nil && !IsNil(o.MembersodataBind) {
return true
}
@@ -240,28 +243,36 @@ func (o *Group) SetMembersodataBind(v []string) {
}
func (o Group) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.Description != nil {
toSerialize["description"] = o.Description
}
if o.DisplayName != nil {
toSerialize["displayName"] = o.DisplayName
}
if o.GroupTypes != nil {
toSerialize["groupTypes"] = o.GroupTypes
}
if o.Members != nil {
toSerialize["members"] = o.Members
}
if o.MembersodataBind != nil {
toSerialize["members@odata.bind"] = o.MembersodataBind
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Group) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
if !IsNil(o.GroupTypes) {
toSerialize["groupTypes"] = o.GroupTypes
}
if !IsNil(o.Members) {
toSerialize["members"] = o.Members
}
if !IsNil(o.MembersodataBind) {
toSerialize["members@odata.bind"] = o.MembersodataBind
}
return toSerialize, nil
}
type NullableGroup struct {
value *Group
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the Hashes type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Hashes{}
// Hashes Hashes of the file's binary content, if available. Read-only.
type Hashes struct {
// The CRC32 value of the file (if available). Read-only.
@@ -45,7 +48,7 @@ func NewHashesWithDefaults() *Hashes {
// GetCrc32Hash returns the Crc32Hash field value if set, zero value otherwise.
func (o *Hashes) GetCrc32Hash() string {
if o == nil || o.Crc32Hash == nil {
if o == nil || IsNil(o.Crc32Hash) {
var ret string
return ret
}
@@ -55,7 +58,7 @@ func (o *Hashes) GetCrc32Hash() string {
// GetCrc32HashOk returns a tuple with the Crc32Hash field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Hashes) GetCrc32HashOk() (*string, bool) {
if o == nil || o.Crc32Hash == nil {
if o == nil || IsNil(o.Crc32Hash) {
return nil, false
}
return o.Crc32Hash, true
@@ -63,7 +66,7 @@ func (o *Hashes) GetCrc32HashOk() (*string, bool) {
// HasCrc32Hash returns a boolean if a field has been set.
func (o *Hashes) HasCrc32Hash() bool {
if o != nil && o.Crc32Hash != nil {
if o != nil && !IsNil(o.Crc32Hash) {
return true
}
@@ -77,7 +80,7 @@ func (o *Hashes) SetCrc32Hash(v string) {
// GetQuickXorHash returns the QuickXorHash field value if set, zero value otherwise.
func (o *Hashes) GetQuickXorHash() string {
if o == nil || o.QuickXorHash == nil {
if o == nil || IsNil(o.QuickXorHash) {
var ret string
return ret
}
@@ -87,7 +90,7 @@ func (o *Hashes) GetQuickXorHash() string {
// GetQuickXorHashOk returns a tuple with the QuickXorHash field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Hashes) GetQuickXorHashOk() (*string, bool) {
if o == nil || o.QuickXorHash == nil {
if o == nil || IsNil(o.QuickXorHash) {
return nil, false
}
return o.QuickXorHash, true
@@ -95,7 +98,7 @@ func (o *Hashes) GetQuickXorHashOk() (*string, bool) {
// HasQuickXorHash returns a boolean if a field has been set.
func (o *Hashes) HasQuickXorHash() bool {
if o != nil && o.QuickXorHash != nil {
if o != nil && !IsNil(o.QuickXorHash) {
return true
}
@@ -109,7 +112,7 @@ func (o *Hashes) SetQuickXorHash(v string) {
// GetSha1Hash returns the Sha1Hash field value if set, zero value otherwise.
func (o *Hashes) GetSha1Hash() string {
if o == nil || o.Sha1Hash == nil {
if o == nil || IsNil(o.Sha1Hash) {
var ret string
return ret
}
@@ -119,7 +122,7 @@ func (o *Hashes) GetSha1Hash() string {
// GetSha1HashOk returns a tuple with the Sha1Hash field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Hashes) GetSha1HashOk() (*string, bool) {
if o == nil || o.Sha1Hash == nil {
if o == nil || IsNil(o.Sha1Hash) {
return nil, false
}
return o.Sha1Hash, true
@@ -127,7 +130,7 @@ func (o *Hashes) GetSha1HashOk() (*string, bool) {
// HasSha1Hash returns a boolean if a field has been set.
func (o *Hashes) HasSha1Hash() bool {
if o != nil && o.Sha1Hash != nil {
if o != nil && !IsNil(o.Sha1Hash) {
return true
}
@@ -141,7 +144,7 @@ func (o *Hashes) SetSha1Hash(v string) {
// GetSha256Hash returns the Sha256Hash field value if set, zero value otherwise.
func (o *Hashes) GetSha256Hash() string {
if o == nil || o.Sha256Hash == nil {
if o == nil || IsNil(o.Sha256Hash) {
var ret string
return ret
}
@@ -151,7 +154,7 @@ func (o *Hashes) GetSha256Hash() string {
// GetSha256HashOk returns a tuple with the Sha256Hash field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Hashes) GetSha256HashOk() (*string, bool) {
if o == nil || o.Sha256Hash == nil {
if o == nil || IsNil(o.Sha256Hash) {
return nil, false
}
return o.Sha256Hash, true
@@ -159,7 +162,7 @@ func (o *Hashes) GetSha256HashOk() (*string, bool) {
// HasSha256Hash returns a boolean if a field has been set.
func (o *Hashes) HasSha256Hash() bool {
if o != nil && o.Sha256Hash != nil {
if o != nil && !IsNil(o.Sha256Hash) {
return true
}
@@ -172,22 +175,30 @@ func (o *Hashes) SetSha256Hash(v string) {
}
func (o Hashes) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Crc32Hash != nil {
toSerialize["crc32Hash"] = o.Crc32Hash
}
if o.QuickXorHash != nil {
toSerialize["quickXorHash"] = o.QuickXorHash
}
if o.Sha1Hash != nil {
toSerialize["sha1Hash"] = o.Sha1Hash
}
if o.Sha256Hash != nil {
toSerialize["sha256Hash"] = o.Sha256Hash
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Hashes) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Crc32Hash) {
toSerialize["crc32Hash"] = o.Crc32Hash
}
if !IsNil(o.QuickXorHash) {
toSerialize["quickXorHash"] = o.QuickXorHash
}
if !IsNil(o.Sha1Hash) {
toSerialize["sha1Hash"] = o.Sha1Hash
}
if !IsNil(o.Sha256Hash) {
toSerialize["sha256Hash"] = o.Sha256Hash
}
return toSerialize, nil
}
type NullableHashes struct {
value *Hashes
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the Identity type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Identity{}
// Identity struct for Identity
type Identity struct {
// The identity's display name. Note that this may not always be available or up to date. For example, if a user changes their display name, the API may show the new value in a future response, but the items associated with the user won't show up as having changed when using delta.
@@ -66,7 +69,7 @@ func (o *Identity) SetDisplayName(v string) {
// GetId returns the Id field value if set, zero value otherwise.
func (o *Identity) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -76,7 +79,7 @@ func (o *Identity) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -84,7 +87,7 @@ func (o *Identity) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *Identity) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -97,16 +100,22 @@ func (o *Identity) SetId(v string) {
}
func (o Identity) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["displayName"] = o.DisplayName
}
if o.Id != nil {
toSerialize["id"] = o.Id
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Identity) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["displayName"] = o.DisplayName
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
return toSerialize, nil
}
type NullableIdentity struct {
value *Identity
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the IdentitySet type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &IdentitySet{}
// IdentitySet Optional. User account.
type IdentitySet struct {
Application *Identity `json:"application,omitempty"`
@@ -41,7 +44,7 @@ func NewIdentitySetWithDefaults() *IdentitySet {
// GetApplication returns the Application field value if set, zero value otherwise.
func (o *IdentitySet) GetApplication() Identity {
if o == nil || o.Application == nil {
if o == nil || IsNil(o.Application) {
var ret Identity
return ret
}
@@ -51,7 +54,7 @@ func (o *IdentitySet) GetApplication() Identity {
// GetApplicationOk returns a tuple with the Application field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentitySet) GetApplicationOk() (*Identity, bool) {
if o == nil || o.Application == nil {
if o == nil || IsNil(o.Application) {
return nil, false
}
return o.Application, true
@@ -59,7 +62,7 @@ func (o *IdentitySet) GetApplicationOk() (*Identity, bool) {
// HasApplication returns a boolean if a field has been set.
func (o *IdentitySet) HasApplication() bool {
if o != nil && o.Application != nil {
if o != nil && !IsNil(o.Application) {
return true
}
@@ -73,7 +76,7 @@ func (o *IdentitySet) SetApplication(v Identity) {
// GetDevice returns the Device field value if set, zero value otherwise.
func (o *IdentitySet) GetDevice() Identity {
if o == nil || o.Device == nil {
if o == nil || IsNil(o.Device) {
var ret Identity
return ret
}
@@ -83,7 +86,7 @@ func (o *IdentitySet) GetDevice() Identity {
// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentitySet) GetDeviceOk() (*Identity, bool) {
if o == nil || o.Device == nil {
if o == nil || IsNil(o.Device) {
return nil, false
}
return o.Device, true
@@ -91,7 +94,7 @@ func (o *IdentitySet) GetDeviceOk() (*Identity, bool) {
// HasDevice returns a boolean if a field has been set.
func (o *IdentitySet) HasDevice() bool {
if o != nil && o.Device != nil {
if o != nil && !IsNil(o.Device) {
return true
}
@@ -105,7 +108,7 @@ func (o *IdentitySet) SetDevice(v Identity) {
// GetUser returns the User field value if set, zero value otherwise.
func (o *IdentitySet) GetUser() Identity {
if o == nil || o.User == nil {
if o == nil || IsNil(o.User) {
var ret Identity
return ret
}
@@ -115,7 +118,7 @@ func (o *IdentitySet) GetUser() Identity {
// GetUserOk returns a tuple with the User field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentitySet) GetUserOk() (*Identity, bool) {
if o == nil || o.User == nil {
if o == nil || IsNil(o.User) {
return nil, false
}
return o.User, true
@@ -123,7 +126,7 @@ func (o *IdentitySet) GetUserOk() (*Identity, bool) {
// HasUser returns a boolean if a field has been set.
func (o *IdentitySet) HasUser() bool {
if o != nil && o.User != nil {
if o != nil && !IsNil(o.User) {
return true
}
@@ -137,7 +140,7 @@ func (o *IdentitySet) SetUser(v Identity) {
// GetGroup returns the Group field value if set, zero value otherwise.
func (o *IdentitySet) GetGroup() Identity {
if o == nil || o.Group == nil {
if o == nil || IsNil(o.Group) {
var ret Identity
return ret
}
@@ -147,7 +150,7 @@ func (o *IdentitySet) GetGroup() Identity {
// GetGroupOk returns a tuple with the Group field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *IdentitySet) GetGroupOk() (*Identity, bool) {
if o == nil || o.Group == nil {
if o == nil || IsNil(o.Group) {
return nil, false
}
return o.Group, true
@@ -155,7 +158,7 @@ func (o *IdentitySet) GetGroupOk() (*Identity, bool) {
// HasGroup returns a boolean if a field has been set.
func (o *IdentitySet) HasGroup() bool {
if o != nil && o.Group != nil {
if o != nil && !IsNil(o.Group) {
return true
}
@@ -168,22 +171,30 @@ func (o *IdentitySet) SetGroup(v Identity) {
}
func (o IdentitySet) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Application != nil {
toSerialize["application"] = o.Application
}
if o.Device != nil {
toSerialize["device"] = o.Device
}
if o.User != nil {
toSerialize["user"] = o.User
}
if o.Group != nil {
toSerialize["group"] = o.Group
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o IdentitySet) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Application) {
toSerialize["application"] = o.Application
}
if !IsNil(o.Device) {
toSerialize["device"] = o.Device
}
if !IsNil(o.User) {
toSerialize["user"] = o.User
}
if !IsNil(o.Group) {
toSerialize["group"] = o.Group
}
return toSerialize, nil
}
type NullableIdentitySet struct {
value *IdentitySet
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the Image type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Image{}
// Image Image metadata, if the item is an image. Read-only.
type Image struct {
// Optional. Height of the image, in pixels. Read-only.
@@ -41,7 +44,7 @@ func NewImageWithDefaults() *Image {
// GetHeight returns the Height field value if set, zero value otherwise.
func (o *Image) GetHeight() int32 {
if o == nil || o.Height == nil {
if o == nil || IsNil(o.Height) {
var ret int32
return ret
}
@@ -51,7 +54,7 @@ func (o *Image) GetHeight() int32 {
// GetHeightOk returns a tuple with the Height field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Image) GetHeightOk() (*int32, bool) {
if o == nil || o.Height == nil {
if o == nil || IsNil(o.Height) {
return nil, false
}
return o.Height, true
@@ -59,7 +62,7 @@ func (o *Image) GetHeightOk() (*int32, bool) {
// HasHeight returns a boolean if a field has been set.
func (o *Image) HasHeight() bool {
if o != nil && o.Height != nil {
if o != nil && !IsNil(o.Height) {
return true
}
@@ -73,7 +76,7 @@ func (o *Image) SetHeight(v int32) {
// GetWidth returns the Width field value if set, zero value otherwise.
func (o *Image) GetWidth() int32 {
if o == nil || o.Width == nil {
if o == nil || IsNil(o.Width) {
var ret int32
return ret
}
@@ -83,7 +86,7 @@ func (o *Image) GetWidth() int32 {
// GetWidthOk returns a tuple with the Width field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Image) GetWidthOk() (*int32, bool) {
if o == nil || o.Width == nil {
if o == nil || IsNil(o.Width) {
return nil, false
}
return o.Width, true
@@ -91,7 +94,7 @@ func (o *Image) GetWidthOk() (*int32, bool) {
// HasWidth returns a boolean if a field has been set.
func (o *Image) HasWidth() bool {
if o != nil && o.Width != nil {
if o != nil && !IsNil(o.Width) {
return true
}
@@ -104,16 +107,24 @@ func (o *Image) SetWidth(v int32) {
}
func (o Image) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Height != nil {
toSerialize["height"] = o.Height
}
if o.Width != nil {
toSerialize["width"] = o.Width
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Image) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Height) {
toSerialize["height"] = o.Height
}
if !IsNil(o.Width) {
toSerialize["width"] = o.Width
}
return toSerialize, nil
}
type NullableImage struct {
value *Image
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the ItemReference type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ItemReference{}
// ItemReference struct for ItemReference
type ItemReference struct {
// Unique identifier of the drive instance that contains the item. Read-only.
@@ -26,8 +29,6 @@ type ItemReference struct {
Name *string `json:"name,omitempty"`
// Path that can be used to navigate to the item. Read-only.
Path *string `json:"path,omitempty"`
// A unique identifier for a shared resource that can be accessed via the [Shares][] API.
ShareId *string `json:"shareId,omitempty"`
}
// NewItemReference instantiates a new ItemReference object
@@ -49,7 +50,7 @@ func NewItemReferenceWithDefaults() *ItemReference {
// GetDriveId returns the DriveId field value if set, zero value otherwise.
func (o *ItemReference) GetDriveId() string {
if o == nil || o.DriveId == nil {
if o == nil || IsNil(o.DriveId) {
var ret string
return ret
}
@@ -59,7 +60,7 @@ func (o *ItemReference) GetDriveId() string {
// GetDriveIdOk returns a tuple with the DriveId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ItemReference) GetDriveIdOk() (*string, bool) {
if o == nil || o.DriveId == nil {
if o == nil || IsNil(o.DriveId) {
return nil, false
}
return o.DriveId, true
@@ -67,7 +68,7 @@ func (o *ItemReference) GetDriveIdOk() (*string, bool) {
// HasDriveId returns a boolean if a field has been set.
func (o *ItemReference) HasDriveId() bool {
if o != nil && o.DriveId != nil {
if o != nil && !IsNil(o.DriveId) {
return true
}
@@ -81,7 +82,7 @@ func (o *ItemReference) SetDriveId(v string) {
// GetDriveType returns the DriveType field value if set, zero value otherwise.
func (o *ItemReference) GetDriveType() string {
if o == nil || o.DriveType == nil {
if o == nil || IsNil(o.DriveType) {
var ret string
return ret
}
@@ -91,7 +92,7 @@ func (o *ItemReference) GetDriveType() string {
// GetDriveTypeOk returns a tuple with the DriveType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ItemReference) GetDriveTypeOk() (*string, bool) {
if o == nil || o.DriveType == nil {
if o == nil || IsNil(o.DriveType) {
return nil, false
}
return o.DriveType, true
@@ -99,7 +100,7 @@ func (o *ItemReference) GetDriveTypeOk() (*string, bool) {
// HasDriveType returns a boolean if a field has been set.
func (o *ItemReference) HasDriveType() bool {
if o != nil && o.DriveType != nil {
if o != nil && !IsNil(o.DriveType) {
return true
}
@@ -113,7 +114,7 @@ func (o *ItemReference) SetDriveType(v string) {
// GetId returns the Id field value if set, zero value otherwise.
func (o *ItemReference) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -123,7 +124,7 @@ func (o *ItemReference) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ItemReference) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -131,7 +132,7 @@ func (o *ItemReference) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *ItemReference) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -145,7 +146,7 @@ func (o *ItemReference) SetId(v string) {
// GetName returns the Name field value if set, zero value otherwise.
func (o *ItemReference) GetName() string {
if o == nil || o.Name == nil {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
@@ -155,7 +156,7 @@ func (o *ItemReference) GetName() string {
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ItemReference) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
@@ -163,7 +164,7 @@ func (o *ItemReference) GetNameOk() (*string, bool) {
// HasName returns a boolean if a field has been set.
func (o *ItemReference) HasName() bool {
if o != nil && o.Name != nil {
if o != nil && !IsNil(o.Name) {
return true
}
@@ -177,7 +178,7 @@ func (o *ItemReference) SetName(v string) {
// GetPath returns the Path field value if set, zero value otherwise.
func (o *ItemReference) GetPath() string {
if o == nil || o.Path == nil {
if o == nil || IsNil(o.Path) {
var ret string
return ret
}
@@ -187,7 +188,7 @@ func (o *ItemReference) GetPath() string {
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ItemReference) GetPathOk() (*string, bool) {
if o == nil || o.Path == nil {
if o == nil || IsNil(o.Path) {
return nil, false
}
return o.Path, true
@@ -195,7 +196,7 @@ func (o *ItemReference) GetPathOk() (*string, bool) {
// HasPath returns a boolean if a field has been set.
func (o *ItemReference) HasPath() bool {
if o != nil && o.Path != nil {
if o != nil && !IsNil(o.Path) {
return true
}
@@ -207,61 +208,34 @@ func (o *ItemReference) SetPath(v string) {
o.Path = &v
}
// GetShareId returns the ShareId field value if set, zero value otherwise.
func (o *ItemReference) GetShareId() string {
if o == nil || o.ShareId == nil {
var ret string
return ret
}
return *o.ShareId
}
// GetShareIdOk returns a tuple with the ShareId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ItemReference) GetShareIdOk() (*string, bool) {
if o == nil || o.ShareId == nil {
return nil, false
}
return o.ShareId, true
}
// HasShareId returns a boolean if a field has been set.
func (o *ItemReference) HasShareId() bool {
if o != nil && o.ShareId != nil {
return true
}
return false
}
// SetShareId gets a reference to the given string and assigns it to the ShareId field.
func (o *ItemReference) SetShareId(v string) {
o.ShareId = &v
}
func (o ItemReference) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.DriveId != nil {
toSerialize["driveId"] = o.DriveId
}
if o.DriveType != nil {
toSerialize["driveType"] = o.DriveType
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.Name != nil {
toSerialize["name"] = o.Name
}
if o.Path != nil {
toSerialize["path"] = o.Path
}
if o.ShareId != nil {
toSerialize["shareId"] = o.ShareId
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ItemReference) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.DriveId) {
toSerialize["driveId"] = o.DriveId
}
if !IsNil(o.DriveType) {
toSerialize["driveType"] = o.DriveType
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Path) {
toSerialize["path"] = o.Path
}
return toSerialize, nil
}
type NullableItemReference struct {
value *ItemReference
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the MemberReference type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MemberReference{}
// MemberReference struct for MemberReference
type MemberReference struct {
OdataId *string `json:"@odata.id,omitempty"`
@@ -38,7 +41,7 @@ func NewMemberReferenceWithDefaults() *MemberReference {
// GetOdataId returns the OdataId field value if set, zero value otherwise.
func (o *MemberReference) GetOdataId() string {
if o == nil || o.OdataId == nil {
if o == nil || IsNil(o.OdataId) {
var ret string
return ret
}
@@ -48,7 +51,7 @@ func (o *MemberReference) GetOdataId() string {
// GetOdataIdOk returns a tuple with the OdataId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MemberReference) GetOdataIdOk() (*string, bool) {
if o == nil || o.OdataId == nil {
if o == nil || IsNil(o.OdataId) {
return nil, false
}
return o.OdataId, true
@@ -56,7 +59,7 @@ func (o *MemberReference) GetOdataIdOk() (*string, bool) {
// HasOdataId returns a boolean if a field has been set.
func (o *MemberReference) HasOdataId() bool {
if o != nil && o.OdataId != nil {
if o != nil && !IsNil(o.OdataId) {
return true
}
@@ -69,13 +72,21 @@ func (o *MemberReference) SetOdataId(v string) {
}
func (o MemberReference) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.OdataId != nil {
toSerialize["@odata.id"] = o.OdataId
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MemberReference) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.OdataId) {
toSerialize["@odata.id"] = o.OdataId
}
return toSerialize, nil
}
type NullableMemberReference struct {
value *MemberReference
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the ObjectIdentity type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ObjectIdentity{}
// ObjectIdentity Represents an identity used to sign in to a user account
type ObjectIdentity struct {
// domain of the Provider issuing the identity
@@ -41,7 +44,7 @@ func NewObjectIdentityWithDefaults() *ObjectIdentity {
// GetIssuer returns the Issuer field value if set, zero value otherwise.
func (o *ObjectIdentity) GetIssuer() string {
if o == nil || o.Issuer == nil {
if o == nil || IsNil(o.Issuer) {
var ret string
return ret
}
@@ -51,7 +54,7 @@ func (o *ObjectIdentity) GetIssuer() string {
// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ObjectIdentity) GetIssuerOk() (*string, bool) {
if o == nil || o.Issuer == nil {
if o == nil || IsNil(o.Issuer) {
return nil, false
}
return o.Issuer, true
@@ -59,7 +62,7 @@ func (o *ObjectIdentity) GetIssuerOk() (*string, bool) {
// HasIssuer returns a boolean if a field has been set.
func (o *ObjectIdentity) HasIssuer() bool {
if o != nil && o.Issuer != nil {
if o != nil && !IsNil(o.Issuer) {
return true
}
@@ -73,7 +76,7 @@ func (o *ObjectIdentity) SetIssuer(v string) {
// GetIssuerAssignedId returns the IssuerAssignedId field value if set, zero value otherwise.
func (o *ObjectIdentity) GetIssuerAssignedId() string {
if o == nil || o.IssuerAssignedId == nil {
if o == nil || IsNil(o.IssuerAssignedId) {
var ret string
return ret
}
@@ -83,7 +86,7 @@ func (o *ObjectIdentity) GetIssuerAssignedId() string {
// GetIssuerAssignedIdOk returns a tuple with the IssuerAssignedId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ObjectIdentity) GetIssuerAssignedIdOk() (*string, bool) {
if o == nil || o.IssuerAssignedId == nil {
if o == nil || IsNil(o.IssuerAssignedId) {
return nil, false
}
return o.IssuerAssignedId, true
@@ -91,7 +94,7 @@ func (o *ObjectIdentity) GetIssuerAssignedIdOk() (*string, bool) {
// HasIssuerAssignedId returns a boolean if a field has been set.
func (o *ObjectIdentity) HasIssuerAssignedId() bool {
if o != nil && o.IssuerAssignedId != nil {
if o != nil && !IsNil(o.IssuerAssignedId) {
return true
}
@@ -104,16 +107,24 @@ func (o *ObjectIdentity) SetIssuerAssignedId(v string) {
}
func (o ObjectIdentity) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Issuer != nil {
toSerialize["issuer"] = o.Issuer
}
if o.IssuerAssignedId != nil {
toSerialize["issuerAssignedId"] = o.IssuerAssignedId
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ObjectIdentity) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Issuer) {
toSerialize["issuer"] = o.Issuer
}
if !IsNil(o.IssuerAssignedId) {
toSerialize["issuerAssignedId"] = o.IssuerAssignedId
}
return toSerialize, nil
}
type NullableObjectIdentity struct {
value *ObjectIdentity
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the OdataError type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OdataError{}
// OdataError struct for OdataError
type OdataError struct {
Error OdataErrorMain `json:"error"`
@@ -62,13 +65,19 @@ func (o *OdataError) SetError(v OdataErrorMain) {
}
func (o OdataError) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["error"] = o.Error
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OdataError) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["error"] = o.Error
return toSerialize, nil
}
type NullableOdataError struct {
value *OdataError
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the OdataErrorDetail type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OdataErrorDetail{}
// OdataErrorDetail struct for OdataErrorDetail
type OdataErrorDetail struct {
Code string `json:"code"`
@@ -90,7 +93,7 @@ func (o *OdataErrorDetail) SetMessage(v string) {
// GetTarget returns the Target field value if set, zero value otherwise.
func (o *OdataErrorDetail) GetTarget() string {
if o == nil || o.Target == nil {
if o == nil || IsNil(o.Target) {
var ret string
return ret
}
@@ -100,7 +103,7 @@ func (o *OdataErrorDetail) GetTarget() string {
// GetTargetOk returns a tuple with the Target field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OdataErrorDetail) GetTargetOk() (*string, bool) {
if o == nil || o.Target == nil {
if o == nil || IsNil(o.Target) {
return nil, false
}
return o.Target, true
@@ -108,7 +111,7 @@ func (o *OdataErrorDetail) GetTargetOk() (*string, bool) {
// HasTarget returns a boolean if a field has been set.
func (o *OdataErrorDetail) HasTarget() bool {
if o != nil && o.Target != nil {
if o != nil && !IsNil(o.Target) {
return true
}
@@ -121,19 +124,23 @@ func (o *OdataErrorDetail) SetTarget(v string) {
}
func (o OdataErrorDetail) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["code"] = o.Code
}
if true {
toSerialize["message"] = o.Message
}
if o.Target != nil {
toSerialize["target"] = o.Target
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OdataErrorDetail) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["code"] = o.Code
toSerialize["message"] = o.Message
if !IsNil(o.Target) {
toSerialize["target"] = o.Target
}
return toSerialize, nil
}
type NullableOdataErrorDetail struct {
value *OdataErrorDetail
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the OdataErrorMain type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OdataErrorMain{}
// OdataErrorMain struct for OdataErrorMain
type OdataErrorMain struct {
Code string `json:"code"`
@@ -93,7 +96,7 @@ func (o *OdataErrorMain) SetMessage(v string) {
// GetTarget returns the Target field value if set, zero value otherwise.
func (o *OdataErrorMain) GetTarget() string {
if o == nil || o.Target == nil {
if o == nil || IsNil(o.Target) {
var ret string
return ret
}
@@ -103,7 +106,7 @@ func (o *OdataErrorMain) GetTarget() string {
// GetTargetOk returns a tuple with the Target field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OdataErrorMain) GetTargetOk() (*string, bool) {
if o == nil || o.Target == nil {
if o == nil || IsNil(o.Target) {
return nil, false
}
return o.Target, true
@@ -111,7 +114,7 @@ func (o *OdataErrorMain) GetTargetOk() (*string, bool) {
// HasTarget returns a boolean if a field has been set.
func (o *OdataErrorMain) HasTarget() bool {
if o != nil && o.Target != nil {
if o != nil && !IsNil(o.Target) {
return true
}
@@ -125,7 +128,7 @@ func (o *OdataErrorMain) SetTarget(v string) {
// GetDetails returns the Details field value if set, zero value otherwise.
func (o *OdataErrorMain) GetDetails() []OdataErrorDetail {
if o == nil || o.Details == nil {
if o == nil || IsNil(o.Details) {
var ret []OdataErrorDetail
return ret
}
@@ -135,7 +138,7 @@ func (o *OdataErrorMain) GetDetails() []OdataErrorDetail {
// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OdataErrorMain) GetDetailsOk() ([]OdataErrorDetail, bool) {
if o == nil || o.Details == nil {
if o == nil || IsNil(o.Details) {
return nil, false
}
return o.Details, true
@@ -143,7 +146,7 @@ func (o *OdataErrorMain) GetDetailsOk() ([]OdataErrorDetail, bool) {
// HasDetails returns a boolean if a field has been set.
func (o *OdataErrorMain) HasDetails() bool {
if o != nil && o.Details != nil {
if o != nil && !IsNil(o.Details) {
return true
}
@@ -157,7 +160,7 @@ func (o *OdataErrorMain) SetDetails(v []OdataErrorDetail) {
// GetInnererror returns the Innererror field value if set, zero value otherwise.
func (o *OdataErrorMain) GetInnererror() map[string]interface{} {
if o == nil || o.Innererror == nil {
if o == nil || IsNil(o.Innererror) {
var ret map[string]interface{}
return ret
}
@@ -167,15 +170,15 @@ func (o *OdataErrorMain) GetInnererror() map[string]interface{} {
// GetInnererrorOk returns a tuple with the Innererror field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OdataErrorMain) GetInnererrorOk() (map[string]interface{}, bool) {
if o == nil || o.Innererror == nil {
return nil, false
if o == nil || IsNil(o.Innererror) {
return map[string]interface{}{}, false
}
return o.Innererror, true
}
// HasInnererror returns a boolean if a field has been set.
func (o *OdataErrorMain) HasInnererror() bool {
if o != nil && o.Innererror != nil {
if o != nil && !IsNil(o.Innererror) {
return true
}
@@ -188,25 +191,29 @@ func (o *OdataErrorMain) SetInnererror(v map[string]interface{}) {
}
func (o OdataErrorMain) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["code"] = o.Code
}
if true {
toSerialize["message"] = o.Message
}
if o.Target != nil {
toSerialize["target"] = o.Target
}
if o.Details != nil {
toSerialize["details"] = o.Details
}
if o.Innererror != nil {
toSerialize["innererror"] = o.Innererror
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OdataErrorMain) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["code"] = o.Code
toSerialize["message"] = o.Message
if !IsNil(o.Target) {
toSerialize["target"] = o.Target
}
if !IsNil(o.Details) {
toSerialize["details"] = o.Details
}
if !IsNil(o.Innererror) {
toSerialize["innererror"] = o.Innererror
}
return toSerialize, nil
}
type NullableOdataErrorMain struct {
value *OdataErrorMain
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the OpenGraphFile type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &OpenGraphFile{}
// OpenGraphFile File metadata, if the item is a file. Read-only.
type OpenGraphFile struct {
Hashes *Hashes `json:"hashes,omitempty"`
@@ -41,7 +44,7 @@ func NewOpenGraphFileWithDefaults() *OpenGraphFile {
// GetHashes returns the Hashes field value if set, zero value otherwise.
func (o *OpenGraphFile) GetHashes() Hashes {
if o == nil || o.Hashes == nil {
if o == nil || IsNil(o.Hashes) {
var ret Hashes
return ret
}
@@ -51,7 +54,7 @@ func (o *OpenGraphFile) GetHashes() Hashes {
// GetHashesOk returns a tuple with the Hashes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenGraphFile) GetHashesOk() (*Hashes, bool) {
if o == nil || o.Hashes == nil {
if o == nil || IsNil(o.Hashes) {
return nil, false
}
return o.Hashes, true
@@ -59,7 +62,7 @@ func (o *OpenGraphFile) GetHashesOk() (*Hashes, bool) {
// HasHashes returns a boolean if a field has been set.
func (o *OpenGraphFile) HasHashes() bool {
if o != nil && o.Hashes != nil {
if o != nil && !IsNil(o.Hashes) {
return true
}
@@ -73,7 +76,7 @@ func (o *OpenGraphFile) SetHashes(v Hashes) {
// GetMimeType returns the MimeType field value if set, zero value otherwise.
func (o *OpenGraphFile) GetMimeType() string {
if o == nil || o.MimeType == nil {
if o == nil || IsNil(o.MimeType) {
var ret string
return ret
}
@@ -83,7 +86,7 @@ func (o *OpenGraphFile) GetMimeType() string {
// GetMimeTypeOk returns a tuple with the MimeType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenGraphFile) GetMimeTypeOk() (*string, bool) {
if o == nil || o.MimeType == nil {
if o == nil || IsNil(o.MimeType) {
return nil, false
}
return o.MimeType, true
@@ -91,7 +94,7 @@ func (o *OpenGraphFile) GetMimeTypeOk() (*string, bool) {
// HasMimeType returns a boolean if a field has been set.
func (o *OpenGraphFile) HasMimeType() bool {
if o != nil && o.MimeType != nil {
if o != nil && !IsNil(o.MimeType) {
return true
}
@@ -105,7 +108,7 @@ func (o *OpenGraphFile) SetMimeType(v string) {
// GetProcessingMetadata returns the ProcessingMetadata field value if set, zero value otherwise.
func (o *OpenGraphFile) GetProcessingMetadata() bool {
if o == nil || o.ProcessingMetadata == nil {
if o == nil || IsNil(o.ProcessingMetadata) {
var ret bool
return ret
}
@@ -115,7 +118,7 @@ func (o *OpenGraphFile) GetProcessingMetadata() bool {
// GetProcessingMetadataOk returns a tuple with the ProcessingMetadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *OpenGraphFile) GetProcessingMetadataOk() (*bool, bool) {
if o == nil || o.ProcessingMetadata == nil {
if o == nil || IsNil(o.ProcessingMetadata) {
return nil, false
}
return o.ProcessingMetadata, true
@@ -123,7 +126,7 @@ func (o *OpenGraphFile) GetProcessingMetadataOk() (*bool, bool) {
// HasProcessingMetadata returns a boolean if a field has been set.
func (o *OpenGraphFile) HasProcessingMetadata() bool {
if o != nil && o.ProcessingMetadata != nil {
if o != nil && !IsNil(o.ProcessingMetadata) {
return true
}
@@ -136,19 +139,27 @@ func (o *OpenGraphFile) SetProcessingMetadata(v bool) {
}
func (o OpenGraphFile) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Hashes != nil {
toSerialize["hashes"] = o.Hashes
}
if o.MimeType != nil {
toSerialize["mimeType"] = o.MimeType
}
if o.ProcessingMetadata != nil {
toSerialize["processingMetadata"] = o.ProcessingMetadata
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o OpenGraphFile) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Hashes) {
toSerialize["hashes"] = o.Hashes
}
if !IsNil(o.MimeType) {
toSerialize["mimeType"] = o.MimeType
}
if !IsNil(o.ProcessingMetadata) {
toSerialize["processingMetadata"] = o.ProcessingMetadata
}
return toSerialize, nil
}
type NullableOpenGraphFile struct {
value *OpenGraphFile
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the PasswordChange type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PasswordChange{}
// PasswordChange struct for PasswordChange
type PasswordChange struct {
CurrentPassword string `json:"currentPassword"`
@@ -88,16 +91,20 @@ func (o *PasswordChange) SetNewPassword(v string) {
}
func (o PasswordChange) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["currentPassword"] = o.CurrentPassword
}
if true {
toSerialize["newPassword"] = o.NewPassword
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PasswordChange) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["currentPassword"] = o.CurrentPassword
toSerialize["newPassword"] = o.NewPassword
return toSerialize, nil
}
type NullablePasswordChange struct {
value *PasswordChange
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the PasswordProfile type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PasswordProfile{}
// PasswordProfile Password Profile associated with a user
type PasswordProfile struct {
// If true the user is required to change their password upon the next login
@@ -45,7 +48,7 @@ func NewPasswordProfileWithDefaults() *PasswordProfile {
// GetForceChangePasswordNextSignIn returns the ForceChangePasswordNextSignIn field value if set, zero value otherwise.
func (o *PasswordProfile) GetForceChangePasswordNextSignIn() bool {
if o == nil || o.ForceChangePasswordNextSignIn == nil {
if o == nil || IsNil(o.ForceChangePasswordNextSignIn) {
var ret bool
return ret
}
@@ -55,7 +58,7 @@ func (o *PasswordProfile) GetForceChangePasswordNextSignIn() bool {
// GetForceChangePasswordNextSignInOk returns a tuple with the ForceChangePasswordNextSignIn field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PasswordProfile) GetForceChangePasswordNextSignInOk() (*bool, bool) {
if o == nil || o.ForceChangePasswordNextSignIn == nil {
if o == nil || IsNil(o.ForceChangePasswordNextSignIn) {
return nil, false
}
return o.ForceChangePasswordNextSignIn, true
@@ -63,7 +66,7 @@ func (o *PasswordProfile) GetForceChangePasswordNextSignInOk() (*bool, bool) {
// HasForceChangePasswordNextSignIn returns a boolean if a field has been set.
func (o *PasswordProfile) HasForceChangePasswordNextSignIn() bool {
if o != nil && o.ForceChangePasswordNextSignIn != nil {
if o != nil && !IsNil(o.ForceChangePasswordNextSignIn) {
return true
}
@@ -77,7 +80,7 @@ func (o *PasswordProfile) SetForceChangePasswordNextSignIn(v bool) {
// GetPassword returns the Password field value if set, zero value otherwise.
func (o *PasswordProfile) GetPassword() string {
if o == nil || o.Password == nil {
if o == nil || IsNil(o.Password) {
var ret string
return ret
}
@@ -87,7 +90,7 @@ func (o *PasswordProfile) GetPassword() string {
// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PasswordProfile) GetPasswordOk() (*string, bool) {
if o == nil || o.Password == nil {
if o == nil || IsNil(o.Password) {
return nil, false
}
return o.Password, true
@@ -95,7 +98,7 @@ func (o *PasswordProfile) GetPasswordOk() (*string, bool) {
// HasPassword returns a boolean if a field has been set.
func (o *PasswordProfile) HasPassword() bool {
if o != nil && o.Password != nil {
if o != nil && !IsNil(o.Password) {
return true
}
@@ -108,16 +111,24 @@ func (o *PasswordProfile) SetPassword(v string) {
}
func (o PasswordProfile) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.ForceChangePasswordNextSignIn != nil {
toSerialize["forceChangePasswordNextSignIn"] = o.ForceChangePasswordNextSignIn
}
if o.Password != nil {
toSerialize["password"] = o.Password
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PasswordProfile) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ForceChangePasswordNextSignIn) {
toSerialize["forceChangePasswordNextSignIn"] = o.ForceChangePasswordNextSignIn
}
if !IsNil(o.Password) {
toSerialize["password"] = o.Password
}
return toSerialize, nil
}
type NullablePasswordProfile struct {
value *PasswordProfile
isSet bool

View File

@@ -15,12 +15,27 @@ import (
"time"
)
// Permission The Permission resource provides information about a sharing permission granted for a DriveItem resource.
// checks if the Permission type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Permission{}
// Permission The Permission resource provides information about a sharing permission granted for a DriveItem resource. ### Remarks The Permission resource uses *facets* to provide information about the kind of permission represented by the resource. Permissions with a `link` facet represent sharing links created on the item. Sharing links contain a unique token that provides access to the item for anyone with the link. Permissions with a `invitation` facet represent permissions added by inviting specific users or groups to have access to the file.
type Permission struct {
// The unique identifier of the permission among all permissions on the item. Read-only.
Id *string `json:"id,omitempty"`
// Indicates whether the password is set for this permission. This property only appears in the response. Optional. Read-only.
HasPassword *bool `json:"hasPassword,omitempty"`
// An optional expiration date which limits the permission in time.
ExpirationDateTime *time.Time `json:"expirationDateTime,omitempty"`
ExpirationDateTime *time.Time `json:"expirationDateTime,omitempty"`
GrantedToV2 *SharePointIdentitySet `json:"grantedToV2,omitempty"`
Link *SharingLink `json:"link,omitempty"`
Roles []string `json:"roles,omitempty"`
// For link type permissions, the details of the identity to whom permission was granted. This could be used to grant access to a an external user that can be identified by email, aka guest accounts.
// Deprecated
GrantedToIdentities []IdentitySet `json:"grantedToIdentities,omitempty"`
Roles []string `json:"roles,omitempty"`
// Use this to create a permission with custom actions.
LibreGraphPermissionsActions []string `json:"@libre.graph.permissions.actions,omitempty"`
// Properties or facets (see UI.Facet) annotated with this term will not be rendered if the annotation evaluates to true. Users can set this to hide permissons.
UIHidden *bool `json:"@UI.Hidden,omitempty"`
}
// NewPermission instantiates a new Permission object
@@ -40,9 +55,73 @@ func NewPermissionWithDefaults() *Permission {
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *Permission) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Permission) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *Permission) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *Permission) SetId(v string) {
o.Id = &v
}
// GetHasPassword returns the HasPassword field value if set, zero value otherwise.
func (o *Permission) GetHasPassword() bool {
if o == nil || IsNil(o.HasPassword) {
var ret bool
return ret
}
return *o.HasPassword
}
// GetHasPasswordOk returns a tuple with the HasPassword field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Permission) GetHasPasswordOk() (*bool, bool) {
if o == nil || IsNil(o.HasPassword) {
return nil, false
}
return o.HasPassword, true
}
// HasHasPassword returns a boolean if a field has been set.
func (o *Permission) HasHasPassword() bool {
if o != nil && !IsNil(o.HasPassword) {
return true
}
return false
}
// SetHasPassword gets a reference to the given bool and assigns it to the HasPassword field.
func (o *Permission) SetHasPassword(v bool) {
o.HasPassword = &v
}
// GetExpirationDateTime returns the ExpirationDateTime field value if set, zero value otherwise.
func (o *Permission) GetExpirationDateTime() time.Time {
if o == nil || o.ExpirationDateTime == nil {
if o == nil || IsNil(o.ExpirationDateTime) {
var ret time.Time
return ret
}
@@ -52,7 +131,7 @@ func (o *Permission) GetExpirationDateTime() time.Time {
// GetExpirationDateTimeOk returns a tuple with the ExpirationDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Permission) GetExpirationDateTimeOk() (*time.Time, bool) {
if o == nil || o.ExpirationDateTime == nil {
if o == nil || IsNil(o.ExpirationDateTime) {
return nil, false
}
return o.ExpirationDateTime, true
@@ -60,7 +139,7 @@ func (o *Permission) GetExpirationDateTimeOk() (*time.Time, bool) {
// HasExpirationDateTime returns a boolean if a field has been set.
func (o *Permission) HasExpirationDateTime() bool {
if o != nil && o.ExpirationDateTime != nil {
if o != nil && !IsNil(o.ExpirationDateTime) {
return true
}
@@ -72,41 +151,73 @@ func (o *Permission) SetExpirationDateTime(v time.Time) {
o.ExpirationDateTime = &v
}
// GetGrantedToIdentities returns the GrantedToIdentities field value if set, zero value otherwise.
func (o *Permission) GetGrantedToIdentities() []IdentitySet {
if o == nil || o.GrantedToIdentities == nil {
var ret []IdentitySet
// GetGrantedToV2 returns the GrantedToV2 field value if set, zero value otherwise.
func (o *Permission) GetGrantedToV2() SharePointIdentitySet {
if o == nil || IsNil(o.GrantedToV2) {
var ret SharePointIdentitySet
return ret
}
return o.GrantedToIdentities
return *o.GrantedToV2
}
// GetGrantedToIdentitiesOk returns a tuple with the GrantedToIdentities field value if set, nil otherwise
// GetGrantedToV2Ok returns a tuple with the GrantedToV2 field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Permission) GetGrantedToIdentitiesOk() ([]IdentitySet, bool) {
if o == nil || o.GrantedToIdentities == nil {
func (o *Permission) GetGrantedToV2Ok() (*SharePointIdentitySet, bool) {
if o == nil || IsNil(o.GrantedToV2) {
return nil, false
}
return o.GrantedToIdentities, true
return o.GrantedToV2, true
}
// HasGrantedToIdentities returns a boolean if a field has been set.
func (o *Permission) HasGrantedToIdentities() bool {
if o != nil && o.GrantedToIdentities != nil {
// HasGrantedToV2 returns a boolean if a field has been set.
func (o *Permission) HasGrantedToV2() bool {
if o != nil && !IsNil(o.GrantedToV2) {
return true
}
return false
}
// SetGrantedToIdentities gets a reference to the given []IdentitySet and assigns it to the GrantedToIdentities field.
func (o *Permission) SetGrantedToIdentities(v []IdentitySet) {
o.GrantedToIdentities = v
// SetGrantedToV2 gets a reference to the given SharePointIdentitySet and assigns it to the GrantedToV2 field.
func (o *Permission) SetGrantedToV2(v SharePointIdentitySet) {
o.GrantedToV2 = &v
}
// GetLink returns the Link field value if set, zero value otherwise.
func (o *Permission) GetLink() SharingLink {
if o == nil || IsNil(o.Link) {
var ret SharingLink
return ret
}
return *o.Link
}
// GetLinkOk returns a tuple with the Link field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Permission) GetLinkOk() (*SharingLink, bool) {
if o == nil || IsNil(o.Link) {
return nil, false
}
return o.Link, true
}
// HasLink returns a boolean if a field has been set.
func (o *Permission) HasLink() bool {
if o != nil && !IsNil(o.Link) {
return true
}
return false
}
// SetLink gets a reference to the given SharingLink and assigns it to the Link field.
func (o *Permission) SetLink(v SharingLink) {
o.Link = &v
}
// GetRoles returns the Roles field value if set, zero value otherwise.
func (o *Permission) GetRoles() []string {
if o == nil || o.Roles == nil {
if o == nil || IsNil(o.Roles) {
var ret []string
return ret
}
@@ -116,7 +227,7 @@ func (o *Permission) GetRoles() []string {
// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Permission) GetRolesOk() ([]string, bool) {
if o == nil || o.Roles == nil {
if o == nil || IsNil(o.Roles) {
return nil, false
}
return o.Roles, true
@@ -124,7 +235,7 @@ func (o *Permission) GetRolesOk() ([]string, bool) {
// HasRoles returns a boolean if a field has been set.
func (o *Permission) HasRoles() bool {
if o != nil && o.Roles != nil {
if o != nil && !IsNil(o.Roles) {
return true
}
@@ -136,20 +247,145 @@ func (o *Permission) SetRoles(v []string) {
o.Roles = v
}
// GetGrantedToIdentities returns the GrantedToIdentities field value if set, zero value otherwise.
// Deprecated
func (o *Permission) GetGrantedToIdentities() []IdentitySet {
if o == nil || IsNil(o.GrantedToIdentities) {
var ret []IdentitySet
return ret
}
return o.GrantedToIdentities
}
// GetGrantedToIdentitiesOk returns a tuple with the GrantedToIdentities field value if set, nil otherwise
// and a boolean to check if the value has been set.
// Deprecated
func (o *Permission) GetGrantedToIdentitiesOk() ([]IdentitySet, bool) {
if o == nil || IsNil(o.GrantedToIdentities) {
return nil, false
}
return o.GrantedToIdentities, true
}
// HasGrantedToIdentities returns a boolean if a field has been set.
func (o *Permission) HasGrantedToIdentities() bool {
if o != nil && !IsNil(o.GrantedToIdentities) {
return true
}
return false
}
// SetGrantedToIdentities gets a reference to the given []IdentitySet and assigns it to the GrantedToIdentities field.
// Deprecated
func (o *Permission) SetGrantedToIdentities(v []IdentitySet) {
o.GrantedToIdentities = v
}
// GetLibreGraphPermissionsActions returns the LibreGraphPermissionsActions field value if set, zero value otherwise.
func (o *Permission) GetLibreGraphPermissionsActions() []string {
if o == nil || IsNil(o.LibreGraphPermissionsActions) {
var ret []string
return ret
}
return o.LibreGraphPermissionsActions
}
// GetLibreGraphPermissionsActionsOk returns a tuple with the LibreGraphPermissionsActions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Permission) GetLibreGraphPermissionsActionsOk() ([]string, bool) {
if o == nil || IsNil(o.LibreGraphPermissionsActions) {
return nil, false
}
return o.LibreGraphPermissionsActions, true
}
// HasLibreGraphPermissionsActions returns a boolean if a field has been set.
func (o *Permission) HasLibreGraphPermissionsActions() bool {
if o != nil && !IsNil(o.LibreGraphPermissionsActions) {
return true
}
return false
}
// SetLibreGraphPermissionsActions gets a reference to the given []string and assigns it to the LibreGraphPermissionsActions field.
func (o *Permission) SetLibreGraphPermissionsActions(v []string) {
o.LibreGraphPermissionsActions = v
}
// GetUIHidden returns the UIHidden field value if set, zero value otherwise.
func (o *Permission) GetUIHidden() bool {
if o == nil || IsNil(o.UIHidden) {
var ret bool
return ret
}
return *o.UIHidden
}
// GetUIHiddenOk returns a tuple with the UIHidden field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Permission) GetUIHiddenOk() (*bool, bool) {
if o == nil || IsNil(o.UIHidden) {
return nil, false
}
return o.UIHidden, true
}
// HasUIHidden returns a boolean if a field has been set.
func (o *Permission) HasUIHidden() bool {
if o != nil && !IsNil(o.UIHidden) {
return true
}
return false
}
// SetUIHidden gets a reference to the given bool and assigns it to the UIHidden field.
func (o *Permission) SetUIHidden(v bool) {
o.UIHidden = &v
}
func (o Permission) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.ExpirationDateTime != nil {
toSerialize["expirationDateTime"] = o.ExpirationDateTime
}
if o.GrantedToIdentities != nil {
toSerialize["grantedToIdentities"] = o.GrantedToIdentities
}
if o.Roles != nil {
toSerialize["roles"] = o.Roles
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Permission) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.HasPassword) {
toSerialize["hasPassword"] = o.HasPassword
}
if !IsNil(o.ExpirationDateTime) {
toSerialize["expirationDateTime"] = o.ExpirationDateTime
}
if !IsNil(o.GrantedToV2) {
toSerialize["grantedToV2"] = o.GrantedToV2
}
if !IsNil(o.Link) {
toSerialize["link"] = o.Link
}
if !IsNil(o.Roles) {
toSerialize["roles"] = o.Roles
}
if !IsNil(o.GrantedToIdentities) {
toSerialize["grantedToIdentities"] = o.GrantedToIdentities
}
if !IsNil(o.LibreGraphPermissionsActions) {
toSerialize["@libre.graph.permissions.actions"] = o.LibreGraphPermissionsActions
}
if !IsNil(o.UIHidden) {
toSerialize["@UI.Hidden"] = o.UIHidden
}
return toSerialize, nil
}
type NullablePermission struct {
value *Permission
isSet bool

View File

@@ -0,0 +1,422 @@
/*
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"
"time"
)
// checks if the Photo type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Photo{}
// Photo The photo resource provides photo and camera properties, for example, EXIF metadata, on a driveItem.
type Photo struct {
// Camera manufacturer. Read-only.
CameraMake *string `json:"cameraMake,omitempty"`
// Camera model. Read-only.
CameraModel *string `json:"cameraModel,omitempty"`
// The denominator for the exposure time fraction from the camera. Read-only.
ExposureDenominator *float64 `json:"exposureDenominator,omitempty"`
// The numerator for the exposure time fraction from the camera. Read-only.
ExposureNumerator *float64 `json:"exposureNumerator,omitempty"`
// The F-stop value from the camera. Read-only.
FNumber *float64 `json:"fNumber,omitempty"`
// The focal length from the camera. Read-only.
FocalLength *float64 `json:"focalLength,omitempty"`
// The ISO value from the camera. Read-only.
Iso *int32 `json:"iso,omitempty"`
// The orientation value from the camera. Read-only.
Orientation *int32 `json:"orientation,omitempty"`
// Represents the date and time the photo was taken. Read-only.
TakenDateTime *time.Time `json:"takenDateTime,omitempty"`
}
// NewPhoto instantiates a new Photo 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 NewPhoto() *Photo {
this := Photo{}
return &this
}
// NewPhotoWithDefaults instantiates a new Photo 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 NewPhotoWithDefaults() *Photo {
this := Photo{}
return &this
}
// GetCameraMake returns the CameraMake field value if set, zero value otherwise.
func (o *Photo) GetCameraMake() string {
if o == nil || IsNil(o.CameraMake) {
var ret string
return ret
}
return *o.CameraMake
}
// GetCameraMakeOk returns a tuple with the CameraMake field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Photo) GetCameraMakeOk() (*string, bool) {
if o == nil || IsNil(o.CameraMake) {
return nil, false
}
return o.CameraMake, true
}
// HasCameraMake returns a boolean if a field has been set.
func (o *Photo) HasCameraMake() bool {
if o != nil && !IsNil(o.CameraMake) {
return true
}
return false
}
// SetCameraMake gets a reference to the given string and assigns it to the CameraMake field.
func (o *Photo) SetCameraMake(v string) {
o.CameraMake = &v
}
// GetCameraModel returns the CameraModel field value if set, zero value otherwise.
func (o *Photo) GetCameraModel() string {
if o == nil || IsNil(o.CameraModel) {
var ret string
return ret
}
return *o.CameraModel
}
// GetCameraModelOk returns a tuple with the CameraModel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Photo) GetCameraModelOk() (*string, bool) {
if o == nil || IsNil(o.CameraModel) {
return nil, false
}
return o.CameraModel, true
}
// HasCameraModel returns a boolean if a field has been set.
func (o *Photo) HasCameraModel() bool {
if o != nil && !IsNil(o.CameraModel) {
return true
}
return false
}
// SetCameraModel gets a reference to the given string and assigns it to the CameraModel field.
func (o *Photo) SetCameraModel(v string) {
o.CameraModel = &v
}
// GetExposureDenominator returns the ExposureDenominator field value if set, zero value otherwise.
func (o *Photo) GetExposureDenominator() float64 {
if o == nil || IsNil(o.ExposureDenominator) {
var ret float64
return ret
}
return *o.ExposureDenominator
}
// GetExposureDenominatorOk returns a tuple with the ExposureDenominator field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Photo) GetExposureDenominatorOk() (*float64, bool) {
if o == nil || IsNil(o.ExposureDenominator) {
return nil, false
}
return o.ExposureDenominator, true
}
// HasExposureDenominator returns a boolean if a field has been set.
func (o *Photo) HasExposureDenominator() bool {
if o != nil && !IsNil(o.ExposureDenominator) {
return true
}
return false
}
// SetExposureDenominator gets a reference to the given float64 and assigns it to the ExposureDenominator field.
func (o *Photo) SetExposureDenominator(v float64) {
o.ExposureDenominator = &v
}
// GetExposureNumerator returns the ExposureNumerator field value if set, zero value otherwise.
func (o *Photo) GetExposureNumerator() float64 {
if o == nil || IsNil(o.ExposureNumerator) {
var ret float64
return ret
}
return *o.ExposureNumerator
}
// GetExposureNumeratorOk returns a tuple with the ExposureNumerator field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Photo) GetExposureNumeratorOk() (*float64, bool) {
if o == nil || IsNil(o.ExposureNumerator) {
return nil, false
}
return o.ExposureNumerator, true
}
// HasExposureNumerator returns a boolean if a field has been set.
func (o *Photo) HasExposureNumerator() bool {
if o != nil && !IsNil(o.ExposureNumerator) {
return true
}
return false
}
// SetExposureNumerator gets a reference to the given float64 and assigns it to the ExposureNumerator field.
func (o *Photo) SetExposureNumerator(v float64) {
o.ExposureNumerator = &v
}
// GetFNumber returns the FNumber field value if set, zero value otherwise.
func (o *Photo) GetFNumber() float64 {
if o == nil || IsNil(o.FNumber) {
var ret float64
return ret
}
return *o.FNumber
}
// GetFNumberOk returns a tuple with the FNumber field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Photo) GetFNumberOk() (*float64, bool) {
if o == nil || IsNil(o.FNumber) {
return nil, false
}
return o.FNumber, true
}
// HasFNumber returns a boolean if a field has been set.
func (o *Photo) HasFNumber() bool {
if o != nil && !IsNil(o.FNumber) {
return true
}
return false
}
// SetFNumber gets a reference to the given float64 and assigns it to the FNumber field.
func (o *Photo) SetFNumber(v float64) {
o.FNumber = &v
}
// GetFocalLength returns the FocalLength field value if set, zero value otherwise.
func (o *Photo) GetFocalLength() float64 {
if o == nil || IsNil(o.FocalLength) {
var ret float64
return ret
}
return *o.FocalLength
}
// GetFocalLengthOk returns a tuple with the FocalLength field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Photo) GetFocalLengthOk() (*float64, bool) {
if o == nil || IsNil(o.FocalLength) {
return nil, false
}
return o.FocalLength, true
}
// HasFocalLength returns a boolean if a field has been set.
func (o *Photo) HasFocalLength() bool {
if o != nil && !IsNil(o.FocalLength) {
return true
}
return false
}
// SetFocalLength gets a reference to the given float64 and assigns it to the FocalLength field.
func (o *Photo) SetFocalLength(v float64) {
o.FocalLength = &v
}
// GetIso returns the Iso field value if set, zero value otherwise.
func (o *Photo) GetIso() int32 {
if o == nil || IsNil(o.Iso) {
var ret int32
return ret
}
return *o.Iso
}
// GetIsoOk returns a tuple with the Iso field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Photo) GetIsoOk() (*int32, bool) {
if o == nil || IsNil(o.Iso) {
return nil, false
}
return o.Iso, true
}
// HasIso returns a boolean if a field has been set.
func (o *Photo) HasIso() bool {
if o != nil && !IsNil(o.Iso) {
return true
}
return false
}
// SetIso gets a reference to the given int32 and assigns it to the Iso field.
func (o *Photo) SetIso(v int32) {
o.Iso = &v
}
// GetOrientation returns the Orientation field value if set, zero value otherwise.
func (o *Photo) GetOrientation() int32 {
if o == nil || IsNil(o.Orientation) {
var ret int32
return ret
}
return *o.Orientation
}
// GetOrientationOk returns a tuple with the Orientation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Photo) GetOrientationOk() (*int32, bool) {
if o == nil || IsNil(o.Orientation) {
return nil, false
}
return o.Orientation, true
}
// HasOrientation returns a boolean if a field has been set.
func (o *Photo) HasOrientation() bool {
if o != nil && !IsNil(o.Orientation) {
return true
}
return false
}
// SetOrientation gets a reference to the given int32 and assigns it to the Orientation field.
func (o *Photo) SetOrientation(v int32) {
o.Orientation = &v
}
// GetTakenDateTime returns the TakenDateTime field value if set, zero value otherwise.
func (o *Photo) GetTakenDateTime() time.Time {
if o == nil || IsNil(o.TakenDateTime) {
var ret time.Time
return ret
}
return *o.TakenDateTime
}
// GetTakenDateTimeOk returns a tuple with the TakenDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Photo) GetTakenDateTimeOk() (*time.Time, bool) {
if o == nil || IsNil(o.TakenDateTime) {
return nil, false
}
return o.TakenDateTime, true
}
// HasTakenDateTime returns a boolean if a field has been set.
func (o *Photo) HasTakenDateTime() bool {
if o != nil && !IsNil(o.TakenDateTime) {
return true
}
return false
}
// SetTakenDateTime gets a reference to the given time.Time and assigns it to the TakenDateTime field.
func (o *Photo) SetTakenDateTime(v time.Time) {
o.TakenDateTime = &v
}
func (o Photo) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Photo) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CameraMake) {
toSerialize["cameraMake"] = o.CameraMake
}
if !IsNil(o.CameraModel) {
toSerialize["cameraModel"] = o.CameraModel
}
if !IsNil(o.ExposureDenominator) {
toSerialize["exposureDenominator"] = o.ExposureDenominator
}
if !IsNil(o.ExposureNumerator) {
toSerialize["exposureNumerator"] = o.ExposureNumerator
}
if !IsNil(o.FNumber) {
toSerialize["fNumber"] = o.FNumber
}
if !IsNil(o.FocalLength) {
toSerialize["focalLength"] = o.FocalLength
}
if !IsNil(o.Iso) {
toSerialize["iso"] = o.Iso
}
if !IsNil(o.Orientation) {
toSerialize["orientation"] = o.Orientation
}
if !IsNil(o.TakenDateTime) {
toSerialize["takenDateTime"] = o.TakenDateTime
}
return toSerialize, nil
}
type NullablePhoto struct {
value *Photo
isSet bool
}
func (v NullablePhoto) Get() *Photo {
return v.value
}
func (v *NullablePhoto) Set(val *Photo) {
v.value = val
v.isSet = true
}
func (v NullablePhoto) IsSet() bool {
return v.isSet
}
func (v *NullablePhoto) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePhoto(val *Photo) *NullablePhoto {
return &NullablePhoto{value: val, isSet: true}
}
func (v NullablePhoto) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePhoto) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the Quota type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Quota{}
// Quota Optional. Information about the drive's storage space quota. Read-only.
type Quota struct {
// Total space consumed by files in the recycle bin, in bytes. Read-only.
@@ -47,7 +50,7 @@ func NewQuotaWithDefaults() *Quota {
// GetDeleted returns the Deleted field value if set, zero value otherwise.
func (o *Quota) GetDeleted() int64 {
if o == nil || o.Deleted == nil {
if o == nil || IsNil(o.Deleted) {
var ret int64
return ret
}
@@ -57,7 +60,7 @@ func (o *Quota) GetDeleted() int64 {
// GetDeletedOk returns a tuple with the Deleted field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Quota) GetDeletedOk() (*int64, bool) {
if o == nil || o.Deleted == nil {
if o == nil || IsNil(o.Deleted) {
return nil, false
}
return o.Deleted, true
@@ -65,7 +68,7 @@ func (o *Quota) GetDeletedOk() (*int64, bool) {
// HasDeleted returns a boolean if a field has been set.
func (o *Quota) HasDeleted() bool {
if o != nil && o.Deleted != nil {
if o != nil && !IsNil(o.Deleted) {
return true
}
@@ -79,7 +82,7 @@ func (o *Quota) SetDeleted(v int64) {
// GetRemaining returns the Remaining field value if set, zero value otherwise.
func (o *Quota) GetRemaining() int64 {
if o == nil || o.Remaining == nil {
if o == nil || IsNil(o.Remaining) {
var ret int64
return ret
}
@@ -89,7 +92,7 @@ func (o *Quota) GetRemaining() int64 {
// GetRemainingOk returns a tuple with the Remaining field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Quota) GetRemainingOk() (*int64, bool) {
if o == nil || o.Remaining == nil {
if o == nil || IsNil(o.Remaining) {
return nil, false
}
return o.Remaining, true
@@ -97,7 +100,7 @@ func (o *Quota) GetRemainingOk() (*int64, bool) {
// HasRemaining returns a boolean if a field has been set.
func (o *Quota) HasRemaining() bool {
if o != nil && o.Remaining != nil {
if o != nil && !IsNil(o.Remaining) {
return true
}
@@ -111,7 +114,7 @@ func (o *Quota) SetRemaining(v int64) {
// GetState returns the State field value if set, zero value otherwise.
func (o *Quota) GetState() string {
if o == nil || o.State == nil {
if o == nil || IsNil(o.State) {
var ret string
return ret
}
@@ -121,7 +124,7 @@ func (o *Quota) GetState() string {
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Quota) GetStateOk() (*string, bool) {
if o == nil || o.State == nil {
if o == nil || IsNil(o.State) {
return nil, false
}
return o.State, true
@@ -129,7 +132,7 @@ func (o *Quota) GetStateOk() (*string, bool) {
// HasState returns a boolean if a field has been set.
func (o *Quota) HasState() bool {
if o != nil && o.State != nil {
if o != nil && !IsNil(o.State) {
return true
}
@@ -143,7 +146,7 @@ func (o *Quota) SetState(v string) {
// GetTotal returns the Total field value if set, zero value otherwise.
func (o *Quota) GetTotal() int64 {
if o == nil || o.Total == nil {
if o == nil || IsNil(o.Total) {
var ret int64
return ret
}
@@ -153,7 +156,7 @@ func (o *Quota) GetTotal() int64 {
// 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 *Quota) GetTotalOk() (*int64, bool) {
if o == nil || o.Total == nil {
if o == nil || IsNil(o.Total) {
return nil, false
}
return o.Total, true
@@ -161,7 +164,7 @@ func (o *Quota) GetTotalOk() (*int64, bool) {
// HasTotal returns a boolean if a field has been set.
func (o *Quota) HasTotal() bool {
if o != nil && o.Total != nil {
if o != nil && !IsNil(o.Total) {
return true
}
@@ -175,7 +178,7 @@ func (o *Quota) SetTotal(v int64) {
// GetUsed returns the Used field value if set, zero value otherwise.
func (o *Quota) GetUsed() int64 {
if o == nil || o.Used == nil {
if o == nil || IsNil(o.Used) {
var ret int64
return ret
}
@@ -185,7 +188,7 @@ func (o *Quota) GetUsed() int64 {
// GetUsedOk returns a tuple with the Used field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Quota) GetUsedOk() (*int64, bool) {
if o == nil || o.Used == nil {
if o == nil || IsNil(o.Used) {
return nil, false
}
return o.Used, true
@@ -193,7 +196,7 @@ func (o *Quota) GetUsedOk() (*int64, bool) {
// HasUsed returns a boolean if a field has been set.
func (o *Quota) HasUsed() bool {
if o != nil && o.Used != nil {
if o != nil && !IsNil(o.Used) {
return true
}
@@ -206,25 +209,33 @@ func (o *Quota) SetUsed(v int64) {
}
func (o Quota) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Deleted != nil {
toSerialize["deleted"] = o.Deleted
}
if o.Remaining != nil {
toSerialize["remaining"] = o.Remaining
}
if o.State != nil {
toSerialize["state"] = o.State
}
if o.Total != nil {
toSerialize["total"] = o.Total
}
if o.Used != nil {
toSerialize["used"] = o.Used
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Quota) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Deleted) {
toSerialize["deleted"] = o.Deleted
}
if !IsNil(o.Remaining) {
toSerialize["remaining"] = o.Remaining
}
if !IsNil(o.State) {
toSerialize["state"] = o.State
}
if !IsNil(o.Total) {
toSerialize["total"] = o.Total
}
if !IsNil(o.Used) {
toSerialize["used"] = o.Used
}
return toSerialize, nil
}
type NullableQuota struct {
value *Quota
isSet bool

View File

@@ -15,6 +15,9 @@ import (
"time"
)
// checks if the RemoteItem type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RemoteItem{}
// RemoteItem Remote item data, if the item is shared from a drive other than the one being accessed. Read-only.
type RemoteItem struct {
CreatedBy *IdentitySet `json:"createdBy,omitempty"`
@@ -71,7 +74,7 @@ func NewRemoteItemWithDefaults() *RemoteItem {
// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise.
func (o *RemoteItem) GetCreatedBy() IdentitySet {
if o == nil || o.CreatedBy == nil {
if o == nil || IsNil(o.CreatedBy) {
var ret IdentitySet
return ret
}
@@ -81,7 +84,7 @@ func (o *RemoteItem) GetCreatedBy() IdentitySet {
// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetCreatedByOk() (*IdentitySet, bool) {
if o == nil || o.CreatedBy == nil {
if o == nil || IsNil(o.CreatedBy) {
return nil, false
}
return o.CreatedBy, true
@@ -89,7 +92,7 @@ func (o *RemoteItem) GetCreatedByOk() (*IdentitySet, bool) {
// HasCreatedBy returns a boolean if a field has been set.
func (o *RemoteItem) HasCreatedBy() bool {
if o != nil && o.CreatedBy != nil {
if o != nil && !IsNil(o.CreatedBy) {
return true
}
@@ -103,7 +106,7 @@ func (o *RemoteItem) SetCreatedBy(v IdentitySet) {
// GetCreatedDateTime returns the CreatedDateTime field value if set, zero value otherwise.
func (o *RemoteItem) GetCreatedDateTime() time.Time {
if o == nil || o.CreatedDateTime == nil {
if o == nil || IsNil(o.CreatedDateTime) {
var ret time.Time
return ret
}
@@ -113,7 +116,7 @@ func (o *RemoteItem) GetCreatedDateTime() time.Time {
// GetCreatedDateTimeOk returns a tuple with the CreatedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetCreatedDateTimeOk() (*time.Time, bool) {
if o == nil || o.CreatedDateTime == nil {
if o == nil || IsNil(o.CreatedDateTime) {
return nil, false
}
return o.CreatedDateTime, true
@@ -121,7 +124,7 @@ func (o *RemoteItem) GetCreatedDateTimeOk() (*time.Time, bool) {
// HasCreatedDateTime returns a boolean if a field has been set.
func (o *RemoteItem) HasCreatedDateTime() bool {
if o != nil && o.CreatedDateTime != nil {
if o != nil && !IsNil(o.CreatedDateTime) {
return true
}
@@ -135,7 +138,7 @@ func (o *RemoteItem) SetCreatedDateTime(v time.Time) {
// GetFile returns the File field value if set, zero value otherwise.
func (o *RemoteItem) GetFile() OpenGraphFile {
if o == nil || o.File == nil {
if o == nil || IsNil(o.File) {
var ret OpenGraphFile
return ret
}
@@ -145,7 +148,7 @@ func (o *RemoteItem) GetFile() OpenGraphFile {
// GetFileOk returns a tuple with the File field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetFileOk() (*OpenGraphFile, bool) {
if o == nil || o.File == nil {
if o == nil || IsNil(o.File) {
return nil, false
}
return o.File, true
@@ -153,7 +156,7 @@ func (o *RemoteItem) GetFileOk() (*OpenGraphFile, bool) {
// HasFile returns a boolean if a field has been set.
func (o *RemoteItem) HasFile() bool {
if o != nil && o.File != nil {
if o != nil && !IsNil(o.File) {
return true
}
@@ -167,7 +170,7 @@ func (o *RemoteItem) SetFile(v OpenGraphFile) {
// GetFileSystemInfo returns the FileSystemInfo field value if set, zero value otherwise.
func (o *RemoteItem) GetFileSystemInfo() FileSystemInfo {
if o == nil || o.FileSystemInfo == nil {
if o == nil || IsNil(o.FileSystemInfo) {
var ret FileSystemInfo
return ret
}
@@ -177,7 +180,7 @@ func (o *RemoteItem) GetFileSystemInfo() FileSystemInfo {
// GetFileSystemInfoOk returns a tuple with the FileSystemInfo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetFileSystemInfoOk() (*FileSystemInfo, bool) {
if o == nil || o.FileSystemInfo == nil {
if o == nil || IsNil(o.FileSystemInfo) {
return nil, false
}
return o.FileSystemInfo, true
@@ -185,7 +188,7 @@ func (o *RemoteItem) GetFileSystemInfoOk() (*FileSystemInfo, bool) {
// HasFileSystemInfo returns a boolean if a field has been set.
func (o *RemoteItem) HasFileSystemInfo() bool {
if o != nil && o.FileSystemInfo != nil {
if o != nil && !IsNil(o.FileSystemInfo) {
return true
}
@@ -199,7 +202,7 @@ func (o *RemoteItem) SetFileSystemInfo(v FileSystemInfo) {
// GetFolder returns the Folder field value if set, zero value otherwise.
func (o *RemoteItem) GetFolder() Folder {
if o == nil || o.Folder == nil {
if o == nil || IsNil(o.Folder) {
var ret Folder
return ret
}
@@ -209,7 +212,7 @@ func (o *RemoteItem) GetFolder() Folder {
// GetFolderOk returns a tuple with the Folder field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetFolderOk() (*Folder, bool) {
if o == nil || o.Folder == nil {
if o == nil || IsNil(o.Folder) {
return nil, false
}
return o.Folder, true
@@ -217,7 +220,7 @@ func (o *RemoteItem) GetFolderOk() (*Folder, bool) {
// HasFolder returns a boolean if a field has been set.
func (o *RemoteItem) HasFolder() bool {
if o != nil && o.Folder != nil {
if o != nil && !IsNil(o.Folder) {
return true
}
@@ -231,7 +234,7 @@ func (o *RemoteItem) SetFolder(v Folder) {
// GetDriveAlias returns the DriveAlias field value if set, zero value otherwise.
func (o *RemoteItem) GetDriveAlias() string {
if o == nil || o.DriveAlias == nil {
if o == nil || IsNil(o.DriveAlias) {
var ret string
return ret
}
@@ -241,7 +244,7 @@ func (o *RemoteItem) GetDriveAlias() string {
// GetDriveAliasOk returns a tuple with the DriveAlias field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetDriveAliasOk() (*string, bool) {
if o == nil || o.DriveAlias == nil {
if o == nil || IsNil(o.DriveAlias) {
return nil, false
}
return o.DriveAlias, true
@@ -249,7 +252,7 @@ func (o *RemoteItem) GetDriveAliasOk() (*string, bool) {
// HasDriveAlias returns a boolean if a field has been set.
func (o *RemoteItem) HasDriveAlias() bool {
if o != nil && o.DriveAlias != nil {
if o != nil && !IsNil(o.DriveAlias) {
return true
}
@@ -263,7 +266,7 @@ func (o *RemoteItem) SetDriveAlias(v string) {
// GetPath returns the Path field value if set, zero value otherwise.
func (o *RemoteItem) GetPath() string {
if o == nil || o.Path == nil {
if o == nil || IsNil(o.Path) {
var ret string
return ret
}
@@ -273,7 +276,7 @@ func (o *RemoteItem) GetPath() string {
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetPathOk() (*string, bool) {
if o == nil || o.Path == nil {
if o == nil || IsNil(o.Path) {
return nil, false
}
return o.Path, true
@@ -281,7 +284,7 @@ func (o *RemoteItem) GetPathOk() (*string, bool) {
// HasPath returns a boolean if a field has been set.
func (o *RemoteItem) HasPath() bool {
if o != nil && o.Path != nil {
if o != nil && !IsNil(o.Path) {
return true
}
@@ -295,7 +298,7 @@ func (o *RemoteItem) SetPath(v string) {
// GetRootId returns the RootId field value if set, zero value otherwise.
func (o *RemoteItem) GetRootId() string {
if o == nil || o.RootId == nil {
if o == nil || IsNil(o.RootId) {
var ret string
return ret
}
@@ -305,7 +308,7 @@ func (o *RemoteItem) GetRootId() string {
// GetRootIdOk returns a tuple with the RootId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetRootIdOk() (*string, bool) {
if o == nil || o.RootId == nil {
if o == nil || IsNil(o.RootId) {
return nil, false
}
return o.RootId, true
@@ -313,7 +316,7 @@ func (o *RemoteItem) GetRootIdOk() (*string, bool) {
// HasRootId returns a boolean if a field has been set.
func (o *RemoteItem) HasRootId() bool {
if o != nil && o.RootId != nil {
if o != nil && !IsNil(o.RootId) {
return true
}
@@ -327,7 +330,7 @@ func (o *RemoteItem) SetRootId(v string) {
// GetId returns the Id field value if set, zero value otherwise.
func (o *RemoteItem) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -337,7 +340,7 @@ func (o *RemoteItem) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -345,7 +348,7 @@ func (o *RemoteItem) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *RemoteItem) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -359,7 +362,7 @@ func (o *RemoteItem) SetId(v string) {
// GetImage returns the Image field value if set, zero value otherwise.
func (o *RemoteItem) GetImage() Image {
if o == nil || o.Image == nil {
if o == nil || IsNil(o.Image) {
var ret Image
return ret
}
@@ -369,7 +372,7 @@ func (o *RemoteItem) GetImage() Image {
// GetImageOk returns a tuple with the Image field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetImageOk() (*Image, bool) {
if o == nil || o.Image == nil {
if o == nil || IsNil(o.Image) {
return nil, false
}
return o.Image, true
@@ -377,7 +380,7 @@ func (o *RemoteItem) GetImageOk() (*Image, bool) {
// HasImage returns a boolean if a field has been set.
func (o *RemoteItem) HasImage() bool {
if o != nil && o.Image != nil {
if o != nil && !IsNil(o.Image) {
return true
}
@@ -391,7 +394,7 @@ func (o *RemoteItem) SetImage(v Image) {
// GetLastModifiedBy returns the LastModifiedBy field value if set, zero value otherwise.
func (o *RemoteItem) GetLastModifiedBy() IdentitySet {
if o == nil || o.LastModifiedBy == nil {
if o == nil || IsNil(o.LastModifiedBy) {
var ret IdentitySet
return ret
}
@@ -401,7 +404,7 @@ func (o *RemoteItem) GetLastModifiedBy() IdentitySet {
// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetLastModifiedByOk() (*IdentitySet, bool) {
if o == nil || o.LastModifiedBy == nil {
if o == nil || IsNil(o.LastModifiedBy) {
return nil, false
}
return o.LastModifiedBy, true
@@ -409,7 +412,7 @@ func (o *RemoteItem) GetLastModifiedByOk() (*IdentitySet, bool) {
// HasLastModifiedBy returns a boolean if a field has been set.
func (o *RemoteItem) HasLastModifiedBy() bool {
if o != nil && o.LastModifiedBy != nil {
if o != nil && !IsNil(o.LastModifiedBy) {
return true
}
@@ -423,7 +426,7 @@ func (o *RemoteItem) SetLastModifiedBy(v IdentitySet) {
// GetLastModifiedDateTime returns the LastModifiedDateTime field value if set, zero value otherwise.
func (o *RemoteItem) GetLastModifiedDateTime() time.Time {
if o == nil || o.LastModifiedDateTime == nil {
if o == nil || IsNil(o.LastModifiedDateTime) {
var ret time.Time
return ret
}
@@ -433,7 +436,7 @@ func (o *RemoteItem) GetLastModifiedDateTime() time.Time {
// GetLastModifiedDateTimeOk returns a tuple with the LastModifiedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetLastModifiedDateTimeOk() (*time.Time, bool) {
if o == nil || o.LastModifiedDateTime == nil {
if o == nil || IsNil(o.LastModifiedDateTime) {
return nil, false
}
return o.LastModifiedDateTime, true
@@ -441,7 +444,7 @@ func (o *RemoteItem) GetLastModifiedDateTimeOk() (*time.Time, bool) {
// HasLastModifiedDateTime returns a boolean if a field has been set.
func (o *RemoteItem) HasLastModifiedDateTime() bool {
if o != nil && o.LastModifiedDateTime != nil {
if o != nil && !IsNil(o.LastModifiedDateTime) {
return true
}
@@ -455,7 +458,7 @@ func (o *RemoteItem) SetLastModifiedDateTime(v time.Time) {
// GetName returns the Name field value if set, zero value otherwise.
func (o *RemoteItem) GetName() string {
if o == nil || o.Name == nil {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
@@ -465,7 +468,7 @@ func (o *RemoteItem) GetName() string {
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
@@ -473,7 +476,7 @@ func (o *RemoteItem) GetNameOk() (*string, bool) {
// HasName returns a boolean if a field has been set.
func (o *RemoteItem) HasName() bool {
if o != nil && o.Name != nil {
if o != nil && !IsNil(o.Name) {
return true
}
@@ -487,7 +490,7 @@ func (o *RemoteItem) SetName(v string) {
// GetETag returns the ETag field value if set, zero value otherwise.
func (o *RemoteItem) GetETag() string {
if o == nil || o.ETag == nil {
if o == nil || IsNil(o.ETag) {
var ret string
return ret
}
@@ -497,7 +500,7 @@ func (o *RemoteItem) GetETag() string {
// GetETagOk returns a tuple with the ETag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetETagOk() (*string, bool) {
if o == nil || o.ETag == nil {
if o == nil || IsNil(o.ETag) {
return nil, false
}
return o.ETag, true
@@ -505,7 +508,7 @@ func (o *RemoteItem) GetETagOk() (*string, bool) {
// HasETag returns a boolean if a field has been set.
func (o *RemoteItem) HasETag() bool {
if o != nil && o.ETag != nil {
if o != nil && !IsNil(o.ETag) {
return true
}
@@ -519,7 +522,7 @@ func (o *RemoteItem) SetETag(v string) {
// GetCTag returns the CTag field value if set, zero value otherwise.
func (o *RemoteItem) GetCTag() string {
if o == nil || o.CTag == nil {
if o == nil || IsNil(o.CTag) {
var ret string
return ret
}
@@ -529,7 +532,7 @@ func (o *RemoteItem) GetCTag() string {
// GetCTagOk returns a tuple with the CTag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetCTagOk() (*string, bool) {
if o == nil || o.CTag == nil {
if o == nil || IsNil(o.CTag) {
return nil, false
}
return o.CTag, true
@@ -537,7 +540,7 @@ func (o *RemoteItem) GetCTagOk() (*string, bool) {
// HasCTag returns a boolean if a field has been set.
func (o *RemoteItem) HasCTag() bool {
if o != nil && o.CTag != nil {
if o != nil && !IsNil(o.CTag) {
return true
}
@@ -551,7 +554,7 @@ func (o *RemoteItem) SetCTag(v string) {
// GetParentReference returns the ParentReference field value if set, zero value otherwise.
func (o *RemoteItem) GetParentReference() ItemReference {
if o == nil || o.ParentReference == nil {
if o == nil || IsNil(o.ParentReference) {
var ret ItemReference
return ret
}
@@ -561,7 +564,7 @@ func (o *RemoteItem) GetParentReference() ItemReference {
// GetParentReferenceOk returns a tuple with the ParentReference field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetParentReferenceOk() (*ItemReference, bool) {
if o == nil || o.ParentReference == nil {
if o == nil || IsNil(o.ParentReference) {
return nil, false
}
return o.ParentReference, true
@@ -569,7 +572,7 @@ func (o *RemoteItem) GetParentReferenceOk() (*ItemReference, bool) {
// HasParentReference returns a boolean if a field has been set.
func (o *RemoteItem) HasParentReference() bool {
if o != nil && o.ParentReference != nil {
if o != nil && !IsNil(o.ParentReference) {
return true
}
@@ -583,7 +586,7 @@ func (o *RemoteItem) SetParentReference(v ItemReference) {
// GetShared returns the Shared field value if set, zero value otherwise.
func (o *RemoteItem) GetShared() Shared {
if o == nil || o.Shared == nil {
if o == nil || IsNil(o.Shared) {
var ret Shared
return ret
}
@@ -593,7 +596,7 @@ func (o *RemoteItem) GetShared() Shared {
// GetSharedOk returns a tuple with the Shared field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetSharedOk() (*Shared, bool) {
if o == nil || o.Shared == nil {
if o == nil || IsNil(o.Shared) {
return nil, false
}
return o.Shared, true
@@ -601,7 +604,7 @@ func (o *RemoteItem) GetSharedOk() (*Shared, bool) {
// HasShared returns a boolean if a field has been set.
func (o *RemoteItem) HasShared() bool {
if o != nil && o.Shared != nil {
if o != nil && !IsNil(o.Shared) {
return true
}
@@ -615,7 +618,7 @@ func (o *RemoteItem) SetShared(v Shared) {
// GetSize returns the Size field value if set, zero value otherwise.
func (o *RemoteItem) GetSize() int64 {
if o == nil || o.Size == nil {
if o == nil || IsNil(o.Size) {
var ret int64
return ret
}
@@ -625,7 +628,7 @@ func (o *RemoteItem) GetSize() int64 {
// 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 *RemoteItem) GetSizeOk() (*int64, bool) {
if o == nil || o.Size == nil {
if o == nil || IsNil(o.Size) {
return nil, false
}
return o.Size, true
@@ -633,7 +636,7 @@ func (o *RemoteItem) GetSizeOk() (*int64, bool) {
// HasSize returns a boolean if a field has been set.
func (o *RemoteItem) HasSize() bool {
if o != nil && o.Size != nil {
if o != nil && !IsNil(o.Size) {
return true
}
@@ -647,7 +650,7 @@ func (o *RemoteItem) SetSize(v int64) {
// GetSpecialFolder returns the SpecialFolder field value if set, zero value otherwise.
func (o *RemoteItem) GetSpecialFolder() SpecialFolder {
if o == nil || o.SpecialFolder == nil {
if o == nil || IsNil(o.SpecialFolder) {
var ret SpecialFolder
return ret
}
@@ -657,7 +660,7 @@ func (o *RemoteItem) GetSpecialFolder() SpecialFolder {
// GetSpecialFolderOk returns a tuple with the SpecialFolder field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetSpecialFolderOk() (*SpecialFolder, bool) {
if o == nil || o.SpecialFolder == nil {
if o == nil || IsNil(o.SpecialFolder) {
return nil, false
}
return o.SpecialFolder, true
@@ -665,7 +668,7 @@ func (o *RemoteItem) GetSpecialFolderOk() (*SpecialFolder, bool) {
// HasSpecialFolder returns a boolean if a field has been set.
func (o *RemoteItem) HasSpecialFolder() bool {
if o != nil && o.SpecialFolder != nil {
if o != nil && !IsNil(o.SpecialFolder) {
return true
}
@@ -679,7 +682,7 @@ func (o *RemoteItem) SetSpecialFolder(v SpecialFolder) {
// GetWebDavUrl returns the WebDavUrl field value if set, zero value otherwise.
func (o *RemoteItem) GetWebDavUrl() string {
if o == nil || o.WebDavUrl == nil {
if o == nil || IsNil(o.WebDavUrl) {
var ret string
return ret
}
@@ -689,7 +692,7 @@ func (o *RemoteItem) GetWebDavUrl() string {
// GetWebDavUrlOk returns a tuple with the WebDavUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetWebDavUrlOk() (*string, bool) {
if o == nil || o.WebDavUrl == nil {
if o == nil || IsNil(o.WebDavUrl) {
return nil, false
}
return o.WebDavUrl, true
@@ -697,7 +700,7 @@ func (o *RemoteItem) GetWebDavUrlOk() (*string, bool) {
// HasWebDavUrl returns a boolean if a field has been set.
func (o *RemoteItem) HasWebDavUrl() bool {
if o != nil && o.WebDavUrl != nil {
if o != nil && !IsNil(o.WebDavUrl) {
return true
}
@@ -711,7 +714,7 @@ func (o *RemoteItem) SetWebDavUrl(v string) {
// GetWebUrl returns the WebUrl field value if set, zero value otherwise.
func (o *RemoteItem) GetWebUrl() string {
if o == nil || o.WebUrl == nil {
if o == nil || IsNil(o.WebUrl) {
var ret string
return ret
}
@@ -721,7 +724,7 @@ func (o *RemoteItem) GetWebUrl() string {
// GetWebUrlOk returns a tuple with the WebUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RemoteItem) GetWebUrlOk() (*string, bool) {
if o == nil || o.WebUrl == nil {
if o == nil || IsNil(o.WebUrl) {
return nil, false
}
return o.WebUrl, true
@@ -729,7 +732,7 @@ func (o *RemoteItem) GetWebUrlOk() (*string, bool) {
// HasWebUrl returns a boolean if a field has been set.
func (o *RemoteItem) HasWebUrl() bool {
if o != nil && o.WebUrl != nil {
if o != nil && !IsNil(o.WebUrl) {
return true
}
@@ -742,73 +745,81 @@ func (o *RemoteItem) SetWebUrl(v string) {
}
func (o RemoteItem) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CreatedBy != nil {
toSerialize["createdBy"] = o.CreatedBy
}
if o.CreatedDateTime != nil {
toSerialize["createdDateTime"] = o.CreatedDateTime
}
if o.File != nil {
toSerialize["file"] = o.File
}
if o.FileSystemInfo != nil {
toSerialize["fileSystemInfo"] = o.FileSystemInfo
}
if o.Folder != nil {
toSerialize["folder"] = o.Folder
}
if o.DriveAlias != nil {
toSerialize["driveAlias"] = o.DriveAlias
}
if o.Path != nil {
toSerialize["path"] = o.Path
}
if o.RootId != nil {
toSerialize["rootId"] = o.RootId
}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.Image != nil {
toSerialize["image"] = o.Image
}
if o.LastModifiedBy != nil {
toSerialize["lastModifiedBy"] = o.LastModifiedBy
}
if o.LastModifiedDateTime != nil {
toSerialize["lastModifiedDateTime"] = o.LastModifiedDateTime
}
if o.Name != nil {
toSerialize["name"] = o.Name
}
if o.ETag != nil {
toSerialize["eTag"] = o.ETag
}
if o.CTag != nil {
toSerialize["cTag"] = o.CTag
}
if o.ParentReference != nil {
toSerialize["parentReference"] = o.ParentReference
}
if o.Shared != nil {
toSerialize["shared"] = o.Shared
}
if o.Size != nil {
toSerialize["size"] = o.Size
}
if o.SpecialFolder != nil {
toSerialize["specialFolder"] = o.SpecialFolder
}
if o.WebDavUrl != nil {
toSerialize["webDavUrl"] = o.WebDavUrl
}
if o.WebUrl != nil {
toSerialize["webUrl"] = o.WebUrl
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RemoteItem) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CreatedBy) {
toSerialize["createdBy"] = o.CreatedBy
}
if !IsNil(o.CreatedDateTime) {
toSerialize["createdDateTime"] = o.CreatedDateTime
}
if !IsNil(o.File) {
toSerialize["file"] = o.File
}
if !IsNil(o.FileSystemInfo) {
toSerialize["fileSystemInfo"] = o.FileSystemInfo
}
if !IsNil(o.Folder) {
toSerialize["folder"] = o.Folder
}
if !IsNil(o.DriveAlias) {
toSerialize["driveAlias"] = o.DriveAlias
}
if !IsNil(o.Path) {
toSerialize["path"] = o.Path
}
if !IsNil(o.RootId) {
toSerialize["rootId"] = o.RootId
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Image) {
toSerialize["image"] = o.Image
}
if !IsNil(o.LastModifiedBy) {
toSerialize["lastModifiedBy"] = o.LastModifiedBy
}
if !IsNil(o.LastModifiedDateTime) {
toSerialize["lastModifiedDateTime"] = o.LastModifiedDateTime
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.ETag) {
toSerialize["eTag"] = o.ETag
}
if !IsNil(o.CTag) {
toSerialize["cTag"] = o.CTag
}
if !IsNil(o.ParentReference) {
toSerialize["parentReference"] = o.ParentReference
}
if !IsNil(o.Shared) {
toSerialize["shared"] = o.Shared
}
if !IsNil(o.Size) {
toSerialize["size"] = o.Size
}
if !IsNil(o.SpecialFolder) {
toSerialize["specialFolder"] = o.SpecialFolder
}
if !IsNil(o.WebDavUrl) {
toSerialize["webDavUrl"] = o.WebDavUrl
}
if !IsNil(o.WebUrl) {
toSerialize["webUrl"] = o.WebUrl
}
return toSerialize, nil
}
type NullableRemoteItem struct {
value *RemoteItem
isSet bool

View File

@@ -0,0 +1,160 @@
/*
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 SharePointIdentitySet type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SharePointIdentitySet{}
// SharePointIdentitySet This resource is used to represent a set of identities associated with various events for an item, such as created by or last modified by.
type SharePointIdentitySet struct {
User *Identity `json:"user,omitempty"`
Group *Identity `json:"group,omitempty"`
}
// NewSharePointIdentitySet instantiates a new SharePointIdentitySet 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 NewSharePointIdentitySet() *SharePointIdentitySet {
this := SharePointIdentitySet{}
return &this
}
// NewSharePointIdentitySetWithDefaults instantiates a new SharePointIdentitySet 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 NewSharePointIdentitySetWithDefaults() *SharePointIdentitySet {
this := SharePointIdentitySet{}
return &this
}
// GetUser returns the User field value if set, zero value otherwise.
func (o *SharePointIdentitySet) GetUser() Identity {
if o == nil || IsNil(o.User) {
var ret Identity
return ret
}
return *o.User
}
// GetUserOk returns a tuple with the User field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SharePointIdentitySet) GetUserOk() (*Identity, bool) {
if o == nil || IsNil(o.User) {
return nil, false
}
return o.User, true
}
// HasUser returns a boolean if a field has been set.
func (o *SharePointIdentitySet) HasUser() bool {
if o != nil && !IsNil(o.User) {
return true
}
return false
}
// SetUser gets a reference to the given Identity and assigns it to the User field.
func (o *SharePointIdentitySet) SetUser(v Identity) {
o.User = &v
}
// GetGroup returns the Group field value if set, zero value otherwise.
func (o *SharePointIdentitySet) GetGroup() Identity {
if o == nil || IsNil(o.Group) {
var ret Identity
return ret
}
return *o.Group
}
// GetGroupOk returns a tuple with the Group field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SharePointIdentitySet) GetGroupOk() (*Identity, bool) {
if o == nil || IsNil(o.Group) {
return nil, false
}
return o.Group, true
}
// HasGroup returns a boolean if a field has been set.
func (o *SharePointIdentitySet) HasGroup() bool {
if o != nil && !IsNil(o.Group) {
return true
}
return false
}
// SetGroup gets a reference to the given Identity and assigns it to the Group field.
func (o *SharePointIdentitySet) SetGroup(v Identity) {
o.Group = &v
}
func (o SharePointIdentitySet) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SharePointIdentitySet) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.User) {
toSerialize["user"] = o.User
}
if !IsNil(o.Group) {
toSerialize["group"] = o.Group
}
return toSerialize, nil
}
type NullableSharePointIdentitySet struct {
value *SharePointIdentitySet
isSet bool
}
func (v NullableSharePointIdentitySet) Get() *SharePointIdentitySet {
return v.value
}
func (v *NullableSharePointIdentitySet) Set(val *SharePointIdentitySet) {
v.value = val
v.isSet = true
}
func (v NullableSharePointIdentitySet) IsSet() bool {
return v.isSet
}
func (v *NullableSharePointIdentitySet) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSharePointIdentitySet(val *SharePointIdentitySet) *NullableSharePointIdentitySet {
return &NullableSharePointIdentitySet{value: val, isSet: true}
}
func (v NullableSharePointIdentitySet) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSharePointIdentitySet) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -15,6 +15,9 @@ import (
"time"
)
// checks if the Shared type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Shared{}
// Shared struct for Shared
type Shared struct {
Owner *IdentitySet `json:"owner,omitempty"`
@@ -44,7 +47,7 @@ func NewSharedWithDefaults() *Shared {
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *Shared) GetOwner() IdentitySet {
if o == nil || o.Owner == nil {
if o == nil || IsNil(o.Owner) {
var ret IdentitySet
return ret
}
@@ -54,7 +57,7 @@ func (o *Shared) GetOwner() IdentitySet {
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Shared) GetOwnerOk() (*IdentitySet, bool) {
if o == nil || o.Owner == nil {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
@@ -62,7 +65,7 @@ func (o *Shared) GetOwnerOk() (*IdentitySet, bool) {
// HasOwner returns a boolean if a field has been set.
func (o *Shared) HasOwner() bool {
if o != nil && o.Owner != nil {
if o != nil && !IsNil(o.Owner) {
return true
}
@@ -76,7 +79,7 @@ func (o *Shared) SetOwner(v IdentitySet) {
// GetScope returns the Scope field value if set, zero value otherwise.
func (o *Shared) GetScope() string {
if o == nil || o.Scope == nil {
if o == nil || IsNil(o.Scope) {
var ret string
return ret
}
@@ -86,7 +89,7 @@ func (o *Shared) GetScope() string {
// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Shared) GetScopeOk() (*string, bool) {
if o == nil || o.Scope == nil {
if o == nil || IsNil(o.Scope) {
return nil, false
}
return o.Scope, true
@@ -94,7 +97,7 @@ func (o *Shared) GetScopeOk() (*string, bool) {
// HasScope returns a boolean if a field has been set.
func (o *Shared) HasScope() bool {
if o != nil && o.Scope != nil {
if o != nil && !IsNil(o.Scope) {
return true
}
@@ -108,7 +111,7 @@ func (o *Shared) SetScope(v string) {
// GetSharedBy returns the SharedBy field value if set, zero value otherwise.
func (o *Shared) GetSharedBy() IdentitySet {
if o == nil || o.SharedBy == nil {
if o == nil || IsNil(o.SharedBy) {
var ret IdentitySet
return ret
}
@@ -118,7 +121,7 @@ func (o *Shared) GetSharedBy() IdentitySet {
// GetSharedByOk returns a tuple with the SharedBy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Shared) GetSharedByOk() (*IdentitySet, bool) {
if o == nil || o.SharedBy == nil {
if o == nil || IsNil(o.SharedBy) {
return nil, false
}
return o.SharedBy, true
@@ -126,7 +129,7 @@ func (o *Shared) GetSharedByOk() (*IdentitySet, bool) {
// HasSharedBy returns a boolean if a field has been set.
func (o *Shared) HasSharedBy() bool {
if o != nil && o.SharedBy != nil {
if o != nil && !IsNil(o.SharedBy) {
return true
}
@@ -140,7 +143,7 @@ func (o *Shared) SetSharedBy(v IdentitySet) {
// GetSharedDateTime returns the SharedDateTime field value if set, zero value otherwise.
func (o *Shared) GetSharedDateTime() time.Time {
if o == nil || o.SharedDateTime == nil {
if o == nil || IsNil(o.SharedDateTime) {
var ret time.Time
return ret
}
@@ -150,7 +153,7 @@ func (o *Shared) GetSharedDateTime() time.Time {
// GetSharedDateTimeOk returns a tuple with the SharedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Shared) GetSharedDateTimeOk() (*time.Time, bool) {
if o == nil || o.SharedDateTime == nil {
if o == nil || IsNil(o.SharedDateTime) {
return nil, false
}
return o.SharedDateTime, true
@@ -158,7 +161,7 @@ func (o *Shared) GetSharedDateTimeOk() (*time.Time, bool) {
// HasSharedDateTime returns a boolean if a field has been set.
func (o *Shared) HasSharedDateTime() bool {
if o != nil && o.SharedDateTime != nil {
if o != nil && !IsNil(o.SharedDateTime) {
return true
}
@@ -171,22 +174,30 @@ func (o *Shared) SetSharedDateTime(v time.Time) {
}
func (o Shared) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Owner != nil {
toSerialize["owner"] = o.Owner
}
if o.Scope != nil {
toSerialize["scope"] = o.Scope
}
if o.SharedBy != nil {
toSerialize["sharedBy"] = o.SharedBy
}
if o.SharedDateTime != nil {
toSerialize["sharedDateTime"] = o.SharedDateTime
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Shared) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.Scope) {
toSerialize["scope"] = o.Scope
}
if !IsNil(o.SharedBy) {
toSerialize["sharedBy"] = o.SharedBy
}
if !IsNil(o.SharedDateTime) {
toSerialize["sharedDateTime"] = o.SharedDateTime
}
return toSerialize, nil
}
type NullableShared struct {
value *Shared
isSet bool

View File

@@ -0,0 +1,235 @@
/*
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 SharingLink type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SharingLink{}
// SharingLink The `SharingLink` resource groups link-related data items into a single structure. If a `permission` resource has a non-null `sharingLink` facet, the permission represents a sharing link (as opposed to permissions granted to a person or group).
type SharingLink struct {
Type *SharingLinkType `json:"type,omitempty"`
// If `true` then the user can only use this link to view the item on the web, and cannot use it to download the contents of the item.
PreventsDownload *bool `json:"preventsDownload,omitempty"`
// A URL that opens the item in the browser on the website.
WebUrl *string `json:"webUrl,omitempty"`
// Provides a user-visible display name of the link. Optional. Libregraph only.
LibreGraphDisplayName *string `json:"@libre.graph.displayName,omitempty"`
}
// NewSharingLink instantiates a new SharingLink 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 NewSharingLink() *SharingLink {
this := SharingLink{}
return &this
}
// NewSharingLinkWithDefaults instantiates a new SharingLink 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 NewSharingLinkWithDefaults() *SharingLink {
this := SharingLink{}
return &this
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *SharingLink) GetType() SharingLinkType {
if o == nil || IsNil(o.Type) {
var ret SharingLinkType
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SharingLink) GetTypeOk() (*SharingLinkType, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *SharingLink) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given SharingLinkType and assigns it to the Type field.
func (o *SharingLink) SetType(v SharingLinkType) {
o.Type = &v
}
// GetPreventsDownload returns the PreventsDownload field value if set, zero value otherwise.
func (o *SharingLink) GetPreventsDownload() bool {
if o == nil || IsNil(o.PreventsDownload) {
var ret bool
return ret
}
return *o.PreventsDownload
}
// GetPreventsDownloadOk returns a tuple with the PreventsDownload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SharingLink) GetPreventsDownloadOk() (*bool, bool) {
if o == nil || IsNil(o.PreventsDownload) {
return nil, false
}
return o.PreventsDownload, true
}
// HasPreventsDownload returns a boolean if a field has been set.
func (o *SharingLink) HasPreventsDownload() bool {
if o != nil && !IsNil(o.PreventsDownload) {
return true
}
return false
}
// SetPreventsDownload gets a reference to the given bool and assigns it to the PreventsDownload field.
func (o *SharingLink) SetPreventsDownload(v bool) {
o.PreventsDownload = &v
}
// GetWebUrl returns the WebUrl field value if set, zero value otherwise.
func (o *SharingLink) GetWebUrl() string {
if o == nil || IsNil(o.WebUrl) {
var ret string
return ret
}
return *o.WebUrl
}
// GetWebUrlOk returns a tuple with the WebUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SharingLink) GetWebUrlOk() (*string, bool) {
if o == nil || IsNil(o.WebUrl) {
return nil, false
}
return o.WebUrl, true
}
// HasWebUrl returns a boolean if a field has been set.
func (o *SharingLink) HasWebUrl() bool {
if o != nil && !IsNil(o.WebUrl) {
return true
}
return false
}
// SetWebUrl gets a reference to the given string and assigns it to the WebUrl field.
func (o *SharingLink) SetWebUrl(v string) {
o.WebUrl = &v
}
// GetLibreGraphDisplayName returns the LibreGraphDisplayName field value if set, zero value otherwise.
func (o *SharingLink) GetLibreGraphDisplayName() string {
if o == nil || IsNil(o.LibreGraphDisplayName) {
var ret string
return ret
}
return *o.LibreGraphDisplayName
}
// GetLibreGraphDisplayNameOk returns a tuple with the LibreGraphDisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SharingLink) GetLibreGraphDisplayNameOk() (*string, bool) {
if o == nil || IsNil(o.LibreGraphDisplayName) {
return nil, false
}
return o.LibreGraphDisplayName, true
}
// HasLibreGraphDisplayName returns a boolean if a field has been set.
func (o *SharingLink) HasLibreGraphDisplayName() bool {
if o != nil && !IsNil(o.LibreGraphDisplayName) {
return true
}
return false
}
// SetLibreGraphDisplayName gets a reference to the given string and assigns it to the LibreGraphDisplayName field.
func (o *SharingLink) SetLibreGraphDisplayName(v string) {
o.LibreGraphDisplayName = &v
}
func (o SharingLink) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SharingLink) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.PreventsDownload) {
toSerialize["preventsDownload"] = o.PreventsDownload
}
if !IsNil(o.WebUrl) {
toSerialize["webUrl"] = o.WebUrl
}
if !IsNil(o.LibreGraphDisplayName) {
toSerialize["@libre.graph.displayName"] = o.LibreGraphDisplayName
}
return toSerialize, nil
}
type NullableSharingLink struct {
value *SharingLink
isSet bool
}
func (v NullableSharingLink) Get() *SharingLink {
return v.value
}
func (v *NullableSharingLink) Set(val *SharingLink) {
v.value = val
v.isSet = true
}
func (v NullableSharingLink) IsSet() bool {
return v.isSet
}
func (v *NullableSharingLink) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSharingLink(val *SharingLink) *NullableSharingLink {
return &NullableSharingLink{value: val, isSet: true}
}
func (v NullableSharingLink) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSharingLink) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -0,0 +1,116 @@
/*
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"
"fmt"
)
// SharingLinkType The type of the link created. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. |
type SharingLinkType string
// List of sharingLinkType
const (
VIEW SharingLinkType = "view"
UPLOAD SharingLinkType = "upload"
EDIT SharingLinkType = "edit"
CREATE_ONLY SharingLinkType = "createOnly"
BLOCKS_DOWNLOAD SharingLinkType = "blocksDownload"
)
// All allowed values of SharingLinkType enum
var AllowedSharingLinkTypeEnumValues = []SharingLinkType{
"view",
"upload",
"edit",
"createOnly",
"blocksDownload",
}
func (v *SharingLinkType) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := SharingLinkType(value)
for _, existing := range AllowedSharingLinkTypeEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid SharingLinkType", value)
}
// NewSharingLinkTypeFromValue returns a pointer to a valid SharingLinkType
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewSharingLinkTypeFromValue(v string) (*SharingLinkType, error) {
ev := SharingLinkType(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for SharingLinkType: valid values are %v", v, AllowedSharingLinkTypeEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v SharingLinkType) IsValid() bool {
for _, existing := range AllowedSharingLinkTypeEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to sharingLinkType value
func (v SharingLinkType) Ptr() *SharingLinkType {
return &v
}
type NullableSharingLinkType struct {
value *SharingLinkType
isSet bool
}
func (v NullableSharingLinkType) Get() *SharingLinkType {
return v.value
}
func (v *NullableSharingLinkType) Set(val *SharingLinkType) {
v.value = val
v.isSet = true
}
func (v NullableSharingLinkType) IsSet() bool {
return v.isSet
}
func (v *NullableSharingLinkType) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSharingLinkType(val *SharingLinkType) *NullableSharingLinkType {
return &NullableSharingLinkType{value: val, isSet: true}
}
func (v NullableSharingLinkType) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSharingLinkType) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the SpecialFolder type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SpecialFolder{}
// SpecialFolder If the current item is also available as a special folder, this facet is returned. Read-only
type SpecialFolder struct {
// The unique identifier for this item in the /drive/special collection
@@ -39,7 +42,7 @@ func NewSpecialFolderWithDefaults() *SpecialFolder {
// GetName returns the Name field value if set, zero value otherwise.
func (o *SpecialFolder) GetName() string {
if o == nil || o.Name == nil {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
@@ -49,7 +52,7 @@ func (o *SpecialFolder) GetName() string {
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SpecialFolder) GetNameOk() (*string, bool) {
if o == nil || o.Name == nil {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
@@ -57,7 +60,7 @@ func (o *SpecialFolder) GetNameOk() (*string, bool) {
// HasName returns a boolean if a field has been set.
func (o *SpecialFolder) HasName() bool {
if o != nil && o.Name != nil {
if o != nil && !IsNil(o.Name) {
return true
}
@@ -70,13 +73,21 @@ func (o *SpecialFolder) SetName(v string) {
}
func (o SpecialFolder) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Name != nil {
toSerialize["name"] = o.Name
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SpecialFolder) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
return toSerialize, nil
}
type NullableSpecialFolder struct {
value *SpecialFolder
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the TagAssignment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TagAssignment{}
// TagAssignment struct for TagAssignment
type TagAssignment struct {
ResourceId string `json:"resourceId"`
@@ -88,16 +91,20 @@ func (o *TagAssignment) SetTags(v []string) {
}
func (o TagAssignment) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["resourceId"] = o.ResourceId
}
if true {
toSerialize["tags"] = o.Tags
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TagAssignment) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["resourceId"] = o.ResourceId
toSerialize["tags"] = o.Tags
return toSerialize, nil
}
type NullableTagAssignment struct {
value *TagAssignment
isSet bool

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the TagUnassignment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &TagUnassignment{}
// TagUnassignment struct for TagUnassignment
type TagUnassignment struct {
ResourceId string `json:"resourceId"`
@@ -88,16 +91,20 @@ func (o *TagUnassignment) SetTags(v []string) {
}
func (o TagUnassignment) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["resourceId"] = o.ResourceId
}
if true {
toSerialize["tags"] = o.Tags
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o TagUnassignment) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["resourceId"] = o.ResourceId
toSerialize["tags"] = o.Tags
return toSerialize, nil
}
type NullableTagUnassignment struct {
value *TagUnassignment
isSet bool

View File

@@ -15,6 +15,9 @@ import (
"time"
)
// checks if the Trash type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Trash{}
// Trash Metadata for trashed drive Items
type Trash struct {
TrashedBy *IdentitySet `json:"trashedBy,omitempty"`
@@ -41,7 +44,7 @@ func NewTrashWithDefaults() *Trash {
// GetTrashedBy returns the TrashedBy field value if set, zero value otherwise.
func (o *Trash) GetTrashedBy() IdentitySet {
if o == nil || o.TrashedBy == nil {
if o == nil || IsNil(o.TrashedBy) {
var ret IdentitySet
return ret
}
@@ -51,7 +54,7 @@ func (o *Trash) GetTrashedBy() IdentitySet {
// GetTrashedByOk returns a tuple with the TrashedBy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Trash) GetTrashedByOk() (*IdentitySet, bool) {
if o == nil || o.TrashedBy == nil {
if o == nil || IsNil(o.TrashedBy) {
return nil, false
}
return o.TrashedBy, true
@@ -59,7 +62,7 @@ func (o *Trash) GetTrashedByOk() (*IdentitySet, bool) {
// HasTrashedBy returns a boolean if a field has been set.
func (o *Trash) HasTrashedBy() bool {
if o != nil && o.TrashedBy != nil {
if o != nil && !IsNil(o.TrashedBy) {
return true
}
@@ -73,7 +76,7 @@ func (o *Trash) SetTrashedBy(v IdentitySet) {
// GetTrashedDateTime returns the TrashedDateTime field value if set, zero value otherwise.
func (o *Trash) GetTrashedDateTime() time.Time {
if o == nil || o.TrashedDateTime == nil {
if o == nil || IsNil(o.TrashedDateTime) {
var ret time.Time
return ret
}
@@ -83,7 +86,7 @@ func (o *Trash) GetTrashedDateTime() time.Time {
// GetTrashedDateTimeOk returns a tuple with the TrashedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Trash) GetTrashedDateTimeOk() (*time.Time, bool) {
if o == nil || o.TrashedDateTime == nil {
if o == nil || IsNil(o.TrashedDateTime) {
return nil, false
}
return o.TrashedDateTime, true
@@ -91,7 +94,7 @@ func (o *Trash) GetTrashedDateTimeOk() (*time.Time, bool) {
// HasTrashedDateTime returns a boolean if a field has been set.
func (o *Trash) HasTrashedDateTime() bool {
if o != nil && o.TrashedDateTime != nil {
if o != nil && !IsNil(o.TrashedDateTime) {
return true
}
@@ -104,16 +107,24 @@ func (o *Trash) SetTrashedDateTime(v time.Time) {
}
func (o Trash) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.TrashedBy != nil {
toSerialize["trashedBy"] = o.TrashedBy
}
if o.TrashedDateTime != nil {
toSerialize["trashedDateTime"] = o.TrashedDateTime
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Trash) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.TrashedBy) {
toSerialize["trashedBy"] = o.TrashedBy
}
if !IsNil(o.TrashedDateTime) {
toSerialize["trashedDateTime"] = o.TrashedDateTime
}
return toSerialize, nil
}
type NullableTrash struct {
value *Trash
isSet bool

View File

@@ -0,0 +1,273 @@
/*
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 UnifiedRoleDefinition type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UnifiedRoleDefinition{}
// UnifiedRoleDefinition A role definition is a collection of permissions in libre graph listing the operations that can be performed and the resources against which they can performed.
type UnifiedRoleDefinition struct {
// The description for the unifiedRoleDefinition.
Description *string `json:"description,omitempty"`
// The display name for the unifiedRoleDefinition. Required. Supports $filter (`eq`, `in`).
DisplayName *string `json:"displayName,omitempty"`
// The unique identifier for the role definition. Key, not nullable, Read-only. Inherited from entity. Supports $filter (`eq`, `in`).
Id *string `json:"id,omitempty"`
// List of permissions included in the role.
RolePermissions []UnifiedRolePermission `json:"rolePermissions,omitempty"`
// When presenting a list of roles the weight can be used to order them in a meaningful way. Lower weight gets higher precedence. So content with lower weight will come first. If set, weights should be non-zero, as 0 is interpreted as an unset weight.
LibreGraphWeight *int32 `json:"@libre.graph.weight,omitempty"`
}
// NewUnifiedRoleDefinition instantiates a new UnifiedRoleDefinition 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 NewUnifiedRoleDefinition() *UnifiedRoleDefinition {
this := UnifiedRoleDefinition{}
return &this
}
// NewUnifiedRoleDefinitionWithDefaults instantiates a new UnifiedRoleDefinition 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 NewUnifiedRoleDefinitionWithDefaults() *UnifiedRoleDefinition {
this := UnifiedRoleDefinition{}
return &this
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *UnifiedRoleDefinition) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UnifiedRoleDefinition) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *UnifiedRoleDefinition) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *UnifiedRoleDefinition) SetDescription(v string) {
o.Description = &v
}
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *UnifiedRoleDefinition) GetDisplayName() string {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
return *o.DisplayName
}
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UnifiedRoleDefinition) GetDisplayNameOk() (*string, bool) {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
}
// HasDisplayName returns a boolean if a field has been set.
func (o *UnifiedRoleDefinition) HasDisplayName() bool {
if o != nil && !IsNil(o.DisplayName) {
return true
}
return false
}
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
func (o *UnifiedRoleDefinition) SetDisplayName(v string) {
o.DisplayName = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *UnifiedRoleDefinition) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UnifiedRoleDefinition) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *UnifiedRoleDefinition) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *UnifiedRoleDefinition) SetId(v string) {
o.Id = &v
}
// GetRolePermissions returns the RolePermissions field value if set, zero value otherwise.
func (o *UnifiedRoleDefinition) GetRolePermissions() []UnifiedRolePermission {
if o == nil || IsNil(o.RolePermissions) {
var ret []UnifiedRolePermission
return ret
}
return o.RolePermissions
}
// GetRolePermissionsOk returns a tuple with the RolePermissions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UnifiedRoleDefinition) GetRolePermissionsOk() ([]UnifiedRolePermission, bool) {
if o == nil || IsNil(o.RolePermissions) {
return nil, false
}
return o.RolePermissions, true
}
// HasRolePermissions returns a boolean if a field has been set.
func (o *UnifiedRoleDefinition) HasRolePermissions() bool {
if o != nil && !IsNil(o.RolePermissions) {
return true
}
return false
}
// SetRolePermissions gets a reference to the given []UnifiedRolePermission and assigns it to the RolePermissions field.
func (o *UnifiedRoleDefinition) SetRolePermissions(v []UnifiedRolePermission) {
o.RolePermissions = v
}
// GetLibreGraphWeight returns the LibreGraphWeight field value if set, zero value otherwise.
func (o *UnifiedRoleDefinition) GetLibreGraphWeight() int32 {
if o == nil || IsNil(o.LibreGraphWeight) {
var ret int32
return ret
}
return *o.LibreGraphWeight
}
// GetLibreGraphWeightOk returns a tuple with the LibreGraphWeight field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UnifiedRoleDefinition) GetLibreGraphWeightOk() (*int32, bool) {
if o == nil || IsNil(o.LibreGraphWeight) {
return nil, false
}
return o.LibreGraphWeight, true
}
// HasLibreGraphWeight returns a boolean if a field has been set.
func (o *UnifiedRoleDefinition) HasLibreGraphWeight() bool {
if o != nil && !IsNil(o.LibreGraphWeight) {
return true
}
return false
}
// SetLibreGraphWeight gets a reference to the given int32 and assigns it to the LibreGraphWeight field.
func (o *UnifiedRoleDefinition) SetLibreGraphWeight(v int32) {
o.LibreGraphWeight = &v
}
func (o UnifiedRoleDefinition) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UnifiedRoleDefinition) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.RolePermissions) {
toSerialize["rolePermissions"] = o.RolePermissions
}
if !IsNil(o.LibreGraphWeight) {
toSerialize["@libre.graph.weight"] = o.LibreGraphWeight
}
return toSerialize, nil
}
type NullableUnifiedRoleDefinition struct {
value *UnifiedRoleDefinition
isSet bool
}
func (v NullableUnifiedRoleDefinition) Get() *UnifiedRoleDefinition {
return v.value
}
func (v *NullableUnifiedRoleDefinition) Set(val *UnifiedRoleDefinition) {
v.value = val
v.isSet = true
}
func (v NullableUnifiedRoleDefinition) IsSet() bool {
return v.isSet
}
func (v *NullableUnifiedRoleDefinition) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUnifiedRoleDefinition(val *UnifiedRoleDefinition) *NullableUnifiedRoleDefinition {
return &NullableUnifiedRoleDefinition{value: val, isSet: true}
}
func (v NullableUnifiedRoleDefinition) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUnifiedRoleDefinition) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -0,0 +1,162 @@
/*
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 UnifiedRolePermission type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UnifiedRolePermission{}
// UnifiedRolePermission Represents a collection of allowed resource actions and the conditions that must be met for the action to be allowed. Resource actions are tasks that can be performed on a resource. For example, an application resource may support create, update, delete, and reset password actions.
type UnifiedRolePermission struct {
// Set of tasks that can be performed on a resource. Required. The following is the schema for resource actions: ``` {Namespace}/{Entity}/{PropertySet}/{Action} ``` For example: `libre.graph/applications/credentials/update` * *{Namespace}* - The services that exposes the task. For example, all tasks in libre graph use the namespace `libre.graph`. * *{Entity}* - The logical features or components exposed by the service in libre graph. For example, `applications`, `servicePrincipals`, or `groups`. * *{PropertySet}* - Optional. The specific properties or aspects of the entity for which access is being granted. For example, `libre.graph/applications/authentication/read` grants the ability to read the reply URL, logout URL, and implicit flow property on the **application** object in libre graph. The following are reserved names for common property sets: * `allProperties` - Designates all properties of the entity, including privileged properties. Examples include `libre.graph/applications/allProperties/read` and `libre.graph/applications/allProperties/update`. * `basic` - Designates common read properties but excludes privileged ones. For example, `libre.graph/applications/basic/update` includes the ability to update standard properties like display name. * `standard` - Designates common update properties but excludes privileged ones. For example, `libre.graph/applications/standard/read`. * *{Actions}* - The operations being granted. In most circumstances, permissions should be expressed in terms of CRUD operations or allTasks. Actions include: * `create` - The ability to create a new instance of the entity. * `read` - The ability to read a given property set (including allProperties). * `update` - The ability to update a given property set (including allProperties). * `delete` - The ability to delete a given entity. * `allTasks` - Represents all CRUD operations (create, read, update, and delete). Following the CS3 API we can represent the CS3 permissions by mapping them to driveItem properties or relations like this: | [CS3 ResourcePermission](https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.ResourcePermissions) | action | comment | | ------------------------------------------------------------------------------------------------------------ | ------ | ------- | | `stat` | `libre.graph/driveItem/basic/read` | `basic` because it does not include versions or trashed items | | `get_quota` | `libre.graph/driveItem/quota/read` | read only the `quota` property | | `get_path` | `libre.graph/driveItem/path/read` | read only the `path` property | | `move` | `libre.graph/driveItem/path/update` | allows updating the `path` property of a CS3 resource | | `delete` | `libre.graph/driveItem/standard/delete` | `standard` because deleting is a common update operation | | `list_container` | `libre.graph/driveItem/children/read` | | | `create_container` | `libre.graph/driveItem/children/create` | | | `initiate_file_download` | `libre.graph/driveItem/content/read` | `content` is the property read when initiating a download | | `initiate_file_upload` | `libre.graph/driveItem/upload/create` | `uploads` are a separate property. postprocessing creates the `content` | | `add_grant` | `libre.graph/driveItem/permissions/create` | | | `list_grant` | `libre.graph/driveItem/permissions/read` | | | `update_grant` | `libre.graph/driveItem/permissions/update` | | | `remove_grant` | `libre.graph/driveItem/permissions/delete` | | | `deny_grant` | `libre.graph/driveItem/permissions/deny` | uses a non CRUD action `deny` | | `list_file_versions` | `libre.graph/driveItem/versions/read` | `versions` is a `driveItemVersion` collection | | `restore_file_version` | `libre.graph/driveItem/versions/update` | the only `update` action is restore | | `list_recycle` | `libre.graph/driveItem/deleted/read` | reading a driveItem `deleted` property implies listing | | `restore_recycle_item` | `libre.graph/driveItem/deleted/update` | the only `update` action is restore | | `purge_recycle` | `libre.graph/driveItem/deleted/delete` | allows purging deleted `driveItems` | Managing drives would be a different entity. A space manager role could be written as `libre.graph/drive/permission/allTasks`.
AllowedResourceActions []string `json:"allowedResourceActions,omitempty"`
// Optional constraints that must be met for the permission to be effective. Not supported for custom roles. Conditions define constraints that must be met. For example, a requirement that the principal be an owner of the target resource. The following are the supported conditions: * Self: `@Subject.objectId == @Resource.objectId` * Owner: `@Subject.objectId Any_of @Resource.owners` * Grantee: `@Subject.objectId Any_of @Resource.grantee` - does not exist in MS Graph, but we use it to express permissions on shared resources. The following is an example of a role permission with a condition that the principal be the owner of the target resource. ```json \"rolePermissions\": [ { \"allowedResourceActions\": [ \"libre.graph/applications/basic/update\", \"libre.graph/applications/credentials/update\" ], \"condition\": \"@Subject.objectId Any_of @Resource.owners\" } ] ``` Conditions aren't supported for custom roles.
Condition *string `json:"condition,omitempty"`
}
// NewUnifiedRolePermission instantiates a new UnifiedRolePermission 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 NewUnifiedRolePermission() *UnifiedRolePermission {
this := UnifiedRolePermission{}
return &this
}
// NewUnifiedRolePermissionWithDefaults instantiates a new UnifiedRolePermission 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 NewUnifiedRolePermissionWithDefaults() *UnifiedRolePermission {
this := UnifiedRolePermission{}
return &this
}
// GetAllowedResourceActions returns the AllowedResourceActions field value if set, zero value otherwise.
func (o *UnifiedRolePermission) GetAllowedResourceActions() []string {
if o == nil || IsNil(o.AllowedResourceActions) {
var ret []string
return ret
}
return o.AllowedResourceActions
}
// GetAllowedResourceActionsOk returns a tuple with the AllowedResourceActions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UnifiedRolePermission) GetAllowedResourceActionsOk() ([]string, bool) {
if o == nil || IsNil(o.AllowedResourceActions) {
return nil, false
}
return o.AllowedResourceActions, true
}
// HasAllowedResourceActions returns a boolean if a field has been set.
func (o *UnifiedRolePermission) HasAllowedResourceActions() bool {
if o != nil && !IsNil(o.AllowedResourceActions) {
return true
}
return false
}
// SetAllowedResourceActions gets a reference to the given []string and assigns it to the AllowedResourceActions field.
func (o *UnifiedRolePermission) SetAllowedResourceActions(v []string) {
o.AllowedResourceActions = v
}
// GetCondition returns the Condition field value if set, zero value otherwise.
func (o *UnifiedRolePermission) GetCondition() string {
if o == nil || IsNil(o.Condition) {
var ret string
return ret
}
return *o.Condition
}
// GetConditionOk returns a tuple with the Condition field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UnifiedRolePermission) GetConditionOk() (*string, bool) {
if o == nil || IsNil(o.Condition) {
return nil, false
}
return o.Condition, true
}
// HasCondition returns a boolean if a field has been set.
func (o *UnifiedRolePermission) HasCondition() bool {
if o != nil && !IsNil(o.Condition) {
return true
}
return false
}
// SetCondition gets a reference to the given string and assigns it to the Condition field.
func (o *UnifiedRolePermission) SetCondition(v string) {
o.Condition = &v
}
func (o UnifiedRolePermission) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UnifiedRolePermission) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.AllowedResourceActions) {
toSerialize["allowedResourceActions"] = o.AllowedResourceActions
}
if !IsNil(o.Condition) {
toSerialize["condition"] = o.Condition
}
return toSerialize, nil
}
type NullableUnifiedRolePermission struct {
value *UnifiedRolePermission
isSet bool
}
func (v NullableUnifiedRolePermission) Get() *UnifiedRolePermission {
return v.value
}
func (v *NullableUnifiedRolePermission) Set(val *UnifiedRolePermission) {
v.value = val
v.isSet = true
}
func (v NullableUnifiedRolePermission) IsSet() bool {
return v.isSet
}
func (v *NullableUnifiedRolePermission) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUnifiedRolePermission(val *UnifiedRolePermission) *NullableUnifiedRolePermission {
return &NullableUnifiedRolePermission{value: val, isSet: true}
}
func (v NullableUnifiedRolePermission) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUnifiedRolePermission) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -14,6 +14,9 @@ import (
"encoding/json"
)
// checks if the User type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &User{}
// User Represents an Active Directory user object.
type User struct {
// Read-only.
@@ -63,7 +66,7 @@ func NewUserWithDefaults() *User {
// GetId returns the Id field value if set, zero value otherwise.
func (o *User) GetId() string {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
@@ -73,7 +76,7 @@ func (o *User) GetId() string {
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
@@ -81,7 +84,7 @@ func (o *User) GetIdOk() (*string, bool) {
// HasId returns a boolean if a field has been set.
func (o *User) HasId() bool {
if o != nil && o.Id != nil {
if o != nil && !IsNil(o.Id) {
return true
}
@@ -95,7 +98,7 @@ func (o *User) SetId(v string) {
// GetAccountEnabled returns the AccountEnabled field value if set, zero value otherwise.
func (o *User) GetAccountEnabled() bool {
if o == nil || o.AccountEnabled == nil {
if o == nil || IsNil(o.AccountEnabled) {
var ret bool
return ret
}
@@ -105,7 +108,7 @@ func (o *User) GetAccountEnabled() bool {
// GetAccountEnabledOk returns a tuple with the AccountEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetAccountEnabledOk() (*bool, bool) {
if o == nil || o.AccountEnabled == nil {
if o == nil || IsNil(o.AccountEnabled) {
return nil, false
}
return o.AccountEnabled, true
@@ -113,7 +116,7 @@ func (o *User) GetAccountEnabledOk() (*bool, bool) {
// HasAccountEnabled returns a boolean if a field has been set.
func (o *User) HasAccountEnabled() bool {
if o != nil && o.AccountEnabled != nil {
if o != nil && !IsNil(o.AccountEnabled) {
return true
}
@@ -127,7 +130,7 @@ func (o *User) SetAccountEnabled(v bool) {
// GetAppRoleAssignments returns the AppRoleAssignments field value if set, zero value otherwise.
func (o *User) GetAppRoleAssignments() []AppRoleAssignment {
if o == nil || o.AppRoleAssignments == nil {
if o == nil || IsNil(o.AppRoleAssignments) {
var ret []AppRoleAssignment
return ret
}
@@ -137,7 +140,7 @@ func (o *User) GetAppRoleAssignments() []AppRoleAssignment {
// GetAppRoleAssignmentsOk returns a tuple with the AppRoleAssignments field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetAppRoleAssignmentsOk() ([]AppRoleAssignment, bool) {
if o == nil || o.AppRoleAssignments == nil {
if o == nil || IsNil(o.AppRoleAssignments) {
return nil, false
}
return o.AppRoleAssignments, true
@@ -145,7 +148,7 @@ func (o *User) GetAppRoleAssignmentsOk() ([]AppRoleAssignment, bool) {
// HasAppRoleAssignments returns a boolean if a field has been set.
func (o *User) HasAppRoleAssignments() bool {
if o != nil && o.AppRoleAssignments != nil {
if o != nil && !IsNil(o.AppRoleAssignments) {
return true
}
@@ -159,7 +162,7 @@ func (o *User) SetAppRoleAssignments(v []AppRoleAssignment) {
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *User) GetDisplayName() string {
if o == nil || o.DisplayName == nil {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
@@ -169,7 +172,7 @@ func (o *User) GetDisplayName() string {
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetDisplayNameOk() (*string, bool) {
if o == nil || o.DisplayName == nil {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
@@ -177,7 +180,7 @@ func (o *User) GetDisplayNameOk() (*string, bool) {
// HasDisplayName returns a boolean if a field has been set.
func (o *User) HasDisplayName() bool {
if o != nil && o.DisplayName != nil {
if o != nil && !IsNil(o.DisplayName) {
return true
}
@@ -191,7 +194,7 @@ func (o *User) SetDisplayName(v string) {
// GetDrives returns the Drives field value if set, zero value otherwise.
func (o *User) GetDrives() []Drive {
if o == nil || o.Drives == nil {
if o == nil || IsNil(o.Drives) {
var ret []Drive
return ret
}
@@ -201,7 +204,7 @@ func (o *User) GetDrives() []Drive {
// GetDrivesOk returns a tuple with the Drives field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetDrivesOk() ([]Drive, bool) {
if o == nil || o.Drives == nil {
if o == nil || IsNil(o.Drives) {
return nil, false
}
return o.Drives, true
@@ -209,7 +212,7 @@ func (o *User) GetDrivesOk() ([]Drive, bool) {
// HasDrives returns a boolean if a field has been set.
func (o *User) HasDrives() bool {
if o != nil && o.Drives != nil {
if o != nil && !IsNil(o.Drives) {
return true
}
@@ -223,7 +226,7 @@ func (o *User) SetDrives(v []Drive) {
// GetDrive returns the Drive field value if set, zero value otherwise.
func (o *User) GetDrive() Drive {
if o == nil || o.Drive == nil {
if o == nil || IsNil(o.Drive) {
var ret Drive
return ret
}
@@ -233,7 +236,7 @@ func (o *User) GetDrive() Drive {
// GetDriveOk returns a tuple with the Drive field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetDriveOk() (*Drive, bool) {
if o == nil || o.Drive == nil {
if o == nil || IsNil(o.Drive) {
return nil, false
}
return o.Drive, true
@@ -241,7 +244,7 @@ func (o *User) GetDriveOk() (*Drive, bool) {
// HasDrive returns a boolean if a field has been set.
func (o *User) HasDrive() bool {
if o != nil && o.Drive != nil {
if o != nil && !IsNil(o.Drive) {
return true
}
@@ -255,7 +258,7 @@ func (o *User) SetDrive(v Drive) {
// GetIdentities returns the Identities field value if set, zero value otherwise.
func (o *User) GetIdentities() []ObjectIdentity {
if o == nil || o.Identities == nil {
if o == nil || IsNil(o.Identities) {
var ret []ObjectIdentity
return ret
}
@@ -265,7 +268,7 @@ func (o *User) GetIdentities() []ObjectIdentity {
// GetIdentitiesOk returns a tuple with the Identities field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetIdentitiesOk() ([]ObjectIdentity, bool) {
if o == nil || o.Identities == nil {
if o == nil || IsNil(o.Identities) {
return nil, false
}
return o.Identities, true
@@ -273,7 +276,7 @@ func (o *User) GetIdentitiesOk() ([]ObjectIdentity, bool) {
// HasIdentities returns a boolean if a field has been set.
func (o *User) HasIdentities() bool {
if o != nil && o.Identities != nil {
if o != nil && !IsNil(o.Identities) {
return true
}
@@ -287,7 +290,7 @@ func (o *User) SetIdentities(v []ObjectIdentity) {
// GetMail returns the Mail field value if set, zero value otherwise.
func (o *User) GetMail() string {
if o == nil || o.Mail == nil {
if o == nil || IsNil(o.Mail) {
var ret string
return ret
}
@@ -297,7 +300,7 @@ func (o *User) GetMail() string {
// GetMailOk returns a tuple with the Mail field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetMailOk() (*string, bool) {
if o == nil || o.Mail == nil {
if o == nil || IsNil(o.Mail) {
return nil, false
}
return o.Mail, true
@@ -305,7 +308,7 @@ func (o *User) GetMailOk() (*string, bool) {
// HasMail returns a boolean if a field has been set.
func (o *User) HasMail() bool {
if o != nil && o.Mail != nil {
if o != nil && !IsNil(o.Mail) {
return true
}
@@ -319,7 +322,7 @@ func (o *User) SetMail(v string) {
// GetMemberOf returns the MemberOf field value if set, zero value otherwise.
func (o *User) GetMemberOf() []Group {
if o == nil || o.MemberOf == nil {
if o == nil || IsNil(o.MemberOf) {
var ret []Group
return ret
}
@@ -329,7 +332,7 @@ func (o *User) GetMemberOf() []Group {
// GetMemberOfOk returns a tuple with the MemberOf field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetMemberOfOk() ([]Group, bool) {
if o == nil || o.MemberOf == nil {
if o == nil || IsNil(o.MemberOf) {
return nil, false
}
return o.MemberOf, true
@@ -337,7 +340,7 @@ func (o *User) GetMemberOfOk() ([]Group, bool) {
// HasMemberOf returns a boolean if a field has been set.
func (o *User) HasMemberOf() bool {
if o != nil && o.MemberOf != nil {
if o != nil && !IsNil(o.MemberOf) {
return true
}
@@ -351,7 +354,7 @@ func (o *User) SetMemberOf(v []Group) {
// GetOnPremisesSamAccountName returns the OnPremisesSamAccountName field value if set, zero value otherwise.
func (o *User) GetOnPremisesSamAccountName() string {
if o == nil || o.OnPremisesSamAccountName == nil {
if o == nil || IsNil(o.OnPremisesSamAccountName) {
var ret string
return ret
}
@@ -361,7 +364,7 @@ func (o *User) GetOnPremisesSamAccountName() string {
// GetOnPremisesSamAccountNameOk returns a tuple with the OnPremisesSamAccountName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetOnPremisesSamAccountNameOk() (*string, bool) {
if o == nil || o.OnPremisesSamAccountName == nil {
if o == nil || IsNil(o.OnPremisesSamAccountName) {
return nil, false
}
return o.OnPremisesSamAccountName, true
@@ -369,7 +372,7 @@ func (o *User) GetOnPremisesSamAccountNameOk() (*string, bool) {
// HasOnPremisesSamAccountName returns a boolean if a field has been set.
func (o *User) HasOnPremisesSamAccountName() bool {
if o != nil && o.OnPremisesSamAccountName != nil {
if o != nil && !IsNil(o.OnPremisesSamAccountName) {
return true
}
@@ -383,7 +386,7 @@ func (o *User) SetOnPremisesSamAccountName(v string) {
// GetPasswordProfile returns the PasswordProfile field value if set, zero value otherwise.
func (o *User) GetPasswordProfile() PasswordProfile {
if o == nil || o.PasswordProfile == nil {
if o == nil || IsNil(o.PasswordProfile) {
var ret PasswordProfile
return ret
}
@@ -393,7 +396,7 @@ func (o *User) GetPasswordProfile() PasswordProfile {
// GetPasswordProfileOk returns a tuple with the PasswordProfile field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetPasswordProfileOk() (*PasswordProfile, bool) {
if o == nil || o.PasswordProfile == nil {
if o == nil || IsNil(o.PasswordProfile) {
return nil, false
}
return o.PasswordProfile, true
@@ -401,7 +404,7 @@ func (o *User) GetPasswordProfileOk() (*PasswordProfile, bool) {
// HasPasswordProfile returns a boolean if a field has been set.
func (o *User) HasPasswordProfile() bool {
if o != nil && o.PasswordProfile != nil {
if o != nil && !IsNil(o.PasswordProfile) {
return true
}
@@ -415,7 +418,7 @@ func (o *User) SetPasswordProfile(v PasswordProfile) {
// GetSurname returns the Surname field value if set, zero value otherwise.
func (o *User) GetSurname() string {
if o == nil || o.Surname == nil {
if o == nil || IsNil(o.Surname) {
var ret string
return ret
}
@@ -425,7 +428,7 @@ func (o *User) GetSurname() string {
// GetSurnameOk returns a tuple with the Surname field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetSurnameOk() (*string, bool) {
if o == nil || o.Surname == nil {
if o == nil || IsNil(o.Surname) {
return nil, false
}
return o.Surname, true
@@ -433,7 +436,7 @@ func (o *User) GetSurnameOk() (*string, bool) {
// HasSurname returns a boolean if a field has been set.
func (o *User) HasSurname() bool {
if o != nil && o.Surname != nil {
if o != nil && !IsNil(o.Surname) {
return true
}
@@ -447,7 +450,7 @@ func (o *User) SetSurname(v string) {
// GetGivenName returns the GivenName field value if set, zero value otherwise.
func (o *User) GetGivenName() string {
if o == nil || o.GivenName == nil {
if o == nil || IsNil(o.GivenName) {
var ret string
return ret
}
@@ -457,7 +460,7 @@ func (o *User) GetGivenName() string {
// GetGivenNameOk returns a tuple with the GivenName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetGivenNameOk() (*string, bool) {
if o == nil || o.GivenName == nil {
if o == nil || IsNil(o.GivenName) {
return nil, false
}
return o.GivenName, true
@@ -465,7 +468,7 @@ func (o *User) GetGivenNameOk() (*string, bool) {
// HasGivenName returns a boolean if a field has been set.
func (o *User) HasGivenName() bool {
if o != nil && o.GivenName != nil {
if o != nil && !IsNil(o.GivenName) {
return true
}
@@ -479,7 +482,7 @@ func (o *User) SetGivenName(v string) {
// GetUserType returns the UserType field value if set, zero value otherwise.
func (o *User) GetUserType() string {
if o == nil || o.UserType == nil {
if o == nil || IsNil(o.UserType) {
var ret string
return ret
}
@@ -489,7 +492,7 @@ func (o *User) GetUserType() string {
// GetUserTypeOk returns a tuple with the UserType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *User) GetUserTypeOk() (*string, bool) {
if o == nil || o.UserType == nil {
if o == nil || IsNil(o.UserType) {
return nil, false
}
return o.UserType, true
@@ -497,7 +500,7 @@ func (o *User) GetUserTypeOk() (*string, bool) {
// HasUserType returns a boolean if a field has been set.
func (o *User) HasUserType() bool {
if o != nil && o.UserType != nil {
if o != nil && !IsNil(o.UserType) {
return true
}
@@ -510,52 +513,60 @@ func (o *User) SetUserType(v string) {
}
func (o User) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.AccountEnabled != nil {
toSerialize["accountEnabled"] = o.AccountEnabled
}
if o.AppRoleAssignments != nil {
toSerialize["appRoleAssignments"] = o.AppRoleAssignments
}
if o.DisplayName != nil {
toSerialize["displayName"] = o.DisplayName
}
if o.Drives != nil {
toSerialize["drives"] = o.Drives
}
if o.Drive != nil {
toSerialize["drive"] = o.Drive
}
if o.Identities != nil {
toSerialize["identities"] = o.Identities
}
if o.Mail != nil {
toSerialize["mail"] = o.Mail
}
if o.MemberOf != nil {
toSerialize["memberOf"] = o.MemberOf
}
if o.OnPremisesSamAccountName != nil {
toSerialize["onPremisesSamAccountName"] = o.OnPremisesSamAccountName
}
if o.PasswordProfile != nil {
toSerialize["passwordProfile"] = o.PasswordProfile
}
if o.Surname != nil {
toSerialize["surname"] = o.Surname
}
if o.GivenName != nil {
toSerialize["givenName"] = o.GivenName
}
if o.UserType != nil {
toSerialize["userType"] = o.UserType
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o User) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.AccountEnabled) {
toSerialize["accountEnabled"] = o.AccountEnabled
}
if !IsNil(o.AppRoleAssignments) {
toSerialize["appRoleAssignments"] = o.AppRoleAssignments
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
if !IsNil(o.Drives) {
toSerialize["drives"] = o.Drives
}
if !IsNil(o.Drive) {
toSerialize["drive"] = o.Drive
}
if !IsNil(o.Identities) {
toSerialize["identities"] = o.Identities
}
if !IsNil(o.Mail) {
toSerialize["mail"] = o.Mail
}
if !IsNil(o.MemberOf) {
toSerialize["memberOf"] = o.MemberOf
}
if !IsNil(o.OnPremisesSamAccountName) {
toSerialize["onPremisesSamAccountName"] = o.OnPremisesSamAccountName
}
if !IsNil(o.PasswordProfile) {
toSerialize["passwordProfile"] = o.PasswordProfile
}
if !IsNil(o.Surname) {
toSerialize["surname"] = o.Surname
}
if !IsNil(o.GivenName) {
toSerialize["givenName"] = o.GivenName
}
if !IsNil(o.UserType) {
toSerialize["userType"] = o.UserType
}
return toSerialize, nil
}
type NullableUser struct {
value *User
isSet bool

View File

@@ -12,6 +12,7 @@ package libregraph
import (
"encoding/json"
"reflect"
"time"
)
@@ -326,3 +327,21 @@ func (v *NullableTime) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
// IsNil checks if an input is nil
func IsNil(i interface{}) bool {
if i == nil {
return true
}
switch reflect.TypeOf(i).Kind() {
case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice:
return reflect.ValueOf(i).IsNil()
case reflect.Array:
return reflect.ValueOf(i).IsZero()
}
return false
}
type MappedNullable interface {
ToMap() (map[string]interface{}, error)
}

4
vendor/modules.txt vendored
View File

@@ -1548,8 +1548,8 @@ 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.20230710073250-9e5acb4b5838
## explicit; go 1.13
# github.com/owncloud/libre-graph-api-go v1.0.5-0.20231019070917-17ae03ef40e4
## explicit; go 1.18
github.com/owncloud/libre-graph-api-go
# github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c
## explicit; go 1.12