Documentation ¶
Index ¶
- type Client
- func (c *Client) Do(ctx context.Context, req *http.Request, isUsingPlainHttpClient bool, ...) error
- func (c *Client) NewFileUploadRequest(relativeURL string, contentType string, fileReader *bytes.Reader) (*http.Request, error)
- func (c *Client) NewRequest(method, relativeURL string, body interface{}) (*http.Request, error)
- func (c *Client) NewRequestToOneDrive(method, absoluteUrl string, body interface{}) (*http.Request, error)
- func (c *Client) NewSessionFileUploadRequest(absoluteUrl string, grandOffset, grandTotalSize int64, ...) (*http.Request, error)
- type CopyItemRequest
- type CopyItemResponse
- type CreateShareLinkRequest
- type Drive
- type DriveAsyncJobService
- type DriveItem
- type DriveItemFile
- type DriveItemFolder
- type DriveItemsService
- func (s *DriveItemsService) Copy(ctx context.Context, sourceDriveId string, itemId string, ...) (*CopyItemResponse, error)
- func (s *DriveItemsService) CreateNewFolder(ctx context.Context, driveId string, parentFolderName string, ...) (*DriveItem, error)
- func (s *DriveItemsService) Delete(ctx context.Context, driveId string, itemId string) error
- func (s *DriveItemsService) DownloadItem(ctx context.Context, item *DriveItem) ([]byte, error)
- func (s *DriveItemsService) Get(ctx context.Context, itemId string) (*DriveItem, error)
- func (s *DriveItemsService) GetSpecial(ctx context.Context, folderName DriveSpecialFolder) (*DriveItem, error)
- func (s *DriveItemsService) List(ctx context.Context, folderId string) (*OneDriveDriveItemsResponse, error)
- func (s *DriveItemsService) ListSpecial(ctx context.Context, folderName DriveSpecialFolder) (*OneDriveDriveItemsResponse, error)
- func (s *DriveItemsService) Move(ctx context.Context, driveId string, itemId string, ...) (*MoveItemResponse, error)
- func (s *DriveItemsService) Rename(ctx context.Context, driveId string, itemId string, newItemName string) (*RenameItemResponse, error)
- func (s *DriveItemsService) UploadNewFile(ctx context.Context, driveId string, destinationParentFolderId string, ...) (*DriveItem, error)
- func (s *DriveItemsService) UploadNewFileLarge(ctx context.Context, driveId string, destinationParentFolderId string, ...) (*DriveItem, error)
- func (s *DriveItemsService) UploadToReplaceFile(ctx context.Context, driveId string, localFilePath string, itemId string) (*DriveItem, error)
- type DriveQuota
- type DriveSearchService
- type DriveSpecialFolder
- type DrivesService
- type Error
- type ErrorResponse
- type Facet
- type InnerError
- type ListPermissionsResponse
- type MoveItemRequest
- type MoveItemResponse
- type NewFolderCreationRequest
- type NewUploadSessionCreationRequest
- type NewUploadSessionCreationResponse
- type OneDriveAsyncJobMonitorResponse
- type OneDriveAudio
- type OneDriveDriveItemsResponse
- type OneDriveDriveSearchResponse
- type OneDriveDrivesResponse
- type OneDriveImage
- type OneDrivePhoto
- type OneDriveVideo
- type Owner
- type ParentReference
- type Permission
- type PermissionService
- func (s *PermissionService) CreateShareLink(ctx context.Context, itemId string, permissionType ShareLinkType, ...) (*Permission, error)
- func (s *PermissionService) Delete(ctx context.Context, driveId string, itemId string, permissionId string) error
- func (s *PermissionService) List(ctx context.Context, itemId string) ([]Permission, error)
- type RenameItemRequest
- type RenameItemResponse
- type ShareLinkScope
- type ShareLinkType
- type SharingLink
- type UploadSessionUploadResponse
- type User
- type UserService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Base URL for API requests. Defaults to the public OneDrive API. BaseURL should // always be specified with a trailing slash. BaseURL *url.URL // Services used for talking to different parts of the OneDrive API. User *UserService Drives *DrivesService DriveItems *DriveItemsService DriveSearch *DriveSearchService DriveAsyncJob *DriveAsyncJobService DrivePermissions *PermissionService // contains filtered or unexported fields }
A Client manages communication with the OneDrive API.
func NewClient ¶
NewClient returns a new OneDrive API client. If a nil httpClient is provided, a new http.Client will be used. To use API methods which require authentication, provide an http.Client that will perform the authentication for you (such as that provided by the golang.org/x/oauth2 library).
func (*Client) Do ¶
func (c *Client) Do(ctx context.Context, req *http.Request, isUsingPlainHttpClient bool, target interface{}) error
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by target, or returned as an error if an API error has occurred.
func (*Client) NewFileUploadRequest ¶
func (c *Client) NewFileUploadRequest(relativeURL string, contentType string, fileReader *bytes.Reader) (*http.Request, error)
NewFileUploadRequest creates an API request to upload files. A relative URL can be provided in relativeURL, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified WITHOUT a preceding slash.
func (*Client) NewRequest ¶
NewRequest creates an API request. A relative URL can be provided in relativeURL, in which case it is resolved relative to the BaseURL of the Client. Relative URLs should always be specified WITHOUT a preceding slash.
func (*Client) NewRequestToOneDrive ¶
func (c *Client) NewRequestToOneDrive(method, absoluteUrl string, body interface{}) (*http.Request, error)
NewRequest creates an API request to OneDrive API directly with an absolute URL.
func (*Client) NewSessionFileUploadRequest ¶
func (c *Client) NewSessionFileUploadRequest(absoluteUrl string, grandOffset, grandTotalSize int64, byteReader *bytes.Reader) (*http.Request, error)
NewSessionFileUploadRequest creates an API request to upload files to an upload session. A relative URL can be provided in relativeURL, in which case it is resolved relative to the BaseURL of the Client. Absolute URLs should always be specified WITHOUT a preceding slash. See: https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_createuploadsession?view=odsp-graph-online#upload-bytes-to-the-upload-session
type CopyItemRequest ¶
type CopyItemRequest struct { Name string `json:"name"` ParentFolder ParentReference `json:"parentReference"` }
CopyItemRequest represents the information needed of copying an item in OneDrive.
type CopyItemResponse ¶
type CopyItemResponse struct {
Location string `json:"location"`
}
CopyItemResponse represents the JSON object returned by the OneDrive API after copying an item.
type CreateShareLinkRequest ¶
type CreateShareLinkRequest struct {}
CreateShareLinkRequest is the request for creating a share link.
type Drive ¶
type Drive struct { Id string `json:"id"` DriveType string `json:"driveType"` Owner *Owner `json:"owner"` Quota *DriveQuota `json:"quota"` }
Drive represents a OneDrive drive.
type DriveAsyncJobService ¶
type DriveAsyncJobService service
DriveAsyncJobService handles communication with the drive items searching related methods of the OneDrive API.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/concepts/long-running-actions?view=odsp-graph-online
func (*DriveAsyncJobService) Monitor ¶
func (s *DriveAsyncJobService) Monitor(ctx context.Context, monitorUrl string) (*OneDriveAsyncJobMonitorResponse, error)
Retrieve a status report from the monitor URL of OneDrive.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/concepts/long-running-actions?view=odsp-graph-online#retrieve-a-status-report-from-the-monitor-url
type DriveItem ¶
type DriveItem struct { Name string `json:"name"` Id string `json:"id"` DownloadURL string `json:"@microsoft.graph.downloadUrl"` Description string `json:"description"` Size int64 `json:"size"` WebURL string `json:"webUrl"` Audio *OneDriveAudio `json:"audio"` Video *OneDriveVideo `json:"video"` Image *OneDriveImage `json:"image"` Photo *OneDrivePhoto `json:"photo"` File *DriveItemFile `json:"file"` Folder *DriveItemFolder `json:"folder"` }
DriveItem represents a OneDrive drive item. Ref https://docs.microsoft.com/en-us/graph/api/resources/driveitem?view=graph-rest-1.0
type DriveItemFile ¶
type DriveItemFile struct {
MIMEType string `json:"mimeType"`
}
DriveItemFile represents a OneDrive drive item file info.
type DriveItemFolder ¶
type DriveItemFolder struct {
ChildCount int32 `json:"childCount"`
}
DriveItemFolder represents a OneDrive drive item folder info.
type DriveItemsService ¶
type DriveItemsService service
DriveItemsService handles communication with the drive items related methods of the OneDrive API.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/resources/driveitem?view=odsp-graph-online
func (*DriveItemsService) Copy ¶
func (s *DriveItemsService) Copy(ctx context.Context, sourceDriveId string, itemId string, destinationDriveId string, destinationFolderId string, newItemName string) (*CopyItemResponse, error)
Copy a drive item to a new parent item or with a new name in a drive of the authenticated user.
If sourceDriveId or destinationDriveId is empty, it means the selected drive will be the default drive of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_copy?view=odsp-graph-online
func (*DriveItemsService) CreateNewFolder ¶
func (s *DriveItemsService) CreateNewFolder(ctx context.Context, driveId string, parentFolderName string, folderName string) (*DriveItem, error)
Create a new folder in a drive of the authenticated user. If there is already a folder in the same OneDrive directory with the same name, OneDrive will choose a new name for the folder while creating it.
If driveId is empty, it means the selected drive will be the default drive of the authenticated user.
If parentFolderName is empty, it means the new folder will be created at the root of the default drive.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_post_children?view=odsp-graph-online
func (*DriveItemsService) Delete ¶
Delete will delete a drive item in a drive of the authenticated user. The deleted item will be moved to the Recycle Bin instead of getting permanently deleted.
If driveId is empty, it means the selected drive will be the default drive of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_delete?view=odsp-graph-online
func (*DriveItemsService) DownloadItem ¶
DownloadItem downloads the given item from OneDrive
func (*DriveItemsService) Get ¶
Get an item in the default drive of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_get?view=odsp-graph-online
func (*DriveItemsService) GetSpecial ¶
func (s *DriveItemsService) GetSpecial(ctx context.Context, folderName DriveSpecialFolder) (*DriveItem, error)
Get an item from special folder in the default drive of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/drive_get_specialfolder?view=odsp-graph-online
func (*DriveItemsService) List ¶
func (s *DriveItemsService) List(ctx context.Context, folderId string) (*OneDriveDriveItemsResponse, error)
List the items of a folder in the default drive of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/resources/driveitem?view=odsp-graph-online
func (*DriveItemsService) ListSpecial ¶
func (s *DriveItemsService) ListSpecial(ctx context.Context, folderName DriveSpecialFolder) (*OneDriveDriveItemsResponse, error)
List the items of a special folder in the default drive of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/drive_get_specialfolder?view=odsp-graph-online#get-children-of-a-special-folder
func (*DriveItemsService) Move ¶
func (s *DriveItemsService) Move(ctx context.Context, driveId string, itemId string, destinationParentFolderId string) (*MoveItemResponse, error)
Move a drive item to a new parent folder in a drive of the authenticated user.
When moving an item to the root of a drive, for example, we cannot use "root" as the destinationParentFolderId. Instead, we need to provide the actual ID of the root.
If driveId is empty, it means the selected drive will be the default drive of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_move?view=odsp-graph-online
func (*DriveItemsService) Rename ¶
func (s *DriveItemsService) Rename(ctx context.Context, driveId string, itemId string, newItemName string) (*RenameItemResponse, error)
Rename a drive item in a drive of the authenticated user.
If driveId is empty, it means the selected drive will be the default drive of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_update?view=odsp-graph-online
func (*DriveItemsService) UploadNewFile ¶
func (s *DriveItemsService) UploadNewFile(ctx context.Context, driveId string, destinationParentFolderId string, localFilePath string) (*DriveItem, error)
UploadNewFile is to upload a file to a drive of the authenticated user.
By default, this API will upload and then rename an item if there is an existing item with the same name on OneDrive.
If driveId is empty, it means the selected drive will be the default drive of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_put_content?view=odsp-graph-online#http-request-to-upload-a-new-file
func (*DriveItemsService) UploadNewFileLarge ¶
func (s *DriveItemsService) UploadNewFileLarge(ctx context.Context, driveId string, destinationParentFolderId string, localFilePath string, sizePerSplit int64) (*DriveItem, error)
UploadNewFileLarge is to upload a large file (> 4mb) to a drive of the authenticated user.
This might take a long time, please consider using a new goroutine.
By default, this API will upload and then rename an item if there is an existing item with the same name on OneDrive.
If driveId is empty, it means the selected drive will be the default drive of the authenticated user.
The recommended splitting size is 5-10 MiB, depending on your internet connection. Per Microsoft API, the size per split MUST BE a multiple of 320 KiB (320 * 1024)
OneDrive API docs: https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_createuploadsession
func (*DriveItemsService) UploadToReplaceFile ¶
func (s *DriveItemsService) UploadToReplaceFile(ctx context.Context, driveId string, localFilePath string, itemId string) (*DriveItem, error)
UploadToReplaceFile is to upload a file to replace an existing file in a drive of the authenticated user.
If driveId is empty, it means the selected drive will be the default drive of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_put_content?view=odsp-graph-online#http-request-to-replace-an-existing-item
type DriveQuota ¶
type DriveQuota struct { Used int `json:"used"` Deleted int `json:"deleted"` Remaining int `json:"remaining"` Total int `json:"total"` State string `json:"state"` }
DriveQuota represents the usage quota of a drive.
type DriveSearchService ¶
type DriveSearchService service
DriveSearchService handles communication with the drive items searching related methods of the OneDrive API.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_search?view=odsp-graph-online
func (*DriveSearchService) Search ¶
func (s *DriveSearchService) Search(ctx context.Context, query string) (*OneDriveDriveSearchResponse, error)
Search the items in the default drive of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_search?view=odsp-graph-online#request
func (*DriveSearchService) SearchAll ¶
func (s *DriveSearchService) SearchAll(ctx context.Context, query string) (*OneDriveDriveSearchResponse, error)
Search the items in the default drive of the authenticated user as well as items shared with the user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_search?view=odsp-graph-online#searching-for-items-a-user-can-access
type DriveSpecialFolder ¶
type DriveSpecialFolder int
DriveSpecialFolder indicates the pre-defined special folder in OneDrive
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/drive_get_specialfolder?view=odsp-graph-online#special-folder-names
const ( Documents DriveSpecialFolder = iota Photos CameraRoll AppRoot Music )
type DrivesService ¶
type DrivesService service
DrivesService handles communication with the drives related methods of the OneDrive API.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/resources/drive?view=odsp-graph-online
func (*DrivesService) Get ¶
Get a specified drive of the authenticated user.
If driveId is empty, it means the selected drive will be the default drive of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/drive_get?view=odsp-graph-online
func (*DrivesService) List ¶
func (s *DrivesService) List(ctx context.Context) (*OneDriveDrivesResponse, error)
List all the drives of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/drive_list?view=odsp-graph-online
type Error ¶
type Error struct { Code string `json:"code"` Message string `json:"message"` LocalizedMessage string `json:"localizedMessage"` InnerError *InnerError `json:"innerError"` }
Error represents the error in the response returned by OneDrive drive API.
type ErrorResponse ¶
type ErrorResponse struct {
Error *Error `json:"error"`
}
ErrorResponse represents the error response returned by OneDrive drive API.
type InnerError ¶
type InnerError struct { Date string `json:"date"` RequestId string `json:"request-id"` ClientRequestId string `json:"client-request-id"` }
InnerError represents the error details in the error returned by OneDrive drive API.
type ListPermissionsResponse ¶
type ListPermissionsResponse struct {
Value []Permission `json:"value"`
}
ListPermissionsResponse is the response of list permissions of a drive item
type MoveItemRequest ¶
type MoveItemRequest struct {
ParentFolder ParentReference `json:"parentReference"`
}
MoveItemRequest represents the information needed of moving an item in OneDrive.
type MoveItemResponse ¶
type MoveItemResponse struct { Id string `json:"id"` Name string `json:"name"` ParentFolder ParentReference `json:"parentReference"` }
MoveItemResponse represents the JSON object returned by the OneDrive API after moving an item.
type NewFolderCreationRequest ¶
type NewFolderCreationRequest struct { FolderName string `json:"name"` FolderFacet Facet `json:"folder"` ConflictBehavior string `json:"@microsoft.graph.conflictBehavior"` }
NewFolderCreationRequest represents the information needed of a new OneDrive folder to be created.
type NewUploadSessionCreationRequest ¶
type NewUploadSessionCreationRequest struct { //Will cause unknown malformed request error, so disabled for now. //FileName string `json:"name,omitempty"` ConflictBehavior string `json:"@microsoft.graph.conflictBehavior,omitempty"` }
NewUploadSessionCreationRequest represents the information needed of a new Upload Session to be created.
type NewUploadSessionCreationResponse ¶
type NewUploadSessionCreationResponse struct { UploadURL string `json:"uploadUrl"` ExpirationDateTime string `json:"expirationDateTime"` }
NewUploadSessionCreationResponse represent the JSON object returned by the OneDrive API after requesting an upload session
type OneDriveAsyncJobMonitorResponse ¶
type OneDriveAsyncJobMonitorResponse struct { ErrorCode string `json:"errorCode"` ResourceId string `json:"resourceId"` Operation string `json:"operation"` Status string `json:"status"` StatusDescription string `json:"statusDescription"` PercentageCompleted float64 `json:"percentageCompleted"` }
OneDriveAsyncJobMonitorResponse represents the JSON object returned by the OneDrive Async Job Monitoring API.
type OneDriveAudio ¶
type OneDriveAudio struct { Title string `json:"title"` Album string `json:"album"` AlbumArtist string `json:"albumArtist"` Duration int `json:"duration"` }
OneDriveAudio represents the audio metadata of a OneDrive drive item which is an audio.
type OneDriveDriveItemsResponse ¶
type OneDriveDriveItemsResponse struct { ODataContext string `json:"@odata.context"` Count int `json:"@odata.count"` DriveItems []*DriveItem `json:"value"` }
OneDriveDriveItemsResponse represents the JSON object returned by the OneDrive API.
type OneDriveDriveSearchResponse ¶
type OneDriveDriveSearchResponse struct { ODataContext string `json:"@odata.context"` DriveItems []*DriveItem `json:"value"` }
OneDriveDriveSearchResponse represents the JSON object returned by the OneDrive API.
type OneDriveDrivesResponse ¶
type OneDriveDrivesResponse struct { ODataContext string `json:"@odata.context"` Drives []*Drive `json:"value"` }
OneDriveDrivesResponse represents the JSON object containing drive list returned by the OneDrive API.
type OneDriveImage ¶
OneDriveAudio represents the image metadata of a OneDrive drive item which is an image.
type OneDrivePhoto ¶
type OneDrivePhoto struct { CameraMake string `json:"cameraMake"` CameraModel string `json:"cameraModel"` }
OneDrivePhoto represents the photo metadata of a OneDrive drive item which is a photo. Ref https://docs.microsoft.com/en-us/graph/api/resources/photo?view=graph-rest-1.0
type OneDriveVideo ¶
type OneDriveVideo struct { Duration int `json:"duration"` Height float64 `json:"height"` Width float64 `json:"width"` }
OneDriveVideo represents the video metadata of a OneDrive drive item. Ref: https://docs.microsoft.com/en-us/graph/api/resources/video?view=graph-rest-1.0
type Owner ¶
type Owner struct {
User User `json:"user"`
}
Owner represents the owner of a OneDrive drive.
type ParentReference ¶
type ParentReference struct { Id string `json:"id"` Path string `json:"path"` DriveId string `json:"driveId"` }
ParentReference represents the information of a folder in OneDrive.
type Permission ¶
type Permission struct { ID string `json:"id"` GrantedTo interface{} `json:"grantedTo"` Link SharingLink `json:"link"` Roles []string `json:"roles"` }
Permission is the permission of a drive item.
type PermissionService ¶
type PermissionService service
PermissionService handles permission settings of a drive item
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/resources/permission?view=odsp-graph-online
func (*PermissionService) CreateShareLink ¶
func (s *PermissionService) CreateShareLink(ctx context.Context, itemId string, permissionType ShareLinkType, permissionScope ShareLinkScope) (*Permission, error)
CreateShareLink will create a new sharing link if the specified link type doesn't already exist for the calling application. If a sharing link of the specified type already exists for the app, the existing sharing link will be returned.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_createlink?view=odsp-graph-online
func (*PermissionService) Delete ¶
func (s *PermissionService) Delete(ctx context.Context, driveId string, itemId string, permissionId string) error
Delete will delete a sharing permission from a file or folder. Only sharing permissions that are not inherited can be deleted. The inheritedFrom property must be null.
If driveId is empty, it means the selected drive will be the default drive of the authenticated user.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_delete?view=odsp-graph-online
func (*PermissionService) List ¶
func (s *PermissionService) List(ctx context.Context, itemId string) ([]Permission, error)
List lists the effective sharing permissions of on a DriveItem.
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_list_permissions?view=odsp-graph-online
type RenameItemRequest ¶
type RenameItemRequest struct {
Name string `json:"name"`
}
RenameItemRequest represents the information needed of renaming an item in OneDrive.
type RenameItemResponse ¶
type RenameItemResponse struct { Id string `json:"id"` Name string `json:"name"` File Facet `json:"file"` }
RenameItemResponse represents the JSON object returned by the OneDrive API after renaming an item.
type ShareLinkScope ¶
type ShareLinkScope int
ShareLinkType the possible values for the scope property of SharingLink
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/resources/sharinglink?view=odsp-graph-online#scope-options
const ( Anonymous ShareLinkScope = iota Organization )
type ShareLinkType ¶
type ShareLinkType int
ShareLinkType the possible values for the type property of SharingLink
OneDrive API docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/resources/sharinglink?view=odsp-graph-online#type-options
const ( View ShareLinkType = iota Edit Embed )
type SharingLink ¶
type SharingLink struct { Type string `json:"type"` // The type of sharing link to create. Either view, edit, or embed. Scope string `json:"scope"` // Optional. The scope of link to create. Either anonymous or organization. URL string `json:"webUrl"` }
SharingLink resource groups link-related data items into a single structure. Ref: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/resources/sharinglink?view=odsp-graph-online
type User ¶
type User struct { Id string `json:"id"` DisplayName string `json:"displayName"` Email string `json:"mail"` }
User represents an user in Microsoft Live.
type UserService ¶
type UserService service
func (*UserService) GetCurrentUserDetails ¶
func (s *UserService) GetCurrentUserDetails(ctx context.Context) (*User, error)
OneDrive API docs: https://learn.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http