Skip to content

Latest commit

 

History

History
481 lines (311 loc) · 12.1 KB

FriendshipApi.md

File metadata and controls

481 lines (311 loc) · 12.1 KB

\FriendshipApi

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

Method HTTP request Description
AcceptFriendshipInvitation Patch /friendship/invitations/{code}/ Accept friendship invitation
CreateFriendshipInvitation Post /friendship/invitations/ Create friendship invitation
DeleteFriend Delete /friendship/friends/{id}/ Delete friend
GetFriend Get /friendship/friends/{id}/ Friend details
GetFriendshipInvitation Get /friendship/invitations/{code}/ Friendship invitation details
ListFriends Get /friendship/friends/ Get friends list
RejectFriendshipInvitation Delete /friendship/invitations/{code}/ Reject friendship invitation

AcceptFriendshipInvitation

AcceptFriendshipInvitation(ctx, code).Execute()

Accept friendship invitation

Example

package main

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

func main() {
    code := "code_example" // string | 

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

Other Parameters

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

CreateFriendshipInvitation

FriendshipInvitation CreateFriendshipInvitation(ctx).PerPage(perPage).Page(page).Execute()

Create friendship invitation

Example

package main

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

func main() {
    perPage := int32(56) // int32 |  (optional)
    page := int32(56) // int32 |  (optional)

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

Path Parameters

Other Parameters

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

Name Type Description Notes
perPage int32
page int32

Return type

FriendshipInvitation

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]

DeleteFriend

DeleteFriend(ctx, id).Execute()

Delete friend

Example

package main

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

func main() {
    id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

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

Other Parameters

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

GetFriend

Friendship GetFriend(ctx, id).Execute()

Friend details

Example

package main

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

func main() {
    id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

Friendship

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]

GetFriendshipInvitation

FriendshipInvitation GetFriendshipInvitation(ctx, code).Execute()

Friendship invitation details

Example

package main

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

func main() {
    code := "code_example" // string | 

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

Path Parameters

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

Other Parameters

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

Name Type Description Notes

Return type

FriendshipInvitation

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]

ListFriends

[]Friendship ListFriends(ctx).PerPage(perPage).Page(page).Execute()

Get friends list

Example

package main

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

func main() {
    perPage := int32(56) // int32 |  (optional)
    page := int32(56) // int32 |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.FriendshipApi.ListFriends(context.Background()).PerPage(perPage).Page(page).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `FriendshipApi.ListFriends``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListFriends`: []Friendship
    fmt.Fprintf(os.Stdout, "Response from `FriendshipApi.ListFriends`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
perPage int32
page int32

Return type

[]Friendship

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]

RejectFriendshipInvitation

RejectFriendshipInvitation(ctx, code).Execute()

Reject friendship invitation

Example

package main

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

func main() {
    code := "code_example" // string | 

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

Other Parameters

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