Initial QSfera import
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
||||
*.o
|
||||
*.a
|
||||
*.so
|
||||
|
||||
# Folders
|
||||
_obj
|
||||
_test
|
||||
|
||||
# Architecture specific extensions/prefixes
|
||||
*.[568vq]
|
||||
[568vq].out
|
||||
|
||||
*.cgo1.go
|
||||
*.cgo2.c
|
||||
_cgo_defun.c
|
||||
_cgo_gotypes.go
|
||||
_cgo_export.*
|
||||
|
||||
_testmain.go
|
||||
|
||||
*.exe
|
||||
*.test
|
||||
*.prof
|
||||
Generated
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
||||
LICENSE
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
language: go
|
||||
|
||||
install:
|
||||
- go get -d -v .
|
||||
|
||||
script:
|
||||
- go build -v ./
|
||||
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
+310
@@ -0,0 +1,310 @@
|
||||
# Go API client for libregraph
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
## Overview
|
||||
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
|
||||
|
||||
- API version: v1.0.8
|
||||
- Package version: 1.0.0
|
||||
- Generator version: 7.13.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:
|
||||
|
||||
```go
|
||||
import libregraph "github.com/opencloud-eu/libre-graph-api-go"
|
||||
```
|
||||
|
||||
To use a proxy, set the environment variable `HTTP_PROXY`:
|
||||
|
||||
```go
|
||||
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
||||
```
|
||||
|
||||
## Configuration of Server URL
|
||||
|
||||
Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification.
|
||||
|
||||
### Select Server Configuration
|
||||
|
||||
For using other server than the one defined on index 0 set context value `libregraph.ContextServerIndex` of type `int`.
|
||||
|
||||
```go
|
||||
ctx := context.WithValue(context.Background(), libregraph.ContextServerIndex, 1)
|
||||
```
|
||||
|
||||
### Templated Server URL
|
||||
|
||||
Templated server URL is formatted using default variables from configuration or from context value `libregraph.ContextServerVariables` of type `map[string]string`.
|
||||
|
||||
```go
|
||||
ctx := context.WithValue(context.Background(), libregraph.ContextServerVariables, map[string]string{
|
||||
"basePath": "v2",
|
||||
})
|
||||
```
|
||||
|
||||
Note, enum values are always validated and all unused variables are silently ignored.
|
||||
|
||||
### URLs Configuration per Operation
|
||||
|
||||
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
|
||||
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
||||
Similar rules for overriding default operation server index and variables applies by using `libregraph.ContextOperationServerIndices` and `libregraph.ContextOperationServerVariables` context maps.
|
||||
|
||||
```go
|
||||
ctx := context.WithValue(context.Background(), libregraph.ContextOperationServerIndices, map[string]int{
|
||||
"{classname}Service.{nickname}": 2,
|
||||
})
|
||||
ctx = context.WithValue(context.Background(), libregraph.ContextOperationServerVariables, map[string]map[string]string{
|
||||
"{classname}Service.{nickname}": {
|
||||
"port": "8443",
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *https://localhost:9200/graph*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*ActivitiesApi* | [**GetActivities**](docs/ActivitiesApi.md#getactivities) | **Get** /v1beta1/extensions/org.libregraph/activities | Get activities
|
||||
*ApplicationsApi* | [**GetApplication**](docs/ApplicationsApi.md#getapplication) | **Get** /v1.0/applications/{application-id} | Get application by id
|
||||
*ApplicationsApi* | [**ListApplications**](docs/ApplicationsApi.md#listapplications) | **Get** /v1.0/applications | Get all applications
|
||||
*DriveItemApi* | [**DeleteDriveItem**](docs/DriveItemApi.md#deletedriveitem) | **Delete** /v1beta1/drives/{drive-id}/items/{item-id} | Delete a DriveItem.
|
||||
*DriveItemApi* | [**GetDriveItem**](docs/DriveItemApi.md#getdriveitem) | **Get** /v1beta1/drives/{drive-id}/items/{item-id} | Get 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
|
||||
*DrivesApi* | [**GetDrive**](docs/DrivesApi.md#getdrive) | **Get** /v1.0/drives/{drive-id} | Get drive by id
|
||||
*DrivesApi* | [**UpdateDrive**](docs/DrivesApi.md#updatedrive) | **Patch** /v1.0/drives/{drive-id} | Update the drive
|
||||
*DrivesGetDrivesApi* | [**ListAllDrives**](docs/DrivesGetDrivesApi.md#listalldrives) | **Get** /v1.0/drives | Get all available drives
|
||||
*DrivesGetDrivesApi* | [**ListAllDrivesBeta**](docs/DrivesGetDrivesApi.md#listalldrivesbeta) | **Get** /v1beta1/drives | Alias for '/v1.0/drives', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles
|
||||
*DrivesPermissionsApi* | [**CreateLink**](docs/DrivesPermissionsApi.md#createlink) | **Post** /v1beta1/drives/{drive-id}/items/{item-id}/createLink | Create a sharing link for a DriveItem
|
||||
*DrivesPermissionsApi* | [**DeletePermission**](docs/DrivesPermissionsApi.md#deletepermission) | **Delete** /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id} | Remove access to a DriveItem
|
||||
*DrivesPermissionsApi* | [**GetPermission**](docs/DrivesPermissionsApi.md#getpermission) | **Get** /v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id} | Get sharing permission for a file or folder
|
||||
*DrivesPermissionsApi* | [**Invite**](docs/DrivesPermissionsApi.md#invite) | **Post** /v1beta1/drives/{drive-id}/items/{item-id}/invite | Send a sharing invitation
|
||||
*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* | [**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
|
||||
*DrivesRootApi* | [**GetRoot**](docs/DrivesRootApi.md#getroot) | **Get** /v1.0/drives/{drive-id}/root | Get root from arbitrary space
|
||||
*DrivesRootApi* | [**InviteSpaceRoot**](docs/DrivesRootApi.md#invitespaceroot) | **Post** /v1beta1/drives/{drive-id}/root/invite | Send a sharing invitation
|
||||
*DrivesRootApi* | [**ListPermissionsSpaceRoot**](docs/DrivesRootApi.md#listpermissionsspaceroot) | **Get** /v1beta1/drives/{drive-id}/root/permissions | List the effective permissions on the root item of a drive.
|
||||
*DrivesRootApi* | [**SetPermissionPasswordSpaceRoot**](docs/DrivesRootApi.md#setpermissionpasswordspaceroot) | **Post** /v1beta1/drives/{drive-id}/root/permissions/{perm-id}/setPassword | Set sharing link password for the root item of a drive
|
||||
*DrivesRootApi* | [**UpdatePermissionSpaceRoot**](docs/DrivesRootApi.md#updatepermissionspaceroot) | **Patch** /v1beta1/drives/{drive-id}/root/permissions/{perm-id} | Update sharing permission
|
||||
*EducationClassApi* | [**AddUserToClass**](docs/EducationClassApi.md#addusertoclass) | **Post** /v1.0/education/classes/{class-id}/members/$ref | Assign a user to a class
|
||||
*EducationClassApi* | [**CreateClass**](docs/EducationClassApi.md#createclass) | **Post** /v1.0/education/classes | Add new education class
|
||||
*EducationClassApi* | [**DeleteClass**](docs/EducationClassApi.md#deleteclass) | **Delete** /v1.0/education/classes/{class-id} | Delete education class
|
||||
*EducationClassApi* | [**DeleteUserFromClass**](docs/EducationClassApi.md#deleteuserfromclass) | **Delete** /v1.0/education/classes/{class-id}/members/{user-id}/$ref | Unassign user from a class
|
||||
*EducationClassApi* | [**GetClass**](docs/EducationClassApi.md#getclass) | **Get** /v1.0/education/classes/{class-id} | Get class by key
|
||||
*EducationClassApi* | [**ListClassMembers**](docs/EducationClassApi.md#listclassmembers) | **Get** /v1.0/education/classes/{class-id}/members | Get the educationClass resources owned by an educationSchool
|
||||
*EducationClassApi* | [**ListClasses**](docs/EducationClassApi.md#listclasses) | **Get** /v1.0/education/classes | list education classes
|
||||
*EducationClassApi* | [**UpdateClass**](docs/EducationClassApi.md#updateclass) | **Patch** /v1.0/education/classes/{class-id} | Update properties of a education class
|
||||
*EducationClassTeachersApi* | [**AddTeacherToClass**](docs/EducationClassTeachersApi.md#addteachertoclass) | **Post** /v1.0/education/classes/{class-id}/teachers/$ref | Assign a teacher to a class
|
||||
*EducationClassTeachersApi* | [**DeleteTeacherFromClass**](docs/EducationClassTeachersApi.md#deleteteacherfromclass) | **Delete** /v1.0/education/classes/{class-id}/teachers/{user-id}/$ref | Unassign user as teacher of a class
|
||||
*EducationClassTeachersApi* | [**GetTeachers**](docs/EducationClassTeachersApi.md#getteachers) | **Get** /v1.0/education/classes/{class-id}/teachers | Get the teachers for a class
|
||||
*EducationSchoolApi* | [**AddClassToSchool**](docs/EducationSchoolApi.md#addclasstoschool) | **Post** /v1.0/education/schools/{school-id}/classes/$ref | Assign a class to a school
|
||||
*EducationSchoolApi* | [**AddUserToSchool**](docs/EducationSchoolApi.md#addusertoschool) | **Post** /v1.0/education/schools/{school-id}/users/$ref | Assign a user to a school
|
||||
*EducationSchoolApi* | [**CreateSchool**](docs/EducationSchoolApi.md#createschool) | **Post** /v1.0/education/schools | Add new school
|
||||
*EducationSchoolApi* | [**DeleteClassFromSchool**](docs/EducationSchoolApi.md#deleteclassfromschool) | **Delete** /v1.0/education/schools/{school-id}/classes/{class-id}/$ref | Unassign class from a school
|
||||
*EducationSchoolApi* | [**DeleteSchool**](docs/EducationSchoolApi.md#deleteschool) | **Delete** /v1.0/education/schools/{school-id} | Delete school
|
||||
*EducationSchoolApi* | [**DeleteUserFromSchool**](docs/EducationSchoolApi.md#deleteuserfromschool) | **Delete** /v1.0/education/schools/{school-id}/users/{user-id}/$ref | Unassign user from a school
|
||||
*EducationSchoolApi* | [**GetSchool**](docs/EducationSchoolApi.md#getschool) | **Get** /v1.0/education/schools/{school-id} | Get the properties of a specific school
|
||||
*EducationSchoolApi* | [**ListSchoolClasses**](docs/EducationSchoolApi.md#listschoolclasses) | **Get** /v1.0/education/schools/{school-id}/classes | Get the educationClass resources owned by an educationSchool
|
||||
*EducationSchoolApi* | [**ListSchoolUsers**](docs/EducationSchoolApi.md#listschoolusers) | **Get** /v1.0/education/schools/{school-id}/users | Get the educationUser resources associated with an educationSchool
|
||||
*EducationSchoolApi* | [**ListSchools**](docs/EducationSchoolApi.md#listschools) | **Get** /v1.0/education/schools | Get a list of schools and their properties
|
||||
*EducationSchoolApi* | [**UpdateSchool**](docs/EducationSchoolApi.md#updateschool) | **Patch** /v1.0/education/schools/{school-id} | Update properties of a school
|
||||
*EducationUserApi* | [**CreateEducationUser**](docs/EducationUserApi.md#createeducationuser) | **Post** /v1.0/education/users | Add new education user
|
||||
*EducationUserApi* | [**DeleteEducationUser**](docs/EducationUserApi.md#deleteeducationuser) | **Delete** /v1.0/education/users/{user-id} | Delete educationUser
|
||||
*EducationUserApi* | [**GetEducationUser**](docs/EducationUserApi.md#geteducationuser) | **Get** /v1.0/education/users/{user-id} | Get properties of educationUser
|
||||
*EducationUserApi* | [**ListEducationUsers**](docs/EducationUserApi.md#listeducationusers) | **Get** /v1.0/education/users | Get entities from education users
|
||||
*EducationUserApi* | [**UpdateEducationUser**](docs/EducationUserApi.md#updateeducationuser) | **Patch** /v1.0/education/users/{user-id} | Update properties of educationUser
|
||||
*GroupApi* | [**AddMember**](docs/GroupApi.md#addmember) | **Post** /v1.0/groups/{group-id}/members/$ref | Add a member to a group
|
||||
*GroupApi* | [**DeleteGroup**](docs/GroupApi.md#deletegroup) | **Delete** /v1.0/groups/{group-id} | Delete entity from groups
|
||||
*GroupApi* | [**DeleteMember**](docs/GroupApi.md#deletemember) | **Delete** /v1.0/groups/{group-id}/members/{directory-object-id}/$ref | Delete member from a group
|
||||
*GroupApi* | [**GetGroup**](docs/GroupApi.md#getgroup) | **Get** /v1.0/groups/{group-id} | Get entity from groups by key
|
||||
*GroupApi* | [**ListMembers**](docs/GroupApi.md#listmembers) | **Get** /v1.0/groups/{group-id}/members | Get a list of the group's direct members
|
||||
*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
|
||||
*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
|
||||
*MeDriveApi* | [**ListSharedByMe**](docs/MeDriveApi.md#listsharedbyme) | **Get** /v1beta1/me/drive/sharedByMe | Get a list of driveItem objects shared by the current user.
|
||||
*MeDriveApi* | [**ListSharedWithMe**](docs/MeDriveApi.md#listsharedwithme) | **Get** /v1beta1/me/drive/sharedWithMe | Get a list of driveItem objects shared with the owner of a drive.
|
||||
*MeDriveApi* | [**UnfollowDriveItem**](docs/MeDriveApi.md#unfollowdriveitem) | **Delete** /v1.0/me/drive/following/{item-id} | Unfollow a DriveItem
|
||||
*MeDriveRootApi* | [**HomeGetRoot**](docs/MeDriveRootApi.md#homegetroot) | **Get** /v1.0/me/drive/root | Get root from personal space
|
||||
*MeDriveRootChildrenApi* | [**HomeGetChildren**](docs/MeDriveRootChildrenApi.md#homegetchildren) | **Get** /v1.0/me/drive/root/children | Get children from drive
|
||||
*MeDrivesApi* | [**ListMyDrives**](docs/MeDrivesApi.md#listmydrives) | **Get** /v1.0/me/drives | Get all drives where the current user is a regular member of
|
||||
*MeDrivesApi* | [**ListMyDrivesBeta**](docs/MeDrivesApi.md#listmydrivesbeta) | **Get** /v1beta1/me/drives | Alias for '/v1.0/drives', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles
|
||||
*MePhotoApi* | [**DeleteOwnUserPhoto**](docs/MePhotoApi.md#deleteownuserphoto) | **Delete** /v1.0/me/photo/$value | Delete the current user's profile photo
|
||||
*MePhotoApi* | [**GetOwnUserPhoto**](docs/MePhotoApi.md#getownuserphoto) | **Get** /v1.0/me/photo/$value | Get the current user's profile photo
|
||||
*MePhotoApi* | [**UpdateOwnUserPhotoPatch**](docs/MePhotoApi.md#updateownuserphotopatch) | **Patch** /v1.0/me/photo/$value | Update the current user's profile photo
|
||||
*MePhotoApi* | [**UpdateOwnUserPhotoPut**](docs/MePhotoApi.md#updateownuserphotoput) | **Put** /v1.0/me/photo/$value | Update the current user's profile photo
|
||||
*MeUserApi* | [**GetOwnUser**](docs/MeUserApi.md#getownuser) | **Get** /v1.0/me | Get current user
|
||||
*MeUserApi* | [**UpdateOwnUser**](docs/MeUserApi.md#updateownuser) | **Patch** /v1.0/me | Update the current user
|
||||
*RoleManagementApi* | [**GetPermissionRoleDefinition**](docs/RoleManagementApi.md#getpermissionroledefinition) | **Get** /v1beta1/roleManagement/permissions/roleDefinitions/{role-id} | Get unifiedRoleDefinition
|
||||
*RoleManagementApi* | [**ListPermissionRoleDefinitions**](docs/RoleManagementApi.md#listpermissionroledefinitions) | **Get** /v1beta1/roleManagement/permissions/roleDefinitions | List roleDefinitions
|
||||
*TagsApi* | [**AssignTags**](docs/TagsApi.md#assigntags) | **Put** /v1.0/extensions/org.libregraph/tags | Assign tags to a resource
|
||||
*TagsApi* | [**GetTags**](docs/TagsApi.md#gettags) | **Get** /v1.0/extensions/org.libregraph/tags | Get all known tags
|
||||
*TagsApi* | [**UnassignTags**](docs/TagsApi.md#unassigntags) | **Delete** /v1.0/extensions/org.libregraph/tags | Unassign tags from a resource
|
||||
*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **Delete** /v1.0/users/{user-id} | Delete entity from users
|
||||
*UserApi* | [**ExportPersonalData**](docs/UserApi.md#exportpersonaldata) | **Post** /v1.0/users/{user-id}/exportPersonalData | export personal data of a user
|
||||
*UserApi* | [**GetUser**](docs/UserApi.md#getuser) | **Get** /v1.0/users/{user-id} | Get entity from users by key
|
||||
*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **Patch** /v1.0/users/{user-id} | Update entity in users
|
||||
*UserAppRoleAssignmentApi* | [**UserCreateAppRoleAssignments**](docs/UserAppRoleAssignmentApi.md#usercreateapproleassignments) | **Post** /v1.0/users/{user-id}/appRoleAssignments | Grant an appRoleAssignment to a user
|
||||
*UserAppRoleAssignmentApi* | [**UserDeleteAppRoleAssignments**](docs/UserAppRoleAssignmentApi.md#userdeleteapproleassignments) | **Delete** /v1.0/users/{user-id}/appRoleAssignments/{appRoleAssignment-id} | Delete the appRoleAssignment from a user
|
||||
*UserAppRoleAssignmentApi* | [**UserListAppRoleAssignments**](docs/UserAppRoleAssignmentApi.md#userlistapproleassignments) | **Get** /v1.0/users/{user-id}/appRoleAssignments | Get appRoleAssignments from a user
|
||||
*UserPhotoApi* | [**GetUserPhoto**](docs/UserPhotoApi.md#getuserphoto) | **Get** /v1.0/users/{user-id}/photo/$value | Get the photo of a user
|
||||
*UsersApi* | [**CreateUser**](docs/UsersApi.md#createuser) | **Post** /v1.0/users | Add new entity to users
|
||||
*UsersApi* | [**ListUsers**](docs/UsersApi.md#listusers) | **Get** /v1.0/users | Get entities from users
|
||||
|
||||
|
||||
## Documentation For Models
|
||||
|
||||
- [Activity](docs/Activity.md)
|
||||
- [ActivityTemplate](docs/ActivityTemplate.md)
|
||||
- [ActivityTimes](docs/ActivityTimes.md)
|
||||
- [AppRole](docs/AppRole.md)
|
||||
- [AppRoleAssignment](docs/AppRoleAssignment.md)
|
||||
- [Application](docs/Application.md)
|
||||
- [Audio](docs/Audio.md)
|
||||
- [ClassMemberReference](docs/ClassMemberReference.md)
|
||||
- [ClassReference](docs/ClassReference.md)
|
||||
- [ClassTeacherReference](docs/ClassTeacherReference.md)
|
||||
- [CollectionOfActivities](docs/CollectionOfActivities.md)
|
||||
- [CollectionOfAppRoleAssignments](docs/CollectionOfAppRoleAssignments.md)
|
||||
- [CollectionOfApplications](docs/CollectionOfApplications.md)
|
||||
- [CollectionOfClass](docs/CollectionOfClass.md)
|
||||
- [CollectionOfDriveItems](docs/CollectionOfDriveItems.md)
|
||||
- [CollectionOfDriveItems1](docs/CollectionOfDriveItems1.md)
|
||||
- [CollectionOfDrives](docs/CollectionOfDrives.md)
|
||||
- [CollectionOfDrives1](docs/CollectionOfDrives1.md)
|
||||
- [CollectionOfEducationClass](docs/CollectionOfEducationClass.md)
|
||||
- [CollectionOfEducationUser](docs/CollectionOfEducationUser.md)
|
||||
- [CollectionOfGroup](docs/CollectionOfGroup.md)
|
||||
- [CollectionOfPermissions](docs/CollectionOfPermissions.md)
|
||||
- [CollectionOfPermissionsWithAllowedValues](docs/CollectionOfPermissionsWithAllowedValues.md)
|
||||
- [CollectionOfSchools](docs/CollectionOfSchools.md)
|
||||
- [CollectionOfTags](docs/CollectionOfTags.md)
|
||||
- [CollectionOfUser](docs/CollectionOfUser.md)
|
||||
- [CollectionOfUsers](docs/CollectionOfUsers.md)
|
||||
- [Deleted](docs/Deleted.md)
|
||||
- [Drive](docs/Drive.md)
|
||||
- [DriveItem](docs/DriveItem.md)
|
||||
- [DriveItemCreateLink](docs/DriveItemCreateLink.md)
|
||||
- [DriveItemInvite](docs/DriveItemInvite.md)
|
||||
- [DriveRecipient](docs/DriveRecipient.md)
|
||||
- [DriveUpdate](docs/DriveUpdate.md)
|
||||
- [EducationClass](docs/EducationClass.md)
|
||||
- [EducationSchool](docs/EducationSchool.md)
|
||||
- [EducationUser](docs/EducationUser.md)
|
||||
- [EducationUserReference](docs/EducationUserReference.md)
|
||||
- [ExportPersonalDataRequest](docs/ExportPersonalDataRequest.md)
|
||||
- [FileSystemInfo](docs/FileSystemInfo.md)
|
||||
- [Folder](docs/Folder.md)
|
||||
- [FolderView](docs/FolderView.md)
|
||||
- [GeoCoordinates](docs/GeoCoordinates.md)
|
||||
- [Group](docs/Group.md)
|
||||
- [Hashes](docs/Hashes.md)
|
||||
- [Identity](docs/Identity.md)
|
||||
- [IdentitySet](docs/IdentitySet.md)
|
||||
- [Image](docs/Image.md)
|
||||
- [ItemReference](docs/ItemReference.md)
|
||||
- [MemberReference](docs/MemberReference.md)
|
||||
- [ObjectIdentity](docs/ObjectIdentity.md)
|
||||
- [OdataError](docs/OdataError.md)
|
||||
- [OdataErrorDetail](docs/OdataErrorDetail.md)
|
||||
- [OdataErrorMain](docs/OdataErrorMain.md)
|
||||
- [OpenGraphFile](docs/OpenGraphFile.md)
|
||||
- [PasswordChange](docs/PasswordChange.md)
|
||||
- [PasswordProfile](docs/PasswordProfile.md)
|
||||
- [Permission](docs/Permission.md)
|
||||
- [Photo](docs/Photo.md)
|
||||
- [Quota](docs/Quota.md)
|
||||
- [RemoteItem](docs/RemoteItem.md)
|
||||
- [SharePointIdentitySet](docs/SharePointIdentitySet.md)
|
||||
- [SharingInvitation](docs/SharingInvitation.md)
|
||||
- [SharingLink](docs/SharingLink.md)
|
||||
- [SharingLinkPassword](docs/SharingLinkPassword.md)
|
||||
- [SharingLinkType](docs/SharingLinkType.md)
|
||||
- [SignInActivity](docs/SignInActivity.md)
|
||||
- [SpecialFolder](docs/SpecialFolder.md)
|
||||
- [TagAssignment](docs/TagAssignment.md)
|
||||
- [TagUnassignment](docs/TagUnassignment.md)
|
||||
- [Thumbnail](docs/Thumbnail.md)
|
||||
- [ThumbnailSet](docs/ThumbnailSet.md)
|
||||
- [Trash](docs/Trash.md)
|
||||
- [UnifiedRoleDefinition](docs/UnifiedRoleDefinition.md)
|
||||
- [UnifiedRolePermission](docs/UnifiedRolePermission.md)
|
||||
- [User](docs/User.md)
|
||||
- [UserUpdate](docs/UserUpdate.md)
|
||||
- [Video](docs/Video.md)
|
||||
|
||||
|
||||
## Documentation For Authorization
|
||||
|
||||
|
||||
Authentication schemes defined for the API:
|
||||
### openId
|
||||
|
||||
### bearerAuth
|
||||
|
||||
- **Type**: HTTP Bearer token authentication
|
||||
|
||||
Example
|
||||
|
||||
```go
|
||||
auth := context.WithValue(context.Background(), libregraph.ContextAccessToken, "BEARER_TOKEN_STRING")
|
||||
r, err := client.Service.Operation(auth, args)
|
||||
```
|
||||
|
||||
### basicAuth
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
Example
|
||||
|
||||
```go
|
||||
auth := context.WithValue(context.Background(), libregraph.ContextBasicAuth, libregraph.BasicAuth{
|
||||
UserName: "username",
|
||||
Password: "password",
|
||||
})
|
||||
r, err := client.Service.Operation(auth, args)
|
||||
```
|
||||
|
||||
|
||||
## Documentation for Utility Methods
|
||||
|
||||
Due to the fact that model structure members are all pointers, this package contains
|
||||
a number of utility functions to easily obtain pointers to values of basic types.
|
||||
Each of these functions takes a value of the given basic type and returns a pointer to it:
|
||||
|
||||
* `PtrBool`
|
||||
* `PtrInt`
|
||||
* `PtrInt32`
|
||||
* `PtrInt64`
|
||||
* `PtrFloat`
|
||||
* `PtrFloat32`
|
||||
* `PtrFloat64`
|
||||
* `PtrString`
|
||||
* `PtrTime`
|
||||
|
||||
## Author
|
||||
|
||||
|
||||
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
|
||||
// ActivitiesApiService ActivitiesApi service
|
||||
type ActivitiesApiService service
|
||||
|
||||
type ApiGetActivitiesRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *ActivitiesApiService
|
||||
kql *string
|
||||
}
|
||||
|
||||
func (r ApiGetActivitiesRequest) Kql(kql string) ApiGetActivitiesRequest {
|
||||
r.kql = &kql
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiGetActivitiesRequest) Execute() (*CollectionOfActivities, *http.Response, error) {
|
||||
return r.ApiService.GetActivitiesExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetActivities Get activities
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiGetActivitiesRequest
|
||||
*/
|
||||
func (a *ActivitiesApiService) GetActivities(ctx context.Context) ApiGetActivitiesRequest {
|
||||
return ApiGetActivitiesRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfActivities
|
||||
func (a *ActivitiesApiService) GetActivitiesExecute(r ApiGetActivitiesRequest) (*CollectionOfActivities, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfActivities
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ActivitiesApiService.GetActivities")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/extensions/org.libregraph/activities"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.kql != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "kql", r.kql, "form", "")
|
||||
}
|
||||
// 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
|
||||
}
|
||||
+238
@@ -0,0 +1,238 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
||||
// ApplicationsApiService ApplicationsApi service
|
||||
type ApplicationsApiService service
|
||||
|
||||
type ApiGetApplicationRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *ApplicationsApiService
|
||||
applicationId string
|
||||
}
|
||||
|
||||
func (r ApiGetApplicationRequest) Execute() (*Application, *http.Response, error) {
|
||||
return r.ApiService.GetApplicationExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetApplication Get application by id
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param applicationId key: id of application
|
||||
@return ApiGetApplicationRequest
|
||||
*/
|
||||
func (a *ApplicationsApiService) GetApplication(ctx context.Context, applicationId string) ApiGetApplicationRequest {
|
||||
return ApiGetApplicationRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
applicationId: applicationId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Application
|
||||
func (a *ApplicationsApiService) GetApplicationExecute(r ApiGetApplicationRequest) (*Application, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Application
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationsApiService.GetApplication")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/applications/{application-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"application-id"+"}", url.PathEscape(parameterValueToString(r.applicationId, "applicationId")), -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 ApiListApplicationsRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *ApplicationsApiService
|
||||
}
|
||||
|
||||
func (r ApiListApplicationsRequest) Execute() (*CollectionOfApplications, *http.Response, error) {
|
||||
return r.ApiService.ListApplicationsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListApplications Get all applications
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiListApplicationsRequest
|
||||
*/
|
||||
func (a *ApplicationsApiService) ListApplications(ctx context.Context) ApiListApplicationsRequest {
|
||||
return ApiListApplicationsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfApplications
|
||||
func (a *ApplicationsApiService) ListApplicationsExecute(r ApiListApplicationsRequest) (*CollectionOfApplications, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfApplications
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ApplicationsApiService.ListApplications")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/applications"
|
||||
|
||||
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
|
||||
}
|
||||
+384
@@ -0,0 +1,384 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// DriveItemApiService DriveItemApi service
|
||||
type DriveItemApiService service
|
||||
|
||||
type ApiDeleteDriveItemRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DriveItemApiService
|
||||
driveId string
|
||||
itemId string
|
||||
}
|
||||
|
||||
func (r ApiDeleteDriveItemRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.DeleteDriveItemExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteDriveItem Delete a DriveItem.
|
||||
|
||||
Delete a DriveItem by using its ID.
|
||||
|
||||
Deleting items using this method moves the items to the recycle bin instead of permanently deleting the item.
|
||||
|
||||
Mounted shares in the share jail are unmounted. The `@client.synchronize` property of the `driveItem` in the [sharedWithMe](#/me.drive/ListSharedWithMe) endpoint will change to false.
|
||||
|
||||
|
||||
@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 ApiDeleteDriveItemRequest
|
||||
*/
|
||||
func (a *DriveItemApiService) DeleteDriveItem(ctx context.Context, driveId string, itemId string) ApiDeleteDriveItemRequest {
|
||||
return ApiDeleteDriveItemRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
itemId: itemId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *DriveItemApiService) DeleteDriveItemExecute(r ApiDeleteDriveItemRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DriveItemApiService.DeleteDriveItem")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}/items/{item-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiGetDriveItemRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DriveItemApiService
|
||||
driveId string
|
||||
itemId string
|
||||
}
|
||||
|
||||
func (r ApiGetDriveItemRequest) Execute() (*DriveItem, *http.Response, error) {
|
||||
return r.ApiService.GetDriveItemExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetDriveItem Get a DriveItem.
|
||||
|
||||
Get a DriveItem by using its ID.
|
||||
|
||||
|
||||
@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 ApiGetDriveItemRequest
|
||||
*/
|
||||
func (a *DriveItemApiService) GetDriveItem(ctx context.Context, driveId string, itemId string) ApiGetDriveItemRequest {
|
||||
return ApiGetDriveItemRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
itemId: itemId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return DriveItem
|
||||
func (a *DriveItemApiService) GetDriveItemExecute(r ApiGetDriveItemRequest) (*DriveItem, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *DriveItem
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DriveItemApiService.GetDriveItem")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}/items/{item-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
|
||||
|
||||
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 ApiUpdateDriveItemRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DriveItemApiService
|
||||
driveId string
|
||||
itemId string
|
||||
driveItem *DriveItem
|
||||
}
|
||||
|
||||
// DriveItem properties to update
|
||||
func (r ApiUpdateDriveItemRequest) DriveItem(driveItem DriveItem) ApiUpdateDriveItemRequest {
|
||||
r.driveItem = &driveItem
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUpdateDriveItemRequest) Execute() (*DriveItem, *http.Response, error) {
|
||||
return r.ApiService.UpdateDriveItemExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateDriveItem Update a DriveItem.
|
||||
|
||||
Update a DriveItem.
|
||||
|
||||
The request body must include a JSON object with the properties to update.
|
||||
Only the properties that are provided will be updated.
|
||||
|
||||
Currently it supports updating the following properties:
|
||||
|
||||
* `@UI.Hidden` - Hides the item from the UI.
|
||||
|
||||
|
||||
@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 ApiUpdateDriveItemRequest
|
||||
*/
|
||||
func (a *DriveItemApiService) UpdateDriveItem(ctx context.Context, driveId string, itemId string) ApiUpdateDriveItemRequest {
|
||||
return ApiUpdateDriveItemRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
itemId: itemId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return DriveItem
|
||||
func (a *DriveItemApiService) UpdateDriveItemExecute(r ApiUpdateDriveItemRequest) (*DriveItem, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *DriveItem
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DriveItemApiService.UpdateDriveItem")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}/items/{item-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
// 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,
|
||||
}
|
||||
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
|
||||
}
|
||||
+489
@@ -0,0 +1,489 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// DrivesApiService DrivesApi service
|
||||
type DrivesApiService service
|
||||
|
||||
type ApiCreateDriveRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesApiService
|
||||
drive *Drive
|
||||
}
|
||||
|
||||
// New space property values
|
||||
func (r ApiCreateDriveRequest) Drive(drive Drive) ApiCreateDriveRequest {
|
||||
r.drive = &drive
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiCreateDriveRequest) Execute() (*Drive, *http.Response, error) {
|
||||
return r.ApiService.CreateDriveExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateDrive Create a new drive of a specific type
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiCreateDriveRequest
|
||||
*/
|
||||
func (a *DrivesApiService) CreateDrive(ctx context.Context) ApiCreateDriveRequest {
|
||||
return ApiCreateDriveRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Drive
|
||||
func (a *DrivesApiService) CreateDriveExecute(r ApiCreateDriveRequest) (*Drive, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Drive
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesApiService.CreateDrive")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/drives"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.drive == nil {
|
||||
return localVarReturnValue, nil, reportError("drive is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.drive
|
||||
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 ApiDeleteDriveRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesApiService
|
||||
driveId string
|
||||
ifMatch *string
|
||||
}
|
||||
|
||||
// ETag
|
||||
func (r ApiDeleteDriveRequest) IfMatch(ifMatch string) ApiDeleteDriveRequest {
|
||||
r.ifMatch = &ifMatch
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiDeleteDriveRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.DeleteDriveExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteDrive Delete a specific space
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param driveId key: id of drive
|
||||
@return ApiDeleteDriveRequest
|
||||
*/
|
||||
func (a *DrivesApiService) DeleteDrive(ctx context.Context, driveId string) ApiDeleteDriveRequest {
|
||||
return ApiDeleteDriveRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *DrivesApiService) DeleteDriveExecute(r ApiDeleteDriveRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesApiService.DeleteDrive")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/drives/{drive-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -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
|
||||
}
|
||||
if r.ifMatch != nil {
|
||||
parameterAddToHeaderOrQuery(localVarHeaderParams, "If-Match", r.ifMatch, "simple", "")
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiGetDriveRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesApiService
|
||||
driveId string
|
||||
select_ *[]string
|
||||
}
|
||||
|
||||
// Select properties to be returned. By default all properties are returned.
|
||||
func (r ApiGetDriveRequest) Select_(select_ []string) ApiGetDriveRequest {
|
||||
r.select_ = &select_
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiGetDriveRequest) Execute() (*Drive, *http.Response, error) {
|
||||
return r.ApiService.GetDriveExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetDrive Get drive by id
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param driveId key: id of drive
|
||||
@return ApiGetDriveRequest
|
||||
*/
|
||||
func (a *DrivesApiService) GetDrive(ctx context.Context, driveId string) ApiGetDriveRequest {
|
||||
return ApiGetDriveRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Drive
|
||||
func (a *DrivesApiService) GetDriveExecute(r ApiGetDriveRequest) (*Drive, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Drive
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesApiService.GetDrive")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/drives/{drive-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
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{}
|
||||
|
||||
// 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 ApiUpdateDriveRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesApiService
|
||||
driveId string
|
||||
driveUpdate *DriveUpdate
|
||||
}
|
||||
|
||||
// New space values
|
||||
func (r ApiUpdateDriveRequest) DriveUpdate(driveUpdate DriveUpdate) ApiUpdateDriveRequest {
|
||||
r.driveUpdate = &driveUpdate
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUpdateDriveRequest) Execute() (*Drive, *http.Response, error) {
|
||||
return r.ApiService.UpdateDriveExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateDrive Update the drive
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param driveId key: id of drive
|
||||
@return ApiUpdateDriveRequest
|
||||
*/
|
||||
func (a *DrivesApiService) UpdateDrive(ctx context.Context, driveId string) ApiUpdateDriveRequest {
|
||||
return ApiUpdateDriveRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Drive
|
||||
func (a *DrivesApiService) UpdateDriveExecute(r ApiUpdateDriveRequest) (*Drive, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Drive
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesApiService.UpdateDrive")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/drives/{drive-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.driveUpdate == nil {
|
||||
return localVarReturnValue, nil, reportError("driveUpdate is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.driveUpdate
|
||||
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
|
||||
}
|
||||
Generated
Vendored
+293
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// DrivesGetDrivesApiService DrivesGetDrivesApi service
|
||||
type DrivesGetDrivesApiService service
|
||||
|
||||
type ApiListAllDrivesRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesGetDrivesApiService
|
||||
orderby *string
|
||||
filter *string
|
||||
}
|
||||
|
||||
// The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc.
|
||||
func (r ApiListAllDrivesRequest) Orderby(orderby string) ApiListAllDrivesRequest {
|
||||
r.orderby = &orderby
|
||||
return r
|
||||
}
|
||||
|
||||
// Filter items by property values
|
||||
func (r ApiListAllDrivesRequest) Filter(filter string) ApiListAllDrivesRequest {
|
||||
r.filter = &filter
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiListAllDrivesRequest) Execute() (*CollectionOfDrives1, *http.Response, error) {
|
||||
return r.ApiService.ListAllDrivesExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListAllDrives Get all available drives
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiListAllDrivesRequest
|
||||
*/
|
||||
func (a *DrivesGetDrivesApiService) ListAllDrives(ctx context.Context) ApiListAllDrivesRequest {
|
||||
return ApiListAllDrivesRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfDrives1
|
||||
func (a *DrivesGetDrivesApiService) ListAllDrivesExecute(r ApiListAllDrivesRequest) (*CollectionOfDrives1, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfDrives1
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesGetDrivesApiService.ListAllDrives")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/drives"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.orderby != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$orderby", r.orderby, "form", "")
|
||||
}
|
||||
if r.filter != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$filter", r.filter, "form", "")
|
||||
}
|
||||
// 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 ApiListAllDrivesBetaRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesGetDrivesApiService
|
||||
orderby *string
|
||||
filter *string
|
||||
expand *string
|
||||
select_ *[]string
|
||||
}
|
||||
|
||||
// The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc.
|
||||
func (r ApiListAllDrivesBetaRequest) Orderby(orderby string) ApiListAllDrivesBetaRequest {
|
||||
r.orderby = &orderby
|
||||
return r
|
||||
}
|
||||
|
||||
// Filter items by property values
|
||||
func (r ApiListAllDrivesBetaRequest) Filter(filter string) ApiListAllDrivesBetaRequest {
|
||||
r.filter = &filter
|
||||
return r
|
||||
}
|
||||
|
||||
// Expand related entities
|
||||
func (r ApiListAllDrivesBetaRequest) Expand(expand string) ApiListAllDrivesBetaRequest {
|
||||
r.expand = &expand
|
||||
return r
|
||||
}
|
||||
|
||||
// Select properties to be returned. By default all properties are returned.
|
||||
func (r ApiListAllDrivesBetaRequest) Select_(select_ []string) ApiListAllDrivesBetaRequest {
|
||||
r.select_ = &select_
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiListAllDrivesBetaRequest) Execute() (*CollectionOfDrives1, *http.Response, error) {
|
||||
return r.ApiService.ListAllDrivesBetaExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListAllDrivesBeta Alias for '/v1.0/drives', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiListAllDrivesBetaRequest
|
||||
*/
|
||||
func (a *DrivesGetDrivesApiService) ListAllDrivesBeta(ctx context.Context) ApiListAllDrivesBetaRequest {
|
||||
return ApiListAllDrivesBetaRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfDrives1
|
||||
func (a *DrivesGetDrivesApiService) ListAllDrivesBetaExecute(r ApiListAllDrivesBetaRequest) (*CollectionOfDrives1, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfDrives1
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesGetDrivesApiService.ListAllDrivesBeta")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.orderby != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$orderby", r.orderby, "form", "")
|
||||
}
|
||||
if r.filter != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$filter", r.filter, "form", "")
|
||||
}
|
||||
if r.expand != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "form", "")
|
||||
}
|
||||
if r.select_ != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "form", "csv")
|
||||
}
|
||||
// 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
|
||||
}
|
||||
Generated
Vendored
+968
@@ -0,0 +1,968 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// DrivesPermissionsApiService DrivesPermissionsApi service
|
||||
type DrivesPermissionsApiService service
|
||||
|
||||
type ApiCreateLinkRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesPermissionsApiService
|
||||
driveId string
|
||||
itemId string
|
||||
driveItemCreateLink *DriveItemCreateLink
|
||||
}
|
||||
|
||||
// In the request body, provide a JSON object with the following parameters.
|
||||
func (r ApiCreateLinkRequest) DriveItemCreateLink(driveItemCreateLink DriveItemCreateLink) ApiCreateLinkRequest {
|
||||
r.driveItemCreateLink = &driveItemCreateLink
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiCreateLinkRequest) Execute() (*Permission, *http.Response, error) {
|
||||
return r.ApiService.CreateLinkExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateLink Create a sharing link for a DriveItem
|
||||
|
||||
You can use the createLink action to share a driveItem via a sharing link.
|
||||
|
||||
The response will be a permission object with the link facet containing the created link details.
|
||||
|
||||
## Link types
|
||||
|
||||
For now, The following values are allowed for the type parameter.
|
||||
|
||||
| Value | Display name | Description |
|
||||
| -------------- | ----------------- | --------------------------------------------------------------- |
|
||||
| view | View | Creates a read-only link to the driveItem. |
|
||||
| upload | Upload | Creates a read-write link to the folder driveItem. |
|
||||
| edit | Edit | Creates a read-write link to the driveItem. |
|
||||
| createOnly | File Drop | Creates an upload-only link to the folder driveItem. |
|
||||
| blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. |
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param driveId key: id of drive
|
||||
@param itemId key: id of item
|
||||
@return ApiCreateLinkRequest
|
||||
*/
|
||||
func (a *DrivesPermissionsApiService) CreateLink(ctx context.Context, driveId string, itemId string) ApiCreateLinkRequest {
|
||||
return ApiCreateLinkRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
itemId: itemId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Permission
|
||||
func (a *DrivesPermissionsApiService) CreateLinkExecute(r ApiCreateLinkRequest) (*Permission, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Permission
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesPermissionsApiService.CreateLink")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}/items/{item-id}/createLink"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.driveItemCreateLink
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiDeletePermissionRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesPermissionsApiService
|
||||
driveId string
|
||||
itemId string
|
||||
permId string
|
||||
}
|
||||
|
||||
func (r ApiDeletePermissionRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.DeletePermissionExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
DeletePermission Remove access to a DriveItem
|
||||
|
||||
Remove access to a DriveItem.
|
||||
|
||||
Only sharing permissions that are not inherited can be deleted. The `inheritedFrom` property must be `null`.
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param driveId key: id of drive
|
||||
@param itemId key: id of item
|
||||
@param permId key: id of permission
|
||||
@return ApiDeletePermissionRequest
|
||||
*/
|
||||
func (a *DrivesPermissionsApiService) DeletePermission(ctx context.Context, driveId string, itemId string, permId string) ApiDeletePermissionRequest {
|
||||
return ApiDeletePermissionRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
itemId: itemId,
|
||||
permId: permId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *DrivesPermissionsApiService) DeletePermissionExecute(r ApiDeletePermissionRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesPermissionsApiService.DeletePermission")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"perm-id"+"}", url.PathEscape(parameterValueToString(r.permId, "permId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiGetPermissionRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesPermissionsApiService
|
||||
driveId string
|
||||
itemId string
|
||||
permId string
|
||||
}
|
||||
|
||||
func (r ApiGetPermissionRequest) Execute() (*Permission, *http.Response, error) {
|
||||
return r.ApiService.GetPermissionExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetPermission Get sharing permission for a file or folder
|
||||
|
||||
Return the effective sharing permission for a particular permission resource.
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param driveId key: id of drive
|
||||
@param itemId key: id of item
|
||||
@param permId key: id of permission
|
||||
@return ApiGetPermissionRequest
|
||||
*/
|
||||
func (a *DrivesPermissionsApiService) GetPermission(ctx context.Context, driveId string, itemId string, permId string) ApiGetPermissionRequest {
|
||||
return ApiGetPermissionRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
itemId: itemId,
|
||||
permId: permId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Permission
|
||||
func (a *DrivesPermissionsApiService) GetPermissionExecute(r ApiGetPermissionRequest) (*Permission, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Permission
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesPermissionsApiService.GetPermission")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"perm-id"+"}", url.PathEscape(parameterValueToString(r.permId, "permId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiInviteRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesPermissionsApiService
|
||||
driveId string
|
||||
itemId string
|
||||
driveItemInvite *DriveItemInvite
|
||||
}
|
||||
|
||||
// In the request body, provide a JSON object with the following parameters. To create a custom role submit a list of actions instead of roles.
|
||||
func (r ApiInviteRequest) DriveItemInvite(driveItemInvite DriveItemInvite) ApiInviteRequest {
|
||||
r.driveItemInvite = &driveItemInvite
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiInviteRequest) Execute() (*CollectionOfPermissions, *http.Response, error) {
|
||||
return r.ApiService.InviteExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
Invite Send a sharing invitation
|
||||
|
||||
Sends a sharing invitation for a `driveItem`. A sharing invitation provides permissions to the
|
||||
recipients and optionally sends them an email with a sharing link.
|
||||
|
||||
The response will be a permission object with the grantedToV2 property containing the created grant details.
|
||||
|
||||
## Roles property values
|
||||
For now, roles are only identified by a uuid. There are no hardcoded aliases like `read` or `write` because role actions can be completely customized.
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param driveId key: id of drive
|
||||
@param itemId key: id of item
|
||||
@return ApiInviteRequest
|
||||
*/
|
||||
func (a *DrivesPermissionsApiService) Invite(ctx context.Context, driveId string, itemId string) ApiInviteRequest {
|
||||
return ApiInviteRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
itemId: itemId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfPermissions
|
||||
func (a *DrivesPermissionsApiService) InviteExecute(r ApiInviteRequest) (*CollectionOfPermissions, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfPermissions
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesPermissionsApiService.Invite")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}/items/{item-id}/invite"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.driveItemInvite
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
if localVarHTTPResponse.StatusCode == 400 {
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiListPermissionsRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesPermissionsApiService
|
||||
driveId string
|
||||
itemId string
|
||||
filter *string
|
||||
select_ *[]string
|
||||
count *bool
|
||||
top *int32
|
||||
}
|
||||
|
||||
// Filter items by property values. By default all permissions are returned and the avalable sharing roles are limited to normal users. To get a list of sharing roles applicable to federated users use the example $select query and combine it with $filter to omit the list of permissions.
|
||||
func (r ApiListPermissionsRequest) Filter(filter string) ApiListPermissionsRequest {
|
||||
r.filter = &filter
|
||||
return r
|
||||
}
|
||||
|
||||
// Select properties to be returned. By default all properties are returned. Select the roles property to fetch the available sharing roles without resolving all the permissions. Combine this with the $filter parameter to fetch the actions applicable to federated users.
|
||||
func (r ApiListPermissionsRequest) Select_(select_ []string) ApiListPermissionsRequest {
|
||||
r.select_ = &select_
|
||||
return r
|
||||
}
|
||||
|
||||
// Include count of items
|
||||
func (r ApiListPermissionsRequest) Count(count bool) ApiListPermissionsRequest {
|
||||
r.count = &count
|
||||
return r
|
||||
}
|
||||
|
||||
// Show only the first n items
|
||||
func (r ApiListPermissionsRequest) Top(top int32) ApiListPermissionsRequest {
|
||||
r.top = &top
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiListPermissionsRequest) Execute() (*CollectionOfPermissionsWithAllowedValues, *http.Response, error) {
|
||||
return r.ApiService.ListPermissionsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListPermissions List the effective sharing permissions on a driveItem.
|
||||
|
||||
The permissions collection includes potentially sensitive information and may not be available for every caller.
|
||||
|
||||
* For the owner of the item, all sharing permissions will be returned. This includes co-owners.
|
||||
* For a non-owner caller, only the sharing permissions that apply to the caller are returned.
|
||||
* Sharing permission properties that contain secrets (e.g. `webUrl`) are only returned for callers that are able to create the sharing permission.
|
||||
|
||||
All permission objects have an `id`. A permission representing
|
||||
* a link has the `link` facet filled with details.
|
||||
* a share has the `roles` property set and the `grantedToV2` property filled with the grant recipient details.
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param driveId key: id of drive
|
||||
@param itemId key: id of item
|
||||
@return ApiListPermissionsRequest
|
||||
*/
|
||||
func (a *DrivesPermissionsApiService) ListPermissions(ctx context.Context, driveId string, itemId string) ApiListPermissionsRequest {
|
||||
return ApiListPermissionsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
itemId: itemId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfPermissionsWithAllowedValues
|
||||
func (a *DrivesPermissionsApiService) ListPermissionsExecute(r ApiListPermissionsRequest) (*CollectionOfPermissionsWithAllowedValues, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfPermissionsWithAllowedValues
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesPermissionsApiService.ListPermissions")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}/items/{item-id}/permissions"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.filter != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$filter", r.filter, "form", "")
|
||||
}
|
||||
if r.select_ != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "form", "csv")
|
||||
}
|
||||
if r.count != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$count", r.count, "form", "")
|
||||
}
|
||||
if r.top != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$top", r.top, "form", "")
|
||||
}
|
||||
// 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 ApiSetPermissionPasswordRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesPermissionsApiService
|
||||
driveId string
|
||||
itemId string
|
||||
permId string
|
||||
sharingLinkPassword *SharingLinkPassword
|
||||
}
|
||||
|
||||
// New password value
|
||||
func (r ApiSetPermissionPasswordRequest) SharingLinkPassword(sharingLinkPassword SharingLinkPassword) ApiSetPermissionPasswordRequest {
|
||||
r.sharingLinkPassword = &sharingLinkPassword
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiSetPermissionPasswordRequest) Execute() (*Permission, *http.Response, error) {
|
||||
return r.ApiService.SetPermissionPasswordExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
SetPermissionPassword Set sharing link password
|
||||
|
||||
Set the password of a sharing permission.
|
||||
|
||||
Only the `password` property can be modified this way.
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param driveId key: id of drive
|
||||
@param itemId key: id of item
|
||||
@param permId key: id of permission
|
||||
@return ApiSetPermissionPasswordRequest
|
||||
*/
|
||||
func (a *DrivesPermissionsApiService) SetPermissionPassword(ctx context.Context, driveId string, itemId string, permId string) ApiSetPermissionPasswordRequest {
|
||||
return ApiSetPermissionPasswordRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
itemId: itemId,
|
||||
permId: permId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Permission
|
||||
func (a *DrivesPermissionsApiService) SetPermissionPasswordExecute(r ApiSetPermissionPasswordRequest) (*Permission, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Permission
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesPermissionsApiService.SetPermissionPassword")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}/setPassword"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"perm-id"+"}", url.PathEscape(parameterValueToString(r.permId, "permId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.sharingLinkPassword == nil {
|
||||
return localVarReturnValue, nil, reportError("sharingLinkPassword is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.sharingLinkPassword
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiUpdatePermissionRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *DrivesPermissionsApiService
|
||||
driveId string
|
||||
itemId string
|
||||
permId string
|
||||
permission *Permission
|
||||
}
|
||||
|
||||
// New property values
|
||||
func (r ApiUpdatePermissionRequest) Permission(permission Permission) ApiUpdatePermissionRequest {
|
||||
r.permission = &permission
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUpdatePermissionRequest) Execute() (*Permission, *http.Response, error) {
|
||||
return r.ApiService.UpdatePermissionExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdatePermission Update sharing permission
|
||||
|
||||
Update the properties of a sharing permission by patching the permission resource.
|
||||
|
||||
Only the `roles`, `expirationDateTime` and `password` properties can be modified this way.
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param driveId key: id of drive
|
||||
@param itemId key: id of item
|
||||
@param permId key: id of permission
|
||||
@return ApiUpdatePermissionRequest
|
||||
*/
|
||||
func (a *DrivesPermissionsApiService) UpdatePermission(ctx context.Context, driveId string, itemId string, permId string) ApiUpdatePermissionRequest {
|
||||
return ApiUpdatePermissionRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
driveId: driveId,
|
||||
itemId: itemId,
|
||||
permId: permId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Permission
|
||||
func (a *DrivesPermissionsApiService) UpdatePermissionExecute(r ApiUpdatePermissionRequest) (*Permission, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Permission
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DrivesPermissionsApiService.UpdatePermission")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/drives/{drive-id}/items/{item-id}/permissions/{perm-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"drive-id"+"}", url.PathEscape(parameterValueToString(r.driveId, "driveId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"item-id"+"}", url.PathEscape(parameterValueToString(r.itemId, "itemId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"perm-id"+"}", url.PathEscape(parameterValueToString(r.permId, "permId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.permission == nil {
|
||||
return localVarReturnValue, nil, reportError("permission is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.permission
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
+1170
File diff suppressed because it is too large
Load Diff
+895
@@ -0,0 +1,895 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// EducationClassApiService EducationClassApi service
|
||||
type EducationClassApiService service
|
||||
|
||||
type ApiAddUserToClassRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationClassApiService
|
||||
classId string
|
||||
classMemberReference *ClassMemberReference
|
||||
}
|
||||
|
||||
// educationUser to be added as member
|
||||
func (r ApiAddUserToClassRequest) ClassMemberReference(classMemberReference ClassMemberReference) ApiAddUserToClassRequest {
|
||||
r.classMemberReference = &classMemberReference
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiAddUserToClassRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.AddUserToClassExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
AddUserToClass Assign a user to a class
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param classId key: id or externalId of class
|
||||
@return ApiAddUserToClassRequest
|
||||
*/
|
||||
func (a *EducationClassApiService) AddUserToClass(ctx context.Context, classId string) ApiAddUserToClassRequest {
|
||||
return ApiAddUserToClassRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
classId: classId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *EducationClassApiService) AddUserToClassExecute(r ApiAddUserToClassRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationClassApiService.AddUserToClass")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/classes/{class-id}/members/$ref"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.classMemberReference == nil {
|
||||
return nil, reportError("classMemberReference is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.classMemberReference
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiCreateClassRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationClassApiService
|
||||
educationClass *EducationClass
|
||||
}
|
||||
|
||||
// New entity
|
||||
func (r ApiCreateClassRequest) EducationClass(educationClass EducationClass) ApiCreateClassRequest {
|
||||
r.educationClass = &educationClass
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiCreateClassRequest) Execute() (*EducationClass, *http.Response, error) {
|
||||
return r.ApiService.CreateClassExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateClass Add new education class
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiCreateClassRequest
|
||||
*/
|
||||
func (a *EducationClassApiService) CreateClass(ctx context.Context) ApiCreateClassRequest {
|
||||
return ApiCreateClassRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return EducationClass
|
||||
func (a *EducationClassApiService) CreateClassExecute(r ApiCreateClassRequest) (*EducationClass, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *EducationClass
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationClassApiService.CreateClass")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/classes"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.educationClass == nil {
|
||||
return localVarReturnValue, nil, reportError("educationClass is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.educationClass
|
||||
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 ApiDeleteClassRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationClassApiService
|
||||
classId string
|
||||
}
|
||||
|
||||
func (r ApiDeleteClassRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.DeleteClassExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteClass Delete education class
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param classId key: id or externalId of class
|
||||
@return ApiDeleteClassRequest
|
||||
*/
|
||||
func (a *EducationClassApiService) DeleteClass(ctx context.Context, classId string) ApiDeleteClassRequest {
|
||||
return ApiDeleteClassRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
classId: classId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *EducationClassApiService) DeleteClassExecute(r ApiDeleteClassRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationClassApiService.DeleteClass")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/classes/{class-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiDeleteUserFromClassRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationClassApiService
|
||||
classId string
|
||||
userId string
|
||||
}
|
||||
|
||||
func (r ApiDeleteUserFromClassRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.DeleteUserFromClassExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteUserFromClass Unassign user from a class
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param classId key: id or externalId of class
|
||||
@param userId key: id or username of the user to unassign from class
|
||||
@return ApiDeleteUserFromClassRequest
|
||||
*/
|
||||
func (a *EducationClassApiService) DeleteUserFromClass(ctx context.Context, classId string, userId string) ApiDeleteUserFromClassRequest {
|
||||
return ApiDeleteUserFromClassRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
classId: classId,
|
||||
userId: userId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *EducationClassApiService) DeleteUserFromClassExecute(r ApiDeleteUserFromClassRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationClassApiService.DeleteUserFromClass")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/classes/{class-id}/members/{user-id}/$ref"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiGetClassRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationClassApiService
|
||||
classId string
|
||||
}
|
||||
|
||||
func (r ApiGetClassRequest) Execute() (*EducationClass, *http.Response, error) {
|
||||
return r.ApiService.GetClassExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetClass Get class by key
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param classId key: id or externalId of class
|
||||
@return ApiGetClassRequest
|
||||
*/
|
||||
func (a *EducationClassApiService) GetClass(ctx context.Context, classId string) ApiGetClassRequest {
|
||||
return ApiGetClassRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
classId: classId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return EducationClass
|
||||
func (a *EducationClassApiService) GetClassExecute(r ApiGetClassRequest) (*EducationClass, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *EducationClass
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationClassApiService.GetClass")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/classes/{class-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -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 ApiListClassMembersRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationClassApiService
|
||||
classId string
|
||||
}
|
||||
|
||||
func (r ApiListClassMembersRequest) Execute() (*CollectionOfEducationUser, *http.Response, error) {
|
||||
return r.ApiService.ListClassMembersExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListClassMembers Get the educationClass resources owned by an educationSchool
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param classId key: id or externalId of class
|
||||
@return ApiListClassMembersRequest
|
||||
*/
|
||||
func (a *EducationClassApiService) ListClassMembers(ctx context.Context, classId string) ApiListClassMembersRequest {
|
||||
return ApiListClassMembersRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
classId: classId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfEducationUser
|
||||
func (a *EducationClassApiService) ListClassMembersExecute(r ApiListClassMembersRequest) (*CollectionOfEducationUser, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfEducationUser
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationClassApiService.ListClassMembers")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/classes/{class-id}/members"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -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 ApiListClassesRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationClassApiService
|
||||
}
|
||||
|
||||
func (r ApiListClassesRequest) Execute() (*CollectionOfClass, *http.Response, error) {
|
||||
return r.ApiService.ListClassesExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListClasses list education classes
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiListClassesRequest
|
||||
*/
|
||||
func (a *EducationClassApiService) ListClasses(ctx context.Context) ApiListClassesRequest {
|
||||
return ApiListClassesRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfClass
|
||||
func (a *EducationClassApiService) ListClassesExecute(r ApiListClassesRequest) (*CollectionOfClass, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfClass
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationClassApiService.ListClasses")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/classes"
|
||||
|
||||
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 ApiUpdateClassRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationClassApiService
|
||||
classId string
|
||||
educationClass *EducationClass
|
||||
}
|
||||
|
||||
// New property values
|
||||
func (r ApiUpdateClassRequest) EducationClass(educationClass EducationClass) ApiUpdateClassRequest {
|
||||
r.educationClass = &educationClass
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUpdateClassRequest) Execute() (*EducationClass, *http.Response, error) {
|
||||
return r.ApiService.UpdateClassExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateClass Update properties of a education class
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param classId key: id or externalId of class
|
||||
@return ApiUpdateClassRequest
|
||||
*/
|
||||
func (a *EducationClassApiService) UpdateClass(ctx context.Context, classId string) ApiUpdateClassRequest {
|
||||
return ApiUpdateClassRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
classId: classId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return EducationClass
|
||||
func (a *EducationClassApiService) UpdateClassExecute(r ApiUpdateClassRequest) (*EducationClass, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *EducationClass
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationClassApiService.UpdateClass")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/classes/{class-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.educationClass == nil {
|
||||
return localVarReturnValue, nil, reportError("educationClass is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.educationClass
|
||||
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
|
||||
}
|
||||
Generated
Vendored
+345
@@ -0,0 +1,345 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// EducationClassTeachersApiService EducationClassTeachersApi service
|
||||
type EducationClassTeachersApiService service
|
||||
|
||||
type ApiAddTeacherToClassRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationClassTeachersApiService
|
||||
classId string
|
||||
classTeacherReference *ClassTeacherReference
|
||||
}
|
||||
|
||||
// educationUser to be added as teacher
|
||||
func (r ApiAddTeacherToClassRequest) ClassTeacherReference(classTeacherReference ClassTeacherReference) ApiAddTeacherToClassRequest {
|
||||
r.classTeacherReference = &classTeacherReference
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiAddTeacherToClassRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.AddTeacherToClassExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
AddTeacherToClass Assign a teacher to a class
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param classId key: id or externalId of class
|
||||
@return ApiAddTeacherToClassRequest
|
||||
*/
|
||||
func (a *EducationClassTeachersApiService) AddTeacherToClass(ctx context.Context, classId string) ApiAddTeacherToClassRequest {
|
||||
return ApiAddTeacherToClassRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
classId: classId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *EducationClassTeachersApiService) AddTeacherToClassExecute(r ApiAddTeacherToClassRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationClassTeachersApiService.AddTeacherToClass")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/classes/{class-id}/teachers/$ref"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.classTeacherReference == nil {
|
||||
return nil, reportError("classTeacherReference is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.classTeacherReference
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiDeleteTeacherFromClassRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationClassTeachersApiService
|
||||
classId string
|
||||
userId string
|
||||
}
|
||||
|
||||
func (r ApiDeleteTeacherFromClassRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.DeleteTeacherFromClassExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteTeacherFromClass Unassign user as teacher of a class
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param classId key: id or externalId of class
|
||||
@param userId key: id or username of the user to unassign as teacher
|
||||
@return ApiDeleteTeacherFromClassRequest
|
||||
*/
|
||||
func (a *EducationClassTeachersApiService) DeleteTeacherFromClass(ctx context.Context, classId string, userId string) ApiDeleteTeacherFromClassRequest {
|
||||
return ApiDeleteTeacherFromClassRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
classId: classId,
|
||||
userId: userId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *EducationClassTeachersApiService) DeleteTeacherFromClassExecute(r ApiDeleteTeacherFromClassRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationClassTeachersApiService.DeleteTeacherFromClass")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/classes/{class-id}/teachers/{user-id}/$ref"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiGetTeachersRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationClassTeachersApiService
|
||||
classId string
|
||||
}
|
||||
|
||||
func (r ApiGetTeachersRequest) Execute() (*CollectionOfEducationUser, *http.Response, error) {
|
||||
return r.ApiService.GetTeachersExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetTeachers Get the teachers for a class
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param classId key: id or externalId of class
|
||||
@return ApiGetTeachersRequest
|
||||
*/
|
||||
func (a *EducationClassTeachersApiService) GetTeachers(ctx context.Context, classId string) ApiGetTeachersRequest {
|
||||
return ApiGetTeachersRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
classId: classId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfEducationUser
|
||||
func (a *EducationClassTeachersApiService) GetTeachersExecute(r ApiGetTeachersRequest) (*CollectionOfEducationUser, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfEducationUser
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationClassTeachersApiService.GetTeachers")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/classes/{class-id}/teachers"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"class-id"+"}", url.PathEscape(parameterValueToString(r.classId, "classId")), -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
|
||||
}
|
||||
+1235
File diff suppressed because it is too large
Load Diff
+632
@@ -0,0 +1,632 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// EducationUserApiService EducationUserApi service
|
||||
type EducationUserApiService service
|
||||
|
||||
type ApiCreateEducationUserRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationUserApiService
|
||||
educationUser *EducationUser
|
||||
}
|
||||
|
||||
// New entity
|
||||
func (r ApiCreateEducationUserRequest) EducationUser(educationUser EducationUser) ApiCreateEducationUserRequest {
|
||||
r.educationUser = &educationUser
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiCreateEducationUserRequest) Execute() (*EducationUser, *http.Response, error) {
|
||||
return r.ApiService.CreateEducationUserExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateEducationUser Add new education user
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiCreateEducationUserRequest
|
||||
*/
|
||||
func (a *EducationUserApiService) CreateEducationUser(ctx context.Context) ApiCreateEducationUserRequest {
|
||||
return ApiCreateEducationUserRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return EducationUser
|
||||
func (a *EducationUserApiService) CreateEducationUserExecute(r ApiCreateEducationUserRequest) (*EducationUser, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *EducationUser
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationUserApiService.CreateEducationUser")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/users"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.educationUser == nil {
|
||||
return localVarReturnValue, nil, reportError("educationUser is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.educationUser
|
||||
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 ApiDeleteEducationUserRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationUserApiService
|
||||
userId string
|
||||
}
|
||||
|
||||
func (r ApiDeleteEducationUserRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.DeleteEducationUserExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteEducationUser Delete educationUser
|
||||
|
||||
Deletes an education user by their internal ID.
|
||||
|
||||
**To delete by external ID:**
|
||||
If you only have an external ID, you must first retrieve the user's internal ID:
|
||||
1. Call `GET /graph/v1.0/education/users?$filter=externalId eq '{value}'`
|
||||
2. Extract the `id` from the response
|
||||
3. Use that `id` in this DELETE endpoint
|
||||
|
||||
See the [ListEducationUsers](#/educationUser/ListEducationUsers) operation for query details.
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param userId key: internal user id (UUID format) or username of user. **Note:** If you only have an external ID, first query the user with `GET /graph/v1.0/education/users?$filter=externalId eq '{value}'` to retrieve the internal ID.
|
||||
@return ApiDeleteEducationUserRequest
|
||||
*/
|
||||
func (a *EducationUserApiService) DeleteEducationUser(ctx context.Context, userId string) ApiDeleteEducationUserRequest {
|
||||
return ApiDeleteEducationUserRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
userId: userId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *EducationUserApiService) DeleteEducationUserExecute(r ApiDeleteEducationUserRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationUserApiService.DeleteEducationUser")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/users/{user-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiGetEducationUserRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationUserApiService
|
||||
userId string
|
||||
expand *[]string
|
||||
}
|
||||
|
||||
// Expand related entities
|
||||
func (r ApiGetEducationUserRequest) Expand(expand []string) ApiGetEducationUserRequest {
|
||||
r.expand = &expand
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiGetEducationUserRequest) Execute() (*EducationUser, *http.Response, error) {
|
||||
return r.ApiService.GetEducationUserExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetEducationUser Get properties of educationUser
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param userId key: id or username of user
|
||||
@return ApiGetEducationUserRequest
|
||||
*/
|
||||
func (a *EducationUserApiService) GetEducationUser(ctx context.Context, userId string) ApiGetEducationUserRequest {
|
||||
return ApiGetEducationUserRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
userId: userId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return EducationUser
|
||||
func (a *EducationUserApiService) GetEducationUserExecute(r ApiGetEducationUserRequest) (*EducationUser, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *EducationUser
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationUserApiService.GetEducationUser")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/users/{user-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.expand != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "form", "csv")
|
||||
}
|
||||
// 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 ApiListEducationUsersRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationUserApiService
|
||||
filter *string
|
||||
orderby *[]string
|
||||
expand *[]string
|
||||
}
|
||||
|
||||
// Filter items by property values. Supports a subset of OData filter expressions. **Supported filters:** - By external ID: `externalId eq 'ext_12345'`
|
||||
func (r ApiListEducationUsersRequest) Filter(filter string) ApiListEducationUsersRequest {
|
||||
r.filter = &filter
|
||||
return r
|
||||
}
|
||||
|
||||
// Order items by property values
|
||||
func (r ApiListEducationUsersRequest) Orderby(orderby []string) ApiListEducationUsersRequest {
|
||||
r.orderby = &orderby
|
||||
return r
|
||||
}
|
||||
|
||||
// Expand related entities
|
||||
func (r ApiListEducationUsersRequest) Expand(expand []string) ApiListEducationUsersRequest {
|
||||
r.expand = &expand
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiListEducationUsersRequest) Execute() (*CollectionOfEducationUser, *http.Response, error) {
|
||||
return r.ApiService.ListEducationUsersExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListEducationUsers Get entities from education users
|
||||
|
||||
Retrieves a collection of education users with optional filtering, ordering, and expansion.
|
||||
|
||||
**Filtering by external ID:**
|
||||
Use `$filter` to query users by their external identifier, for example:
|
||||
`$filter=externalId eq 'EX12345'`
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiListEducationUsersRequest
|
||||
*/
|
||||
func (a *EducationUserApiService) ListEducationUsers(ctx context.Context) ApiListEducationUsersRequest {
|
||||
return ApiListEducationUsersRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfEducationUser
|
||||
func (a *EducationUserApiService) ListEducationUsersExecute(r ApiListEducationUsersRequest) (*CollectionOfEducationUser, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfEducationUser
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationUserApiService.ListEducationUsers")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/users"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.filter != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$filter", r.filter, "form", "")
|
||||
}
|
||||
if r.orderby != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$orderby", r.orderby, "form", "csv")
|
||||
}
|
||||
if r.expand != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "form", "csv")
|
||||
}
|
||||
// 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 ApiUpdateEducationUserRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *EducationUserApiService
|
||||
userId string
|
||||
educationUser *EducationUser
|
||||
}
|
||||
|
||||
// New property values
|
||||
func (r ApiUpdateEducationUserRequest) EducationUser(educationUser EducationUser) ApiUpdateEducationUserRequest {
|
||||
r.educationUser = &educationUser
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUpdateEducationUserRequest) Execute() (*EducationUser, *http.Response, error) {
|
||||
return r.ApiService.UpdateEducationUserExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateEducationUser Update properties of educationUser
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param userId key: id or username of user
|
||||
@return ApiUpdateEducationUserRequest
|
||||
*/
|
||||
func (a *EducationUserApiService) UpdateEducationUser(ctx context.Context, userId string) ApiUpdateEducationUserRequest {
|
||||
return ApiUpdateEducationUserRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
userId: userId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return EducationUser
|
||||
func (a *EducationUserApiService) UpdateEducationUserExecute(r ApiUpdateEducationUserRequest) (*EducationUser, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *EducationUser
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EducationUserApiService.UpdateEducationUser")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/education/users/{user-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.educationUser == nil {
|
||||
return localVarReturnValue, nil, reportError("educationUser is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.educationUser
|
||||
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
|
||||
}
|
||||
+702
@@ -0,0 +1,702 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// GroupApiService GroupApi service
|
||||
type GroupApiService service
|
||||
|
||||
type ApiAddMemberRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *GroupApiService
|
||||
groupId string
|
||||
memberReference *MemberReference
|
||||
}
|
||||
|
||||
// Object to be added as member
|
||||
func (r ApiAddMemberRequest) MemberReference(memberReference MemberReference) ApiAddMemberRequest {
|
||||
r.memberReference = &memberReference
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiAddMemberRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.AddMemberExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
AddMember Add a member to a group
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param groupId key: id of group
|
||||
@return ApiAddMemberRequest
|
||||
*/
|
||||
func (a *GroupApiService) AddMember(ctx context.Context, groupId string) ApiAddMemberRequest {
|
||||
return ApiAddMemberRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
groupId: groupId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *GroupApiService) AddMemberExecute(r ApiAddMemberRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupApiService.AddMember")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/groups/{group-id}/members/$ref"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.memberReference == nil {
|
||||
return nil, reportError("memberReference is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.memberReference
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiDeleteGroupRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *GroupApiService
|
||||
groupId string
|
||||
ifMatch *string
|
||||
}
|
||||
|
||||
// ETag
|
||||
func (r ApiDeleteGroupRequest) IfMatch(ifMatch string) ApiDeleteGroupRequest {
|
||||
r.ifMatch = &ifMatch
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiDeleteGroupRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.DeleteGroupExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteGroup Delete entity from groups
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param groupId key: id of group
|
||||
@return ApiDeleteGroupRequest
|
||||
*/
|
||||
func (a *GroupApiService) DeleteGroup(ctx context.Context, groupId string) ApiDeleteGroupRequest {
|
||||
return ApiDeleteGroupRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
groupId: groupId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *GroupApiService) DeleteGroupExecute(r ApiDeleteGroupRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupApiService.DeleteGroup")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/groups/{group-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -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
|
||||
}
|
||||
if r.ifMatch != nil {
|
||||
parameterAddToHeaderOrQuery(localVarHeaderParams, "If-Match", r.ifMatch, "simple", "")
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiDeleteMemberRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *GroupApiService
|
||||
groupId string
|
||||
directoryObjectId string
|
||||
ifMatch *string
|
||||
}
|
||||
|
||||
// ETag
|
||||
func (r ApiDeleteMemberRequest) IfMatch(ifMatch string) ApiDeleteMemberRequest {
|
||||
r.ifMatch = &ifMatch
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiDeleteMemberRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.DeleteMemberExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteMember Delete member from a group
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param groupId key: id of group
|
||||
@param directoryObjectId key: id of group member to remove
|
||||
@return ApiDeleteMemberRequest
|
||||
*/
|
||||
func (a *GroupApiService) DeleteMember(ctx context.Context, groupId string, directoryObjectId string) ApiDeleteMemberRequest {
|
||||
return ApiDeleteMemberRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
groupId: groupId,
|
||||
directoryObjectId: directoryObjectId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *GroupApiService) DeleteMemberExecute(r ApiDeleteMemberRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupApiService.DeleteMember")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/groups/{group-id}/members/{directory-object-id}/$ref"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"directory-object-id"+"}", url.PathEscape(parameterValueToString(r.directoryObjectId, "directoryObjectId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
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
|
||||
}
|
||||
if r.ifMatch != nil {
|
||||
parameterAddToHeaderOrQuery(localVarHeaderParams, "If-Match", r.ifMatch, "simple", "")
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiGetGroupRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *GroupApiService
|
||||
groupId string
|
||||
select_ *[]string
|
||||
expand *[]string
|
||||
}
|
||||
|
||||
// Select properties to be returned
|
||||
func (r ApiGetGroupRequest) Select_(select_ []string) ApiGetGroupRequest {
|
||||
r.select_ = &select_
|
||||
return r
|
||||
}
|
||||
|
||||
// Expand related entities
|
||||
func (r ApiGetGroupRequest) Expand(expand []string) ApiGetGroupRequest {
|
||||
r.expand = &expand
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiGetGroupRequest) Execute() (*Group, *http.Response, error) {
|
||||
return r.ApiService.GetGroupExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetGroup Get entity from groups by key
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param groupId key: id or name of group
|
||||
@return ApiGetGroupRequest
|
||||
*/
|
||||
func (a *GroupApiService) GetGroup(ctx context.Context, groupId string) ApiGetGroupRequest {
|
||||
return ApiGetGroupRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
groupId: groupId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Group
|
||||
func (a *GroupApiService) GetGroupExecute(r ApiGetGroupRequest) (*Group, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Group
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupApiService.GetGroup")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/groups/{group-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.select_ != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "form", "csv")
|
||||
}
|
||||
if r.expand != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "form", "csv")
|
||||
}
|
||||
// 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 ApiListMembersRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *GroupApiService
|
||||
groupId string
|
||||
}
|
||||
|
||||
func (r ApiListMembersRequest) Execute() (*CollectionOfUsers, *http.Response, error) {
|
||||
return r.ApiService.ListMembersExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListMembers Get a list of the group's direct members
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param groupId key: id or name of group
|
||||
@return ApiListMembersRequest
|
||||
*/
|
||||
func (a *GroupApiService) ListMembers(ctx context.Context, groupId string) ApiListMembersRequest {
|
||||
return ApiListMembersRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
groupId: groupId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfUsers
|
||||
func (a *GroupApiService) ListMembersExecute(r ApiListMembersRequest) (*CollectionOfUsers, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfUsers
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupApiService.ListMembers")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/groups/{group-id}/members"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -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 ApiUpdateGroupRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *GroupApiService
|
||||
groupId string
|
||||
group *Group
|
||||
}
|
||||
|
||||
// New property values
|
||||
func (r ApiUpdateGroupRequest) Group(group Group) ApiUpdateGroupRequest {
|
||||
r.group = &group
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUpdateGroupRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.UpdateGroupExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateGroup Update entity in groups
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param groupId key: id of group
|
||||
@return ApiUpdateGroupRequest
|
||||
*/
|
||||
func (a *GroupApiService) UpdateGroup(ctx context.Context, groupId string) ApiUpdateGroupRequest {
|
||||
return ApiUpdateGroupRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
groupId: groupId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *GroupApiService) UpdateGroupExecute(r ApiUpdateGroupRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupApiService.UpdateGroup")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/groups/{group-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"group-id"+"}", url.PathEscape(parameterValueToString(r.groupId, "groupId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.group == nil {
|
||||
return nil, reportError("group is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.group
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
+285
@@ -0,0 +1,285 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// GroupsApiService GroupsApi service
|
||||
type GroupsApiService service
|
||||
|
||||
type ApiCreateGroupRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *GroupsApiService
|
||||
group *Group
|
||||
}
|
||||
|
||||
// New entity
|
||||
func (r ApiCreateGroupRequest) Group(group Group) ApiCreateGroupRequest {
|
||||
r.group = &group
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiCreateGroupRequest) Execute() (*Group, *http.Response, error) {
|
||||
return r.ApiService.CreateGroupExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateGroup Add new entity to groups
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiCreateGroupRequest
|
||||
*/
|
||||
func (a *GroupsApiService) CreateGroup(ctx context.Context) ApiCreateGroupRequest {
|
||||
return ApiCreateGroupRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Group
|
||||
func (a *GroupsApiService) CreateGroupExecute(r ApiCreateGroupRequest) (*Group, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Group
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupsApiService.CreateGroup")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/groups"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.group == nil {
|
||||
return localVarReturnValue, nil, reportError("group is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.group
|
||||
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 ApiListGroupsRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *GroupsApiService
|
||||
search *string
|
||||
orderby *[]string
|
||||
select_ *[]string
|
||||
expand *[]string
|
||||
}
|
||||
|
||||
// Search items by search phrases
|
||||
func (r ApiListGroupsRequest) Search(search string) ApiListGroupsRequest {
|
||||
r.search = &search
|
||||
return r
|
||||
}
|
||||
|
||||
// Order items by property values
|
||||
func (r ApiListGroupsRequest) Orderby(orderby []string) ApiListGroupsRequest {
|
||||
r.orderby = &orderby
|
||||
return r
|
||||
}
|
||||
|
||||
// Select properties to be returned
|
||||
func (r ApiListGroupsRequest) Select_(select_ []string) ApiListGroupsRequest {
|
||||
r.select_ = &select_
|
||||
return r
|
||||
}
|
||||
|
||||
// Expand related entities
|
||||
func (r ApiListGroupsRequest) Expand(expand []string) ApiListGroupsRequest {
|
||||
r.expand = &expand
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiListGroupsRequest) Execute() (*CollectionOfGroup, *http.Response, error) {
|
||||
return r.ApiService.ListGroupsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListGroups Get entities from groups
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiListGroupsRequest
|
||||
*/
|
||||
func (a *GroupsApiService) ListGroups(ctx context.Context) ApiListGroupsRequest {
|
||||
return ApiListGroupsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfGroup
|
||||
func (a *GroupsApiService) ListGroupsExecute(r ApiListGroupsRequest) (*CollectionOfGroup, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfGroup
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "GroupsApiService.ListGroups")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/groups"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.search != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$search", r.search, "form", "")
|
||||
}
|
||||
if r.orderby != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$orderby", r.orderby, "form", "csv")
|
||||
}
|
||||
if r.select_ != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "form", "csv")
|
||||
}
|
||||
if r.expand != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "form", "csv")
|
||||
}
|
||||
// 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
|
||||
}
|
||||
Generated
Vendored
+129
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// MeChangepasswordApiService MeChangepasswordApi service
|
||||
type MeChangepasswordApiService service
|
||||
|
||||
type ApiChangeOwnPasswordRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MeChangepasswordApiService
|
||||
passwordChange *PasswordChange
|
||||
}
|
||||
|
||||
// Password change request
|
||||
func (r ApiChangeOwnPasswordRequest) PasswordChange(passwordChange PasswordChange) ApiChangeOwnPasswordRequest {
|
||||
r.passwordChange = &passwordChange
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiChangeOwnPasswordRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.ChangeOwnPasswordExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ChangeOwnPassword Change your own password
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiChangeOwnPasswordRequest
|
||||
*/
|
||||
func (a *MeChangepasswordApiService) ChangeOwnPassword(ctx context.Context) ApiChangeOwnPasswordRequest {
|
||||
return ApiChangeOwnPasswordRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *MeChangepasswordApiService) ChangeOwnPasswordExecute(r ApiChangeOwnPasswordRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeChangepasswordApiService.ChangeOwnPassword")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/me/changePassword"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.passwordChange == nil {
|
||||
return nil, reportError("passwordChange is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.passwordChange
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
+576
@@ -0,0 +1,576 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// MeDriveApiService MeDriveApi service
|
||||
type MeDriveApiService service
|
||||
|
||||
type ApiFollowDriveItemRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MeDriveApiService
|
||||
itemId string
|
||||
}
|
||||
|
||||
func (r ApiFollowDriveItemRequest) Execute() (*DriveItem, *http.Response, error) {
|
||||
return r.ApiService.FollowDriveItemExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
FollowDriveItem Follow a DriveItem
|
||||
|
||||
Follow a DriveItem.
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param itemId key: id of item
|
||||
@return ApiFollowDriveItemRequest
|
||||
*/
|
||||
func (a *MeDriveApiService) FollowDriveItem(ctx context.Context, itemId string) ApiFollowDriveItemRequest {
|
||||
return ApiFollowDriveItemRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
itemId: itemId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return DriveItem
|
||||
func (a *MeDriveApiService) FollowDriveItemExecute(r ApiFollowDriveItemRequest) (*DriveItem, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *DriveItem
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeDriveApiService.FollowDriveItem")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/me/drive/items/{item-id}/follow"
|
||||
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 ApiGetHomeRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MeDriveApiService
|
||||
}
|
||||
|
||||
func (r ApiGetHomeRequest) Execute() (*Drive, *http.Response, error) {
|
||||
return r.ApiService.GetHomeExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetHome Get personal space for user
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiGetHomeRequest
|
||||
*/
|
||||
func (a *MeDriveApiService) GetHome(ctx context.Context) ApiGetHomeRequest {
|
||||
return ApiGetHomeRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return Drive
|
||||
func (a *MeDriveApiService) GetHomeExecute(r ApiGetHomeRequest) (*Drive, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *Drive
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeDriveApiService.GetHome")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/me/drive"
|
||||
|
||||
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 ApiListSharedByMeRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MeDriveApiService
|
||||
expand *[]string
|
||||
}
|
||||
|
||||
// Expand related entities
|
||||
func (r ApiListSharedByMeRequest) Expand(expand []string) ApiListSharedByMeRequest {
|
||||
r.expand = &expand
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiListSharedByMeRequest) Execute() (*CollectionOfDriveItems1, *http.Response, error) {
|
||||
return r.ApiService.ListSharedByMeExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListSharedByMe Get a list of driveItem objects shared by the current user.
|
||||
|
||||
The `driveItems` returned from the `sharedByMe` method always include the `permissions` relation that indicates they are shared items.
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiListSharedByMeRequest
|
||||
*/
|
||||
func (a *MeDriveApiService) ListSharedByMe(ctx context.Context) ApiListSharedByMeRequest {
|
||||
return ApiListSharedByMeRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfDriveItems1
|
||||
func (a *MeDriveApiService) ListSharedByMeExecute(r ApiListSharedByMeRequest) (*CollectionOfDriveItems1, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfDriveItems1
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeDriveApiService.ListSharedByMe")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/me/drive/sharedByMe"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.expand != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "form", "csv")
|
||||
}
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiListSharedWithMeRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MeDriveApiService
|
||||
expand *[]string
|
||||
}
|
||||
|
||||
// Expand related entities
|
||||
func (r ApiListSharedWithMeRequest) Expand(expand []string) ApiListSharedWithMeRequest {
|
||||
r.expand = &expand
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiListSharedWithMeRequest) Execute() (*CollectionOfDriveItems1, *http.Response, error) {
|
||||
return r.ApiService.ListSharedWithMeExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListSharedWithMe Get a list of driveItem objects shared with the owner of a drive.
|
||||
|
||||
The `driveItems` returned from the `sharedWithMe` method always include the `remoteItem` facet that indicates they are items from a different drive.
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiListSharedWithMeRequest
|
||||
*/
|
||||
func (a *MeDriveApiService) ListSharedWithMe(ctx context.Context) ApiListSharedWithMeRequest {
|
||||
return ApiListSharedWithMeRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfDriveItems1
|
||||
func (a *MeDriveApiService) ListSharedWithMeExecute(r ApiListSharedWithMeRequest) (*CollectionOfDriveItems1, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfDriveItems1
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeDriveApiService.ListSharedWithMe")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/me/drive/sharedWithMe"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.expand != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "form", "csv")
|
||||
}
|
||||
// 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 ApiUnfollowDriveItemRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MeDriveApiService
|
||||
itemId string
|
||||
}
|
||||
|
||||
func (r ApiUnfollowDriveItemRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.UnfollowDriveItemExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UnfollowDriveItem Unfollow a DriveItem
|
||||
|
||||
Unfollow a DriveItem.
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param itemId key: id of item
|
||||
@return ApiUnfollowDriveItemRequest
|
||||
*/
|
||||
func (a *MeDriveApiService) UnfollowDriveItem(ctx context.Context, itemId string) ApiUnfollowDriveItemRequest {
|
||||
return ApiUnfollowDriveItemRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
itemId: itemId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *MeDriveApiService) UnfollowDriveItemExecute(r ApiUnfollowDriveItemRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeDriveApiService.UnfollowDriveItem")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/me/drive/following/{item-id}"
|
||||
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 nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// MeDriveRootApiService MeDriveRootApi service
|
||||
type MeDriveRootApiService service
|
||||
|
||||
type ApiHomeGetRootRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MeDriveRootApiService
|
||||
}
|
||||
|
||||
func (r ApiHomeGetRootRequest) Execute() (*DriveItem, *http.Response, error) {
|
||||
return r.ApiService.HomeGetRootExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
HomeGetRoot Get root from personal space
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiHomeGetRootRequest
|
||||
*/
|
||||
func (a *MeDriveRootApiService) HomeGetRoot(ctx context.Context) ApiHomeGetRootRequest {
|
||||
return ApiHomeGetRootRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return DriveItem
|
||||
func (a *MeDriveRootApiService) HomeGetRootExecute(r ApiHomeGetRootRequest) (*DriveItem, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *DriveItem
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeDriveRootApiService.HomeGetRoot")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/me/drive/root"
|
||||
|
||||
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
|
||||
}
|
||||
Generated
Vendored
+128
@@ -0,0 +1,128 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// MeDriveRootChildrenApiService MeDriveRootChildrenApi service
|
||||
type MeDriveRootChildrenApiService service
|
||||
|
||||
type ApiHomeGetChildrenRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MeDriveRootChildrenApiService
|
||||
}
|
||||
|
||||
func (r ApiHomeGetChildrenRequest) Execute() (*CollectionOfDriveItems, *http.Response, error) {
|
||||
return r.ApiService.HomeGetChildrenExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
HomeGetChildren Get children from drive
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiHomeGetChildrenRequest
|
||||
*/
|
||||
func (a *MeDriveRootChildrenApiService) HomeGetChildren(ctx context.Context) ApiHomeGetChildrenRequest {
|
||||
return ApiHomeGetChildrenRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfDriveItems
|
||||
func (a *MeDriveRootChildrenApiService) HomeGetChildrenExecute(r ApiHomeGetChildrenRequest) (*CollectionOfDriveItems, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfDriveItems
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeDriveRootChildrenApiService.HomeGetChildren")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/me/drive/root/children"
|
||||
|
||||
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
|
||||
}
|
||||
+293
@@ -0,0 +1,293 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// MeDrivesApiService MeDrivesApi service
|
||||
type MeDrivesApiService service
|
||||
|
||||
type ApiListMyDrivesRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MeDrivesApiService
|
||||
orderby *string
|
||||
filter *string
|
||||
}
|
||||
|
||||
// The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc.
|
||||
func (r ApiListMyDrivesRequest) Orderby(orderby string) ApiListMyDrivesRequest {
|
||||
r.orderby = &orderby
|
||||
return r
|
||||
}
|
||||
|
||||
// Filter items by property values
|
||||
func (r ApiListMyDrivesRequest) Filter(filter string) ApiListMyDrivesRequest {
|
||||
r.filter = &filter
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiListMyDrivesRequest) Execute() (*CollectionOfDrives, *http.Response, error) {
|
||||
return r.ApiService.ListMyDrivesExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListMyDrives Get all drives where the current user is a regular member of
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiListMyDrivesRequest
|
||||
*/
|
||||
func (a *MeDrivesApiService) ListMyDrives(ctx context.Context) ApiListMyDrivesRequest {
|
||||
return ApiListMyDrivesRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfDrives
|
||||
func (a *MeDrivesApiService) ListMyDrivesExecute(r ApiListMyDrivesRequest) (*CollectionOfDrives, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfDrives
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeDrivesApiService.ListMyDrives")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/me/drives"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.orderby != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$orderby", r.orderby, "form", "")
|
||||
}
|
||||
if r.filter != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$filter", r.filter, "form", "")
|
||||
}
|
||||
// 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 ApiListMyDrivesBetaRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MeDrivesApiService
|
||||
orderby *string
|
||||
filter *string
|
||||
expand *string
|
||||
select_ *[]string
|
||||
}
|
||||
|
||||
// The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc.
|
||||
func (r ApiListMyDrivesBetaRequest) Orderby(orderby string) ApiListMyDrivesBetaRequest {
|
||||
r.orderby = &orderby
|
||||
return r
|
||||
}
|
||||
|
||||
// Filter items by property values
|
||||
func (r ApiListMyDrivesBetaRequest) Filter(filter string) ApiListMyDrivesBetaRequest {
|
||||
r.filter = &filter
|
||||
return r
|
||||
}
|
||||
|
||||
// Expand related entities
|
||||
func (r ApiListMyDrivesBetaRequest) Expand(expand string) ApiListMyDrivesBetaRequest {
|
||||
r.expand = &expand
|
||||
return r
|
||||
}
|
||||
|
||||
// Select properties to be returned. By default all properties are returned.
|
||||
func (r ApiListMyDrivesBetaRequest) Select_(select_ []string) ApiListMyDrivesBetaRequest {
|
||||
r.select_ = &select_
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiListMyDrivesBetaRequest) Execute() (*CollectionOfDrives, *http.Response, error) {
|
||||
return r.ApiService.ListMyDrivesBetaExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListMyDrivesBeta Alias for '/v1.0/drives', the difference is that grantedtoV2 is used and roles contain unified roles instead of cs3 roles
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiListMyDrivesBetaRequest
|
||||
*/
|
||||
func (a *MeDrivesApiService) ListMyDrivesBeta(ctx context.Context) ApiListMyDrivesBetaRequest {
|
||||
return ApiListMyDrivesBetaRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfDrives
|
||||
func (a *MeDrivesApiService) ListMyDrivesBetaExecute(r ApiListMyDrivesBetaRequest) (*CollectionOfDrives, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfDrives
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeDrivesApiService.ListMyDrivesBeta")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/me/drives"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.orderby != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$orderby", r.orderby, "form", "")
|
||||
}
|
||||
if r.filter != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$filter", r.filter, "form", "")
|
||||
}
|
||||
if r.expand != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "form", "")
|
||||
}
|
||||
if r.select_ != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "form", "csv")
|
||||
}
|
||||
// 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
|
||||
}
|
||||
+429
@@ -0,0 +1,429 @@
|
||||
/*
|
||||
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"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
||||
// MePhotoApiService MePhotoApi service
|
||||
type MePhotoApiService service
|
||||
|
||||
type ApiDeleteOwnUserPhotoRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MePhotoApiService
|
||||
}
|
||||
|
||||
func (r ApiDeleteOwnUserPhotoRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.DeleteOwnUserPhotoExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteOwnUserPhoto Delete the current user's profile photo
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiDeleteOwnUserPhotoRequest
|
||||
*/
|
||||
func (a *MePhotoApiService) DeleteOwnUserPhoto(ctx context.Context) ApiDeleteOwnUserPhotoRequest {
|
||||
return ApiDeleteOwnUserPhotoRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *MePhotoApiService) DeleteOwnUserPhotoExecute(r ApiDeleteOwnUserPhotoRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MePhotoApiService.DeleteOwnUserPhoto")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/me/photo/$value"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiGetOwnUserPhotoRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MePhotoApiService
|
||||
}
|
||||
|
||||
func (r ApiGetOwnUserPhotoRequest) Execute() (*os.File, *http.Response, error) {
|
||||
return r.ApiService.GetOwnUserPhotoExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetOwnUserPhoto Get the current user's profile photo
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiGetOwnUserPhotoRequest
|
||||
*/
|
||||
func (a *MePhotoApiService) GetOwnUserPhoto(ctx context.Context) ApiGetOwnUserPhotoRequest {
|
||||
return ApiGetOwnUserPhotoRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return *os.File
|
||||
func (a *MePhotoApiService) GetOwnUserPhotoExecute(r ApiGetOwnUserPhotoRequest) (*os.File, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *os.File
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MePhotoApiService.GetOwnUserPhoto")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/me/photo/$value"
|
||||
|
||||
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{"image/jpeg", "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 ApiUpdateOwnUserPhotoPatchRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MePhotoApiService
|
||||
body *os.File
|
||||
}
|
||||
|
||||
// New user photo
|
||||
func (r ApiUpdateOwnUserPhotoPatchRequest) Body(body *os.File) ApiUpdateOwnUserPhotoPatchRequest {
|
||||
r.body = body
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUpdateOwnUserPhotoPatchRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.UpdateOwnUserPhotoPatchExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateOwnUserPhotoPatch Update the current user's profile photo
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiUpdateOwnUserPhotoPatchRequest
|
||||
*/
|
||||
func (a *MePhotoApiService) UpdateOwnUserPhotoPatch(ctx context.Context) ApiUpdateOwnUserPhotoPatchRequest {
|
||||
return ApiUpdateOwnUserPhotoPatchRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *MePhotoApiService) UpdateOwnUserPhotoPatchExecute(r ApiUpdateOwnUserPhotoPatchRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MePhotoApiService.UpdateOwnUserPhotoPatch")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/me/photo/$value"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"image/jpeg"}
|
||||
|
||||
// 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.body
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiUpdateOwnUserPhotoPutRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MePhotoApiService
|
||||
body *os.File
|
||||
}
|
||||
|
||||
// New user photo
|
||||
func (r ApiUpdateOwnUserPhotoPutRequest) Body(body *os.File) ApiUpdateOwnUserPhotoPutRequest {
|
||||
r.body = body
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUpdateOwnUserPhotoPutRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.UpdateOwnUserPhotoPutExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateOwnUserPhotoPut Update the current user's profile photo
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiUpdateOwnUserPhotoPutRequest
|
||||
*/
|
||||
func (a *MePhotoApiService) UpdateOwnUserPhotoPut(ctx context.Context) ApiUpdateOwnUserPhotoPutRequest {
|
||||
return ApiUpdateOwnUserPhotoPutRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *MePhotoApiService) UpdateOwnUserPhotoPutExecute(r ApiUpdateOwnUserPhotoPutRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPut
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MePhotoApiService.UpdateOwnUserPhotoPut")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/me/photo/$value"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"image/jpeg"}
|
||||
|
||||
// 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.body
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
+252
@@ -0,0 +1,252 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// MeUserApiService MeUserApi service
|
||||
type MeUserApiService service
|
||||
|
||||
type ApiGetOwnUserRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MeUserApiService
|
||||
expand *[]string
|
||||
}
|
||||
|
||||
// Expand related entities
|
||||
func (r ApiGetOwnUserRequest) Expand(expand []string) ApiGetOwnUserRequest {
|
||||
r.expand = &expand
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiGetOwnUserRequest) Execute() (*User, *http.Response, error) {
|
||||
return r.ApiService.GetOwnUserExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetOwnUser Get current user
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiGetOwnUserRequest
|
||||
*/
|
||||
func (a *MeUserApiService) GetOwnUser(ctx context.Context) ApiGetOwnUserRequest {
|
||||
return ApiGetOwnUserRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return User
|
||||
func (a *MeUserApiService) GetOwnUserExecute(r ApiGetOwnUserRequest) (*User, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *User
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeUserApiService.GetOwnUser")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/me"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.expand != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "form", "csv")
|
||||
}
|
||||
// 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 ApiUpdateOwnUserRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *MeUserApiService
|
||||
userUpdate *UserUpdate
|
||||
}
|
||||
|
||||
// New user values
|
||||
func (r ApiUpdateOwnUserRequest) UserUpdate(userUpdate UserUpdate) ApiUpdateOwnUserRequest {
|
||||
r.userUpdate = &userUpdate
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUpdateOwnUserRequest) Execute() (*User, *http.Response, error) {
|
||||
return r.ApiService.UpdateOwnUserExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateOwnUser Update the current user
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiUpdateOwnUserRequest
|
||||
*/
|
||||
func (a *MeUserApiService) UpdateOwnUser(ctx context.Context) ApiUpdateOwnUserRequest {
|
||||
return ApiUpdateOwnUserRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return User
|
||||
func (a *MeUserApiService) UpdateOwnUserExecute(r ApiUpdateOwnUserRequest) (*User, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *User
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeUserApiService.UpdateOwnUser")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/me"
|
||||
|
||||
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.userUpdate
|
||||
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
|
||||
}
|
||||
+244
@@ -0,0 +1,244 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// RoleManagementApiService RoleManagementApi service
|
||||
type RoleManagementApiService service
|
||||
|
||||
type ApiGetPermissionRoleDefinitionRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *RoleManagementApiService
|
||||
roleId string
|
||||
}
|
||||
|
||||
func (r ApiGetPermissionRoleDefinitionRequest) Execute() (*UnifiedRoleDefinition, *http.Response, error) {
|
||||
return r.ApiService.GetPermissionRoleDefinitionExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetPermissionRoleDefinition Get unifiedRoleDefinition
|
||||
|
||||
Read the properties and relationships of a `unifiedRoleDefinition` object.
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param roleId key: id of roleDefinition
|
||||
@return ApiGetPermissionRoleDefinitionRequest
|
||||
*/
|
||||
func (a *RoleManagementApiService) GetPermissionRoleDefinition(ctx context.Context, roleId string) ApiGetPermissionRoleDefinitionRequest {
|
||||
return ApiGetPermissionRoleDefinitionRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
roleId: roleId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return UnifiedRoleDefinition
|
||||
func (a *RoleManagementApiService) GetPermissionRoleDefinitionExecute(r ApiGetPermissionRoleDefinitionRequest) (*UnifiedRoleDefinition, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *UnifiedRoleDefinition
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleManagementApiService.GetPermissionRoleDefinition")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/roleManagement/permissions/roleDefinitions/{role-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"role-id"+"}", url.PathEscape(parameterValueToString(r.roleId, "roleId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiListPermissionRoleDefinitionsRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *RoleManagementApiService
|
||||
}
|
||||
|
||||
func (r ApiListPermissionRoleDefinitionsRequest) Execute() ([]UnifiedRoleDefinition, *http.Response, error) {
|
||||
return r.ApiService.ListPermissionRoleDefinitionsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListPermissionRoleDefinitions List roleDefinitions
|
||||
|
||||
Get a list of `unifiedRoleDefinition` objects for the permissions provider. This list determines the roles that can be selected when creating sharing invites.
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiListPermissionRoleDefinitionsRequest
|
||||
*/
|
||||
func (a *RoleManagementApiService) ListPermissionRoleDefinitions(ctx context.Context) ApiListPermissionRoleDefinitionsRequest {
|
||||
return ApiListPermissionRoleDefinitionsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return []UnifiedRoleDefinition
|
||||
func (a *RoleManagementApiService) ListPermissionRoleDefinitionsExecute(r ApiListPermissionRoleDefinitionsRequest) ([]UnifiedRoleDefinition, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue []UnifiedRoleDefinition
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "RoleManagementApiService.ListPermissionRoleDefinitions")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1beta1/roleManagement/permissions/roleDefinitions"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarReturnValue, localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: err.Error(),
|
||||
}
|
||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHTTPResponse, nil
|
||||
}
|
||||
+332
@@ -0,0 +1,332 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// TagsApiService TagsApi service
|
||||
type TagsApiService service
|
||||
|
||||
type ApiAssignTagsRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *TagsApiService
|
||||
tagAssignment *TagAssignment
|
||||
}
|
||||
|
||||
func (r ApiAssignTagsRequest) TagAssignment(tagAssignment TagAssignment) ApiAssignTagsRequest {
|
||||
r.tagAssignment = &tagAssignment
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiAssignTagsRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.AssignTagsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
AssignTags Assign tags to a resource
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiAssignTagsRequest
|
||||
*/
|
||||
func (a *TagsApiService) AssignTags(ctx context.Context) ApiAssignTagsRequest {
|
||||
return ApiAssignTagsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *TagsApiService) AssignTagsExecute(r ApiAssignTagsRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPut
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TagsApiService.AssignTags")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/extensions/org.libregraph/tags"
|
||||
|
||||
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.tagAssignment
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiGetTagsRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *TagsApiService
|
||||
}
|
||||
|
||||
func (r ApiGetTagsRequest) Execute() (*CollectionOfTags, *http.Response, error) {
|
||||
return r.ApiService.GetTagsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetTags Get all known tags
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiGetTagsRequest
|
||||
*/
|
||||
func (a *TagsApiService) GetTags(ctx context.Context) ApiGetTagsRequest {
|
||||
return ApiGetTagsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfTags
|
||||
func (a *TagsApiService) GetTagsExecute(r ApiGetTagsRequest) (*CollectionOfTags, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfTags
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TagsApiService.GetTags")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/extensions/org.libregraph/tags"
|
||||
|
||||
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 ApiUnassignTagsRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *TagsApiService
|
||||
tagUnassignment *TagUnassignment
|
||||
}
|
||||
|
||||
func (r ApiUnassignTagsRequest) TagUnassignment(tagUnassignment TagUnassignment) ApiUnassignTagsRequest {
|
||||
r.tagUnassignment = &tagUnassignment
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUnassignTagsRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.UnassignTagsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UnassignTags Unassign tags from a resource
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiUnassignTagsRequest
|
||||
*/
|
||||
func (a *TagsApiService) UnassignTags(ctx context.Context) ApiUnassignTagsRequest {
|
||||
return ApiUnassignTagsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *TagsApiService) UnassignTagsExecute(r ApiUnassignTagsRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "TagsApiService.UnassignTags")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/extensions/org.libregraph/tags"
|
||||
|
||||
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.tagUnassignment
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
+489
@@ -0,0 +1,489 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// UserApiService UserApi service
|
||||
type UserApiService service
|
||||
|
||||
type ApiDeleteUserRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *UserApiService
|
||||
userId string
|
||||
ifMatch *string
|
||||
}
|
||||
|
||||
// ETag
|
||||
func (r ApiDeleteUserRequest) IfMatch(ifMatch string) ApiDeleteUserRequest {
|
||||
r.ifMatch = &ifMatch
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiDeleteUserRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.DeleteUserExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
DeleteUser Delete entity from users
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param userId key: id or name of user
|
||||
@return ApiDeleteUserRequest
|
||||
*/
|
||||
func (a *UserApiService) DeleteUser(ctx context.Context, userId string) ApiDeleteUserRequest {
|
||||
return ApiDeleteUserRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
userId: userId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.DeleteUser")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/users/{user-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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
|
||||
}
|
||||
if r.ifMatch != nil {
|
||||
parameterAddToHeaderOrQuery(localVarHeaderParams, "If-Match", r.ifMatch, "simple", "")
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiExportPersonalDataRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *UserApiService
|
||||
userId string
|
||||
exportPersonalDataRequest *ExportPersonalDataRequest
|
||||
}
|
||||
|
||||
// destination the file should be created at
|
||||
func (r ApiExportPersonalDataRequest) ExportPersonalDataRequest(exportPersonalDataRequest ExportPersonalDataRequest) ApiExportPersonalDataRequest {
|
||||
r.exportPersonalDataRequest = &exportPersonalDataRequest
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiExportPersonalDataRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.ExportPersonalDataExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ExportPersonalData export personal data of a user
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param userId key: id or name of user
|
||||
@return ApiExportPersonalDataRequest
|
||||
*/
|
||||
func (a *UserApiService) ExportPersonalData(ctx context.Context, userId string) ApiExportPersonalDataRequest {
|
||||
return ApiExportPersonalDataRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
userId: userId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *UserApiService) ExportPersonalDataExecute(r ApiExportPersonalDataRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.ExportPersonalData")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/users/{user-id}/exportPersonalData"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.exportPersonalDataRequest
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiGetUserRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *UserApiService
|
||||
userId string
|
||||
select_ *[]string
|
||||
expand *[]string
|
||||
}
|
||||
|
||||
// Select properties to be returned
|
||||
func (r ApiGetUserRequest) Select_(select_ []string) ApiGetUserRequest {
|
||||
r.select_ = &select_
|
||||
return r
|
||||
}
|
||||
|
||||
// Expand related entities
|
||||
func (r ApiGetUserRequest) Expand(expand []string) ApiGetUserRequest {
|
||||
r.expand = &expand
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiGetUserRequest) Execute() (*User, *http.Response, error) {
|
||||
return r.ApiService.GetUserExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetUser Get entity from users by key
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param userId key: id or name of user
|
||||
@return ApiGetUserRequest
|
||||
*/
|
||||
func (a *UserApiService) GetUser(ctx context.Context, userId string) ApiGetUserRequest {
|
||||
return ApiGetUserRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
userId: userId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return User
|
||||
func (a *UserApiService) GetUserExecute(r ApiGetUserRequest) (*User, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *User
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.GetUser")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/users/{user-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.select_ != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "form", "csv")
|
||||
}
|
||||
if r.expand != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "form", "csv")
|
||||
}
|
||||
// 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 ApiUpdateUserRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *UserApiService
|
||||
userId string
|
||||
userUpdate *UserUpdate
|
||||
}
|
||||
|
||||
// New property values
|
||||
func (r ApiUpdateUserRequest) UserUpdate(userUpdate UserUpdate) ApiUpdateUserRequest {
|
||||
r.userUpdate = &userUpdate
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUpdateUserRequest) Execute() (*User, *http.Response, error) {
|
||||
return r.ApiService.UpdateUserExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateUser Update entity in users
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param userId key: id of user
|
||||
@return ApiUpdateUserRequest
|
||||
*/
|
||||
func (a *UserApiService) UpdateUser(ctx context.Context, userId string) ApiUpdateUserRequest {
|
||||
return ApiUpdateUserRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
userId: userId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return User
|
||||
func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*User, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPatch
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *User
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserApiService.UpdateUser")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/users/{user-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.userUpdate == nil {
|
||||
return localVarReturnValue, nil, reportError("userUpdate is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.userUpdate
|
||||
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
|
||||
}
|
||||
Generated
Vendored
+374
@@ -0,0 +1,374 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// UserAppRoleAssignmentApiService UserAppRoleAssignmentApi service
|
||||
type UserAppRoleAssignmentApiService service
|
||||
|
||||
type ApiUserCreateAppRoleAssignmentsRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *UserAppRoleAssignmentApiService
|
||||
userId string
|
||||
appRoleAssignment *AppRoleAssignment
|
||||
}
|
||||
|
||||
// New app role assignment value
|
||||
func (r ApiUserCreateAppRoleAssignmentsRequest) AppRoleAssignment(appRoleAssignment AppRoleAssignment) ApiUserCreateAppRoleAssignmentsRequest {
|
||||
r.appRoleAssignment = &appRoleAssignment
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUserCreateAppRoleAssignmentsRequest) Execute() (*AppRoleAssignment, *http.Response, error) {
|
||||
return r.ApiService.UserCreateAppRoleAssignmentsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UserCreateAppRoleAssignments Grant an appRoleAssignment to a user
|
||||
|
||||
Use this API to assign a global role to a user. To grant an app role assignment to a user, you need three identifiers:
|
||||
* `principalId`: The `id` of the user to whom you are assigning the app role.
|
||||
* `resourceId`: The `id` of the resource `servicePrincipal` or `application` that has defined the app role.
|
||||
* `appRoleId`: The `id` of the `appRole` (defined on the resource service principal or application) to assign to the user.
|
||||
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param userId key: id of user
|
||||
@return ApiUserCreateAppRoleAssignmentsRequest
|
||||
*/
|
||||
func (a *UserAppRoleAssignmentApiService) UserCreateAppRoleAssignments(ctx context.Context, userId string) ApiUserCreateAppRoleAssignmentsRequest {
|
||||
return ApiUserCreateAppRoleAssignmentsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
userId: userId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return AppRoleAssignment
|
||||
func (a *UserAppRoleAssignmentApiService) UserCreateAppRoleAssignmentsExecute(r ApiUserCreateAppRoleAssignmentsRequest) (*AppRoleAssignment, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *AppRoleAssignment
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserAppRoleAssignmentApiService.UserCreateAppRoleAssignments")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/users/{user-id}/appRoleAssignments"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.appRoleAssignment == nil {
|
||||
return localVarReturnValue, nil, reportError("appRoleAssignment is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.appRoleAssignment
|
||||
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 ApiUserDeleteAppRoleAssignmentsRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *UserAppRoleAssignmentApiService
|
||||
userId string
|
||||
appRoleAssignmentId string
|
||||
ifMatch *string
|
||||
}
|
||||
|
||||
// ETag
|
||||
func (r ApiUserDeleteAppRoleAssignmentsRequest) IfMatch(ifMatch string) ApiUserDeleteAppRoleAssignmentsRequest {
|
||||
r.ifMatch = &ifMatch
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiUserDeleteAppRoleAssignmentsRequest) Execute() (*http.Response, error) {
|
||||
return r.ApiService.UserDeleteAppRoleAssignmentsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UserDeleteAppRoleAssignments Delete the appRoleAssignment from a user
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param userId key: id of user
|
||||
@param appRoleAssignmentId key: id of appRoleAssignment. This is the concatenated {user-id}:{appRole-id} separated by a colon.
|
||||
@return ApiUserDeleteAppRoleAssignmentsRequest
|
||||
*/
|
||||
func (a *UserAppRoleAssignmentApiService) UserDeleteAppRoleAssignments(ctx context.Context, userId string, appRoleAssignmentId string) ApiUserDeleteAppRoleAssignmentsRequest {
|
||||
return ApiUserDeleteAppRoleAssignmentsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
userId: userId,
|
||||
appRoleAssignmentId: appRoleAssignmentId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
func (a *UserAppRoleAssignmentApiService) UserDeleteAppRoleAssignmentsExecute(r ApiUserDeleteAppRoleAssignmentsRequest) (*http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodDelete
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserAppRoleAssignmentApiService.UserDeleteAppRoleAssignments")
|
||||
if err != nil {
|
||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/users/{user-id}/appRoleAssignments/{appRoleAssignment-id}"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1)
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"appRoleAssignment-id"+"}", url.PathEscape(parameterValueToString(r.appRoleAssignmentId, "appRoleAssignmentId")), -1)
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
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
|
||||
}
|
||||
if r.ifMatch != nil {
|
||||
parameterAddToHeaderOrQuery(localVarHeaderParams, "If-Match", r.ifMatch, "simple", "")
|
||||
}
|
||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||
if err != nil || localVarHTTPResponse == nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
||||
localVarHTTPResponse.Body.Close()
|
||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
||||
if err != nil {
|
||||
return localVarHTTPResponse, err
|
||||
}
|
||||
|
||||
if localVarHTTPResponse.StatusCode >= 300 {
|
||||
newErr := &GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHTTPResponse.Status,
|
||||
}
|
||||
var v OdataError
|
||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
||||
newErr.model = v
|
||||
return localVarHTTPResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHTTPResponse, nil
|
||||
}
|
||||
|
||||
type ApiUserListAppRoleAssignmentsRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *UserAppRoleAssignmentApiService
|
||||
userId string
|
||||
}
|
||||
|
||||
func (r ApiUserListAppRoleAssignmentsRequest) Execute() (*CollectionOfAppRoleAssignments, *http.Response, error) {
|
||||
return r.ApiService.UserListAppRoleAssignmentsExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
UserListAppRoleAssignments Get appRoleAssignments from a user
|
||||
|
||||
Represents the global roles a user has been granted for an application.
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param userId key: id of user
|
||||
@return ApiUserListAppRoleAssignmentsRequest
|
||||
*/
|
||||
func (a *UserAppRoleAssignmentApiService) UserListAppRoleAssignments(ctx context.Context, userId string) ApiUserListAppRoleAssignmentsRequest {
|
||||
return ApiUserListAppRoleAssignmentsRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
userId: userId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfAppRoleAssignments
|
||||
func (a *UserAppRoleAssignmentApiService) UserListAppRoleAssignmentsExecute(r ApiUserListAppRoleAssignmentsRequest) (*CollectionOfAppRoleAssignments, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfAppRoleAssignments
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserAppRoleAssignmentApiService.UserListAppRoleAssignments")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/users/{user-id}/appRoleAssignments"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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
|
||||
}
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
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"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
||||
// UserPhotoApiService UserPhotoApi service
|
||||
type UserPhotoApiService service
|
||||
|
||||
type ApiGetUserPhotoRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *UserPhotoApiService
|
||||
userId string
|
||||
}
|
||||
|
||||
func (r ApiGetUserPhotoRequest) Execute() (*os.File, *http.Response, error) {
|
||||
return r.ApiService.GetUserPhotoExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
GetUserPhoto Get the photo of a user
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@param userId key: id or name of user
|
||||
@return ApiGetUserPhotoRequest
|
||||
*/
|
||||
func (a *UserPhotoApiService) GetUserPhoto(ctx context.Context, userId string) ApiGetUserPhotoRequest {
|
||||
return ApiGetUserPhotoRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
userId: userId,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return *os.File
|
||||
func (a *UserPhotoApiService) GetUserPhotoExecute(r ApiGetUserPhotoRequest) (*os.File, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *os.File
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UserPhotoApiService.GetUserPhoto")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/users/{user-id}/photo/$value"
|
||||
localVarPath = strings.Replace(localVarPath, "{"+"user-id"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -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{"image/jpeg", "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
|
||||
}
|
||||
+295
@@ -0,0 +1,295 @@
|
||||
/*
|
||||
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"
|
||||
)
|
||||
|
||||
|
||||
// UsersApiService UsersApi service
|
||||
type UsersApiService service
|
||||
|
||||
type ApiCreateUserRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *UsersApiService
|
||||
user *User
|
||||
}
|
||||
|
||||
// New entity
|
||||
func (r ApiCreateUserRequest) User(user User) ApiCreateUserRequest {
|
||||
r.user = &user
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiCreateUserRequest) Execute() (*User, *http.Response, error) {
|
||||
return r.ApiService.CreateUserExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
CreateUser Add new entity to users
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiCreateUserRequest
|
||||
*/
|
||||
func (a *UsersApiService) CreateUser(ctx context.Context) ApiCreateUserRequest {
|
||||
return ApiCreateUserRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return User
|
||||
func (a *UsersApiService) CreateUserExecute(r ApiCreateUserRequest) (*User, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodPost
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *User
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.CreateUser")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/users"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
if r.user == nil {
|
||||
return localVarReturnValue, nil, reportError("user is required and must be specified")
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHTTPContentTypes := []string{"application/json"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||
if localVarHTTPContentType != "" {
|
||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||
|
||||
// set Accept header
|
||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||
if localVarHTTPHeaderAccept != "" {
|
||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = r.user
|
||||
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 ApiListUsersRequest struct {
|
||||
ctx context.Context
|
||||
ApiService *UsersApiService
|
||||
search *string
|
||||
filter *string
|
||||
orderby *[]string
|
||||
select_ *[]string
|
||||
expand *[]string
|
||||
}
|
||||
|
||||
// Search items by search phrases
|
||||
func (r ApiListUsersRequest) Search(search string) ApiListUsersRequest {
|
||||
r.search = &search
|
||||
return r
|
||||
}
|
||||
|
||||
// Filter users by property values and relationship attributes
|
||||
func (r ApiListUsersRequest) Filter(filter string) ApiListUsersRequest {
|
||||
r.filter = &filter
|
||||
return r
|
||||
}
|
||||
|
||||
// Order items by property values
|
||||
func (r ApiListUsersRequest) Orderby(orderby []string) ApiListUsersRequest {
|
||||
r.orderby = &orderby
|
||||
return r
|
||||
}
|
||||
|
||||
// Select properties to be returned
|
||||
func (r ApiListUsersRequest) Select_(select_ []string) ApiListUsersRequest {
|
||||
r.select_ = &select_
|
||||
return r
|
||||
}
|
||||
|
||||
// Expand related entities
|
||||
func (r ApiListUsersRequest) Expand(expand []string) ApiListUsersRequest {
|
||||
r.expand = &expand
|
||||
return r
|
||||
}
|
||||
|
||||
func (r ApiListUsersRequest) Execute() (*CollectionOfUser, *http.Response, error) {
|
||||
return r.ApiService.ListUsersExecute(r)
|
||||
}
|
||||
|
||||
/*
|
||||
ListUsers Get entities from users
|
||||
|
||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
@return ApiListUsersRequest
|
||||
*/
|
||||
func (a *UsersApiService) ListUsers(ctx context.Context) ApiListUsersRequest {
|
||||
return ApiListUsersRequest{
|
||||
ApiService: a,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
// Execute executes the request
|
||||
// @return CollectionOfUser
|
||||
func (a *UsersApiService) ListUsersExecute(r ApiListUsersRequest) (*CollectionOfUser, *http.Response, error) {
|
||||
var (
|
||||
localVarHTTPMethod = http.MethodGet
|
||||
localVarPostBody interface{}
|
||||
formFiles []formFile
|
||||
localVarReturnValue *CollectionOfUser
|
||||
)
|
||||
|
||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.ListUsers")
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
||||
}
|
||||
|
||||
localVarPath := localBasePath + "/v1.0/users"
|
||||
|
||||
localVarHeaderParams := make(map[string]string)
|
||||
localVarQueryParams := url.Values{}
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
if r.search != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$search", r.search, "form", "")
|
||||
}
|
||||
if r.filter != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$filter", r.filter, "form", "")
|
||||
}
|
||||
if r.orderby != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$orderby", r.orderby, "form", "csv")
|
||||
}
|
||||
if r.select_ != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$select", r.select_, "form", "csv")
|
||||
}
|
||||
if r.expand != nil {
|
||||
parameterAddToHeaderOrQuery(localVarQueryParams, "$expand", r.expand, "form", "csv")
|
||||
}
|
||||
// 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
|
||||
}
|
||||
+741
@@ -0,0 +1,741 @@
|
||||
/*
|
||||
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"
|
||||
"encoding/json"
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/http/httputil"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
)
|
||||
|
||||
var (
|
||||
JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`)
|
||||
XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`)
|
||||
queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`)
|
||||
queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" )
|
||||
)
|
||||
|
||||
// APIClient manages communication with the Libre Graph API API vv1.0.8
|
||||
// In most cases there should be only one, shared, APIClient.
|
||||
type APIClient struct {
|
||||
cfg *Configuration
|
||||
common service // Reuse a single struct instead of allocating one for each service on the heap.
|
||||
|
||||
// API Services
|
||||
|
||||
ActivitiesApi *ActivitiesApiService
|
||||
|
||||
ApplicationsApi *ApplicationsApiService
|
||||
|
||||
DriveItemApi *DriveItemApiService
|
||||
|
||||
DrivesApi *DrivesApiService
|
||||
|
||||
DrivesGetDrivesApi *DrivesGetDrivesApiService
|
||||
|
||||
DrivesPermissionsApi *DrivesPermissionsApiService
|
||||
|
||||
DrivesRootApi *DrivesRootApiService
|
||||
|
||||
EducationClassApi *EducationClassApiService
|
||||
|
||||
EducationClassTeachersApi *EducationClassTeachersApiService
|
||||
|
||||
EducationSchoolApi *EducationSchoolApiService
|
||||
|
||||
EducationUserApi *EducationUserApiService
|
||||
|
||||
GroupApi *GroupApiService
|
||||
|
||||
GroupsApi *GroupsApiService
|
||||
|
||||
MeChangepasswordApi *MeChangepasswordApiService
|
||||
|
||||
MeDriveApi *MeDriveApiService
|
||||
|
||||
MeDriveRootApi *MeDriveRootApiService
|
||||
|
||||
MeDriveRootChildrenApi *MeDriveRootChildrenApiService
|
||||
|
||||
MeDrivesApi *MeDrivesApiService
|
||||
|
||||
MePhotoApi *MePhotoApiService
|
||||
|
||||
MeUserApi *MeUserApiService
|
||||
|
||||
RoleManagementApi *RoleManagementApiService
|
||||
|
||||
TagsApi *TagsApiService
|
||||
|
||||
UserApi *UserApiService
|
||||
|
||||
UserAppRoleAssignmentApi *UserAppRoleAssignmentApiService
|
||||
|
||||
UserPhotoApi *UserPhotoApiService
|
||||
|
||||
UsersApi *UsersApiService
|
||||
}
|
||||
|
||||
type service struct {
|
||||
client *APIClient
|
||||
}
|
||||
|
||||
// NewAPIClient creates a new API client. Requires a userAgent string describing your application.
|
||||
// optionally a custom http.Client to allow for advanced features such as caching.
|
||||
func NewAPIClient(cfg *Configuration) *APIClient {
|
||||
if cfg.HTTPClient == nil {
|
||||
cfg.HTTPClient = http.DefaultClient
|
||||
}
|
||||
|
||||
c := &APIClient{}
|
||||
c.cfg = cfg
|
||||
c.common.client = c
|
||||
|
||||
// API Services
|
||||
c.ActivitiesApi = (*ActivitiesApiService)(&c.common)
|
||||
c.ApplicationsApi = (*ApplicationsApiService)(&c.common)
|
||||
c.DriveItemApi = (*DriveItemApiService)(&c.common)
|
||||
c.DrivesApi = (*DrivesApiService)(&c.common)
|
||||
c.DrivesGetDrivesApi = (*DrivesGetDrivesApiService)(&c.common)
|
||||
c.DrivesPermissionsApi = (*DrivesPermissionsApiService)(&c.common)
|
||||
c.DrivesRootApi = (*DrivesRootApiService)(&c.common)
|
||||
c.EducationClassApi = (*EducationClassApiService)(&c.common)
|
||||
c.EducationClassTeachersApi = (*EducationClassTeachersApiService)(&c.common)
|
||||
c.EducationSchoolApi = (*EducationSchoolApiService)(&c.common)
|
||||
c.EducationUserApi = (*EducationUserApiService)(&c.common)
|
||||
c.GroupApi = (*GroupApiService)(&c.common)
|
||||
c.GroupsApi = (*GroupsApiService)(&c.common)
|
||||
c.MeChangepasswordApi = (*MeChangepasswordApiService)(&c.common)
|
||||
c.MeDriveApi = (*MeDriveApiService)(&c.common)
|
||||
c.MeDriveRootApi = (*MeDriveRootApiService)(&c.common)
|
||||
c.MeDriveRootChildrenApi = (*MeDriveRootChildrenApiService)(&c.common)
|
||||
c.MeDrivesApi = (*MeDrivesApiService)(&c.common)
|
||||
c.MePhotoApi = (*MePhotoApiService)(&c.common)
|
||||
c.MeUserApi = (*MeUserApiService)(&c.common)
|
||||
c.RoleManagementApi = (*RoleManagementApiService)(&c.common)
|
||||
c.TagsApi = (*TagsApiService)(&c.common)
|
||||
c.UserApi = (*UserApiService)(&c.common)
|
||||
c.UserAppRoleAssignmentApi = (*UserAppRoleAssignmentApiService)(&c.common)
|
||||
c.UserPhotoApi = (*UserPhotoApiService)(&c.common)
|
||||
c.UsersApi = (*UsersApiService)(&c.common)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func atoi(in string) (int, error) {
|
||||
return strconv.Atoi(in)
|
||||
}
|
||||
|
||||
// selectHeaderContentType select a content type from the available list.
|
||||
func selectHeaderContentType(contentTypes []string) string {
|
||||
if len(contentTypes) == 0 {
|
||||
return ""
|
||||
}
|
||||
if contains(contentTypes, "application/json") {
|
||||
return "application/json"
|
||||
}
|
||||
return contentTypes[0] // use the first content type specified in 'consumes'
|
||||
}
|
||||
|
||||
// selectHeaderAccept join all accept types and return
|
||||
func selectHeaderAccept(accepts []string) string {
|
||||
if len(accepts) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
if contains(accepts, "application/json") {
|
||||
return "application/json"
|
||||
}
|
||||
|
||||
return strings.Join(accepts, ",")
|
||||
}
|
||||
|
||||
// contains is a case insensitive match, finding needle in a haystack
|
||||
func contains(haystack []string, needle string) bool {
|
||||
for _, a := range haystack {
|
||||
if strings.EqualFold(a, needle) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Verify optional parameters are of the correct type.
|
||||
func typeCheckParameter(obj interface{}, expected string, name string) error {
|
||||
// Make sure there is an object.
|
||||
if obj == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Check the type is as expected.
|
||||
if reflect.TypeOf(obj).String() != expected {
|
||||
return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func parameterValueToString( obj interface{}, key string ) string {
|
||||
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
|
||||
if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok {
|
||||
return fmt.Sprintf("%v", actualObj.GetActualInstanceValue())
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%v", obj)
|
||||
}
|
||||
var param,ok = obj.(MappedNullable)
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
dataMap,err := param.ToMap()
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("%v", dataMap[key])
|
||||
}
|
||||
|
||||
// parameterAddToHeaderOrQuery adds the provided object to the request header or url query
|
||||
// supporting deep object syntax
|
||||
func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) {
|
||||
var v = reflect.ValueOf(obj)
|
||||
var value = ""
|
||||
if v == reflect.ValueOf(nil) {
|
||||
value = "null"
|
||||
} else {
|
||||
switch v.Kind() {
|
||||
case reflect.Invalid:
|
||||
value = "invalid"
|
||||
|
||||
case reflect.Struct:
|
||||
if t,ok := obj.(MappedNullable); ok {
|
||||
dataMap,err := t.ToMap()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType)
|
||||
return
|
||||
}
|
||||
if t, ok := obj.(time.Time); ok {
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType)
|
||||
return
|
||||
}
|
||||
value = v.Type().String() + " value"
|
||||
case reflect.Slice:
|
||||
var indValue = reflect.ValueOf(obj)
|
||||
if indValue == reflect.ValueOf(nil) {
|
||||
return
|
||||
}
|
||||
var lenIndValue = indValue.Len()
|
||||
for i:=0;i<lenIndValue;i++ {
|
||||
var arrayValue = indValue.Index(i)
|
||||
var keyPrefixForCollectionType = keyPrefix
|
||||
if style == "deepObject" {
|
||||
keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]"
|
||||
}
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType)
|
||||
}
|
||||
return
|
||||
|
||||
case reflect.Map:
|
||||
var indValue = reflect.ValueOf(obj)
|
||||
if indValue == reflect.ValueOf(nil) {
|
||||
return
|
||||
}
|
||||
iter := indValue.MapRange()
|
||||
for iter.Next() {
|
||||
k,v := iter.Key(), iter.Value()
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType)
|
||||
}
|
||||
return
|
||||
|
||||
case reflect.Interface:
|
||||
fallthrough
|
||||
case reflect.Ptr:
|
||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType)
|
||||
return
|
||||
|
||||
case reflect.Int, reflect.Int8, reflect.Int16,
|
||||
reflect.Int32, reflect.Int64:
|
||||
value = strconv.FormatInt(v.Int(), 10)
|
||||
case reflect.Uint, reflect.Uint8, reflect.Uint16,
|
||||
reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
||||
value = strconv.FormatUint(v.Uint(), 10)
|
||||
case reflect.Float32, reflect.Float64:
|
||||
value = strconv.FormatFloat(v.Float(), 'g', -1, 32)
|
||||
case reflect.Bool:
|
||||
value = strconv.FormatBool(v.Bool())
|
||||
case reflect.String:
|
||||
value = v.String()
|
||||
default:
|
||||
value = v.Type().String() + " value"
|
||||
}
|
||||
}
|
||||
|
||||
switch valuesMap := headerOrQueryParams.(type) {
|
||||
case url.Values:
|
||||
if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" {
|
||||
valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix) + "," + value)
|
||||
} else {
|
||||
valuesMap.Add(keyPrefix, value)
|
||||
}
|
||||
break
|
||||
case map[string]string:
|
||||
valuesMap[keyPrefix] = value
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// helper for converting interface{} parameters to json strings
|
||||
func parameterToJson(obj interface{}) (string, error) {
|
||||
jsonBuf, err := json.Marshal(obj)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(jsonBuf), err
|
||||
}
|
||||
|
||||
// callAPI do the request.
|
||||
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
|
||||
if c.cfg.Debug {
|
||||
dump, err := httputil.DumpRequestOut(request, true)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
log.Printf("\n%s\n", string(dump))
|
||||
}
|
||||
|
||||
resp, err := c.cfg.HTTPClient.Do(request)
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
|
||||
if c.cfg.Debug {
|
||||
dump, err := httputil.DumpResponse(resp, true)
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
log.Printf("\n%s\n", string(dump))
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
||||
// Allow modification of underlying config for alternate implementations and testing
|
||||
// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
|
||||
func (c *APIClient) GetConfig() *Configuration {
|
||||
return c.cfg
|
||||
}
|
||||
|
||||
type formFile struct {
|
||||
fileBytes []byte
|
||||
fileName string
|
||||
formFileName string
|
||||
}
|
||||
|
||||
// prepareRequest build the request
|
||||
func (c *APIClient) prepareRequest(
|
||||
ctx context.Context,
|
||||
path string, method string,
|
||||
postBody interface{},
|
||||
headerParams map[string]string,
|
||||
queryParams url.Values,
|
||||
formParams url.Values,
|
||||
formFiles []formFile) (localVarRequest *http.Request, err error) {
|
||||
|
||||
var body *bytes.Buffer
|
||||
|
||||
// Detect postBody type and post.
|
||||
if postBody != nil {
|
||||
contentType := headerParams["Content-Type"]
|
||||
if contentType == "" {
|
||||
contentType = detectContentType(postBody)
|
||||
headerParams["Content-Type"] = contentType
|
||||
}
|
||||
|
||||
body, err = setBody(postBody, contentType)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// add form parameters and file if available.
|
||||
if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) {
|
||||
if body != nil {
|
||||
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
|
||||
}
|
||||
body = &bytes.Buffer{}
|
||||
w := multipart.NewWriter(body)
|
||||
|
||||
for k, v := range formParams {
|
||||
for _, iv := range v {
|
||||
if strings.HasPrefix(k, "@") { // file
|
||||
err = addFile(w, k[1:], iv)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else { // form value
|
||||
w.WriteField(k, iv)
|
||||
}
|
||||
}
|
||||
}
|
||||
for _, formFile := range formFiles {
|
||||
if len(formFile.fileBytes) > 0 && formFile.fileName != "" {
|
||||
w.Boundary()
|
||||
part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
_, err = part.Write(formFile.fileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set the Boundary in the Content-Type
|
||||
headerParams["Content-Type"] = w.FormDataContentType()
|
||||
|
||||
// Set Content-Length
|
||||
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
|
||||
w.Close()
|
||||
}
|
||||
|
||||
if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 {
|
||||
if body != nil {
|
||||
return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.")
|
||||
}
|
||||
body = &bytes.Buffer{}
|
||||
body.WriteString(formParams.Encode())
|
||||
// Set Content-Length
|
||||
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
|
||||
}
|
||||
|
||||
// Setup path and query parameters
|
||||
url, err := url.Parse(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Override request host, if applicable
|
||||
if c.cfg.Host != "" {
|
||||
url.Host = c.cfg.Host
|
||||
}
|
||||
|
||||
// Override request scheme, if applicable
|
||||
if c.cfg.Scheme != "" {
|
||||
url.Scheme = c.cfg.Scheme
|
||||
}
|
||||
|
||||
// Adding Query Param
|
||||
query := url.Query()
|
||||
for k, v := range queryParams {
|
||||
for _, iv := range v {
|
||||
query.Add(k, iv)
|
||||
}
|
||||
}
|
||||
|
||||
// Encode the parameters.
|
||||
url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string {
|
||||
pieces := strings.Split(s, "=")
|
||||
pieces[0] = queryDescape.Replace(pieces[0])
|
||||
return strings.Join(pieces, "=")
|
||||
})
|
||||
|
||||
// Generate a new request
|
||||
if body != nil {
|
||||
localVarRequest, err = http.NewRequest(method, url.String(), body)
|
||||
} else {
|
||||
localVarRequest, err = http.NewRequest(method, url.String(), nil)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// add header parameters, if any
|
||||
if len(headerParams) > 0 {
|
||||
headers := http.Header{}
|
||||
for h, v := range headerParams {
|
||||
headers[h] = []string{v}
|
||||
}
|
||||
localVarRequest.Header = headers
|
||||
}
|
||||
|
||||
// Add the user agent to the request.
|
||||
localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent)
|
||||
|
||||
if ctx != nil {
|
||||
// add context to the request
|
||||
localVarRequest = localVarRequest.WithContext(ctx)
|
||||
|
||||
// Walk through any authentication.
|
||||
|
||||
// Basic HTTP Authentication
|
||||
if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok {
|
||||
localVarRequest.SetBasicAuth(auth.UserName, auth.Password)
|
||||
}
|
||||
|
||||
// AccessToken Authentication
|
||||
if auth, ok := ctx.Value(ContextAccessToken).(string); ok {
|
||||
localVarRequest.Header.Add("Authorization", "Bearer "+auth)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for header, value := range c.cfg.DefaultHeader {
|
||||
localVarRequest.Header.Add(header, value)
|
||||
}
|
||||
return localVarRequest, nil
|
||||
}
|
||||
|
||||
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
|
||||
if len(b) == 0 {
|
||||
return nil
|
||||
}
|
||||
if s, ok := v.(*string); ok {
|
||||
*s = string(b)
|
||||
return nil
|
||||
}
|
||||
if f, ok := v.(*os.File); ok {
|
||||
f, err = os.CreateTemp("", "HttpClientFile")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, err = f.Write(b)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, err = f.Seek(0, io.SeekStart)
|
||||
return
|
||||
}
|
||||
if f, ok := v.(**os.File); ok {
|
||||
*f, err = os.CreateTemp("", "HttpClientFile")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, err = (*f).Write(b)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, err = (*f).Seek(0, io.SeekStart)
|
||||
return
|
||||
}
|
||||
if XmlCheck.MatchString(contentType) {
|
||||
if err = xml.Unmarshal(b, v); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if JsonCheck.MatchString(contentType) {
|
||||
if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas
|
||||
if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined
|
||||
if err = unmarshalObj.UnmarshalJSON(b); err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined")
|
||||
}
|
||||
} else if err = json.Unmarshal(b, v); err != nil { // simple model
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return errors.New("undefined response type")
|
||||
}
|
||||
|
||||
// Add a file to the multipart request
|
||||
func addFile(w *multipart.Writer, fieldName, path string) error {
|
||||
file, err := os.Open(filepath.Clean(path))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = file.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = io.Copy(part, file)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// Set request body from an interface{}
|
||||
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
|
||||
if bodyBuf == nil {
|
||||
bodyBuf = &bytes.Buffer{}
|
||||
}
|
||||
|
||||
if reader, ok := body.(io.Reader); ok {
|
||||
_, err = bodyBuf.ReadFrom(reader)
|
||||
} else if fp, ok := body.(*os.File); ok {
|
||||
_, err = bodyBuf.ReadFrom(fp)
|
||||
} else if b, ok := body.([]byte); ok {
|
||||
_, err = bodyBuf.Write(b)
|
||||
} else if s, ok := body.(string); ok {
|
||||
_, err = bodyBuf.WriteString(s)
|
||||
} else if s, ok := body.(*string); ok {
|
||||
_, err = bodyBuf.WriteString(*s)
|
||||
} else if JsonCheck.MatchString(contentType) {
|
||||
err = json.NewEncoder(bodyBuf).Encode(body)
|
||||
} else if XmlCheck.MatchString(contentType) {
|
||||
var bs []byte
|
||||
bs, err = xml.Marshal(body)
|
||||
if err == nil {
|
||||
bodyBuf.Write(bs)
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if bodyBuf.Len() == 0 {
|
||||
err = fmt.Errorf("invalid body type %s\n", contentType)
|
||||
return nil, err
|
||||
}
|
||||
return bodyBuf, nil
|
||||
}
|
||||
|
||||
// detectContentType method is used to figure out `Request.Body` content type for request header
|
||||
func detectContentType(body interface{}) string {
|
||||
contentType := "text/plain; charset=utf-8"
|
||||
kind := reflect.TypeOf(body).Kind()
|
||||
|
||||
switch kind {
|
||||
case reflect.Struct, reflect.Map, reflect.Ptr:
|
||||
contentType = "application/json; charset=utf-8"
|
||||
case reflect.String:
|
||||
contentType = "text/plain; charset=utf-8"
|
||||
default:
|
||||
if b, ok := body.([]byte); ok {
|
||||
contentType = http.DetectContentType(b)
|
||||
} else if kind == reflect.Slice {
|
||||
contentType = "application/json; charset=utf-8"
|
||||
}
|
||||
}
|
||||
|
||||
return contentType
|
||||
}
|
||||
|
||||
// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go
|
||||
type cacheControl map[string]string
|
||||
|
||||
func parseCacheControl(headers http.Header) cacheControl {
|
||||
cc := cacheControl{}
|
||||
ccHeader := headers.Get("Cache-Control")
|
||||
for _, part := range strings.Split(ccHeader, ",") {
|
||||
part = strings.Trim(part, " ")
|
||||
if part == "" {
|
||||
continue
|
||||
}
|
||||
if strings.ContainsRune(part, '=') {
|
||||
keyval := strings.Split(part, "=")
|
||||
cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",")
|
||||
} else {
|
||||
cc[part] = ""
|
||||
}
|
||||
}
|
||||
return cc
|
||||
}
|
||||
|
||||
// CacheExpires helper function to determine remaining time before repeating a request.
|
||||
func CacheExpires(r *http.Response) time.Time {
|
||||
// Figure out when the cache expires.
|
||||
var expires time.Time
|
||||
now, err := time.Parse(time.RFC1123, r.Header.Get("date"))
|
||||
if err != nil {
|
||||
return time.Now()
|
||||
}
|
||||
respCacheControl := parseCacheControl(r.Header)
|
||||
|
||||
if maxAge, ok := respCacheControl["max-age"]; ok {
|
||||
lifetime, err := time.ParseDuration(maxAge + "s")
|
||||
if err != nil {
|
||||
expires = now
|
||||
} else {
|
||||
expires = now.Add(lifetime)
|
||||
}
|
||||
} else {
|
||||
expiresHeader := r.Header.Get("Expires")
|
||||
if expiresHeader != "" {
|
||||
expires, err = time.Parse(time.RFC1123, expiresHeader)
|
||||
if err != nil {
|
||||
expires = now
|
||||
}
|
||||
}
|
||||
}
|
||||
return expires
|
||||
}
|
||||
|
||||
func strlen(s string) int {
|
||||
return utf8.RuneCountInString(s)
|
||||
}
|
||||
|
||||
// GenericOpenAPIError Provides access to the body, error and model on returned errors.
|
||||
type GenericOpenAPIError struct {
|
||||
body []byte
|
||||
error string
|
||||
model interface{}
|
||||
}
|
||||
|
||||
// Error returns non-empty string if there was an error.
|
||||
func (e GenericOpenAPIError) Error() string {
|
||||
return e.error
|
||||
}
|
||||
|
||||
// Body returns the raw bytes of the response
|
||||
func (e GenericOpenAPIError) Body() []byte {
|
||||
return e.body
|
||||
}
|
||||
|
||||
// Model returns the unpacked model of the error
|
||||
func (e GenericOpenAPIError) Model() interface{} {
|
||||
return e.model
|
||||
}
|
||||
|
||||
// format error message using title and detail when model implements rfc7807
|
||||
func formatErrorMessage(status string, v interface{}) string {
|
||||
str := ""
|
||||
metaValue := reflect.ValueOf(v).Elem()
|
||||
|
||||
if metaValue.Kind() == reflect.Struct {
|
||||
field := metaValue.FieldByName("Title")
|
||||
if field != (reflect.Value{}) {
|
||||
str = fmt.Sprintf("%s", field.Interface())
|
||||
}
|
||||
|
||||
field = metaValue.FieldByName("Detail")
|
||||
if field != (reflect.Value{}) {
|
||||
str = fmt.Sprintf("%s (%s)", str, field.Interface())
|
||||
}
|
||||
}
|
||||
|
||||
return strings.TrimSpace(fmt.Sprintf("%s %s", status, str))
|
||||
}
|
||||
+221
@@ -0,0 +1,221 @@
|
||||
/*
|
||||
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 (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// contextKeys are used to identify the type of value in the context.
|
||||
// Since these are string, it is possible to get a short description of the
|
||||
// context key for logging and debugging using key.String().
|
||||
|
||||
type contextKey string
|
||||
|
||||
func (c contextKey) String() string {
|
||||
return "auth " + string(c)
|
||||
}
|
||||
|
||||
var (
|
||||
// ContextBasicAuth takes BasicAuth as authentication for the request.
|
||||
ContextBasicAuth = contextKey("basic")
|
||||
|
||||
// ContextAccessToken takes a string oauth2 access token as authentication for the request.
|
||||
ContextAccessToken = contextKey("accesstoken")
|
||||
|
||||
// ContextServerIndex uses a server configuration from the index.
|
||||
ContextServerIndex = contextKey("serverIndex")
|
||||
|
||||
// ContextOperationServerIndices uses a server configuration from the index mapping.
|
||||
ContextOperationServerIndices = contextKey("serverOperationIndices")
|
||||
|
||||
// ContextServerVariables overrides a server configuration variables.
|
||||
ContextServerVariables = contextKey("serverVariables")
|
||||
|
||||
// ContextOperationServerVariables overrides a server configuration variables using operation specific values.
|
||||
ContextOperationServerVariables = contextKey("serverOperationVariables")
|
||||
)
|
||||
|
||||
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
|
||||
type BasicAuth struct {
|
||||
UserName string `json:"userName,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
}
|
||||
|
||||
// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
|
||||
type APIKey struct {
|
||||
Key string
|
||||
Prefix string
|
||||
}
|
||||
|
||||
// ServerVariable stores the information about a server variable
|
||||
type ServerVariable struct {
|
||||
Description string
|
||||
DefaultValue string
|
||||
EnumValues []string
|
||||
}
|
||||
|
||||
// ServerConfiguration stores the information about a server
|
||||
type ServerConfiguration struct {
|
||||
URL string
|
||||
Description string
|
||||
Variables map[string]ServerVariable
|
||||
}
|
||||
|
||||
// ServerConfigurations stores multiple ServerConfiguration items
|
||||
type ServerConfigurations []ServerConfiguration
|
||||
|
||||
// Configuration stores the configuration of the API client
|
||||
type Configuration struct {
|
||||
Host string `json:"host,omitempty"`
|
||||
Scheme string `json:"scheme,omitempty"`
|
||||
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
|
||||
UserAgent string `json:"userAgent,omitempty"`
|
||||
Debug bool `json:"debug,omitempty"`
|
||||
Servers ServerConfigurations
|
||||
OperationServers map[string]ServerConfigurations
|
||||
HTTPClient *http.Client
|
||||
}
|
||||
|
||||
// NewConfiguration returns a new Configuration object
|
||||
func NewConfiguration() *Configuration {
|
||||
cfg := &Configuration{
|
||||
DefaultHeader: make(map[string]string),
|
||||
UserAgent: "OpenAPI-Generator/1.0.0/go",
|
||||
Debug: false,
|
||||
Servers: ServerConfigurations{
|
||||
{
|
||||
URL: "https://localhost:9200/graph",
|
||||
Description: "OpenCloud Development Setup",
|
||||
},
|
||||
},
|
||||
OperationServers: map[string]ServerConfigurations{
|
||||
},
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
||||
// AddDefaultHeader adds a new HTTP header to the default header in the request
|
||||
func (c *Configuration) AddDefaultHeader(key string, value string) {
|
||||
c.DefaultHeader[key] = value
|
||||
}
|
||||
|
||||
// URL formats template on a index using given variables
|
||||
func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) {
|
||||
if index < 0 || len(sc) <= index {
|
||||
return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1)
|
||||
}
|
||||
server := sc[index]
|
||||
url := server.URL
|
||||
|
||||
// go through variables and replace placeholders
|
||||
for name, variable := range server.Variables {
|
||||
if value, ok := variables[name]; ok {
|
||||
found := bool(len(variable.EnumValues) == 0)
|
||||
for _, enumValue := range variable.EnumValues {
|
||||
if value == enumValue {
|
||||
found = true
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues)
|
||||
}
|
||||
url = strings.Replace(url, "{"+name+"}", value, -1)
|
||||
} else {
|
||||
url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1)
|
||||
}
|
||||
}
|
||||
return url, nil
|
||||
}
|
||||
|
||||
// ServerURL returns URL based on server settings
|
||||
func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) {
|
||||
return c.Servers.URL(index, variables)
|
||||
}
|
||||
|
||||
func getServerIndex(ctx context.Context) (int, error) {
|
||||
si := ctx.Value(ContextServerIndex)
|
||||
if si != nil {
|
||||
if index, ok := si.(int); ok {
|
||||
return index, nil
|
||||
}
|
||||
return 0, reportError("Invalid type %T should be int", si)
|
||||
}
|
||||
return 0, nil
|
||||
}
|
||||
|
||||
func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) {
|
||||
osi := ctx.Value(ContextOperationServerIndices)
|
||||
if osi != nil {
|
||||
if operationIndices, ok := osi.(map[string]int); !ok {
|
||||
return 0, reportError("Invalid type %T should be map[string]int", osi)
|
||||
} else {
|
||||
index, ok := operationIndices[endpoint]
|
||||
if ok {
|
||||
return index, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return getServerIndex(ctx)
|
||||
}
|
||||
|
||||
func getServerVariables(ctx context.Context) (map[string]string, error) {
|
||||
sv := ctx.Value(ContextServerVariables)
|
||||
if sv != nil {
|
||||
if variables, ok := sv.(map[string]string); ok {
|
||||
return variables, nil
|
||||
}
|
||||
return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv)
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) {
|
||||
osv := ctx.Value(ContextOperationServerVariables)
|
||||
if osv != nil {
|
||||
if operationVariables, ok := osv.(map[string]map[string]string); !ok {
|
||||
return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv)
|
||||
} else {
|
||||
variables, ok := operationVariables[endpoint]
|
||||
if ok {
|
||||
return variables, nil
|
||||
}
|
||||
}
|
||||
}
|
||||
return getServerVariables(ctx)
|
||||
}
|
||||
|
||||
// ServerURLWithContext returns a new server URL given an endpoint
|
||||
func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) {
|
||||
sc, ok := c.OperationServers[endpoint]
|
||||
if !ok {
|
||||
sc = c.Servers
|
||||
}
|
||||
|
||||
if ctx == nil {
|
||||
return sc.URL(0, nil)
|
||||
}
|
||||
|
||||
index, err := getServerOperationIndex(ctx, endpoint)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
variables, err := getServerOperationVariables(ctx, endpoint)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return sc.URL(index, variables)
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
||||
release_note=$3
|
||||
git_host=$4
|
||||
|
||||
if [ "$git_host" = "" ]; then
|
||||
git_host="github.com"
|
||||
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
||||
fi
|
||||
|
||||
if [ "$git_user_id" = "" ]; then
|
||||
git_user_id="opencloud-eu"
|
||||
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
||||
fi
|
||||
|
||||
if [ "$git_repo_id" = "" ]; then
|
||||
git_repo_id="libre-graph-api-go"
|
||||
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
||||
fi
|
||||
|
||||
if [ "$release_note" = "" ]; then
|
||||
release_note="Minor update"
|
||||
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
||||
fi
|
||||
|
||||
# Initialize the local directory as a Git repository
|
||||
git init
|
||||
|
||||
# Adds the files in the local repository and stages them for commit.
|
||||
git add .
|
||||
|
||||
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
||||
git commit -m "$release_note"
|
||||
|
||||
# Sets the new remote
|
||||
git_remote=$(git remote)
|
||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||
|
||||
if [ "$GIT_TOKEN" = "" ]; then
|
||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
||||
else
|
||||
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
git pull origin master
|
||||
|
||||
# Pushes (Forces) the changes in the local repository up to the remote repository
|
||||
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
||||
git push origin master 2>&1 | grep -v 'To https'
|
||||
+215
@@ -0,0 +1,215 @@
|
||||
/*
|
||||
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 Activity type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Activity{}
|
||||
|
||||
// Activity Represents activity.
|
||||
type Activity struct {
|
||||
// Activity ID.
|
||||
Id string `json:"id"`
|
||||
Times ActivityTimes `json:"times"`
|
||||
Template ActivityTemplate `json:"template"`
|
||||
}
|
||||
|
||||
type _Activity Activity
|
||||
|
||||
// NewActivity instantiates a new Activity object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewActivity(id string, times ActivityTimes, template ActivityTemplate) *Activity {
|
||||
this := Activity{}
|
||||
this.Id = id
|
||||
this.Times = times
|
||||
this.Template = template
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewActivityWithDefaults instantiates a new Activity object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewActivityWithDefaults() *Activity {
|
||||
this := Activity{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetId returns the Id field value
|
||||
func (o *Activity) GetId() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Activity) GetIdOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Id, true
|
||||
}
|
||||
|
||||
// SetId sets field value
|
||||
func (o *Activity) SetId(v string) {
|
||||
o.Id = v
|
||||
}
|
||||
|
||||
// GetTimes returns the Times field value
|
||||
func (o *Activity) GetTimes() ActivityTimes {
|
||||
if o == nil {
|
||||
var ret ActivityTimes
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Times
|
||||
}
|
||||
|
||||
// GetTimesOk returns a tuple with the Times field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Activity) GetTimesOk() (*ActivityTimes, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Times, true
|
||||
}
|
||||
|
||||
// SetTimes sets field value
|
||||
func (o *Activity) SetTimes(v ActivityTimes) {
|
||||
o.Times = v
|
||||
}
|
||||
|
||||
// GetTemplate returns the Template field value
|
||||
func (o *Activity) GetTemplate() ActivityTemplate {
|
||||
if o == nil {
|
||||
var ret ActivityTemplate
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Template
|
||||
}
|
||||
|
||||
// GetTemplateOk returns a tuple with the Template field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Activity) GetTemplateOk() (*ActivityTemplate, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Template, true
|
||||
}
|
||||
|
||||
// SetTemplate sets field value
|
||||
func (o *Activity) SetTemplate(v ActivityTemplate) {
|
||||
o.Template = v
|
||||
}
|
||||
|
||||
func (o Activity) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Activity) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["id"] = o.Id
|
||||
toSerialize["times"] = o.Times
|
||||
toSerialize["template"] = o.Template
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *Activity) UnmarshalJSON(data []byte) (err error) {
|
||||
// This validates that all required properties are included in the JSON object
|
||||
// by unmarshalling the object into a generic map with string keys and checking
|
||||
// that every required field exists as a key in the generic map.
|
||||
requiredProperties := []string{
|
||||
"id",
|
||||
"times",
|
||||
"template",
|
||||
}
|
||||
|
||||
allProperties := make(map[string]interface{})
|
||||
|
||||
err = json.Unmarshal(data, &allProperties)
|
||||
|
||||
if err != nil {
|
||||
return err;
|
||||
}
|
||||
|
||||
for _, requiredProperty := range(requiredProperties) {
|
||||
if _, exists := allProperties[requiredProperty]; !exists {
|
||||
return fmt.Errorf("no value given for required property %v", requiredProperty)
|
||||
}
|
||||
}
|
||||
|
||||
varActivity := _Activity{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varActivity)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = Activity(varActivity)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableActivity struct {
|
||||
value *Activity
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableActivity) Get() *Activity {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableActivity) Set(val *Activity) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableActivity) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableActivity) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableActivity(val *Activity) *NullableActivity {
|
||||
return &NullableActivity{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableActivity) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableActivity) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+196
@@ -0,0 +1,196 @@
|
||||
/*
|
||||
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 ActivityTemplate type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ActivityTemplate{}
|
||||
|
||||
// ActivityTemplate struct for ActivityTemplate
|
||||
type ActivityTemplate struct {
|
||||
// Activity description.
|
||||
Message string `json:"message"`
|
||||
// Activity description variables.
|
||||
Variables map[string]interface{} `json:"variables,omitempty"`
|
||||
}
|
||||
|
||||
type _ActivityTemplate ActivityTemplate
|
||||
|
||||
// NewActivityTemplate instantiates a new ActivityTemplate object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewActivityTemplate(message string) *ActivityTemplate {
|
||||
this := ActivityTemplate{}
|
||||
this.Message = message
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewActivityTemplateWithDefaults instantiates a new ActivityTemplate object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewActivityTemplateWithDefaults() *ActivityTemplate {
|
||||
this := ActivityTemplate{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetMessage returns the Message field value
|
||||
func (o *ActivityTemplate) GetMessage() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Message
|
||||
}
|
||||
|
||||
// GetMessageOk returns a tuple with the Message field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ActivityTemplate) GetMessageOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Message, true
|
||||
}
|
||||
|
||||
// SetMessage sets field value
|
||||
func (o *ActivityTemplate) SetMessage(v string) {
|
||||
o.Message = v
|
||||
}
|
||||
|
||||
// GetVariables returns the Variables field value if set, zero value otherwise.
|
||||
func (o *ActivityTemplate) GetVariables() map[string]interface{} {
|
||||
if o == nil || IsNil(o.Variables) {
|
||||
var ret map[string]interface{}
|
||||
return ret
|
||||
}
|
||||
return o.Variables
|
||||
}
|
||||
|
||||
// GetVariablesOk returns a tuple with the Variables field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ActivityTemplate) GetVariablesOk() (map[string]interface{}, bool) {
|
||||
if o == nil || IsNil(o.Variables) {
|
||||
return map[string]interface{}{}, false
|
||||
}
|
||||
return o.Variables, true
|
||||
}
|
||||
|
||||
// HasVariables returns a boolean if a field has been set.
|
||||
func (o *ActivityTemplate) HasVariables() bool {
|
||||
if o != nil && !IsNil(o.Variables) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetVariables gets a reference to the given map[string]interface{} and assigns it to the Variables field.
|
||||
func (o *ActivityTemplate) SetVariables(v map[string]interface{}) {
|
||||
o.Variables = v
|
||||
}
|
||||
|
||||
func (o ActivityTemplate) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o ActivityTemplate) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["message"] = o.Message
|
||||
if !IsNil(o.Variables) {
|
||||
toSerialize["variables"] = o.Variables
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *ActivityTemplate) UnmarshalJSON(data []byte) (err error) {
|
||||
// This validates that all required properties are included in the JSON object
|
||||
// by unmarshalling the object into a generic map with string keys and checking
|
||||
// that every required field exists as a key in the generic map.
|
||||
requiredProperties := []string{
|
||||
"message",
|
||||
}
|
||||
|
||||
allProperties := make(map[string]interface{})
|
||||
|
||||
err = json.Unmarshal(data, &allProperties)
|
||||
|
||||
if err != nil {
|
||||
return err;
|
||||
}
|
||||
|
||||
for _, requiredProperty := range(requiredProperties) {
|
||||
if _, exists := allProperties[requiredProperty]; !exists {
|
||||
return fmt.Errorf("no value given for required property %v", requiredProperty)
|
||||
}
|
||||
}
|
||||
|
||||
varActivityTemplate := _ActivityTemplate{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varActivityTemplate)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = ActivityTemplate(varActivityTemplate)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableActivityTemplate struct {
|
||||
value *ActivityTemplate
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableActivityTemplate) Get() *ActivityTemplate {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableActivityTemplate) Set(val *ActivityTemplate) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableActivityTemplate) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableActivityTemplate) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableActivityTemplate(val *ActivityTemplate) *NullableActivityTemplate {
|
||||
return &NullableActivityTemplate{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableActivityTemplate) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableActivityTemplate) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+160
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
"bytes"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// checks if the ActivityTimes type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ActivityTimes{}
|
||||
|
||||
// ActivityTimes struct for ActivityTimes
|
||||
type ActivityTimes struct {
|
||||
// Timestamp of the activity.
|
||||
RecordedTime time.Time `json:"recordedTime"`
|
||||
}
|
||||
|
||||
type _ActivityTimes ActivityTimes
|
||||
|
||||
// NewActivityTimes instantiates a new ActivityTimes object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewActivityTimes(recordedTime time.Time) *ActivityTimes {
|
||||
this := ActivityTimes{}
|
||||
this.RecordedTime = recordedTime
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewActivityTimesWithDefaults instantiates a new ActivityTimes object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewActivityTimesWithDefaults() *ActivityTimes {
|
||||
this := ActivityTimes{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetRecordedTime returns the RecordedTime field value
|
||||
func (o *ActivityTimes) GetRecordedTime() time.Time {
|
||||
if o == nil {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.RecordedTime
|
||||
}
|
||||
|
||||
// GetRecordedTimeOk returns a tuple with the RecordedTime field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ActivityTimes) GetRecordedTimeOk() (*time.Time, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.RecordedTime, true
|
||||
}
|
||||
|
||||
// SetRecordedTime sets field value
|
||||
func (o *ActivityTimes) SetRecordedTime(v time.Time) {
|
||||
o.RecordedTime = v
|
||||
}
|
||||
|
||||
func (o ActivityTimes) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o ActivityTimes) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["recordedTime"] = o.RecordedTime
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *ActivityTimes) UnmarshalJSON(data []byte) (err error) {
|
||||
// This validates that all required properties are included in the JSON object
|
||||
// by unmarshalling the object into a generic map with string keys and checking
|
||||
// that every required field exists as a key in the generic map.
|
||||
requiredProperties := []string{
|
||||
"recordedTime",
|
||||
}
|
||||
|
||||
allProperties := make(map[string]interface{})
|
||||
|
||||
err = json.Unmarshal(data, &allProperties)
|
||||
|
||||
if err != nil {
|
||||
return err;
|
||||
}
|
||||
|
||||
for _, requiredProperty := range(requiredProperties) {
|
||||
if _, exists := allProperties[requiredProperty]; !exists {
|
||||
return fmt.Errorf("no value given for required property %v", requiredProperty)
|
||||
}
|
||||
}
|
||||
|
||||
varActivityTimes := _ActivityTimes{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varActivityTimes)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = ActivityTimes(varActivityTimes)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableActivityTimes struct {
|
||||
value *ActivityTimes
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableActivityTimes) Get() *ActivityTimes {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableActivityTimes) Set(val *ActivityTimes) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableActivityTimes) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableActivityTimes) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableActivityTimes(val *ActivityTimes) *NullableActivityTimes {
|
||||
return &NullableActivityTimes{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableActivityTimes) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableActivityTimes) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+290
@@ -0,0 +1,290 @@
|
||||
/*
|
||||
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 AppRole type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &AppRole{}
|
||||
|
||||
// AppRole struct for AppRole
|
||||
type AppRole struct {
|
||||
// Specifies whether this app role can be assigned to users and groups (by setting to ['User']), to other application's (by setting to ['Application'], or both (by setting to ['User', 'Application']). App roles supporting assignment to other applications' service principals are also known as application permissions. The 'Application' value is only supported for app roles defined on application entities.
|
||||
AllowedMemberTypes []string `json:"allowedMemberTypes,omitempty"`
|
||||
// The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences.
|
||||
Description NullableString `json:"description,omitempty"`
|
||||
// Display name for the permission that appears in the app role assignment and consent experiences.
|
||||
DisplayName NullableString `json:"displayName,omitempty"`
|
||||
// Unique role identifier inside the appRoles collection. When creating a new app role, a new GUID identifier must be provided.
|
||||
Id string `json:"id" validate:"regexp=^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"`
|
||||
}
|
||||
|
||||
type _AppRole AppRole
|
||||
|
||||
// NewAppRole instantiates a new AppRole 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 NewAppRole(id string) *AppRole {
|
||||
this := AppRole{}
|
||||
this.Id = id
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewAppRoleWithDefaults instantiates a new AppRole 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 NewAppRoleWithDefaults() *AppRole {
|
||||
this := AppRole{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetAllowedMemberTypes returns the AllowedMemberTypes field value if set, zero value otherwise.
|
||||
func (o *AppRole) GetAllowedMemberTypes() []string {
|
||||
if o == nil || IsNil(o.AllowedMemberTypes) {
|
||||
var ret []string
|
||||
return ret
|
||||
}
|
||||
return o.AllowedMemberTypes
|
||||
}
|
||||
|
||||
// GetAllowedMemberTypesOk returns a tuple with the AllowedMemberTypes field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AppRole) GetAllowedMemberTypesOk() ([]string, bool) {
|
||||
if o == nil || IsNil(o.AllowedMemberTypes) {
|
||||
return nil, false
|
||||
}
|
||||
return o.AllowedMemberTypes, true
|
||||
}
|
||||
|
||||
// HasAllowedMemberTypes returns a boolean if a field has been set.
|
||||
func (o *AppRole) HasAllowedMemberTypes() bool {
|
||||
if o != nil && !IsNil(o.AllowedMemberTypes) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetAllowedMemberTypes gets a reference to the given []string and assigns it to the AllowedMemberTypes field.
|
||||
func (o *AppRole) SetAllowedMemberTypes(v []string) {
|
||||
o.AllowedMemberTypes = v
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *AppRole) GetDescription() string {
|
||||
if o == nil || IsNil(o.Description.Get()) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Description.Get()
|
||||
}
|
||||
|
||||
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *AppRole) GetDescriptionOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.Description.Get(), o.Description.IsSet()
|
||||
}
|
||||
|
||||
// HasDescription returns a boolean if a field has been set.
|
||||
func (o *AppRole) HasDescription() bool {
|
||||
if o != nil && o.Description.IsSet() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDescription gets a reference to the given NullableString and assigns it to the Description field.
|
||||
func (o *AppRole) SetDescription(v string) {
|
||||
o.Description.Set(&v)
|
||||
}
|
||||
// SetDescriptionNil sets the value for Description to be an explicit nil
|
||||
func (o *AppRole) SetDescriptionNil() {
|
||||
o.Description.Set(nil)
|
||||
}
|
||||
|
||||
// UnsetDescription ensures that no value is present for Description, not even an explicit nil
|
||||
func (o *AppRole) UnsetDescription() {
|
||||
o.Description.Unset()
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *AppRole) GetDisplayName() string {
|
||||
if o == nil || IsNil(o.DisplayName.Get()) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DisplayName.Get()
|
||||
}
|
||||
|
||||
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *AppRole) GetDisplayNameOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.DisplayName.Get(), o.DisplayName.IsSet()
|
||||
}
|
||||
|
||||
// HasDisplayName returns a boolean if a field has been set.
|
||||
func (o *AppRole) HasDisplayName() bool {
|
||||
if o != nil && o.DisplayName.IsSet() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDisplayName gets a reference to the given NullableString and assigns it to the DisplayName field.
|
||||
func (o *AppRole) SetDisplayName(v string) {
|
||||
o.DisplayName.Set(&v)
|
||||
}
|
||||
// SetDisplayNameNil sets the value for DisplayName to be an explicit nil
|
||||
func (o *AppRole) SetDisplayNameNil() {
|
||||
o.DisplayName.Set(nil)
|
||||
}
|
||||
|
||||
// UnsetDisplayName ensures that no value is present for DisplayName, not even an explicit nil
|
||||
func (o *AppRole) UnsetDisplayName() {
|
||||
o.DisplayName.Unset()
|
||||
}
|
||||
|
||||
// GetId returns the Id field value
|
||||
func (o *AppRole) GetId() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AppRole) GetIdOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Id, true
|
||||
}
|
||||
|
||||
// SetId sets field value
|
||||
func (o *AppRole) SetId(v string) {
|
||||
o.Id = v
|
||||
}
|
||||
|
||||
func (o AppRole) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o AppRole) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.AllowedMemberTypes) {
|
||||
toSerialize["allowedMemberTypes"] = o.AllowedMemberTypes
|
||||
}
|
||||
if o.Description.IsSet() {
|
||||
toSerialize["description"] = o.Description.Get()
|
||||
}
|
||||
if o.DisplayName.IsSet() {
|
||||
toSerialize["displayName"] = o.DisplayName.Get()
|
||||
}
|
||||
toSerialize["id"] = o.Id
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *AppRole) UnmarshalJSON(data []byte) (err error) {
|
||||
// This validates that all required properties are included in the JSON object
|
||||
// by unmarshalling the object into a generic map with string keys and checking
|
||||
// that every required field exists as a key in the generic map.
|
||||
requiredProperties := []string{
|
||||
"id",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varAppRole := _AppRole{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varAppRole)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = AppRole(varAppRole)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableAppRole struct {
|
||||
value *AppRole
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableAppRole) Get() *AppRole {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableAppRole) Set(val *AppRole) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableAppRole) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableAppRole) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableAppRole(val *AppRole) *NullableAppRole {
|
||||
return &NullableAppRole{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableAppRole) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableAppRole) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+483
@@ -0,0 +1,483 @@
|
||||
/*
|
||||
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"
|
||||
"time"
|
||||
"bytes"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// checks if the AppRoleAssignment type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &AppRoleAssignment{}
|
||||
|
||||
// AppRoleAssignment struct for AppRoleAssignment
|
||||
type AppRoleAssignment struct {
|
||||
// The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only.
|
||||
Id *string `json:"id,omitempty"`
|
||||
DeletedDateTime *time.Time `json:"deletedDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?([Zz]|[+-][0-9][0-9]:[0-9][0-9])$"`
|
||||
// The identifier (id) for the app role which is assigned to the user. Required on create.
|
||||
AppRoleId string `json:"appRoleId" validate:"regexp=^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"`
|
||||
// The time when the app role assignment was created. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only.
|
||||
CreatedDateTime NullableTime `json:"createdDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$"`
|
||||
// The display name of the user, group, or service principal that was granted the app role assignment. Read-only.
|
||||
PrincipalDisplayName NullableString `json:"principalDisplayName,omitempty"`
|
||||
// The unique identifier (id) for the user, security group, or service principal being granted the app role. Security groups with dynamic memberships are supported. Required on create.
|
||||
PrincipalId NullableString `json:"principalId" validate:"regexp=^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"`
|
||||
// The type of the assigned principal. This can either be User, Group, or ServicePrincipal. Read-only.
|
||||
PrincipalType NullableString `json:"principalType,omitempty"`
|
||||
// The display name of the resource app's service principal to which the assignment is made.
|
||||
ResourceDisplayName NullableString `json:"resourceDisplayName,omitempty"`
|
||||
// The unique identifier (id) for the resource service principal for which the assignment is made. Required on create.
|
||||
ResourceId NullableString `json:"resourceId" validate:"regexp=^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"`
|
||||
}
|
||||
|
||||
type _AppRoleAssignment AppRoleAssignment
|
||||
|
||||
// NewAppRoleAssignment instantiates a new AppRoleAssignment 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 NewAppRoleAssignment(appRoleId string, principalId NullableString, resourceId NullableString) *AppRoleAssignment {
|
||||
this := AppRoleAssignment{}
|
||||
this.AppRoleId = appRoleId
|
||||
this.PrincipalId = principalId
|
||||
this.ResourceId = resourceId
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewAppRoleAssignmentWithDefaults instantiates a new AppRoleAssignment 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 NewAppRoleAssignmentWithDefaults() *AppRoleAssignment {
|
||||
this := AppRoleAssignment{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetId returns the Id field value if set, zero value otherwise.
|
||||
func (o *AppRoleAssignment) GetId() string {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AppRoleAssignment) GetIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Id, true
|
||||
}
|
||||
|
||||
// HasId returns a boolean if a field has been set.
|
||||
func (o *AppRoleAssignment) HasId() bool {
|
||||
if o != nil && !IsNil(o.Id) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetId gets a reference to the given string and assigns it to the Id field.
|
||||
func (o *AppRoleAssignment) SetId(v string) {
|
||||
o.Id = &v
|
||||
}
|
||||
|
||||
// GetDeletedDateTime returns the DeletedDateTime field value if set, zero value otherwise.
|
||||
func (o *AppRoleAssignment) GetDeletedDateTime() time.Time {
|
||||
if o == nil || IsNil(o.DeletedDateTime) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.DeletedDateTime
|
||||
}
|
||||
|
||||
// GetDeletedDateTimeOk returns a tuple with the DeletedDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AppRoleAssignment) GetDeletedDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil || IsNil(o.DeletedDateTime) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DeletedDateTime, true
|
||||
}
|
||||
|
||||
// HasDeletedDateTime returns a boolean if a field has been set.
|
||||
func (o *AppRoleAssignment) HasDeletedDateTime() bool {
|
||||
if o != nil && !IsNil(o.DeletedDateTime) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDeletedDateTime gets a reference to the given time.Time and assigns it to the DeletedDateTime field.
|
||||
func (o *AppRoleAssignment) SetDeletedDateTime(v time.Time) {
|
||||
o.DeletedDateTime = &v
|
||||
}
|
||||
|
||||
// GetAppRoleId returns the AppRoleId field value
|
||||
func (o *AppRoleAssignment) GetAppRoleId() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.AppRoleId
|
||||
}
|
||||
|
||||
// GetAppRoleIdOk returns a tuple with the AppRoleId field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *AppRoleAssignment) GetAppRoleIdOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.AppRoleId, true
|
||||
}
|
||||
|
||||
// SetAppRoleId sets field value
|
||||
func (o *AppRoleAssignment) SetAppRoleId(v string) {
|
||||
o.AppRoleId = v
|
||||
}
|
||||
|
||||
// GetCreatedDateTime returns the CreatedDateTime field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *AppRoleAssignment) GetCreatedDateTime() time.Time {
|
||||
if o == nil || IsNil(o.CreatedDateTime.Get()) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.CreatedDateTime.Get()
|
||||
}
|
||||
|
||||
// GetCreatedDateTimeOk returns a tuple with the CreatedDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *AppRoleAssignment) GetCreatedDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.CreatedDateTime.Get(), o.CreatedDateTime.IsSet()
|
||||
}
|
||||
|
||||
// HasCreatedDateTime returns a boolean if a field has been set.
|
||||
func (o *AppRoleAssignment) HasCreatedDateTime() bool {
|
||||
if o != nil && o.CreatedDateTime.IsSet() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCreatedDateTime gets a reference to the given NullableTime and assigns it to the CreatedDateTime field.
|
||||
func (o *AppRoleAssignment) SetCreatedDateTime(v time.Time) {
|
||||
o.CreatedDateTime.Set(&v)
|
||||
}
|
||||
// SetCreatedDateTimeNil sets the value for CreatedDateTime to be an explicit nil
|
||||
func (o *AppRoleAssignment) SetCreatedDateTimeNil() {
|
||||
o.CreatedDateTime.Set(nil)
|
||||
}
|
||||
|
||||
// UnsetCreatedDateTime ensures that no value is present for CreatedDateTime, not even an explicit nil
|
||||
func (o *AppRoleAssignment) UnsetCreatedDateTime() {
|
||||
o.CreatedDateTime.Unset()
|
||||
}
|
||||
|
||||
// GetPrincipalDisplayName returns the PrincipalDisplayName field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *AppRoleAssignment) GetPrincipalDisplayName() string {
|
||||
if o == nil || IsNil(o.PrincipalDisplayName.Get()) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.PrincipalDisplayName.Get()
|
||||
}
|
||||
|
||||
// GetPrincipalDisplayNameOk returns a tuple with the PrincipalDisplayName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *AppRoleAssignment) GetPrincipalDisplayNameOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.PrincipalDisplayName.Get(), o.PrincipalDisplayName.IsSet()
|
||||
}
|
||||
|
||||
// HasPrincipalDisplayName returns a boolean if a field has been set.
|
||||
func (o *AppRoleAssignment) HasPrincipalDisplayName() bool {
|
||||
if o != nil && o.PrincipalDisplayName.IsSet() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPrincipalDisplayName gets a reference to the given NullableString and assigns it to the PrincipalDisplayName field.
|
||||
func (o *AppRoleAssignment) SetPrincipalDisplayName(v string) {
|
||||
o.PrincipalDisplayName.Set(&v)
|
||||
}
|
||||
// SetPrincipalDisplayNameNil sets the value for PrincipalDisplayName to be an explicit nil
|
||||
func (o *AppRoleAssignment) SetPrincipalDisplayNameNil() {
|
||||
o.PrincipalDisplayName.Set(nil)
|
||||
}
|
||||
|
||||
// UnsetPrincipalDisplayName ensures that no value is present for PrincipalDisplayName, not even an explicit nil
|
||||
func (o *AppRoleAssignment) UnsetPrincipalDisplayName() {
|
||||
o.PrincipalDisplayName.Unset()
|
||||
}
|
||||
|
||||
// GetPrincipalId returns the PrincipalId field value
|
||||
// If the value is explicit nil, the zero value for string will be returned
|
||||
func (o *AppRoleAssignment) GetPrincipalId() string {
|
||||
if o == nil || o.PrincipalId.Get() == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return *o.PrincipalId.Get()
|
||||
}
|
||||
|
||||
// GetPrincipalIdOk returns a tuple with the PrincipalId field value
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *AppRoleAssignment) GetPrincipalIdOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.PrincipalId.Get(), o.PrincipalId.IsSet()
|
||||
}
|
||||
|
||||
// SetPrincipalId sets field value
|
||||
func (o *AppRoleAssignment) SetPrincipalId(v string) {
|
||||
o.PrincipalId.Set(&v)
|
||||
}
|
||||
|
||||
// GetPrincipalType returns the PrincipalType field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *AppRoleAssignment) GetPrincipalType() string {
|
||||
if o == nil || IsNil(o.PrincipalType.Get()) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.PrincipalType.Get()
|
||||
}
|
||||
|
||||
// GetPrincipalTypeOk returns a tuple with the PrincipalType field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *AppRoleAssignment) GetPrincipalTypeOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.PrincipalType.Get(), o.PrincipalType.IsSet()
|
||||
}
|
||||
|
||||
// HasPrincipalType returns a boolean if a field has been set.
|
||||
func (o *AppRoleAssignment) HasPrincipalType() bool {
|
||||
if o != nil && o.PrincipalType.IsSet() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPrincipalType gets a reference to the given NullableString and assigns it to the PrincipalType field.
|
||||
func (o *AppRoleAssignment) SetPrincipalType(v string) {
|
||||
o.PrincipalType.Set(&v)
|
||||
}
|
||||
// SetPrincipalTypeNil sets the value for PrincipalType to be an explicit nil
|
||||
func (o *AppRoleAssignment) SetPrincipalTypeNil() {
|
||||
o.PrincipalType.Set(nil)
|
||||
}
|
||||
|
||||
// UnsetPrincipalType ensures that no value is present for PrincipalType, not even an explicit nil
|
||||
func (o *AppRoleAssignment) UnsetPrincipalType() {
|
||||
o.PrincipalType.Unset()
|
||||
}
|
||||
|
||||
// GetResourceDisplayName returns the ResourceDisplayName field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *AppRoleAssignment) GetResourceDisplayName() string {
|
||||
if o == nil || IsNil(o.ResourceDisplayName.Get()) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.ResourceDisplayName.Get()
|
||||
}
|
||||
|
||||
// GetResourceDisplayNameOk returns a tuple with the ResourceDisplayName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *AppRoleAssignment) GetResourceDisplayNameOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.ResourceDisplayName.Get(), o.ResourceDisplayName.IsSet()
|
||||
}
|
||||
|
||||
// HasResourceDisplayName returns a boolean if a field has been set.
|
||||
func (o *AppRoleAssignment) HasResourceDisplayName() bool {
|
||||
if o != nil && o.ResourceDisplayName.IsSet() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetResourceDisplayName gets a reference to the given NullableString and assigns it to the ResourceDisplayName field.
|
||||
func (o *AppRoleAssignment) SetResourceDisplayName(v string) {
|
||||
o.ResourceDisplayName.Set(&v)
|
||||
}
|
||||
// SetResourceDisplayNameNil sets the value for ResourceDisplayName to be an explicit nil
|
||||
func (o *AppRoleAssignment) SetResourceDisplayNameNil() {
|
||||
o.ResourceDisplayName.Set(nil)
|
||||
}
|
||||
|
||||
// UnsetResourceDisplayName ensures that no value is present for ResourceDisplayName, not even an explicit nil
|
||||
func (o *AppRoleAssignment) UnsetResourceDisplayName() {
|
||||
o.ResourceDisplayName.Unset()
|
||||
}
|
||||
|
||||
// GetResourceId returns the ResourceId field value
|
||||
// If the value is explicit nil, the zero value for string will be returned
|
||||
func (o *AppRoleAssignment) GetResourceId() string {
|
||||
if o == nil || o.ResourceId.Get() == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return *o.ResourceId.Get()
|
||||
}
|
||||
|
||||
// GetResourceIdOk returns a tuple with the ResourceId field value
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *AppRoleAssignment) GetResourceIdOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.ResourceId.Get(), o.ResourceId.IsSet()
|
||||
}
|
||||
|
||||
// SetResourceId sets field value
|
||||
func (o *AppRoleAssignment) SetResourceId(v string) {
|
||||
o.ResourceId.Set(&v)
|
||||
}
|
||||
|
||||
func (o AppRoleAssignment) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o AppRoleAssignment) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Id) {
|
||||
toSerialize["id"] = o.Id
|
||||
}
|
||||
if !IsNil(o.DeletedDateTime) {
|
||||
toSerialize["deletedDateTime"] = o.DeletedDateTime
|
||||
}
|
||||
toSerialize["appRoleId"] = o.AppRoleId
|
||||
if o.CreatedDateTime.IsSet() {
|
||||
toSerialize["createdDateTime"] = o.CreatedDateTime.Get()
|
||||
}
|
||||
if o.PrincipalDisplayName.IsSet() {
|
||||
toSerialize["principalDisplayName"] = o.PrincipalDisplayName.Get()
|
||||
}
|
||||
toSerialize["principalId"] = o.PrincipalId.Get()
|
||||
if o.PrincipalType.IsSet() {
|
||||
toSerialize["principalType"] = o.PrincipalType.Get()
|
||||
}
|
||||
if o.ResourceDisplayName.IsSet() {
|
||||
toSerialize["resourceDisplayName"] = o.ResourceDisplayName.Get()
|
||||
}
|
||||
toSerialize["resourceId"] = o.ResourceId.Get()
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *AppRoleAssignment) 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{
|
||||
"appRoleId",
|
||||
"principalId",
|
||||
"resourceId",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varAppRoleAssignment := _AppRoleAssignment{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varAppRoleAssignment)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = AppRoleAssignment(varAppRoleAssignment)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableAppRoleAssignment struct {
|
||||
value *AppRoleAssignment
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableAppRoleAssignment) Get() *AppRoleAssignment {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableAppRoleAssignment) Set(val *AppRoleAssignment) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableAppRoleAssignment) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableAppRoleAssignment) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableAppRoleAssignment(val *AppRoleAssignment) *NullableAppRoleAssignment {
|
||||
return &NullableAppRoleAssignment{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableAppRoleAssignment) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableAppRoleAssignment) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+243
@@ -0,0 +1,243 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"bytes"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// checks if the Application type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Application{}
|
||||
|
||||
// Application struct for Application
|
||||
type Application struct {
|
||||
// The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only.
|
||||
Id string `json:"id"`
|
||||
// The collection of roles defined for the application. With app role assignments, these roles can be assigned to users, groups, or service principals associated with other applications. Not nullable.
|
||||
AppRoles []AppRole `json:"appRoles,omitempty"`
|
||||
// The display name for the application.
|
||||
DisplayName NullableString `json:"displayName,omitempty"`
|
||||
}
|
||||
|
||||
type _Application Application
|
||||
|
||||
// NewApplication instantiates a new Application 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 NewApplication(id string) *Application {
|
||||
this := Application{}
|
||||
this.Id = id
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewApplicationWithDefaults instantiates a new Application 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 NewApplicationWithDefaults() *Application {
|
||||
this := Application{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetId returns the Id field value
|
||||
func (o *Application) GetId() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Application) GetIdOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Id, true
|
||||
}
|
||||
|
||||
// SetId sets field value
|
||||
func (o *Application) SetId(v string) {
|
||||
o.Id = v
|
||||
}
|
||||
|
||||
// GetAppRoles returns the AppRoles field value if set, zero value otherwise.
|
||||
func (o *Application) GetAppRoles() []AppRole {
|
||||
if o == nil || IsNil(o.AppRoles) {
|
||||
var ret []AppRole
|
||||
return ret
|
||||
}
|
||||
return o.AppRoles
|
||||
}
|
||||
|
||||
// GetAppRolesOk returns a tuple with the AppRoles field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Application) GetAppRolesOk() ([]AppRole, bool) {
|
||||
if o == nil || IsNil(o.AppRoles) {
|
||||
return nil, false
|
||||
}
|
||||
return o.AppRoles, true
|
||||
}
|
||||
|
||||
// HasAppRoles returns a boolean if a field has been set.
|
||||
func (o *Application) HasAppRoles() bool {
|
||||
if o != nil && !IsNil(o.AppRoles) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetAppRoles gets a reference to the given []AppRole and assigns it to the AppRoles field.
|
||||
func (o *Application) SetAppRoles(v []AppRole) {
|
||||
o.AppRoles = v
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *Application) GetDisplayName() string {
|
||||
if o == nil || IsNil(o.DisplayName.Get()) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DisplayName.Get()
|
||||
}
|
||||
|
||||
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *Application) GetDisplayNameOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.DisplayName.Get(), o.DisplayName.IsSet()
|
||||
}
|
||||
|
||||
// HasDisplayName returns a boolean if a field has been set.
|
||||
func (o *Application) HasDisplayName() bool {
|
||||
if o != nil && o.DisplayName.IsSet() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDisplayName gets a reference to the given NullableString and assigns it to the DisplayName field.
|
||||
func (o *Application) SetDisplayName(v string) {
|
||||
o.DisplayName.Set(&v)
|
||||
}
|
||||
// SetDisplayNameNil sets the value for DisplayName to be an explicit nil
|
||||
func (o *Application) SetDisplayNameNil() {
|
||||
o.DisplayName.Set(nil)
|
||||
}
|
||||
|
||||
// UnsetDisplayName ensures that no value is present for DisplayName, not even an explicit nil
|
||||
func (o *Application) UnsetDisplayName() {
|
||||
o.DisplayName.Unset()
|
||||
}
|
||||
|
||||
func (o Application) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Application) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["id"] = o.Id
|
||||
if !IsNil(o.AppRoles) {
|
||||
toSerialize["appRoles"] = o.AppRoles
|
||||
}
|
||||
if o.DisplayName.IsSet() {
|
||||
toSerialize["displayName"] = o.DisplayName.Get()
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *Application) UnmarshalJSON(data []byte) (err error) {
|
||||
// This validates that all required properties are included in the JSON object
|
||||
// by unmarshalling the object into a generic map with string keys and checking
|
||||
// that every required field exists as a key in the generic map.
|
||||
requiredProperties := []string{
|
||||
"id",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varApplication := _Application{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varApplication)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = Application(varApplication)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableApplication struct {
|
||||
value *Application
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableApplication) Get() *Application {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableApplication) Set(val *Application) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableApplication) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableApplication) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableApplication(val *Application) *NullableApplication {
|
||||
return &NullableApplication{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableApplication) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableApplication) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+682
@@ -0,0 +1,682 @@
|
||||
/*
|
||||
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 Audio type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Audio{}
|
||||
|
||||
// Audio The Audio resource groups audio-related properties on an item into a single structure. If a DriveItem has a non-null audio facet, the item represents an audio file. The properties of the Audio resource are populated by extracting metadata from the file.
|
||||
type Audio struct {
|
||||
// The title of the album for this audio file.
|
||||
Album *string `json:"album,omitempty"`
|
||||
// The artist named on the album for the audio file.
|
||||
AlbumArtist *string `json:"albumArtist,omitempty"`
|
||||
// The performing artist for the audio file.
|
||||
Artist *string `json:"artist,omitempty"`
|
||||
// Bitrate expressed in kbps.
|
||||
Bitrate *int64 `json:"bitrate,omitempty"`
|
||||
// The name of the composer of the audio file.
|
||||
Composers *string `json:"composers,omitempty"`
|
||||
// Copyright information for the audio file.
|
||||
Copyright *string `json:"copyright,omitempty"`
|
||||
// The number of the disc this audio file came from.
|
||||
Disc *int32 `json:"disc,omitempty"`
|
||||
// The total number of discs in this album.
|
||||
DiscCount *int32 `json:"discCount,omitempty"`
|
||||
// Duration of the audio file, expressed in milliseconds
|
||||
Duration *int64 `json:"duration,omitempty"`
|
||||
// The genre of this audio file.
|
||||
Genre *string `json:"genre,omitempty"`
|
||||
// Indicates if the file is protected with digital rights management.
|
||||
HasDrm *bool `json:"hasDrm,omitempty"`
|
||||
// Indicates if the file is encoded with a variable bitrate.
|
||||
IsVariableBitrate *bool `json:"isVariableBitrate,omitempty"`
|
||||
// The title of the audio file.
|
||||
Title *string `json:"title,omitempty"`
|
||||
// The number of the track on the original disc for this audio file.
|
||||
Track *int32 `json:"track,omitempty"`
|
||||
// The total number of tracks on the original disc for this audio file.
|
||||
TrackCount *int32 `json:"trackCount,omitempty"`
|
||||
// The year the audio file was recorded.
|
||||
Year *int32 `json:"year,omitempty"`
|
||||
}
|
||||
|
||||
// NewAudio instantiates a new Audio object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewAudio() *Audio {
|
||||
this := Audio{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewAudioWithDefaults instantiates a new Audio object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewAudioWithDefaults() *Audio {
|
||||
this := Audio{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetAlbum returns the Album field value if set, zero value otherwise.
|
||||
func (o *Audio) GetAlbum() string {
|
||||
if o == nil || IsNil(o.Album) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Album
|
||||
}
|
||||
|
||||
// GetAlbumOk returns a tuple with the Album field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetAlbumOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Album) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Album, true
|
||||
}
|
||||
|
||||
// HasAlbum returns a boolean if a field has been set.
|
||||
func (o *Audio) HasAlbum() bool {
|
||||
if o != nil && !IsNil(o.Album) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetAlbum gets a reference to the given string and assigns it to the Album field.
|
||||
func (o *Audio) SetAlbum(v string) {
|
||||
o.Album = &v
|
||||
}
|
||||
|
||||
// GetAlbumArtist returns the AlbumArtist field value if set, zero value otherwise.
|
||||
func (o *Audio) GetAlbumArtist() string {
|
||||
if o == nil || IsNil(o.AlbumArtist) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.AlbumArtist
|
||||
}
|
||||
|
||||
// GetAlbumArtistOk returns a tuple with the AlbumArtist field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetAlbumArtistOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.AlbumArtist) {
|
||||
return nil, false
|
||||
}
|
||||
return o.AlbumArtist, true
|
||||
}
|
||||
|
||||
// HasAlbumArtist returns a boolean if a field has been set.
|
||||
func (o *Audio) HasAlbumArtist() bool {
|
||||
if o != nil && !IsNil(o.AlbumArtist) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetAlbumArtist gets a reference to the given string and assigns it to the AlbumArtist field.
|
||||
func (o *Audio) SetAlbumArtist(v string) {
|
||||
o.AlbumArtist = &v
|
||||
}
|
||||
|
||||
// GetArtist returns the Artist field value if set, zero value otherwise.
|
||||
func (o *Audio) GetArtist() string {
|
||||
if o == nil || IsNil(o.Artist) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Artist
|
||||
}
|
||||
|
||||
// GetArtistOk returns a tuple with the Artist field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetArtistOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Artist) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Artist, true
|
||||
}
|
||||
|
||||
// HasArtist returns a boolean if a field has been set.
|
||||
func (o *Audio) HasArtist() bool {
|
||||
if o != nil && !IsNil(o.Artist) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetArtist gets a reference to the given string and assigns it to the Artist field.
|
||||
func (o *Audio) SetArtist(v string) {
|
||||
o.Artist = &v
|
||||
}
|
||||
|
||||
// GetBitrate returns the Bitrate field value if set, zero value otherwise.
|
||||
func (o *Audio) GetBitrate() int64 {
|
||||
if o == nil || IsNil(o.Bitrate) {
|
||||
var ret int64
|
||||
return ret
|
||||
}
|
||||
return *o.Bitrate
|
||||
}
|
||||
|
||||
// GetBitrateOk returns a tuple with the Bitrate field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetBitrateOk() (*int64, bool) {
|
||||
if o == nil || IsNil(o.Bitrate) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Bitrate, true
|
||||
}
|
||||
|
||||
// HasBitrate returns a boolean if a field has been set.
|
||||
func (o *Audio) HasBitrate() bool {
|
||||
if o != nil && !IsNil(o.Bitrate) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetBitrate gets a reference to the given int64 and assigns it to the Bitrate field.
|
||||
func (o *Audio) SetBitrate(v int64) {
|
||||
o.Bitrate = &v
|
||||
}
|
||||
|
||||
// GetComposers returns the Composers field value if set, zero value otherwise.
|
||||
func (o *Audio) GetComposers() string {
|
||||
if o == nil || IsNil(o.Composers) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Composers
|
||||
}
|
||||
|
||||
// GetComposersOk returns a tuple with the Composers field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetComposersOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Composers) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Composers, true
|
||||
}
|
||||
|
||||
// HasComposers returns a boolean if a field has been set.
|
||||
func (o *Audio) HasComposers() bool {
|
||||
if o != nil && !IsNil(o.Composers) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetComposers gets a reference to the given string and assigns it to the Composers field.
|
||||
func (o *Audio) SetComposers(v string) {
|
||||
o.Composers = &v
|
||||
}
|
||||
|
||||
// GetCopyright returns the Copyright field value if set, zero value otherwise.
|
||||
func (o *Audio) GetCopyright() string {
|
||||
if o == nil || IsNil(o.Copyright) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Copyright
|
||||
}
|
||||
|
||||
// GetCopyrightOk returns a tuple with the Copyright field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetCopyrightOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Copyright) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Copyright, true
|
||||
}
|
||||
|
||||
// HasCopyright returns a boolean if a field has been set.
|
||||
func (o *Audio) HasCopyright() bool {
|
||||
if o != nil && !IsNil(o.Copyright) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCopyright gets a reference to the given string and assigns it to the Copyright field.
|
||||
func (o *Audio) SetCopyright(v string) {
|
||||
o.Copyright = &v
|
||||
}
|
||||
|
||||
// GetDisc returns the Disc field value if set, zero value otherwise.
|
||||
func (o *Audio) GetDisc() int32 {
|
||||
if o == nil || IsNil(o.Disc) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.Disc
|
||||
}
|
||||
|
||||
// GetDiscOk returns a tuple with the Disc field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetDiscOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.Disc) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Disc, true
|
||||
}
|
||||
|
||||
// HasDisc returns a boolean if a field has been set.
|
||||
func (o *Audio) HasDisc() bool {
|
||||
if o != nil && !IsNil(o.Disc) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDisc gets a reference to the given int32 and assigns it to the Disc field.
|
||||
func (o *Audio) SetDisc(v int32) {
|
||||
o.Disc = &v
|
||||
}
|
||||
|
||||
// GetDiscCount returns the DiscCount field value if set, zero value otherwise.
|
||||
func (o *Audio) GetDiscCount() int32 {
|
||||
if o == nil || IsNil(o.DiscCount) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.DiscCount
|
||||
}
|
||||
|
||||
// GetDiscCountOk returns a tuple with the DiscCount field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetDiscCountOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.DiscCount) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DiscCount, true
|
||||
}
|
||||
|
||||
// HasDiscCount returns a boolean if a field has been set.
|
||||
func (o *Audio) HasDiscCount() bool {
|
||||
if o != nil && !IsNil(o.DiscCount) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDiscCount gets a reference to the given int32 and assigns it to the DiscCount field.
|
||||
func (o *Audio) SetDiscCount(v int32) {
|
||||
o.DiscCount = &v
|
||||
}
|
||||
|
||||
// GetDuration returns the Duration field value if set, zero value otherwise.
|
||||
func (o *Audio) GetDuration() int64 {
|
||||
if o == nil || IsNil(o.Duration) {
|
||||
var ret int64
|
||||
return ret
|
||||
}
|
||||
return *o.Duration
|
||||
}
|
||||
|
||||
// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetDurationOk() (*int64, bool) {
|
||||
if o == nil || IsNil(o.Duration) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Duration, true
|
||||
}
|
||||
|
||||
// HasDuration returns a boolean if a field has been set.
|
||||
func (o *Audio) HasDuration() bool {
|
||||
if o != nil && !IsNil(o.Duration) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDuration gets a reference to the given int64 and assigns it to the Duration field.
|
||||
func (o *Audio) SetDuration(v int64) {
|
||||
o.Duration = &v
|
||||
}
|
||||
|
||||
// GetGenre returns the Genre field value if set, zero value otherwise.
|
||||
func (o *Audio) GetGenre() string {
|
||||
if o == nil || IsNil(o.Genre) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Genre
|
||||
}
|
||||
|
||||
// GetGenreOk returns a tuple with the Genre field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetGenreOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Genre) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Genre, true
|
||||
}
|
||||
|
||||
// HasGenre returns a boolean if a field has been set.
|
||||
func (o *Audio) HasGenre() bool {
|
||||
if o != nil && !IsNil(o.Genre) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetGenre gets a reference to the given string and assigns it to the Genre field.
|
||||
func (o *Audio) SetGenre(v string) {
|
||||
o.Genre = &v
|
||||
}
|
||||
|
||||
// GetHasDrm returns the HasDrm field value if set, zero value otherwise.
|
||||
func (o *Audio) GetHasDrm() bool {
|
||||
if o == nil || IsNil(o.HasDrm) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.HasDrm
|
||||
}
|
||||
|
||||
// GetHasDrmOk returns a tuple with the HasDrm field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetHasDrmOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.HasDrm) {
|
||||
return nil, false
|
||||
}
|
||||
return o.HasDrm, true
|
||||
}
|
||||
|
||||
// HasHasDrm returns a boolean if a field has been set.
|
||||
func (o *Audio) HasHasDrm() bool {
|
||||
if o != nil && !IsNil(o.HasDrm) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetHasDrm gets a reference to the given bool and assigns it to the HasDrm field.
|
||||
func (o *Audio) SetHasDrm(v bool) {
|
||||
o.HasDrm = &v
|
||||
}
|
||||
|
||||
// GetIsVariableBitrate returns the IsVariableBitrate field value if set, zero value otherwise.
|
||||
func (o *Audio) GetIsVariableBitrate() bool {
|
||||
if o == nil || IsNil(o.IsVariableBitrate) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.IsVariableBitrate
|
||||
}
|
||||
|
||||
// GetIsVariableBitrateOk returns a tuple with the IsVariableBitrate field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetIsVariableBitrateOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.IsVariableBitrate) {
|
||||
return nil, false
|
||||
}
|
||||
return o.IsVariableBitrate, true
|
||||
}
|
||||
|
||||
// HasIsVariableBitrate returns a boolean if a field has been set.
|
||||
func (o *Audio) HasIsVariableBitrate() bool {
|
||||
if o != nil && !IsNil(o.IsVariableBitrate) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIsVariableBitrate gets a reference to the given bool and assigns it to the IsVariableBitrate field.
|
||||
func (o *Audio) SetIsVariableBitrate(v bool) {
|
||||
o.IsVariableBitrate = &v
|
||||
}
|
||||
|
||||
// GetTitle returns the Title field value if set, zero value otherwise.
|
||||
func (o *Audio) GetTitle() string {
|
||||
if o == nil || IsNil(o.Title) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Title
|
||||
}
|
||||
|
||||
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetTitleOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Title) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Title, true
|
||||
}
|
||||
|
||||
// HasTitle returns a boolean if a field has been set.
|
||||
func (o *Audio) HasTitle() bool {
|
||||
if o != nil && !IsNil(o.Title) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetTitle gets a reference to the given string and assigns it to the Title field.
|
||||
func (o *Audio) SetTitle(v string) {
|
||||
o.Title = &v
|
||||
}
|
||||
|
||||
// GetTrack returns the Track field value if set, zero value otherwise.
|
||||
func (o *Audio) GetTrack() int32 {
|
||||
if o == nil || IsNil(o.Track) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.Track
|
||||
}
|
||||
|
||||
// GetTrackOk returns a tuple with the Track field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetTrackOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.Track) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Track, true
|
||||
}
|
||||
|
||||
// HasTrack returns a boolean if a field has been set.
|
||||
func (o *Audio) HasTrack() bool {
|
||||
if o != nil && !IsNil(o.Track) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetTrack gets a reference to the given int32 and assigns it to the Track field.
|
||||
func (o *Audio) SetTrack(v int32) {
|
||||
o.Track = &v
|
||||
}
|
||||
|
||||
// GetTrackCount returns the TrackCount field value if set, zero value otherwise.
|
||||
func (o *Audio) GetTrackCount() int32 {
|
||||
if o == nil || IsNil(o.TrackCount) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.TrackCount
|
||||
}
|
||||
|
||||
// GetTrackCountOk returns a tuple with the TrackCount field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetTrackCountOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.TrackCount) {
|
||||
return nil, false
|
||||
}
|
||||
return o.TrackCount, true
|
||||
}
|
||||
|
||||
// HasTrackCount returns a boolean if a field has been set.
|
||||
func (o *Audio) HasTrackCount() bool {
|
||||
if o != nil && !IsNil(o.TrackCount) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetTrackCount gets a reference to the given int32 and assigns it to the TrackCount field.
|
||||
func (o *Audio) SetTrackCount(v int32) {
|
||||
o.TrackCount = &v
|
||||
}
|
||||
|
||||
// GetYear returns the Year field value if set, zero value otherwise.
|
||||
func (o *Audio) GetYear() int32 {
|
||||
if o == nil || IsNil(o.Year) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.Year
|
||||
}
|
||||
|
||||
// GetYearOk returns a tuple with the Year field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Audio) GetYearOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.Year) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Year, true
|
||||
}
|
||||
|
||||
// HasYear returns a boolean if a field has been set.
|
||||
func (o *Audio) HasYear() bool {
|
||||
if o != nil && !IsNil(o.Year) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetYear gets a reference to the given int32 and assigns it to the Year field.
|
||||
func (o *Audio) SetYear(v int32) {
|
||||
o.Year = &v
|
||||
}
|
||||
|
||||
func (o Audio) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Audio) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Album) {
|
||||
toSerialize["album"] = o.Album
|
||||
}
|
||||
if !IsNil(o.AlbumArtist) {
|
||||
toSerialize["albumArtist"] = o.AlbumArtist
|
||||
}
|
||||
if !IsNil(o.Artist) {
|
||||
toSerialize["artist"] = o.Artist
|
||||
}
|
||||
if !IsNil(o.Bitrate) {
|
||||
toSerialize["bitrate"] = o.Bitrate
|
||||
}
|
||||
if !IsNil(o.Composers) {
|
||||
toSerialize["composers"] = o.Composers
|
||||
}
|
||||
if !IsNil(o.Copyright) {
|
||||
toSerialize["copyright"] = o.Copyright
|
||||
}
|
||||
if !IsNil(o.Disc) {
|
||||
toSerialize["disc"] = o.Disc
|
||||
}
|
||||
if !IsNil(o.DiscCount) {
|
||||
toSerialize["discCount"] = o.DiscCount
|
||||
}
|
||||
if !IsNil(o.Duration) {
|
||||
toSerialize["duration"] = o.Duration
|
||||
}
|
||||
if !IsNil(o.Genre) {
|
||||
toSerialize["genre"] = o.Genre
|
||||
}
|
||||
if !IsNil(o.HasDrm) {
|
||||
toSerialize["hasDrm"] = o.HasDrm
|
||||
}
|
||||
if !IsNil(o.IsVariableBitrate) {
|
||||
toSerialize["isVariableBitrate"] = o.IsVariableBitrate
|
||||
}
|
||||
if !IsNil(o.Title) {
|
||||
toSerialize["title"] = o.Title
|
||||
}
|
||||
if !IsNil(o.Track) {
|
||||
toSerialize["track"] = o.Track
|
||||
}
|
||||
if !IsNil(o.TrackCount) {
|
||||
toSerialize["trackCount"] = o.TrackCount
|
||||
}
|
||||
if !IsNil(o.Year) {
|
||||
toSerialize["year"] = o.Year
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableAudio struct {
|
||||
value *Audio
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableAudio) Get() *Audio {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableAudio) Set(val *Audio) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableAudio) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableAudio) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableAudio(val *Audio) *NullableAudio {
|
||||
return &NullableAudio{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableAudio) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableAudio) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 ClassMemberReference type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ClassMemberReference{}
|
||||
|
||||
// ClassMemberReference struct for ClassMemberReference
|
||||
type ClassMemberReference struct {
|
||||
OdataId *string `json:"@odata.id,omitempty"`
|
||||
}
|
||||
|
||||
// NewClassMemberReference instantiates a new ClassMemberReference 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 NewClassMemberReference() *ClassMemberReference {
|
||||
this := ClassMemberReference{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewClassMemberReferenceWithDefaults instantiates a new ClassMemberReference 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 NewClassMemberReferenceWithDefaults() *ClassMemberReference {
|
||||
this := ClassMemberReference{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetOdataId returns the OdataId field value if set, zero value otherwise.
|
||||
func (o *ClassMemberReference) GetOdataId() string {
|
||||
if o == nil || IsNil(o.OdataId) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.OdataId
|
||||
}
|
||||
|
||||
// GetOdataIdOk returns a tuple with the OdataId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ClassMemberReference) GetOdataIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.OdataId) {
|
||||
return nil, false
|
||||
}
|
||||
return o.OdataId, true
|
||||
}
|
||||
|
||||
// HasOdataId returns a boolean if a field has been set.
|
||||
func (o *ClassMemberReference) HasOdataId() bool {
|
||||
if o != nil && !IsNil(o.OdataId) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOdataId gets a reference to the given string and assigns it to the OdataId field.
|
||||
func (o *ClassMemberReference) SetOdataId(v string) {
|
||||
o.OdataId = &v
|
||||
}
|
||||
|
||||
func (o ClassMemberReference) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o ClassMemberReference) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.OdataId) {
|
||||
toSerialize["@odata.id"] = o.OdataId
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableClassMemberReference struct {
|
||||
value *ClassMemberReference
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableClassMemberReference) Get() *ClassMemberReference {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableClassMemberReference) Set(val *ClassMemberReference) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableClassMemberReference) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableClassMemberReference) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableClassMemberReference(val *ClassMemberReference) *NullableClassMemberReference {
|
||||
return &NullableClassMemberReference{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableClassMemberReference) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableClassMemberReference) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 ClassReference type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ClassReference{}
|
||||
|
||||
// ClassReference struct for ClassReference
|
||||
type ClassReference struct {
|
||||
OdataId *string `json:"@odata.id,omitempty"`
|
||||
}
|
||||
|
||||
// NewClassReference instantiates a new ClassReference 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 NewClassReference() *ClassReference {
|
||||
this := ClassReference{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewClassReferenceWithDefaults instantiates a new ClassReference 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 NewClassReferenceWithDefaults() *ClassReference {
|
||||
this := ClassReference{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetOdataId returns the OdataId field value if set, zero value otherwise.
|
||||
func (o *ClassReference) GetOdataId() string {
|
||||
if o == nil || IsNil(o.OdataId) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.OdataId
|
||||
}
|
||||
|
||||
// GetOdataIdOk returns a tuple with the OdataId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ClassReference) GetOdataIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.OdataId) {
|
||||
return nil, false
|
||||
}
|
||||
return o.OdataId, true
|
||||
}
|
||||
|
||||
// HasOdataId returns a boolean if a field has been set.
|
||||
func (o *ClassReference) HasOdataId() bool {
|
||||
if o != nil && !IsNil(o.OdataId) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOdataId gets a reference to the given string and assigns it to the OdataId field.
|
||||
func (o *ClassReference) SetOdataId(v string) {
|
||||
o.OdataId = &v
|
||||
}
|
||||
|
||||
func (o ClassReference) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o ClassReference) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.OdataId) {
|
||||
toSerialize["@odata.id"] = o.OdataId
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableClassReference struct {
|
||||
value *ClassReference
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableClassReference) Get() *ClassReference {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableClassReference) Set(val *ClassReference) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableClassReference) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableClassReference) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableClassReference(val *ClassReference) *NullableClassReference {
|
||||
return &NullableClassReference{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableClassReference) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableClassReference) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 ClassTeacherReference type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ClassTeacherReference{}
|
||||
|
||||
// ClassTeacherReference struct for ClassTeacherReference
|
||||
type ClassTeacherReference struct {
|
||||
OdataId *string `json:"@odata.id,omitempty"`
|
||||
}
|
||||
|
||||
// NewClassTeacherReference instantiates a new ClassTeacherReference 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 NewClassTeacherReference() *ClassTeacherReference {
|
||||
this := ClassTeacherReference{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewClassTeacherReferenceWithDefaults instantiates a new ClassTeacherReference 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 NewClassTeacherReferenceWithDefaults() *ClassTeacherReference {
|
||||
this := ClassTeacherReference{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetOdataId returns the OdataId field value if set, zero value otherwise.
|
||||
func (o *ClassTeacherReference) GetOdataId() string {
|
||||
if o == nil || IsNil(o.OdataId) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.OdataId
|
||||
}
|
||||
|
||||
// GetOdataIdOk returns a tuple with the OdataId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ClassTeacherReference) GetOdataIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.OdataId) {
|
||||
return nil, false
|
||||
}
|
||||
return o.OdataId, true
|
||||
}
|
||||
|
||||
// HasOdataId returns a boolean if a field has been set.
|
||||
func (o *ClassTeacherReference) HasOdataId() bool {
|
||||
if o != nil && !IsNil(o.OdataId) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOdataId gets a reference to the given string and assigns it to the OdataId field.
|
||||
func (o *ClassTeacherReference) SetOdataId(v string) {
|
||||
o.OdataId = &v
|
||||
}
|
||||
|
||||
func (o ClassTeacherReference) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o ClassTeacherReference) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.OdataId) {
|
||||
toSerialize["@odata.id"] = o.OdataId
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableClassTeacherReference struct {
|
||||
value *ClassTeacherReference
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableClassTeacherReference) Get() *ClassTeacherReference {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableClassTeacherReference) Set(val *ClassTeacherReference) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableClassTeacherReference) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableClassTeacherReference) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableClassTeacherReference(val *ClassTeacherReference) *NullableClassTeacherReference {
|
||||
return &NullableClassTeacherReference{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableClassTeacherReference) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableClassTeacherReference) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 CollectionOfActivities type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfActivities{}
|
||||
|
||||
// CollectionOfActivities struct for CollectionOfActivities
|
||||
type CollectionOfActivities struct {
|
||||
Value []Activity `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfActivities instantiates a new CollectionOfActivities object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewCollectionOfActivities() *CollectionOfActivities {
|
||||
this := CollectionOfActivities{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfActivitiesWithDefaults instantiates a new CollectionOfActivities object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewCollectionOfActivitiesWithDefaults() *CollectionOfActivities {
|
||||
this := CollectionOfActivities{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfActivities) GetValue() []Activity {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []Activity
|
||||
return ret
|
||||
}
|
||||
return o.Value
|
||||
}
|
||||
|
||||
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CollectionOfActivities) GetValueOk() ([]Activity, bool) {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Value, true
|
||||
}
|
||||
|
||||
// HasValue returns a boolean if a field has been set.
|
||||
func (o *CollectionOfActivities) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []Activity and assigns it to the Value field.
|
||||
func (o *CollectionOfActivities) SetValue(v []Activity) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
func (o CollectionOfActivities) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfActivities) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfActivities struct {
|
||||
value *CollectionOfActivities
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfActivities) Get() *CollectionOfActivities {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfActivities) Set(val *CollectionOfActivities) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfActivities) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfActivities) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfActivities(val *CollectionOfActivities) *NullableCollectionOfActivities {
|
||||
return &NullableCollectionOfActivities{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfActivities) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfActivities) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Server/vendor/github.com/opencloud-eu/libre-graph-api-go/model_collection_of_app_role_assignments.go
Generated
Vendored
+162
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CollectionOfAppRoleAssignments type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfAppRoleAssignments{}
|
||||
|
||||
// CollectionOfAppRoleAssignments struct for CollectionOfAppRoleAssignments
|
||||
type CollectionOfAppRoleAssignments struct {
|
||||
Value []AppRoleAssignment `json:"value,omitempty"`
|
||||
OdataNextLink *string `json:"@odata.nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfAppRoleAssignments instantiates a new CollectionOfAppRoleAssignments 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 NewCollectionOfAppRoleAssignments() *CollectionOfAppRoleAssignments {
|
||||
this := CollectionOfAppRoleAssignments{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfAppRoleAssignmentsWithDefaults instantiates a new CollectionOfAppRoleAssignments 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 NewCollectionOfAppRoleAssignmentsWithDefaults() *CollectionOfAppRoleAssignments {
|
||||
this := CollectionOfAppRoleAssignments{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfAppRoleAssignments) GetValue() []AppRoleAssignment {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []AppRoleAssignment
|
||||
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 *CollectionOfAppRoleAssignments) GetValueOk() ([]AppRoleAssignment, 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 *CollectionOfAppRoleAssignments) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []AppRoleAssignment and assigns it to the Value field.
|
||||
func (o *CollectionOfAppRoleAssignments) SetValue(v []AppRoleAssignment) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
// GetOdataNextLink returns the OdataNextLink field value if set, zero value otherwise.
|
||||
func (o *CollectionOfAppRoleAssignments) GetOdataNextLink() string {
|
||||
if o == nil || IsNil(o.OdataNextLink) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.OdataNextLink
|
||||
}
|
||||
|
||||
// GetOdataNextLinkOk returns a tuple with the OdataNextLink field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CollectionOfAppRoleAssignments) GetOdataNextLinkOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.OdataNextLink) {
|
||||
return nil, false
|
||||
}
|
||||
return o.OdataNextLink, true
|
||||
}
|
||||
|
||||
// HasOdataNextLink returns a boolean if a field has been set.
|
||||
func (o *CollectionOfAppRoleAssignments) HasOdataNextLink() bool {
|
||||
if o != nil && !IsNil(o.OdataNextLink) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOdataNextLink gets a reference to the given string and assigns it to the OdataNextLink field.
|
||||
func (o *CollectionOfAppRoleAssignments) SetOdataNextLink(v string) {
|
||||
o.OdataNextLink = &v
|
||||
}
|
||||
|
||||
func (o CollectionOfAppRoleAssignments) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfAppRoleAssignments) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
if !IsNil(o.OdataNextLink) {
|
||||
toSerialize["@odata.nextLink"] = o.OdataNextLink
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfAppRoleAssignments struct {
|
||||
value *CollectionOfAppRoleAssignments
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfAppRoleAssignments) Get() *CollectionOfAppRoleAssignments {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfAppRoleAssignments) Set(val *CollectionOfAppRoleAssignments) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfAppRoleAssignments) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfAppRoleAssignments) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfAppRoleAssignments(val *CollectionOfAppRoleAssignments) *NullableCollectionOfAppRoleAssignments {
|
||||
return &NullableCollectionOfAppRoleAssignments{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfAppRoleAssignments) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfAppRoleAssignments) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 CollectionOfApplications type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfApplications{}
|
||||
|
||||
// CollectionOfApplications struct for CollectionOfApplications
|
||||
type CollectionOfApplications struct {
|
||||
Value []Application `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfApplications instantiates a new CollectionOfApplications 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 NewCollectionOfApplications() *CollectionOfApplications {
|
||||
this := CollectionOfApplications{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfApplicationsWithDefaults instantiates a new CollectionOfApplications 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 NewCollectionOfApplicationsWithDefaults() *CollectionOfApplications {
|
||||
this := CollectionOfApplications{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfApplications) GetValue() []Application {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []Application
|
||||
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 *CollectionOfApplications) GetValueOk() ([]Application, 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 *CollectionOfApplications) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []Application and assigns it to the Value field.
|
||||
func (o *CollectionOfApplications) SetValue(v []Application) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
func (o CollectionOfApplications) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfApplications) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfApplications struct {
|
||||
value *CollectionOfApplications
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfApplications) Get() *CollectionOfApplications {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfApplications) Set(val *CollectionOfApplications) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfApplications) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfApplications) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfApplications(val *CollectionOfApplications) *NullableCollectionOfApplications {
|
||||
return &NullableCollectionOfApplications{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfApplications) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfApplications) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 CollectionOfClass type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfClass{}
|
||||
|
||||
// CollectionOfClass struct for CollectionOfClass
|
||||
type CollectionOfClass struct {
|
||||
Value []EducationClass `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfClass instantiates a new CollectionOfClass 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 NewCollectionOfClass() *CollectionOfClass {
|
||||
this := CollectionOfClass{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfClassWithDefaults instantiates a new CollectionOfClass 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 NewCollectionOfClassWithDefaults() *CollectionOfClass {
|
||||
this := CollectionOfClass{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfClass) GetValue() []EducationClass {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []EducationClass
|
||||
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 *CollectionOfClass) GetValueOk() ([]EducationClass, 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 *CollectionOfClass) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []EducationClass and assigns it to the Value field.
|
||||
func (o *CollectionOfClass) SetValue(v []EducationClass) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
func (o CollectionOfClass) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfClass) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfClass struct {
|
||||
value *CollectionOfClass
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfClass) Get() *CollectionOfClass {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfClass) Set(val *CollectionOfClass) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfClass) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfClass) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfClass(val *CollectionOfClass) *NullableCollectionOfClass {
|
||||
return &NullableCollectionOfClass{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfClass) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfClass) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+162
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CollectionOfDriveItems type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfDriveItems{}
|
||||
|
||||
// CollectionOfDriveItems struct for CollectionOfDriveItems
|
||||
type CollectionOfDriveItems struct {
|
||||
Value []DriveItem `json:"value,omitempty"`
|
||||
OdataNextLink *string `json:"@odata.nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfDriveItems instantiates a new CollectionOfDriveItems 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 NewCollectionOfDriveItems() *CollectionOfDriveItems {
|
||||
this := CollectionOfDriveItems{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfDriveItemsWithDefaults instantiates a new CollectionOfDriveItems 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 NewCollectionOfDriveItemsWithDefaults() *CollectionOfDriveItems {
|
||||
this := CollectionOfDriveItems{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfDriveItems) GetValue() []DriveItem {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []DriveItem
|
||||
return ret
|
||||
}
|
||||
return o.Value
|
||||
}
|
||||
|
||||
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CollectionOfDriveItems) GetValueOk() ([]DriveItem, bool) {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Value, true
|
||||
}
|
||||
|
||||
// HasValue returns a boolean if a field has been set.
|
||||
func (o *CollectionOfDriveItems) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []DriveItem and assigns it to the Value field.
|
||||
func (o *CollectionOfDriveItems) SetValue(v []DriveItem) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
// GetOdataNextLink returns the OdataNextLink field value if set, zero value otherwise.
|
||||
func (o *CollectionOfDriveItems) GetOdataNextLink() string {
|
||||
if o == nil || IsNil(o.OdataNextLink) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.OdataNextLink
|
||||
}
|
||||
|
||||
// GetOdataNextLinkOk returns a tuple with the OdataNextLink field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CollectionOfDriveItems) GetOdataNextLinkOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.OdataNextLink) {
|
||||
return nil, false
|
||||
}
|
||||
return o.OdataNextLink, true
|
||||
}
|
||||
|
||||
// HasOdataNextLink returns a boolean if a field has been set.
|
||||
func (o *CollectionOfDriveItems) HasOdataNextLink() bool {
|
||||
if o != nil && !IsNil(o.OdataNextLink) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOdataNextLink gets a reference to the given string and assigns it to the OdataNextLink field.
|
||||
func (o *CollectionOfDriveItems) SetOdataNextLink(v string) {
|
||||
o.OdataNextLink = &v
|
||||
}
|
||||
|
||||
func (o CollectionOfDriveItems) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfDriveItems) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
if !IsNil(o.OdataNextLink) {
|
||||
toSerialize["@odata.nextLink"] = o.OdataNextLink
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfDriveItems struct {
|
||||
value *CollectionOfDriveItems
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfDriveItems) Get() *CollectionOfDriveItems {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfDriveItems) Set(val *CollectionOfDriveItems) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfDriveItems) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfDriveItems) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfDriveItems(val *CollectionOfDriveItems) *NullableCollectionOfDriveItems {
|
||||
return &NullableCollectionOfDriveItems{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfDriveItems) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfDriveItems) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 CollectionOfDriveItems1 type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfDriveItems1{}
|
||||
|
||||
// CollectionOfDriveItems1 struct for CollectionOfDriveItems1
|
||||
type CollectionOfDriveItems1 struct {
|
||||
Value []DriveItem `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfDriveItems1 instantiates a new CollectionOfDriveItems1 object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewCollectionOfDriveItems1() *CollectionOfDriveItems1 {
|
||||
this := CollectionOfDriveItems1{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfDriveItems1WithDefaults instantiates a new CollectionOfDriveItems1 object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewCollectionOfDriveItems1WithDefaults() *CollectionOfDriveItems1 {
|
||||
this := CollectionOfDriveItems1{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfDriveItems1) GetValue() []DriveItem {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []DriveItem
|
||||
return ret
|
||||
}
|
||||
return o.Value
|
||||
}
|
||||
|
||||
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CollectionOfDriveItems1) GetValueOk() ([]DriveItem, bool) {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Value, true
|
||||
}
|
||||
|
||||
// HasValue returns a boolean if a field has been set.
|
||||
func (o *CollectionOfDriveItems1) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []DriveItem and assigns it to the Value field.
|
||||
func (o *CollectionOfDriveItems1) SetValue(v []DriveItem) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
func (o CollectionOfDriveItems1) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfDriveItems1) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfDriveItems1 struct {
|
||||
value *CollectionOfDriveItems1
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfDriveItems1) Get() *CollectionOfDriveItems1 {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfDriveItems1) Set(val *CollectionOfDriveItems1) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfDriveItems1) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfDriveItems1) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfDriveItems1(val *CollectionOfDriveItems1) *NullableCollectionOfDriveItems1 {
|
||||
return &NullableCollectionOfDriveItems1{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfDriveItems1) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfDriveItems1) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+162
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CollectionOfDrives type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfDrives{}
|
||||
|
||||
// CollectionOfDrives struct for CollectionOfDrives
|
||||
type CollectionOfDrives struct {
|
||||
Value []Drive `json:"value,omitempty"`
|
||||
OdataNextLink *string `json:"@odata.nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfDrives instantiates a new CollectionOfDrives 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 NewCollectionOfDrives() *CollectionOfDrives {
|
||||
this := CollectionOfDrives{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfDrivesWithDefaults instantiates a new CollectionOfDrives 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 NewCollectionOfDrivesWithDefaults() *CollectionOfDrives {
|
||||
this := CollectionOfDrives{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfDrives) GetValue() []Drive {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []Drive
|
||||
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 *CollectionOfDrives) GetValueOk() ([]Drive, 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 *CollectionOfDrives) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []Drive and assigns it to the Value field.
|
||||
func (o *CollectionOfDrives) SetValue(v []Drive) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
// GetOdataNextLink returns the OdataNextLink field value if set, zero value otherwise.
|
||||
func (o *CollectionOfDrives) GetOdataNextLink() string {
|
||||
if o == nil || IsNil(o.OdataNextLink) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.OdataNextLink
|
||||
}
|
||||
|
||||
// GetOdataNextLinkOk returns a tuple with the OdataNextLink field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CollectionOfDrives) GetOdataNextLinkOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.OdataNextLink) {
|
||||
return nil, false
|
||||
}
|
||||
return o.OdataNextLink, true
|
||||
}
|
||||
|
||||
// HasOdataNextLink returns a boolean if a field has been set.
|
||||
func (o *CollectionOfDrives) HasOdataNextLink() bool {
|
||||
if o != nil && !IsNil(o.OdataNextLink) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOdataNextLink gets a reference to the given string and assigns it to the OdataNextLink field.
|
||||
func (o *CollectionOfDrives) SetOdataNextLink(v string) {
|
||||
o.OdataNextLink = &v
|
||||
}
|
||||
|
||||
func (o CollectionOfDrives) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfDrives) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
if !IsNil(o.OdataNextLink) {
|
||||
toSerialize["@odata.nextLink"] = o.OdataNextLink
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfDrives struct {
|
||||
value *CollectionOfDrives
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfDrives) Get() *CollectionOfDrives {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfDrives) Set(val *CollectionOfDrives) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfDrives) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfDrives) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfDrives(val *CollectionOfDrives) *NullableCollectionOfDrives {
|
||||
return &NullableCollectionOfDrives{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfDrives) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfDrives) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 CollectionOfDrives1 type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfDrives1{}
|
||||
|
||||
// CollectionOfDrives1 struct for CollectionOfDrives1
|
||||
type CollectionOfDrives1 struct {
|
||||
Value []Drive `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfDrives1 instantiates a new CollectionOfDrives1 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 NewCollectionOfDrives1() *CollectionOfDrives1 {
|
||||
this := CollectionOfDrives1{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfDrives1WithDefaults instantiates a new CollectionOfDrives1 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 NewCollectionOfDrives1WithDefaults() *CollectionOfDrives1 {
|
||||
this := CollectionOfDrives1{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfDrives1) GetValue() []Drive {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []Drive
|
||||
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 *CollectionOfDrives1) GetValueOk() ([]Drive, 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 *CollectionOfDrives1) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []Drive and assigns it to the Value field.
|
||||
func (o *CollectionOfDrives1) SetValue(v []Drive) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
func (o CollectionOfDrives1) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfDrives1) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfDrives1 struct {
|
||||
value *CollectionOfDrives1
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfDrives1) Get() *CollectionOfDrives1 {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfDrives1) Set(val *CollectionOfDrives1) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfDrives1) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfDrives1) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfDrives1(val *CollectionOfDrives1) *NullableCollectionOfDrives1 {
|
||||
return &NullableCollectionOfDrives1{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfDrives1) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfDrives1) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 CollectionOfEducationClass type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfEducationClass{}
|
||||
|
||||
// CollectionOfEducationClass struct for CollectionOfEducationClass
|
||||
type CollectionOfEducationClass struct {
|
||||
Value []EducationClass `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfEducationClass instantiates a new CollectionOfEducationClass 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 NewCollectionOfEducationClass() *CollectionOfEducationClass {
|
||||
this := CollectionOfEducationClass{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfEducationClassWithDefaults instantiates a new CollectionOfEducationClass 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 NewCollectionOfEducationClassWithDefaults() *CollectionOfEducationClass {
|
||||
this := CollectionOfEducationClass{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfEducationClass) GetValue() []EducationClass {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []EducationClass
|
||||
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 *CollectionOfEducationClass) GetValueOk() ([]EducationClass, 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 *CollectionOfEducationClass) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []EducationClass and assigns it to the Value field.
|
||||
func (o *CollectionOfEducationClass) SetValue(v []EducationClass) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
func (o CollectionOfEducationClass) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfEducationClass) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfEducationClass struct {
|
||||
value *CollectionOfEducationClass
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfEducationClass) Get() *CollectionOfEducationClass {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfEducationClass) Set(val *CollectionOfEducationClass) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfEducationClass) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfEducationClass) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfEducationClass(val *CollectionOfEducationClass) *NullableCollectionOfEducationClass {
|
||||
return &NullableCollectionOfEducationClass{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfEducationClass) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfEducationClass) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 CollectionOfEducationUser type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfEducationUser{}
|
||||
|
||||
// CollectionOfEducationUser struct for CollectionOfEducationUser
|
||||
type CollectionOfEducationUser struct {
|
||||
Value []EducationUser `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfEducationUser instantiates a new CollectionOfEducationUser 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 NewCollectionOfEducationUser() *CollectionOfEducationUser {
|
||||
this := CollectionOfEducationUser{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfEducationUserWithDefaults instantiates a new CollectionOfEducationUser 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 NewCollectionOfEducationUserWithDefaults() *CollectionOfEducationUser {
|
||||
this := CollectionOfEducationUser{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfEducationUser) GetValue() []EducationUser {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []EducationUser
|
||||
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 *CollectionOfEducationUser) GetValueOk() ([]EducationUser, 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 *CollectionOfEducationUser) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []EducationUser and assigns it to the Value field.
|
||||
func (o *CollectionOfEducationUser) SetValue(v []EducationUser) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
func (o CollectionOfEducationUser) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfEducationUser) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfEducationUser struct {
|
||||
value *CollectionOfEducationUser
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfEducationUser) Get() *CollectionOfEducationUser {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfEducationUser) Set(val *CollectionOfEducationUser) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfEducationUser) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfEducationUser) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfEducationUser(val *CollectionOfEducationUser) *NullableCollectionOfEducationUser {
|
||||
return &NullableCollectionOfEducationUser{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfEducationUser) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfEducationUser) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+162
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CollectionOfGroup type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfGroup{}
|
||||
|
||||
// CollectionOfGroup struct for CollectionOfGroup
|
||||
type CollectionOfGroup struct {
|
||||
Value []Group `json:"value,omitempty"`
|
||||
OdataNextLink *string `json:"@odata.nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfGroup instantiates a new CollectionOfGroup 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 NewCollectionOfGroup() *CollectionOfGroup {
|
||||
this := CollectionOfGroup{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfGroupWithDefaults instantiates a new CollectionOfGroup 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 NewCollectionOfGroupWithDefaults() *CollectionOfGroup {
|
||||
this := CollectionOfGroup{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfGroup) GetValue() []Group {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []Group
|
||||
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 *CollectionOfGroup) GetValueOk() ([]Group, 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 *CollectionOfGroup) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []Group and assigns it to the Value field.
|
||||
func (o *CollectionOfGroup) SetValue(v []Group) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
// GetOdataNextLink returns the OdataNextLink field value if set, zero value otherwise.
|
||||
func (o *CollectionOfGroup) GetOdataNextLink() string {
|
||||
if o == nil || IsNil(o.OdataNextLink) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.OdataNextLink
|
||||
}
|
||||
|
||||
// GetOdataNextLinkOk returns a tuple with the OdataNextLink field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CollectionOfGroup) GetOdataNextLinkOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.OdataNextLink) {
|
||||
return nil, false
|
||||
}
|
||||
return o.OdataNextLink, true
|
||||
}
|
||||
|
||||
// HasOdataNextLink returns a boolean if a field has been set.
|
||||
func (o *CollectionOfGroup) HasOdataNextLink() bool {
|
||||
if o != nil && !IsNil(o.OdataNextLink) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOdataNextLink gets a reference to the given string and assigns it to the OdataNextLink field.
|
||||
func (o *CollectionOfGroup) SetOdataNextLink(v string) {
|
||||
o.OdataNextLink = &v
|
||||
}
|
||||
|
||||
func (o CollectionOfGroup) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfGroup) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
if !IsNil(o.OdataNextLink) {
|
||||
toSerialize["@odata.nextLink"] = o.OdataNextLink
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfGroup struct {
|
||||
value *CollectionOfGroup
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfGroup) Get() *CollectionOfGroup {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfGroup) Set(val *CollectionOfGroup) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfGroup) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfGroup) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfGroup(val *CollectionOfGroup) *NullableCollectionOfGroup {
|
||||
return &NullableCollectionOfGroup{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfGroup) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfGroup) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 CollectionOfPermissions type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfPermissions{}
|
||||
|
||||
// CollectionOfPermissions struct for CollectionOfPermissions
|
||||
type CollectionOfPermissions struct {
|
||||
Value []Permission `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfPermissions instantiates a new CollectionOfPermissions object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewCollectionOfPermissions() *CollectionOfPermissions {
|
||||
this := CollectionOfPermissions{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfPermissionsWithDefaults instantiates a new CollectionOfPermissions object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewCollectionOfPermissionsWithDefaults() *CollectionOfPermissions {
|
||||
this := CollectionOfPermissions{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfPermissions) GetValue() []Permission {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []Permission
|
||||
return ret
|
||||
}
|
||||
return o.Value
|
||||
}
|
||||
|
||||
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CollectionOfPermissions) GetValueOk() ([]Permission, bool) {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Value, true
|
||||
}
|
||||
|
||||
// HasValue returns a boolean if a field has been set.
|
||||
func (o *CollectionOfPermissions) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []Permission and assigns it to the Value field.
|
||||
func (o *CollectionOfPermissions) SetValue(v []Permission) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
func (o CollectionOfPermissions) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfPermissions) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfPermissions struct {
|
||||
value *CollectionOfPermissions
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfPermissions) Get() *CollectionOfPermissions {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfPermissions) Set(val *CollectionOfPermissions) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfPermissions) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfPermissions) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfPermissions(val *CollectionOfPermissions) *NullableCollectionOfPermissions {
|
||||
return &NullableCollectionOfPermissions{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfPermissions) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfPermissions) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+237
@@ -0,0 +1,237 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CollectionOfPermissionsWithAllowedValues type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfPermissionsWithAllowedValues{}
|
||||
|
||||
// CollectionOfPermissionsWithAllowedValues struct for CollectionOfPermissionsWithAllowedValues
|
||||
type CollectionOfPermissionsWithAllowedValues struct {
|
||||
// A list of role definitions that can be chosen for the resource.
|
||||
LibreGraphPermissionsRolesAllowedValues []UnifiedRoleDefinition `json:"@libre.graph.permissions.roles.allowedValues,omitempty"`
|
||||
// A list of actions that can be chosen for a custom role. Following the CS3 API we can represent the CS3 permissions by mapping them to driveItem properties or relations like this: | [CS3 ResourcePermission](https://cs3org.github.io/cs3apis/#cs3.storage.provider.v1beta1.ResourcePermissions) | action | comment | | ------------------------------------------------------------------------------------------------------------ | ------ | ------- | | `stat` | `libre.graph/driveItem/basic/read` | `basic` because it does not include versions or trashed items | | `get_quota` | `libre.graph/driveItem/quota/read` | read only the `quota` property | | `get_path` | `libre.graph/driveItem/path/read` | read only the `path` property | | `move` | `libre.graph/driveItem/path/update` | allows updating the `path` property of a CS3 resource | | `delete` | `libre.graph/driveItem/standard/delete` | `standard` because deleting is a common update operation | | `list_container` | `libre.graph/driveItem/children/read` | | | `create_container` | `libre.graph/driveItem/children/create` | | | `initiate_file_download` | `libre.graph/driveItem/content/read` | `content` is the property read when initiating a download | | `initiate_file_upload` | `libre.graph/driveItem/upload/create` | `uploads` are a separate property. postprocessing creates the `content` | | `add_grant` | `libre.graph/driveItem/permissions/create` | | | `list_grant` | `libre.graph/driveItem/permissions/read` | | | `update_grant` | `libre.graph/driveItem/permissions/update` | | | `remove_grant` | `libre.graph/driveItem/permissions/delete` | | | `deny_grant` | `libre.graph/driveItem/permissions/deny` | uses a non CRUD action `deny` | | `list_file_versions` | `libre.graph/driveItem/versions/read` | `versions` is a `driveItemVersion` collection | | `restore_file_version` | `libre.graph/driveItem/versions/update` | the only `update` action is restore | | `list_recycle` | `libre.graph/driveItem/deleted/read` | reading a driveItem `deleted` property implies listing | | `restore_recycle_item` | `libre.graph/driveItem/deleted/update` | the only `update` action is restore | | `purge_recycle` | `libre.graph/driveItem/deleted/delete` | allows purging deleted `driveItems` |
|
||||
LibreGraphPermissionsActionsAllowedValues []string `json:"@libre.graph.permissions.actions.allowedValues,omitempty"`
|
||||
Value []Permission `json:"value,omitempty"`
|
||||
// The total number of permissions available, only present if the `count` query parameter is set to true.
|
||||
OdataCount *int32 `json:"@odata.count,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfPermissionsWithAllowedValues instantiates a new CollectionOfPermissionsWithAllowedValues 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 NewCollectionOfPermissionsWithAllowedValues() *CollectionOfPermissionsWithAllowedValues {
|
||||
this := CollectionOfPermissionsWithAllowedValues{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfPermissionsWithAllowedValuesWithDefaults instantiates a new CollectionOfPermissionsWithAllowedValues 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 NewCollectionOfPermissionsWithAllowedValuesWithDefaults() *CollectionOfPermissionsWithAllowedValues {
|
||||
this := CollectionOfPermissionsWithAllowedValues{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetLibreGraphPermissionsRolesAllowedValues returns the LibreGraphPermissionsRolesAllowedValues field value if set, zero value otherwise.
|
||||
func (o *CollectionOfPermissionsWithAllowedValues) GetLibreGraphPermissionsRolesAllowedValues() []UnifiedRoleDefinition {
|
||||
if o == nil || IsNil(o.LibreGraphPermissionsRolesAllowedValues) {
|
||||
var ret []UnifiedRoleDefinition
|
||||
return ret
|
||||
}
|
||||
return o.LibreGraphPermissionsRolesAllowedValues
|
||||
}
|
||||
|
||||
// GetLibreGraphPermissionsRolesAllowedValuesOk returns a tuple with the LibreGraphPermissionsRolesAllowedValues field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CollectionOfPermissionsWithAllowedValues) GetLibreGraphPermissionsRolesAllowedValuesOk() ([]UnifiedRoleDefinition, bool) {
|
||||
if o == nil || IsNil(o.LibreGraphPermissionsRolesAllowedValues) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LibreGraphPermissionsRolesAllowedValues, true
|
||||
}
|
||||
|
||||
// HasLibreGraphPermissionsRolesAllowedValues returns a boolean if a field has been set.
|
||||
func (o *CollectionOfPermissionsWithAllowedValues) HasLibreGraphPermissionsRolesAllowedValues() bool {
|
||||
if o != nil && !IsNil(o.LibreGraphPermissionsRolesAllowedValues) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLibreGraphPermissionsRolesAllowedValues gets a reference to the given []UnifiedRoleDefinition and assigns it to the LibreGraphPermissionsRolesAllowedValues field.
|
||||
func (o *CollectionOfPermissionsWithAllowedValues) SetLibreGraphPermissionsRolesAllowedValues(v []UnifiedRoleDefinition) {
|
||||
o.LibreGraphPermissionsRolesAllowedValues = v
|
||||
}
|
||||
|
||||
// GetLibreGraphPermissionsActionsAllowedValues returns the LibreGraphPermissionsActionsAllowedValues field value if set, zero value otherwise.
|
||||
func (o *CollectionOfPermissionsWithAllowedValues) 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 *CollectionOfPermissionsWithAllowedValues) 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 *CollectionOfPermissionsWithAllowedValues) 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 *CollectionOfPermissionsWithAllowedValues) SetLibreGraphPermissionsActionsAllowedValues(v []string) {
|
||||
o.LibreGraphPermissionsActionsAllowedValues = v
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfPermissionsWithAllowedValues) GetValue() []Permission {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []Permission
|
||||
return ret
|
||||
}
|
||||
return o.Value
|
||||
}
|
||||
|
||||
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CollectionOfPermissionsWithAllowedValues) GetValueOk() ([]Permission, bool) {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Value, true
|
||||
}
|
||||
|
||||
// HasValue returns a boolean if a field has been set.
|
||||
func (o *CollectionOfPermissionsWithAllowedValues) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []Permission and assigns it to the Value field.
|
||||
func (o *CollectionOfPermissionsWithAllowedValues) SetValue(v []Permission) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
// GetOdataCount returns the OdataCount field value if set, zero value otherwise.
|
||||
func (o *CollectionOfPermissionsWithAllowedValues) GetOdataCount() int32 {
|
||||
if o == nil || IsNil(o.OdataCount) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.OdataCount
|
||||
}
|
||||
|
||||
// GetOdataCountOk returns a tuple with the OdataCount field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CollectionOfPermissionsWithAllowedValues) GetOdataCountOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.OdataCount) {
|
||||
return nil, false
|
||||
}
|
||||
return o.OdataCount, true
|
||||
}
|
||||
|
||||
// HasOdataCount returns a boolean if a field has been set.
|
||||
func (o *CollectionOfPermissionsWithAllowedValues) HasOdataCount() bool {
|
||||
if o != nil && !IsNil(o.OdataCount) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOdataCount gets a reference to the given int32 and assigns it to the OdataCount field.
|
||||
func (o *CollectionOfPermissionsWithAllowedValues) SetOdataCount(v int32) {
|
||||
o.OdataCount = &v
|
||||
}
|
||||
|
||||
func (o CollectionOfPermissionsWithAllowedValues) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfPermissionsWithAllowedValues) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.LibreGraphPermissionsRolesAllowedValues) {
|
||||
toSerialize["@libre.graph.permissions.roles.allowedValues"] = o.LibreGraphPermissionsRolesAllowedValues
|
||||
}
|
||||
if !IsNil(o.LibreGraphPermissionsActionsAllowedValues) {
|
||||
toSerialize["@libre.graph.permissions.actions.allowedValues"] = o.LibreGraphPermissionsActionsAllowedValues
|
||||
}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
if !IsNil(o.OdataCount) {
|
||||
toSerialize["@odata.count"] = o.OdataCount
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfPermissionsWithAllowedValues struct {
|
||||
value *CollectionOfPermissionsWithAllowedValues
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfPermissionsWithAllowedValues) Get() *CollectionOfPermissionsWithAllowedValues {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfPermissionsWithAllowedValues) Set(val *CollectionOfPermissionsWithAllowedValues) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfPermissionsWithAllowedValues) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfPermissionsWithAllowedValues) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfPermissionsWithAllowedValues(val *CollectionOfPermissionsWithAllowedValues) *NullableCollectionOfPermissionsWithAllowedValues {
|
||||
return &NullableCollectionOfPermissionsWithAllowedValues{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfPermissionsWithAllowedValues) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfPermissionsWithAllowedValues) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 CollectionOfSchools type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfSchools{}
|
||||
|
||||
// CollectionOfSchools struct for CollectionOfSchools
|
||||
type CollectionOfSchools struct {
|
||||
Value []EducationSchool `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfSchools instantiates a new CollectionOfSchools 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 NewCollectionOfSchools() *CollectionOfSchools {
|
||||
this := CollectionOfSchools{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfSchoolsWithDefaults instantiates a new CollectionOfSchools 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 NewCollectionOfSchoolsWithDefaults() *CollectionOfSchools {
|
||||
this := CollectionOfSchools{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfSchools) GetValue() []EducationSchool {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []EducationSchool
|
||||
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 *CollectionOfSchools) GetValueOk() ([]EducationSchool, 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 *CollectionOfSchools) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []EducationSchool and assigns it to the Value field.
|
||||
func (o *CollectionOfSchools) SetValue(v []EducationSchool) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
func (o CollectionOfSchools) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfSchools) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfSchools struct {
|
||||
value *CollectionOfSchools
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfSchools) Get() *CollectionOfSchools {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfSchools) Set(val *CollectionOfSchools) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfSchools) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfSchools) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfSchools(val *CollectionOfSchools) *NullableCollectionOfSchools {
|
||||
return &NullableCollectionOfSchools{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfSchools) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfSchools) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 CollectionOfTags type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfTags{}
|
||||
|
||||
// CollectionOfTags struct for CollectionOfTags
|
||||
type CollectionOfTags struct {
|
||||
Value []string `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfTags instantiates a new CollectionOfTags 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 NewCollectionOfTags() *CollectionOfTags {
|
||||
this := CollectionOfTags{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfTagsWithDefaults instantiates a new CollectionOfTags 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 NewCollectionOfTagsWithDefaults() *CollectionOfTags {
|
||||
this := CollectionOfTags{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfTags) GetValue() []string {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []string
|
||||
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 *CollectionOfTags) GetValueOk() ([]string, 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 *CollectionOfTags) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []string and assigns it to the Value field.
|
||||
func (o *CollectionOfTags) SetValue(v []string) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
func (o CollectionOfTags) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfTags) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfTags struct {
|
||||
value *CollectionOfTags
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfTags) Get() *CollectionOfTags {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfTags) Set(val *CollectionOfTags) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfTags) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfTags) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfTags(val *CollectionOfTags) *NullableCollectionOfTags {
|
||||
return &NullableCollectionOfTags{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfTags) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfTags) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+162
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the CollectionOfUser type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfUser{}
|
||||
|
||||
// CollectionOfUser struct for CollectionOfUser
|
||||
type CollectionOfUser struct {
|
||||
Value []User `json:"value,omitempty"`
|
||||
OdataNextLink *string `json:"@odata.nextLink,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfUser instantiates a new CollectionOfUser 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 NewCollectionOfUser() *CollectionOfUser {
|
||||
this := CollectionOfUser{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfUserWithDefaults instantiates a new CollectionOfUser 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 NewCollectionOfUserWithDefaults() *CollectionOfUser {
|
||||
this := CollectionOfUser{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfUser) GetValue() []User {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []User
|
||||
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 *CollectionOfUser) GetValueOk() ([]User, 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 *CollectionOfUser) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []User and assigns it to the Value field.
|
||||
func (o *CollectionOfUser) SetValue(v []User) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
// GetOdataNextLink returns the OdataNextLink field value if set, zero value otherwise.
|
||||
func (o *CollectionOfUser) GetOdataNextLink() string {
|
||||
if o == nil || IsNil(o.OdataNextLink) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.OdataNextLink
|
||||
}
|
||||
|
||||
// GetOdataNextLinkOk returns a tuple with the OdataNextLink field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *CollectionOfUser) GetOdataNextLinkOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.OdataNextLink) {
|
||||
return nil, false
|
||||
}
|
||||
return o.OdataNextLink, true
|
||||
}
|
||||
|
||||
// HasOdataNextLink returns a boolean if a field has been set.
|
||||
func (o *CollectionOfUser) HasOdataNextLink() bool {
|
||||
if o != nil && !IsNil(o.OdataNextLink) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOdataNextLink gets a reference to the given string and assigns it to the OdataNextLink field.
|
||||
func (o *CollectionOfUser) SetOdataNextLink(v string) {
|
||||
o.OdataNextLink = &v
|
||||
}
|
||||
|
||||
func (o CollectionOfUser) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfUser) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
if !IsNil(o.OdataNextLink) {
|
||||
toSerialize["@odata.nextLink"] = o.OdataNextLink
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfUser struct {
|
||||
value *CollectionOfUser
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfUser) Get() *CollectionOfUser {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfUser) Set(val *CollectionOfUser) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfUser) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfUser) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfUser(val *CollectionOfUser) *NullableCollectionOfUser {
|
||||
return &NullableCollectionOfUser{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfUser) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfUser) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 CollectionOfUsers type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &CollectionOfUsers{}
|
||||
|
||||
// CollectionOfUsers struct for CollectionOfUsers
|
||||
type CollectionOfUsers struct {
|
||||
Value []User `json:"value,omitempty"`
|
||||
}
|
||||
|
||||
// NewCollectionOfUsers instantiates a new CollectionOfUsers 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 NewCollectionOfUsers() *CollectionOfUsers {
|
||||
this := CollectionOfUsers{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewCollectionOfUsersWithDefaults instantiates a new CollectionOfUsers 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 NewCollectionOfUsersWithDefaults() *CollectionOfUsers {
|
||||
this := CollectionOfUsers{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetValue returns the Value field value if set, zero value otherwise.
|
||||
func (o *CollectionOfUsers) GetValue() []User {
|
||||
if o == nil || IsNil(o.Value) {
|
||||
var ret []User
|
||||
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 *CollectionOfUsers) GetValueOk() ([]User, 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 *CollectionOfUsers) HasValue() bool {
|
||||
if o != nil && !IsNil(o.Value) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetValue gets a reference to the given []User and assigns it to the Value field.
|
||||
func (o *CollectionOfUsers) SetValue(v []User) {
|
||||
o.Value = v
|
||||
}
|
||||
|
||||
func (o CollectionOfUsers) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o CollectionOfUsers) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Value) {
|
||||
toSerialize["value"] = o.Value
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableCollectionOfUsers struct {
|
||||
value *CollectionOfUsers
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfUsers) Get() *CollectionOfUsers {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfUsers) Set(val *CollectionOfUsers) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfUsers) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfUsers) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableCollectionOfUsers(val *CollectionOfUsers) *NullableCollectionOfUsers {
|
||||
return &NullableCollectionOfUsers{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableCollectionOfUsers) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableCollectionOfUsers) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the Deleted type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Deleted{}
|
||||
|
||||
// Deleted Information about the deleted state of the item. Read-only.
|
||||
type Deleted struct {
|
||||
// Represents the state of the deleted item.
|
||||
State *string `json:"state,omitempty"`
|
||||
}
|
||||
|
||||
// NewDeleted instantiates a new Deleted 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 NewDeleted() *Deleted {
|
||||
this := Deleted{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewDeletedWithDefaults instantiates a new Deleted 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 NewDeletedWithDefaults() *Deleted {
|
||||
this := Deleted{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetState returns the State field value if set, zero value otherwise.
|
||||
func (o *Deleted) GetState() string {
|
||||
if o == nil || IsNil(o.State) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.State
|
||||
}
|
||||
|
||||
// GetStateOk returns a tuple with the State field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Deleted) GetStateOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.State) {
|
||||
return nil, false
|
||||
}
|
||||
return o.State, true
|
||||
}
|
||||
|
||||
// HasState returns a boolean if a field has been set.
|
||||
func (o *Deleted) HasState() bool {
|
||||
if o != nil && !IsNil(o.State) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetState gets a reference to the given string and assigns it to the State field.
|
||||
func (o *Deleted) SetState(v string) {
|
||||
o.State = &v
|
||||
}
|
||||
|
||||
func (o Deleted) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Deleted) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.State) {
|
||||
toSerialize["state"] = o.State
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableDeleted struct {
|
||||
value *Deleted
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableDeleted) Get() *Deleted {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableDeleted) Set(val *Deleted) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableDeleted) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableDeleted) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableDeleted(val *Deleted) *NullableDeleted {
|
||||
return &NullableDeleted{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableDeleted) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableDeleted) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+783
@@ -0,0 +1,783 @@
|
||||
/*
|
||||
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"
|
||||
"time"
|
||||
"bytes"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// checks if the Drive type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Drive{}
|
||||
|
||||
// Drive The drive represents a space on the storage.
|
||||
type Drive struct {
|
||||
// The unique identifier for this drive.
|
||||
Id *string `json:"id,omitempty"`
|
||||
CreatedBy *IdentitySet `json:"createdBy,omitempty"`
|
||||
// Date and time of item creation. Read-only.
|
||||
CreatedDateTime *time.Time `json:"createdDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?([Zz]|[+-][0-9][0-9]:[0-9][0-9])$"`
|
||||
// Provides a user-visible description of the item. Optional.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// ETag for the item. Read-only.
|
||||
ETag *string `json:"eTag,omitempty"`
|
||||
LastModifiedBy *IdentitySet `json:"lastModifiedBy,omitempty"`
|
||||
// Date and time the item was last modified. Read-only.
|
||||
LastModifiedDateTime *time.Time `json:"lastModifiedDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?([Zz]|[+-][0-9][0-9]:[0-9][0-9])$"`
|
||||
// The name of the item. Read-write.
|
||||
Name string `json:"name"`
|
||||
ParentReference *ItemReference `json:"parentReference,omitempty"`
|
||||
// URL that displays the resource in the browser. Read-only.
|
||||
WebUrl *string `json:"webUrl,omitempty"`
|
||||
// Describes the type of drive represented by this resource. Values are \"personal\" for users home spaces, \"project\", \"virtual\" or \"share\". Read-only.
|
||||
DriveType *string `json:"driveType,omitempty"`
|
||||
// The drive alias can be used in clients to make the urls user friendly. Example: 'personal/einstein'. This will be used to resolve to the correct driveID.
|
||||
DriveAlias *string `json:"driveAlias,omitempty"`
|
||||
Owner *IdentitySet `json:"owner,omitempty"`
|
||||
Quota *Quota `json:"quota,omitempty"`
|
||||
// All items contained in the drive. Read-only. Nullable.
|
||||
Items []DriveItem `json:"items,omitempty"`
|
||||
Root *DriveItem `json:"root,omitempty"`
|
||||
// A collection of special drive resources.
|
||||
Special []DriveItem `json:"special,omitempty"`
|
||||
// Indicates whether the drive has items in the trash. Read-only.
|
||||
LibreGraphHasTrashedItems *bool `json:"@libre.graph.hasTrashedItems,omitempty"`
|
||||
}
|
||||
|
||||
type _Drive Drive
|
||||
|
||||
// NewDrive instantiates a new Drive 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 NewDrive(name string) *Drive {
|
||||
this := Drive{}
|
||||
this.Name = name
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewDriveWithDefaults instantiates a new Drive 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 NewDriveWithDefaults() *Drive {
|
||||
this := Drive{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetId returns the Id field value if set, zero value otherwise.
|
||||
func (o *Drive) GetId() string {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Id, true
|
||||
}
|
||||
|
||||
// HasId returns a boolean if a field has been set.
|
||||
func (o *Drive) HasId() bool {
|
||||
if o != nil && !IsNil(o.Id) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetId gets a reference to the given string and assigns it to the Id field.
|
||||
func (o *Drive) SetId(v string) {
|
||||
o.Id = &v
|
||||
}
|
||||
|
||||
// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise.
|
||||
func (o *Drive) GetCreatedBy() IdentitySet {
|
||||
if o == nil || IsNil(o.CreatedBy) {
|
||||
var ret IdentitySet
|
||||
return ret
|
||||
}
|
||||
return *o.CreatedBy
|
||||
}
|
||||
|
||||
// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetCreatedByOk() (*IdentitySet, bool) {
|
||||
if o == nil || IsNil(o.CreatedBy) {
|
||||
return nil, false
|
||||
}
|
||||
return o.CreatedBy, true
|
||||
}
|
||||
|
||||
// HasCreatedBy returns a boolean if a field has been set.
|
||||
func (o *Drive) HasCreatedBy() bool {
|
||||
if o != nil && !IsNil(o.CreatedBy) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCreatedBy gets a reference to the given IdentitySet and assigns it to the CreatedBy field.
|
||||
func (o *Drive) SetCreatedBy(v IdentitySet) {
|
||||
o.CreatedBy = &v
|
||||
}
|
||||
|
||||
// GetCreatedDateTime returns the CreatedDateTime field value if set, zero value otherwise.
|
||||
func (o *Drive) GetCreatedDateTime() time.Time {
|
||||
if o == nil || IsNil(o.CreatedDateTime) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.CreatedDateTime
|
||||
}
|
||||
|
||||
// GetCreatedDateTimeOk returns a tuple with the CreatedDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetCreatedDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil || IsNil(o.CreatedDateTime) {
|
||||
return nil, false
|
||||
}
|
||||
return o.CreatedDateTime, true
|
||||
}
|
||||
|
||||
// HasCreatedDateTime returns a boolean if a field has been set.
|
||||
func (o *Drive) HasCreatedDateTime() bool {
|
||||
if o != nil && !IsNil(o.CreatedDateTime) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCreatedDateTime gets a reference to the given time.Time and assigns it to the CreatedDateTime field.
|
||||
func (o *Drive) SetCreatedDateTime(v time.Time) {
|
||||
o.CreatedDateTime = &v
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value if set, zero value otherwise.
|
||||
func (o *Drive) GetDescription() string {
|
||||
if o == nil || IsNil(o.Description) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Description
|
||||
}
|
||||
|
||||
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetDescriptionOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Description) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Description, true
|
||||
}
|
||||
|
||||
// HasDescription returns a boolean if a field has been set.
|
||||
func (o *Drive) HasDescription() bool {
|
||||
if o != nil && !IsNil(o.Description) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDescription gets a reference to the given string and assigns it to the Description field.
|
||||
func (o *Drive) SetDescription(v string) {
|
||||
o.Description = &v
|
||||
}
|
||||
|
||||
// GetETag returns the ETag field value if set, zero value otherwise.
|
||||
func (o *Drive) GetETag() string {
|
||||
if o == nil || IsNil(o.ETag) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.ETag
|
||||
}
|
||||
|
||||
// GetETagOk returns a tuple with the ETag field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetETagOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.ETag) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ETag, true
|
||||
}
|
||||
|
||||
// HasETag returns a boolean if a field has been set.
|
||||
func (o *Drive) HasETag() bool {
|
||||
if o != nil && !IsNil(o.ETag) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetETag gets a reference to the given string and assigns it to the ETag field.
|
||||
func (o *Drive) SetETag(v string) {
|
||||
o.ETag = &v
|
||||
}
|
||||
|
||||
// GetLastModifiedBy returns the LastModifiedBy field value if set, zero value otherwise.
|
||||
func (o *Drive) GetLastModifiedBy() IdentitySet {
|
||||
if o == nil || IsNil(o.LastModifiedBy) {
|
||||
var ret IdentitySet
|
||||
return ret
|
||||
}
|
||||
return *o.LastModifiedBy
|
||||
}
|
||||
|
||||
// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetLastModifiedByOk() (*IdentitySet, bool) {
|
||||
if o == nil || IsNil(o.LastModifiedBy) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LastModifiedBy, true
|
||||
}
|
||||
|
||||
// HasLastModifiedBy returns a boolean if a field has been set.
|
||||
func (o *Drive) HasLastModifiedBy() bool {
|
||||
if o != nil && !IsNil(o.LastModifiedBy) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLastModifiedBy gets a reference to the given IdentitySet and assigns it to the LastModifiedBy field.
|
||||
func (o *Drive) SetLastModifiedBy(v IdentitySet) {
|
||||
o.LastModifiedBy = &v
|
||||
}
|
||||
|
||||
// GetLastModifiedDateTime returns the LastModifiedDateTime field value if set, zero value otherwise.
|
||||
func (o *Drive) GetLastModifiedDateTime() time.Time {
|
||||
if o == nil || IsNil(o.LastModifiedDateTime) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.LastModifiedDateTime
|
||||
}
|
||||
|
||||
// GetLastModifiedDateTimeOk returns a tuple with the LastModifiedDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetLastModifiedDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil || IsNil(o.LastModifiedDateTime) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LastModifiedDateTime, true
|
||||
}
|
||||
|
||||
// HasLastModifiedDateTime returns a boolean if a field has been set.
|
||||
func (o *Drive) HasLastModifiedDateTime() bool {
|
||||
if o != nil && !IsNil(o.LastModifiedDateTime) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLastModifiedDateTime gets a reference to the given time.Time and assigns it to the LastModifiedDateTime field.
|
||||
func (o *Drive) SetLastModifiedDateTime(v time.Time) {
|
||||
o.LastModifiedDateTime = &v
|
||||
}
|
||||
|
||||
// GetName returns the Name field value
|
||||
func (o *Drive) GetName() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Name
|
||||
}
|
||||
|
||||
// GetNameOk returns a tuple with the Name field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetNameOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Name, true
|
||||
}
|
||||
|
||||
// SetName sets field value
|
||||
func (o *Drive) SetName(v string) {
|
||||
o.Name = v
|
||||
}
|
||||
|
||||
// GetParentReference returns the ParentReference field value if set, zero value otherwise.
|
||||
func (o *Drive) GetParentReference() ItemReference {
|
||||
if o == nil || IsNil(o.ParentReference) {
|
||||
var ret ItemReference
|
||||
return ret
|
||||
}
|
||||
return *o.ParentReference
|
||||
}
|
||||
|
||||
// GetParentReferenceOk returns a tuple with the ParentReference field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetParentReferenceOk() (*ItemReference, bool) {
|
||||
if o == nil || IsNil(o.ParentReference) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ParentReference, true
|
||||
}
|
||||
|
||||
// HasParentReference returns a boolean if a field has been set.
|
||||
func (o *Drive) HasParentReference() bool {
|
||||
if o != nil && !IsNil(o.ParentReference) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetParentReference gets a reference to the given ItemReference and assigns it to the ParentReference field.
|
||||
func (o *Drive) SetParentReference(v ItemReference) {
|
||||
o.ParentReference = &v
|
||||
}
|
||||
|
||||
// GetWebUrl returns the WebUrl field value if set, zero value otherwise.
|
||||
func (o *Drive) GetWebUrl() string {
|
||||
if o == nil || IsNil(o.WebUrl) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.WebUrl
|
||||
}
|
||||
|
||||
// GetWebUrlOk returns a tuple with the WebUrl field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetWebUrlOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.WebUrl) {
|
||||
return nil, false
|
||||
}
|
||||
return o.WebUrl, true
|
||||
}
|
||||
|
||||
// HasWebUrl returns a boolean if a field has been set.
|
||||
func (o *Drive) HasWebUrl() bool {
|
||||
if o != nil && !IsNil(o.WebUrl) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetWebUrl gets a reference to the given string and assigns it to the WebUrl field.
|
||||
func (o *Drive) SetWebUrl(v string) {
|
||||
o.WebUrl = &v
|
||||
}
|
||||
|
||||
// GetDriveType returns the DriveType field value if set, zero value otherwise.
|
||||
func (o *Drive) GetDriveType() string {
|
||||
if o == nil || IsNil(o.DriveType) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DriveType
|
||||
}
|
||||
|
||||
// GetDriveTypeOk returns a tuple with the DriveType field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetDriveTypeOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.DriveType) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DriveType, true
|
||||
}
|
||||
|
||||
// HasDriveType returns a boolean if a field has been set.
|
||||
func (o *Drive) HasDriveType() bool {
|
||||
if o != nil && !IsNil(o.DriveType) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDriveType gets a reference to the given string and assigns it to the DriveType field.
|
||||
func (o *Drive) SetDriveType(v string) {
|
||||
o.DriveType = &v
|
||||
}
|
||||
|
||||
// GetDriveAlias returns the DriveAlias field value if set, zero value otherwise.
|
||||
func (o *Drive) GetDriveAlias() string {
|
||||
if o == nil || IsNil(o.DriveAlias) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DriveAlias
|
||||
}
|
||||
|
||||
// GetDriveAliasOk returns a tuple with the DriveAlias field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetDriveAliasOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.DriveAlias) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DriveAlias, true
|
||||
}
|
||||
|
||||
// HasDriveAlias returns a boolean if a field has been set.
|
||||
func (o *Drive) HasDriveAlias() bool {
|
||||
if o != nil && !IsNil(o.DriveAlias) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDriveAlias gets a reference to the given string and assigns it to the DriveAlias field.
|
||||
func (o *Drive) SetDriveAlias(v string) {
|
||||
o.DriveAlias = &v
|
||||
}
|
||||
|
||||
// GetOwner returns the Owner field value if set, zero value otherwise.
|
||||
func (o *Drive) GetOwner() IdentitySet {
|
||||
if o == nil || IsNil(o.Owner) {
|
||||
var ret IdentitySet
|
||||
return ret
|
||||
}
|
||||
return *o.Owner
|
||||
}
|
||||
|
||||
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetOwnerOk() (*IdentitySet, bool) {
|
||||
if o == nil || IsNil(o.Owner) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Owner, true
|
||||
}
|
||||
|
||||
// HasOwner returns a boolean if a field has been set.
|
||||
func (o *Drive) HasOwner() bool {
|
||||
if o != nil && !IsNil(o.Owner) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOwner gets a reference to the given IdentitySet and assigns it to the Owner field.
|
||||
func (o *Drive) SetOwner(v IdentitySet) {
|
||||
o.Owner = &v
|
||||
}
|
||||
|
||||
// GetQuota returns the Quota field value if set, zero value otherwise.
|
||||
func (o *Drive) GetQuota() Quota {
|
||||
if o == nil || IsNil(o.Quota) {
|
||||
var ret Quota
|
||||
return ret
|
||||
}
|
||||
return *o.Quota
|
||||
}
|
||||
|
||||
// GetQuotaOk returns a tuple with the Quota field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetQuotaOk() (*Quota, bool) {
|
||||
if o == nil || IsNil(o.Quota) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Quota, true
|
||||
}
|
||||
|
||||
// HasQuota returns a boolean if a field has been set.
|
||||
func (o *Drive) HasQuota() bool {
|
||||
if o != nil && !IsNil(o.Quota) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetQuota gets a reference to the given Quota and assigns it to the Quota field.
|
||||
func (o *Drive) SetQuota(v Quota) {
|
||||
o.Quota = &v
|
||||
}
|
||||
|
||||
// GetItems returns the Items field value if set, zero value otherwise.
|
||||
func (o *Drive) GetItems() []DriveItem {
|
||||
if o == nil || IsNil(o.Items) {
|
||||
var ret []DriveItem
|
||||
return ret
|
||||
}
|
||||
return o.Items
|
||||
}
|
||||
|
||||
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetItemsOk() ([]DriveItem, bool) {
|
||||
if o == nil || IsNil(o.Items) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Items, true
|
||||
}
|
||||
|
||||
// HasItems returns a boolean if a field has been set.
|
||||
func (o *Drive) HasItems() bool {
|
||||
if o != nil && !IsNil(o.Items) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetItems gets a reference to the given []DriveItem and assigns it to the Items field.
|
||||
func (o *Drive) SetItems(v []DriveItem) {
|
||||
o.Items = v
|
||||
}
|
||||
|
||||
// GetRoot returns the Root field value if set, zero value otherwise.
|
||||
func (o *Drive) GetRoot() DriveItem {
|
||||
if o == nil || IsNil(o.Root) {
|
||||
var ret DriveItem
|
||||
return ret
|
||||
}
|
||||
return *o.Root
|
||||
}
|
||||
|
||||
// GetRootOk returns a tuple with the Root field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetRootOk() (*DriveItem, bool) {
|
||||
if o == nil || IsNil(o.Root) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Root, true
|
||||
}
|
||||
|
||||
// HasRoot returns a boolean if a field has been set.
|
||||
func (o *Drive) HasRoot() bool {
|
||||
if o != nil && !IsNil(o.Root) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetRoot gets a reference to the given DriveItem and assigns it to the Root field.
|
||||
func (o *Drive) SetRoot(v DriveItem) {
|
||||
o.Root = &v
|
||||
}
|
||||
|
||||
// GetSpecial returns the Special field value if set, zero value otherwise.
|
||||
func (o *Drive) GetSpecial() []DriveItem {
|
||||
if o == nil || IsNil(o.Special) {
|
||||
var ret []DriveItem
|
||||
return ret
|
||||
}
|
||||
return o.Special
|
||||
}
|
||||
|
||||
// GetSpecialOk returns a tuple with the Special field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetSpecialOk() ([]DriveItem, bool) {
|
||||
if o == nil || IsNil(o.Special) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Special, true
|
||||
}
|
||||
|
||||
// HasSpecial returns a boolean if a field has been set.
|
||||
func (o *Drive) HasSpecial() bool {
|
||||
if o != nil && !IsNil(o.Special) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetSpecial gets a reference to the given []DriveItem and assigns it to the Special field.
|
||||
func (o *Drive) SetSpecial(v []DriveItem) {
|
||||
o.Special = v
|
||||
}
|
||||
|
||||
// GetLibreGraphHasTrashedItems returns the LibreGraphHasTrashedItems field value if set, zero value otherwise.
|
||||
func (o *Drive) GetLibreGraphHasTrashedItems() bool {
|
||||
if o == nil || IsNil(o.LibreGraphHasTrashedItems) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.LibreGraphHasTrashedItems
|
||||
}
|
||||
|
||||
// GetLibreGraphHasTrashedItemsOk returns a tuple with the LibreGraphHasTrashedItems field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Drive) GetLibreGraphHasTrashedItemsOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.LibreGraphHasTrashedItems) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LibreGraphHasTrashedItems, true
|
||||
}
|
||||
|
||||
// HasLibreGraphHasTrashedItems returns a boolean if a field has been set.
|
||||
func (o *Drive) HasLibreGraphHasTrashedItems() bool {
|
||||
if o != nil && !IsNil(o.LibreGraphHasTrashedItems) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLibreGraphHasTrashedItems gets a reference to the given bool and assigns it to the LibreGraphHasTrashedItems field.
|
||||
func (o *Drive) SetLibreGraphHasTrashedItems(v bool) {
|
||||
o.LibreGraphHasTrashedItems = &v
|
||||
}
|
||||
|
||||
func (o Drive) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Drive) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Id) {
|
||||
toSerialize["id"] = o.Id
|
||||
}
|
||||
if !IsNil(o.CreatedBy) {
|
||||
toSerialize["createdBy"] = o.CreatedBy
|
||||
}
|
||||
if !IsNil(o.CreatedDateTime) {
|
||||
toSerialize["createdDateTime"] = o.CreatedDateTime
|
||||
}
|
||||
if !IsNil(o.Description) {
|
||||
toSerialize["description"] = o.Description
|
||||
}
|
||||
if !IsNil(o.ETag) {
|
||||
toSerialize["eTag"] = o.ETag
|
||||
}
|
||||
if !IsNil(o.LastModifiedBy) {
|
||||
toSerialize["lastModifiedBy"] = o.LastModifiedBy
|
||||
}
|
||||
if !IsNil(o.LastModifiedDateTime) {
|
||||
toSerialize["lastModifiedDateTime"] = o.LastModifiedDateTime
|
||||
}
|
||||
toSerialize["name"] = o.Name
|
||||
if !IsNil(o.ParentReference) {
|
||||
toSerialize["parentReference"] = o.ParentReference
|
||||
}
|
||||
if !IsNil(o.WebUrl) {
|
||||
toSerialize["webUrl"] = o.WebUrl
|
||||
}
|
||||
if !IsNil(o.DriveType) {
|
||||
toSerialize["driveType"] = o.DriveType
|
||||
}
|
||||
if !IsNil(o.DriveAlias) {
|
||||
toSerialize["driveAlias"] = o.DriveAlias
|
||||
}
|
||||
if !IsNil(o.Owner) {
|
||||
toSerialize["owner"] = o.Owner
|
||||
}
|
||||
if !IsNil(o.Quota) {
|
||||
toSerialize["quota"] = o.Quota
|
||||
}
|
||||
if !IsNil(o.Items) {
|
||||
toSerialize["items"] = o.Items
|
||||
}
|
||||
if !IsNil(o.Root) {
|
||||
toSerialize["root"] = o.Root
|
||||
}
|
||||
if !IsNil(o.Special) {
|
||||
toSerialize["special"] = o.Special
|
||||
}
|
||||
if !IsNil(o.LibreGraphHasTrashedItems) {
|
||||
toSerialize["@libre.graph.hasTrashedItems"] = o.LibreGraphHasTrashedItems
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *Drive) 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{
|
||||
"name",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varDrive := _Drive{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varDrive)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = Drive(varDrive)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableDrive struct {
|
||||
value *Drive
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableDrive) Get() *Drive {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableDrive) Set(val *Drive) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableDrive) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableDrive) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableDrive(val *Drive) *NullableDrive {
|
||||
return &NullableDrive{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableDrive) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableDrive) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+1260
File diff suppressed because it is too large
Load Diff
Generated
Vendored
+275
@@ -0,0 +1,275 @@
|
||||
/*
|
||||
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"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the DriveItemCreateLink type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &DriveItemCreateLink{}
|
||||
|
||||
// DriveItemCreateLink struct for DriveItemCreateLink
|
||||
type DriveItemCreateLink struct {
|
||||
Type *SharingLinkType `json:"type,omitempty"`
|
||||
// Optional. A String with format of yyyy-MM-ddTHH:mm:ssZ of DateTime indicates the expiration time of the permission.
|
||||
ExpirationDateTime *time.Time `json:"expirationDateTime,omitempty"`
|
||||
// Optional.The password of the sharing link that is set by the creator.
|
||||
Password *string `json:"password,omitempty"`
|
||||
// Provides a user-visible display name of the link. Optional. Libregraph only.
|
||||
DisplayName *string `json:"displayName,omitempty"`
|
||||
// The quicklink property can be assigned to only one link per resource. A quicklink can be used in the clients to provide a one-click copy to clipboard action. Optional. Libregraph only.
|
||||
LibreGraphQuickLink *bool `json:"@libre.graph.quickLink,omitempty"`
|
||||
}
|
||||
|
||||
// NewDriveItemCreateLink instantiates a new DriveItemCreateLink object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewDriveItemCreateLink() *DriveItemCreateLink {
|
||||
this := DriveItemCreateLink{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewDriveItemCreateLinkWithDefaults instantiates a new DriveItemCreateLink object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewDriveItemCreateLinkWithDefaults() *DriveItemCreateLink {
|
||||
this := DriveItemCreateLink{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetType returns the Type field value if set, zero value otherwise.
|
||||
func (o *DriveItemCreateLink) GetType() SharingLinkType {
|
||||
if o == nil || IsNil(o.Type) {
|
||||
var ret SharingLinkType
|
||||
return ret
|
||||
}
|
||||
return *o.Type
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveItemCreateLink) GetTypeOk() (*SharingLinkType, bool) {
|
||||
if o == nil || IsNil(o.Type) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Type, true
|
||||
}
|
||||
|
||||
// HasType returns a boolean if a field has been set.
|
||||
func (o *DriveItemCreateLink) HasType() bool {
|
||||
if o != nil && !IsNil(o.Type) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetType gets a reference to the given SharingLinkType and assigns it to the Type field.
|
||||
func (o *DriveItemCreateLink) SetType(v SharingLinkType) {
|
||||
o.Type = &v
|
||||
}
|
||||
|
||||
// GetExpirationDateTime returns the ExpirationDateTime field value if set, zero value otherwise.
|
||||
func (o *DriveItemCreateLink) GetExpirationDateTime() time.Time {
|
||||
if o == nil || IsNil(o.ExpirationDateTime) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.ExpirationDateTime
|
||||
}
|
||||
|
||||
// GetExpirationDateTimeOk returns a tuple with the ExpirationDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveItemCreateLink) GetExpirationDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil || IsNil(o.ExpirationDateTime) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ExpirationDateTime, true
|
||||
}
|
||||
|
||||
// HasExpirationDateTime returns a boolean if a field has been set.
|
||||
func (o *DriveItemCreateLink) HasExpirationDateTime() bool {
|
||||
if o != nil && !IsNil(o.ExpirationDateTime) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetExpirationDateTime gets a reference to the given time.Time and assigns it to the ExpirationDateTime field.
|
||||
func (o *DriveItemCreateLink) SetExpirationDateTime(v time.Time) {
|
||||
o.ExpirationDateTime = &v
|
||||
}
|
||||
|
||||
// GetPassword returns the Password field value if set, zero value otherwise.
|
||||
func (o *DriveItemCreateLink) GetPassword() string {
|
||||
if o == nil || IsNil(o.Password) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Password
|
||||
}
|
||||
|
||||
// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveItemCreateLink) GetPasswordOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Password) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Password, true
|
||||
}
|
||||
|
||||
// HasPassword returns a boolean if a field has been set.
|
||||
func (o *DriveItemCreateLink) HasPassword() bool {
|
||||
if o != nil && !IsNil(o.Password) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPassword gets a reference to the given string and assigns it to the Password field.
|
||||
func (o *DriveItemCreateLink) SetPassword(v string) {
|
||||
o.Password = &v
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
|
||||
func (o *DriveItemCreateLink) GetDisplayName() string {
|
||||
if o == nil || IsNil(o.DisplayName) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DisplayName
|
||||
}
|
||||
|
||||
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveItemCreateLink) GetDisplayNameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.DisplayName) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DisplayName, true
|
||||
}
|
||||
|
||||
// HasDisplayName returns a boolean if a field has been set.
|
||||
func (o *DriveItemCreateLink) HasDisplayName() bool {
|
||||
if o != nil && !IsNil(o.DisplayName) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
|
||||
func (o *DriveItemCreateLink) SetDisplayName(v string) {
|
||||
o.DisplayName = &v
|
||||
}
|
||||
|
||||
// GetLibreGraphQuickLink returns the LibreGraphQuickLink field value if set, zero value otherwise.
|
||||
func (o *DriveItemCreateLink) GetLibreGraphQuickLink() bool {
|
||||
if o == nil || IsNil(o.LibreGraphQuickLink) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.LibreGraphQuickLink
|
||||
}
|
||||
|
||||
// GetLibreGraphQuickLinkOk returns a tuple with the LibreGraphQuickLink field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveItemCreateLink) GetLibreGraphQuickLinkOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.LibreGraphQuickLink) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LibreGraphQuickLink, true
|
||||
}
|
||||
|
||||
// HasLibreGraphQuickLink returns a boolean if a field has been set.
|
||||
func (o *DriveItemCreateLink) HasLibreGraphQuickLink() bool {
|
||||
if o != nil && !IsNil(o.LibreGraphQuickLink) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLibreGraphQuickLink gets a reference to the given bool and assigns it to the LibreGraphQuickLink field.
|
||||
func (o *DriveItemCreateLink) SetLibreGraphQuickLink(v bool) {
|
||||
o.LibreGraphQuickLink = &v
|
||||
}
|
||||
|
||||
func (o DriveItemCreateLink) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o DriveItemCreateLink) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Type) {
|
||||
toSerialize["type"] = o.Type
|
||||
}
|
||||
if !IsNil(o.ExpirationDateTime) {
|
||||
toSerialize["expirationDateTime"] = o.ExpirationDateTime
|
||||
}
|
||||
if !IsNil(o.Password) {
|
||||
toSerialize["password"] = o.Password
|
||||
}
|
||||
if !IsNil(o.DisplayName) {
|
||||
toSerialize["displayName"] = o.DisplayName
|
||||
}
|
||||
if !IsNil(o.LibreGraphQuickLink) {
|
||||
toSerialize["@libre.graph.quickLink"] = o.LibreGraphQuickLink
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableDriveItemCreateLink struct {
|
||||
value *DriveItemCreateLink
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableDriveItemCreateLink) Get() *DriveItemCreateLink {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableDriveItemCreateLink) Set(val *DriveItemCreateLink) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableDriveItemCreateLink) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableDriveItemCreateLink) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableDriveItemCreateLink(val *DriveItemCreateLink) *NullableDriveItemCreateLink {
|
||||
return &NullableDriveItemCreateLink{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableDriveItemCreateLink) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableDriveItemCreateLink) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+239
@@ -0,0 +1,239 @@
|
||||
/*
|
||||
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"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the DriveItemInvite type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &DriveItemInvite{}
|
||||
|
||||
// DriveItemInvite struct for DriveItemInvite
|
||||
type DriveItemInvite struct {
|
||||
// A collection of recipients who will receive access and the sharing invitation. Currently, only internal users or groups are supported.
|
||||
Recipients []DriveRecipient `json:"recipients,omitempty"`
|
||||
// Specifies the roles that are to be granted to the recipients of the sharing invitation.
|
||||
Roles []string `json:"roles,omitempty"`
|
||||
// Specifies the actions that are to be granted to the recipients of the sharing invitation, in effect creating a custom role.
|
||||
LibreGraphPermissionsActions []string `json:"@libre.graph.permissions.actions,omitempty"`
|
||||
// Specifies the dateTime after which the permission expires.
|
||||
ExpirationDateTime *time.Time `json:"expirationDateTime,omitempty"`
|
||||
}
|
||||
|
||||
// NewDriveItemInvite instantiates a new DriveItemInvite object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewDriveItemInvite() *DriveItemInvite {
|
||||
this := DriveItemInvite{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewDriveItemInviteWithDefaults instantiates a new DriveItemInvite object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewDriveItemInviteWithDefaults() *DriveItemInvite {
|
||||
this := DriveItemInvite{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetRecipients returns the Recipients field value if set, zero value otherwise.
|
||||
func (o *DriveItemInvite) GetRecipients() []DriveRecipient {
|
||||
if o == nil || IsNil(o.Recipients) {
|
||||
var ret []DriveRecipient
|
||||
return ret
|
||||
}
|
||||
return o.Recipients
|
||||
}
|
||||
|
||||
// GetRecipientsOk returns a tuple with the Recipients field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveItemInvite) GetRecipientsOk() ([]DriveRecipient, bool) {
|
||||
if o == nil || IsNil(o.Recipients) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Recipients, true
|
||||
}
|
||||
|
||||
// HasRecipients returns a boolean if a field has been set.
|
||||
func (o *DriveItemInvite) HasRecipients() bool {
|
||||
if o != nil && !IsNil(o.Recipients) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetRecipients gets a reference to the given []DriveRecipient and assigns it to the Recipients field.
|
||||
func (o *DriveItemInvite) SetRecipients(v []DriveRecipient) {
|
||||
o.Recipients = v
|
||||
}
|
||||
|
||||
// GetRoles returns the Roles field value if set, zero value otherwise.
|
||||
func (o *DriveItemInvite) GetRoles() []string {
|
||||
if o == nil || IsNil(o.Roles) {
|
||||
var ret []string
|
||||
return ret
|
||||
}
|
||||
return o.Roles
|
||||
}
|
||||
|
||||
// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveItemInvite) GetRolesOk() ([]string, bool) {
|
||||
if o == nil || IsNil(o.Roles) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Roles, true
|
||||
}
|
||||
|
||||
// HasRoles returns a boolean if a field has been set.
|
||||
func (o *DriveItemInvite) HasRoles() bool {
|
||||
if o != nil && !IsNil(o.Roles) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetRoles gets a reference to the given []string and assigns it to the Roles field.
|
||||
func (o *DriveItemInvite) SetRoles(v []string) {
|
||||
o.Roles = v
|
||||
}
|
||||
|
||||
// GetLibreGraphPermissionsActions returns the LibreGraphPermissionsActions field value if set, zero value otherwise.
|
||||
func (o *DriveItemInvite) GetLibreGraphPermissionsActions() []string {
|
||||
if o == nil || IsNil(o.LibreGraphPermissionsActions) {
|
||||
var ret []string
|
||||
return ret
|
||||
}
|
||||
return o.LibreGraphPermissionsActions
|
||||
}
|
||||
|
||||
// GetLibreGraphPermissionsActionsOk returns a tuple with the LibreGraphPermissionsActions field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveItemInvite) GetLibreGraphPermissionsActionsOk() ([]string, bool) {
|
||||
if o == nil || IsNil(o.LibreGraphPermissionsActions) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LibreGraphPermissionsActions, true
|
||||
}
|
||||
|
||||
// HasLibreGraphPermissionsActions returns a boolean if a field has been set.
|
||||
func (o *DriveItemInvite) HasLibreGraphPermissionsActions() bool {
|
||||
if o != nil && !IsNil(o.LibreGraphPermissionsActions) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLibreGraphPermissionsActions gets a reference to the given []string and assigns it to the LibreGraphPermissionsActions field.
|
||||
func (o *DriveItemInvite) SetLibreGraphPermissionsActions(v []string) {
|
||||
o.LibreGraphPermissionsActions = v
|
||||
}
|
||||
|
||||
// GetExpirationDateTime returns the ExpirationDateTime field value if set, zero value otherwise.
|
||||
func (o *DriveItemInvite) GetExpirationDateTime() time.Time {
|
||||
if o == nil || IsNil(o.ExpirationDateTime) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.ExpirationDateTime
|
||||
}
|
||||
|
||||
// GetExpirationDateTimeOk returns a tuple with the ExpirationDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveItemInvite) GetExpirationDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil || IsNil(o.ExpirationDateTime) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ExpirationDateTime, true
|
||||
}
|
||||
|
||||
// HasExpirationDateTime returns a boolean if a field has been set.
|
||||
func (o *DriveItemInvite) HasExpirationDateTime() bool {
|
||||
if o != nil && !IsNil(o.ExpirationDateTime) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetExpirationDateTime gets a reference to the given time.Time and assigns it to the ExpirationDateTime field.
|
||||
func (o *DriveItemInvite) SetExpirationDateTime(v time.Time) {
|
||||
o.ExpirationDateTime = &v
|
||||
}
|
||||
|
||||
func (o DriveItemInvite) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o DriveItemInvite) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Recipients) {
|
||||
toSerialize["recipients"] = o.Recipients
|
||||
}
|
||||
if !IsNil(o.Roles) {
|
||||
toSerialize["roles"] = o.Roles
|
||||
}
|
||||
if !IsNil(o.LibreGraphPermissionsActions) {
|
||||
toSerialize["@libre.graph.permissions.actions"] = o.LibreGraphPermissionsActions
|
||||
}
|
||||
if !IsNil(o.ExpirationDateTime) {
|
||||
toSerialize["expirationDateTime"] = o.ExpirationDateTime
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableDriveItemInvite struct {
|
||||
value *DriveItemInvite
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableDriveItemInvite) Get() *DriveItemInvite {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableDriveItemInvite) Set(val *DriveItemInvite) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableDriveItemInvite) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableDriveItemInvite) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableDriveItemInvite(val *DriveItemInvite) *NullableDriveItemInvite {
|
||||
return &NullableDriveItemInvite{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableDriveItemInvite) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableDriveItemInvite) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+168
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
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 DriveRecipient type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &DriveRecipient{}
|
||||
|
||||
// DriveRecipient Represents a person, group, or other recipient to share a drive item with using the invite action. When using invite to add permissions, the `driveRecipient` object would specify the `email`, `alias`, or `objectId` of the recipient. Only one of these values is required; multiple values are not accepted.
|
||||
type DriveRecipient struct {
|
||||
// The unique identifier for the recipient in the directory.
|
||||
ObjectId *string `json:"objectId,omitempty"`
|
||||
// When the recipient is referenced by objectId this annotation is used to differentiate `user` and `group` recipients.
|
||||
LibreGraphRecipientType *string `json:"@libre.graph.recipient.type,omitempty"`
|
||||
}
|
||||
|
||||
// NewDriveRecipient instantiates a new DriveRecipient object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewDriveRecipient() *DriveRecipient {
|
||||
this := DriveRecipient{}
|
||||
var libreGraphRecipientType string = "user"
|
||||
this.LibreGraphRecipientType = &libreGraphRecipientType
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewDriveRecipientWithDefaults instantiates a new DriveRecipient object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewDriveRecipientWithDefaults() *DriveRecipient {
|
||||
this := DriveRecipient{}
|
||||
var libreGraphRecipientType string = "user"
|
||||
this.LibreGraphRecipientType = &libreGraphRecipientType
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetObjectId returns the ObjectId field value if set, zero value otherwise.
|
||||
func (o *DriveRecipient) GetObjectId() string {
|
||||
if o == nil || IsNil(o.ObjectId) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.ObjectId
|
||||
}
|
||||
|
||||
// GetObjectIdOk returns a tuple with the ObjectId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveRecipient) GetObjectIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.ObjectId) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ObjectId, true
|
||||
}
|
||||
|
||||
// HasObjectId returns a boolean if a field has been set.
|
||||
func (o *DriveRecipient) HasObjectId() bool {
|
||||
if o != nil && !IsNil(o.ObjectId) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetObjectId gets a reference to the given string and assigns it to the ObjectId field.
|
||||
func (o *DriveRecipient) SetObjectId(v string) {
|
||||
o.ObjectId = &v
|
||||
}
|
||||
|
||||
// GetLibreGraphRecipientType returns the LibreGraphRecipientType field value if set, zero value otherwise.
|
||||
func (o *DriveRecipient) GetLibreGraphRecipientType() string {
|
||||
if o == nil || IsNil(o.LibreGraphRecipientType) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.LibreGraphRecipientType
|
||||
}
|
||||
|
||||
// GetLibreGraphRecipientTypeOk returns a tuple with the LibreGraphRecipientType field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveRecipient) GetLibreGraphRecipientTypeOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.LibreGraphRecipientType) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LibreGraphRecipientType, true
|
||||
}
|
||||
|
||||
// HasLibreGraphRecipientType returns a boolean if a field has been set.
|
||||
func (o *DriveRecipient) HasLibreGraphRecipientType() bool {
|
||||
if o != nil && !IsNil(o.LibreGraphRecipientType) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLibreGraphRecipientType gets a reference to the given string and assigns it to the LibreGraphRecipientType field.
|
||||
func (o *DriveRecipient) SetLibreGraphRecipientType(v string) {
|
||||
o.LibreGraphRecipientType = &v
|
||||
}
|
||||
|
||||
func (o DriveRecipient) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o DriveRecipient) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.ObjectId) {
|
||||
toSerialize["objectId"] = o.ObjectId
|
||||
}
|
||||
if !IsNil(o.LibreGraphRecipientType) {
|
||||
toSerialize["@libre.graph.recipient.type"] = o.LibreGraphRecipientType
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableDriveRecipient struct {
|
||||
value *DriveRecipient
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableDriveRecipient) Get() *DriveRecipient {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableDriveRecipient) Set(val *DriveRecipient) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableDriveRecipient) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableDriveRecipient) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableDriveRecipient(val *DriveRecipient) *NullableDriveRecipient {
|
||||
return &NullableDriveRecipient{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableDriveRecipient) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableDriveRecipient) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+751
@@ -0,0 +1,751 @@
|
||||
/*
|
||||
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"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the DriveUpdate type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &DriveUpdate{}
|
||||
|
||||
// DriveUpdate The drive represents an update to a space on the storage.
|
||||
type DriveUpdate struct {
|
||||
// The unique identifier for this drive.
|
||||
Id *string `json:"id,omitempty"`
|
||||
CreatedBy *IdentitySet `json:"createdBy,omitempty"`
|
||||
// Date and time of item creation. Read-only.
|
||||
CreatedDateTime *time.Time `json:"createdDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?([Zz]|[+-][0-9][0-9]:[0-9][0-9])$"`
|
||||
// Provides a user-visible description of the item. Optional.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// ETag for the item. Read-only.
|
||||
ETag *string `json:"eTag,omitempty"`
|
||||
LastModifiedBy *IdentitySet `json:"lastModifiedBy,omitempty"`
|
||||
// Date and time the item was last modified. Read-only.
|
||||
LastModifiedDateTime *time.Time `json:"lastModifiedDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?([Zz]|[+-][0-9][0-9]:[0-9][0-9])$"`
|
||||
// The name of the item. Read-write.
|
||||
Name *string `json:"name,omitempty"`
|
||||
ParentReference *ItemReference `json:"parentReference,omitempty"`
|
||||
// URL that displays the resource in the browser. Read-only.
|
||||
WebUrl *string `json:"webUrl,omitempty"`
|
||||
// Describes the type of drive represented by this resource. Values are \"personal\" for users home spaces, \"project\", \"virtual\" or \"share\". Read-only.
|
||||
DriveType *string `json:"driveType,omitempty"`
|
||||
// The drive alias can be used in clients to make the urls user friendly. Example: 'personal/einstein'. This will be used to resolve to the correct driveID.
|
||||
DriveAlias *string `json:"driveAlias,omitempty"`
|
||||
Owner *IdentitySet `json:"owner,omitempty"`
|
||||
Quota *Quota `json:"quota,omitempty"`
|
||||
// All items contained in the drive. Read-only. Nullable.
|
||||
Items []DriveItem `json:"items,omitempty"`
|
||||
Root *DriveItem `json:"root,omitempty"`
|
||||
// A collection of special drive resources.
|
||||
Special []DriveItem `json:"special,omitempty"`
|
||||
// Indicates whether the drive has items in the trash. Read-only.
|
||||
LibreGraphHasTrashedItems *bool `json:"@libre.graph.hasTrashedItems,omitempty"`
|
||||
}
|
||||
|
||||
// NewDriveUpdate instantiates a new DriveUpdate 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 NewDriveUpdate() *DriveUpdate {
|
||||
this := DriveUpdate{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewDriveUpdateWithDefaults instantiates a new DriveUpdate 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 NewDriveUpdateWithDefaults() *DriveUpdate {
|
||||
this := DriveUpdate{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetId returns the Id field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetId() string {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Id, true
|
||||
}
|
||||
|
||||
// HasId returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasId() bool {
|
||||
if o != nil && !IsNil(o.Id) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetId gets a reference to the given string and assigns it to the Id field.
|
||||
func (o *DriveUpdate) SetId(v string) {
|
||||
o.Id = &v
|
||||
}
|
||||
|
||||
// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetCreatedBy() IdentitySet {
|
||||
if o == nil || IsNil(o.CreatedBy) {
|
||||
var ret IdentitySet
|
||||
return ret
|
||||
}
|
||||
return *o.CreatedBy
|
||||
}
|
||||
|
||||
// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetCreatedByOk() (*IdentitySet, bool) {
|
||||
if o == nil || IsNil(o.CreatedBy) {
|
||||
return nil, false
|
||||
}
|
||||
return o.CreatedBy, true
|
||||
}
|
||||
|
||||
// HasCreatedBy returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasCreatedBy() bool {
|
||||
if o != nil && !IsNil(o.CreatedBy) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCreatedBy gets a reference to the given IdentitySet and assigns it to the CreatedBy field.
|
||||
func (o *DriveUpdate) SetCreatedBy(v IdentitySet) {
|
||||
o.CreatedBy = &v
|
||||
}
|
||||
|
||||
// GetCreatedDateTime returns the CreatedDateTime field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetCreatedDateTime() time.Time {
|
||||
if o == nil || IsNil(o.CreatedDateTime) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.CreatedDateTime
|
||||
}
|
||||
|
||||
// GetCreatedDateTimeOk returns a tuple with the CreatedDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetCreatedDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil || IsNil(o.CreatedDateTime) {
|
||||
return nil, false
|
||||
}
|
||||
return o.CreatedDateTime, true
|
||||
}
|
||||
|
||||
// HasCreatedDateTime returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasCreatedDateTime() bool {
|
||||
if o != nil && !IsNil(o.CreatedDateTime) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCreatedDateTime gets a reference to the given time.Time and assigns it to the CreatedDateTime field.
|
||||
func (o *DriveUpdate) SetCreatedDateTime(v time.Time) {
|
||||
o.CreatedDateTime = &v
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetDescription() string {
|
||||
if o == nil || IsNil(o.Description) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Description
|
||||
}
|
||||
|
||||
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetDescriptionOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Description) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Description, true
|
||||
}
|
||||
|
||||
// HasDescription returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasDescription() bool {
|
||||
if o != nil && !IsNil(o.Description) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDescription gets a reference to the given string and assigns it to the Description field.
|
||||
func (o *DriveUpdate) SetDescription(v string) {
|
||||
o.Description = &v
|
||||
}
|
||||
|
||||
// GetETag returns the ETag field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetETag() string {
|
||||
if o == nil || IsNil(o.ETag) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.ETag
|
||||
}
|
||||
|
||||
// GetETagOk returns a tuple with the ETag field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetETagOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.ETag) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ETag, true
|
||||
}
|
||||
|
||||
// HasETag returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasETag() bool {
|
||||
if o != nil && !IsNil(o.ETag) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetETag gets a reference to the given string and assigns it to the ETag field.
|
||||
func (o *DriveUpdate) SetETag(v string) {
|
||||
o.ETag = &v
|
||||
}
|
||||
|
||||
// GetLastModifiedBy returns the LastModifiedBy field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetLastModifiedBy() IdentitySet {
|
||||
if o == nil || IsNil(o.LastModifiedBy) {
|
||||
var ret IdentitySet
|
||||
return ret
|
||||
}
|
||||
return *o.LastModifiedBy
|
||||
}
|
||||
|
||||
// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetLastModifiedByOk() (*IdentitySet, bool) {
|
||||
if o == nil || IsNil(o.LastModifiedBy) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LastModifiedBy, true
|
||||
}
|
||||
|
||||
// HasLastModifiedBy returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasLastModifiedBy() bool {
|
||||
if o != nil && !IsNil(o.LastModifiedBy) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLastModifiedBy gets a reference to the given IdentitySet and assigns it to the LastModifiedBy field.
|
||||
func (o *DriveUpdate) SetLastModifiedBy(v IdentitySet) {
|
||||
o.LastModifiedBy = &v
|
||||
}
|
||||
|
||||
// GetLastModifiedDateTime returns the LastModifiedDateTime field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetLastModifiedDateTime() time.Time {
|
||||
if o == nil || IsNil(o.LastModifiedDateTime) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.LastModifiedDateTime
|
||||
}
|
||||
|
||||
// GetLastModifiedDateTimeOk returns a tuple with the LastModifiedDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetLastModifiedDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil || IsNil(o.LastModifiedDateTime) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LastModifiedDateTime, true
|
||||
}
|
||||
|
||||
// HasLastModifiedDateTime returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasLastModifiedDateTime() bool {
|
||||
if o != nil && !IsNil(o.LastModifiedDateTime) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLastModifiedDateTime gets a reference to the given time.Time and assigns it to the LastModifiedDateTime field.
|
||||
func (o *DriveUpdate) SetLastModifiedDateTime(v time.Time) {
|
||||
o.LastModifiedDateTime = &v
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) 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 *DriveUpdate) 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 *DriveUpdate) 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 *DriveUpdate) SetName(v string) {
|
||||
o.Name = &v
|
||||
}
|
||||
|
||||
// GetParentReference returns the ParentReference field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetParentReference() ItemReference {
|
||||
if o == nil || IsNil(o.ParentReference) {
|
||||
var ret ItemReference
|
||||
return ret
|
||||
}
|
||||
return *o.ParentReference
|
||||
}
|
||||
|
||||
// GetParentReferenceOk returns a tuple with the ParentReference field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetParentReferenceOk() (*ItemReference, bool) {
|
||||
if o == nil || IsNil(o.ParentReference) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ParentReference, true
|
||||
}
|
||||
|
||||
// HasParentReference returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasParentReference() bool {
|
||||
if o != nil && !IsNil(o.ParentReference) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetParentReference gets a reference to the given ItemReference and assigns it to the ParentReference field.
|
||||
func (o *DriveUpdate) SetParentReference(v ItemReference) {
|
||||
o.ParentReference = &v
|
||||
}
|
||||
|
||||
// GetWebUrl returns the WebUrl field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetWebUrl() string {
|
||||
if o == nil || IsNil(o.WebUrl) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.WebUrl
|
||||
}
|
||||
|
||||
// GetWebUrlOk returns a tuple with the WebUrl field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetWebUrlOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.WebUrl) {
|
||||
return nil, false
|
||||
}
|
||||
return o.WebUrl, true
|
||||
}
|
||||
|
||||
// HasWebUrl returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasWebUrl() bool {
|
||||
if o != nil && !IsNil(o.WebUrl) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetWebUrl gets a reference to the given string and assigns it to the WebUrl field.
|
||||
func (o *DriveUpdate) SetWebUrl(v string) {
|
||||
o.WebUrl = &v
|
||||
}
|
||||
|
||||
// GetDriveType returns the DriveType field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetDriveType() string {
|
||||
if o == nil || IsNil(o.DriveType) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DriveType
|
||||
}
|
||||
|
||||
// GetDriveTypeOk returns a tuple with the DriveType field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetDriveTypeOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.DriveType) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DriveType, true
|
||||
}
|
||||
|
||||
// HasDriveType returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasDriveType() bool {
|
||||
if o != nil && !IsNil(o.DriveType) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDriveType gets a reference to the given string and assigns it to the DriveType field.
|
||||
func (o *DriveUpdate) SetDriveType(v string) {
|
||||
o.DriveType = &v
|
||||
}
|
||||
|
||||
// GetDriveAlias returns the DriveAlias field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetDriveAlias() string {
|
||||
if o == nil || IsNil(o.DriveAlias) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DriveAlias
|
||||
}
|
||||
|
||||
// GetDriveAliasOk returns a tuple with the DriveAlias field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetDriveAliasOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.DriveAlias) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DriveAlias, true
|
||||
}
|
||||
|
||||
// HasDriveAlias returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasDriveAlias() bool {
|
||||
if o != nil && !IsNil(o.DriveAlias) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDriveAlias gets a reference to the given string and assigns it to the DriveAlias field.
|
||||
func (o *DriveUpdate) SetDriveAlias(v string) {
|
||||
o.DriveAlias = &v
|
||||
}
|
||||
|
||||
// GetOwner returns the Owner field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetOwner() IdentitySet {
|
||||
if o == nil || IsNil(o.Owner) {
|
||||
var ret IdentitySet
|
||||
return ret
|
||||
}
|
||||
return *o.Owner
|
||||
}
|
||||
|
||||
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetOwnerOk() (*IdentitySet, bool) {
|
||||
if o == nil || IsNil(o.Owner) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Owner, true
|
||||
}
|
||||
|
||||
// HasOwner returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasOwner() bool {
|
||||
if o != nil && !IsNil(o.Owner) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOwner gets a reference to the given IdentitySet and assigns it to the Owner field.
|
||||
func (o *DriveUpdate) SetOwner(v IdentitySet) {
|
||||
o.Owner = &v
|
||||
}
|
||||
|
||||
// GetQuota returns the Quota field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetQuota() Quota {
|
||||
if o == nil || IsNil(o.Quota) {
|
||||
var ret Quota
|
||||
return ret
|
||||
}
|
||||
return *o.Quota
|
||||
}
|
||||
|
||||
// GetQuotaOk returns a tuple with the Quota field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetQuotaOk() (*Quota, bool) {
|
||||
if o == nil || IsNil(o.Quota) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Quota, true
|
||||
}
|
||||
|
||||
// HasQuota returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasQuota() bool {
|
||||
if o != nil && !IsNil(o.Quota) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetQuota gets a reference to the given Quota and assigns it to the Quota field.
|
||||
func (o *DriveUpdate) SetQuota(v Quota) {
|
||||
o.Quota = &v
|
||||
}
|
||||
|
||||
// GetItems returns the Items field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetItems() []DriveItem {
|
||||
if o == nil || IsNil(o.Items) {
|
||||
var ret []DriveItem
|
||||
return ret
|
||||
}
|
||||
return o.Items
|
||||
}
|
||||
|
||||
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetItemsOk() ([]DriveItem, bool) {
|
||||
if o == nil || IsNil(o.Items) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Items, true
|
||||
}
|
||||
|
||||
// HasItems returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasItems() bool {
|
||||
if o != nil && !IsNil(o.Items) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetItems gets a reference to the given []DriveItem and assigns it to the Items field.
|
||||
func (o *DriveUpdate) SetItems(v []DriveItem) {
|
||||
o.Items = v
|
||||
}
|
||||
|
||||
// GetRoot returns the Root field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetRoot() DriveItem {
|
||||
if o == nil || IsNil(o.Root) {
|
||||
var ret DriveItem
|
||||
return ret
|
||||
}
|
||||
return *o.Root
|
||||
}
|
||||
|
||||
// GetRootOk returns a tuple with the Root field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetRootOk() (*DriveItem, bool) {
|
||||
if o == nil || IsNil(o.Root) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Root, true
|
||||
}
|
||||
|
||||
// HasRoot returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasRoot() bool {
|
||||
if o != nil && !IsNil(o.Root) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetRoot gets a reference to the given DriveItem and assigns it to the Root field.
|
||||
func (o *DriveUpdate) SetRoot(v DriveItem) {
|
||||
o.Root = &v
|
||||
}
|
||||
|
||||
// GetSpecial returns the Special field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetSpecial() []DriveItem {
|
||||
if o == nil || IsNil(o.Special) {
|
||||
var ret []DriveItem
|
||||
return ret
|
||||
}
|
||||
return o.Special
|
||||
}
|
||||
|
||||
// GetSpecialOk returns a tuple with the Special field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetSpecialOk() ([]DriveItem, bool) {
|
||||
if o == nil || IsNil(o.Special) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Special, true
|
||||
}
|
||||
|
||||
// HasSpecial returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasSpecial() bool {
|
||||
if o != nil && !IsNil(o.Special) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetSpecial gets a reference to the given []DriveItem and assigns it to the Special field.
|
||||
func (o *DriveUpdate) SetSpecial(v []DriveItem) {
|
||||
o.Special = v
|
||||
}
|
||||
|
||||
// GetLibreGraphHasTrashedItems returns the LibreGraphHasTrashedItems field value if set, zero value otherwise.
|
||||
func (o *DriveUpdate) GetLibreGraphHasTrashedItems() bool {
|
||||
if o == nil || IsNil(o.LibreGraphHasTrashedItems) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.LibreGraphHasTrashedItems
|
||||
}
|
||||
|
||||
// GetLibreGraphHasTrashedItemsOk returns a tuple with the LibreGraphHasTrashedItems field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *DriveUpdate) GetLibreGraphHasTrashedItemsOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.LibreGraphHasTrashedItems) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LibreGraphHasTrashedItems, true
|
||||
}
|
||||
|
||||
// HasLibreGraphHasTrashedItems returns a boolean if a field has been set.
|
||||
func (o *DriveUpdate) HasLibreGraphHasTrashedItems() bool {
|
||||
if o != nil && !IsNil(o.LibreGraphHasTrashedItems) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLibreGraphHasTrashedItems gets a reference to the given bool and assigns it to the LibreGraphHasTrashedItems field.
|
||||
func (o *DriveUpdate) SetLibreGraphHasTrashedItems(v bool) {
|
||||
o.LibreGraphHasTrashedItems = &v
|
||||
}
|
||||
|
||||
func (o DriveUpdate) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o DriveUpdate) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Id) {
|
||||
toSerialize["id"] = o.Id
|
||||
}
|
||||
if !IsNil(o.CreatedBy) {
|
||||
toSerialize["createdBy"] = o.CreatedBy
|
||||
}
|
||||
if !IsNil(o.CreatedDateTime) {
|
||||
toSerialize["createdDateTime"] = o.CreatedDateTime
|
||||
}
|
||||
if !IsNil(o.Description) {
|
||||
toSerialize["description"] = o.Description
|
||||
}
|
||||
if !IsNil(o.ETag) {
|
||||
toSerialize["eTag"] = o.ETag
|
||||
}
|
||||
if !IsNil(o.LastModifiedBy) {
|
||||
toSerialize["lastModifiedBy"] = o.LastModifiedBy
|
||||
}
|
||||
if !IsNil(o.LastModifiedDateTime) {
|
||||
toSerialize["lastModifiedDateTime"] = o.LastModifiedDateTime
|
||||
}
|
||||
if !IsNil(o.Name) {
|
||||
toSerialize["name"] = o.Name
|
||||
}
|
||||
if !IsNil(o.ParentReference) {
|
||||
toSerialize["parentReference"] = o.ParentReference
|
||||
}
|
||||
if !IsNil(o.WebUrl) {
|
||||
toSerialize["webUrl"] = o.WebUrl
|
||||
}
|
||||
if !IsNil(o.DriveType) {
|
||||
toSerialize["driveType"] = o.DriveType
|
||||
}
|
||||
if !IsNil(o.DriveAlias) {
|
||||
toSerialize["driveAlias"] = o.DriveAlias
|
||||
}
|
||||
if !IsNil(o.Owner) {
|
||||
toSerialize["owner"] = o.Owner
|
||||
}
|
||||
if !IsNil(o.Quota) {
|
||||
toSerialize["quota"] = o.Quota
|
||||
}
|
||||
if !IsNil(o.Items) {
|
||||
toSerialize["items"] = o.Items
|
||||
}
|
||||
if !IsNil(o.Root) {
|
||||
toSerialize["root"] = o.Root
|
||||
}
|
||||
if !IsNil(o.Special) {
|
||||
toSerialize["special"] = o.Special
|
||||
}
|
||||
if !IsNil(o.LibreGraphHasTrashedItems) {
|
||||
toSerialize["@libre.graph.hasTrashedItems"] = o.LibreGraphHasTrashedItems
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableDriveUpdate struct {
|
||||
value *DriveUpdate
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableDriveUpdate) Get() *DriveUpdate {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableDriveUpdate) Set(val *DriveUpdate) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableDriveUpdate) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableDriveUpdate) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableDriveUpdate(val *DriveUpdate) *NullableDriveUpdate {
|
||||
return &NullableDriveUpdate{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableDriveUpdate) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableDriveUpdate) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+373
@@ -0,0 +1,373 @@
|
||||
/*
|
||||
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 EducationClass type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &EducationClass{}
|
||||
|
||||
// EducationClass And extension of group representing a class or course
|
||||
type EducationClass struct {
|
||||
// Read-only.
|
||||
Id *string `json:"id,omitempty"`
|
||||
// An optional description for the group. Returned by default.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// The display name for the group. This property is required when a group is created and cannot be cleared during updates. Returned by default. Supports $search and $orderBy.
|
||||
DisplayName string `json:"displayName"`
|
||||
// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), Nullable. Supports $expand.
|
||||
Members []User `json:"members,omitempty"`
|
||||
// A list of member references to the members to be added. Up to 20 members can be added with a single request
|
||||
MembersodataBind []string `json:"members@odata.bind,omitempty"`
|
||||
// Classification of the group, i.e. \"class\" or \"course\"
|
||||
Classification string `json:"classification"`
|
||||
// An external unique ID for the class
|
||||
ExternalId *string `json:"externalId,omitempty"`
|
||||
}
|
||||
|
||||
type _EducationClass EducationClass
|
||||
|
||||
// NewEducationClass instantiates a new EducationClass 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 NewEducationClass(displayName string, classification string) *EducationClass {
|
||||
this := EducationClass{}
|
||||
this.DisplayName = displayName
|
||||
this.Classification = classification
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewEducationClassWithDefaults instantiates a new EducationClass 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 NewEducationClassWithDefaults() *EducationClass {
|
||||
this := EducationClass{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetId returns the Id field value if set, zero value otherwise.
|
||||
func (o *EducationClass) GetId() string {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationClass) GetIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Id, true
|
||||
}
|
||||
|
||||
// HasId returns a boolean if a field has been set.
|
||||
func (o *EducationClass) HasId() bool {
|
||||
if o != nil && !IsNil(o.Id) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetId gets a reference to the given string and assigns it to the Id field.
|
||||
func (o *EducationClass) SetId(v string) {
|
||||
o.Id = &v
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value if set, zero value otherwise.
|
||||
func (o *EducationClass) GetDescription() string {
|
||||
if o == nil || IsNil(o.Description) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Description
|
||||
}
|
||||
|
||||
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationClass) GetDescriptionOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Description) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Description, true
|
||||
}
|
||||
|
||||
// HasDescription returns a boolean if a field has been set.
|
||||
func (o *EducationClass) HasDescription() bool {
|
||||
if o != nil && !IsNil(o.Description) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDescription gets a reference to the given string and assigns it to the Description field.
|
||||
func (o *EducationClass) SetDescription(v string) {
|
||||
o.Description = &v
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value
|
||||
func (o *EducationClass) GetDisplayName() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.DisplayName
|
||||
}
|
||||
|
||||
// GetDisplayNameOk returns a tuple with the DisplayName field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationClass) GetDisplayNameOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.DisplayName, true
|
||||
}
|
||||
|
||||
// SetDisplayName sets field value
|
||||
func (o *EducationClass) SetDisplayName(v string) {
|
||||
o.DisplayName = v
|
||||
}
|
||||
|
||||
// GetMembers returns the Members field value if set, zero value otherwise.
|
||||
func (o *EducationClass) GetMembers() []User {
|
||||
if o == nil || IsNil(o.Members) {
|
||||
var ret []User
|
||||
return ret
|
||||
}
|
||||
return o.Members
|
||||
}
|
||||
|
||||
// GetMembersOk returns a tuple with the Members field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationClass) GetMembersOk() ([]User, bool) {
|
||||
if o == nil || IsNil(o.Members) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Members, true
|
||||
}
|
||||
|
||||
// HasMembers returns a boolean if a field has been set.
|
||||
func (o *EducationClass) HasMembers() bool {
|
||||
if o != nil && !IsNil(o.Members) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetMembers gets a reference to the given []User and assigns it to the Members field.
|
||||
func (o *EducationClass) SetMembers(v []User) {
|
||||
o.Members = v
|
||||
}
|
||||
|
||||
// GetMembersodataBind returns the MembersodataBind field value if set, zero value otherwise.
|
||||
func (o *EducationClass) GetMembersodataBind() []string {
|
||||
if o == nil || IsNil(o.MembersodataBind) {
|
||||
var ret []string
|
||||
return ret
|
||||
}
|
||||
return o.MembersodataBind
|
||||
}
|
||||
|
||||
// GetMembersodataBindOk returns a tuple with the MembersodataBind field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationClass) GetMembersodataBindOk() ([]string, bool) {
|
||||
if o == nil || IsNil(o.MembersodataBind) {
|
||||
return nil, false
|
||||
}
|
||||
return o.MembersodataBind, true
|
||||
}
|
||||
|
||||
// HasMembersodataBind returns a boolean if a field has been set.
|
||||
func (o *EducationClass) HasMembersodataBind() bool {
|
||||
if o != nil && !IsNil(o.MembersodataBind) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetMembersodataBind gets a reference to the given []string and assigns it to the MembersodataBind field.
|
||||
func (o *EducationClass) SetMembersodataBind(v []string) {
|
||||
o.MembersodataBind = v
|
||||
}
|
||||
|
||||
// GetClassification returns the Classification field value
|
||||
func (o *EducationClass) GetClassification() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Classification
|
||||
}
|
||||
|
||||
// GetClassificationOk returns a tuple with the Classification field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationClass) GetClassificationOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Classification, true
|
||||
}
|
||||
|
||||
// SetClassification sets field value
|
||||
func (o *EducationClass) SetClassification(v string) {
|
||||
o.Classification = v
|
||||
}
|
||||
|
||||
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
|
||||
func (o *EducationClass) GetExternalId() string {
|
||||
if o == nil || IsNil(o.ExternalId) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.ExternalId
|
||||
}
|
||||
|
||||
// GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationClass) GetExternalIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.ExternalId) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ExternalId, true
|
||||
}
|
||||
|
||||
// HasExternalId returns a boolean if a field has been set.
|
||||
func (o *EducationClass) HasExternalId() bool {
|
||||
if o != nil && !IsNil(o.ExternalId) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetExternalId gets a reference to the given string and assigns it to the ExternalId field.
|
||||
func (o *EducationClass) SetExternalId(v string) {
|
||||
o.ExternalId = &v
|
||||
}
|
||||
|
||||
func (o EducationClass) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o EducationClass) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Id) {
|
||||
toSerialize["id"] = o.Id
|
||||
}
|
||||
if !IsNil(o.Description) {
|
||||
toSerialize["description"] = o.Description
|
||||
}
|
||||
toSerialize["displayName"] = o.DisplayName
|
||||
if !IsNil(o.Members) {
|
||||
toSerialize["members"] = o.Members
|
||||
}
|
||||
if !IsNil(o.MembersodataBind) {
|
||||
toSerialize["members@odata.bind"] = o.MembersodataBind
|
||||
}
|
||||
toSerialize["classification"] = o.Classification
|
||||
if !IsNil(o.ExternalId) {
|
||||
toSerialize["externalId"] = o.ExternalId
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *EducationClass) 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{
|
||||
"displayName",
|
||||
"classification",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varEducationClass := _EducationClass{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varEducationClass)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = EducationClass(varEducationClass)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableEducationClass struct {
|
||||
value *EducationClass
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableEducationClass) Get() *EducationClass {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableEducationClass) Set(val *EducationClass) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableEducationClass) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableEducationClass) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableEducationClass(val *EducationClass) *NullableEducationClass {
|
||||
return &NullableEducationClass{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableEducationClass) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableEducationClass) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+286
@@ -0,0 +1,286 @@
|
||||
/*
|
||||
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"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the EducationSchool type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &EducationSchool{}
|
||||
|
||||
// EducationSchool Represents a school
|
||||
type EducationSchool struct {
|
||||
// The unique identifier for an entity. Read-only.
|
||||
Id *string `json:"id,omitempty"`
|
||||
// The organization name
|
||||
DisplayName *string `json:"displayName,omitempty"`
|
||||
// School number
|
||||
SchoolNumber *string `json:"schoolNumber,omitempty"`
|
||||
// External identifier of the school
|
||||
ExternalId *string `json:"externalId,omitempty"`
|
||||
// Date and time at which the service for this organization is scheduled to be terminated
|
||||
TerminationDate NullableTime `json:"terminationDate,omitempty"`
|
||||
}
|
||||
|
||||
// NewEducationSchool instantiates a new EducationSchool 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 NewEducationSchool() *EducationSchool {
|
||||
this := EducationSchool{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewEducationSchoolWithDefaults instantiates a new EducationSchool 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 NewEducationSchoolWithDefaults() *EducationSchool {
|
||||
this := EducationSchool{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetId returns the Id field value if set, zero value otherwise.
|
||||
func (o *EducationSchool) GetId() string {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationSchool) GetIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Id, true
|
||||
}
|
||||
|
||||
// HasId returns a boolean if a field has been set.
|
||||
func (o *EducationSchool) HasId() bool {
|
||||
if o != nil && !IsNil(o.Id) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetId gets a reference to the given string and assigns it to the Id field.
|
||||
func (o *EducationSchool) SetId(v string) {
|
||||
o.Id = &v
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
|
||||
func (o *EducationSchool) GetDisplayName() string {
|
||||
if o == nil || IsNil(o.DisplayName) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DisplayName
|
||||
}
|
||||
|
||||
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationSchool) GetDisplayNameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.DisplayName) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DisplayName, true
|
||||
}
|
||||
|
||||
// HasDisplayName returns a boolean if a field has been set.
|
||||
func (o *EducationSchool) HasDisplayName() bool {
|
||||
if o != nil && !IsNil(o.DisplayName) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
|
||||
func (o *EducationSchool) SetDisplayName(v string) {
|
||||
o.DisplayName = &v
|
||||
}
|
||||
|
||||
// GetSchoolNumber returns the SchoolNumber field value if set, zero value otherwise.
|
||||
func (o *EducationSchool) GetSchoolNumber() string {
|
||||
if o == nil || IsNil(o.SchoolNumber) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.SchoolNumber
|
||||
}
|
||||
|
||||
// GetSchoolNumberOk returns a tuple with the SchoolNumber field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationSchool) GetSchoolNumberOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.SchoolNumber) {
|
||||
return nil, false
|
||||
}
|
||||
return o.SchoolNumber, true
|
||||
}
|
||||
|
||||
// HasSchoolNumber returns a boolean if a field has been set.
|
||||
func (o *EducationSchool) HasSchoolNumber() bool {
|
||||
if o != nil && !IsNil(o.SchoolNumber) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetSchoolNumber gets a reference to the given string and assigns it to the SchoolNumber field.
|
||||
func (o *EducationSchool) SetSchoolNumber(v string) {
|
||||
o.SchoolNumber = &v
|
||||
}
|
||||
|
||||
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
|
||||
func (o *EducationSchool) GetExternalId() string {
|
||||
if o == nil || IsNil(o.ExternalId) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.ExternalId
|
||||
}
|
||||
|
||||
// GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationSchool) GetExternalIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.ExternalId) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ExternalId, true
|
||||
}
|
||||
|
||||
// HasExternalId returns a boolean if a field has been set.
|
||||
func (o *EducationSchool) HasExternalId() bool {
|
||||
if o != nil && !IsNil(o.ExternalId) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetExternalId gets a reference to the given string and assigns it to the ExternalId field.
|
||||
func (o *EducationSchool) SetExternalId(v string) {
|
||||
o.ExternalId = &v
|
||||
}
|
||||
|
||||
// GetTerminationDate returns the TerminationDate field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *EducationSchool) GetTerminationDate() time.Time {
|
||||
if o == nil || IsNil(o.TerminationDate.Get()) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.TerminationDate.Get()
|
||||
}
|
||||
|
||||
// GetTerminationDateOk returns a tuple with the TerminationDate field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *EducationSchool) GetTerminationDateOk() (*time.Time, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.TerminationDate.Get(), o.TerminationDate.IsSet()
|
||||
}
|
||||
|
||||
// HasTerminationDate returns a boolean if a field has been set.
|
||||
func (o *EducationSchool) HasTerminationDate() bool {
|
||||
if o != nil && o.TerminationDate.IsSet() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetTerminationDate gets a reference to the given NullableTime and assigns it to the TerminationDate field.
|
||||
func (o *EducationSchool) SetTerminationDate(v time.Time) {
|
||||
o.TerminationDate.Set(&v)
|
||||
}
|
||||
// SetTerminationDateNil sets the value for TerminationDate to be an explicit nil
|
||||
func (o *EducationSchool) SetTerminationDateNil() {
|
||||
o.TerminationDate.Set(nil)
|
||||
}
|
||||
|
||||
// UnsetTerminationDate ensures that no value is present for TerminationDate, not even an explicit nil
|
||||
func (o *EducationSchool) UnsetTerminationDate() {
|
||||
o.TerminationDate.Unset()
|
||||
}
|
||||
|
||||
func (o EducationSchool) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o EducationSchool) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Id) {
|
||||
toSerialize["id"] = o.Id
|
||||
}
|
||||
if !IsNil(o.DisplayName) {
|
||||
toSerialize["displayName"] = o.DisplayName
|
||||
}
|
||||
if !IsNil(o.SchoolNumber) {
|
||||
toSerialize["schoolNumber"] = o.SchoolNumber
|
||||
}
|
||||
if !IsNil(o.ExternalId) {
|
||||
toSerialize["externalId"] = o.ExternalId
|
||||
}
|
||||
if o.TerminationDate.IsSet() {
|
||||
toSerialize["terminationDate"] = o.TerminationDate.Get()
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableEducationSchool struct {
|
||||
value *EducationSchool
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableEducationSchool) Get() *EducationSchool {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableEducationSchool) Set(val *EducationSchool) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableEducationSchool) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableEducationSchool) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableEducationSchool(val *EducationSchool) *NullableEducationSchool {
|
||||
return &NullableEducationSchool{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableEducationSchool) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableEducationSchool) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+643
@@ -0,0 +1,643 @@
|
||||
/*
|
||||
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 EducationUser type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &EducationUser{}
|
||||
|
||||
// EducationUser An extension of user with education-specific attributes
|
||||
type EducationUser struct {
|
||||
// Read-only.
|
||||
Id *string `json:"id,omitempty"`
|
||||
// Set to \"true\" when the account is enabled.
|
||||
AccountEnabled *bool `json:"accountEnabled,omitempty"`
|
||||
// The name displayed in the address book for the user. This value is usually the combination of the user's first name, middle initial, and last name. This property is required when a user is created and it cannot be cleared during updates. Returned by default. Supports $orderby.
|
||||
DisplayName *string `json:"displayName,omitempty"`
|
||||
// A collection of drives available for this user. Read-only.
|
||||
Drives []Drive `json:"drives,omitempty"`
|
||||
Drive *Drive `json:"drive,omitempty"`
|
||||
// An external unique ID for the user. Use it to associate a user in another system, such as a student or employee ID number.
|
||||
ExternalId *string `json:"externalId,omitempty"`
|
||||
// Identities associated with this account.
|
||||
Identities []ObjectIdentity `json:"identities,omitempty"`
|
||||
// The SMTP address for the user, for example, 'jeff@contoso.opencloud.com'. Returned by default.
|
||||
Mail *string `json:"mail,omitempty"`
|
||||
// Groups that this user is a member of. HTTP Methods: GET (supported for all groups). Read-only. Nullable. Supports $expand.
|
||||
MemberOf []Group `json:"memberOf,omitempty"`
|
||||
// Contains the on-premises SAM account name synchronized from the on-premises directory. Read-only.
|
||||
OnPremisesSamAccountName *string `json:"onPremisesSamAccountName,omitempty"`
|
||||
PasswordProfile *PasswordProfile `json:"passwordProfile,omitempty"`
|
||||
// The user's surname (family name or last name). Returned by default.
|
||||
Surname *string `json:"surname,omitempty"`
|
||||
// The user's givenName. Returned by default.
|
||||
GivenName *string `json:"givenName,omitempty"`
|
||||
// The user`s default role. Such as \"student\" or \"teacher\"
|
||||
PrimaryRole *string `json:"primaryRole,omitempty"`
|
||||
// The user`s type. This can be either \"Member\" for regular user, \"Guest\" for guest users or \"Federated\" for users imported from a federated instance.
|
||||
UserType *string `json:"userType,omitempty"`
|
||||
}
|
||||
|
||||
// NewEducationUser instantiates a new EducationUser 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 NewEducationUser() *EducationUser {
|
||||
this := EducationUser{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewEducationUserWithDefaults instantiates a new EducationUser 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 NewEducationUserWithDefaults() *EducationUser {
|
||||
this := EducationUser{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetId returns the Id field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetId() string {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Id, true
|
||||
}
|
||||
|
||||
// HasId returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasId() bool {
|
||||
if o != nil && !IsNil(o.Id) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetId gets a reference to the given string and assigns it to the Id field.
|
||||
func (o *EducationUser) SetId(v string) {
|
||||
o.Id = &v
|
||||
}
|
||||
|
||||
// GetAccountEnabled returns the AccountEnabled field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetAccountEnabled() bool {
|
||||
if o == nil || IsNil(o.AccountEnabled) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.AccountEnabled
|
||||
}
|
||||
|
||||
// GetAccountEnabledOk returns a tuple with the AccountEnabled field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetAccountEnabledOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.AccountEnabled) {
|
||||
return nil, false
|
||||
}
|
||||
return o.AccountEnabled, true
|
||||
}
|
||||
|
||||
// HasAccountEnabled returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasAccountEnabled() bool {
|
||||
if o != nil && !IsNil(o.AccountEnabled) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetAccountEnabled gets a reference to the given bool and assigns it to the AccountEnabled field.
|
||||
func (o *EducationUser) SetAccountEnabled(v bool) {
|
||||
o.AccountEnabled = &v
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetDisplayName() string {
|
||||
if o == nil || IsNil(o.DisplayName) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DisplayName
|
||||
}
|
||||
|
||||
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetDisplayNameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.DisplayName) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DisplayName, true
|
||||
}
|
||||
|
||||
// HasDisplayName returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasDisplayName() bool {
|
||||
if o != nil && !IsNil(o.DisplayName) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
|
||||
func (o *EducationUser) SetDisplayName(v string) {
|
||||
o.DisplayName = &v
|
||||
}
|
||||
|
||||
// GetDrives returns the Drives field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetDrives() []Drive {
|
||||
if o == nil || IsNil(o.Drives) {
|
||||
var ret []Drive
|
||||
return ret
|
||||
}
|
||||
return o.Drives
|
||||
}
|
||||
|
||||
// GetDrivesOk returns a tuple with the Drives field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetDrivesOk() ([]Drive, bool) {
|
||||
if o == nil || IsNil(o.Drives) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Drives, true
|
||||
}
|
||||
|
||||
// HasDrives returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasDrives() bool {
|
||||
if o != nil && !IsNil(o.Drives) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDrives gets a reference to the given []Drive and assigns it to the Drives field.
|
||||
func (o *EducationUser) SetDrives(v []Drive) {
|
||||
o.Drives = v
|
||||
}
|
||||
|
||||
// GetDrive returns the Drive field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetDrive() Drive {
|
||||
if o == nil || IsNil(o.Drive) {
|
||||
var ret Drive
|
||||
return ret
|
||||
}
|
||||
return *o.Drive
|
||||
}
|
||||
|
||||
// GetDriveOk returns a tuple with the Drive field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetDriveOk() (*Drive, bool) {
|
||||
if o == nil || IsNil(o.Drive) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Drive, true
|
||||
}
|
||||
|
||||
// HasDrive returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasDrive() bool {
|
||||
if o != nil && !IsNil(o.Drive) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDrive gets a reference to the given Drive and assigns it to the Drive field.
|
||||
func (o *EducationUser) SetDrive(v Drive) {
|
||||
o.Drive = &v
|
||||
}
|
||||
|
||||
// GetExternalId returns the ExternalId field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetExternalId() string {
|
||||
if o == nil || IsNil(o.ExternalId) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.ExternalId
|
||||
}
|
||||
|
||||
// GetExternalIdOk returns a tuple with the ExternalId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetExternalIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.ExternalId) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ExternalId, true
|
||||
}
|
||||
|
||||
// HasExternalId returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasExternalId() bool {
|
||||
if o != nil && !IsNil(o.ExternalId) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetExternalId gets a reference to the given string and assigns it to the ExternalId field.
|
||||
func (o *EducationUser) SetExternalId(v string) {
|
||||
o.ExternalId = &v
|
||||
}
|
||||
|
||||
// GetIdentities returns the Identities field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetIdentities() []ObjectIdentity {
|
||||
if o == nil || IsNil(o.Identities) {
|
||||
var ret []ObjectIdentity
|
||||
return ret
|
||||
}
|
||||
return o.Identities
|
||||
}
|
||||
|
||||
// GetIdentitiesOk returns a tuple with the Identities field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetIdentitiesOk() ([]ObjectIdentity, bool) {
|
||||
if o == nil || IsNil(o.Identities) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Identities, true
|
||||
}
|
||||
|
||||
// HasIdentities returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasIdentities() bool {
|
||||
if o != nil && !IsNil(o.Identities) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIdentities gets a reference to the given []ObjectIdentity and assigns it to the Identities field.
|
||||
func (o *EducationUser) SetIdentities(v []ObjectIdentity) {
|
||||
o.Identities = v
|
||||
}
|
||||
|
||||
// GetMail returns the Mail field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetMail() string {
|
||||
if o == nil || IsNil(o.Mail) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Mail
|
||||
}
|
||||
|
||||
// GetMailOk returns a tuple with the Mail field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetMailOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Mail) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Mail, true
|
||||
}
|
||||
|
||||
// HasMail returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasMail() bool {
|
||||
if o != nil && !IsNil(o.Mail) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetMail gets a reference to the given string and assigns it to the Mail field.
|
||||
func (o *EducationUser) SetMail(v string) {
|
||||
o.Mail = &v
|
||||
}
|
||||
|
||||
// GetMemberOf returns the MemberOf field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetMemberOf() []Group {
|
||||
if o == nil || IsNil(o.MemberOf) {
|
||||
var ret []Group
|
||||
return ret
|
||||
}
|
||||
return o.MemberOf
|
||||
}
|
||||
|
||||
// GetMemberOfOk returns a tuple with the MemberOf field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetMemberOfOk() ([]Group, bool) {
|
||||
if o == nil || IsNil(o.MemberOf) {
|
||||
return nil, false
|
||||
}
|
||||
return o.MemberOf, true
|
||||
}
|
||||
|
||||
// HasMemberOf returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasMemberOf() bool {
|
||||
if o != nil && !IsNil(o.MemberOf) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetMemberOf gets a reference to the given []Group and assigns it to the MemberOf field.
|
||||
func (o *EducationUser) SetMemberOf(v []Group) {
|
||||
o.MemberOf = v
|
||||
}
|
||||
|
||||
// GetOnPremisesSamAccountName returns the OnPremisesSamAccountName field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetOnPremisesSamAccountName() string {
|
||||
if o == nil || IsNil(o.OnPremisesSamAccountName) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.OnPremisesSamAccountName
|
||||
}
|
||||
|
||||
// GetOnPremisesSamAccountNameOk returns a tuple with the OnPremisesSamAccountName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetOnPremisesSamAccountNameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.OnPremisesSamAccountName) {
|
||||
return nil, false
|
||||
}
|
||||
return o.OnPremisesSamAccountName, true
|
||||
}
|
||||
|
||||
// HasOnPremisesSamAccountName returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasOnPremisesSamAccountName() bool {
|
||||
if o != nil && !IsNil(o.OnPremisesSamAccountName) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOnPremisesSamAccountName gets a reference to the given string and assigns it to the OnPremisesSamAccountName field.
|
||||
func (o *EducationUser) SetOnPremisesSamAccountName(v string) {
|
||||
o.OnPremisesSamAccountName = &v
|
||||
}
|
||||
|
||||
// GetPasswordProfile returns the PasswordProfile field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetPasswordProfile() PasswordProfile {
|
||||
if o == nil || IsNil(o.PasswordProfile) {
|
||||
var ret PasswordProfile
|
||||
return ret
|
||||
}
|
||||
return *o.PasswordProfile
|
||||
}
|
||||
|
||||
// GetPasswordProfileOk returns a tuple with the PasswordProfile field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetPasswordProfileOk() (*PasswordProfile, bool) {
|
||||
if o == nil || IsNil(o.PasswordProfile) {
|
||||
return nil, false
|
||||
}
|
||||
return o.PasswordProfile, true
|
||||
}
|
||||
|
||||
// HasPasswordProfile returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasPasswordProfile() bool {
|
||||
if o != nil && !IsNil(o.PasswordProfile) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPasswordProfile gets a reference to the given PasswordProfile and assigns it to the PasswordProfile field.
|
||||
func (o *EducationUser) SetPasswordProfile(v PasswordProfile) {
|
||||
o.PasswordProfile = &v
|
||||
}
|
||||
|
||||
// GetSurname returns the Surname field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetSurname() string {
|
||||
if o == nil || IsNil(o.Surname) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Surname
|
||||
}
|
||||
|
||||
// GetSurnameOk returns a tuple with the Surname field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetSurnameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Surname) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Surname, true
|
||||
}
|
||||
|
||||
// HasSurname returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasSurname() bool {
|
||||
if o != nil && !IsNil(o.Surname) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetSurname gets a reference to the given string and assigns it to the Surname field.
|
||||
func (o *EducationUser) SetSurname(v string) {
|
||||
o.Surname = &v
|
||||
}
|
||||
|
||||
// GetGivenName returns the GivenName field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetGivenName() string {
|
||||
if o == nil || IsNil(o.GivenName) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.GivenName
|
||||
}
|
||||
|
||||
// GetGivenNameOk returns a tuple with the GivenName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetGivenNameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.GivenName) {
|
||||
return nil, false
|
||||
}
|
||||
return o.GivenName, true
|
||||
}
|
||||
|
||||
// HasGivenName returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasGivenName() bool {
|
||||
if o != nil && !IsNil(o.GivenName) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetGivenName gets a reference to the given string and assigns it to the GivenName field.
|
||||
func (o *EducationUser) SetGivenName(v string) {
|
||||
o.GivenName = &v
|
||||
}
|
||||
|
||||
// GetPrimaryRole returns the PrimaryRole field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetPrimaryRole() string {
|
||||
if o == nil || IsNil(o.PrimaryRole) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.PrimaryRole
|
||||
}
|
||||
|
||||
// GetPrimaryRoleOk returns a tuple with the PrimaryRole field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetPrimaryRoleOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.PrimaryRole) {
|
||||
return nil, false
|
||||
}
|
||||
return o.PrimaryRole, true
|
||||
}
|
||||
|
||||
// HasPrimaryRole returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasPrimaryRole() bool {
|
||||
if o != nil && !IsNil(o.PrimaryRole) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPrimaryRole gets a reference to the given string and assigns it to the PrimaryRole field.
|
||||
func (o *EducationUser) SetPrimaryRole(v string) {
|
||||
o.PrimaryRole = &v
|
||||
}
|
||||
|
||||
// GetUserType returns the UserType field value if set, zero value otherwise.
|
||||
func (o *EducationUser) GetUserType() string {
|
||||
if o == nil || IsNil(o.UserType) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.UserType
|
||||
}
|
||||
|
||||
// GetUserTypeOk returns a tuple with the UserType field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUser) GetUserTypeOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.UserType) {
|
||||
return nil, false
|
||||
}
|
||||
return o.UserType, true
|
||||
}
|
||||
|
||||
// HasUserType returns a boolean if a field has been set.
|
||||
func (o *EducationUser) HasUserType() bool {
|
||||
if o != nil && !IsNil(o.UserType) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetUserType gets a reference to the given string and assigns it to the UserType field.
|
||||
func (o *EducationUser) SetUserType(v string) {
|
||||
o.UserType = &v
|
||||
}
|
||||
|
||||
func (o EducationUser) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o EducationUser) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Id) {
|
||||
toSerialize["id"] = o.Id
|
||||
}
|
||||
if !IsNil(o.AccountEnabled) {
|
||||
toSerialize["accountEnabled"] = o.AccountEnabled
|
||||
}
|
||||
if !IsNil(o.DisplayName) {
|
||||
toSerialize["displayName"] = o.DisplayName
|
||||
}
|
||||
if !IsNil(o.Drives) {
|
||||
toSerialize["drives"] = o.Drives
|
||||
}
|
||||
if !IsNil(o.Drive) {
|
||||
toSerialize["drive"] = o.Drive
|
||||
}
|
||||
if !IsNil(o.ExternalId) {
|
||||
toSerialize["externalId"] = o.ExternalId
|
||||
}
|
||||
if !IsNil(o.Identities) {
|
||||
toSerialize["identities"] = o.Identities
|
||||
}
|
||||
if !IsNil(o.Mail) {
|
||||
toSerialize["mail"] = o.Mail
|
||||
}
|
||||
if !IsNil(o.MemberOf) {
|
||||
toSerialize["memberOf"] = o.MemberOf
|
||||
}
|
||||
if !IsNil(o.OnPremisesSamAccountName) {
|
||||
toSerialize["onPremisesSamAccountName"] = o.OnPremisesSamAccountName
|
||||
}
|
||||
if !IsNil(o.PasswordProfile) {
|
||||
toSerialize["passwordProfile"] = o.PasswordProfile
|
||||
}
|
||||
if !IsNil(o.Surname) {
|
||||
toSerialize["surname"] = o.Surname
|
||||
}
|
||||
if !IsNil(o.GivenName) {
|
||||
toSerialize["givenName"] = o.GivenName
|
||||
}
|
||||
if !IsNil(o.PrimaryRole) {
|
||||
toSerialize["primaryRole"] = o.PrimaryRole
|
||||
}
|
||||
if !IsNil(o.UserType) {
|
||||
toSerialize["userType"] = o.UserType
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableEducationUser struct {
|
||||
value *EducationUser
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableEducationUser) Get() *EducationUser {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableEducationUser) Set(val *EducationUser) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableEducationUser) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableEducationUser) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableEducationUser(val *EducationUser) *NullableEducationUser {
|
||||
return &NullableEducationUser{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableEducationUser) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableEducationUser) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 EducationUserReference type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &EducationUserReference{}
|
||||
|
||||
// EducationUserReference struct for EducationUserReference
|
||||
type EducationUserReference struct {
|
||||
OdataId *string `json:"@odata.id,omitempty"`
|
||||
}
|
||||
|
||||
// NewEducationUserReference instantiates a new EducationUserReference 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 NewEducationUserReference() *EducationUserReference {
|
||||
this := EducationUserReference{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewEducationUserReferenceWithDefaults instantiates a new EducationUserReference 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 NewEducationUserReferenceWithDefaults() *EducationUserReference {
|
||||
this := EducationUserReference{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetOdataId returns the OdataId field value if set, zero value otherwise.
|
||||
func (o *EducationUserReference) GetOdataId() string {
|
||||
if o == nil || IsNil(o.OdataId) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.OdataId
|
||||
}
|
||||
|
||||
// GetOdataIdOk returns a tuple with the OdataId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *EducationUserReference) GetOdataIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.OdataId) {
|
||||
return nil, false
|
||||
}
|
||||
return o.OdataId, true
|
||||
}
|
||||
|
||||
// HasOdataId returns a boolean if a field has been set.
|
||||
func (o *EducationUserReference) HasOdataId() bool {
|
||||
if o != nil && !IsNil(o.OdataId) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOdataId gets a reference to the given string and assigns it to the OdataId field.
|
||||
func (o *EducationUserReference) SetOdataId(v string) {
|
||||
o.OdataId = &v
|
||||
}
|
||||
|
||||
func (o EducationUserReference) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o EducationUserReference) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.OdataId) {
|
||||
toSerialize["@odata.id"] = o.OdataId
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableEducationUserReference struct {
|
||||
value *EducationUserReference
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableEducationUserReference) Get() *EducationUserReference {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableEducationUserReference) Set(val *EducationUserReference) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableEducationUserReference) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableEducationUserReference) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableEducationUserReference(val *EducationUserReference) *NullableEducationUserReference {
|
||||
return &NullableEducationUserReference{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableEducationUserReference) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableEducationUserReference) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+127
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the ExportPersonalDataRequest type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ExportPersonalDataRequest{}
|
||||
|
||||
// ExportPersonalDataRequest struct for ExportPersonalDataRequest
|
||||
type ExportPersonalDataRequest struct {
|
||||
// the path where the file should be created in the users personal space
|
||||
StorageLocation *string `json:"storageLocation,omitempty"`
|
||||
}
|
||||
|
||||
// NewExportPersonalDataRequest instantiates a new ExportPersonalDataRequest 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 NewExportPersonalDataRequest() *ExportPersonalDataRequest {
|
||||
this := ExportPersonalDataRequest{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewExportPersonalDataRequestWithDefaults instantiates a new ExportPersonalDataRequest 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 NewExportPersonalDataRequestWithDefaults() *ExportPersonalDataRequest {
|
||||
this := ExportPersonalDataRequest{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetStorageLocation returns the StorageLocation field value if set, zero value otherwise.
|
||||
func (o *ExportPersonalDataRequest) GetStorageLocation() string {
|
||||
if o == nil || IsNil(o.StorageLocation) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.StorageLocation
|
||||
}
|
||||
|
||||
// GetStorageLocationOk returns a tuple with the StorageLocation field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ExportPersonalDataRequest) GetStorageLocationOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.StorageLocation) {
|
||||
return nil, false
|
||||
}
|
||||
return o.StorageLocation, true
|
||||
}
|
||||
|
||||
// HasStorageLocation returns a boolean if a field has been set.
|
||||
func (o *ExportPersonalDataRequest) HasStorageLocation() bool {
|
||||
if o != nil && !IsNil(o.StorageLocation) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetStorageLocation gets a reference to the given string and assigns it to the StorageLocation field.
|
||||
func (o *ExportPersonalDataRequest) SetStorageLocation(v string) {
|
||||
o.StorageLocation = &v
|
||||
}
|
||||
|
||||
func (o ExportPersonalDataRequest) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o ExportPersonalDataRequest) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.StorageLocation) {
|
||||
toSerialize["storageLocation"] = o.StorageLocation
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableExportPersonalDataRequest struct {
|
||||
value *ExportPersonalDataRequest
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableExportPersonalDataRequest) Get() *ExportPersonalDataRequest {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableExportPersonalDataRequest) Set(val *ExportPersonalDataRequest) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableExportPersonalDataRequest) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableExportPersonalDataRequest) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableExportPersonalDataRequest(val *ExportPersonalDataRequest) *NullableExportPersonalDataRequest {
|
||||
return &NullableExportPersonalDataRequest{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableExportPersonalDataRequest) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableExportPersonalDataRequest) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+202
@@ -0,0 +1,202 @@
|
||||
/*
|
||||
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"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the FileSystemInfo type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &FileSystemInfo{}
|
||||
|
||||
// FileSystemInfo File system information on client. Read-write.
|
||||
type FileSystemInfo struct {
|
||||
// The UTC date and time the file was created on a client.
|
||||
CreatedDateTime *time.Time `json:"createdDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?([Zz]|[+-][0-9][0-9]:[0-9][0-9])$"`
|
||||
// The UTC date and time the file was last accessed. Available for the recent file list only.
|
||||
LastAccessedDateTime *time.Time `json:"lastAccessedDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?([Zz]|[+-][0-9][0-9]:[0-9][0-9])$"`
|
||||
// The UTC date and time the file was last modified on a client.
|
||||
LastModifiedDateTime *time.Time `json:"lastModifiedDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?([Zz]|[+-][0-9][0-9]:[0-9][0-9])$"`
|
||||
}
|
||||
|
||||
// NewFileSystemInfo instantiates a new FileSystemInfo 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 NewFileSystemInfo() *FileSystemInfo {
|
||||
this := FileSystemInfo{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewFileSystemInfoWithDefaults instantiates a new FileSystemInfo 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 NewFileSystemInfoWithDefaults() *FileSystemInfo {
|
||||
this := FileSystemInfo{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCreatedDateTime returns the CreatedDateTime field value if set, zero value otherwise.
|
||||
func (o *FileSystemInfo) GetCreatedDateTime() time.Time {
|
||||
if o == nil || IsNil(o.CreatedDateTime) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.CreatedDateTime
|
||||
}
|
||||
|
||||
// GetCreatedDateTimeOk returns a tuple with the CreatedDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *FileSystemInfo) GetCreatedDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil || IsNil(o.CreatedDateTime) {
|
||||
return nil, false
|
||||
}
|
||||
return o.CreatedDateTime, true
|
||||
}
|
||||
|
||||
// HasCreatedDateTime returns a boolean if a field has been set.
|
||||
func (o *FileSystemInfo) HasCreatedDateTime() bool {
|
||||
if o != nil && !IsNil(o.CreatedDateTime) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCreatedDateTime gets a reference to the given time.Time and assigns it to the CreatedDateTime field.
|
||||
func (o *FileSystemInfo) SetCreatedDateTime(v time.Time) {
|
||||
o.CreatedDateTime = &v
|
||||
}
|
||||
|
||||
// GetLastAccessedDateTime returns the LastAccessedDateTime field value if set, zero value otherwise.
|
||||
func (o *FileSystemInfo) GetLastAccessedDateTime() time.Time {
|
||||
if o == nil || IsNil(o.LastAccessedDateTime) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.LastAccessedDateTime
|
||||
}
|
||||
|
||||
// GetLastAccessedDateTimeOk returns a tuple with the LastAccessedDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *FileSystemInfo) GetLastAccessedDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil || IsNil(o.LastAccessedDateTime) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LastAccessedDateTime, true
|
||||
}
|
||||
|
||||
// HasLastAccessedDateTime returns a boolean if a field has been set.
|
||||
func (o *FileSystemInfo) HasLastAccessedDateTime() bool {
|
||||
if o != nil && !IsNil(o.LastAccessedDateTime) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLastAccessedDateTime gets a reference to the given time.Time and assigns it to the LastAccessedDateTime field.
|
||||
func (o *FileSystemInfo) SetLastAccessedDateTime(v time.Time) {
|
||||
o.LastAccessedDateTime = &v
|
||||
}
|
||||
|
||||
// GetLastModifiedDateTime returns the LastModifiedDateTime field value if set, zero value otherwise.
|
||||
func (o *FileSystemInfo) GetLastModifiedDateTime() time.Time {
|
||||
if o == nil || IsNil(o.LastModifiedDateTime) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.LastModifiedDateTime
|
||||
}
|
||||
|
||||
// GetLastModifiedDateTimeOk returns a tuple with the LastModifiedDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *FileSystemInfo) GetLastModifiedDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil || IsNil(o.LastModifiedDateTime) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LastModifiedDateTime, true
|
||||
}
|
||||
|
||||
// HasLastModifiedDateTime returns a boolean if a field has been set.
|
||||
func (o *FileSystemInfo) HasLastModifiedDateTime() bool {
|
||||
if o != nil && !IsNil(o.LastModifiedDateTime) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLastModifiedDateTime gets a reference to the given time.Time and assigns it to the LastModifiedDateTime field.
|
||||
func (o *FileSystemInfo) SetLastModifiedDateTime(v time.Time) {
|
||||
o.LastModifiedDateTime = &v
|
||||
}
|
||||
|
||||
func (o FileSystemInfo) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o FileSystemInfo) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.CreatedDateTime) {
|
||||
toSerialize["createdDateTime"] = o.CreatedDateTime
|
||||
}
|
||||
if !IsNil(o.LastAccessedDateTime) {
|
||||
toSerialize["lastAccessedDateTime"] = o.LastAccessedDateTime
|
||||
}
|
||||
if !IsNil(o.LastModifiedDateTime) {
|
||||
toSerialize["lastModifiedDateTime"] = o.LastModifiedDateTime
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableFileSystemInfo struct {
|
||||
value *FileSystemInfo
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableFileSystemInfo) Get() *FileSystemInfo {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableFileSystemInfo) Set(val *FileSystemInfo) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableFileSystemInfo) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableFileSystemInfo) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableFileSystemInfo(val *FileSystemInfo) *NullableFileSystemInfo {
|
||||
return &NullableFileSystemInfo{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableFileSystemInfo) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableFileSystemInfo) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
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 Folder type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Folder{}
|
||||
|
||||
// Folder Folder metadata, if the item is a folder. Read-only.
|
||||
type Folder struct {
|
||||
// Number of children contained immediately within this container.
|
||||
ChildCount *int32 `json:"childCount,omitempty"`
|
||||
View *FolderView `json:"view,omitempty"`
|
||||
}
|
||||
|
||||
// NewFolder instantiates a new Folder 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 NewFolder() *Folder {
|
||||
this := Folder{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewFolderWithDefaults instantiates a new Folder 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 NewFolderWithDefaults() *Folder {
|
||||
this := Folder{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetChildCount returns the ChildCount field value if set, zero value otherwise.
|
||||
func (o *Folder) GetChildCount() int32 {
|
||||
if o == nil || IsNil(o.ChildCount) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.ChildCount
|
||||
}
|
||||
|
||||
// GetChildCountOk returns a tuple with the ChildCount field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Folder) GetChildCountOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.ChildCount) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ChildCount, true
|
||||
}
|
||||
|
||||
// HasChildCount returns a boolean if a field has been set.
|
||||
func (o *Folder) HasChildCount() bool {
|
||||
if o != nil && !IsNil(o.ChildCount) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetChildCount gets a reference to the given int32 and assigns it to the ChildCount field.
|
||||
func (o *Folder) SetChildCount(v int32) {
|
||||
o.ChildCount = &v
|
||||
}
|
||||
|
||||
// GetView returns the View field value if set, zero value otherwise.
|
||||
func (o *Folder) GetView() FolderView {
|
||||
if o == nil || IsNil(o.View) {
|
||||
var ret FolderView
|
||||
return ret
|
||||
}
|
||||
return *o.View
|
||||
}
|
||||
|
||||
// GetViewOk returns a tuple with the View field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Folder) GetViewOk() (*FolderView, bool) {
|
||||
if o == nil || IsNil(o.View) {
|
||||
return nil, false
|
||||
}
|
||||
return o.View, true
|
||||
}
|
||||
|
||||
// HasView returns a boolean if a field has been set.
|
||||
func (o *Folder) HasView() bool {
|
||||
if o != nil && !IsNil(o.View) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetView gets a reference to the given FolderView and assigns it to the View field.
|
||||
func (o *Folder) SetView(v FolderView) {
|
||||
o.View = &v
|
||||
}
|
||||
|
||||
func (o Folder) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Folder) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.ChildCount) {
|
||||
toSerialize["childCount"] = o.ChildCount
|
||||
}
|
||||
if !IsNil(o.View) {
|
||||
toSerialize["view"] = o.View
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableFolder struct {
|
||||
value *Folder
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableFolder) Get() *Folder {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableFolder) Set(val *Folder) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableFolder) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableFolder) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableFolder(val *Folder) *NullableFolder {
|
||||
return &NullableFolder{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableFolder) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableFolder) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+201
@@ -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 FolderView type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &FolderView{}
|
||||
|
||||
// FolderView A collection of properties defining the recommended view for the folder.
|
||||
type FolderView struct {
|
||||
// The method by which the folder should be sorted.
|
||||
SortBy *string `json:"sortBy,omitempty"`
|
||||
// If true, indicates that items should be sorted in descending order. Otherwise, items should be sorted ascending.
|
||||
SortOrder *string `json:"sortOrder,omitempty"`
|
||||
// The type of view that should be used to represent the folder.
|
||||
ViewType *string `json:"viewType,omitempty"`
|
||||
}
|
||||
|
||||
// NewFolderView instantiates a new FolderView 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 NewFolderView() *FolderView {
|
||||
this := FolderView{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewFolderViewWithDefaults instantiates a new FolderView 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 NewFolderViewWithDefaults() *FolderView {
|
||||
this := FolderView{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetSortBy returns the SortBy field value if set, zero value otherwise.
|
||||
func (o *FolderView) GetSortBy() string {
|
||||
if o == nil || IsNil(o.SortBy) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.SortBy
|
||||
}
|
||||
|
||||
// GetSortByOk returns a tuple with the SortBy field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *FolderView) GetSortByOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.SortBy) {
|
||||
return nil, false
|
||||
}
|
||||
return o.SortBy, true
|
||||
}
|
||||
|
||||
// HasSortBy returns a boolean if a field has been set.
|
||||
func (o *FolderView) HasSortBy() bool {
|
||||
if o != nil && !IsNil(o.SortBy) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetSortBy gets a reference to the given string and assigns it to the SortBy field.
|
||||
func (o *FolderView) SetSortBy(v string) {
|
||||
o.SortBy = &v
|
||||
}
|
||||
|
||||
// GetSortOrder returns the SortOrder field value if set, zero value otherwise.
|
||||
func (o *FolderView) GetSortOrder() string {
|
||||
if o == nil || IsNil(o.SortOrder) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.SortOrder
|
||||
}
|
||||
|
||||
// GetSortOrderOk returns a tuple with the SortOrder field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *FolderView) GetSortOrderOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.SortOrder) {
|
||||
return nil, false
|
||||
}
|
||||
return o.SortOrder, true
|
||||
}
|
||||
|
||||
// HasSortOrder returns a boolean if a field has been set.
|
||||
func (o *FolderView) HasSortOrder() bool {
|
||||
if o != nil && !IsNil(o.SortOrder) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetSortOrder gets a reference to the given string and assigns it to the SortOrder field.
|
||||
func (o *FolderView) SetSortOrder(v string) {
|
||||
o.SortOrder = &v
|
||||
}
|
||||
|
||||
// GetViewType returns the ViewType field value if set, zero value otherwise.
|
||||
func (o *FolderView) GetViewType() string {
|
||||
if o == nil || IsNil(o.ViewType) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.ViewType
|
||||
}
|
||||
|
||||
// GetViewTypeOk returns a tuple with the ViewType field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *FolderView) GetViewTypeOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.ViewType) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ViewType, true
|
||||
}
|
||||
|
||||
// HasViewType returns a boolean if a field has been set.
|
||||
func (o *FolderView) HasViewType() bool {
|
||||
if o != nil && !IsNil(o.ViewType) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetViewType gets a reference to the given string and assigns it to the ViewType field.
|
||||
func (o *FolderView) SetViewType(v string) {
|
||||
o.ViewType = &v
|
||||
}
|
||||
|
||||
func (o FolderView) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o FolderView) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.SortBy) {
|
||||
toSerialize["sortBy"] = o.SortBy
|
||||
}
|
||||
if !IsNil(o.SortOrder) {
|
||||
toSerialize["sortOrder"] = o.SortOrder
|
||||
}
|
||||
if !IsNil(o.ViewType) {
|
||||
toSerialize["viewType"] = o.ViewType
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableFolderView struct {
|
||||
value *FolderView
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableFolderView) Get() *FolderView {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableFolderView) Set(val *FolderView) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableFolderView) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableFolderView) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableFolderView(val *FolderView) *NullableFolderView {
|
||||
return &NullableFolderView{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableFolderView) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableFolderView) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+201
@@ -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 GeoCoordinates type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &GeoCoordinates{}
|
||||
|
||||
// GeoCoordinates The GeoCoordinates resource provides geographic coordinates and elevation of a location based on metadata contained within the file. If a DriveItem has a non-null location facet, the item represents a file with a known location associated with it.
|
||||
type GeoCoordinates struct {
|
||||
// The altitude (height), in feet, above sea level for the item. Read-only.
|
||||
Altitude *float64 `json:"altitude,omitempty"`
|
||||
// The latitude, in decimal, for the item. Read-only.
|
||||
Latitude *float64 `json:"latitude,omitempty"`
|
||||
// The longitude, in decimal, for the item. Read-only.
|
||||
Longitude *float64 `json:"longitude,omitempty"`
|
||||
}
|
||||
|
||||
// NewGeoCoordinates instantiates a new GeoCoordinates object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewGeoCoordinates() *GeoCoordinates {
|
||||
this := GeoCoordinates{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewGeoCoordinatesWithDefaults instantiates a new GeoCoordinates object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewGeoCoordinatesWithDefaults() *GeoCoordinates {
|
||||
this := GeoCoordinates{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetAltitude returns the Altitude field value if set, zero value otherwise.
|
||||
func (o *GeoCoordinates) GetAltitude() float64 {
|
||||
if o == nil || IsNil(o.Altitude) {
|
||||
var ret float64
|
||||
return ret
|
||||
}
|
||||
return *o.Altitude
|
||||
}
|
||||
|
||||
// GetAltitudeOk returns a tuple with the Altitude field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GeoCoordinates) GetAltitudeOk() (*float64, bool) {
|
||||
if o == nil || IsNil(o.Altitude) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Altitude, true
|
||||
}
|
||||
|
||||
// HasAltitude returns a boolean if a field has been set.
|
||||
func (o *GeoCoordinates) HasAltitude() bool {
|
||||
if o != nil && !IsNil(o.Altitude) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetAltitude gets a reference to the given float64 and assigns it to the Altitude field.
|
||||
func (o *GeoCoordinates) SetAltitude(v float64) {
|
||||
o.Altitude = &v
|
||||
}
|
||||
|
||||
// GetLatitude returns the Latitude field value if set, zero value otherwise.
|
||||
func (o *GeoCoordinates) GetLatitude() float64 {
|
||||
if o == nil || IsNil(o.Latitude) {
|
||||
var ret float64
|
||||
return ret
|
||||
}
|
||||
return *o.Latitude
|
||||
}
|
||||
|
||||
// GetLatitudeOk returns a tuple with the Latitude field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GeoCoordinates) GetLatitudeOk() (*float64, bool) {
|
||||
if o == nil || IsNil(o.Latitude) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Latitude, true
|
||||
}
|
||||
|
||||
// HasLatitude returns a boolean if a field has been set.
|
||||
func (o *GeoCoordinates) HasLatitude() bool {
|
||||
if o != nil && !IsNil(o.Latitude) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLatitude gets a reference to the given float64 and assigns it to the Latitude field.
|
||||
func (o *GeoCoordinates) SetLatitude(v float64) {
|
||||
o.Latitude = &v
|
||||
}
|
||||
|
||||
// GetLongitude returns the Longitude field value if set, zero value otherwise.
|
||||
func (o *GeoCoordinates) GetLongitude() float64 {
|
||||
if o == nil || IsNil(o.Longitude) {
|
||||
var ret float64
|
||||
return ret
|
||||
}
|
||||
return *o.Longitude
|
||||
}
|
||||
|
||||
// GetLongitudeOk returns a tuple with the Longitude field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *GeoCoordinates) GetLongitudeOk() (*float64, bool) {
|
||||
if o == nil || IsNil(o.Longitude) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Longitude, true
|
||||
}
|
||||
|
||||
// HasLongitude returns a boolean if a field has been set.
|
||||
func (o *GeoCoordinates) HasLongitude() bool {
|
||||
if o != nil && !IsNil(o.Longitude) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLongitude gets a reference to the given float64 and assigns it to the Longitude field.
|
||||
func (o *GeoCoordinates) SetLongitude(v float64) {
|
||||
o.Longitude = &v
|
||||
}
|
||||
|
||||
func (o GeoCoordinates) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o GeoCoordinates) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Altitude) {
|
||||
toSerialize["altitude"] = o.Altitude
|
||||
}
|
||||
if !IsNil(o.Latitude) {
|
||||
toSerialize["latitude"] = o.Latitude
|
||||
}
|
||||
if !IsNil(o.Longitude) {
|
||||
toSerialize["longitude"] = o.Longitude
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableGeoCoordinates struct {
|
||||
value *GeoCoordinates
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableGeoCoordinates) Get() *GeoCoordinates {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableGeoCoordinates) Set(val *GeoCoordinates) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableGeoCoordinates) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableGeoCoordinates) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableGeoCoordinates(val *GeoCoordinates) *NullableGeoCoordinates {
|
||||
return &NullableGeoCoordinates{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableGeoCoordinates) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableGeoCoordinates) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+312
@@ -0,0 +1,312 @@
|
||||
/*
|
||||
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 Group type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Group{}
|
||||
|
||||
// Group struct for Group
|
||||
type Group struct {
|
||||
// Read-only.
|
||||
Id *string `json:"id,omitempty"`
|
||||
// An optional description for the group. Returned by default.
|
||||
Description *string `json:"description,omitempty"`
|
||||
// The display name for the group. This property is required when a group is created and cannot be cleared during updates. Returned by default. Supports $search and $orderBy.
|
||||
DisplayName *string `json:"displayName,omitempty"`
|
||||
// Specifies the group types. In MS Graph a group can have multiple types, so this is an array. In libreGraph the possible group types deviate from the MS Graph. The only group type that we currently support is \"ReadOnly\", which is set for groups that cannot be modified on the current instance.
|
||||
GroupTypes []string `json:"groupTypes,omitempty"`
|
||||
// Users and groups that are members of this group. HTTP Methods: GET (supported for all groups), Nullable. Supports $expand.
|
||||
Members []User `json:"members,omitempty"`
|
||||
// A list of member references to the members to be added. Up to 20 members can be added with a single request
|
||||
MembersodataBind []string `json:"members@odata.bind,omitempty"`
|
||||
}
|
||||
|
||||
// NewGroup instantiates a new Group 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 NewGroup() *Group {
|
||||
this := Group{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewGroupWithDefaults instantiates a new Group 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 NewGroupWithDefaults() *Group {
|
||||
this := Group{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetId returns the Id field value if set, zero value otherwise.
|
||||
func (o *Group) GetId() string {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Group) GetIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Id, true
|
||||
}
|
||||
|
||||
// HasId returns a boolean if a field has been set.
|
||||
func (o *Group) HasId() bool {
|
||||
if o != nil && !IsNil(o.Id) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetId gets a reference to the given string and assigns it to the Id field.
|
||||
func (o *Group) SetId(v string) {
|
||||
o.Id = &v
|
||||
}
|
||||
|
||||
// GetDescription returns the Description field value if set, zero value otherwise.
|
||||
func (o *Group) GetDescription() string {
|
||||
if o == nil || IsNil(o.Description) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Description
|
||||
}
|
||||
|
||||
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Group) GetDescriptionOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Description) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Description, true
|
||||
}
|
||||
|
||||
// HasDescription returns a boolean if a field has been set.
|
||||
func (o *Group) HasDescription() bool {
|
||||
if o != nil && !IsNil(o.Description) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDescription gets a reference to the given string and assigns it to the Description field.
|
||||
func (o *Group) SetDescription(v string) {
|
||||
o.Description = &v
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
|
||||
func (o *Group) GetDisplayName() string {
|
||||
if o == nil || IsNil(o.DisplayName) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DisplayName
|
||||
}
|
||||
|
||||
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Group) GetDisplayNameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.DisplayName) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DisplayName, true
|
||||
}
|
||||
|
||||
// HasDisplayName returns a boolean if a field has been set.
|
||||
func (o *Group) HasDisplayName() bool {
|
||||
if o != nil && !IsNil(o.DisplayName) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
|
||||
func (o *Group) SetDisplayName(v string) {
|
||||
o.DisplayName = &v
|
||||
}
|
||||
|
||||
// GetGroupTypes returns the GroupTypes field value if set, zero value otherwise.
|
||||
func (o *Group) GetGroupTypes() []string {
|
||||
if o == nil || IsNil(o.GroupTypes) {
|
||||
var ret []string
|
||||
return ret
|
||||
}
|
||||
return o.GroupTypes
|
||||
}
|
||||
|
||||
// GetGroupTypesOk returns a tuple with the GroupTypes field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Group) GetGroupTypesOk() ([]string, bool) {
|
||||
if o == nil || IsNil(o.GroupTypes) {
|
||||
return nil, false
|
||||
}
|
||||
return o.GroupTypes, true
|
||||
}
|
||||
|
||||
// HasGroupTypes returns a boolean if a field has been set.
|
||||
func (o *Group) HasGroupTypes() bool {
|
||||
if o != nil && !IsNil(o.GroupTypes) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetGroupTypes gets a reference to the given []string and assigns it to the GroupTypes field.
|
||||
func (o *Group) SetGroupTypes(v []string) {
|
||||
o.GroupTypes = v
|
||||
}
|
||||
|
||||
// GetMembers returns the Members field value if set, zero value otherwise.
|
||||
func (o *Group) GetMembers() []User {
|
||||
if o == nil || IsNil(o.Members) {
|
||||
var ret []User
|
||||
return ret
|
||||
}
|
||||
return o.Members
|
||||
}
|
||||
|
||||
// GetMembersOk returns a tuple with the Members field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Group) GetMembersOk() ([]User, bool) {
|
||||
if o == nil || IsNil(o.Members) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Members, true
|
||||
}
|
||||
|
||||
// HasMembers returns a boolean if a field has been set.
|
||||
func (o *Group) HasMembers() bool {
|
||||
if o != nil && !IsNil(o.Members) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetMembers gets a reference to the given []User and assigns it to the Members field.
|
||||
func (o *Group) SetMembers(v []User) {
|
||||
o.Members = v
|
||||
}
|
||||
|
||||
// GetMembersodataBind returns the MembersodataBind field value if set, zero value otherwise.
|
||||
func (o *Group) GetMembersodataBind() []string {
|
||||
if o == nil || IsNil(o.MembersodataBind) {
|
||||
var ret []string
|
||||
return ret
|
||||
}
|
||||
return o.MembersodataBind
|
||||
}
|
||||
|
||||
// GetMembersodataBindOk returns a tuple with the MembersodataBind field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Group) GetMembersodataBindOk() ([]string, bool) {
|
||||
if o == nil || IsNil(o.MembersodataBind) {
|
||||
return nil, false
|
||||
}
|
||||
return o.MembersodataBind, true
|
||||
}
|
||||
|
||||
// HasMembersodataBind returns a boolean if a field has been set.
|
||||
func (o *Group) HasMembersodataBind() bool {
|
||||
if o != nil && !IsNil(o.MembersodataBind) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetMembersodataBind gets a reference to the given []string and assigns it to the MembersodataBind field.
|
||||
func (o *Group) SetMembersodataBind(v []string) {
|
||||
o.MembersodataBind = v
|
||||
}
|
||||
|
||||
func (o Group) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Group) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Id) {
|
||||
toSerialize["id"] = o.Id
|
||||
}
|
||||
if !IsNil(o.Description) {
|
||||
toSerialize["description"] = o.Description
|
||||
}
|
||||
if !IsNil(o.DisplayName) {
|
||||
toSerialize["displayName"] = o.DisplayName
|
||||
}
|
||||
if !IsNil(o.GroupTypes) {
|
||||
toSerialize["groupTypes"] = o.GroupTypes
|
||||
}
|
||||
if !IsNil(o.Members) {
|
||||
toSerialize["members"] = o.Members
|
||||
}
|
||||
if !IsNil(o.MembersodataBind) {
|
||||
toSerialize["members@odata.bind"] = o.MembersodataBind
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableGroup struct {
|
||||
value *Group
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableGroup) Get() *Group {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableGroup) Set(val *Group) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableGroup) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableGroup) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableGroup(val *Group) *NullableGroup {
|
||||
return &NullableGroup{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableGroup) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableGroup) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+238
@@ -0,0 +1,238 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the Hashes type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Hashes{}
|
||||
|
||||
// Hashes Hashes of the file's binary content, if available. Read-only.
|
||||
type Hashes struct {
|
||||
// The CRC32 value of the file (if available). Read-only.
|
||||
Crc32Hash *string `json:"crc32Hash,omitempty"`
|
||||
// A proprietary hash of the file that can be used to determine if the contents of the file have changed (if available). Read-only.
|
||||
QuickXorHash *string `json:"quickXorHash,omitempty"`
|
||||
// SHA1 hash for the contents of the file (if available). Read-only.
|
||||
Sha1Hash *string `json:"sha1Hash,omitempty"`
|
||||
// SHA256 hash for the contents of the file (if available). Read-only.
|
||||
Sha256Hash *string `json:"sha256Hash,omitempty"`
|
||||
}
|
||||
|
||||
// NewHashes instantiates a new Hashes 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 NewHashes() *Hashes {
|
||||
this := Hashes{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewHashesWithDefaults instantiates a new Hashes 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 NewHashesWithDefaults() *Hashes {
|
||||
this := Hashes{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCrc32Hash returns the Crc32Hash field value if set, zero value otherwise.
|
||||
func (o *Hashes) GetCrc32Hash() string {
|
||||
if o == nil || IsNil(o.Crc32Hash) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Crc32Hash
|
||||
}
|
||||
|
||||
// GetCrc32HashOk returns a tuple with the Crc32Hash field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Hashes) GetCrc32HashOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Crc32Hash) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Crc32Hash, true
|
||||
}
|
||||
|
||||
// HasCrc32Hash returns a boolean if a field has been set.
|
||||
func (o *Hashes) HasCrc32Hash() bool {
|
||||
if o != nil && !IsNil(o.Crc32Hash) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCrc32Hash gets a reference to the given string and assigns it to the Crc32Hash field.
|
||||
func (o *Hashes) SetCrc32Hash(v string) {
|
||||
o.Crc32Hash = &v
|
||||
}
|
||||
|
||||
// GetQuickXorHash returns the QuickXorHash field value if set, zero value otherwise.
|
||||
func (o *Hashes) GetQuickXorHash() string {
|
||||
if o == nil || IsNil(o.QuickXorHash) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.QuickXorHash
|
||||
}
|
||||
|
||||
// GetQuickXorHashOk returns a tuple with the QuickXorHash field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Hashes) GetQuickXorHashOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.QuickXorHash) {
|
||||
return nil, false
|
||||
}
|
||||
return o.QuickXorHash, true
|
||||
}
|
||||
|
||||
// HasQuickXorHash returns a boolean if a field has been set.
|
||||
func (o *Hashes) HasQuickXorHash() bool {
|
||||
if o != nil && !IsNil(o.QuickXorHash) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetQuickXorHash gets a reference to the given string and assigns it to the QuickXorHash field.
|
||||
func (o *Hashes) SetQuickXorHash(v string) {
|
||||
o.QuickXorHash = &v
|
||||
}
|
||||
|
||||
// GetSha1Hash returns the Sha1Hash field value if set, zero value otherwise.
|
||||
func (o *Hashes) GetSha1Hash() string {
|
||||
if o == nil || IsNil(o.Sha1Hash) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Sha1Hash
|
||||
}
|
||||
|
||||
// GetSha1HashOk returns a tuple with the Sha1Hash field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Hashes) GetSha1HashOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Sha1Hash) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Sha1Hash, true
|
||||
}
|
||||
|
||||
// HasSha1Hash returns a boolean if a field has been set.
|
||||
func (o *Hashes) HasSha1Hash() bool {
|
||||
if o != nil && !IsNil(o.Sha1Hash) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetSha1Hash gets a reference to the given string and assigns it to the Sha1Hash field.
|
||||
func (o *Hashes) SetSha1Hash(v string) {
|
||||
o.Sha1Hash = &v
|
||||
}
|
||||
|
||||
// GetSha256Hash returns the Sha256Hash field value if set, zero value otherwise.
|
||||
func (o *Hashes) GetSha256Hash() string {
|
||||
if o == nil || IsNil(o.Sha256Hash) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Sha256Hash
|
||||
}
|
||||
|
||||
// GetSha256HashOk returns a tuple with the Sha256Hash field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Hashes) GetSha256HashOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Sha256Hash) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Sha256Hash, true
|
||||
}
|
||||
|
||||
// HasSha256Hash returns a boolean if a field has been set.
|
||||
func (o *Hashes) HasSha256Hash() bool {
|
||||
if o != nil && !IsNil(o.Sha256Hash) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetSha256Hash gets a reference to the given string and assigns it to the Sha256Hash field.
|
||||
func (o *Hashes) SetSha256Hash(v string) {
|
||||
o.Sha256Hash = &v
|
||||
}
|
||||
|
||||
func (o Hashes) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Hashes) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Crc32Hash) {
|
||||
toSerialize["crc32Hash"] = o.Crc32Hash
|
||||
}
|
||||
if !IsNil(o.QuickXorHash) {
|
||||
toSerialize["quickXorHash"] = o.QuickXorHash
|
||||
}
|
||||
if !IsNil(o.Sha1Hash) {
|
||||
toSerialize["sha1Hash"] = o.Sha1Hash
|
||||
}
|
||||
if !IsNil(o.Sha256Hash) {
|
||||
toSerialize["sha256Hash"] = o.Sha256Hash
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableHashes struct {
|
||||
value *Hashes
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableHashes) Get() *Hashes {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableHashes) Set(val *Hashes) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableHashes) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableHashes) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableHashes(val *Hashes) *NullableHashes {
|
||||
return &NullableHashes{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableHashes) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableHashes) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+233
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
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 Identity type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Identity{}
|
||||
|
||||
// Identity struct for Identity
|
||||
type Identity struct {
|
||||
// The identity's display name. Note that this may not always be available or up to date. For example, if a user changes their display name, the API may show the new value in a future response, but the items associated with the user won't show up as having changed when using delta.
|
||||
DisplayName string `json:"displayName"`
|
||||
// Unique identifier for the identity.
|
||||
Id *string `json:"id,omitempty"`
|
||||
// The type of the identity. This can be either \"Member\" for regular user, \"Guest\" for guest users or \"Federated\" for users imported from a federated instance. Can be used by clients to indicate the type of user. For more details, clients should look up and cache the user at the /users endpoint.
|
||||
LibreGraphUserType *string `json:"@libre.graph.userType,omitempty"`
|
||||
}
|
||||
|
||||
type _Identity Identity
|
||||
|
||||
// NewIdentity instantiates a new Identity 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 NewIdentity(displayName string) *Identity {
|
||||
this := Identity{}
|
||||
this.DisplayName = displayName
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewIdentityWithDefaults instantiates a new Identity 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 NewIdentityWithDefaults() *Identity {
|
||||
this := Identity{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetDisplayName returns the DisplayName field value
|
||||
func (o *Identity) GetDisplayName() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.DisplayName
|
||||
}
|
||||
|
||||
// GetDisplayNameOk returns a tuple with the DisplayName field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Identity) GetDisplayNameOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.DisplayName, true
|
||||
}
|
||||
|
||||
// SetDisplayName sets field value
|
||||
func (o *Identity) SetDisplayName(v string) {
|
||||
o.DisplayName = v
|
||||
}
|
||||
|
||||
// GetId returns the Id field value if set, zero value otherwise.
|
||||
func (o *Identity) GetId() string {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Identity) GetIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Id, true
|
||||
}
|
||||
|
||||
// HasId returns a boolean if a field has been set.
|
||||
func (o *Identity) HasId() bool {
|
||||
if o != nil && !IsNil(o.Id) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetId gets a reference to the given string and assigns it to the Id field.
|
||||
func (o *Identity) SetId(v string) {
|
||||
o.Id = &v
|
||||
}
|
||||
|
||||
// GetLibreGraphUserType returns the LibreGraphUserType field value if set, zero value otherwise.
|
||||
func (o *Identity) GetLibreGraphUserType() string {
|
||||
if o == nil || IsNil(o.LibreGraphUserType) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.LibreGraphUserType
|
||||
}
|
||||
|
||||
// GetLibreGraphUserTypeOk returns a tuple with the LibreGraphUserType field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Identity) GetLibreGraphUserTypeOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.LibreGraphUserType) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LibreGraphUserType, true
|
||||
}
|
||||
|
||||
// HasLibreGraphUserType returns a boolean if a field has been set.
|
||||
func (o *Identity) HasLibreGraphUserType() bool {
|
||||
if o != nil && !IsNil(o.LibreGraphUserType) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLibreGraphUserType gets a reference to the given string and assigns it to the LibreGraphUserType field.
|
||||
func (o *Identity) SetLibreGraphUserType(v string) {
|
||||
o.LibreGraphUserType = &v
|
||||
}
|
||||
|
||||
func (o Identity) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Identity) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["displayName"] = o.DisplayName
|
||||
if !IsNil(o.Id) {
|
||||
toSerialize["id"] = o.Id
|
||||
}
|
||||
if !IsNil(o.LibreGraphUserType) {
|
||||
toSerialize["@libre.graph.userType"] = o.LibreGraphUserType
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *Identity) 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{
|
||||
"displayName",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varIdentity := _Identity{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varIdentity)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = Identity(varIdentity)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableIdentity struct {
|
||||
value *Identity
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableIdentity) Get() *Identity {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableIdentity) Set(val *Identity) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableIdentity) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableIdentity) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableIdentity(val *Identity) *NullableIdentity {
|
||||
return &NullableIdentity{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableIdentity) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableIdentity) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+234
@@ -0,0 +1,234 @@
|
||||
/*
|
||||
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 IdentitySet type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &IdentitySet{}
|
||||
|
||||
// IdentitySet Optional. User account.
|
||||
type IdentitySet struct {
|
||||
Application *Identity `json:"application,omitempty"`
|
||||
Device *Identity `json:"device,omitempty"`
|
||||
User *Identity `json:"user,omitempty"`
|
||||
Group *Identity `json:"group,omitempty"`
|
||||
}
|
||||
|
||||
// NewIdentitySet instantiates a new IdentitySet 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 NewIdentitySet() *IdentitySet {
|
||||
this := IdentitySet{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewIdentitySetWithDefaults instantiates a new IdentitySet 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 NewIdentitySetWithDefaults() *IdentitySet {
|
||||
this := IdentitySet{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetApplication returns the Application field value if set, zero value otherwise.
|
||||
func (o *IdentitySet) GetApplication() Identity {
|
||||
if o == nil || IsNil(o.Application) {
|
||||
var ret Identity
|
||||
return ret
|
||||
}
|
||||
return *o.Application
|
||||
}
|
||||
|
||||
// GetApplicationOk returns a tuple with the Application field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *IdentitySet) GetApplicationOk() (*Identity, bool) {
|
||||
if o == nil || IsNil(o.Application) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Application, true
|
||||
}
|
||||
|
||||
// HasApplication returns a boolean if a field has been set.
|
||||
func (o *IdentitySet) HasApplication() bool {
|
||||
if o != nil && !IsNil(o.Application) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetApplication gets a reference to the given Identity and assigns it to the Application field.
|
||||
func (o *IdentitySet) SetApplication(v Identity) {
|
||||
o.Application = &v
|
||||
}
|
||||
|
||||
// GetDevice returns the Device field value if set, zero value otherwise.
|
||||
func (o *IdentitySet) GetDevice() Identity {
|
||||
if o == nil || IsNil(o.Device) {
|
||||
var ret Identity
|
||||
return ret
|
||||
}
|
||||
return *o.Device
|
||||
}
|
||||
|
||||
// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *IdentitySet) GetDeviceOk() (*Identity, bool) {
|
||||
if o == nil || IsNil(o.Device) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Device, true
|
||||
}
|
||||
|
||||
// HasDevice returns a boolean if a field has been set.
|
||||
func (o *IdentitySet) HasDevice() bool {
|
||||
if o != nil && !IsNil(o.Device) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDevice gets a reference to the given Identity and assigns it to the Device field.
|
||||
func (o *IdentitySet) SetDevice(v Identity) {
|
||||
o.Device = &v
|
||||
}
|
||||
|
||||
// GetUser returns the User field value if set, zero value otherwise.
|
||||
func (o *IdentitySet) GetUser() Identity {
|
||||
if o == nil || IsNil(o.User) {
|
||||
var ret Identity
|
||||
return ret
|
||||
}
|
||||
return *o.User
|
||||
}
|
||||
|
||||
// GetUserOk returns a tuple with the User field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *IdentitySet) GetUserOk() (*Identity, bool) {
|
||||
if o == nil || IsNil(o.User) {
|
||||
return nil, false
|
||||
}
|
||||
return o.User, true
|
||||
}
|
||||
|
||||
// HasUser returns a boolean if a field has been set.
|
||||
func (o *IdentitySet) HasUser() bool {
|
||||
if o != nil && !IsNil(o.User) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetUser gets a reference to the given Identity and assigns it to the User field.
|
||||
func (o *IdentitySet) SetUser(v Identity) {
|
||||
o.User = &v
|
||||
}
|
||||
|
||||
// GetGroup returns the Group field value if set, zero value otherwise.
|
||||
func (o *IdentitySet) GetGroup() Identity {
|
||||
if o == nil || IsNil(o.Group) {
|
||||
var ret Identity
|
||||
return ret
|
||||
}
|
||||
return *o.Group
|
||||
}
|
||||
|
||||
// GetGroupOk returns a tuple with the Group field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *IdentitySet) GetGroupOk() (*Identity, bool) {
|
||||
if o == nil || IsNil(o.Group) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Group, true
|
||||
}
|
||||
|
||||
// HasGroup returns a boolean if a field has been set.
|
||||
func (o *IdentitySet) HasGroup() bool {
|
||||
if o != nil && !IsNil(o.Group) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetGroup gets a reference to the given Identity and assigns it to the Group field.
|
||||
func (o *IdentitySet) SetGroup(v Identity) {
|
||||
o.Group = &v
|
||||
}
|
||||
|
||||
func (o IdentitySet) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o IdentitySet) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Application) {
|
||||
toSerialize["application"] = o.Application
|
||||
}
|
||||
if !IsNil(o.Device) {
|
||||
toSerialize["device"] = o.Device
|
||||
}
|
||||
if !IsNil(o.User) {
|
||||
toSerialize["user"] = o.User
|
||||
}
|
||||
if !IsNil(o.Group) {
|
||||
toSerialize["group"] = o.Group
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableIdentitySet struct {
|
||||
value *IdentitySet
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableIdentitySet) Get() *IdentitySet {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableIdentitySet) Set(val *IdentitySet) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableIdentitySet) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableIdentitySet) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableIdentitySet(val *IdentitySet) *NullableIdentitySet {
|
||||
return &NullableIdentitySet{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableIdentitySet) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableIdentitySet) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+164
@@ -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 Image type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Image{}
|
||||
|
||||
// Image Image metadata, if the item is an image. Read-only.
|
||||
type Image struct {
|
||||
// Optional. Height of the image, in pixels. Read-only.
|
||||
Height *int32 `json:"height,omitempty"`
|
||||
// Optional. Width of the image, in pixels. Read-only.
|
||||
Width *int32 `json:"width,omitempty"`
|
||||
}
|
||||
|
||||
// NewImage instantiates a new Image 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 NewImage() *Image {
|
||||
this := Image{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewImageWithDefaults instantiates a new Image 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 NewImageWithDefaults() *Image {
|
||||
this := Image{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetHeight returns the Height field value if set, zero value otherwise.
|
||||
func (o *Image) GetHeight() int32 {
|
||||
if o == nil || IsNil(o.Height) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.Height
|
||||
}
|
||||
|
||||
// GetHeightOk returns a tuple with the Height field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Image) GetHeightOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.Height) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Height, true
|
||||
}
|
||||
|
||||
// HasHeight returns a boolean if a field has been set.
|
||||
func (o *Image) HasHeight() bool {
|
||||
if o != nil && !IsNil(o.Height) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetHeight gets a reference to the given int32 and assigns it to the Height field.
|
||||
func (o *Image) SetHeight(v int32) {
|
||||
o.Height = &v
|
||||
}
|
||||
|
||||
// GetWidth returns the Width field value if set, zero value otherwise.
|
||||
func (o *Image) GetWidth() int32 {
|
||||
if o == nil || IsNil(o.Width) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.Width
|
||||
}
|
||||
|
||||
// GetWidthOk returns a tuple with the Width field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Image) GetWidthOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.Width) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Width, true
|
||||
}
|
||||
|
||||
// HasWidth returns a boolean if a field has been set.
|
||||
func (o *Image) HasWidth() bool {
|
||||
if o != nil && !IsNil(o.Width) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetWidth gets a reference to the given int32 and assigns it to the Width field.
|
||||
func (o *Image) SetWidth(v int32) {
|
||||
o.Width = &v
|
||||
}
|
||||
|
||||
func (o Image) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Image) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Height) {
|
||||
toSerialize["height"] = o.Height
|
||||
}
|
||||
if !IsNil(o.Width) {
|
||||
toSerialize["width"] = o.Width
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableImage struct {
|
||||
value *Image
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableImage) Get() *Image {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableImage) Set(val *Image) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableImage) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableImage) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableImage(val *Image) *NullableImage {
|
||||
return &NullableImage{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableImage) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableImage) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+275
@@ -0,0 +1,275 @@
|
||||
/*
|
||||
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 ItemReference type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ItemReference{}
|
||||
|
||||
// ItemReference struct for ItemReference
|
||||
type ItemReference struct {
|
||||
// Unique identifier of the drive instance that contains the item. Read-only.
|
||||
DriveId *string `json:"driveId,omitempty"`
|
||||
// Identifies the type of drive. See [drive][] resource for values. Read-only.
|
||||
DriveType *string `json:"driveType,omitempty"`
|
||||
// Unique identifier of the item in the drive. Read-only.
|
||||
Id *string `json:"id,omitempty"`
|
||||
// The name of the item being referenced. Read-only.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// Path that can be used to navigate to the item. Read-only.
|
||||
Path *string `json:"path,omitempty"`
|
||||
}
|
||||
|
||||
// NewItemReference instantiates a new ItemReference 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 NewItemReference() *ItemReference {
|
||||
this := ItemReference{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewItemReferenceWithDefaults instantiates a new ItemReference 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 NewItemReferenceWithDefaults() *ItemReference {
|
||||
this := ItemReference{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetDriveId returns the DriveId field value if set, zero value otherwise.
|
||||
func (o *ItemReference) GetDriveId() string {
|
||||
if o == nil || IsNil(o.DriveId) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DriveId
|
||||
}
|
||||
|
||||
// GetDriveIdOk returns a tuple with the DriveId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ItemReference) GetDriveIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.DriveId) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DriveId, true
|
||||
}
|
||||
|
||||
// HasDriveId returns a boolean if a field has been set.
|
||||
func (o *ItemReference) HasDriveId() bool {
|
||||
if o != nil && !IsNil(o.DriveId) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDriveId gets a reference to the given string and assigns it to the DriveId field.
|
||||
func (o *ItemReference) SetDriveId(v string) {
|
||||
o.DriveId = &v
|
||||
}
|
||||
|
||||
// GetDriveType returns the DriveType field value if set, zero value otherwise.
|
||||
func (o *ItemReference) GetDriveType() string {
|
||||
if o == nil || IsNil(o.DriveType) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DriveType
|
||||
}
|
||||
|
||||
// GetDriveTypeOk returns a tuple with the DriveType field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ItemReference) GetDriveTypeOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.DriveType) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DriveType, true
|
||||
}
|
||||
|
||||
// HasDriveType returns a boolean if a field has been set.
|
||||
func (o *ItemReference) HasDriveType() bool {
|
||||
if o != nil && !IsNil(o.DriveType) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDriveType gets a reference to the given string and assigns it to the DriveType field.
|
||||
func (o *ItemReference) SetDriveType(v string) {
|
||||
o.DriveType = &v
|
||||
}
|
||||
|
||||
// GetId returns the Id field value if set, zero value otherwise.
|
||||
func (o *ItemReference) GetId() string {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ItemReference) GetIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Id, true
|
||||
}
|
||||
|
||||
// HasId returns a boolean if a field has been set.
|
||||
func (o *ItemReference) HasId() bool {
|
||||
if o != nil && !IsNil(o.Id) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetId gets a reference to the given string and assigns it to the Id field.
|
||||
func (o *ItemReference) SetId(v string) {
|
||||
o.Id = &v
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *ItemReference) 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 *ItemReference) 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 *ItemReference) 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 *ItemReference) SetName(v string) {
|
||||
o.Name = &v
|
||||
}
|
||||
|
||||
// GetPath returns the Path field value if set, zero value otherwise.
|
||||
func (o *ItemReference) GetPath() string {
|
||||
if o == nil || IsNil(o.Path) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Path
|
||||
}
|
||||
|
||||
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ItemReference) GetPathOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Path) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Path, true
|
||||
}
|
||||
|
||||
// HasPath returns a boolean if a field has been set.
|
||||
func (o *ItemReference) HasPath() bool {
|
||||
if o != nil && !IsNil(o.Path) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPath gets a reference to the given string and assigns it to the Path field.
|
||||
func (o *ItemReference) SetPath(v string) {
|
||||
o.Path = &v
|
||||
}
|
||||
|
||||
func (o ItemReference) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o ItemReference) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.DriveId) {
|
||||
toSerialize["driveId"] = o.DriveId
|
||||
}
|
||||
if !IsNil(o.DriveType) {
|
||||
toSerialize["driveType"] = o.DriveType
|
||||
}
|
||||
if !IsNil(o.Id) {
|
||||
toSerialize["id"] = o.Id
|
||||
}
|
||||
if !IsNil(o.Name) {
|
||||
toSerialize["name"] = o.Name
|
||||
}
|
||||
if !IsNil(o.Path) {
|
||||
toSerialize["path"] = o.Path
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableItemReference struct {
|
||||
value *ItemReference
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableItemReference) Get() *ItemReference {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableItemReference) Set(val *ItemReference) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableItemReference) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableItemReference) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableItemReference(val *ItemReference) *NullableItemReference {
|
||||
return &NullableItemReference{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableItemReference) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableItemReference) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 MemberReference type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &MemberReference{}
|
||||
|
||||
// MemberReference struct for MemberReference
|
||||
type MemberReference struct {
|
||||
OdataId *string `json:"@odata.id,omitempty"`
|
||||
}
|
||||
|
||||
// NewMemberReference instantiates a new MemberReference 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 NewMemberReference() *MemberReference {
|
||||
this := MemberReference{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewMemberReferenceWithDefaults instantiates a new MemberReference 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 NewMemberReferenceWithDefaults() *MemberReference {
|
||||
this := MemberReference{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetOdataId returns the OdataId field value if set, zero value otherwise.
|
||||
func (o *MemberReference) GetOdataId() string {
|
||||
if o == nil || IsNil(o.OdataId) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.OdataId
|
||||
}
|
||||
|
||||
// GetOdataIdOk returns a tuple with the OdataId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *MemberReference) GetOdataIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.OdataId) {
|
||||
return nil, false
|
||||
}
|
||||
return o.OdataId, true
|
||||
}
|
||||
|
||||
// HasOdataId returns a boolean if a field has been set.
|
||||
func (o *MemberReference) HasOdataId() bool {
|
||||
if o != nil && !IsNil(o.OdataId) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOdataId gets a reference to the given string and assigns it to the OdataId field.
|
||||
func (o *MemberReference) SetOdataId(v string) {
|
||||
o.OdataId = &v
|
||||
}
|
||||
|
||||
func (o MemberReference) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o MemberReference) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.OdataId) {
|
||||
toSerialize["@odata.id"] = o.OdataId
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableMemberReference struct {
|
||||
value *MemberReference
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableMemberReference) Get() *MemberReference {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableMemberReference) Set(val *MemberReference) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableMemberReference) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableMemberReference) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableMemberReference(val *MemberReference) *NullableMemberReference {
|
||||
return &NullableMemberReference{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableMemberReference) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableMemberReference) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+164
@@ -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 ObjectIdentity type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &ObjectIdentity{}
|
||||
|
||||
// ObjectIdentity Represents an identity used to sign in to a user account
|
||||
type ObjectIdentity struct {
|
||||
// domain of the Provider issuing the identity
|
||||
Issuer *string `json:"issuer,omitempty"`
|
||||
// The unique id assigned by the issuer to the account
|
||||
IssuerAssignedId *string `json:"issuerAssignedId,omitempty"`
|
||||
}
|
||||
|
||||
// NewObjectIdentity instantiates a new ObjectIdentity 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 NewObjectIdentity() *ObjectIdentity {
|
||||
this := ObjectIdentity{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewObjectIdentityWithDefaults instantiates a new ObjectIdentity 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 NewObjectIdentityWithDefaults() *ObjectIdentity {
|
||||
this := ObjectIdentity{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetIssuer returns the Issuer field value if set, zero value otherwise.
|
||||
func (o *ObjectIdentity) GetIssuer() string {
|
||||
if o == nil || IsNil(o.Issuer) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Issuer
|
||||
}
|
||||
|
||||
// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ObjectIdentity) GetIssuerOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Issuer) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Issuer, true
|
||||
}
|
||||
|
||||
// HasIssuer returns a boolean if a field has been set.
|
||||
func (o *ObjectIdentity) HasIssuer() bool {
|
||||
if o != nil && !IsNil(o.Issuer) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIssuer gets a reference to the given string and assigns it to the Issuer field.
|
||||
func (o *ObjectIdentity) SetIssuer(v string) {
|
||||
o.Issuer = &v
|
||||
}
|
||||
|
||||
// GetIssuerAssignedId returns the IssuerAssignedId field value if set, zero value otherwise.
|
||||
func (o *ObjectIdentity) GetIssuerAssignedId() string {
|
||||
if o == nil || IsNil(o.IssuerAssignedId) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.IssuerAssignedId
|
||||
}
|
||||
|
||||
// GetIssuerAssignedIdOk returns a tuple with the IssuerAssignedId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *ObjectIdentity) GetIssuerAssignedIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.IssuerAssignedId) {
|
||||
return nil, false
|
||||
}
|
||||
return o.IssuerAssignedId, true
|
||||
}
|
||||
|
||||
// HasIssuerAssignedId returns a boolean if a field has been set.
|
||||
func (o *ObjectIdentity) HasIssuerAssignedId() bool {
|
||||
if o != nil && !IsNil(o.IssuerAssignedId) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIssuerAssignedId gets a reference to the given string and assigns it to the IssuerAssignedId field.
|
||||
func (o *ObjectIdentity) SetIssuerAssignedId(v string) {
|
||||
o.IssuerAssignedId = &v
|
||||
}
|
||||
|
||||
func (o ObjectIdentity) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o ObjectIdentity) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Issuer) {
|
||||
toSerialize["issuer"] = o.Issuer
|
||||
}
|
||||
if !IsNil(o.IssuerAssignedId) {
|
||||
toSerialize["issuerAssignedId"] = o.IssuerAssignedId
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableObjectIdentity struct {
|
||||
value *ObjectIdentity
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableObjectIdentity) Get() *ObjectIdentity {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableObjectIdentity) Set(val *ObjectIdentity) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableObjectIdentity) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableObjectIdentity) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableObjectIdentity(val *ObjectIdentity) *NullableObjectIdentity {
|
||||
return &NullableObjectIdentity{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableObjectIdentity) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableObjectIdentity) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"bytes"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// checks if the OdataError type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &OdataError{}
|
||||
|
||||
// OdataError struct for OdataError
|
||||
type OdataError struct {
|
||||
Error OdataErrorMain `json:"error"`
|
||||
}
|
||||
|
||||
type _OdataError OdataError
|
||||
|
||||
// NewOdataError instantiates a new OdataError 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 NewOdataError(error_ OdataErrorMain) *OdataError {
|
||||
this := OdataError{}
|
||||
this.Error = error_
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewOdataErrorWithDefaults instantiates a new OdataError 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 NewOdataErrorWithDefaults() *OdataError {
|
||||
this := OdataError{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetError returns the Error field value
|
||||
func (o *OdataError) GetError() OdataErrorMain {
|
||||
if o == nil {
|
||||
var ret OdataErrorMain
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Error
|
||||
}
|
||||
|
||||
// GetErrorOk returns a tuple with the Error field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OdataError) GetErrorOk() (*OdataErrorMain, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Error, true
|
||||
}
|
||||
|
||||
// SetError sets field value
|
||||
func (o *OdataError) SetError(v OdataErrorMain) {
|
||||
o.Error = v
|
||||
}
|
||||
|
||||
func (o OdataError) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o OdataError) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["error"] = o.Error
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *OdataError) 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{
|
||||
"error",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varOdataError := _OdataError{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varOdataError)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = OdataError(varOdataError)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableOdataError struct {
|
||||
value *OdataError
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableOdataError) Get() *OdataError {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableOdataError) Set(val *OdataError) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableOdataError) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableOdataError) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableOdataError(val *OdataError) *NullableOdataError {
|
||||
return &NullableOdataError{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableOdataError) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableOdataError) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+222
@@ -0,0 +1,222 @@
|
||||
/*
|
||||
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 OdataErrorDetail type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &OdataErrorDetail{}
|
||||
|
||||
// OdataErrorDetail struct for OdataErrorDetail
|
||||
type OdataErrorDetail struct {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Target *string `json:"target,omitempty"`
|
||||
}
|
||||
|
||||
type _OdataErrorDetail OdataErrorDetail
|
||||
|
||||
// NewOdataErrorDetail instantiates a new OdataErrorDetail 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 NewOdataErrorDetail(code string, message string) *OdataErrorDetail {
|
||||
this := OdataErrorDetail{}
|
||||
this.Code = code
|
||||
this.Message = message
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewOdataErrorDetailWithDefaults instantiates a new OdataErrorDetail 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 NewOdataErrorDetailWithDefaults() *OdataErrorDetail {
|
||||
this := OdataErrorDetail{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCode returns the Code field value
|
||||
func (o *OdataErrorDetail) GetCode() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Code
|
||||
}
|
||||
|
||||
// GetCodeOk returns a tuple with the Code field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OdataErrorDetail) GetCodeOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Code, true
|
||||
}
|
||||
|
||||
// SetCode sets field value
|
||||
func (o *OdataErrorDetail) SetCode(v string) {
|
||||
o.Code = v
|
||||
}
|
||||
|
||||
// GetMessage returns the Message field value
|
||||
func (o *OdataErrorDetail) GetMessage() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Message
|
||||
}
|
||||
|
||||
// GetMessageOk returns a tuple with the Message field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OdataErrorDetail) GetMessageOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Message, true
|
||||
}
|
||||
|
||||
// SetMessage sets field value
|
||||
func (o *OdataErrorDetail) SetMessage(v string) {
|
||||
o.Message = v
|
||||
}
|
||||
|
||||
// GetTarget returns the Target field value if set, zero value otherwise.
|
||||
func (o *OdataErrorDetail) GetTarget() string {
|
||||
if o == nil || IsNil(o.Target) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Target
|
||||
}
|
||||
|
||||
// GetTargetOk returns a tuple with the Target field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OdataErrorDetail) GetTargetOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Target) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Target, true
|
||||
}
|
||||
|
||||
// HasTarget returns a boolean if a field has been set.
|
||||
func (o *OdataErrorDetail) HasTarget() bool {
|
||||
if o != nil && !IsNil(o.Target) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetTarget gets a reference to the given string and assigns it to the Target field.
|
||||
func (o *OdataErrorDetail) SetTarget(v string) {
|
||||
o.Target = &v
|
||||
}
|
||||
|
||||
func (o OdataErrorDetail) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o OdataErrorDetail) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["code"] = o.Code
|
||||
toSerialize["message"] = o.Message
|
||||
if !IsNil(o.Target) {
|
||||
toSerialize["target"] = o.Target
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *OdataErrorDetail) 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{
|
||||
"code",
|
||||
"message",
|
||||
}
|
||||
|
||||
allProperties := make(map[string]interface{})
|
||||
|
||||
err = json.Unmarshal(data, &allProperties)
|
||||
|
||||
if err != nil {
|
||||
return err;
|
||||
}
|
||||
|
||||
for _, requiredProperty := range(requiredProperties) {
|
||||
if _, exists := allProperties[requiredProperty]; !exists {
|
||||
return fmt.Errorf("no value given for required property %v", requiredProperty)
|
||||
}
|
||||
}
|
||||
|
||||
varOdataErrorDetail := _OdataErrorDetail{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varOdataErrorDetail)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = OdataErrorDetail(varOdataErrorDetail)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableOdataErrorDetail struct {
|
||||
value *OdataErrorDetail
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableOdataErrorDetail) Get() *OdataErrorDetail {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableOdataErrorDetail) Set(val *OdataErrorDetail) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableOdataErrorDetail) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableOdataErrorDetail) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableOdataErrorDetail(val *OdataErrorDetail) *NullableOdataErrorDetail {
|
||||
return &NullableOdataErrorDetail{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableOdataErrorDetail) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableOdataErrorDetail) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+295
@@ -0,0 +1,295 @@
|
||||
/*
|
||||
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 OdataErrorMain type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &OdataErrorMain{}
|
||||
|
||||
// OdataErrorMain struct for OdataErrorMain
|
||||
type OdataErrorMain struct {
|
||||
Code string `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Target *string `json:"target,omitempty"`
|
||||
Details []OdataErrorDetail `json:"details,omitempty"`
|
||||
// The structure of this object is service-specific
|
||||
Innererror map[string]interface{} `json:"innererror,omitempty"`
|
||||
}
|
||||
|
||||
type _OdataErrorMain OdataErrorMain
|
||||
|
||||
// NewOdataErrorMain instantiates a new OdataErrorMain 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 NewOdataErrorMain(code string, message string) *OdataErrorMain {
|
||||
this := OdataErrorMain{}
|
||||
this.Code = code
|
||||
this.Message = message
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewOdataErrorMainWithDefaults instantiates a new OdataErrorMain 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 NewOdataErrorMainWithDefaults() *OdataErrorMain {
|
||||
this := OdataErrorMain{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCode returns the Code field value
|
||||
func (o *OdataErrorMain) GetCode() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Code
|
||||
}
|
||||
|
||||
// GetCodeOk returns a tuple with the Code field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OdataErrorMain) GetCodeOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Code, true
|
||||
}
|
||||
|
||||
// SetCode sets field value
|
||||
func (o *OdataErrorMain) SetCode(v string) {
|
||||
o.Code = v
|
||||
}
|
||||
|
||||
// GetMessage returns the Message field value
|
||||
func (o *OdataErrorMain) GetMessage() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.Message
|
||||
}
|
||||
|
||||
// GetMessageOk returns a tuple with the Message field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OdataErrorMain) GetMessageOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.Message, true
|
||||
}
|
||||
|
||||
// SetMessage sets field value
|
||||
func (o *OdataErrorMain) SetMessage(v string) {
|
||||
o.Message = v
|
||||
}
|
||||
|
||||
// GetTarget returns the Target field value if set, zero value otherwise.
|
||||
func (o *OdataErrorMain) GetTarget() string {
|
||||
if o == nil || IsNil(o.Target) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Target
|
||||
}
|
||||
|
||||
// GetTargetOk returns a tuple with the Target field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OdataErrorMain) GetTargetOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Target) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Target, true
|
||||
}
|
||||
|
||||
// HasTarget returns a boolean if a field has been set.
|
||||
func (o *OdataErrorMain) HasTarget() bool {
|
||||
if o != nil && !IsNil(o.Target) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetTarget gets a reference to the given string and assigns it to the Target field.
|
||||
func (o *OdataErrorMain) SetTarget(v string) {
|
||||
o.Target = &v
|
||||
}
|
||||
|
||||
// GetDetails returns the Details field value if set, zero value otherwise.
|
||||
func (o *OdataErrorMain) GetDetails() []OdataErrorDetail {
|
||||
if o == nil || IsNil(o.Details) {
|
||||
var ret []OdataErrorDetail
|
||||
return ret
|
||||
}
|
||||
return o.Details
|
||||
}
|
||||
|
||||
// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OdataErrorMain) GetDetailsOk() ([]OdataErrorDetail, bool) {
|
||||
if o == nil || IsNil(o.Details) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Details, true
|
||||
}
|
||||
|
||||
// HasDetails returns a boolean if a field has been set.
|
||||
func (o *OdataErrorMain) HasDetails() bool {
|
||||
if o != nil && !IsNil(o.Details) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDetails gets a reference to the given []OdataErrorDetail and assigns it to the Details field.
|
||||
func (o *OdataErrorMain) SetDetails(v []OdataErrorDetail) {
|
||||
o.Details = v
|
||||
}
|
||||
|
||||
// GetInnererror returns the Innererror field value if set, zero value otherwise.
|
||||
func (o *OdataErrorMain) GetInnererror() map[string]interface{} {
|
||||
if o == nil || IsNil(o.Innererror) {
|
||||
var ret map[string]interface{}
|
||||
return ret
|
||||
}
|
||||
return o.Innererror
|
||||
}
|
||||
|
||||
// GetInnererrorOk returns a tuple with the Innererror field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OdataErrorMain) GetInnererrorOk() (map[string]interface{}, bool) {
|
||||
if o == nil || IsNil(o.Innererror) {
|
||||
return map[string]interface{}{}, false
|
||||
}
|
||||
return o.Innererror, true
|
||||
}
|
||||
|
||||
// HasInnererror returns a boolean if a field has been set.
|
||||
func (o *OdataErrorMain) HasInnererror() bool {
|
||||
if o != nil && !IsNil(o.Innererror) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetInnererror gets a reference to the given map[string]interface{} and assigns it to the Innererror field.
|
||||
func (o *OdataErrorMain) SetInnererror(v map[string]interface{}) {
|
||||
o.Innererror = v
|
||||
}
|
||||
|
||||
func (o OdataErrorMain) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o OdataErrorMain) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["code"] = o.Code
|
||||
toSerialize["message"] = o.Message
|
||||
if !IsNil(o.Target) {
|
||||
toSerialize["target"] = o.Target
|
||||
}
|
||||
if !IsNil(o.Details) {
|
||||
toSerialize["details"] = o.Details
|
||||
}
|
||||
if !IsNil(o.Innererror) {
|
||||
toSerialize["innererror"] = o.Innererror
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *OdataErrorMain) 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{
|
||||
"code",
|
||||
"message",
|
||||
}
|
||||
|
||||
allProperties := make(map[string]interface{})
|
||||
|
||||
err = json.Unmarshal(data, &allProperties)
|
||||
|
||||
if err != nil {
|
||||
return err;
|
||||
}
|
||||
|
||||
for _, requiredProperty := range(requiredProperties) {
|
||||
if _, exists := allProperties[requiredProperty]; !exists {
|
||||
return fmt.Errorf("no value given for required property %v", requiredProperty)
|
||||
}
|
||||
}
|
||||
|
||||
varOdataErrorMain := _OdataErrorMain{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varOdataErrorMain)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = OdataErrorMain(varOdataErrorMain)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullableOdataErrorMain struct {
|
||||
value *OdataErrorMain
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableOdataErrorMain) Get() *OdataErrorMain {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableOdataErrorMain) Set(val *OdataErrorMain) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableOdataErrorMain) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableOdataErrorMain) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableOdataErrorMain(val *OdataErrorMain) *NullableOdataErrorMain {
|
||||
return &NullableOdataErrorMain{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableOdataErrorMain) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableOdataErrorMain) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+199
@@ -0,0 +1,199 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the OpenGraphFile type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &OpenGraphFile{}
|
||||
|
||||
// OpenGraphFile File metadata, if the item is a file. Read-only.
|
||||
type OpenGraphFile struct {
|
||||
Hashes *Hashes `json:"hashes,omitempty"`
|
||||
// The MIME type for the file. This is determined by logic on the server and might not be the value provided when the file was uploaded. Read-only.
|
||||
MimeType *string `json:"mimeType,omitempty"`
|
||||
ProcessingMetadata *bool `json:"processingMetadata,omitempty"`
|
||||
}
|
||||
|
||||
// NewOpenGraphFile instantiates a new OpenGraphFile 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 NewOpenGraphFile() *OpenGraphFile {
|
||||
this := OpenGraphFile{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewOpenGraphFileWithDefaults instantiates a new OpenGraphFile 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 NewOpenGraphFileWithDefaults() *OpenGraphFile {
|
||||
this := OpenGraphFile{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetHashes returns the Hashes field value if set, zero value otherwise.
|
||||
func (o *OpenGraphFile) GetHashes() Hashes {
|
||||
if o == nil || IsNil(o.Hashes) {
|
||||
var ret Hashes
|
||||
return ret
|
||||
}
|
||||
return *o.Hashes
|
||||
}
|
||||
|
||||
// GetHashesOk returns a tuple with the Hashes field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OpenGraphFile) GetHashesOk() (*Hashes, bool) {
|
||||
if o == nil || IsNil(o.Hashes) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Hashes, true
|
||||
}
|
||||
|
||||
// HasHashes returns a boolean if a field has been set.
|
||||
func (o *OpenGraphFile) HasHashes() bool {
|
||||
if o != nil && !IsNil(o.Hashes) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetHashes gets a reference to the given Hashes and assigns it to the Hashes field.
|
||||
func (o *OpenGraphFile) SetHashes(v Hashes) {
|
||||
o.Hashes = &v
|
||||
}
|
||||
|
||||
// GetMimeType returns the MimeType field value if set, zero value otherwise.
|
||||
func (o *OpenGraphFile) GetMimeType() string {
|
||||
if o == nil || IsNil(o.MimeType) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.MimeType
|
||||
}
|
||||
|
||||
// GetMimeTypeOk returns a tuple with the MimeType field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OpenGraphFile) GetMimeTypeOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.MimeType) {
|
||||
return nil, false
|
||||
}
|
||||
return o.MimeType, true
|
||||
}
|
||||
|
||||
// HasMimeType returns a boolean if a field has been set.
|
||||
func (o *OpenGraphFile) HasMimeType() bool {
|
||||
if o != nil && !IsNil(o.MimeType) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetMimeType gets a reference to the given string and assigns it to the MimeType field.
|
||||
func (o *OpenGraphFile) SetMimeType(v string) {
|
||||
o.MimeType = &v
|
||||
}
|
||||
|
||||
// GetProcessingMetadata returns the ProcessingMetadata field value if set, zero value otherwise.
|
||||
func (o *OpenGraphFile) GetProcessingMetadata() bool {
|
||||
if o == nil || IsNil(o.ProcessingMetadata) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.ProcessingMetadata
|
||||
}
|
||||
|
||||
// GetProcessingMetadataOk returns a tuple with the ProcessingMetadata field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *OpenGraphFile) GetProcessingMetadataOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.ProcessingMetadata) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ProcessingMetadata, true
|
||||
}
|
||||
|
||||
// HasProcessingMetadata returns a boolean if a field has been set.
|
||||
func (o *OpenGraphFile) HasProcessingMetadata() bool {
|
||||
if o != nil && !IsNil(o.ProcessingMetadata) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetProcessingMetadata gets a reference to the given bool and assigns it to the ProcessingMetadata field.
|
||||
func (o *OpenGraphFile) SetProcessingMetadata(v bool) {
|
||||
o.ProcessingMetadata = &v
|
||||
}
|
||||
|
||||
func (o OpenGraphFile) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o OpenGraphFile) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Hashes) {
|
||||
toSerialize["hashes"] = o.Hashes
|
||||
}
|
||||
if !IsNil(o.MimeType) {
|
||||
toSerialize["mimeType"] = o.MimeType
|
||||
}
|
||||
if !IsNil(o.ProcessingMetadata) {
|
||||
toSerialize["processingMetadata"] = o.ProcessingMetadata
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableOpenGraphFile struct {
|
||||
value *OpenGraphFile
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableOpenGraphFile) Get() *OpenGraphFile {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableOpenGraphFile) Set(val *OpenGraphFile) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableOpenGraphFile) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableOpenGraphFile) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableOpenGraphFile(val *OpenGraphFile) *NullableOpenGraphFile {
|
||||
return &NullableOpenGraphFile{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableOpenGraphFile) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableOpenGraphFile) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+186
@@ -0,0 +1,186 @@
|
||||
/*
|
||||
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 PasswordChange type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &PasswordChange{}
|
||||
|
||||
// PasswordChange struct for PasswordChange
|
||||
type PasswordChange struct {
|
||||
CurrentPassword string `json:"currentPassword"`
|
||||
NewPassword string `json:"newPassword"`
|
||||
}
|
||||
|
||||
type _PasswordChange PasswordChange
|
||||
|
||||
// NewPasswordChange instantiates a new PasswordChange 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 NewPasswordChange(currentPassword string, newPassword string) *PasswordChange {
|
||||
this := PasswordChange{}
|
||||
this.CurrentPassword = currentPassword
|
||||
this.NewPassword = newPassword
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewPasswordChangeWithDefaults instantiates a new PasswordChange 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 NewPasswordChangeWithDefaults() *PasswordChange {
|
||||
this := PasswordChange{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCurrentPassword returns the CurrentPassword field value
|
||||
func (o *PasswordChange) GetCurrentPassword() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.CurrentPassword
|
||||
}
|
||||
|
||||
// GetCurrentPasswordOk returns a tuple with the CurrentPassword field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *PasswordChange) GetCurrentPasswordOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.CurrentPassword, true
|
||||
}
|
||||
|
||||
// SetCurrentPassword sets field value
|
||||
func (o *PasswordChange) SetCurrentPassword(v string) {
|
||||
o.CurrentPassword = v
|
||||
}
|
||||
|
||||
// GetNewPassword returns the NewPassword field value
|
||||
func (o *PasswordChange) GetNewPassword() string {
|
||||
if o == nil {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
|
||||
return o.NewPassword
|
||||
}
|
||||
|
||||
// GetNewPasswordOk returns a tuple with the NewPassword field value
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *PasswordChange) GetNewPasswordOk() (*string, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return &o.NewPassword, true
|
||||
}
|
||||
|
||||
// SetNewPassword sets field value
|
||||
func (o *PasswordChange) SetNewPassword(v string) {
|
||||
o.NewPassword = v
|
||||
}
|
||||
|
||||
func (o PasswordChange) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o PasswordChange) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
toSerialize["currentPassword"] = o.CurrentPassword
|
||||
toSerialize["newPassword"] = o.NewPassword
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
func (o *PasswordChange) 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{
|
||||
"currentPassword",
|
||||
"newPassword",
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
varPasswordChange := _PasswordChange{}
|
||||
|
||||
decoder := json.NewDecoder(bytes.NewReader(data))
|
||||
decoder.DisallowUnknownFields()
|
||||
err = decoder.Decode(&varPasswordChange)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
*o = PasswordChange(varPasswordChange)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
type NullablePasswordChange struct {
|
||||
value *PasswordChange
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullablePasswordChange) Get() *PasswordChange {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullablePasswordChange) Set(val *PasswordChange) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullablePasswordChange) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullablePasswordChange) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullablePasswordChange(val *PasswordChange) *NullablePasswordChange {
|
||||
return &NullablePasswordChange{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullablePasswordChange) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullablePasswordChange) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+168
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
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 PasswordProfile type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &PasswordProfile{}
|
||||
|
||||
// PasswordProfile Password Profile associated with a user
|
||||
type PasswordProfile struct {
|
||||
// If true the user is required to change their password upon the next login
|
||||
ForceChangePasswordNextSignIn *bool `json:"forceChangePasswordNextSignIn,omitempty"`
|
||||
// The user's password
|
||||
Password *string `json:"password,omitempty"`
|
||||
}
|
||||
|
||||
// NewPasswordProfile instantiates a new PasswordProfile 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 NewPasswordProfile() *PasswordProfile {
|
||||
this := PasswordProfile{}
|
||||
var forceChangePasswordNextSignIn bool = false
|
||||
this.ForceChangePasswordNextSignIn = &forceChangePasswordNextSignIn
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewPasswordProfileWithDefaults instantiates a new PasswordProfile 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 NewPasswordProfileWithDefaults() *PasswordProfile {
|
||||
this := PasswordProfile{}
|
||||
var forceChangePasswordNextSignIn bool = false
|
||||
this.ForceChangePasswordNextSignIn = &forceChangePasswordNextSignIn
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetForceChangePasswordNextSignIn returns the ForceChangePasswordNextSignIn field value if set, zero value otherwise.
|
||||
func (o *PasswordProfile) GetForceChangePasswordNextSignIn() bool {
|
||||
if o == nil || IsNil(o.ForceChangePasswordNextSignIn) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.ForceChangePasswordNextSignIn
|
||||
}
|
||||
|
||||
// GetForceChangePasswordNextSignInOk returns a tuple with the ForceChangePasswordNextSignIn field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *PasswordProfile) GetForceChangePasswordNextSignInOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.ForceChangePasswordNextSignIn) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ForceChangePasswordNextSignIn, true
|
||||
}
|
||||
|
||||
// HasForceChangePasswordNextSignIn returns a boolean if a field has been set.
|
||||
func (o *PasswordProfile) HasForceChangePasswordNextSignIn() bool {
|
||||
if o != nil && !IsNil(o.ForceChangePasswordNextSignIn) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetForceChangePasswordNextSignIn gets a reference to the given bool and assigns it to the ForceChangePasswordNextSignIn field.
|
||||
func (o *PasswordProfile) SetForceChangePasswordNextSignIn(v bool) {
|
||||
o.ForceChangePasswordNextSignIn = &v
|
||||
}
|
||||
|
||||
// GetPassword returns the Password field value if set, zero value otherwise.
|
||||
func (o *PasswordProfile) GetPassword() string {
|
||||
if o == nil || IsNil(o.Password) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Password
|
||||
}
|
||||
|
||||
// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *PasswordProfile) GetPasswordOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Password) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Password, true
|
||||
}
|
||||
|
||||
// HasPassword returns a boolean if a field has been set.
|
||||
func (o *PasswordProfile) HasPassword() bool {
|
||||
if o != nil && !IsNil(o.Password) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPassword gets a reference to the given string and assigns it to the Password field.
|
||||
func (o *PasswordProfile) SetPassword(v string) {
|
||||
o.Password = &v
|
||||
}
|
||||
|
||||
func (o PasswordProfile) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o PasswordProfile) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.ForceChangePasswordNextSignIn) {
|
||||
toSerialize["forceChangePasswordNextSignIn"] = o.ForceChangePasswordNextSignIn
|
||||
}
|
||||
if !IsNil(o.Password) {
|
||||
toSerialize["password"] = o.Password
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullablePasswordProfile struct {
|
||||
value *PasswordProfile
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullablePasswordProfile) Get() *PasswordProfile {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullablePasswordProfile) Set(val *PasswordProfile) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullablePasswordProfile) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullablePasswordProfile) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullablePasswordProfile(val *PasswordProfile) *NullablePasswordProfile {
|
||||
return &NullablePasswordProfile{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullablePasswordProfile) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullablePasswordProfile) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+481
@@ -0,0 +1,481 @@
|
||||
/*
|
||||
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"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the Permission type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Permission{}
|
||||
|
||||
// Permission The Permission resource provides information about a sharing permission granted for a DriveItem resource. ### Remarks The Permission resource uses *facets* to provide information about the kind of permission represented by the resource. Permissions with a `link` facet represent sharing links created on the item. Sharing links contain a unique token that provides access to the item for anyone with the link. Permissions with a `invitation` facet represent permissions added by inviting specific users or groups to have access to the file.
|
||||
type Permission struct {
|
||||
// The unique identifier of the permission among all permissions on the item. Read-only.
|
||||
Id *string `json:"id,omitempty"`
|
||||
// Indicates whether the password is set for this permission. This property only appears in the response. Optional. Read-only.
|
||||
HasPassword *bool `json:"hasPassword,omitempty"`
|
||||
// An optional expiration date which limits the permission in time.
|
||||
ExpirationDateTime NullableTime `json:"expirationDateTime,omitempty"`
|
||||
// An optional creation date. Libregraph only.
|
||||
CreatedDateTime NullableTime `json:"createdDateTime,omitempty"`
|
||||
GrantedToV2 *SharePointIdentitySet `json:"grantedToV2,omitempty"`
|
||||
Link *SharingLink `json:"link,omitempty"`
|
||||
Roles []string `json:"roles,omitempty"`
|
||||
// For link type permissions, the details of the identity to whom permission was granted. This could be used to grant access to a an external user that can be identified by email, aka guest accounts.
|
||||
// Deprecated
|
||||
GrantedToIdentities []IdentitySet `json:"grantedToIdentities,omitempty"`
|
||||
// Use this to create a permission with custom actions.
|
||||
LibreGraphPermissionsActions []string `json:"@libre.graph.permissions.actions,omitempty"`
|
||||
Invitation *SharingInvitation `json:"invitation,omitempty"`
|
||||
}
|
||||
|
||||
// NewPermission instantiates a new Permission 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 NewPermission() *Permission {
|
||||
this := Permission{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewPermissionWithDefaults instantiates a new Permission 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 NewPermissionWithDefaults() *Permission {
|
||||
this := Permission{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetId returns the Id field value if set, zero value otherwise.
|
||||
func (o *Permission) GetId() string {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Permission) GetIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Id, true
|
||||
}
|
||||
|
||||
// HasId returns a boolean if a field has been set.
|
||||
func (o *Permission) HasId() bool {
|
||||
if o != nil && !IsNil(o.Id) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetId gets a reference to the given string and assigns it to the Id field.
|
||||
func (o *Permission) SetId(v string) {
|
||||
o.Id = &v
|
||||
}
|
||||
|
||||
// GetHasPassword returns the HasPassword field value if set, zero value otherwise.
|
||||
func (o *Permission) GetHasPassword() bool {
|
||||
if o == nil || IsNil(o.HasPassword) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.HasPassword
|
||||
}
|
||||
|
||||
// GetHasPasswordOk returns a tuple with the HasPassword field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Permission) GetHasPasswordOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.HasPassword) {
|
||||
return nil, false
|
||||
}
|
||||
return o.HasPassword, true
|
||||
}
|
||||
|
||||
// HasHasPassword returns a boolean if a field has been set.
|
||||
func (o *Permission) HasHasPassword() bool {
|
||||
if o != nil && !IsNil(o.HasPassword) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetHasPassword gets a reference to the given bool and assigns it to the HasPassword field.
|
||||
func (o *Permission) SetHasPassword(v bool) {
|
||||
o.HasPassword = &v
|
||||
}
|
||||
|
||||
// GetExpirationDateTime returns the ExpirationDateTime field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *Permission) GetExpirationDateTime() time.Time {
|
||||
if o == nil || IsNil(o.ExpirationDateTime.Get()) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.ExpirationDateTime.Get()
|
||||
}
|
||||
|
||||
// GetExpirationDateTimeOk returns a tuple with the ExpirationDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *Permission) GetExpirationDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.ExpirationDateTime.Get(), o.ExpirationDateTime.IsSet()
|
||||
}
|
||||
|
||||
// HasExpirationDateTime returns a boolean if a field has been set.
|
||||
func (o *Permission) HasExpirationDateTime() bool {
|
||||
if o != nil && o.ExpirationDateTime.IsSet() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetExpirationDateTime gets a reference to the given NullableTime and assigns it to the ExpirationDateTime field.
|
||||
func (o *Permission) SetExpirationDateTime(v time.Time) {
|
||||
o.ExpirationDateTime.Set(&v)
|
||||
}
|
||||
// SetExpirationDateTimeNil sets the value for ExpirationDateTime to be an explicit nil
|
||||
func (o *Permission) SetExpirationDateTimeNil() {
|
||||
o.ExpirationDateTime.Set(nil)
|
||||
}
|
||||
|
||||
// UnsetExpirationDateTime ensures that no value is present for ExpirationDateTime, not even an explicit nil
|
||||
func (o *Permission) UnsetExpirationDateTime() {
|
||||
o.ExpirationDateTime.Unset()
|
||||
}
|
||||
|
||||
// GetCreatedDateTime returns the CreatedDateTime field value if set, zero value otherwise (both if not set or set to explicit null).
|
||||
func (o *Permission) GetCreatedDateTime() time.Time {
|
||||
if o == nil || IsNil(o.CreatedDateTime.Get()) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.CreatedDateTime.Get()
|
||||
}
|
||||
|
||||
// GetCreatedDateTimeOk returns a tuple with the CreatedDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// NOTE: If the value is an explicit nil, `nil, true` will be returned
|
||||
func (o *Permission) GetCreatedDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil {
|
||||
return nil, false
|
||||
}
|
||||
return o.CreatedDateTime.Get(), o.CreatedDateTime.IsSet()
|
||||
}
|
||||
|
||||
// HasCreatedDateTime returns a boolean if a field has been set.
|
||||
func (o *Permission) HasCreatedDateTime() bool {
|
||||
if o != nil && o.CreatedDateTime.IsSet() {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCreatedDateTime gets a reference to the given NullableTime and assigns it to the CreatedDateTime field.
|
||||
func (o *Permission) SetCreatedDateTime(v time.Time) {
|
||||
o.CreatedDateTime.Set(&v)
|
||||
}
|
||||
// SetCreatedDateTimeNil sets the value for CreatedDateTime to be an explicit nil
|
||||
func (o *Permission) SetCreatedDateTimeNil() {
|
||||
o.CreatedDateTime.Set(nil)
|
||||
}
|
||||
|
||||
// UnsetCreatedDateTime ensures that no value is present for CreatedDateTime, not even an explicit nil
|
||||
func (o *Permission) UnsetCreatedDateTime() {
|
||||
o.CreatedDateTime.Unset()
|
||||
}
|
||||
|
||||
// GetGrantedToV2 returns the GrantedToV2 field value if set, zero value otherwise.
|
||||
func (o *Permission) GetGrantedToV2() SharePointIdentitySet {
|
||||
if o == nil || IsNil(o.GrantedToV2) {
|
||||
var ret SharePointIdentitySet
|
||||
return ret
|
||||
}
|
||||
return *o.GrantedToV2
|
||||
}
|
||||
|
||||
// GetGrantedToV2Ok returns a tuple with the GrantedToV2 field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Permission) GetGrantedToV2Ok() (*SharePointIdentitySet, bool) {
|
||||
if o == nil || IsNil(o.GrantedToV2) {
|
||||
return nil, false
|
||||
}
|
||||
return o.GrantedToV2, true
|
||||
}
|
||||
|
||||
// HasGrantedToV2 returns a boolean if a field has been set.
|
||||
func (o *Permission) HasGrantedToV2() bool {
|
||||
if o != nil && !IsNil(o.GrantedToV2) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetGrantedToV2 gets a reference to the given SharePointIdentitySet and assigns it to the GrantedToV2 field.
|
||||
func (o *Permission) SetGrantedToV2(v SharePointIdentitySet) {
|
||||
o.GrantedToV2 = &v
|
||||
}
|
||||
|
||||
// GetLink returns the Link field value if set, zero value otherwise.
|
||||
func (o *Permission) GetLink() SharingLink {
|
||||
if o == nil || IsNil(o.Link) {
|
||||
var ret SharingLink
|
||||
return ret
|
||||
}
|
||||
return *o.Link
|
||||
}
|
||||
|
||||
// GetLinkOk returns a tuple with the Link field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Permission) GetLinkOk() (*SharingLink, bool) {
|
||||
if o == nil || IsNil(o.Link) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Link, true
|
||||
}
|
||||
|
||||
// HasLink returns a boolean if a field has been set.
|
||||
func (o *Permission) HasLink() bool {
|
||||
if o != nil && !IsNil(o.Link) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLink gets a reference to the given SharingLink and assigns it to the Link field.
|
||||
func (o *Permission) SetLink(v SharingLink) {
|
||||
o.Link = &v
|
||||
}
|
||||
|
||||
// GetRoles returns the Roles field value if set, zero value otherwise.
|
||||
func (o *Permission) GetRoles() []string {
|
||||
if o == nil || IsNil(o.Roles) {
|
||||
var ret []string
|
||||
return ret
|
||||
}
|
||||
return o.Roles
|
||||
}
|
||||
|
||||
// GetRolesOk returns a tuple with the Roles field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Permission) GetRolesOk() ([]string, bool) {
|
||||
if o == nil || IsNil(o.Roles) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Roles, true
|
||||
}
|
||||
|
||||
// HasRoles returns a boolean if a field has been set.
|
||||
func (o *Permission) HasRoles() bool {
|
||||
if o != nil && !IsNil(o.Roles) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetRoles gets a reference to the given []string and assigns it to the Roles field.
|
||||
func (o *Permission) SetRoles(v []string) {
|
||||
o.Roles = v
|
||||
}
|
||||
|
||||
// GetGrantedToIdentities returns the GrantedToIdentities field value if set, zero value otherwise.
|
||||
// Deprecated
|
||||
func (o *Permission) GetGrantedToIdentities() []IdentitySet {
|
||||
if o == nil || IsNil(o.GrantedToIdentities) {
|
||||
var ret []IdentitySet
|
||||
return ret
|
||||
}
|
||||
return o.GrantedToIdentities
|
||||
}
|
||||
|
||||
// GetGrantedToIdentitiesOk returns a tuple with the GrantedToIdentities field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
// Deprecated
|
||||
func (o *Permission) GetGrantedToIdentitiesOk() ([]IdentitySet, bool) {
|
||||
if o == nil || IsNil(o.GrantedToIdentities) {
|
||||
return nil, false
|
||||
}
|
||||
return o.GrantedToIdentities, true
|
||||
}
|
||||
|
||||
// HasGrantedToIdentities returns a boolean if a field has been set.
|
||||
func (o *Permission) HasGrantedToIdentities() bool {
|
||||
if o != nil && !IsNil(o.GrantedToIdentities) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetGrantedToIdentities gets a reference to the given []IdentitySet and assigns it to the GrantedToIdentities field.
|
||||
// Deprecated
|
||||
func (o *Permission) SetGrantedToIdentities(v []IdentitySet) {
|
||||
o.GrantedToIdentities = v
|
||||
}
|
||||
|
||||
// GetLibreGraphPermissionsActions returns the LibreGraphPermissionsActions field value if set, zero value otherwise.
|
||||
func (o *Permission) GetLibreGraphPermissionsActions() []string {
|
||||
if o == nil || IsNil(o.LibreGraphPermissionsActions) {
|
||||
var ret []string
|
||||
return ret
|
||||
}
|
||||
return o.LibreGraphPermissionsActions
|
||||
}
|
||||
|
||||
// GetLibreGraphPermissionsActionsOk returns a tuple with the LibreGraphPermissionsActions field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Permission) GetLibreGraphPermissionsActionsOk() ([]string, bool) {
|
||||
if o == nil || IsNil(o.LibreGraphPermissionsActions) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LibreGraphPermissionsActions, true
|
||||
}
|
||||
|
||||
// HasLibreGraphPermissionsActions returns a boolean if a field has been set.
|
||||
func (o *Permission) HasLibreGraphPermissionsActions() bool {
|
||||
if o != nil && !IsNil(o.LibreGraphPermissionsActions) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLibreGraphPermissionsActions gets a reference to the given []string and assigns it to the LibreGraphPermissionsActions field.
|
||||
func (o *Permission) SetLibreGraphPermissionsActions(v []string) {
|
||||
o.LibreGraphPermissionsActions = v
|
||||
}
|
||||
|
||||
// GetInvitation returns the Invitation field value if set, zero value otherwise.
|
||||
func (o *Permission) GetInvitation() SharingInvitation {
|
||||
if o == nil || IsNil(o.Invitation) {
|
||||
var ret SharingInvitation
|
||||
return ret
|
||||
}
|
||||
return *o.Invitation
|
||||
}
|
||||
|
||||
// GetInvitationOk returns a tuple with the Invitation field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Permission) GetInvitationOk() (*SharingInvitation, bool) {
|
||||
if o == nil || IsNil(o.Invitation) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Invitation, true
|
||||
}
|
||||
|
||||
// HasInvitation returns a boolean if a field has been set.
|
||||
func (o *Permission) HasInvitation() bool {
|
||||
if o != nil && !IsNil(o.Invitation) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetInvitation gets a reference to the given SharingInvitation and assigns it to the Invitation field.
|
||||
func (o *Permission) SetInvitation(v SharingInvitation) {
|
||||
o.Invitation = &v
|
||||
}
|
||||
|
||||
func (o Permission) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Permission) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Id) {
|
||||
toSerialize["id"] = o.Id
|
||||
}
|
||||
if !IsNil(o.HasPassword) {
|
||||
toSerialize["hasPassword"] = o.HasPassword
|
||||
}
|
||||
if o.ExpirationDateTime.IsSet() {
|
||||
toSerialize["expirationDateTime"] = o.ExpirationDateTime.Get()
|
||||
}
|
||||
if o.CreatedDateTime.IsSet() {
|
||||
toSerialize["createdDateTime"] = o.CreatedDateTime.Get()
|
||||
}
|
||||
if !IsNil(o.GrantedToV2) {
|
||||
toSerialize["grantedToV2"] = o.GrantedToV2
|
||||
}
|
||||
if !IsNil(o.Link) {
|
||||
toSerialize["link"] = o.Link
|
||||
}
|
||||
if !IsNil(o.Roles) {
|
||||
toSerialize["roles"] = o.Roles
|
||||
}
|
||||
if !IsNil(o.GrantedToIdentities) {
|
||||
toSerialize["grantedToIdentities"] = o.GrantedToIdentities
|
||||
}
|
||||
if !IsNil(o.LibreGraphPermissionsActions) {
|
||||
toSerialize["@libre.graph.permissions.actions"] = o.LibreGraphPermissionsActions
|
||||
}
|
||||
if !IsNil(o.Invitation) {
|
||||
toSerialize["invitation"] = o.Invitation
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullablePermission struct {
|
||||
value *Permission
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullablePermission) Get() *Permission {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullablePermission) Set(val *Permission) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullablePermission) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullablePermission) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullablePermission(val *Permission) *NullablePermission {
|
||||
return &NullablePermission{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullablePermission) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullablePermission) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+424
@@ -0,0 +1,424 @@
|
||||
/*
|
||||
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"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the Photo type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Photo{}
|
||||
|
||||
// Photo The photo resource provides photo and camera properties, for example, EXIF metadata, on a driveItem.
|
||||
type Photo struct {
|
||||
// Camera manufacturer. Read-only.
|
||||
CameraMake *string `json:"cameraMake,omitempty"`
|
||||
// Camera model. Read-only.
|
||||
CameraModel *string `json:"cameraModel,omitempty"`
|
||||
// The denominator for the exposure time fraction from the camera. Read-only.
|
||||
ExposureDenominator *float64 `json:"exposureDenominator,omitempty"`
|
||||
// The numerator for the exposure time fraction from the camera. Read-only.
|
||||
ExposureNumerator *float64 `json:"exposureNumerator,omitempty"`
|
||||
// The F-stop value from the camera. Read-only.
|
||||
FNumber *float64 `json:"fNumber,omitempty"`
|
||||
// The focal length from the camera. Read-only.
|
||||
FocalLength *float64 `json:"focalLength,omitempty"`
|
||||
// The ISO value from the camera. Read-only.
|
||||
Iso *int32 `json:"iso,omitempty"`
|
||||
// The orientation value from the camera. Read-only.
|
||||
Orientation *int32 `json:"orientation,omitempty"`
|
||||
// Represents the date and time the photo was taken. Read-only.
|
||||
TakenDateTime *time.Time `json:"takenDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?([Zz]|[+-][0-9][0-9]:[0-9][0-9])$"`
|
||||
}
|
||||
|
||||
// NewPhoto instantiates a new Photo object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewPhoto() *Photo {
|
||||
this := Photo{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewPhotoWithDefaults instantiates a new Photo object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewPhotoWithDefaults() *Photo {
|
||||
this := Photo{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCameraMake returns the CameraMake field value if set, zero value otherwise.
|
||||
func (o *Photo) GetCameraMake() string {
|
||||
if o == nil || IsNil(o.CameraMake) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.CameraMake
|
||||
}
|
||||
|
||||
// GetCameraMakeOk returns a tuple with the CameraMake field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Photo) GetCameraMakeOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.CameraMake) {
|
||||
return nil, false
|
||||
}
|
||||
return o.CameraMake, true
|
||||
}
|
||||
|
||||
// HasCameraMake returns a boolean if a field has been set.
|
||||
func (o *Photo) HasCameraMake() bool {
|
||||
if o != nil && !IsNil(o.CameraMake) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCameraMake gets a reference to the given string and assigns it to the CameraMake field.
|
||||
func (o *Photo) SetCameraMake(v string) {
|
||||
o.CameraMake = &v
|
||||
}
|
||||
|
||||
// GetCameraModel returns the CameraModel field value if set, zero value otherwise.
|
||||
func (o *Photo) GetCameraModel() string {
|
||||
if o == nil || IsNil(o.CameraModel) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.CameraModel
|
||||
}
|
||||
|
||||
// GetCameraModelOk returns a tuple with the CameraModel field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Photo) GetCameraModelOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.CameraModel) {
|
||||
return nil, false
|
||||
}
|
||||
return o.CameraModel, true
|
||||
}
|
||||
|
||||
// HasCameraModel returns a boolean if a field has been set.
|
||||
func (o *Photo) HasCameraModel() bool {
|
||||
if o != nil && !IsNil(o.CameraModel) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCameraModel gets a reference to the given string and assigns it to the CameraModel field.
|
||||
func (o *Photo) SetCameraModel(v string) {
|
||||
o.CameraModel = &v
|
||||
}
|
||||
|
||||
// GetExposureDenominator returns the ExposureDenominator field value if set, zero value otherwise.
|
||||
func (o *Photo) GetExposureDenominator() float64 {
|
||||
if o == nil || IsNil(o.ExposureDenominator) {
|
||||
var ret float64
|
||||
return ret
|
||||
}
|
||||
return *o.ExposureDenominator
|
||||
}
|
||||
|
||||
// GetExposureDenominatorOk returns a tuple with the ExposureDenominator field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Photo) GetExposureDenominatorOk() (*float64, bool) {
|
||||
if o == nil || IsNil(o.ExposureDenominator) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ExposureDenominator, true
|
||||
}
|
||||
|
||||
// HasExposureDenominator returns a boolean if a field has been set.
|
||||
func (o *Photo) HasExposureDenominator() bool {
|
||||
if o != nil && !IsNil(o.ExposureDenominator) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetExposureDenominator gets a reference to the given float64 and assigns it to the ExposureDenominator field.
|
||||
func (o *Photo) SetExposureDenominator(v float64) {
|
||||
o.ExposureDenominator = &v
|
||||
}
|
||||
|
||||
// GetExposureNumerator returns the ExposureNumerator field value if set, zero value otherwise.
|
||||
func (o *Photo) GetExposureNumerator() float64 {
|
||||
if o == nil || IsNil(o.ExposureNumerator) {
|
||||
var ret float64
|
||||
return ret
|
||||
}
|
||||
return *o.ExposureNumerator
|
||||
}
|
||||
|
||||
// GetExposureNumeratorOk returns a tuple with the ExposureNumerator field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Photo) GetExposureNumeratorOk() (*float64, bool) {
|
||||
if o == nil || IsNil(o.ExposureNumerator) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ExposureNumerator, true
|
||||
}
|
||||
|
||||
// HasExposureNumerator returns a boolean if a field has been set.
|
||||
func (o *Photo) HasExposureNumerator() bool {
|
||||
if o != nil && !IsNil(o.ExposureNumerator) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetExposureNumerator gets a reference to the given float64 and assigns it to the ExposureNumerator field.
|
||||
func (o *Photo) SetExposureNumerator(v float64) {
|
||||
o.ExposureNumerator = &v
|
||||
}
|
||||
|
||||
// GetFNumber returns the FNumber field value if set, zero value otherwise.
|
||||
func (o *Photo) GetFNumber() float64 {
|
||||
if o == nil || IsNil(o.FNumber) {
|
||||
var ret float64
|
||||
return ret
|
||||
}
|
||||
return *o.FNumber
|
||||
}
|
||||
|
||||
// GetFNumberOk returns a tuple with the FNumber field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Photo) GetFNumberOk() (*float64, bool) {
|
||||
if o == nil || IsNil(o.FNumber) {
|
||||
return nil, false
|
||||
}
|
||||
return o.FNumber, true
|
||||
}
|
||||
|
||||
// HasFNumber returns a boolean if a field has been set.
|
||||
func (o *Photo) HasFNumber() bool {
|
||||
if o != nil && !IsNil(o.FNumber) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetFNumber gets a reference to the given float64 and assigns it to the FNumber field.
|
||||
func (o *Photo) SetFNumber(v float64) {
|
||||
o.FNumber = &v
|
||||
}
|
||||
|
||||
// GetFocalLength returns the FocalLength field value if set, zero value otherwise.
|
||||
func (o *Photo) GetFocalLength() float64 {
|
||||
if o == nil || IsNil(o.FocalLength) {
|
||||
var ret float64
|
||||
return ret
|
||||
}
|
||||
return *o.FocalLength
|
||||
}
|
||||
|
||||
// GetFocalLengthOk returns a tuple with the FocalLength field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Photo) GetFocalLengthOk() (*float64, bool) {
|
||||
if o == nil || IsNil(o.FocalLength) {
|
||||
return nil, false
|
||||
}
|
||||
return o.FocalLength, true
|
||||
}
|
||||
|
||||
// HasFocalLength returns a boolean if a field has been set.
|
||||
func (o *Photo) HasFocalLength() bool {
|
||||
if o != nil && !IsNil(o.FocalLength) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetFocalLength gets a reference to the given float64 and assigns it to the FocalLength field.
|
||||
func (o *Photo) SetFocalLength(v float64) {
|
||||
o.FocalLength = &v
|
||||
}
|
||||
|
||||
// GetIso returns the Iso field value if set, zero value otherwise.
|
||||
func (o *Photo) GetIso() int32 {
|
||||
if o == nil || IsNil(o.Iso) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.Iso
|
||||
}
|
||||
|
||||
// GetIsoOk returns a tuple with the Iso field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Photo) GetIsoOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.Iso) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Iso, true
|
||||
}
|
||||
|
||||
// HasIso returns a boolean if a field has been set.
|
||||
func (o *Photo) HasIso() bool {
|
||||
if o != nil && !IsNil(o.Iso) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetIso gets a reference to the given int32 and assigns it to the Iso field.
|
||||
func (o *Photo) SetIso(v int32) {
|
||||
o.Iso = &v
|
||||
}
|
||||
|
||||
// GetOrientation returns the Orientation field value if set, zero value otherwise.
|
||||
func (o *Photo) GetOrientation() int32 {
|
||||
if o == nil || IsNil(o.Orientation) {
|
||||
var ret int32
|
||||
return ret
|
||||
}
|
||||
return *o.Orientation
|
||||
}
|
||||
|
||||
// GetOrientationOk returns a tuple with the Orientation field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Photo) GetOrientationOk() (*int32, bool) {
|
||||
if o == nil || IsNil(o.Orientation) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Orientation, true
|
||||
}
|
||||
|
||||
// HasOrientation returns a boolean if a field has been set.
|
||||
func (o *Photo) HasOrientation() bool {
|
||||
if o != nil && !IsNil(o.Orientation) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetOrientation gets a reference to the given int32 and assigns it to the Orientation field.
|
||||
func (o *Photo) SetOrientation(v int32) {
|
||||
o.Orientation = &v
|
||||
}
|
||||
|
||||
// GetTakenDateTime returns the TakenDateTime field value if set, zero value otherwise.
|
||||
func (o *Photo) GetTakenDateTime() time.Time {
|
||||
if o == nil || IsNil(o.TakenDateTime) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.TakenDateTime
|
||||
}
|
||||
|
||||
// GetTakenDateTimeOk returns a tuple with the TakenDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Photo) GetTakenDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil || IsNil(o.TakenDateTime) {
|
||||
return nil, false
|
||||
}
|
||||
return o.TakenDateTime, true
|
||||
}
|
||||
|
||||
// HasTakenDateTime returns a boolean if a field has been set.
|
||||
func (o *Photo) HasTakenDateTime() bool {
|
||||
if o != nil && !IsNil(o.TakenDateTime) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetTakenDateTime gets a reference to the given time.Time and assigns it to the TakenDateTime field.
|
||||
func (o *Photo) SetTakenDateTime(v time.Time) {
|
||||
o.TakenDateTime = &v
|
||||
}
|
||||
|
||||
func (o Photo) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Photo) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.CameraMake) {
|
||||
toSerialize["cameraMake"] = o.CameraMake
|
||||
}
|
||||
if !IsNil(o.CameraModel) {
|
||||
toSerialize["cameraModel"] = o.CameraModel
|
||||
}
|
||||
if !IsNil(o.ExposureDenominator) {
|
||||
toSerialize["exposureDenominator"] = o.ExposureDenominator
|
||||
}
|
||||
if !IsNil(o.ExposureNumerator) {
|
||||
toSerialize["exposureNumerator"] = o.ExposureNumerator
|
||||
}
|
||||
if !IsNil(o.FNumber) {
|
||||
toSerialize["fNumber"] = o.FNumber
|
||||
}
|
||||
if !IsNil(o.FocalLength) {
|
||||
toSerialize["focalLength"] = o.FocalLength
|
||||
}
|
||||
if !IsNil(o.Iso) {
|
||||
toSerialize["iso"] = o.Iso
|
||||
}
|
||||
if !IsNil(o.Orientation) {
|
||||
toSerialize["orientation"] = o.Orientation
|
||||
}
|
||||
if !IsNil(o.TakenDateTime) {
|
||||
toSerialize["takenDateTime"] = o.TakenDateTime
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullablePhoto struct {
|
||||
value *Photo
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullablePhoto) Get() *Photo {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullablePhoto) Set(val *Photo) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullablePhoto) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullablePhoto) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullablePhoto(val *Photo) *NullablePhoto {
|
||||
return &NullablePhoto{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullablePhoto) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullablePhoto) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+275
@@ -0,0 +1,275 @@
|
||||
/*
|
||||
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 Quota type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &Quota{}
|
||||
|
||||
// Quota Optional. Information about the drive's storage space quota. Read-only.
|
||||
type Quota struct {
|
||||
// Total space consumed by files in the recycle bin, in bytes. Read-only.
|
||||
Deleted *int64 `json:"deleted,omitempty"`
|
||||
// Total space remaining before reaching the quota limit, in bytes. Read-only.
|
||||
Remaining *int64 `json:"remaining,omitempty"`
|
||||
// Enumeration value that indicates the state of the storage space. Either \"normal\", \"nearing\", \"critical\" or \"exceeded\". Read-only.
|
||||
State *string `json:"state,omitempty"`
|
||||
// Total allowed storage space, in bytes. Read-only.
|
||||
Total *int64 `json:"total,omitempty"`
|
||||
// Total space used, in bytes. Read-only.
|
||||
Used *int64 `json:"used,omitempty"`
|
||||
}
|
||||
|
||||
// NewQuota instantiates a new Quota 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 NewQuota() *Quota {
|
||||
this := Quota{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewQuotaWithDefaults instantiates a new Quota 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 NewQuotaWithDefaults() *Quota {
|
||||
this := Quota{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetDeleted returns the Deleted field value if set, zero value otherwise.
|
||||
func (o *Quota) GetDeleted() int64 {
|
||||
if o == nil || IsNil(o.Deleted) {
|
||||
var ret int64
|
||||
return ret
|
||||
}
|
||||
return *o.Deleted
|
||||
}
|
||||
|
||||
// GetDeletedOk returns a tuple with the Deleted field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Quota) GetDeletedOk() (*int64, bool) {
|
||||
if o == nil || IsNil(o.Deleted) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Deleted, true
|
||||
}
|
||||
|
||||
// HasDeleted returns a boolean if a field has been set.
|
||||
func (o *Quota) HasDeleted() bool {
|
||||
if o != nil && !IsNil(o.Deleted) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDeleted gets a reference to the given int64 and assigns it to the Deleted field.
|
||||
func (o *Quota) SetDeleted(v int64) {
|
||||
o.Deleted = &v
|
||||
}
|
||||
|
||||
// GetRemaining returns the Remaining field value if set, zero value otherwise.
|
||||
func (o *Quota) GetRemaining() int64 {
|
||||
if o == nil || IsNil(o.Remaining) {
|
||||
var ret int64
|
||||
return ret
|
||||
}
|
||||
return *o.Remaining
|
||||
}
|
||||
|
||||
// GetRemainingOk returns a tuple with the Remaining field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Quota) GetRemainingOk() (*int64, bool) {
|
||||
if o == nil || IsNil(o.Remaining) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Remaining, true
|
||||
}
|
||||
|
||||
// HasRemaining returns a boolean if a field has been set.
|
||||
func (o *Quota) HasRemaining() bool {
|
||||
if o != nil && !IsNil(o.Remaining) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetRemaining gets a reference to the given int64 and assigns it to the Remaining field.
|
||||
func (o *Quota) SetRemaining(v int64) {
|
||||
o.Remaining = &v
|
||||
}
|
||||
|
||||
// GetState returns the State field value if set, zero value otherwise.
|
||||
func (o *Quota) GetState() string {
|
||||
if o == nil || IsNil(o.State) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.State
|
||||
}
|
||||
|
||||
// GetStateOk returns a tuple with the State field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Quota) GetStateOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.State) {
|
||||
return nil, false
|
||||
}
|
||||
return o.State, true
|
||||
}
|
||||
|
||||
// HasState returns a boolean if a field has been set.
|
||||
func (o *Quota) HasState() bool {
|
||||
if o != nil && !IsNil(o.State) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetState gets a reference to the given string and assigns it to the State field.
|
||||
func (o *Quota) SetState(v string) {
|
||||
o.State = &v
|
||||
}
|
||||
|
||||
// GetTotal returns the Total field value if set, zero value otherwise.
|
||||
func (o *Quota) GetTotal() int64 {
|
||||
if o == nil || IsNil(o.Total) {
|
||||
var ret int64
|
||||
return ret
|
||||
}
|
||||
return *o.Total
|
||||
}
|
||||
|
||||
// GetTotalOk returns a tuple with the Total field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Quota) GetTotalOk() (*int64, bool) {
|
||||
if o == nil || IsNil(o.Total) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Total, true
|
||||
}
|
||||
|
||||
// HasTotal returns a boolean if a field has been set.
|
||||
func (o *Quota) HasTotal() bool {
|
||||
if o != nil && !IsNil(o.Total) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetTotal gets a reference to the given int64 and assigns it to the Total field.
|
||||
func (o *Quota) SetTotal(v int64) {
|
||||
o.Total = &v
|
||||
}
|
||||
|
||||
// GetUsed returns the Used field value if set, zero value otherwise.
|
||||
func (o *Quota) GetUsed() int64 {
|
||||
if o == nil || IsNil(o.Used) {
|
||||
var ret int64
|
||||
return ret
|
||||
}
|
||||
return *o.Used
|
||||
}
|
||||
|
||||
// GetUsedOk returns a tuple with the Used field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *Quota) GetUsedOk() (*int64, bool) {
|
||||
if o == nil || IsNil(o.Used) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Used, true
|
||||
}
|
||||
|
||||
// HasUsed returns a boolean if a field has been set.
|
||||
func (o *Quota) HasUsed() bool {
|
||||
if o != nil && !IsNil(o.Used) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetUsed gets a reference to the given int64 and assigns it to the Used field.
|
||||
func (o *Quota) SetUsed(v int64) {
|
||||
o.Used = &v
|
||||
}
|
||||
|
||||
func (o Quota) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o Quota) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Deleted) {
|
||||
toSerialize["deleted"] = o.Deleted
|
||||
}
|
||||
if !IsNil(o.Remaining) {
|
||||
toSerialize["remaining"] = o.Remaining
|
||||
}
|
||||
if !IsNil(o.State) {
|
||||
toSerialize["state"] = o.State
|
||||
}
|
||||
if !IsNil(o.Total) {
|
||||
toSerialize["total"] = o.Total
|
||||
}
|
||||
if !IsNil(o.Used) {
|
||||
toSerialize["used"] = o.Used
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableQuota struct {
|
||||
value *Quota
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableQuota) Get() *Quota {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableQuota) Set(val *Quota) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableQuota) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableQuota) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableQuota(val *Quota) *NullableQuota {
|
||||
return &NullableQuota{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableQuota) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableQuota) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+860
@@ -0,0 +1,860 @@
|
||||
/*
|
||||
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"
|
||||
"time"
|
||||
)
|
||||
|
||||
// checks if the RemoteItem type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &RemoteItem{}
|
||||
|
||||
// RemoteItem Remote item data, if the item is shared from a drive other than the one being accessed. Read-only.
|
||||
type RemoteItem struct {
|
||||
CreatedBy *IdentitySet `json:"createdBy,omitempty"`
|
||||
// Date and time of item creation. Read-only.
|
||||
CreatedDateTime *time.Time `json:"createdDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$"`
|
||||
File *OpenGraphFile `json:"file,omitempty"`
|
||||
FileSystemInfo *FileSystemInfo `json:"fileSystemInfo,omitempty"`
|
||||
Folder *Folder `json:"folder,omitempty"`
|
||||
// The drive alias can be used in clients to make the urls user friendly. Example: 'personal/einstein'. This will be used to resolve to the correct driveID.
|
||||
DriveAlias *string `json:"driveAlias,omitempty"`
|
||||
// The relative path of the item in relation to its drive root.
|
||||
Path *string `json:"path,omitempty"`
|
||||
// Unique identifier for the drive root of this item. Read-only.
|
||||
RootId *string `json:"rootId,omitempty"`
|
||||
// Unique identifier for the remote item in its drive. Read-only.
|
||||
Id *string `json:"id,omitempty"`
|
||||
Image *Image `json:"image,omitempty"`
|
||||
LastModifiedBy *IdentitySet `json:"lastModifiedBy,omitempty"`
|
||||
// Date and time the item was last modified. Read-only.
|
||||
LastModifiedDateTime *time.Time `json:"lastModifiedDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$"`
|
||||
// Optional. Filename of the remote item. Read-only.
|
||||
Name *string `json:"name,omitempty"`
|
||||
// ETag for the item. Read-only.
|
||||
ETag *string `json:"eTag,omitempty"`
|
||||
// An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Note This property is not returned if the item is a folder. Read-only.
|
||||
CTag *string `json:"cTag,omitempty"`
|
||||
ParentReference *ItemReference `json:"parentReference,omitempty"`
|
||||
// The set of permissions for the item. Read-only. Nullable.
|
||||
Permissions []Permission `json:"permissions,omitempty"`
|
||||
// Size of the remote item. Read-only.
|
||||
Size *int64 `json:"size,omitempty"`
|
||||
SpecialFolder *SpecialFolder `json:"specialFolder,omitempty"`
|
||||
// DAV compatible URL for the item.
|
||||
WebDavUrl *string `json:"webDavUrl,omitempty"`
|
||||
// URL that displays the resource in the browser. Read-only.
|
||||
WebUrl *string `json:"webUrl,omitempty"`
|
||||
}
|
||||
|
||||
// NewRemoteItem instantiates a new RemoteItem 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 NewRemoteItem() *RemoteItem {
|
||||
this := RemoteItem{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewRemoteItemWithDefaults instantiates a new RemoteItem 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 NewRemoteItemWithDefaults() *RemoteItem {
|
||||
this := RemoteItem{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetCreatedBy returns the CreatedBy field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetCreatedBy() IdentitySet {
|
||||
if o == nil || IsNil(o.CreatedBy) {
|
||||
var ret IdentitySet
|
||||
return ret
|
||||
}
|
||||
return *o.CreatedBy
|
||||
}
|
||||
|
||||
// GetCreatedByOk returns a tuple with the CreatedBy field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetCreatedByOk() (*IdentitySet, bool) {
|
||||
if o == nil || IsNil(o.CreatedBy) {
|
||||
return nil, false
|
||||
}
|
||||
return o.CreatedBy, true
|
||||
}
|
||||
|
||||
// HasCreatedBy returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasCreatedBy() bool {
|
||||
if o != nil && !IsNil(o.CreatedBy) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCreatedBy gets a reference to the given IdentitySet and assigns it to the CreatedBy field.
|
||||
func (o *RemoteItem) SetCreatedBy(v IdentitySet) {
|
||||
o.CreatedBy = &v
|
||||
}
|
||||
|
||||
// GetCreatedDateTime returns the CreatedDateTime field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetCreatedDateTime() time.Time {
|
||||
if o == nil || IsNil(o.CreatedDateTime) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.CreatedDateTime
|
||||
}
|
||||
|
||||
// GetCreatedDateTimeOk returns a tuple with the CreatedDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetCreatedDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil || IsNil(o.CreatedDateTime) {
|
||||
return nil, false
|
||||
}
|
||||
return o.CreatedDateTime, true
|
||||
}
|
||||
|
||||
// HasCreatedDateTime returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasCreatedDateTime() bool {
|
||||
if o != nil && !IsNil(o.CreatedDateTime) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCreatedDateTime gets a reference to the given time.Time and assigns it to the CreatedDateTime field.
|
||||
func (o *RemoteItem) SetCreatedDateTime(v time.Time) {
|
||||
o.CreatedDateTime = &v
|
||||
}
|
||||
|
||||
// GetFile returns the File field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetFile() OpenGraphFile {
|
||||
if o == nil || IsNil(o.File) {
|
||||
var ret OpenGraphFile
|
||||
return ret
|
||||
}
|
||||
return *o.File
|
||||
}
|
||||
|
||||
// GetFileOk returns a tuple with the File field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetFileOk() (*OpenGraphFile, bool) {
|
||||
if o == nil || IsNil(o.File) {
|
||||
return nil, false
|
||||
}
|
||||
return o.File, true
|
||||
}
|
||||
|
||||
// HasFile returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasFile() bool {
|
||||
if o != nil && !IsNil(o.File) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetFile gets a reference to the given OpenGraphFile and assigns it to the File field.
|
||||
func (o *RemoteItem) SetFile(v OpenGraphFile) {
|
||||
o.File = &v
|
||||
}
|
||||
|
||||
// GetFileSystemInfo returns the FileSystemInfo field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetFileSystemInfo() FileSystemInfo {
|
||||
if o == nil || IsNil(o.FileSystemInfo) {
|
||||
var ret FileSystemInfo
|
||||
return ret
|
||||
}
|
||||
return *o.FileSystemInfo
|
||||
}
|
||||
|
||||
// GetFileSystemInfoOk returns a tuple with the FileSystemInfo field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetFileSystemInfoOk() (*FileSystemInfo, bool) {
|
||||
if o == nil || IsNil(o.FileSystemInfo) {
|
||||
return nil, false
|
||||
}
|
||||
return o.FileSystemInfo, true
|
||||
}
|
||||
|
||||
// HasFileSystemInfo returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasFileSystemInfo() bool {
|
||||
if o != nil && !IsNil(o.FileSystemInfo) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetFileSystemInfo gets a reference to the given FileSystemInfo and assigns it to the FileSystemInfo field.
|
||||
func (o *RemoteItem) SetFileSystemInfo(v FileSystemInfo) {
|
||||
o.FileSystemInfo = &v
|
||||
}
|
||||
|
||||
// GetFolder returns the Folder field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetFolder() Folder {
|
||||
if o == nil || IsNil(o.Folder) {
|
||||
var ret Folder
|
||||
return ret
|
||||
}
|
||||
return *o.Folder
|
||||
}
|
||||
|
||||
// GetFolderOk returns a tuple with the Folder field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetFolderOk() (*Folder, bool) {
|
||||
if o == nil || IsNil(o.Folder) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Folder, true
|
||||
}
|
||||
|
||||
// HasFolder returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasFolder() bool {
|
||||
if o != nil && !IsNil(o.Folder) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetFolder gets a reference to the given Folder and assigns it to the Folder field.
|
||||
func (o *RemoteItem) SetFolder(v Folder) {
|
||||
o.Folder = &v
|
||||
}
|
||||
|
||||
// GetDriveAlias returns the DriveAlias field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetDriveAlias() string {
|
||||
if o == nil || IsNil(o.DriveAlias) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.DriveAlias
|
||||
}
|
||||
|
||||
// GetDriveAliasOk returns a tuple with the DriveAlias field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetDriveAliasOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.DriveAlias) {
|
||||
return nil, false
|
||||
}
|
||||
return o.DriveAlias, true
|
||||
}
|
||||
|
||||
// HasDriveAlias returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasDriveAlias() bool {
|
||||
if o != nil && !IsNil(o.DriveAlias) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetDriveAlias gets a reference to the given string and assigns it to the DriveAlias field.
|
||||
func (o *RemoteItem) SetDriveAlias(v string) {
|
||||
o.DriveAlias = &v
|
||||
}
|
||||
|
||||
// GetPath returns the Path field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetPath() string {
|
||||
if o == nil || IsNil(o.Path) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Path
|
||||
}
|
||||
|
||||
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetPathOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Path) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Path, true
|
||||
}
|
||||
|
||||
// HasPath returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasPath() bool {
|
||||
if o != nil && !IsNil(o.Path) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPath gets a reference to the given string and assigns it to the Path field.
|
||||
func (o *RemoteItem) SetPath(v string) {
|
||||
o.Path = &v
|
||||
}
|
||||
|
||||
// GetRootId returns the RootId field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetRootId() string {
|
||||
if o == nil || IsNil(o.RootId) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.RootId
|
||||
}
|
||||
|
||||
// GetRootIdOk returns a tuple with the RootId field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetRootIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.RootId) {
|
||||
return nil, false
|
||||
}
|
||||
return o.RootId, true
|
||||
}
|
||||
|
||||
// HasRootId returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasRootId() bool {
|
||||
if o != nil && !IsNil(o.RootId) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetRootId gets a reference to the given string and assigns it to the RootId field.
|
||||
func (o *RemoteItem) SetRootId(v string) {
|
||||
o.RootId = &v
|
||||
}
|
||||
|
||||
// GetId returns the Id field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetId() string {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Id
|
||||
}
|
||||
|
||||
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetIdOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Id) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Id, true
|
||||
}
|
||||
|
||||
// HasId returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasId() bool {
|
||||
if o != nil && !IsNil(o.Id) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetId gets a reference to the given string and assigns it to the Id field.
|
||||
func (o *RemoteItem) SetId(v string) {
|
||||
o.Id = &v
|
||||
}
|
||||
|
||||
// GetImage returns the Image field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetImage() Image {
|
||||
if o == nil || IsNil(o.Image) {
|
||||
var ret Image
|
||||
return ret
|
||||
}
|
||||
return *o.Image
|
||||
}
|
||||
|
||||
// GetImageOk returns a tuple with the Image field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetImageOk() (*Image, bool) {
|
||||
if o == nil || IsNil(o.Image) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Image, true
|
||||
}
|
||||
|
||||
// HasImage returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasImage() bool {
|
||||
if o != nil && !IsNil(o.Image) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetImage gets a reference to the given Image and assigns it to the Image field.
|
||||
func (o *RemoteItem) SetImage(v Image) {
|
||||
o.Image = &v
|
||||
}
|
||||
|
||||
// GetLastModifiedBy returns the LastModifiedBy field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetLastModifiedBy() IdentitySet {
|
||||
if o == nil || IsNil(o.LastModifiedBy) {
|
||||
var ret IdentitySet
|
||||
return ret
|
||||
}
|
||||
return *o.LastModifiedBy
|
||||
}
|
||||
|
||||
// GetLastModifiedByOk returns a tuple with the LastModifiedBy field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetLastModifiedByOk() (*IdentitySet, bool) {
|
||||
if o == nil || IsNil(o.LastModifiedBy) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LastModifiedBy, true
|
||||
}
|
||||
|
||||
// HasLastModifiedBy returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasLastModifiedBy() bool {
|
||||
if o != nil && !IsNil(o.LastModifiedBy) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLastModifiedBy gets a reference to the given IdentitySet and assigns it to the LastModifiedBy field.
|
||||
func (o *RemoteItem) SetLastModifiedBy(v IdentitySet) {
|
||||
o.LastModifiedBy = &v
|
||||
}
|
||||
|
||||
// GetLastModifiedDateTime returns the LastModifiedDateTime field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetLastModifiedDateTime() time.Time {
|
||||
if o == nil || IsNil(o.LastModifiedDateTime) {
|
||||
var ret time.Time
|
||||
return ret
|
||||
}
|
||||
return *o.LastModifiedDateTime
|
||||
}
|
||||
|
||||
// GetLastModifiedDateTimeOk returns a tuple with the LastModifiedDateTime field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetLastModifiedDateTimeOk() (*time.Time, bool) {
|
||||
if o == nil || IsNil(o.LastModifiedDateTime) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LastModifiedDateTime, true
|
||||
}
|
||||
|
||||
// HasLastModifiedDateTime returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasLastModifiedDateTime() bool {
|
||||
if o != nil && !IsNil(o.LastModifiedDateTime) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLastModifiedDateTime gets a reference to the given time.Time and assigns it to the LastModifiedDateTime field.
|
||||
func (o *RemoteItem) SetLastModifiedDateTime(v time.Time) {
|
||||
o.LastModifiedDateTime = &v
|
||||
}
|
||||
|
||||
// GetName returns the Name field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) 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 *RemoteItem) 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 *RemoteItem) 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 *RemoteItem) SetName(v string) {
|
||||
o.Name = &v
|
||||
}
|
||||
|
||||
// GetETag returns the ETag field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetETag() string {
|
||||
if o == nil || IsNil(o.ETag) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.ETag
|
||||
}
|
||||
|
||||
// GetETagOk returns a tuple with the ETag field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetETagOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.ETag) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ETag, true
|
||||
}
|
||||
|
||||
// HasETag returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasETag() bool {
|
||||
if o != nil && !IsNil(o.ETag) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetETag gets a reference to the given string and assigns it to the ETag field.
|
||||
func (o *RemoteItem) SetETag(v string) {
|
||||
o.ETag = &v
|
||||
}
|
||||
|
||||
// GetCTag returns the CTag field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetCTag() string {
|
||||
if o == nil || IsNil(o.CTag) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.CTag
|
||||
}
|
||||
|
||||
// GetCTagOk returns a tuple with the CTag field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetCTagOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.CTag) {
|
||||
return nil, false
|
||||
}
|
||||
return o.CTag, true
|
||||
}
|
||||
|
||||
// HasCTag returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasCTag() bool {
|
||||
if o != nil && !IsNil(o.CTag) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetCTag gets a reference to the given string and assigns it to the CTag field.
|
||||
func (o *RemoteItem) SetCTag(v string) {
|
||||
o.CTag = &v
|
||||
}
|
||||
|
||||
// GetParentReference returns the ParentReference field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetParentReference() ItemReference {
|
||||
if o == nil || IsNil(o.ParentReference) {
|
||||
var ret ItemReference
|
||||
return ret
|
||||
}
|
||||
return *o.ParentReference
|
||||
}
|
||||
|
||||
// GetParentReferenceOk returns a tuple with the ParentReference field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetParentReferenceOk() (*ItemReference, bool) {
|
||||
if o == nil || IsNil(o.ParentReference) {
|
||||
return nil, false
|
||||
}
|
||||
return o.ParentReference, true
|
||||
}
|
||||
|
||||
// HasParentReference returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasParentReference() bool {
|
||||
if o != nil && !IsNil(o.ParentReference) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetParentReference gets a reference to the given ItemReference and assigns it to the ParentReference field.
|
||||
func (o *RemoteItem) SetParentReference(v ItemReference) {
|
||||
o.ParentReference = &v
|
||||
}
|
||||
|
||||
// GetPermissions returns the Permissions field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetPermissions() []Permission {
|
||||
if o == nil || IsNil(o.Permissions) {
|
||||
var ret []Permission
|
||||
return ret
|
||||
}
|
||||
return o.Permissions
|
||||
}
|
||||
|
||||
// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetPermissionsOk() ([]Permission, bool) {
|
||||
if o == nil || IsNil(o.Permissions) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Permissions, true
|
||||
}
|
||||
|
||||
// HasPermissions returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasPermissions() bool {
|
||||
if o != nil && !IsNil(o.Permissions) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPermissions gets a reference to the given []Permission and assigns it to the Permissions field.
|
||||
func (o *RemoteItem) SetPermissions(v []Permission) {
|
||||
o.Permissions = v
|
||||
}
|
||||
|
||||
// GetSize returns the Size field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetSize() int64 {
|
||||
if o == nil || IsNil(o.Size) {
|
||||
var ret int64
|
||||
return ret
|
||||
}
|
||||
return *o.Size
|
||||
}
|
||||
|
||||
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetSizeOk() (*int64, bool) {
|
||||
if o == nil || IsNil(o.Size) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Size, true
|
||||
}
|
||||
|
||||
// HasSize returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasSize() bool {
|
||||
if o != nil && !IsNil(o.Size) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetSize gets a reference to the given int64 and assigns it to the Size field.
|
||||
func (o *RemoteItem) SetSize(v int64) {
|
||||
o.Size = &v
|
||||
}
|
||||
|
||||
// GetSpecialFolder returns the SpecialFolder field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetSpecialFolder() SpecialFolder {
|
||||
if o == nil || IsNil(o.SpecialFolder) {
|
||||
var ret SpecialFolder
|
||||
return ret
|
||||
}
|
||||
return *o.SpecialFolder
|
||||
}
|
||||
|
||||
// GetSpecialFolderOk returns a tuple with the SpecialFolder field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetSpecialFolderOk() (*SpecialFolder, bool) {
|
||||
if o == nil || IsNil(o.SpecialFolder) {
|
||||
return nil, false
|
||||
}
|
||||
return o.SpecialFolder, true
|
||||
}
|
||||
|
||||
// HasSpecialFolder returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasSpecialFolder() bool {
|
||||
if o != nil && !IsNil(o.SpecialFolder) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetSpecialFolder gets a reference to the given SpecialFolder and assigns it to the SpecialFolder field.
|
||||
func (o *RemoteItem) SetSpecialFolder(v SpecialFolder) {
|
||||
o.SpecialFolder = &v
|
||||
}
|
||||
|
||||
// GetWebDavUrl returns the WebDavUrl field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetWebDavUrl() string {
|
||||
if o == nil || IsNil(o.WebDavUrl) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.WebDavUrl
|
||||
}
|
||||
|
||||
// GetWebDavUrlOk returns a tuple with the WebDavUrl field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetWebDavUrlOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.WebDavUrl) {
|
||||
return nil, false
|
||||
}
|
||||
return o.WebDavUrl, true
|
||||
}
|
||||
|
||||
// HasWebDavUrl returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasWebDavUrl() bool {
|
||||
if o != nil && !IsNil(o.WebDavUrl) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetWebDavUrl gets a reference to the given string and assigns it to the WebDavUrl field.
|
||||
func (o *RemoteItem) SetWebDavUrl(v string) {
|
||||
o.WebDavUrl = &v
|
||||
}
|
||||
|
||||
// GetWebUrl returns the WebUrl field value if set, zero value otherwise.
|
||||
func (o *RemoteItem) GetWebUrl() string {
|
||||
if o == nil || IsNil(o.WebUrl) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.WebUrl
|
||||
}
|
||||
|
||||
// GetWebUrlOk returns a tuple with the WebUrl field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *RemoteItem) GetWebUrlOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.WebUrl) {
|
||||
return nil, false
|
||||
}
|
||||
return o.WebUrl, true
|
||||
}
|
||||
|
||||
// HasWebUrl returns a boolean if a field has been set.
|
||||
func (o *RemoteItem) HasWebUrl() bool {
|
||||
if o != nil && !IsNil(o.WebUrl) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetWebUrl gets a reference to the given string and assigns it to the WebUrl field.
|
||||
func (o *RemoteItem) SetWebUrl(v string) {
|
||||
o.WebUrl = &v
|
||||
}
|
||||
|
||||
func (o RemoteItem) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o RemoteItem) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.CreatedBy) {
|
||||
toSerialize["createdBy"] = o.CreatedBy
|
||||
}
|
||||
if !IsNil(o.CreatedDateTime) {
|
||||
toSerialize["createdDateTime"] = o.CreatedDateTime
|
||||
}
|
||||
if !IsNil(o.File) {
|
||||
toSerialize["file"] = o.File
|
||||
}
|
||||
if !IsNil(o.FileSystemInfo) {
|
||||
toSerialize["fileSystemInfo"] = o.FileSystemInfo
|
||||
}
|
||||
if !IsNil(o.Folder) {
|
||||
toSerialize["folder"] = o.Folder
|
||||
}
|
||||
if !IsNil(o.DriveAlias) {
|
||||
toSerialize["driveAlias"] = o.DriveAlias
|
||||
}
|
||||
if !IsNil(o.Path) {
|
||||
toSerialize["path"] = o.Path
|
||||
}
|
||||
if !IsNil(o.RootId) {
|
||||
toSerialize["rootId"] = o.RootId
|
||||
}
|
||||
if !IsNil(o.Id) {
|
||||
toSerialize["id"] = o.Id
|
||||
}
|
||||
if !IsNil(o.Image) {
|
||||
toSerialize["image"] = o.Image
|
||||
}
|
||||
if !IsNil(o.LastModifiedBy) {
|
||||
toSerialize["lastModifiedBy"] = o.LastModifiedBy
|
||||
}
|
||||
if !IsNil(o.LastModifiedDateTime) {
|
||||
toSerialize["lastModifiedDateTime"] = o.LastModifiedDateTime
|
||||
}
|
||||
if !IsNil(o.Name) {
|
||||
toSerialize["name"] = o.Name
|
||||
}
|
||||
if !IsNil(o.ETag) {
|
||||
toSerialize["eTag"] = o.ETag
|
||||
}
|
||||
if !IsNil(o.CTag) {
|
||||
toSerialize["cTag"] = o.CTag
|
||||
}
|
||||
if !IsNil(o.ParentReference) {
|
||||
toSerialize["parentReference"] = o.ParentReference
|
||||
}
|
||||
if !IsNil(o.Permissions) {
|
||||
toSerialize["permissions"] = o.Permissions
|
||||
}
|
||||
if !IsNil(o.Size) {
|
||||
toSerialize["size"] = o.Size
|
||||
}
|
||||
if !IsNil(o.SpecialFolder) {
|
||||
toSerialize["specialFolder"] = o.SpecialFolder
|
||||
}
|
||||
if !IsNil(o.WebDavUrl) {
|
||||
toSerialize["webDavUrl"] = o.WebDavUrl
|
||||
}
|
||||
if !IsNil(o.WebUrl) {
|
||||
toSerialize["webUrl"] = o.WebUrl
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableRemoteItem struct {
|
||||
value *RemoteItem
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableRemoteItem) Get() *RemoteItem {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableRemoteItem) Set(val *RemoteItem) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableRemoteItem) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableRemoteItem) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableRemoteItem(val *RemoteItem) *NullableRemoteItem {
|
||||
return &NullableRemoteItem{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableRemoteItem) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableRemoteItem) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+162
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the SharePointIdentitySet type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &SharePointIdentitySet{}
|
||||
|
||||
// SharePointIdentitySet This resource is used to represent a set of identities associated with various events for an item, such as created by or last modified by.
|
||||
type SharePointIdentitySet struct {
|
||||
User *Identity `json:"user,omitempty"`
|
||||
Group *Identity `json:"group,omitempty"`
|
||||
}
|
||||
|
||||
// NewSharePointIdentitySet instantiates a new SharePointIdentitySet object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewSharePointIdentitySet() *SharePointIdentitySet {
|
||||
this := SharePointIdentitySet{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewSharePointIdentitySetWithDefaults instantiates a new SharePointIdentitySet object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewSharePointIdentitySetWithDefaults() *SharePointIdentitySet {
|
||||
this := SharePointIdentitySet{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetUser returns the User field value if set, zero value otherwise.
|
||||
func (o *SharePointIdentitySet) GetUser() Identity {
|
||||
if o == nil || IsNil(o.User) {
|
||||
var ret Identity
|
||||
return ret
|
||||
}
|
||||
return *o.User
|
||||
}
|
||||
|
||||
// GetUserOk returns a tuple with the User field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SharePointIdentitySet) GetUserOk() (*Identity, bool) {
|
||||
if o == nil || IsNil(o.User) {
|
||||
return nil, false
|
||||
}
|
||||
return o.User, true
|
||||
}
|
||||
|
||||
// HasUser returns a boolean if a field has been set.
|
||||
func (o *SharePointIdentitySet) HasUser() bool {
|
||||
if o != nil && !IsNil(o.User) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetUser gets a reference to the given Identity and assigns it to the User field.
|
||||
func (o *SharePointIdentitySet) SetUser(v Identity) {
|
||||
o.User = &v
|
||||
}
|
||||
|
||||
// GetGroup returns the Group field value if set, zero value otherwise.
|
||||
func (o *SharePointIdentitySet) GetGroup() Identity {
|
||||
if o == nil || IsNil(o.Group) {
|
||||
var ret Identity
|
||||
return ret
|
||||
}
|
||||
return *o.Group
|
||||
}
|
||||
|
||||
// GetGroupOk returns a tuple with the Group field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SharePointIdentitySet) GetGroupOk() (*Identity, bool) {
|
||||
if o == nil || IsNil(o.Group) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Group, true
|
||||
}
|
||||
|
||||
// HasGroup returns a boolean if a field has been set.
|
||||
func (o *SharePointIdentitySet) HasGroup() bool {
|
||||
if o != nil && !IsNil(o.Group) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetGroup gets a reference to the given Identity and assigns it to the Group field.
|
||||
func (o *SharePointIdentitySet) SetGroup(v Identity) {
|
||||
o.Group = &v
|
||||
}
|
||||
|
||||
func (o SharePointIdentitySet) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o SharePointIdentitySet) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.User) {
|
||||
toSerialize["user"] = o.User
|
||||
}
|
||||
if !IsNil(o.Group) {
|
||||
toSerialize["group"] = o.Group
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableSharePointIdentitySet struct {
|
||||
value *SharePointIdentitySet
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableSharePointIdentitySet) Get() *SharePointIdentitySet {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableSharePointIdentitySet) Set(val *SharePointIdentitySet) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableSharePointIdentitySet) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableSharePointIdentitySet) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableSharePointIdentitySet(val *SharePointIdentitySet) *NullableSharePointIdentitySet {
|
||||
return &NullableSharePointIdentitySet{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableSharePointIdentitySet) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableSharePointIdentitySet) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+126
@@ -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 SharingInvitation type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &SharingInvitation{}
|
||||
|
||||
// SharingInvitation invitation-related data items
|
||||
type SharingInvitation struct {
|
||||
InvitedBy *IdentitySet `json:"invitedBy,omitempty"`
|
||||
}
|
||||
|
||||
// NewSharingInvitation instantiates a new SharingInvitation 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 NewSharingInvitation() *SharingInvitation {
|
||||
this := SharingInvitation{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewSharingInvitationWithDefaults instantiates a new SharingInvitation 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 NewSharingInvitationWithDefaults() *SharingInvitation {
|
||||
this := SharingInvitation{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetInvitedBy returns the InvitedBy field value if set, zero value otherwise.
|
||||
func (o *SharingInvitation) GetInvitedBy() IdentitySet {
|
||||
if o == nil || IsNil(o.InvitedBy) {
|
||||
var ret IdentitySet
|
||||
return ret
|
||||
}
|
||||
return *o.InvitedBy
|
||||
}
|
||||
|
||||
// GetInvitedByOk returns a tuple with the InvitedBy field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SharingInvitation) GetInvitedByOk() (*IdentitySet, bool) {
|
||||
if o == nil || IsNil(o.InvitedBy) {
|
||||
return nil, false
|
||||
}
|
||||
return o.InvitedBy, true
|
||||
}
|
||||
|
||||
// HasInvitedBy returns a boolean if a field has been set.
|
||||
func (o *SharingInvitation) HasInvitedBy() bool {
|
||||
if o != nil && !IsNil(o.InvitedBy) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetInvitedBy gets a reference to the given IdentitySet and assigns it to the InvitedBy field.
|
||||
func (o *SharingInvitation) SetInvitedBy(v IdentitySet) {
|
||||
o.InvitedBy = &v
|
||||
}
|
||||
|
||||
func (o SharingInvitation) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o SharingInvitation) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.InvitedBy) {
|
||||
toSerialize["invitedBy"] = o.InvitedBy
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableSharingInvitation struct {
|
||||
value *SharingInvitation
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableSharingInvitation) Get() *SharingInvitation {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableSharingInvitation) Set(val *SharingInvitation) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableSharingInvitation) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableSharingInvitation) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableSharingInvitation(val *SharingInvitation) *NullableSharingInvitation {
|
||||
return &NullableSharingInvitation{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableSharingInvitation) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableSharingInvitation) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
+274
@@ -0,0 +1,274 @@
|
||||
/*
|
||||
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 SharingLink type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &SharingLink{}
|
||||
|
||||
// SharingLink The `SharingLink` resource groups link-related data items into a single structure. If a `permission` resource has a non-null `sharingLink` facet, the permission represents a sharing link (as opposed to permissions granted to a person or group).
|
||||
type SharingLink struct {
|
||||
Type *SharingLinkType `json:"type,omitempty"`
|
||||
// If `true` then the user can only use this link to view the item on the web, and cannot use it to download the contents of the item.
|
||||
PreventsDownload *bool `json:"preventsDownload,omitempty"`
|
||||
// A URL that opens the item in the browser on the website.
|
||||
WebUrl *string `json:"webUrl,omitempty"`
|
||||
// Provides a user-visible display name of the link. Optional. Libregraph only.
|
||||
LibreGraphDisplayName *string `json:"@libre.graph.displayName,omitempty"`
|
||||
// The quicklink property can be assigned to only one link per resource. A quicklink can be used in the clients to provide a one-click copy to clipboard action. Optional. Libregraph only.
|
||||
LibreGraphQuickLink *bool `json:"@libre.graph.quickLink,omitempty"`
|
||||
}
|
||||
|
||||
// NewSharingLink instantiates a new SharingLink object
|
||||
// This constructor will assign default values to properties that have it defined,
|
||||
// and makes sure properties required by API are set, but the set of arguments
|
||||
// will change when the set of required properties is changed
|
||||
func NewSharingLink() *SharingLink {
|
||||
this := SharingLink{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewSharingLinkWithDefaults instantiates a new SharingLink object
|
||||
// This constructor will only assign default values to properties that have it defined,
|
||||
// but it doesn't guarantee that properties required by API are set
|
||||
func NewSharingLinkWithDefaults() *SharingLink {
|
||||
this := SharingLink{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetType returns the Type field value if set, zero value otherwise.
|
||||
func (o *SharingLink) GetType() SharingLinkType {
|
||||
if o == nil || IsNil(o.Type) {
|
||||
var ret SharingLinkType
|
||||
return ret
|
||||
}
|
||||
return *o.Type
|
||||
}
|
||||
|
||||
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SharingLink) GetTypeOk() (*SharingLinkType, bool) {
|
||||
if o == nil || IsNil(o.Type) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Type, true
|
||||
}
|
||||
|
||||
// HasType returns a boolean if a field has been set.
|
||||
func (o *SharingLink) HasType() bool {
|
||||
if o != nil && !IsNil(o.Type) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetType gets a reference to the given SharingLinkType and assigns it to the Type field.
|
||||
func (o *SharingLink) SetType(v SharingLinkType) {
|
||||
o.Type = &v
|
||||
}
|
||||
|
||||
// GetPreventsDownload returns the PreventsDownload field value if set, zero value otherwise.
|
||||
func (o *SharingLink) GetPreventsDownload() bool {
|
||||
if o == nil || IsNil(o.PreventsDownload) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.PreventsDownload
|
||||
}
|
||||
|
||||
// GetPreventsDownloadOk returns a tuple with the PreventsDownload field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SharingLink) GetPreventsDownloadOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.PreventsDownload) {
|
||||
return nil, false
|
||||
}
|
||||
return o.PreventsDownload, true
|
||||
}
|
||||
|
||||
// HasPreventsDownload returns a boolean if a field has been set.
|
||||
func (o *SharingLink) HasPreventsDownload() bool {
|
||||
if o != nil && !IsNil(o.PreventsDownload) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPreventsDownload gets a reference to the given bool and assigns it to the PreventsDownload field.
|
||||
func (o *SharingLink) SetPreventsDownload(v bool) {
|
||||
o.PreventsDownload = &v
|
||||
}
|
||||
|
||||
// GetWebUrl returns the WebUrl field value if set, zero value otherwise.
|
||||
func (o *SharingLink) GetWebUrl() string {
|
||||
if o == nil || IsNil(o.WebUrl) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.WebUrl
|
||||
}
|
||||
|
||||
// GetWebUrlOk returns a tuple with the WebUrl field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SharingLink) GetWebUrlOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.WebUrl) {
|
||||
return nil, false
|
||||
}
|
||||
return o.WebUrl, true
|
||||
}
|
||||
|
||||
// HasWebUrl returns a boolean if a field has been set.
|
||||
func (o *SharingLink) HasWebUrl() bool {
|
||||
if o != nil && !IsNil(o.WebUrl) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetWebUrl gets a reference to the given string and assigns it to the WebUrl field.
|
||||
func (o *SharingLink) SetWebUrl(v string) {
|
||||
o.WebUrl = &v
|
||||
}
|
||||
|
||||
// GetLibreGraphDisplayName returns the LibreGraphDisplayName field value if set, zero value otherwise.
|
||||
func (o *SharingLink) GetLibreGraphDisplayName() string {
|
||||
if o == nil || IsNil(o.LibreGraphDisplayName) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.LibreGraphDisplayName
|
||||
}
|
||||
|
||||
// GetLibreGraphDisplayNameOk returns a tuple with the LibreGraphDisplayName field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SharingLink) GetLibreGraphDisplayNameOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.LibreGraphDisplayName) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LibreGraphDisplayName, true
|
||||
}
|
||||
|
||||
// HasLibreGraphDisplayName returns a boolean if a field has been set.
|
||||
func (o *SharingLink) HasLibreGraphDisplayName() bool {
|
||||
if o != nil && !IsNil(o.LibreGraphDisplayName) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLibreGraphDisplayName gets a reference to the given string and assigns it to the LibreGraphDisplayName field.
|
||||
func (o *SharingLink) SetLibreGraphDisplayName(v string) {
|
||||
o.LibreGraphDisplayName = &v
|
||||
}
|
||||
|
||||
// GetLibreGraphQuickLink returns the LibreGraphQuickLink field value if set, zero value otherwise.
|
||||
func (o *SharingLink) GetLibreGraphQuickLink() bool {
|
||||
if o == nil || IsNil(o.LibreGraphQuickLink) {
|
||||
var ret bool
|
||||
return ret
|
||||
}
|
||||
return *o.LibreGraphQuickLink
|
||||
}
|
||||
|
||||
// GetLibreGraphQuickLinkOk returns a tuple with the LibreGraphQuickLink field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SharingLink) GetLibreGraphQuickLinkOk() (*bool, bool) {
|
||||
if o == nil || IsNil(o.LibreGraphQuickLink) {
|
||||
return nil, false
|
||||
}
|
||||
return o.LibreGraphQuickLink, true
|
||||
}
|
||||
|
||||
// HasLibreGraphQuickLink returns a boolean if a field has been set.
|
||||
func (o *SharingLink) HasLibreGraphQuickLink() bool {
|
||||
if o != nil && !IsNil(o.LibreGraphQuickLink) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetLibreGraphQuickLink gets a reference to the given bool and assigns it to the LibreGraphQuickLink field.
|
||||
func (o *SharingLink) SetLibreGraphQuickLink(v bool) {
|
||||
o.LibreGraphQuickLink = &v
|
||||
}
|
||||
|
||||
func (o SharingLink) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o SharingLink) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Type) {
|
||||
toSerialize["type"] = o.Type
|
||||
}
|
||||
if !IsNil(o.PreventsDownload) {
|
||||
toSerialize["preventsDownload"] = o.PreventsDownload
|
||||
}
|
||||
if !IsNil(o.WebUrl) {
|
||||
toSerialize["webUrl"] = o.WebUrl
|
||||
}
|
||||
if !IsNil(o.LibreGraphDisplayName) {
|
||||
toSerialize["@libre.graph.displayName"] = o.LibreGraphDisplayName
|
||||
}
|
||||
if !IsNil(o.LibreGraphQuickLink) {
|
||||
toSerialize["@libre.graph.quickLink"] = o.LibreGraphQuickLink
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableSharingLink struct {
|
||||
value *SharingLink
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableSharingLink) Get() *SharingLink {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableSharingLink) Set(val *SharingLink) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableSharingLink) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableSharingLink) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableSharingLink(val *SharingLink) *NullableSharingLink {
|
||||
return &NullableSharingLink{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableSharingLink) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableSharingLink) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+127
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
Libre Graph API
|
||||
|
||||
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
|
||||
|
||||
API version: v1.0.8
|
||||
*/
|
||||
|
||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||||
|
||||
package libregraph
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
// checks if the SharingLinkPassword type satisfies the MappedNullable interface at compile time
|
||||
var _ MappedNullable = &SharingLinkPassword{}
|
||||
|
||||
// SharingLinkPassword The sharing link password which should be set.
|
||||
type SharingLinkPassword struct {
|
||||
// Password. It may require a password policy.
|
||||
Password *string `json:"password,omitempty"`
|
||||
}
|
||||
|
||||
// NewSharingLinkPassword instantiates a new SharingLinkPassword 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 NewSharingLinkPassword() *SharingLinkPassword {
|
||||
this := SharingLinkPassword{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// NewSharingLinkPasswordWithDefaults instantiates a new SharingLinkPassword 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 NewSharingLinkPasswordWithDefaults() *SharingLinkPassword {
|
||||
this := SharingLinkPassword{}
|
||||
return &this
|
||||
}
|
||||
|
||||
// GetPassword returns the Password field value if set, zero value otherwise.
|
||||
func (o *SharingLinkPassword) GetPassword() string {
|
||||
if o == nil || IsNil(o.Password) {
|
||||
var ret string
|
||||
return ret
|
||||
}
|
||||
return *o.Password
|
||||
}
|
||||
|
||||
// GetPasswordOk returns a tuple with the Password field value if set, nil otherwise
|
||||
// and a boolean to check if the value has been set.
|
||||
func (o *SharingLinkPassword) GetPasswordOk() (*string, bool) {
|
||||
if o == nil || IsNil(o.Password) {
|
||||
return nil, false
|
||||
}
|
||||
return o.Password, true
|
||||
}
|
||||
|
||||
// HasPassword returns a boolean if a field has been set.
|
||||
func (o *SharingLinkPassword) HasPassword() bool {
|
||||
if o != nil && !IsNil(o.Password) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// SetPassword gets a reference to the given string and assigns it to the Password field.
|
||||
func (o *SharingLinkPassword) SetPassword(v string) {
|
||||
o.Password = &v
|
||||
}
|
||||
|
||||
func (o SharingLinkPassword) MarshalJSON() ([]byte, error) {
|
||||
toSerialize,err := o.ToMap()
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
return json.Marshal(toSerialize)
|
||||
}
|
||||
|
||||
func (o SharingLinkPassword) ToMap() (map[string]interface{}, error) {
|
||||
toSerialize := map[string]interface{}{}
|
||||
if !IsNil(o.Password) {
|
||||
toSerialize["password"] = o.Password
|
||||
}
|
||||
return toSerialize, nil
|
||||
}
|
||||
|
||||
type NullableSharingLinkPassword struct {
|
||||
value *SharingLinkPassword
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableSharingLinkPassword) Get() *SharingLinkPassword {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableSharingLinkPassword) Set(val *SharingLinkPassword) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableSharingLinkPassword) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableSharingLinkPassword) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableSharingLinkPassword(val *SharingLinkPassword) *NullableSharingLinkPassword {
|
||||
return &NullableSharingLinkPassword{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableSharingLinkPassword) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableSharingLinkPassword) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+119
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
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"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// SharingLinkType The type of the link created. | Value | Display name | Description | | -------------- | ----------------- | --------------------------------------------------------------- | | internal | Internal | Creates an internal link without any permissions. | | view | View | Creates a read-only link to the driveItem. | | upload | Upload | Creates a read-write link to the folder driveItem. | | edit | Edit | Creates a read-write link to the driveItem. | | createOnly | File Drop | Creates an upload-only link to the folder driveItem. | | blocksDownload | Secure View | Creates a read-only link that blocks download to the driveItem. |
|
||||
type SharingLinkType string
|
||||
|
||||
// List of sharingLinkType
|
||||
const (
|
||||
INTERNAL SharingLinkType = "internal"
|
||||
VIEW SharingLinkType = "view"
|
||||
UPLOAD SharingLinkType = "upload"
|
||||
EDIT SharingLinkType = "edit"
|
||||
CREATE_ONLY SharingLinkType = "createOnly"
|
||||
BLOCKS_DOWNLOAD SharingLinkType = "blocksDownload"
|
||||
)
|
||||
|
||||
// All allowed values of SharingLinkType enum
|
||||
var AllowedSharingLinkTypeEnumValues = []SharingLinkType{
|
||||
"internal",
|
||||
"view",
|
||||
"upload",
|
||||
"edit",
|
||||
"createOnly",
|
||||
"blocksDownload",
|
||||
}
|
||||
|
||||
func (v *SharingLinkType) UnmarshalJSON(src []byte) error {
|
||||
var value string
|
||||
err := json.Unmarshal(src, &value)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
enumTypeValue := SharingLinkType(value)
|
||||
for _, existing := range AllowedSharingLinkTypeEnumValues {
|
||||
if existing == enumTypeValue {
|
||||
*v = enumTypeValue
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
return fmt.Errorf("%+v is not a valid SharingLinkType", value)
|
||||
}
|
||||
|
||||
// NewSharingLinkTypeFromValue returns a pointer to a valid SharingLinkType
|
||||
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
||||
func NewSharingLinkTypeFromValue(v string) (*SharingLinkType, error) {
|
||||
ev := SharingLinkType(v)
|
||||
if ev.IsValid() {
|
||||
return &ev, nil
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid value '%v' for SharingLinkType: valid values are %v", v, AllowedSharingLinkTypeEnumValues)
|
||||
}
|
||||
}
|
||||
|
||||
// IsValid return true if the value is valid for the enum, false otherwise
|
||||
func (v SharingLinkType) IsValid() bool {
|
||||
for _, existing := range AllowedSharingLinkTypeEnumValues {
|
||||
if existing == v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Ptr returns reference to sharingLinkType value
|
||||
func (v SharingLinkType) Ptr() *SharingLinkType {
|
||||
return &v
|
||||
}
|
||||
|
||||
type NullableSharingLinkType struct {
|
||||
value *SharingLinkType
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func (v NullableSharingLinkType) Get() *SharingLinkType {
|
||||
return v.value
|
||||
}
|
||||
|
||||
func (v *NullableSharingLinkType) Set(val *SharingLinkType) {
|
||||
v.value = val
|
||||
v.isSet = true
|
||||
}
|
||||
|
||||
func (v NullableSharingLinkType) IsSet() bool {
|
||||
return v.isSet
|
||||
}
|
||||
|
||||
func (v *NullableSharingLinkType) Unset() {
|
||||
v.value = nil
|
||||
v.isSet = false
|
||||
}
|
||||
|
||||
func NewNullableSharingLinkType(val *SharingLinkType) *NullableSharingLinkType {
|
||||
return &NullableSharingLinkType{value: val, isSet: true}
|
||||
}
|
||||
|
||||
func (v NullableSharingLinkType) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(v.value)
|
||||
}
|
||||
|
||||
func (v *NullableSharingLinkType) UnmarshalJSON(src []byte) error {
|
||||
v.isSet = true
|
||||
return json.Unmarshal(src, &v.value)
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user