no need to filter, remove unnecessary openapi package

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2021-07-08 12:28:43 +00:00
parent d7031c93fe
commit 9376e2ef5e
4 changed files with 5 additions and 1812 deletions

View File

@@ -1,870 +0,0 @@
openapi: 3.0.1
info:
title: Open Graph API
version: v0.0
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: https://owncloud.dev/open-graph-api/
description: open Graph API
paths:
/me/drives:
get:
tags:
- me.drive
summary: Get drives from me
operationId: me.ListDrives
parameters:
- $ref: '#/components/parameters/top'
- $ref: '#/components/parameters/skip'
- $ref: '#/components/parameters/search'
- $ref: '#/components/parameters/filter'
- $ref: '#/components/parameters/count'
- name: $select
in: query
description: Select properties to be returned
style: form
explode: false
schema:
uniqueItems: true
type: array
items:
enum:
- id
- createdBy
- createdDateTime
- description
- eTag
- lastModifiedBy
- lastModifiedDateTime
- name
- parentReference
- webUrl
- driveType
- oCDriveStatus
- owner
- oCCoOwner
- quota
- createdByUser
- lastModifiedByUser
- root
type: string
maxItems: 18
- name: $expand
in: query
description: Expand related entities
style: form
explode: false
schema:
uniqueItems: true
type: array
items:
enum:
- '*'
- root
type: string
maxItems: 2
responses:
'200':
description: Retrieved navigation property
content:
application/json:
schema:
title: Collection of drive
type: object
properties:
value:
type: array
items:
$ref: '#/components/schemas/drive'
maxItems: 100
'@odata.nextLink':
type: string
links:
root:
operationId: me.drive.root.GetRoot
parameters:
drive-id: $request.path.drive-id
default:
$ref: '#/components/responses/error'
x-ms-pageable:
nextLinkName: '@odata.nextLink'
operationName: listMore
x-ms-docs-operation-type: operation
post:
tags:
- me.drive
summary: Create new navigation property to drives for me
operationId: me.CreateDrives
requestBody:
description: New navigation property
content:
application/json:
schema:
$ref: '#/components/schemas/drive'
required: true
responses:
'201':
description: Created navigation property.
content:
application/json:
schema:
$ref: '#/components/schemas/drive'
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
'/me/drives/{drive-id}':
get:
tags:
- me.drives
summary: Get drive by id
operationId: me.drives.GetDrive
parameters:
- name: drive-id
in: path
description: 'key: id of drive'
required: true
schema:
type: string
x-ms-docs-key-type: drive
- name: $select
in: query
description: Select properties to be returned
style: form
explode: false
schema:
uniqueItems: true
type: array
items:
enum:
- id
- createdBy
- createdDateTime
- description
- eTag
- lastModifiedBy
- lastModifiedDateTime
- name
- parentReference
- webUrl
- driveType
- oCDriveStatus
- owner
- oCCoOwner
- quota
- createdByUser
- lastModifiedByUser
- root
type: string
maxItems: 18
- name: $expand
in: query
description: Expand related entities
style: form
explode: false
schema:
uniqueItems: true
type: array
items:
enum:
- '*'
- root
type: string
maxItems: 2
responses:
'200':
description: Retrieved navigation property
content:
application/json:
schema:
$ref: '#/components/schemas/drive'
links:
root:
operationId: me.drive.root.GetRoot
parameters:
drive-id: $request.path.drive-id
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
patch:
tags:
- me.drives
summary: Update the navigation property of a specific drive
operationId: me.drives.UpdateDrive
parameters:
- name: drive-id
in: path
description: 'key: id of drive'
required: true
schema:
type: string
x-ms-docs-key-type: drive
requestBody:
description: New navigation property values
content:
application/json:
schema:
$ref: '#/components/schemas/drive'
required: true
responses:
'204':
description: Success
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
delete:
tags:
- me.drives
summary: Delete a specific navigation property drive
operationId: me.drives.DeleteDrive
parameters:
- name: drive-id
in: path
description: 'key: id of drive'
required: true
schema:
type: string
x-ms-docs-key-type: drive
- name: If-Match
in: header
description: ETag
schema:
type: string
responses:
'204':
description: Success
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
/drive/root:
get:
tags:
- me.drive.root
summary: Get root from drive
operationId: me.drive.root.GetRoot
parameters:
- name: $select
in: query
description: Select properties to be returned
style: form
explode: false
schema:
uniqueItems: true
type: array
items:
enum:
- id
- createdBy
- createdDateTime
- description
- eTag
- lastModifiedBy
- lastModifiedDateTime
- name
- parentReference
- webUrl
- audio
- content
- cTag
- deleted
- file
- fileSystemInfo
- folder
- image
- location
- package
- pendingOperations
- photo
- publication
- remoteItem
- root
- searchResult
- shared
- sharepointIds
- size
- specialFolder
- video
- webDavUrl
- createdByUser
- lastModifiedByUser
- workbook
- analytics
- children
- listItem
- permissions
- subscriptions
- thumbnails
- versions
type: string
responses:
'200':
description: Retrieved navigation property
content:
application/json:
schema:
$ref: '#/components/schemas/driveItem'
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
patch:
tags:
- me.drive.root
summary: Update the navigation property root in drive
operationId: me.drive.root.UpdateRoot
requestBody:
description: New navigation property values
content:
application/json:
schema:
$ref: '#/components/schemas/driveItem'
required: true
responses:
'204':
description: Success
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
delete:
tags:
- me.drive.root
summary: Delete navigation property root for drive
operationId: me.drive.root.DeleteRoot
parameters:
- name: If-Match
in: header
description: ETag
schema:
type: string
responses:
'204':
description: Success
default:
$ref: '#/components/responses/error'
x-ms-docs-operation-type: operation
components:
schemas:
drive:
allOf:
- $ref: '#/components/schemas/baseItem'
- type: object
properties:
driveType:
type: string
description: Describes the type of drive represented by this resource. Values are "personal" for users home spaces, "projectSpace" or "shares". Read-only.
readOnly: true
oCDriveStatus:
type: string
description: Describes the status of the drive.
owner:
$ref: '#/components/schemas/identitySet'
description: Optional. The user account that owns the drive. Read-only.
readOnly: true
oCCoOwner:
$ref: '#/components/schemas/identitySet'
description: Optional. The user account that owns the drive.
quota:
$ref: '#/components/schemas/quota'
description: Optional. Information about the drive's storage space quota. Read-only.
readOnly: true
items:
type: array
items:
$ref: '#/components/schemas/driveItem'
description: All items contained in the drive. Read-only. Nullable.
readOnly: true
root:
$ref: '#/components/schemas/driveItem'
description: The root folder of the drive. Read-only.
readOnly: true
baseItem:
allOf:
- $ref: '#/components/schemas/entity'
- type: object
properties:
createdBy:
$ref: '#/components/schemas/identitySet'
description: 'Identity of the user, device, or application which created the item. Read-only.'
readOnly: true
createdDateTime:
pattern: '^[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])$'
type: string
description: Date and time of item creation. Read-only.
format: date-time
readOnly: true
description:
type: string
description: Provides a user-visible description of the item. Optional.
eTag:
type: string
description: ETag for the item. Read-only.
readOnly: true
lastModifiedBy:
$ref: '#/components/schemas/identitySet'
description: 'Identity of the user, device, and application which last modified the item. Read-only.'
readOnly: true
lastModifiedDateTime:
pattern: '^[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])$'
type: string
description: Date and time the item was last modified. Read-only.
format: date-time
readOnly: true
name:
type: string
description: The name of the item. Read-write.
parentReference:
$ref: '#/components/schemas/itemReference'
description: 'Parent information, if the item has a parent. Read-write.'
webUrl:
type: string
description: URL that displays the resource in the browser. Read-only.
readOnly: true
createdByUser:
$ref: '#/components/schemas/user'
description: Identity of the user who created the item. Read-only.
readOnly: true
lastModifiedByUser:
$ref: '#/components/schemas/user'
description: Identity of the user who last modified the item. Read-only.
readOnly: true
entity:
type: object
properties:
id:
type: string
description: Read-only.
readOnly: true
discriminator:
propertyName: id
identitySet:
type: object
properties:
application:
$ref: '#/components/schemas/identity'
description: Optional. The application associated with this action.
device:
$ref: '#/components/schemas/identity'
description: Optional. The device associated with this action.
user:
$ref: '#/components/schemas/identity'
description: Optional. The user associated with this action.
identity:
type: object
properties:
displayName:
type: string
description: '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.'
id:
type: string
description: Unique identifier for the identity.
user:
allOf:
- $ref: '#/components/schemas/directoryObject'
- type: object
properties:
accountEnabled:
type: boolean
description: 'true if the account is enabled; otherwise, false. This property is required when a user is created. Returned only on $select. Supports $filter.'
businessPhones:
type: array
items:
type: string
description: The telephone numbers for the user. Only one number can be set for this property. Returned by default. Read-only for users synced from on-premises directory.
city:
type: string
description: The city in which the user is located. Returned only on $select. Supports $filter.
companyName:
type: string
description: The company name which the user is associated. This property can be useful for describing the company that an external user comes from. The maximum length of the company name is 64 characters.Returned only on $select.
country:
type: string
description: 'The country/region in which the user is located; for example, ''US'' or ''UK''. Returned only on $select. Supports $filter.'
maxLength: 3
createdDateTime:
pattern: '^[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])$'
type: string
description: The date and time the user was created. The value cannot be modified and is automatically populated when the entity is created. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. Property is nullable. A null value indicates that an accurate creation time couldn't be determined for the user. Returned only on $select. Read-only. Supports $filter.
format: date-time
readOnly: true
department:
type: string
description: The name for the department in which the user works. Returned only on $select. Supports $filter.
displayName:
type: string
description: '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 $filter and $orderby.'
faxNumber:
type: string
description: The fax number of the user. Returned only on $select.
givenName:
type: string
description: The given name (first name) of the user. Returned by default. Supports $filter.
lastPasswordChangeDateTime:
pattern: '^[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])$'
type: string
description: 'The time when this user last changed their password. 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 Returned only on $select. Read-only.'
format: date-time
readOnly: true
legalAgeGroupClassification:
type: string
description: 'Used by enterprise applications to determine the legal age group of the user. This property is read-only and calculated based on ageGroup and consentProvidedForMinor properties. Allowed values: null, minorWithOutParentalConsent, minorWithParentalConsent, minorNoParentalConsentRequired, notAdult and adult. Refer to the legal age group property definitions for further information. Returned only on $select.'
mail:
type: string
description: 'The SMTP address for the user, for example, ''jeff@contoso.onowncloud.com''. Returned by default. Supports $filter and endsWith.'
mailNickname:
type: string
description: The mail alias for the user. This property must be specified when a user is created. Returned only on $select. Supports $filter.
mobilePhone:
type: string
description: The primary cellular telephone number for the user. Returned by default. Read-only for users synced from on-premises directory.
officeLocation:
type: string
description: The office location in the user's place of business. Returned by default.
postalCode:
type: string
description: 'The postal code for the user''s postal address. The postal code is specific to the user''s country/region. In the United States of America, this attribute contains the ZIP code. Returned only on $select.'
preferredLanguage:
type: string
description: The preferred language for the user. Should follow ISO 639-1 Code; for example 'en-US'. Returned by default.
pattern: '^[a-z]{2}(-[A-Z]{2})?$'
maxLength: 7
state:
type: string
description: The state or province in the user's address. Returned only on $select. Supports $filter.
streetAddress:
type: string
description: The street address of the user's place of business. Returned only on $select.
surname:
type: string
description: The user's surname (family name or last name). Returned by default. Supports $filter.
usageLocation:
type: string
description: 'A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: ''US'', ''JP'', and ''GB''. Not nullable. Returned only on $select. Supports $filter.'
maxLength: 3
userPrincipalName:
type: string
description: 'The user principal name (UPN) of the user. The UPN is an Internet-style login name for the user based on the Internet standard RFC 822. By convention, this should map to the user''s email name. The general format is alias@domain, where domain must be present in the tenant''s collection of verified domains. This property is required when a user is created. The verified domains for the tenant can be accessed from the verifiedDomains property of organization. Returned by default. Supports $filter, $orderby, and endsWith.'
userType:
type: string
description: 'A string value that can be used to classify user types in your directory, such as ''Member'' and ''Guest''. Returned only on $select. Supports $filter.'
aboutMe:
type: string
description: A freeform text entry field for the user to describe themselves. Returned only on $select.
birthday:
pattern: '^[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])$'
type: string
description: 'The birthday of the user. 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 Returned only on $select.'
format: date-time
drive:
$ref: '#/components/schemas/drive'
description: The user's HomeDrive. Read-only.
readOnly: true
drives:
type: array
items:
$ref: '#/components/schemas/drive'
description: A collection of drives available for this user. Read-only.
maxItems: 100
readOnly: true
description: Represents an Active Directory user object.
itemReference:
type: object
properties:
driveId:
type: string
description: Unique identifier of the drive instance that contains the item. Read-only.
readOnly: true
driveType:
type: string
description: 'Identifies the type of drive. See [drive][] resource for values. Read-only.'
readOnly: true
id:
type: string
description: Unique identifier of the item in the drive. Read-only.
readOnly: true
name:
type: string
description: The name of the item being referenced. Read-only.
readOnly: true
path:
type: string
description: Path that can be used to navigate to the item. Read-only.
readOnly: true
shareId:
type: string
description: 'A unique identifier for a shared resource that can be accessed via the [Shares][] API.'
driveItem:
allOf:
- $ref: '#/components/schemas/baseItem'
- type: object
properties:
content:
type: string
description: 'The content stream, if the item represents a file.'
format: base64url
cTag:
type: string
description: 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.
readOnly: true
deleted:
$ref: '#/components/schemas/deleted'
description: Information about the deleted state of the item. Read-only.
readOnly: true
file:
$ref: '#/components/schemas/file'
description: 'File metadata, if the item is a file. Read-only.'
readOnly: true
fileSystemInfo:
$ref: '#/components/schemas/fileSystemInfo'
description: File system information on client. Read-write.
folder:
$ref: '#/components/schemas/folder'
description: 'Folder metadata, if the item is a folder. Read-only.'
readOnly: true
image:
$ref: '#/components/schemas/image'
description: 'Image metadata, if the item is an image. Read-only.'
readOnly: true
root:
$ref: '#/components/schemas/root'
description: 'If this property is non-null, it indicates that the driveItem is the top-most driveItem in the drive.'
size:
type: integer
description: Size of the item in bytes. Read-only.
format: int64
readOnly: true
webDavUrl:
type: string
description: WebDAV compatible URL for the item. Read-only.
readOnly: true
children:
type: array
items:
$ref: '#/components/schemas/driveItem'
description: Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable.
readOnly: true
deleted:
type: object
properties:
state:
type: string
description: Represents the state of the deleted item.
file:
type: object
properties:
hashes:
$ref: '#/components/schemas/hashes'
description: 'Hashes of the file''s binary content, if available. Read-only.'
readOnly: true
mimeType:
type: string
description: 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.
readOnly: true
processingMetadata:
type: boolean
fileSystemInfo:
type: object
properties:
createdDateTime:
pattern: '^[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])$'
type: string
description: The UTC date and time the file was created on a client.
format: date-time
lastAccessedDateTime:
pattern: '^[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])$'
type: string
description: The UTC date and time the file was last accessed. Available for the recent file list only.
format: date-time
lastModifiedDateTime:
pattern: '^[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])$'
type: string
description: The UTC date and time the file was last modified on a client.
format: date-time
folder:
type: object
properties:
childCount:
maximum: 2147483647
type: integer
description: Number of children contained immediately within this container.
format: int32
view:
$ref: '#/components/schemas/folderView'
description: A collection of properties defining the recommended view for the folder.
image:
type: object
properties:
height:
maximum: 2147483647
type: integer
description: 'Optional. Height of the image, in pixels. Read-only.'
format: int32
readOnly: true
width:
maximum: 2147483647
type: integer
description: 'Optional. Width of the image, in pixels. Read-only.'
format: int32
readOnly: true
root:
type: object
directoryObject:
allOf:
- $ref: '#/components/schemas/entity'
- type: object
properties:
deletedDateTime:
pattern: '^[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])$'
type: string
format: date-time
description: Represents an Active Directory object. The directoryObject type is the base type for many other directory entity types.
quota:
type: object
properties:
deleted:
type: integer
description: 'Total space consumed by files in the recycle bin, in bytes. Read-only.'
format: int64
readOnly: true
remaining:
type: integer
description: 'Total space remaining before reaching the quota limit, in bytes. Read-only.'
format: int64
readOnly: true
state:
type: string
description: Enumeration value that indicates the state of the storage space. Read-only.
readOnly: true
storagePlanInformation:
$ref: '#/components/schemas/storagePlanInformation'
description: Information about the drive's storage quota plans.
total:
type: integer
description: 'Total allowed storage space, in bytes. Read-only.'
format: int64
readOnly: true
used:
type: integer
description: 'Total space used, in bytes. Read-only.'
format: int64
readOnly: true
storagePlanInformation:
type: object
properties:
upgradeAvailable:
type: boolean
description: Indicates if there are higher storage quota plans available. Read-only.
hashes:
type: object
properties:
crc32Hash:
type: string
description: The CRC32 value of the file (if available). Read-only.
maxLength: 8
quickXorHash:
type: string
description: A proprietary hash of the file that can be used to determine if the contents of the file have changed (if available). Read-only.
sha1Hash:
type: string
description: SHA1 hash for the contents of the file (if available). Read-only.
maxLength: 40
sha256Hash:
type: string
description: SHA256 hash for the contents of the file (if available). Read-only.
maxLength: 160
folderView:
type: object
properties:
sortBy:
type: string
description: The method by which the folder should be sorted.
sortOrder:
type: string
description: 'If true, indicates that items should be sorted in descending order. Otherwise, items should be sorted ascending.'
viewType:
type: string
description: The type of view that should be used to represent the folder.
odata.error:
required:
- error
type: object
properties:
error:
$ref: '#/components/schemas/odata.error.main'
odata.error.main:
required:
- code
- message
type: object
properties:
code:
type: string
message:
type: string
target:
type: string
details:
type: array
items:
$ref: '#/components/schemas/odata.error.detail'
innererror:
type: object
description: The structure of this object is service-specific
odata.error.detail:
required:
- code
- message
type: object
properties:
code:
type: string
message:
type: string
target:
type: string
responses:
error:
description: error
content:
application/json:
schema:
$ref: '#/components/schemas/odata.error'
parameters:
top:
name: $top
in: query
description: Show only the first n items
schema:
minimum: 0
type: integer
example: 50
skip:
name: $skip
in: query
description: Skip the first n items
schema:
minimum: 0
type: integer
search:
name: $search
in: query
description: Search items by search phrases
schema:
type: string
filter:
name: $filter
in: query
description: Filter items by property values
schema:
type: string
count:
name: $count
in: query
description: Include count of items
schema:
type: boolean
securitySchemes:
bearerAuth:
type: http
scheme: bearer
security:
- bearerAuth: [ ]

