chore: bump libre-graph-api-go

Adapt the collaboration service to the changed GetUserPhoto return type.
This commit is contained in:
Dominik Schmidt
2026-07-11 12:25:32 +02:00
parent 8c3ef60da1
commit 535755cd04
21 changed files with 2705 additions and 38 deletions

View File

@@ -7,19 +7,12 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
- API version: v1.0.8
- Package version: 1.0.0
- Generator version: 7.13.0
- Generator version: 7.23.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
## Installation
Install the following dependencies:
```sh
go get github.com/stretchr/testify/assert
go get golang.org/x/net/context
```
Put the package under your project folder and add the following in import:
Import the package in a go file in your project and run `go mod tidy`:
```go
import libregraph "github.com/opencloud-eu/libre-graph-api-go"
@@ -81,8 +74,11 @@ Class | Method | HTTP request | Description
*ActivitiesApi* | [**GetActivities**](docs/ActivitiesApi.md#getactivities) | **Get** /v1beta1/extensions/org.libregraph/activities | Get activities
*ApplicationsApi* | [**GetApplication**](docs/ApplicationsApi.md#getapplication) | **Get** /v1.0/applications/{application-id} | Get application by id
*ApplicationsApi* | [**ListApplications**](docs/ApplicationsApi.md#listapplications) | **Get** /v1.0/applications | Get all applications
*DriveItemApi* | [**CreateChildDriveItem**](docs/DriveItemApi.md#createchilddriveitem) | **Post** /v1beta1/drives/{drive-id}/items/{item-id}/children | Create a new DriveItem under a parent item
*DriveItemApi* | [**DeleteDriveItem**](docs/DriveItemApi.md#deletedriveitem) | **Delete** /v1beta1/drives/{drive-id}/items/{item-id} | Delete a DriveItem.
*DriveItemApi* | [**GetDriveItem**](docs/DriveItemApi.md#getdriveitem) | **Get** /v1beta1/drives/{drive-id}/items/{item-id} | Get a DriveItem.
*DriveItemApi* | [**GetDriveItemChildren**](docs/DriveItemApi.md#getdriveitemchildren) | **Get** /v1.0/drives/{drive-id}/items/{item-id}/children | List children of a DriveItem
*DriveItemApi* | [**GetDriveItemContent**](docs/DriveItemApi.md#getdriveitemcontent) | **Get** /v1beta1/drives/{drive-id}/items/{item-id}/content | Download the content of a DriveItem
*DriveItemApi* | [**UpdateDriveItem**](docs/DriveItemApi.md#updatedriveitem) | **Patch** /v1beta1/drives/{drive-id}/items/{item-id} | Update a DriveItem.
*DrivesApi* | [**CreateDrive**](docs/DrivesApi.md#createdrive) | **Post** /v1.0/drives | Create a new drive of a specific type
*DrivesApi* | [**DeleteDrive**](docs/DrivesApi.md#deletedrive) | **Delete** /v1.0/drives/{drive-id} | Delete a specific space
@@ -97,7 +93,7 @@ Class | Method | HTTP request | Description
*DrivesPermissionsApi* | [**ListPermissions**](docs/DrivesPermissionsApi.md#listpermissions) | **Get** /v1beta1/drives/{drive-id}/items/{item-id}/permissions | List the effective sharing permissions on a driveItem.
*DrivesPermissionsApi* | [**SetPermissionPassword**](docs/DrivesPermissionsApi.md#setpermissionpassword) | **Post** /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}/setPassword | Set sharing link password
*DrivesPermissionsApi* | [**UpdatePermission**](docs/DrivesPermissionsApi.md#updatepermission) | **Patch** /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id} | Update sharing permission
*DrivesRootApi* | [**CreateDriveItem**](docs/DrivesRootApi.md#createdriveitem) | **Post** /v1beta1/drives/{drive-id}/root/children | Create a drive item
*DrivesRootApi* | [**CreateDriveItem**](docs/DrivesRootApi.md#createdriveitem) | **Post** /v1beta1/drives/{drive-id}/root/children | Create a new DriveItem at the drive root
*DrivesRootApi* | [**CreateLinkSpaceRoot**](docs/DrivesRootApi.md#createlinkspaceroot) | **Post** /v1beta1/drives/{drive-id}/root/createLink | Create a sharing link for the root item of a Drive
*DrivesRootApi* | [**DeletePermissionSpaceRoot**](docs/DrivesRootApi.md#deletepermissionspaceroot) | **Delete** /v1beta1/drives/{drive-id}/root/permissions/{perm-id} | Remove access to a Drive
*DrivesRootApi* | [**GetPermissionSpaceRoot**](docs/DrivesRootApi.md#getpermissionspaceroot) | **Get** /v1beta1/drives/{drive-id}/root/permissions/{perm-id} | Get a single sharing permission for the root item of a drive
@@ -141,6 +137,9 @@ Class | Method | HTTP request | Description
*GroupApi* | [**UpdateGroup**](docs/GroupApi.md#updategroup) | **Patch** /v1.0/groups/{group-id} | Update entity in groups
*GroupsApi* | [**CreateGroup**](docs/GroupsApi.md#creategroup) | **Post** /v1.0/groups | Add new entity to groups
*GroupsApi* | [**ListGroups**](docs/GroupsApi.md#listgroups) | **Get** /v1.0/groups | Get entities from groups
*InvitationsApi* | [**CreateInvitation**](docs/InvitationsApi.md#createinvitation) | **Post** /v1.0/invitations | Create a new invitation
*InvitationsApi* | [**GetInvitation**](docs/InvitationsApi.md#getinvitation) | **Get** /v1.0/invitations/{invitation-id} | Get an invitation by key
*InvitationsApi* | [**ListInvitations**](docs/InvitationsApi.md#listinvitations) | **Get** /v1.0/invitations | Get a list of invitations
*MeChangepasswordApi* | [**ChangeOwnPassword**](docs/MeChangepasswordApi.md#changeownpassword) | **Post** /v1.0/me/changePassword | Change your own password
*MeDriveApi* | [**FollowDriveItem**](docs/MeDriveApi.md#followdriveitem) | **Post** /v1.0/me/drive/items/{item-id}/follow | Follow a DriveItem
*MeDriveApi* | [**GetHome**](docs/MeDriveApi.md#gethome) | **Get** /v1.0/me/drive | Get personal space for user
@@ -197,6 +196,7 @@ Class | Method | HTTP request | Description
- [CollectionOfEducationClass](docs/CollectionOfEducationClass.md)
- [CollectionOfEducationUser](docs/CollectionOfEducationUser.md)
- [CollectionOfGroup](docs/CollectionOfGroup.md)
- [CollectionOfInvitations](docs/CollectionOfInvitations.md)
- [CollectionOfPermissions](docs/CollectionOfPermissions.md)
- [CollectionOfPermissionsWithAllowedValues](docs/CollectionOfPermissionsWithAllowedValues.md)
- [CollectionOfSchools](docs/CollectionOfSchools.md)
@@ -214,6 +214,7 @@ Class | Method | HTTP request | Description
- [EducationSchool](docs/EducationSchool.md)
- [EducationUser](docs/EducationUser.md)
- [EducationUserReference](docs/EducationUserReference.md)
- [EmailAddress](docs/EmailAddress.md)
- [ExportPersonalDataRequest](docs/ExportPersonalDataRequest.md)
- [FileSystemInfo](docs/FileSystemInfo.md)
- [Folder](docs/Folder.md)
@@ -224,8 +225,12 @@ Class | Method | HTTP request | Description
- [Identity](docs/Identity.md)
- [IdentitySet](docs/IdentitySet.md)
- [Image](docs/Image.md)
- [Invitation](docs/Invitation.md)
- [InvitedUserMessageInfo](docs/InvitedUserMessageInfo.md)
- [ItemReference](docs/ItemReference.md)
- [LivePhoto](docs/LivePhoto.md)
- [MemberReference](docs/MemberReference.md)
- [MotionPhoto](docs/MotionPhoto.md)
- [ObjectIdentity](docs/ObjectIdentity.md)
- [OdataError](docs/OdataError.md)
- [OdataErrorDetail](docs/OdataErrorDetail.md)
@@ -236,6 +241,7 @@ Class | Method | HTTP request | Description
- [Permission](docs/Permission.md)
- [Photo](docs/Photo.md)
- [Quota](docs/Quota.md)
- [Recipient](docs/Recipient.md)
- [RemoteItem](docs/RemoteItem.md)
- [SharePointIdentitySet](docs/SharePointIdentitySet.md)
- [SharingInvitation](docs/SharingInvitation.md)

View File

@@ -23,6 +23,218 @@ import (
// DriveItemApiService DriveItemApi service
type DriveItemApiService service
type ApiCreateChildDriveItemRequest struct {
ctx context.Context
ApiService *DriveItemApiService
driveId string
itemId string
driveItem *DriveItem
libreGraphConflictBehavior *string
libreGraphMissingParentsBehavior *string
}
// In the request body, provide a JSON object describing the new driveItem. Must specify exactly one of `folder` or `file`.
func (r ApiCreateChildDriveItemRequest) DriveItem(driveItem DriveItem) ApiCreateChildDriveItemRequest {
r.driveItem = &driveItem
return r
}
// Controls what happens when a child with the same name already exists. `fail` (default) returns 409; `replace` overwrites the existing item. MS Graph's `rename` value is not supported.
func (r ApiCreateChildDriveItemRequest) LibreGraphConflictBehavior(libreGraphConflictBehavior string) ApiCreateChildDriveItemRequest {
r.libreGraphConflictBehavior = &libreGraphConflictBehavior
return r
}
// Controls what happens when a colon-syntax URL refers to a path whose intermediate folders don't all exist yet. `fail` (default) returns 404; `create` creates the missing intermediate folders before creating the final item. Only meaningful for colon-syntax URLs; ignored otherwise.
func (r ApiCreateChildDriveItemRequest) LibreGraphMissingParentsBehavior(libreGraphMissingParentsBehavior string) ApiCreateChildDriveItemRequest {
r.libreGraphMissingParentsBehavior = &libreGraphMissingParentsBehavior
return r
}
func (r ApiCreateChildDriveItemRequest) Execute() (*DriveItem, *http.Response, error) {
return r.ApiService.CreateChildDriveItemExecute(r)
}
/*
CreateChildDriveItem Create a new DriveItem under a parent item
Create a new folder or DriveItem in a Drive with the specified parent item. The parent must exist and be a folder.
Modeled on the MS Graph create driveItem endpoint
(https://learn.microsoft.com/en-us/graph/api/driveitem-post-children).
Identical request and response shape to the [drive-root variant](#/drives.root/CreateDriveItem), just with an explicit parent item id rather than the drive root.
The request body must specify exactly one of `folder` (set to `{}` to create a folder) or `file` (to create a file item). Requests with none of these, or with both, return 400. The `@libre.graph.conflictBehavior` query parameter controls what happens if a child with the same name already exists.
This endpoint also accepts the MS Graph colon-syntax URL form:
POST /v1beta1/drives/{drive-id}/items/{item-id}:/{path}:/children
OpenAPI cannot express the colon-delimited path segment, so this URL form is not represented as a separate operation in this specification. The server still accepts it, resolves `:/{path}:` as the parent of the new item (relative to `item-id`), and applies `@libre.graph.missingParentsBehavior` to decide whether to create missing intermediate folders.
@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 ApiCreateChildDriveItemRequest
*/
func (a *DriveItemApiService) CreateChildDriveItem(ctx context.Context, driveId string, itemId string) ApiCreateChildDriveItemRequest {
return ApiCreateChildDriveItemRequest{
ApiService: a,
ctx: ctx,
driveId: driveId,
itemId: itemId,
}
}
// Execute executes the request
// @return DriveItem
func (a *DriveItemApiService) CreateChildDriveItemExecute(r ApiCreateChildDriveItemRequest) (*DriveItem, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DriveItem
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DriveItemApiService.CreateChildDriveItem")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}/items/{item-id}/children"
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{}
if r.driveItem == nil {
return localVarReturnValue, nil, reportError("driveItem is required and must be specified")
}
if r.libreGraphConflictBehavior != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "@libre.graph.conflictBehavior", r.libreGraphConflictBehavior, "form", "")
} else {
var defaultValue string = "fail"
parameterAddToHeaderOrQuery(localVarQueryParams, "@libre.graph.conflictBehavior", defaultValue, "form", "")
r.libreGraphConflictBehavior = &defaultValue
}
if r.libreGraphMissingParentsBehavior != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "@libre.graph.missingParentsBehavior", r.libreGraphMissingParentsBehavior, "form", "")
} else {
var defaultValue string = "fail"
parameterAddToHeaderOrQuery(localVarQueryParams, "@libre.graph.missingParentsBehavior", defaultValue, "form", "")
r.libreGraphMissingParentsBehavior = &defaultValue
}
// 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.driveItem
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
}
if localVarHTTPResponse.StatusCode == 403 {
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
}
if localVarHTTPResponse.StatusCode == 404 {
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
}
if localVarHTTPResponse.StatusCode == 409 {
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 ApiDeleteDriveItemRequest struct {
ctx context.Context
ApiService *DriveItemApiService
@@ -137,6 +349,13 @@ type ApiGetDriveItemRequest struct {
ApiService *DriveItemApiService
driveId string
itemId string
select_ *[]string
}
// Select additional properties to be returned.
func (r ApiGetDriveItemRequest) Select_(select_ []string) ApiGetDriveItemRequest {
r.select_ = &select_
return r
}
func (r ApiGetDriveItemRequest) Execute() (*DriveItem, *http.Response, error) {
@@ -186,6 +405,9 @@ func (a *DriveItemApiService) GetDriveItemExecute(r ApiGetDriveItemRequest) (*Dr
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.select_ != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "form", "csv")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@@ -248,6 +470,275 @@ func (a *DriveItemApiService) GetDriveItemExecute(r ApiGetDriveItemRequest) (*Dr
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetDriveItemChildrenRequest struct {
ctx context.Context
ApiService *DriveItemApiService
driveId string
itemId string
}
func (r ApiGetDriveItemChildrenRequest) Execute() (*CollectionOfDriveItems, *http.Response, error) {
return r.ApiService.GetDriveItemChildrenExecute(r)
}
/*
GetDriveItemChildren List children of a DriveItem
List the children of the item identified by `item-id` in the drive identified by `drive-id`. The item must exist and be a folder.
Modeled on the MS Graph list driveItem children endpoint
(https://learn.microsoft.com/en-us/graph/api/driveitem-list-children).
This endpoint also accepts the MS Graph colon-syntax URL forms:
GET /v1.0/drives/{drive-id}/root:/{path}:/children
GET /v1.0/drives/{drive-id}/items/{item-id}:/{path}:/children
OpenAPI cannot express the colon-delimited path segment, so these URL forms are not represented as separate operations in this specification. The server still accepts them, resolves `:/{path}:` as the parent item, and lists its children.
@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 ApiGetDriveItemChildrenRequest
*/
func (a *DriveItemApiService) GetDriveItemChildren(ctx context.Context, driveId string, itemId string) ApiGetDriveItemChildrenRequest {
return ApiGetDriveItemChildrenRequest{
ApiService: a,
ctx: ctx,
driveId: driveId,
itemId: itemId,
}
}
// Execute executes the request
// @return CollectionOfDriveItems
func (a *DriveItemApiService) GetDriveItemChildrenExecute(r ApiGetDriveItemChildrenRequest) (*CollectionOfDriveItems, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *CollectionOfDriveItems
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DriveItemApiService.GetDriveItemChildren")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1.0/drives/{drive-id}/items/{item-id}/children"
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 ApiGetDriveItemContentRequest struct {
ctx context.Context
ApiService *DriveItemApiService
driveId string
itemId string
}
func (r ApiGetDriveItemContentRequest) Execute() (*OdataError, *http.Response, error) {
return r.ApiService.GetDriveItemContentExecute(r)
}
/*
GetDriveItemContent Download the content of a DriveItem
Download the contents of the primary stream (file) of a driveItem. Only
driveItem objects with a `file` facet can be downloaded.
The response is a `302 Found` redirecting to a pre-authenticated download
URL for the file. This is the same URL that is returned via the
`@microsoft.graph.downloadUrl` instance annotation on the driveItem when
requested via `$select`. Choose between the two based on whether you
want to call the redirecting `/content` endpoint directly (for example,
with a client that follows redirects automatically) or you want to
inspect / schedule / prefetch the URL yourself via the annotation.
The pre-authenticated URL is short-lived and does not require an
`Authorization` header.
To download a partial range of bytes, apply the `Range` header to the
redirect target (the pre-authenticated URL), not to the `/content`
request.
@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 ApiGetDriveItemContentRequest
*/
func (a *DriveItemApiService) GetDriveItemContent(ctx context.Context, driveId string, itemId string) ApiGetDriveItemContentRequest {
return ApiGetDriveItemContentRequest{
ApiService: a,
ctx: ctx,
driveId: driveId,
itemId: itemId,
}
}
// Execute executes the request
// @return OdataError
func (a *DriveItemApiService) GetDriveItemContentExecute(r ApiGetDriveItemContentRequest) (*OdataError, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *OdataError
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DriveItemApiService.GetDriveItemContent")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}/items/{item-id}/content"
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,
}
if localVarHTTPResponse.StatusCode == 404 {
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 ApiUpdateDriveItemRequest struct {
ctx context.Context
ApiService *DriveItemApiService

View File

@@ -27,10 +27,24 @@ type ApiCreateDriveItemRequest struct {
ctx context.Context
ApiService *DrivesRootApiService
driveId string
libreGraphConflictBehavior *string
libreGraphMissingParentsBehavior *string
driveItem *DriveItem
}
// In the request body, provide a JSON object with the following parameters. For mounting a share the necessary remoteItem id and permission id can be taken from the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint.
// Controls what happens when a child with the same name already exists. `fail` (default) returns 409; `replace` overwrites the existing item. MS Graph's `rename` value is not supported.
func (r ApiCreateDriveItemRequest) LibreGraphConflictBehavior(libreGraphConflictBehavior string) ApiCreateDriveItemRequest {
r.libreGraphConflictBehavior = &libreGraphConflictBehavior
return r
}
// Controls what happens when a colon-syntax URL refers to a path whose intermediate folders don't all exist yet. `fail` (default) returns 404; `create` creates the missing intermediate folders before creating the final item. Only meaningful for colon-syntax URLs; ignored otherwise.
func (r ApiCreateDriveItemRequest) LibreGraphMissingParentsBehavior(libreGraphMissingParentsBehavior string) ApiCreateDriveItemRequest {
r.libreGraphMissingParentsBehavior = &libreGraphMissingParentsBehavior
return r
}
// In the request body, provide a JSON object describing the new driveItem. Must specify exactly one of `folder`, `file`, or `remoteItem`. For mount-share, see [sharedWithMe](#/me.drive/ListSharedWithMe) for obtaining the source `remoteItem.id` and `permission` id.
func (r ApiCreateDriveItemRequest) DriveItem(driveItem DriveItem) ApiCreateDriveItemRequest {
r.driveItem = &driveItem
return r
@@ -41,9 +55,22 @@ func (r ApiCreateDriveItemRequest) Execute() (*DriveItem, *http.Response, error)
}
/*
CreateDriveItem Create a drive item
CreateDriveItem Create a new DriveItem at the drive root
You can use the root childrens endpoint to mount a remoteItem in the share jail. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to true.
Create a new folder or DriveItem in a Drive with the drive root as the parent.
Modeled on the MS Graph create driveItem endpoint
(https://learn.microsoft.com/en-us/graph/api/driveitem-post-children).
The request body must specify exactly one of `folder` (set to `{}` to create a folder), `file` (to create a file item), or `remoteItem` (to mount a shared item; see [sharedWithMe](#/me.drive/ListSharedWithMe) for obtaining the source `remoteItem.id`). Requests with none of these, or with more than one, return 400. Mounting a share changes the `@client.synchronize` property of the `driveItem` in [sharedWithMe](#/me.drive/ListSharedWithMe) to true.
The `@libre.graph.conflictBehavior` query parameter controls what happens if a child with the same name already exists.
This endpoint also accepts the MS Graph colon-syntax URL form:
POST /v1beta1/drives/{drive-id}/root:/{path}:/children
OpenAPI cannot express the colon-delimited path segment, so this URL form is not represented as a separate operation in this specification. The server still accepts it, resolves `:/{path}:` as the parent of the new item, and applies `@libre.graph.missingParentsBehavior` to decide whether to create missing intermediate folders.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@@ -80,6 +107,20 @@ func (a *DrivesRootApiService) CreateDriveItemExecute(r ApiCreateDriveItemReques
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.libreGraphConflictBehavior != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "@libre.graph.conflictBehavior", r.libreGraphConflictBehavior, "form", "")
} else {
var defaultValue string = "fail"
parameterAddToHeaderOrQuery(localVarQueryParams, "@libre.graph.conflictBehavior", defaultValue, "form", "")
r.libreGraphConflictBehavior = &defaultValue
}
if r.libreGraphMissingParentsBehavior != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "@libre.graph.missingParentsBehavior", r.libreGraphMissingParentsBehavior, "form", "")
} else {
var defaultValue string = "fail"
parameterAddToHeaderOrQuery(localVarQueryParams, "@libre.graph.missingParentsBehavior", defaultValue, "form", "")
r.libreGraphMissingParentsBehavior = &defaultValue
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
@@ -506,6 +547,13 @@ type ApiGetRootRequest struct {
ctx context.Context
ApiService *DrivesRootApiService
driveId string
select_ *[]string
}
// Select additional properties to be returned.
func (r ApiGetRootRequest) Select_(select_ []string) ApiGetRootRequest {
r.select_ = &select_
return r
}
func (r ApiGetRootRequest) Execute() (*DriveItem, *http.Response, error) {
@@ -549,6 +597,9 @@ func (a *DrivesRootApiService) GetRootExecute(r ApiGetRootRequest) (*DriveItem,
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.select_ != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "form", "csv")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}

View File

@@ -0,0 +1,328 @@
/*
Libre Graph API
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
API version: v1.0.8
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package libregraph
import (
"bytes"
"context"
"io"
"net/http"
"net/url"
"strings"
)
// InvitationsApiService InvitationsApi service
type InvitationsApiService service
type ApiCreateInvitationRequest struct {
ctx context.Context
ApiService *InvitationsApiService
invitation *Invitation
}
// New invitation
func (r ApiCreateInvitationRequest) Invitation(invitation Invitation) ApiCreateInvitationRequest {
r.invitation = &invitation
return r
}
func (r ApiCreateInvitationRequest) Execute() (*Invitation, *http.Response, error) {
return r.ApiService.CreateInvitationExecute(r)
}
/*
CreateInvitation Create a new invitation
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiCreateInvitationRequest
*/
func (a *InvitationsApiService) CreateInvitation(ctx context.Context) ApiCreateInvitationRequest {
return ApiCreateInvitationRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return Invitation
func (a *InvitationsApiService) CreateInvitationExecute(r ApiCreateInvitationRequest) (*Invitation, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Invitation
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InvitationsApiService.CreateInvitation")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1.0/invitations"
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.invitation
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,
}
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 ApiGetInvitationRequest struct {
ctx context.Context
ApiService *InvitationsApiService
invitationId string
}
func (r ApiGetInvitationRequest) Execute() (*Invitation, *http.Response, error) {
return r.ApiService.GetInvitationExecute(r)
}
/*
GetInvitation Get an invitation by key
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param invitationId key: id of invitation
@return ApiGetInvitationRequest
*/
func (a *InvitationsApiService) GetInvitation(ctx context.Context, invitationId string) ApiGetInvitationRequest {
return ApiGetInvitationRequest{
ApiService: a,
ctx: ctx,
invitationId: invitationId,
}
}
// Execute executes the request
// @return Invitation
func (a *InvitationsApiService) GetInvitationExecute(r ApiGetInvitationRequest) (*Invitation, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *Invitation
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InvitationsApiService.GetInvitation")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1.0/invitations/{invitation-id}"
localVarPath = strings.Replace(localVarPath, "{"+"invitation-id"+"}", url.PathEscape(parameterValueToString(r.invitationId, "invitationId")), -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,
}
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 ApiListInvitationsRequest struct {
ctx context.Context
ApiService *InvitationsApiService
}
func (r ApiListInvitationsRequest) Execute() (*CollectionOfInvitations, *http.Response, error) {
return r.ApiService.ListInvitationsExecute(r)
}
/*
ListInvitations Get a list of invitations
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiListInvitationsRequest
*/
func (a *InvitationsApiService) ListInvitations(ctx context.Context) ApiListInvitationsRequest {
return ApiListInvitationsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
// @return CollectionOfInvitations
func (a *InvitationsApiService) ListInvitationsExecute(r ApiListInvitationsRequest) (*CollectionOfInvitations, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *CollectionOfInvitations
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "InvitationsApiService.ListInvitations")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/v1.0/invitations"
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,
}
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

@@ -25,6 +25,13 @@ type MeDriveRootApiService service
type ApiHomeGetRootRequest struct {
ctx context.Context
ApiService *MeDriveRootApiService
select_ *[]string
}
// Select additional properties to be returned.
func (r ApiHomeGetRootRequest) Select_(select_ []string) ApiHomeGetRootRequest {
r.select_ = &select_
return r
}
func (r ApiHomeGetRootRequest) Execute() (*DriveItem, *http.Response, error) {
@@ -65,6 +72,9 @@ func (a *MeDriveRootApiService) HomeGetRootExecute(r ApiHomeGetRootRequest) (*Dr
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.select_ != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "form", "csv")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}

View File

@@ -25,6 +25,13 @@ type MeDriveRootChildrenApiService service
type ApiHomeGetChildrenRequest struct {
ctx context.Context
ApiService *MeDriveRootChildrenApiService
select_ *[]string
}
// Select additional properties to be returned.
func (r ApiHomeGetChildrenRequest) Select_(select_ []string) ApiHomeGetChildrenRequest {
r.select_ = &select_
return r
}
func (r ApiHomeGetChildrenRequest) Execute() (*CollectionOfDriveItems, *http.Response, error) {
@@ -65,6 +72,9 @@ func (a *MeDriveRootChildrenApiService) HomeGetChildrenExecute(r ApiHomeGetChild
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.select_ != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "form", "csv")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}

View File

@@ -16,7 +16,6 @@ import (
"io"
"net/http"
"net/url"
"os"
)
@@ -122,7 +121,7 @@ type ApiGetOwnUserPhotoRequest struct {
ApiService *MePhotoApiService
}
func (r ApiGetOwnUserPhotoRequest) Execute() (*os.File, *http.Response, error) {
func (r ApiGetOwnUserPhotoRequest) Execute() (io.Reader, *http.Response, error) {
return r.ApiService.GetOwnUserPhotoExecute(r)
}
@@ -140,13 +139,13 @@ func (a *MePhotoApiService) GetOwnUserPhoto(ctx context.Context) ApiGetOwnUserPh
}
// Execute executes the request
// @return *os.File
func (a *MePhotoApiService) GetOwnUserPhotoExecute(r ApiGetOwnUserPhotoRequest) (*os.File, *http.Response, error) {
// @return io.Reader
func (a *MePhotoApiService) GetOwnUserPhotoExecute(r ApiGetOwnUserPhotoRequest) (io.Reader, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *os.File
localVarReturnValue io.Reader
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MePhotoApiService.GetOwnUserPhoto")
@@ -225,11 +224,11 @@ func (a *MePhotoApiService) GetOwnUserPhotoExecute(r ApiGetOwnUserPhotoRequest)
type ApiUpdateOwnUserPhotoPatchRequest struct {
ctx context.Context
ApiService *MePhotoApiService
body *os.File
body io.Reader
}
// New user photo
func (r ApiUpdateOwnUserPhotoPatchRequest) Body(body *os.File) ApiUpdateOwnUserPhotoPatchRequest {
func (r ApiUpdateOwnUserPhotoPatchRequest) Body(body io.Reader) ApiUpdateOwnUserPhotoPatchRequest {
r.body = body
return r
}
@@ -328,11 +327,11 @@ func (a *MePhotoApiService) UpdateOwnUserPhotoPatchExecute(r ApiUpdateOwnUserPho
type ApiUpdateOwnUserPhotoPutRequest struct {
ctx context.Context
ApiService *MePhotoApiService
body *os.File
body io.Reader
}
// New user photo
func (r ApiUpdateOwnUserPhotoPutRequest) Body(body *os.File) ApiUpdateOwnUserPhotoPutRequest {
func (r ApiUpdateOwnUserPhotoPutRequest) Body(body io.Reader) ApiUpdateOwnUserPhotoPutRequest {
r.body = body
return r
}

View File

@@ -17,7 +17,6 @@ import (
"net/http"
"net/url"
"strings"
"os"
)
@@ -30,7 +29,7 @@ type ApiGetUserPhotoRequest struct {
userId string
}
func (r ApiGetUserPhotoRequest) Execute() (*os.File, *http.Response, error) {
func (r ApiGetUserPhotoRequest) Execute() (io.Reader, *http.Response, error) {
return r.ApiService.GetUserPhotoExecute(r)
}
@@ -50,13 +49,13 @@ func (a *UserPhotoApiService) GetUserPhoto(ctx context.Context, userId string) A
}
// Execute executes the request
// @return *os.File
func (a *UserPhotoApiService) GetUserPhotoExecute(r ApiGetUserPhotoRequest) (*os.File, *http.Response, error) {
// @return io.Reader
func (a *UserPhotoApiService) GetUserPhotoExecute(r ApiGetUserPhotoRequest) (io.Reader, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *os.File
localVarReturnValue io.Reader
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserPhotoApiService.GetUserPhoto")

View File

@@ -75,6 +75,8 @@ type APIClient struct {
GroupsApi *GroupsApiService
InvitationsApi *InvitationsApiService
MeChangepasswordApi *MeChangepasswordApiService
MeDriveApi *MeDriveApiService
@@ -131,6 +133,7 @@ func NewAPIClient(cfg *Configuration) *APIClient {
c.EducationUserApi = (*EducationUserApiService)(&c.common)
c.GroupApi = (*GroupApiService)(&c.common)
c.GroupsApi = (*GroupsApiService)(&c.common)
c.InvitationsApi = (*InvitationsApiService)(&c.common)
c.MeChangepasswordApi = (*MeChangepasswordApiService)(&c.common)
c.MeDriveApi = (*MeDriveApiService)(&c.common)
c.MeDriveRootApi = (*MeDriveRootApiService)(&c.common)
@@ -519,6 +522,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err
*s = string(b)
return nil
}
if r, ok := v.(*io.Reader); ok {
*r = bytes.NewReader(b)
return nil
}
// Must stay before the JSON branch: json.Unmarshal would base64-decode into *[]byte.
if p, ok := v.(*[]byte); ok {
*p = b
return nil
}
if f, ok := v.(*os.File); ok {
f, err = os.CreateTemp("", "HttpClientFile")
if err != nil {
@@ -572,10 +584,7 @@ func addFile(w *multipart.Writer, fieldName, path string) error {
if err != nil {
return err
}
err = file.Close()
if err != nil {
return err
}
defer file.Close()
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
if err != nil {

View File

@@ -0,0 +1,126 @@
/*
Libre Graph API
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
API version: v1.0.8
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package libregraph
import (
"encoding/json"
)
// checks if the CollectionOfInvitations type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CollectionOfInvitations{}
// CollectionOfInvitations struct for CollectionOfInvitations
type CollectionOfInvitations struct {
Value []Invitation `json:"value,omitempty"`
}
// NewCollectionOfInvitations instantiates a new CollectionOfInvitations 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 NewCollectionOfInvitations() *CollectionOfInvitations {
this := CollectionOfInvitations{}
return &this
}
// NewCollectionOfInvitationsWithDefaults instantiates a new CollectionOfInvitations 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 NewCollectionOfInvitationsWithDefaults() *CollectionOfInvitations {
this := CollectionOfInvitations{}
return &this
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *CollectionOfInvitations) GetValue() []Invitation {
if o == nil || IsNil(o.Value) {
var ret []Invitation
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 *CollectionOfInvitations) GetValueOk() ([]Invitation, 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 *CollectionOfInvitations) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given []Invitation and assigns it to the Value field.
func (o *CollectionOfInvitations) SetValue(v []Invitation) {
o.Value = v
}
func (o CollectionOfInvitations) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CollectionOfInvitations) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableCollectionOfInvitations struct {
value *CollectionOfInvitations
isSet bool
}
func (v NullableCollectionOfInvitations) Get() *CollectionOfInvitations {
return v.value
}
func (v *NullableCollectionOfInvitations) Set(val *CollectionOfInvitations) {
v.value = val
v.isSet = true
}
func (v NullableCollectionOfInvitations) IsSet() bool {
return v.isSet
}
func (v *NullableCollectionOfInvitations) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCollectionOfInvitations(val *CollectionOfInvitations) *NullableCollectionOfInvitations {
return &NullableCollectionOfInvitations{value: val, isSet: true}
}
func (v NullableCollectionOfInvitations) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCollectionOfInvitations) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -65,10 +65,20 @@ type DriveItem struct {
Permissions []Permission `json:"permissions,omitempty"`
Audio *Audio `json:"audio,omitempty"`
Video *Video `json:"video,omitempty"`
LibreGraphMotionPhoto *MotionPhoto `json:"@libre.graph.motionPhoto,omitempty"`
LibreGraphLivePhoto *LivePhoto `json:"@libre.graph.livePhoto,omitempty"`
// Indicates if the item is synchronized with the underlying storage provider. Read-only.
ClientSynchronize *bool `json:"@client.synchronize,omitempty"`
// A pre-authenticated URL that can be used to download the item's content without providing an Authorization header. The URL is short-lived and cannot be cached. This annotation is only populated when explicitly requested via `$select`, and only for items that have a `file` facet. The returned URL is valid for a limited time and should be used promptly.
MicrosoftGraphDownloadUrl *string `json:"@microsoft.graph.downloadUrl,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 permissions.
UIHidden *bool `json:"@UI.Hidden,omitempty"`
// Indicates whether the current user is following this DriveItem. Read-only. Use the FollowDriveItem and UnfollowDriveItem operations to change the following state.
LibreGraphMeFollowing *bool `json:"@libre.graph.me.following,omitempty"`
// The list of tags assigned to this DriveItem. Read-only. Use the AssignTags and UnassignTags operations to modify tags.
LibreGraphTags []string `json:"@libre.graph.tags,omitempty"`
// A list of actions the caller is allowed to perform on this item. Only returned when explicitly requested via `$select` on endpoints that support it. Mirrors the annotation of the same name on the `/permissions` endpoint, allowing clients to learn a caller's effective actions on an item without a separate round-trip.
LibreGraphPermissionsActionsAllowedValues []string `json:"@libre.graph.permissions.actions.allowedValues,omitempty"`
}
// NewDriveItem instantiates a new DriveItem object
@@ -1048,6 +1058,70 @@ func (o *DriveItem) SetVideo(v Video) {
o.Video = &v
}
// GetLibreGraphMotionPhoto returns the LibreGraphMotionPhoto field value if set, zero value otherwise.
func (o *DriveItem) GetLibreGraphMotionPhoto() MotionPhoto {
if o == nil || IsNil(o.LibreGraphMotionPhoto) {
var ret MotionPhoto
return ret
}
return *o.LibreGraphMotionPhoto
}
// GetLibreGraphMotionPhotoOk returns a tuple with the LibreGraphMotionPhoto field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetLibreGraphMotionPhotoOk() (*MotionPhoto, bool) {
if o == nil || IsNil(o.LibreGraphMotionPhoto) {
return nil, false
}
return o.LibreGraphMotionPhoto, true
}
// HasLibreGraphMotionPhoto returns a boolean if a field has been set.
func (o *DriveItem) HasLibreGraphMotionPhoto() bool {
if o != nil && !IsNil(o.LibreGraphMotionPhoto) {
return true
}
return false
}
// SetLibreGraphMotionPhoto gets a reference to the given MotionPhoto and assigns it to the LibreGraphMotionPhoto field.
func (o *DriveItem) SetLibreGraphMotionPhoto(v MotionPhoto) {
o.LibreGraphMotionPhoto = &v
}
// GetLibreGraphLivePhoto returns the LibreGraphLivePhoto field value if set, zero value otherwise.
func (o *DriveItem) GetLibreGraphLivePhoto() LivePhoto {
if o == nil || IsNil(o.LibreGraphLivePhoto) {
var ret LivePhoto
return ret
}
return *o.LibreGraphLivePhoto
}
// GetLibreGraphLivePhotoOk returns a tuple with the LibreGraphLivePhoto field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetLibreGraphLivePhotoOk() (*LivePhoto, bool) {
if o == nil || IsNil(o.LibreGraphLivePhoto) {
return nil, false
}
return o.LibreGraphLivePhoto, true
}
// HasLibreGraphLivePhoto returns a boolean if a field has been set.
func (o *DriveItem) HasLibreGraphLivePhoto() bool {
if o != nil && !IsNil(o.LibreGraphLivePhoto) {
return true
}
return false
}
// SetLibreGraphLivePhoto gets a reference to the given LivePhoto and assigns it to the LibreGraphLivePhoto field.
func (o *DriveItem) SetLibreGraphLivePhoto(v LivePhoto) {
o.LibreGraphLivePhoto = &v
}
// GetClientSynchronize returns the ClientSynchronize field value if set, zero value otherwise.
func (o *DriveItem) GetClientSynchronize() bool {
if o == nil || IsNil(o.ClientSynchronize) {
@@ -1080,6 +1154,38 @@ func (o *DriveItem) SetClientSynchronize(v bool) {
o.ClientSynchronize = &v
}
// GetMicrosoftGraphDownloadUrl returns the MicrosoftGraphDownloadUrl field value if set, zero value otherwise.
func (o *DriveItem) GetMicrosoftGraphDownloadUrl() string {
if o == nil || IsNil(o.MicrosoftGraphDownloadUrl) {
var ret string
return ret
}
return *o.MicrosoftGraphDownloadUrl
}
// GetMicrosoftGraphDownloadUrlOk returns a tuple with the MicrosoftGraphDownloadUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetMicrosoftGraphDownloadUrlOk() (*string, bool) {
if o == nil || IsNil(o.MicrosoftGraphDownloadUrl) {
return nil, false
}
return o.MicrosoftGraphDownloadUrl, true
}
// HasMicrosoftGraphDownloadUrl returns a boolean if a field has been set.
func (o *DriveItem) HasMicrosoftGraphDownloadUrl() bool {
if o != nil && !IsNil(o.MicrosoftGraphDownloadUrl) {
return true
}
return false
}
// SetMicrosoftGraphDownloadUrl gets a reference to the given string and assigns it to the MicrosoftGraphDownloadUrl field.
func (o *DriveItem) SetMicrosoftGraphDownloadUrl(v string) {
o.MicrosoftGraphDownloadUrl = &v
}
// GetUIHidden returns the UIHidden field value if set, zero value otherwise.
func (o *DriveItem) GetUIHidden() bool {
if o == nil || IsNil(o.UIHidden) {
@@ -1112,6 +1218,102 @@ func (o *DriveItem) SetUIHidden(v bool) {
o.UIHidden = &v
}
// GetLibreGraphMeFollowing returns the LibreGraphMeFollowing field value if set, zero value otherwise.
func (o *DriveItem) GetLibreGraphMeFollowing() bool {
if o == nil || IsNil(o.LibreGraphMeFollowing) {
var ret bool
return ret
}
return *o.LibreGraphMeFollowing
}
// GetLibreGraphMeFollowingOk returns a tuple with the LibreGraphMeFollowing field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetLibreGraphMeFollowingOk() (*bool, bool) {
if o == nil || IsNil(o.LibreGraphMeFollowing) {
return nil, false
}
return o.LibreGraphMeFollowing, true
}
// HasLibreGraphMeFollowing returns a boolean if a field has been set.
func (o *DriveItem) HasLibreGraphMeFollowing() bool {
if o != nil && !IsNil(o.LibreGraphMeFollowing) {
return true
}
return false
}
// SetLibreGraphMeFollowing gets a reference to the given bool and assigns it to the LibreGraphMeFollowing field.
func (o *DriveItem) SetLibreGraphMeFollowing(v bool) {
o.LibreGraphMeFollowing = &v
}
// GetLibreGraphTags returns the LibreGraphTags field value if set, zero value otherwise.
func (o *DriveItem) GetLibreGraphTags() []string {
if o == nil || IsNil(o.LibreGraphTags) {
var ret []string
return ret
}
return o.LibreGraphTags
}
// GetLibreGraphTagsOk returns a tuple with the LibreGraphTags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DriveItem) GetLibreGraphTagsOk() ([]string, bool) {
if o == nil || IsNil(o.LibreGraphTags) {
return nil, false
}
return o.LibreGraphTags, true
}
// HasLibreGraphTags returns a boolean if a field has been set.
func (o *DriveItem) HasLibreGraphTags() bool {
if o != nil && !IsNil(o.LibreGraphTags) {
return true
}
return false
}
// SetLibreGraphTags gets a reference to the given []string and assigns it to the LibreGraphTags field.
func (o *DriveItem) SetLibreGraphTags(v []string) {
o.LibreGraphTags = v
}
// GetLibreGraphPermissionsActionsAllowedValues returns the LibreGraphPermissionsActionsAllowedValues field value if set, zero value otherwise.
func (o *DriveItem) 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 *DriveItem) 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 *DriveItem) 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 *DriveItem) SetLibreGraphPermissionsActionsAllowedValues(v []string) {
o.LibreGraphPermissionsActionsAllowedValues = v
}
func (o DriveItem) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
@@ -1212,12 +1414,30 @@ func (o DriveItem) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Video) {
toSerialize["video"] = o.Video
}
if !IsNil(o.LibreGraphMotionPhoto) {
toSerialize["@libre.graph.motionPhoto"] = o.LibreGraphMotionPhoto
}
if !IsNil(o.LibreGraphLivePhoto) {
toSerialize["@libre.graph.livePhoto"] = o.LibreGraphLivePhoto
}
if !IsNil(o.ClientSynchronize) {
toSerialize["@client.synchronize"] = o.ClientSynchronize
}
if !IsNil(o.MicrosoftGraphDownloadUrl) {
toSerialize["@microsoft.graph.downloadUrl"] = o.MicrosoftGraphDownloadUrl
}
if !IsNil(o.UIHidden) {
toSerialize["@UI.Hidden"] = o.UIHidden
}
if !IsNil(o.LibreGraphMeFollowing) {
toSerialize["@libre.graph.me.following"] = o.LibreGraphMeFollowing
}
if !IsNil(o.LibreGraphTags) {
toSerialize["@libre.graph.tags"] = o.LibreGraphTags
}
if !IsNil(o.LibreGraphPermissionsActionsAllowedValues) {
toSerialize["@libre.graph.permissions.actions.allowedValues"] = o.LibreGraphPermissionsActionsAllowedValues
}
return toSerialize, nil
}

