Skip to content

Latest commit

 

History

History
262 lines (169 loc) · 6.69 KB

NotificationsApi.md

File metadata and controls

262 lines (169 loc) · 6.69 KB

\NotificationsApi

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

Method HTTP request Description
GetNotificationsUnreadCount Get /notifications/unread_count/ Get unread notifications count
ListNotifications Get /notifications/all_list/ Get notifications list
UpdateNotificationMarkRead Get /notifications/mark_as_read/{slug}/ Mark notification as read by user
UpdateNotificationMarkReadAll Get /notifications/mark_all_as_read/ Mark all notifications as read by user

GetNotificationsUnreadCount

NotificationUnreadCount GetNotificationsUnreadCount(ctx).Execute()

Get unread notifications count

Example

package main

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

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

NotificationUnreadCount

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]

ListNotifications

[]NotificationAllList ListNotifications(ctx).Limit(limit).Offset(offset).Type_(type_).Execute()

Get notifications list

Example

package main

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

func main() {
    limit := int32(56) // int32 |  (optional)
    offset := int32(56) // int32 |  (optional)
    type_ := "type__example" // string |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.NotificationsApi.ListNotifications(context.Background()).Limit(limit).Offset(offset).Type_(type_).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `NotificationsApi.ListNotifications``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListNotifications`: []NotificationAllList
    fmt.Fprintf(os.Stdout, "Response from `NotificationsApi.ListNotifications`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
limit int32
offset int32
type_ string

Return type

[]NotificationAllList

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]

UpdateNotificationMarkRead

UpdateNotificationMarkRead(ctx, slug).Execute()

Mark notification as read by user

Example

package main

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

func main() {
    slug := int32(56) // int32 | 

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
slug int32

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

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]

UpdateNotificationMarkReadAll

UpdateNotificationMarkReadAll(ctx).Execute()

Mark all notifications as read by user

Example

package main

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

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

(empty response body)

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]