View File

@@ -1,456 +0,0 @@
// Package GraphV0 provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
package GraphV0
import (
"context"
"fmt"
"net/http"
"github.com/deepmap/oapi-codegen/pkg/runtime"
"github.com/go-chi/chi/v5"
)
// ServerInterface represents all server handlers.
type ServerInterface interface {
// Delete navigation property root for drive
// (DELETE /drive/root)
MeDriveRootDeleteRoot(w http.ResponseWriter, r *http.Request, params MeDriveRootDeleteRootParams)
// Get root from drive
// (GET /drive/root)
MeDriveRootGetRoot(w http.ResponseWriter, r *http.Request, params MeDriveRootGetRootParams)
// Update the navigation property root in drive
// (PATCH /drive/root)
MeDriveRootUpdateRoot(w http.ResponseWriter, r *http.Request)
// Get drives from me
// (GET /me/drives)
MeListDrives(w http.ResponseWriter, r *http.Request, params MeListDrivesParams)
// Create new navigation property to drives for me
// (POST /me/drives)
MeCreateDrives(w http.ResponseWriter, r *http.Request)
// Delete a specific navigation property drive
// (DELETE /me/drives/{drive-id})
MeDrivesDeleteDrive(w http.ResponseWriter, r *http.Request, driveId string, params MeDrivesDeleteDriveParams)
// Get drive by id
// (GET /me/drives/{drive-id})
MeDrivesGetDrive(w http.ResponseWriter, r *http.Request, driveId string, params MeDrivesGetDriveParams)
// Update the navigation property of a specific drive
// (PATCH /me/drives/{drive-id})
MeDrivesUpdateDrive(w http.ResponseWriter, r *http.Request, driveId string)
}
// ServerInterfaceWrapper converts contexts to parameters.
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
}
type MiddlewareFunc func(http.HandlerFunc) http.HandlerFunc
// MeDriveRootDeleteRoot operation middleware
func (siw *ServerInterfaceWrapper) MeDriveRootDeleteRoot(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
ctx = context.WithValue(ctx, BearerAuthScopes, []string{""})
// Parameter object where we will unmarshal all parameters from the context
var params MeDriveRootDeleteRootParams
headers := r.Header
// ------------- Optional header parameter "If-Match" -------------
if valueList, found := headers[http.CanonicalHeaderKey("If-Match")]; found {
var IfMatch string
n := len(valueList)
if n != 1 {
http.Error(w, fmt.Sprintf("Expected one value for If-Match, got %d", n), http.StatusBadRequest)
return
}
err = runtime.BindStyledParameter("simple", false, "If-Match", valueList[0], &IfMatch)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter If-Match: %s", err), http.StatusBadRequest)
return
}
params.IfMatch = &IfMatch
}
var handler = func(w http.ResponseWriter, r *http.Request) {
siw.Handler.MeDriveRootDeleteRoot(w, r, params)
}
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler(w, r.WithContext(ctx))
}
// MeDriveRootGetRoot operation middleware
func (siw *ServerInterfaceWrapper) MeDriveRootGetRoot(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
ctx = context.WithValue(ctx, BearerAuthScopes, []string{""})
// Parameter object where we will unmarshal all parameters from the context
var params MeDriveRootGetRootParams
// ------------- Optional query parameter "$select" -------------
if paramValue := r.URL.Query().Get("$select"); paramValue != "" {
}
err = runtime.BindQueryParameter("form", false, false, "$select", r.URL.Query(), &params.Select)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter $select: %s", err), http.StatusBadRequest)
return
}
var handler = func(w http.ResponseWriter, r *http.Request) {
siw.Handler.MeDriveRootGetRoot(w, r, params)
}
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler(w, r.WithContext(ctx))
}
// MeDriveRootUpdateRoot operation middleware
func (siw *ServerInterfaceWrapper) MeDriveRootUpdateRoot(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
ctx = context.WithValue(ctx, BearerAuthScopes, []string{""})
var handler = func(w http.ResponseWriter, r *http.Request) {
siw.Handler.MeDriveRootUpdateRoot(w, r)
}
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler(w, r.WithContext(ctx))
}
// MeListDrives operation middleware
func (siw *ServerInterfaceWrapper) MeListDrives(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
ctx = context.WithValue(ctx, BearerAuthScopes, []string{""})
// Parameter object where we will unmarshal all parameters from the context
var params MeListDrivesParams
// ------------- Optional query parameter "$top" -------------
if paramValue := r.URL.Query().Get("$top"); paramValue != "" {
}
err = runtime.BindQueryParameter("form", true, false, "$top", r.URL.Query(), &params.Top)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter $top: %s", err), http.StatusBadRequest)
return
}
// ------------- Optional query parameter "$skip" -------------
if paramValue := r.URL.Query().Get("$skip"); paramValue != "" {
}
err = runtime.BindQueryParameter("form", true, false, "$skip", r.URL.Query(), &params.Skip)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter $skip: %s", err), http.StatusBadRequest)
return
}
// ------------- Optional query parameter "$search" -------------
if paramValue := r.URL.Query().Get("$search"); paramValue != "" {
}
err = runtime.BindQueryParameter("form", true, false, "$search", r.URL.Query(), &params.Search)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter $search: %s", err), http.StatusBadRequest)
return
}
// ------------- Optional query parameter "$filter" -------------
if paramValue := r.URL.Query().Get("$filter"); paramValue != "" {
}
err = runtime.BindQueryParameter("form", true, false, "$filter", r.URL.Query(), &params.Filter)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter $filter: %s", err), http.StatusBadRequest)
return
}
// ------------- Optional query parameter "$count" -------------
if paramValue := r.URL.Query().Get("$count"); paramValue != "" {
}
err = runtime.BindQueryParameter("form", true, false, "$count", r.URL.Query(), &params.Count)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter $count: %s", err), http.StatusBadRequest)
return
}
// ------------- Optional query parameter "$select" -------------
if paramValue := r.URL.Query().Get("$select"); paramValue != "" {
}
err = runtime.BindQueryParameter("form", false, false, "$select", r.URL.Query(), &params.Select)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter $select: %s", err), http.StatusBadRequest)
return
}
// ------------- Optional query parameter "$expand" -------------
if paramValue := r.URL.Query().Get("$expand"); paramValue != "" {
}
err = runtime.BindQueryParameter("form", false, false, "$expand", r.URL.Query(), &params.Expand)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter $expand: %s", err), http.StatusBadRequest)
return
}
var handler = func(w http.ResponseWriter, r *http.Request) {
siw.Handler.MeListDrives(w, r, params)
}
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler(w, r.WithContext(ctx))
}
// MeCreateDrives operation middleware
func (siw *ServerInterfaceWrapper) MeCreateDrives(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
ctx = context.WithValue(ctx, BearerAuthScopes, []string{""})
var handler = func(w http.ResponseWriter, r *http.Request) {
siw.Handler.MeCreateDrives(w, r)
}
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler(w, r.WithContext(ctx))
}
// MeDrivesDeleteDrive operation middleware
func (siw *ServerInterfaceWrapper) MeDrivesDeleteDrive(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
// ------------- Path parameter "drive-id" -------------
var driveId string
err = runtime.BindStyledParameter("simple", false, "drive-id", chi.URLParam(r, "drive-id"), &driveId)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter drive-id: %s", err), http.StatusBadRequest)
return
}
ctx = context.WithValue(ctx, BearerAuthScopes, []string{""})
// Parameter object where we will unmarshal all parameters from the context
var params MeDrivesDeleteDriveParams
headers := r.Header
// ------------- Optional header parameter "If-Match" -------------
if valueList, found := headers[http.CanonicalHeaderKey("If-Match")]; found {
var IfMatch string
n := len(valueList)
if n != 1 {
http.Error(w, fmt.Sprintf("Expected one value for If-Match, got %d", n), http.StatusBadRequest)
return
}
err = runtime.BindStyledParameter("simple", false, "If-Match", valueList[0], &IfMatch)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter If-Match: %s", err), http.StatusBadRequest)
return
}
params.IfMatch = &IfMatch
}
var handler = func(w http.ResponseWriter, r *http.Request) {
siw.Handler.MeDrivesDeleteDrive(w, r, driveId, params)
}
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler(w, r.WithContext(ctx))
}
// MeDrivesGetDrive operation middleware
func (siw *ServerInterfaceWrapper) MeDrivesGetDrive(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
// ------------- Path parameter "drive-id" -------------
var driveId string
err = runtime.BindStyledParameter("simple", false, "drive-id", chi.URLParam(r, "drive-id"), &driveId)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter drive-id: %s", err), http.StatusBadRequest)
return
}
ctx = context.WithValue(ctx, BearerAuthScopes, []string{""})
// Parameter object where we will unmarshal all parameters from the context
var params MeDrivesGetDriveParams
// ------------- Optional query parameter "$select" -------------
if paramValue := r.URL.Query().Get("$select"); paramValue != "" {
}
err = runtime.BindQueryParameter("form", false, false, "$select", r.URL.Query(), &params.Select)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter $select: %s", err), http.StatusBadRequest)
return
}
// ------------- Optional query parameter "$expand" -------------
if paramValue := r.URL.Query().Get("$expand"); paramValue != "" {
}
err = runtime.BindQueryParameter("form", false, false, "$expand", r.URL.Query(), &params.Expand)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter $expand: %s", err), http.StatusBadRequest)
return
}
var handler = func(w http.ResponseWriter, r *http.Request) {
siw.Handler.MeDrivesGetDrive(w, r, driveId, params)
}
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler(w, r.WithContext(ctx))
}
// MeDrivesUpdateDrive operation middleware
func (siw *ServerInterfaceWrapper) MeDrivesUpdateDrive(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var err error
// ------------- Path parameter "drive-id" -------------
var driveId string
err = runtime.BindStyledParameter("simple", false, "drive-id", chi.URLParam(r, "drive-id"), &driveId)
if err != nil {
http.Error(w, fmt.Sprintf("Invalid format for parameter drive-id: %s", err), http.StatusBadRequest)
return
}
ctx = context.WithValue(ctx, BearerAuthScopes, []string{""})
var handler = func(w http.ResponseWriter, r *http.Request) {
siw.Handler.MeDrivesUpdateDrive(w, r, driveId)
}
for _, middleware := range siw.HandlerMiddlewares {
handler = middleware(handler)
}
handler(w, r.WithContext(ctx))
}
// Handler creates http.Handler with routing matching OpenAPI spec.
func Handler(si ServerInterface) http.Handler {
return HandlerWithOptions(si, ChiServerOptions{})
}
type ChiServerOptions struct {
BaseURL string
BaseRouter chi.Router
Middlewares []MiddlewareFunc
}
// HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler {
return HandlerWithOptions(si, ChiServerOptions{
BaseRouter: r,
})
}
func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler {
return HandlerWithOptions(si, ChiServerOptions{
BaseURL: baseURL,
BaseRouter: r,
})
}
// HandlerWithOptions creates http.Handler with additional options
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler {
r := options.BaseRouter
if r == nil {
r = chi.NewRouter()
}
wrapper := ServerInterfaceWrapper{
Handler: si,
HandlerMiddlewares: options.Middlewares,
}
r.Group(func(r chi.Router) {
r.Delete(options.BaseURL+"/drive/root", wrapper.MeDriveRootDeleteRoot)
})
r.Group(func(r chi.Router) {
r.Get(options.BaseURL+"/drive/root", wrapper.MeDriveRootGetRoot)
})
r.Group(func(r chi.Router) {
r.Patch(options.BaseURL+"/drive/root", wrapper.MeDriveRootUpdateRoot)
})
r.Group(func(r chi.Router) {
r.Get(options.BaseURL+"/me/drives", wrapper.MeListDrives)
})
r.Group(func(r chi.Router) {
r.Post(options.BaseURL+"/me/drives", wrapper.MeCreateDrives)
})
r.Group(func(r chi.Router) {
r.Delete(options.BaseURL+"/me/drives/{drive-id}", wrapper.MeDrivesDeleteDrive)
})
r.Group(func(r chi.Router) {
r.Get(options.BaseURL+"/me/drives/{drive-id}", wrapper.MeDrivesGetDrive)
})
r.Group(func(r chi.Router) {
r.Patch(options.BaseURL+"/me/drives/{drive-id}", wrapper.MeDrivesUpdateDrive)
})
return r
}