View File

@@ -0,0 +1,164 @@
/*
Libre Graph API
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
API version: v1.0.8
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package libregraph
import (
"encoding/json"
)
// checks if the EmailAddress type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EmailAddress{}
// EmailAddress Represents an email address.
type EmailAddress struct {
// The email address.
Address *string `json:"address,omitempty"`
// The name associated with the email address.
Name *string `json:"name,omitempty"`
}
// NewEmailAddress instantiates a new EmailAddress 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 NewEmailAddress() *EmailAddress {
this := EmailAddress{}
return &this
}
// NewEmailAddressWithDefaults instantiates a new EmailAddress 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 NewEmailAddressWithDefaults() *EmailAddress {
this := EmailAddress{}
return &this
}
// GetAddress returns the Address field value if set, zero value otherwise.
func (o *EmailAddress) GetAddress() string {
if o == nil || IsNil(o.Address) {
var ret string
return ret
}
return *o.Address
}
// GetAddressOk returns a tuple with the Address field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EmailAddress) GetAddressOk() (*string, bool) {
if o == nil || IsNil(o.Address) {
return nil, false
}
return o.Address, true
}
// HasAddress returns a boolean if a field has been set.
func (o *EmailAddress) HasAddress() bool {
if o != nil && !IsNil(o.Address) {
return true
}
return false
}
// SetAddress gets a reference to the given string and assigns it to the Address field.
func (o *EmailAddress) SetAddress(v string) {
o.Address = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *EmailAddress) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// 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 *EmailAddress) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *EmailAddress) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *EmailAddress) SetName(v string) {
o.Name = &v
}
func (o EmailAddress) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EmailAddress) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Address) {
toSerialize["address"] = o.Address
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
return toSerialize, nil
}
type NullableEmailAddress struct {
value *EmailAddress
isSet bool
}
func (v NullableEmailAddress) Get() *EmailAddress {
return v.value
}
func (v *NullableEmailAddress) Set(val *EmailAddress) {
v.value = val
v.isSet = true
}
func (v NullableEmailAddress) IsSet() bool {
return v.isSet
}
func (v *NullableEmailAddress) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEmailAddress(val *EmailAddress) *NullableEmailAddress {
return &NullableEmailAddress{value: val, isSet: true}
}
func (v NullableEmailAddress) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEmailAddress) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -0,0 +1,421 @@
/*
Libre Graph API
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
API version: v1.0.8
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package libregraph
import (
"encoding/json"
)
// checks if the Invitation type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Invitation{}
// Invitation Represents an invitation to a drive item.
type Invitation struct {
// The display name of the user being invited.
InvitedUserDisplayName *string `json:"invitedUserDisplayName,omitempty"`
// The email address of the user being invited. Required.
InvitedUserEmailAddress *string `json:"invitedUserEmailAddress,omitempty"`
InvitedUserMessageInfo *InvitedUserMessageInfo `json:"invitedUserMessageInfo,omitempty"`
// Indicates whether an invitation message should be sent to the user.
SendInvitationMessage *bool `json:"sendInvitationMessage,omitempty"`
// The URL to which the user is redirected after accepting the invitation. Required.
InviteRedirectUrl *string `json:"inviteRedirectUrl,omitempty"`
// The URL that the user can use to redeem the invitation. Read-only.
InviteRedeemUrl *string `json:"inviteRedeemUrl,omitempty"`
// The status of the invitation. Read-only.
Status *string `json:"status,omitempty"`
InvitedUser *User `json:"invitedUser,omitempty"`
// The type of user being invited.
InvitedUserType *string `json:"invitedUserType,omitempty"`
}
// NewInvitation instantiates a new Invitation 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 NewInvitation() *Invitation {
this := Invitation{}
return &this
}
// NewInvitationWithDefaults instantiates a new Invitation 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 NewInvitationWithDefaults() *Invitation {
this := Invitation{}
return &this
}
// GetInvitedUserDisplayName returns the InvitedUserDisplayName field value if set, zero value otherwise.
func (o *Invitation) GetInvitedUserDisplayName() string {
if o == nil || IsNil(o.InvitedUserDisplayName) {
var ret string
return ret
}
return *o.InvitedUserDisplayName
}
// GetInvitedUserDisplayNameOk returns a tuple with the InvitedUserDisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Invitation) GetInvitedUserDisplayNameOk() (*string, bool) {
if o == nil || IsNil(o.InvitedUserDisplayName) {
return nil, false
}
return o.InvitedUserDisplayName, true
}
// HasInvitedUserDisplayName returns a boolean if a field has been set.
func (o *Invitation) HasInvitedUserDisplayName() bool {
if o != nil && !IsNil(o.InvitedUserDisplayName) {
return true
}
return false
}
// SetInvitedUserDisplayName gets a reference to the given string and assigns it to the InvitedUserDisplayName field.
func (o *Invitation) SetInvitedUserDisplayName(v string) {
o.InvitedUserDisplayName = &v
}
// GetInvitedUserEmailAddress returns the InvitedUserEmailAddress field value if set, zero value otherwise.
func (o *Invitation) GetInvitedUserEmailAddress() string {
if o == nil || IsNil(o.InvitedUserEmailAddress) {
var ret string
return ret
}
return *o.InvitedUserEmailAddress
}
// GetInvitedUserEmailAddressOk returns a tuple with the InvitedUserEmailAddress field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Invitation) GetInvitedUserEmailAddressOk() (*string, bool) {
if o == nil || IsNil(o.InvitedUserEmailAddress) {
return nil, false
}
return o.InvitedUserEmailAddress, true
}
// HasInvitedUserEmailAddress returns a boolean if a field has been set.
func (o *Invitation) HasInvitedUserEmailAddress() bool {
if o != nil && !IsNil(o.InvitedUserEmailAddress) {
return true
}
return false
}
// SetInvitedUserEmailAddress gets a reference to the given string and assigns it to the InvitedUserEmailAddress field.
func (o *Invitation) SetInvitedUserEmailAddress(v string) {
o.InvitedUserEmailAddress = &v
}
// GetInvitedUserMessageInfo returns the InvitedUserMessageInfo field value if set, zero value otherwise.
func (o *Invitation) GetInvitedUserMessageInfo() InvitedUserMessageInfo {
if o == nil || IsNil(o.InvitedUserMessageInfo) {
var ret InvitedUserMessageInfo
return ret
}
return *o.InvitedUserMessageInfo
}
// GetInvitedUserMessageInfoOk returns a tuple with the InvitedUserMessageInfo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Invitation) GetInvitedUserMessageInfoOk() (*InvitedUserMessageInfo, bool) {
if o == nil || IsNil(o.InvitedUserMessageInfo) {
return nil, false
}
return o.InvitedUserMessageInfo, true
}
// HasInvitedUserMessageInfo returns a boolean if a field has been set.
func (o *Invitation) HasInvitedUserMessageInfo() bool {
if o != nil && !IsNil(o.InvitedUserMessageInfo) {
return true
}
return false
}
// SetInvitedUserMessageInfo gets a reference to the given InvitedUserMessageInfo and assigns it to the InvitedUserMessageInfo field.
func (o *Invitation) SetInvitedUserMessageInfo(v InvitedUserMessageInfo) {
o.InvitedUserMessageInfo = &v
}
// GetSendInvitationMessage returns the SendInvitationMessage field value if set, zero value otherwise.
func (o *Invitation) GetSendInvitationMessage() bool {
if o == nil || IsNil(o.SendInvitationMessage) {
var ret bool
return ret
}
return *o.SendInvitationMessage
}
// GetSendInvitationMessageOk returns a tuple with the SendInvitationMessage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Invitation) GetSendInvitationMessageOk() (*bool, bool) {
if o == nil || IsNil(o.SendInvitationMessage) {
return nil, false
}
return o.SendInvitationMessage, true
}
// HasSendInvitationMessage returns a boolean if a field has been set.
func (o *Invitation) HasSendInvitationMessage() bool {
if o != nil && !IsNil(o.SendInvitationMessage) {
return true
}
return false
}
// SetSendInvitationMessage gets a reference to the given bool and assigns it to the SendInvitationMessage field.
func (o *Invitation) SetSendInvitationMessage(v bool) {
o.SendInvitationMessage = &v
}
// GetInviteRedirectUrl returns the InviteRedirectUrl field value if set, zero value otherwise.
func (o *Invitation) GetInviteRedirectUrl() string {
if o == nil || IsNil(o.InviteRedirectUrl) {
var ret string
return ret
}
return *o.InviteRedirectUrl
}
// GetInviteRedirectUrlOk returns a tuple with the InviteRedirectUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Invitation) GetInviteRedirectUrlOk() (*string, bool) {
if o == nil || IsNil(o.InviteRedirectUrl) {
return nil, false
}
return o.InviteRedirectUrl, true
}
// HasInviteRedirectUrl returns a boolean if a field has been set.
func (o *Invitation) HasInviteRedirectUrl() bool {
if o != nil && !IsNil(o.InviteRedirectUrl) {
return true
}
return false
}
// SetInviteRedirectUrl gets a reference to the given string and assigns it to the InviteRedirectUrl field.
func (o *Invitation) SetInviteRedirectUrl(v string) {
o.InviteRedirectUrl = &v
}
// GetInviteRedeemUrl returns the InviteRedeemUrl field value if set, zero value otherwise.
func (o *Invitation) GetInviteRedeemUrl() string {
if o == nil || IsNil(o.InviteRedeemUrl) {
var ret string
return ret
}
return *o.InviteRedeemUrl
}
// GetInviteRedeemUrlOk returns a tuple with the InviteRedeemUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Invitation) GetInviteRedeemUrlOk() (*string, bool) {
if o == nil || IsNil(o.InviteRedeemUrl) {
return nil, false
}
return o.InviteRedeemUrl, true
}
// HasInviteRedeemUrl returns a boolean if a field has been set.
func (o *Invitation) HasInviteRedeemUrl() bool {
if o != nil && !IsNil(o.InviteRedeemUrl) {
return true
}
return false
}
// SetInviteRedeemUrl gets a reference to the given string and assigns it to the InviteRedeemUrl field.
func (o *Invitation) SetInviteRedeemUrl(v string) {
o.InviteRedeemUrl = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *Invitation) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Invitation) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *Invitation) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *Invitation) SetStatus(v string) {
o.Status = &v
}
// GetInvitedUser returns the InvitedUser field value if set, zero value otherwise.
func (o *Invitation) GetInvitedUser() User {
if o == nil || IsNil(o.InvitedUser) {
var ret User
return ret
}
return *o.InvitedUser
}
// GetInvitedUserOk returns a tuple with the InvitedUser field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Invitation) GetInvitedUserOk() (*User, bool) {
if o == nil || IsNil(o.InvitedUser) {
return nil, false
}
return o.InvitedUser, true
}
// HasInvitedUser returns a boolean if a field has been set.
func (o *Invitation) HasInvitedUser() bool {
if o != nil && !IsNil(o.InvitedUser) {
return true
}
return false
}
// SetInvitedUser gets a reference to the given User and assigns it to the InvitedUser field.
func (o *Invitation) SetInvitedUser(v User) {
o.InvitedUser = &v
}
// GetInvitedUserType returns the InvitedUserType field value if set, zero value otherwise.
func (o *Invitation) GetInvitedUserType() string {
if o == nil || IsNil(o.InvitedUserType) {
var ret string
return ret
}
return *o.InvitedUserType
}
// GetInvitedUserTypeOk returns a tuple with the InvitedUserType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Invitation) GetInvitedUserTypeOk() (*string, bool) {
if o == nil || IsNil(o.InvitedUserType) {
return nil, false
}
return o.InvitedUserType, true
}
// HasInvitedUserType returns a boolean if a field has been set.
func (o *Invitation) HasInvitedUserType() bool {
if o != nil && !IsNil(o.InvitedUserType) {
return true
}
return false
}
// SetInvitedUserType gets a reference to the given string and assigns it to the InvitedUserType field.
func (o *Invitation) SetInvitedUserType(v string) {
o.InvitedUserType = &v
}
func (o Invitation) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Invitation) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.InvitedUserDisplayName) {
toSerialize["invitedUserDisplayName"] = o.InvitedUserDisplayName
}
if !IsNil(o.InvitedUserEmailAddress) {
toSerialize["invitedUserEmailAddress"] = o.InvitedUserEmailAddress
}
if !IsNil(o.InvitedUserMessageInfo) {
toSerialize["invitedUserMessageInfo"] = o.InvitedUserMessageInfo
}
if !IsNil(o.SendInvitationMessage) {
toSerialize["sendInvitationMessage"] = o.SendInvitationMessage
}
if !IsNil(o.InviteRedirectUrl) {
toSerialize["inviteRedirectUrl"] = o.InviteRedirectUrl
}
if !IsNil(o.InviteRedeemUrl) {
toSerialize["inviteRedeemUrl"] = o.InviteRedeemUrl
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.InvitedUser) {
toSerialize["invitedUser"] = o.InvitedUser
}
if !IsNil(o.InvitedUserType) {
toSerialize["invitedUserType"] = o.InvitedUserType
}
return toSerialize, nil
}
type NullableInvitation struct {
value *Invitation
isSet bool
}
func (v NullableInvitation) Get() *Invitation {
return v.value
}
func (v *NullableInvitation) Set(val *Invitation) {
v.value = val
v.isSet = true
}
func (v NullableInvitation) IsSet() bool {
return v.isSet
}
func (v *NullableInvitation) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInvitation(val *Invitation) *NullableInvitation {
return &NullableInvitation{value: val, isSet: true}
}
func (v NullableInvitation) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInvitation) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -0,0 +1,201 @@
/*
Libre Graph API
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
API version: v1.0.8
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package libregraph
import (
"encoding/json"
)
// checks if the InvitedUserMessageInfo type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &InvitedUserMessageInfo{}
// InvitedUserMessageInfo Additional information about the invitation message.
type InvitedUserMessageInfo struct {
// Additional recipients who will receive a copy of the invitation message.
CcRecipients []Recipient `json:"ccRecipients,omitempty"`
// The customized message body that will be included in the invitation message.
CustomizedMessageBody *string `json:"customizedMessageBody,omitempty"`
// The language of the invitation message.
MessageLanguage *string `json:"messageLanguage,omitempty"`
}
// NewInvitedUserMessageInfo instantiates a new InvitedUserMessageInfo 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 NewInvitedUserMessageInfo() *InvitedUserMessageInfo {
this := InvitedUserMessageInfo{}
return &this
}
// NewInvitedUserMessageInfoWithDefaults instantiates a new InvitedUserMessageInfo 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 NewInvitedUserMessageInfoWithDefaults() *InvitedUserMessageInfo {
this := InvitedUserMessageInfo{}
return &this
}
// GetCcRecipients returns the CcRecipients field value if set, zero value otherwise.
func (o *InvitedUserMessageInfo) GetCcRecipients() []Recipient {
if o == nil || IsNil(o.CcRecipients) {
var ret []Recipient
return ret
}
return o.CcRecipients
}
// GetCcRecipientsOk returns a tuple with the CcRecipients field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InvitedUserMessageInfo) GetCcRecipientsOk() ([]Recipient, bool) {
if o == nil || IsNil(o.CcRecipients) {
return nil, false
}
return o.CcRecipients, true
}
// HasCcRecipients returns a boolean if a field has been set.
func (o *InvitedUserMessageInfo) HasCcRecipients() bool {
if o != nil && !IsNil(o.CcRecipients) {
return true
}
return false
}
// SetCcRecipients gets a reference to the given []Recipient and assigns it to the CcRecipients field.
func (o *InvitedUserMessageInfo) SetCcRecipients(v []Recipient) {
o.CcRecipients = v
}
// GetCustomizedMessageBody returns the CustomizedMessageBody field value if set, zero value otherwise.
func (o *InvitedUserMessageInfo) GetCustomizedMessageBody() string {
if o == nil || IsNil(o.CustomizedMessageBody) {
var ret string
return ret
}
return *o.CustomizedMessageBody
}
// GetCustomizedMessageBodyOk returns a tuple with the CustomizedMessageBody field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InvitedUserMessageInfo) GetCustomizedMessageBodyOk() (*string, bool) {
if o == nil || IsNil(o.CustomizedMessageBody) {
return nil, false
}
return o.CustomizedMessageBody, true
}
// HasCustomizedMessageBody returns a boolean if a field has been set.
func (o *InvitedUserMessageInfo) HasCustomizedMessageBody() bool {
if o != nil && !IsNil(o.CustomizedMessageBody) {
return true
}
return false
}
// SetCustomizedMessageBody gets a reference to the given string and assigns it to the CustomizedMessageBody field.
func (o *InvitedUserMessageInfo) SetCustomizedMessageBody(v string) {
o.CustomizedMessageBody = &v
}
// GetMessageLanguage returns the MessageLanguage field value if set, zero value otherwise.
func (o *InvitedUserMessageInfo) GetMessageLanguage() string {
if o == nil || IsNil(o.MessageLanguage) {
var ret string
return ret
}
return *o.MessageLanguage
}
// GetMessageLanguageOk returns a tuple with the MessageLanguage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *InvitedUserMessageInfo) GetMessageLanguageOk() (*string, bool) {
if o == nil || IsNil(o.MessageLanguage) {
return nil, false
}
return o.MessageLanguage, true
}
// HasMessageLanguage returns a boolean if a field has been set.
func (o *InvitedUserMessageInfo) HasMessageLanguage() bool {
if o != nil && !IsNil(o.MessageLanguage) {
return true
}
return false
}
// SetMessageLanguage gets a reference to the given string and assigns it to the MessageLanguage field.
func (o *InvitedUserMessageInfo) SetMessageLanguage(v string) {
o.MessageLanguage = &v
}
func (o InvitedUserMessageInfo) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o InvitedUserMessageInfo) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CcRecipients) {
toSerialize["ccRecipients"] = o.CcRecipients
}
if !IsNil(o.CustomizedMessageBody) {
toSerialize["customizedMessageBody"] = o.CustomizedMessageBody
}
if !IsNil(o.MessageLanguage) {
toSerialize["messageLanguage"] = o.MessageLanguage
}
return toSerialize, nil
}
type NullableInvitedUserMessageInfo struct {
value *InvitedUserMessageInfo
isSet bool
}
func (v NullableInvitedUserMessageInfo) Get() *InvitedUserMessageInfo {
return v.value
}
func (v *NullableInvitedUserMessageInfo) Set(val *InvitedUserMessageInfo) {
v.value = val
v.isSet = true
}
func (v NullableInvitedUserMessageInfo) IsSet() bool {
return v.isSet
}
func (v *NullableInvitedUserMessageInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInvitedUserMessageInfo(val *InvitedUserMessageInfo) *NullableInvitedUserMessageInfo {
return &NullableInvitedUserMessageInfo{value: val, isSet: true}
}
func (v NullableInvitedUserMessageInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInvitedUserMessageInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -0,0 +1,307 @@
/*
Libre Graph API
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
API version: v1.0.8
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package libregraph
import (
"encoding/json"
"bytes"
"fmt"
)
// checks if the LivePhoto type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LivePhoto{}
// LivePhoto Apple Live Photo metadata. A Live Photo is a pair of files sharing one content identifier: a still image (HEIC or JPEG) and a short QuickTime video. Unlike a Motion Photo, the two parts are separate driveItems. The presence of this facet indicates the item was captured as part of a Live Photo; the counterpart is the driveItem whose livePhoto facet carries the same contentId. Whether an item is the still image or the video half follows from its photo/video facets and MIME type. There is no public file format specification; the metadata keys are documented as AVFoundation metadata identifiers: https://developer.apple.com/documentation/avfoundation/avmetadataidentifier On the still image they are stored in the Apple maker note, on the video as com.apple.quicktime.* QuickTime metadata keys.
type LivePhoto struct {
// Identifier (UUID) shared by the still image and the paired video of one Live Photo. Read-only.
ContentId string `json:"contentId"`
// Time in microseconds within the paired video at which the still image was captured. The value comes from the video file only: it is the presentation time of the com.apple.quicktime.still-image-time timed metadata sample in the QuickTime movie, so it is only present on the video half. The still image carries no reliable equivalent (the Apple maker note tag 0x0017, historically documented as a derivable video index, does not encode a usable time on current iOS versions). If absent, readers should use a timestamp near the middle of the video track. Read-only.
StillImageTimeUs *int64 `json:"stillImageTimeUs,omitempty"`
// True if the device decided automatically whether to capture the Live Photo video (com.apple.quicktime.live-photo.auto). Only present on the video half. Read-only.
Auto *bool `json:"auto,omitempty"`
// Score between 0 and 1 rating how interesting the motion clip is, used by readers to decide whether to autoplay it (com.apple.quicktime.live-photo.vitality-score). Only present on the video half. Read-only.
VitalityScore *float64 `json:"vitalityScore,omitempty"`
// Version of the algorithm that produced vitalityScore (com.apple.quicktime.live-photo.vitality-scoring-version). Only present on the video half. Read-only.
VitalityScoringVersion *int64 `json:"vitalityScoringVersion,omitempty"`
}
type _LivePhoto LivePhoto
// NewLivePhoto instantiates a new LivePhoto 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 NewLivePhoto(contentId string) *LivePhoto {
this := LivePhoto{}
this.ContentId = contentId
return &this
}
// NewLivePhotoWithDefaults instantiates a new LivePhoto 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 NewLivePhotoWithDefaults() *LivePhoto {
this := LivePhoto{}
return &this
}
// GetContentId returns the ContentId field value
func (o *LivePhoto) GetContentId() string {
if o == nil {
var ret string
return ret
}
return o.ContentId
}
// GetContentIdOk returns a tuple with the ContentId field value
// and a boolean to check if the value has been set.
func (o *LivePhoto) GetContentIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ContentId, true
}
// SetContentId sets field value
func (o *LivePhoto) SetContentId(v string) {
o.ContentId = v
}
// GetStillImageTimeUs returns the StillImageTimeUs field value if set, zero value otherwise.
func (o *LivePhoto) GetStillImageTimeUs() int64 {
if o == nil || IsNil(o.StillImageTimeUs) {
var ret int64
return ret
}
return *o.StillImageTimeUs
}
// GetStillImageTimeUsOk returns a tuple with the StillImageTimeUs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LivePhoto) GetStillImageTimeUsOk() (*int64, bool) {
if o == nil || IsNil(o.StillImageTimeUs) {
return nil, false
}
return o.StillImageTimeUs, true
}
// HasStillImageTimeUs returns a boolean if a field has been set.
func (o *LivePhoto) HasStillImageTimeUs() bool {
if o != nil && !IsNil(o.StillImageTimeUs) {
return true
}
return false
}
// SetStillImageTimeUs gets a reference to the given int64 and assigns it to the StillImageTimeUs field.
func (o *LivePhoto) SetStillImageTimeUs(v int64) {
o.StillImageTimeUs = &v
}
// GetAuto returns the Auto field value if set, zero value otherwise.
func (o *LivePhoto) GetAuto() bool {
if o == nil || IsNil(o.Auto) {
var ret bool
return ret
}
return *o.Auto
}
// GetAutoOk returns a tuple with the Auto field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LivePhoto) GetAutoOk() (*bool, bool) {
if o == nil || IsNil(o.Auto) {
return nil, false
}
return o.Auto, true
}
// HasAuto returns a boolean if a field has been set.
func (o *LivePhoto) HasAuto() bool {
if o != nil && !IsNil(o.Auto) {
return true
}
return false
}
// SetAuto gets a reference to the given bool and assigns it to the Auto field.
func (o *LivePhoto) SetAuto(v bool) {
o.Auto = &v
}
// GetVitalityScore returns the VitalityScore field value if set, zero value otherwise.
func (o *LivePhoto) GetVitalityScore() float64 {
if o == nil || IsNil(o.VitalityScore) {
var ret float64
return ret
}
return *o.VitalityScore
}
// GetVitalityScoreOk returns a tuple with the VitalityScore field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LivePhoto) GetVitalityScoreOk() (*float64, bool) {
if o == nil || IsNil(o.VitalityScore) {
return nil, false
}
return o.VitalityScore, true
}
// HasVitalityScore returns a boolean if a field has been set.
func (o *LivePhoto) HasVitalityScore() bool {
if o != nil && !IsNil(o.VitalityScore) {
return true
}
return false
}
// SetVitalityScore gets a reference to the given float64 and assigns it to the VitalityScore field.
func (o *LivePhoto) SetVitalityScore(v float64) {
o.VitalityScore = &v
}
// GetVitalityScoringVersion returns the VitalityScoringVersion field value if set, zero value otherwise.
func (o *LivePhoto) GetVitalityScoringVersion() int64 {
if o == nil || IsNil(o.VitalityScoringVersion) {
var ret int64
return ret
}
return *o.VitalityScoringVersion
}
// GetVitalityScoringVersionOk returns a tuple with the VitalityScoringVersion field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LivePhoto) GetVitalityScoringVersionOk() (*int64, bool) {
if o == nil || IsNil(o.VitalityScoringVersion) {
return nil, false
}
return o.VitalityScoringVersion, true
}
// HasVitalityScoringVersion returns a boolean if a field has been set.
func (o *LivePhoto) HasVitalityScoringVersion() bool {
if o != nil && !IsNil(o.VitalityScoringVersion) {
return true
}
return false
}
// SetVitalityScoringVersion gets a reference to the given int64 and assigns it to the VitalityScoringVersion field.
func (o *LivePhoto) SetVitalityScoringVersion(v int64) {
o.VitalityScoringVersion = &v
}
func (o LivePhoto) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LivePhoto) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["contentId"] = o.ContentId
if !IsNil(o.StillImageTimeUs) {
toSerialize["stillImageTimeUs"] = o.StillImageTimeUs
}
if !IsNil(o.Auto) {
toSerialize["auto"] = o.Auto
}
if !IsNil(o.VitalityScore) {
toSerialize["vitalityScore"] = o.VitalityScore
}
if !IsNil(o.VitalityScoringVersion) {
toSerialize["vitalityScoringVersion"] = o.VitalityScoringVersion
}
return toSerialize, nil
}
func (o *LivePhoto) UnmarshalJSON(data []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"contentId",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varLivePhoto := _LivePhoto{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varLivePhoto)
if err != nil {
return err
}
*o = LivePhoto(varLivePhoto)
return err
}
type NullableLivePhoto struct {
value *LivePhoto
isSet bool
}
func (v NullableLivePhoto) Get() *LivePhoto {
return v.value
}
func (v *NullableLivePhoto) Set(val *LivePhoto) {
v.value = val
v.isSet = true
}
func (v NullableLivePhoto) IsSet() bool {
return v.isSet
}
func (v *NullableLivePhoto) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLivePhoto(val *LivePhoto) *NullableLivePhoto {
return &NullableLivePhoto{value: val, isSet: true}
}
func (v NullableLivePhoto) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLivePhoto) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -0,0 +1,201 @@
/*
Libre Graph API
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
API version: v1.0.8
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package libregraph
import (
"encoding/json"
)
// checks if the MotionPhoto type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MotionPhoto{}
// MotionPhoto Motion Photo metadata. A Motion Photo is a still image with a short video clip appended to the end of the file. The presence of this facet on a driveItem indicates that the item is a Motion Photo; absence indicates it is not. Based on the Google Motion Photo format v1.0 specification: https://developer.android.com/media/platform/motion-photo-format
type MotionPhoto struct {
// The file format version of the Motion Photo. Currently always 1. Read-only.
Version *int32 `json:"version,omitempty"`
// Presentation timestamp in microseconds of the video frame that corresponds to the still image. A value of -1 indicates unspecified. If absent, readers should use a timestamp near the middle of the video track. Read-only.
PresentationTimestampUs *int64 `json:"presentationTimestampUs,omitempty"`
// Size in bytes of the embedded video portion of the file. The video is appended at the end of the file, so clients can fetch it with a Range request: `Range: bytes=<fileSize - videoSize>-`. Read-only.
VideoSize *int64 `json:"videoSize,omitempty"`
}
// NewMotionPhoto instantiates a new MotionPhoto 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 NewMotionPhoto() *MotionPhoto {
this := MotionPhoto{}
return &this
}
// NewMotionPhotoWithDefaults instantiates a new MotionPhoto 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 NewMotionPhotoWithDefaults() *MotionPhoto {
this := MotionPhoto{}
return &this
}
// GetVersion returns the Version field value if set, zero value otherwise.
func (o *MotionPhoto) GetVersion() int32 {
if o == nil || IsNil(o.Version) {
var ret int32
return ret
}
return *o.Version
}
// GetVersionOk returns a tuple with the Version field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MotionPhoto) GetVersionOk() (*int32, bool) {
if o == nil || IsNil(o.Version) {
return nil, false
}
return o.Version, true
}
// HasVersion returns a boolean if a field has been set.
func (o *MotionPhoto) HasVersion() bool {
if o != nil && !IsNil(o.Version) {
return true
}
return false
}
// SetVersion gets a reference to the given int32 and assigns it to the Version field.
func (o *MotionPhoto) SetVersion(v int32) {
o.Version = &v
}
// GetPresentationTimestampUs returns the PresentationTimestampUs field value if set, zero value otherwise.
func (o *MotionPhoto) GetPresentationTimestampUs() int64 {
if o == nil || IsNil(o.PresentationTimestampUs) {
var ret int64
return ret
}
return *o.PresentationTimestampUs
}
// GetPresentationTimestampUsOk returns a tuple with the PresentationTimestampUs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MotionPhoto) GetPresentationTimestampUsOk() (*int64, bool) {
if o == nil || IsNil(o.PresentationTimestampUs) {
return nil, false
}
return o.PresentationTimestampUs, true
}
// HasPresentationTimestampUs returns a boolean if a field has been set.
func (o *MotionPhoto) HasPresentationTimestampUs() bool {
if o != nil && !IsNil(o.PresentationTimestampUs) {
return true
}
return false
}
// SetPresentationTimestampUs gets a reference to the given int64 and assigns it to the PresentationTimestampUs field.
func (o *MotionPhoto) SetPresentationTimestampUs(v int64) {
o.PresentationTimestampUs = &v
}
// GetVideoSize returns the VideoSize field value if set, zero value otherwise.
func (o *MotionPhoto) GetVideoSize() int64 {
if o == nil || IsNil(o.VideoSize) {
var ret int64
return ret
}
return *o.VideoSize
}
// GetVideoSizeOk returns a tuple with the VideoSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MotionPhoto) GetVideoSizeOk() (*int64, bool) {
if o == nil || IsNil(o.VideoSize) {
return nil, false
}
return o.VideoSize, true
}
// HasVideoSize returns a boolean if a field has been set.
func (o *MotionPhoto) HasVideoSize() bool {
if o != nil && !IsNil(o.VideoSize) {
return true
}
return false
}
// SetVideoSize gets a reference to the given int64 and assigns it to the VideoSize field.
func (o *MotionPhoto) SetVideoSize(v int64) {
o.VideoSize = &v
}
func (o MotionPhoto) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MotionPhoto) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Version) {
toSerialize["version"] = o.Version
}
if !IsNil(o.PresentationTimestampUs) {
toSerialize["presentationTimestampUs"] = o.PresentationTimestampUs
}
if !IsNil(o.VideoSize) {
toSerialize["videoSize"] = o.VideoSize
}
return toSerialize, nil
}
type NullableMotionPhoto struct {
value *MotionPhoto
isSet bool
}
func (v NullableMotionPhoto) Get() *MotionPhoto {
return v.value
}
func (v *NullableMotionPhoto) Set(val *MotionPhoto) {
v.value = val
v.isSet = true
}
func (v NullableMotionPhoto) IsSet() bool {
return v.isSet
}
func (v *NullableMotionPhoto) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMotionPhoto(val *MotionPhoto) *NullableMotionPhoto {
return &NullableMotionPhoto{value: val, isSet: true}
}
func (v NullableMotionPhoto) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMotionPhoto) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -0,0 +1,126 @@
/*
Libre Graph API
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
API version: v1.0.8
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package libregraph
import (
"encoding/json"
)
// checks if the Recipient type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Recipient{}
// Recipient Represents a recipient of an invitation.
type Recipient struct {
EmailAddress *EmailAddress `json:"emailAddress,omitempty"`
}
// NewRecipient instantiates a new Recipient 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 NewRecipient() *Recipient {
this := Recipient{}
return &this
}
// NewRecipientWithDefaults instantiates a new Recipient 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 NewRecipientWithDefaults() *Recipient {
this := Recipient{}
return &this
}
// GetEmailAddress returns the EmailAddress field value if set, zero value otherwise.
func (o *Recipient) GetEmailAddress() EmailAddress {
if o == nil || IsNil(o.EmailAddress) {
var ret EmailAddress
return ret
}
return *o.EmailAddress
}
// GetEmailAddressOk returns a tuple with the EmailAddress field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Recipient) GetEmailAddressOk() (*EmailAddress, bool) {
if o == nil || IsNil(o.EmailAddress) {
return nil, false
}
return o.EmailAddress, true
}
// HasEmailAddress returns a boolean if a field has been set.
func (o *Recipient) HasEmailAddress() bool {
if o != nil && !IsNil(o.EmailAddress) {
return true
}
return false
}
// SetEmailAddress gets a reference to the given EmailAddress and assigns it to the EmailAddress field.
func (o *Recipient) SetEmailAddress(v EmailAddress) {
o.EmailAddress = &v
}
func (o Recipient) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Recipient) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.EmailAddress) {
toSerialize["emailAddress"] = o.EmailAddress
}
return toSerialize, nil
}
type NullableRecipient struct {
value *Recipient
isSet bool
}
func (v NullableRecipient) Get() *Recipient {
return v.value
}
func (v *NullableRecipient) Set(val *Recipient) {
v.value = val
v.isSet = true
}
func (v NullableRecipient) IsSet() bool {
return v.isSet
}
func (v *NullableRecipient) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRecipient(val *Recipient) *NullableRecipient {
return &NullableRecipient{value: val, isSet: true}
}
func (v NullableRecipient) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRecipient) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}