Skip to content

Latest commit

 

History

History
280 lines (181 loc) · 7.41 KB

FcmApi.md

File metadata and controls

280 lines (181 loc) · 7.41 KB

\FcmApi

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

Method HTTP request Description
CreateFCMDevice Post /notification/fcm/ Device registration for push notification through out Firebase Cloud Messaging
DeleteFCMDevice Delete /notification/fcm/{registrationID}/ Delete fcm device
GetFCMDevice Get /notification/fcm/{registrationID}/ Device info
UpdateFCMDevice Patch /notification/fcm/{registrationID}/ Update device fcm properties

CreateFCMDevice

FCMDevice CreateFCMDevice(ctx).CreateFCMDeviceRequest(createFCMDeviceRequest).Execute()

Device registration for push notification through out Firebase Cloud Messaging

Example

package main

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

func main() {
    createFCMDeviceRequest := *openapiclient.NewCreateFCMDeviceRequest("RegistrationId_example", false) // CreateFCMDeviceRequest | 

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

Path Parameters

Other Parameters

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

Name Type Description Notes
createFCMDeviceRequest CreateFCMDeviceRequest

Return type

FCMDevice

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]

DeleteFCMDevice

DeleteFCMDevice(ctx, registrationID).Execute()

Delete fcm device

Example

package main

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

func main() {
    registrationID := "registrationID_example" // string | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.FcmApi.DeleteFCMDevice(context.Background(), registrationID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FcmApi.DeleteFCMDevice``: %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.
registrationID string

Other Parameters

Other parameters are passed through a pointer to a apiDeleteFCMDeviceRequest 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]

GetFCMDevice

FCMDevice GetFCMDevice(ctx, registrationID).Execute()

Device info

Example

package main

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

func main() {
    registrationID := "registrationID_example" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

FCMDevice

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]

UpdateFCMDevice

FCMDevice UpdateFCMDevice(ctx, registrationID).UpdateFCMDeviceRequest(updateFCMDeviceRequest).Execute()

Update device fcm properties

Example

package main

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

func main() {
    registrationID := "registrationID_example" // string | 
    updateFCMDeviceRequest := *openapiclient.NewUpdateFCMDeviceRequest() // UpdateFCMDeviceRequest | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

updateFCMDeviceRequest | UpdateFCMDeviceRequest | |

Return type

FCMDevice

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]