View File

@@ -1,469 +0,0 @@
// Package GraphV0 provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
package GraphV0
import (
"time"
)
const (
BearerAuthScopes = "bearerAuth.Scopes"
)
// BaseItem defines model for baseItem.
type BaseItem struct {
// Embedded struct due to allOf(#/components/schemas/entity)
Entity `yaml:",inline"`
// Embedded fields due to inline allOf schema
CreatedBy *IdentitySet `json:"createdBy,omitempty"`
CreatedByUser *User `json:"createdByUser,omitempty"`
// Date and time of item creation. Read-only.
CreatedDateTime *time.Time `json:"createdDateTime,omitempty"`
// 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"`
LastModifiedByUser *User `json:"lastModifiedByUser,omitempty"`
// Date and time the item was last modified. Read-only.
LastModifiedDateTime *time.Time `json:"lastModifiedDateTime,omitempty"`
// 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"`
}
// Deleted defines model for deleted.
type Deleted struct {
// Represents the state of the deleted item.
State *string `json:"state,omitempty"`
}
// DirectoryObject defines model for directoryObject.
type DirectoryObject struct {
// Embedded struct due to allOf(#/components/schemas/entity)
Entity `yaml:",inline"`
// Embedded fields due to inline allOf schema
DeletedDateTime *time.Time `json:"deletedDateTime,omitempty"`
}
// Drive defines model for drive.
type Drive struct {
// Embedded struct due to allOf(#/components/schemas/baseItem)
BaseItem `yaml:",inline"`
// Embedded fields due to inline allOf schema
// Describes the type of drive represented by this resource. Values are "personal" for users home spaces, "projectSpace" or "shares". Read-only.
DriveType *string `json:"driveType,omitempty"`
// All items contained in the drive. Read-only. Nullable.
Items *[]DriveItem `json:"items,omitempty"`
OCCoOwner *IdentitySet `json:"oCCoOwner,omitempty"`
// Describes the status of the drive.
OCDriveStatus *string `json:"oCDriveStatus,omitempty"`
Owner *IdentitySet `json:"owner,omitempty"`
Quota *Quota `json:"quota,omitempty"`
Root *DriveItem `json:"root,omitempty"`
}
// DriveItem defines model for driveItem.
type DriveItem struct {
// Embedded struct due to allOf(#/components/schemas/baseItem)
BaseItem `yaml:",inline"`
// Embedded fields due to inline allOf schema
// 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"`
// Collection containing Item objects for the immediate children of Item. Only items representing folders have children. Read-only. Nullable.
Children *[]DriveItem `json:"children,omitempty"`
// The content stream, if the item represents a file.
Content *string `json:"content,omitempty"`
Deleted *Deleted `json:"deleted,omitempty"`
File *File `json:"file,omitempty"`
FileSystemInfo *FileSystemInfo `json:"fileSystemInfo,omitempty"`
Folder *Folder `json:"folder,omitempty"`
Image *Image `json:"image,omitempty"`
Root *Root `json:"root,omitempty"`
// Size of the item in bytes. Read-only.
Size *int64 `json:"size,omitempty"`
// WebDAV compatible URL for the item. Read-only.
WebDavUrl *string `json:"webDavUrl,omitempty"`
}
// Entity defines model for entity.
type Entity struct {
// Read-only.
Id *string `json:"id,omitempty"`
}
// File defines model for file.
type File 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"`
}
// FileSystemInfo defines model for fileSystemInfo.
type FileSystemInfo struct {
// The UTC date and time the file was created on a client.
CreatedDateTime *time.Time `json:"createdDateTime,omitempty"`
// The UTC date and time the file was last accessed. Available for the recent file list only.
LastAccessedDateTime *time.Time `json:"lastAccessedDateTime,omitempty"`
// The UTC date and time the file was last modified on a client.
LastModifiedDateTime *time.Time `json:"lastModifiedDateTime,omitempty"`
}
// Folder defines model for folder.
type Folder struct {
// Number of children contained immediately within this container.
ChildCount *int32 `json:"childCount,omitempty"`
View *FolderView `json:"view,omitempty"`
}
// FolderView defines model for folderView.
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"`
}
// Hashes defines model for hashes.
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"`
}
// Identity defines model 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,omitempty"`
// Unique identifier for the identity.
Id *string `json:"id,omitempty"`
}
// IdentitySet defines model for identitySet.
type IdentitySet struct {
Application *Identity `json:"application,omitempty"`
Device *Identity `json:"device,omitempty"`
User *Identity `json:"user,omitempty"`
}
// Image defines model for image.
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"`
}
// ItemReference defines model 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"`
// A unique identifier for a shared resource that can be accessed via the [Shares][] API.
ShareId *string `json:"shareId,omitempty"`
}
// OdataError defines model for odata.error.
type OdataError struct {
Error OdataErrorMain `json:"error"`
}
// OdataErrorDetail defines model for odata.error.detail.
type OdataErrorDetail struct {
Code string `json:"code"`
Message string `json:"message"`
Target *string `json:"target,omitempty"`
}
// OdataErrorMain defines model for odata.error.main.
type OdataErrorMain struct {
Code string `json:"code"`
Details *[]OdataErrorDetail `json:"details,omitempty"`
// The structure of this object is service-specific
Innererror *map[string]interface{} `json:"innererror,omitempty"`
Message string `json:"message"`
Target *string `json:"target,omitempty"`
}
// Quota defines model for quota.
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. Read-only.
State *string `json:"state,omitempty"`
StoragePlanInformation *StoragePlanInformation `json:"storagePlanInformation,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"`
}
// Root defines model for root.
type Root map[string]interface{}
// StoragePlanInformation defines model for storagePlanInformation.
type StoragePlanInformation struct {
// Indicates if there are higher storage quota plans available. Read-only.
UpgradeAvailable *bool `json:"upgradeAvailable,omitempty"`
}
// User defines model for user.
type User struct {
// Embedded struct due to allOf(#/components/schemas/directoryObject)
DirectoryObject `yaml:",inline"`
// Embedded fields due to inline allOf schema
// A freeform text entry field for the user to describe themselves. Returned only on $select.
AboutMe *string `json:"aboutMe,omitempty"`
// true if the account is enabled; otherwise, false. This property is required when a user is created. Returned only on $select. Supports $filter.
AccountEnabled *bool `json:"accountEnabled,omitempty"`
// The birthday of the user. 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 Returned only on $select.
Birthday *time.Time `json:"birthday,omitempty"`
// The telephone numbers for the user. Only one number can be set for this property. Returned by default. Read-only for users synced from on-premises directory.
BusinessPhones *[]string `json:"businessPhones,omitempty"`
// The city in which the user is located. Returned only on $select. Supports $filter.
City *string `json:"city,omitempty"`
// The company name which the user is associated. This property can be useful for describing the company that an external user comes from. The maximum length of the company name is 64 characters.Returned only on $select.
CompanyName *string `json:"companyName,omitempty"`
// The country/region in which the user is located; for example, 'US' or 'UK'. Returned only on $select. Supports $filter.
Country *string `json:"country,omitempty"`
// The date and time the user was created. The value cannot be modified and is automatically populated when the entity is created. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. Property is nullable. A null value indicates that an accurate creation time couldn't be determined for the user. Returned only on $select. Read-only. Supports $filter.
CreatedDateTime *time.Time `json:"createdDateTime,omitempty"`
// The name for the department in which the user works. Returned only on $select. Supports $filter.
Department *string `json:"department,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 $filter and $orderby.
DisplayName *string `json:"displayName,omitempty"`
Drive *Drive `json:"drive,omitempty"`
// A collection of drives available for this user. Read-only.
Drives *[]Drive `json:"drives,omitempty"`
// The fax number of the user. Returned only on $select.
FaxNumber *string `json:"faxNumber,omitempty"`
// The given name (first name) of the user. Returned by default. Supports $filter.
GivenName *string `json:"givenName,omitempty"`
// The time when this user last changed their password. 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 Returned only on $select. Read-only.
LastPasswordChangeDateTime *time.Time `json:"lastPasswordChangeDateTime,omitempty"`
// Used by enterprise applications to determine the legal age group of the user. This property is read-only and calculated based on ageGroup and consentProvidedForMinor properties. Allowed values: null, minorWithOutParentalConsent, minorWithParentalConsent, minorNoParentalConsentRequired, notAdult and adult. Refer to the legal age group property definitions for further information. Returned only on $select.
LegalAgeGroupClassification *string `json:"legalAgeGroupClassification,omitempty"`
// The SMTP address for the user, for example, 'jeff@contoso.onowncloud.com'. Returned by default. Supports $filter and endsWith.
Mail *string `json:"mail,omitempty"`
// The mail alias for the user. This property must be specified when a user is created. Returned only on $select. Supports $filter.
MailNickname *string `json:"mailNickname,omitempty"`
// The primary cellular telephone number for the user. Returned by default. Read-only for users synced from on-premises directory.
MobilePhone *string `json:"mobilePhone,omitempty"`
// The office location in the user's place of business. Returned by default.
OfficeLocation *string `json:"officeLocation,omitempty"`
// The postal code for the user's postal address. The postal code is specific to the user's country/region. In the United States of America, this attribute contains the ZIP code. Returned only on $select.
PostalCode *string `json:"postalCode,omitempty"`
// The preferred language for the user. Should follow ISO 639-1 Code; for example 'en-US'. Returned by default.
PreferredLanguage *string `json:"preferredLanguage,omitempty"`
// The state or province in the user's address. Returned only on $select. Supports $filter.
State *string `json:"state,omitempty"`
// The street address of the user's place of business. Returned only on $select.
StreetAddress *string `json:"streetAddress,omitempty"`
// The user's surname (family name or last name). Returned by default. Supports $filter.
Surname *string `json:"surname,omitempty"`
// A two letter country code (ISO standard 3166). Required for users that will be assigned licenses due to legal requirement to check for availability of services in countries. Examples include: 'US', 'JP', and 'GB'. Not nullable. Returned only on $select. Supports $filter.
UsageLocation *string `json:"usageLocation,omitempty"`
// The user principal name (UPN) of the user. The UPN is an Internet-style login name for the user based on the Internet standard RFC 822. By convention, this should map to the user's email name. The general format is alias@domain, where domain must be present in the tenant's collection of verified domains. This property is required when a user is created. The verified domains for the tenant can be accessed from the verifiedDomains property of organization. Returned by default. Supports $filter, $orderby, and endsWith.
UserPrincipalName *string `json:"userPrincipalName,omitempty"`
// A string value that can be used to classify user types in your directory, such as 'Member' and 'Guest'. Returned only on $select. Supports $filter.
UserType *string `json:"userType,omitempty"`
}
// Count defines model for count.
type Count bool
// Filter defines model for filter.
type Filter string
// Search defines model for search.
type Search string
// Skip defines model for skip.
type Skip int
// Top defines model for top.
type Top int
// Error defines model for error.
type Error OdataError
// MeDriveRootDeleteRootParams defines parameters for MeDriveRootDeleteRoot.
type MeDriveRootDeleteRootParams struct {
// ETag
IfMatch *string `json:"If-Match,omitempty"`
}
// MeDriveRootGetRootParams defines parameters for MeDriveRootGetRoot.
type MeDriveRootGetRootParams struct {
// Select properties to be returned
Select *[]MeDriveRootGetRootParamsSelect `json:"$select,omitempty"`
}
// MeDriveRootGetRootParamsSelect defines parameters for MeDriveRootGetRoot.
type MeDriveRootGetRootParamsSelect string
// MeDriveRootUpdateRootJSONBody defines parameters for MeDriveRootUpdateRoot.
type MeDriveRootUpdateRootJSONBody DriveItem
// MeListDrivesParams defines parameters for MeListDrives.
type MeListDrivesParams struct {
// Show only the first n items
Top *Top `json:"$top,omitempty"`
// Skip the first n items
Skip *Skip `json:"$skip,omitempty"`
// Search items by search phrases
Search *Search `json:"$search,omitempty"`
// Filter items by property values
Filter *Filter `json:"$filter,omitempty"`
// Include count of items
Count *Count `json:"$count,omitempty"`
// Select properties to be returned
Select *[]MeListDrivesParamsSelect `json:"$select,omitempty"`
// Expand related entities
Expand *[]MeListDrivesParamsExpand `json:"$expand,omitempty"`
}
// MeListDrivesParamsSelect defines parameters for MeListDrives.
type MeListDrivesParamsSelect string
// MeListDrivesParamsExpand defines parameters for MeListDrives.
type MeListDrivesParamsExpand string
// MeCreateDrivesJSONBody defines parameters for MeCreateDrives.
type MeCreateDrivesJSONBody Drive
// MeDrivesDeleteDriveParams defines parameters for MeDrivesDeleteDrive.
type MeDrivesDeleteDriveParams struct {
// ETag
IfMatch *string `json:"If-Match,omitempty"`
}
// MeDrivesGetDriveParams defines parameters for MeDrivesGetDrive.
type MeDrivesGetDriveParams struct {
// Select properties to be returned
Select *[]MeDrivesGetDriveParamsSelect `json:"$select,omitempty"`
// Expand related entities
Expand *[]MeDrivesGetDriveParamsExpand `json:"$expand,omitempty"`
}
// MeDrivesGetDriveParamsSelect defines parameters for MeDrivesGetDrive.
type MeDrivesGetDriveParamsSelect string
// MeDrivesGetDriveParamsExpand defines parameters for MeDrivesGetDrive.
type MeDrivesGetDriveParamsExpand string
// MeDrivesUpdateDriveJSONBody defines parameters for MeDrivesUpdateDrive.
type MeDrivesUpdateDriveJSONBody Drive
// MeDriveRootUpdateRootJSONRequestBody defines body for MeDriveRootUpdateRoot for application/json ContentType.
type MeDriveRootUpdateRootJSONRequestBody MeDriveRootUpdateRootJSONBody
// MeCreateDrivesJSONRequestBody defines body for MeCreateDrives for application/json ContentType.
type MeCreateDrivesJSONRequestBody MeCreateDrivesJSONBody
// MeDrivesUpdateDriveJSONRequestBody defines body for MeDrivesUpdateDrive for application/json ContentType.
type MeDrivesUpdateDriveJSONRequestBody MeDrivesUpdateDriveJSONBody

View File

@@ -56,28 +56,15 @@ func (g Graph) GetDrives(w http.ResponseWriter, r *http.Request) {
ctx = token.ContextSetToken(ctx, t)
ctx = metadata.AppendToOutgoingContext(ctx, "x-access-token", t)
req := &storageprovider.ListStorageSpacesRequest{
Filters: []*storageprovider.ListStorageSpacesRequest_Filter{
{
Type: storageprovider.ListStorageSpacesRequest_Filter_TYPE_ID,
Term: &storageprovider.ListStorageSpacesRequest_Filter_Id{
Id: &storageprovider.StorageSpaceId{
OpaqueId: "1284d238-aa92-42ce-bdc4-0b0000009157", // FIXME dynamically discover home and other storages ... actually the storage registry should provide the list of storage spaces
},
},
},
},
}
res, err := client.ListStorageSpaces(ctx, req)
res, err := client.ListStorageSpaces(ctx, &storageprovider.ListStorageSpacesRequest{})
if err != nil {
g.logger.Error().Err(err).Msg("error sending list storage spaces grpc request")
w.WriteHeader(http.StatusInternalServerError)
return
}
// TODO handle not found and other status codes
if res.Status.Code != cs3rpc.Code_CODE_OK {
g.logger.Error().Err(err).Msg("error calling grpc list storage spaces")
g.logger.Error().Err(err).Interface("status", res.Status).Msg("error calling grpc list storage spaces")
w.WriteHeader(http.StatusInternalServerError)
return
}
@@ -138,8 +125,9 @@ func (g Graph) GetRootDriveChildren(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
return
}
// TODO handle not found and other status codes
if res.Status.Code != cs3rpc.Code_CODE_OK {
g.logger.Error().Err(err).Str("path", fn).Msg("error calling grpc list container")
g.logger.Error().Err(err).Str("path", fn).Interface("status", res.Status).Msg("error calling grpc list container")
w.WriteHeader(http.StatusInternalServerError)
return
}