Used expirationDateTime key for graph api (#9278)
This commit is contained in:
committed by
Ralf Haferkamp
parent
a0a3447a00
commit
5327f90712
+27
-11
@@ -7,26 +7,27 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat
|
||||
|
||||
- API version: v1.0.4
|
||||
- Package version: 1.0.0
|
||||
- Generator version: 7.6.0
|
||||
- Build package: org.openapitools.codegen.languages.GoClientCodegen
|
||||
|
||||
## Installation
|
||||
|
||||
Install the following dependencies:
|
||||
|
||||
```shell
|
||||
```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:
|
||||
|
||||
```golang
|
||||
```go
|
||||
import libregraph "github.com/owncloud/libre-graph-api-go"
|
||||
```
|
||||
|
||||
To use a proxy, set the environment variable `HTTP_PROXY`:
|
||||
|
||||
```golang
|
||||
```go
|
||||
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
||||
```
|
||||
|
||||
@@ -36,17 +37,17 @@ Default configuration comes with `Servers` field that contains server objects as
|
||||
|
||||
### Select Server Configuration
|
||||
|
||||
For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`.
|
||||
For using other server than the one defined on index 0 set context value `libregraph.ContextServerIndex` of type `int`.
|
||||
|
||||
```golang
|
||||
```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 `sw.ContextServerVariables` of type `map[string]string`.
|
||||
Templated server URL is formatted using default variables from configuration or from context value `libregraph.ContextServerVariables` of type `map[string]string`.
|
||||
|
||||
```golang
|
||||
```go
|
||||
ctx := context.WithValue(context.Background(), libregraph.ContextServerVariables, map[string]string{
|
||||
"basePath": "v2",
|
||||
})
|
||||
@@ -58,9 +59,9 @@ Note, enum values are always validated and all unused variables are silently ign
|
||||
|
||||
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 `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps.
|
||||
Similar rules for overriding default operation server index and variables applies by using `libregraph.ContextOperationServerIndices` and `libregraph.ContextOperationServerVariables` context maps.
|
||||
|
||||
```golang
|
||||
```go
|
||||
ctx := context.WithValue(context.Background(), libregraph.ContextOperationServerIndices, map[string]int{
|
||||
"{classname}Service.{nickname}": 2,
|
||||
})
|
||||
@@ -196,6 +197,7 @@ Class | Method | HTTP request | Description
|
||||
- [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)
|
||||
@@ -252,8 +254,22 @@ Authentication schemes defined for the API:
|
||||
|
||||
Example
|
||||
|
||||
```golang
|
||||
auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING")
|
||||
```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)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user