Skip to content

Latest commit

 

History

History
131 lines (83 loc) · 3.2 KB

AppApi.md

File metadata and controls

131 lines (83 loc) · 3.2 KB

\AppApi

All URIs are relative to https://api.forestvpn.com/v2

Method HTTP request Description
GetCurrentUserDevice Get /app/devices/current/ Get user device info
UpdateCurrentUserDevice Patch /app/devices/current/ Update user device

GetCurrentUserDevice

UserDevice GetCurrentUserDevice(ctx).Execute()

Get user device info

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.AppApi.GetCurrentUserDevice(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `AppApi.GetCurrentUserDevice``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetCurrentUserDevice`: UserDevice
    fmt.Fprintf(os.Stdout, "Response from `AppApi.GetCurrentUserDevice`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetCurrentUserDeviceRequest struct via the builder pattern

Return type

UserDevice

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateCurrentUserDevice

UpdateCurrentUserDevice(ctx).UpdateUserDeviceRequest(updateUserDeviceRequest).Execute()

Update user device

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    updateUserDeviceRequest := *openapiclient.NewUpdateUserDeviceRequest() // UpdateUserDeviceRequest | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.AppApi.UpdateCurrentUserDevice(context.Background()).UpdateUserDeviceRequest(updateUserDeviceRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `AppApi.UpdateCurrentUserDevice``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiUpdateCurrentUserDeviceRequest struct via the builder pattern

Name Type Description Notes
updateUserDeviceRequest UpdateUserDeviceRequest

Return type

(empty response body)

Authorization

bearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]