Skip to content

Latest commit

 

History

History
672 lines (421 loc) · 17.8 KB

NotificationApi.md

File metadata and controls

672 lines (421 loc) · 17.8 KB

\NotificationApi

All URIs are relative to https://q.trap.jp/api/v3

Method HTTP request Description
EditChannelSubscribers Patch /channels/{channelId}/subscribers チャンネルの通知購読者を編集
GetChannelSubscribers Get /channels/{channelId}/subscribers チャンネルの通知購読者のリストを取得
GetMyChannelSubscriptions Get /users/me/subscriptions 自分のチャンネル購読状態を取得
GetMyUnreadChannels Get /users/me/unread 未読チャンネルを取得
GetMyViewStates Get /users/me/view-states 自身のチャンネル閲覧状態一覧を取得
ReadChannel Delete /users/me/unread/{channelId} チャンネルを既読にする
RegisterFCMDevice Post /users/me/fcm-device FCMデバイスを登録
SetChannelSubscribeLevel Put /users/me/subscriptions/{channelId} チャンネル購読レベルを設定
SetChannelSubscribers Put /channels/{channelId}/subscribers チャンネルの通知購読者を設定
Ws Get /ws WebSocket通知ストリームに接続します

EditChannelSubscribers

EditChannelSubscribers(ctx, channelId).PatchChannelSubscribersRequest(patchChannelSubscribersRequest).Execute()

チャンネルの通知購読者を編集

Example

package main

import (
    "context"
    "fmt"
    "os"
    traq "github.com/traPtitech/go-traq"
)

func main() {
    channelId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | チャンネルUUID
    patchChannelSubscribersRequest := *traq.NewPatchChannelSubscribersRequest() // PatchChannelSubscribersRequest |  (optional)

    configuration := traq.NewConfiguration()
    apiClient := traq.NewAPIClient(configuration)
    r, err := apiClient.NotificationApi.EditChannelSubscribers(context.Background(), channelId).PatchChannelSubscribersRequest(patchChannelSubscribersRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.EditChannelSubscribers``: %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.
channelId string チャンネルUUID

Other Parameters

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

Name Type Description Notes

patchChannelSubscribersRequest | PatchChannelSubscribersRequest | |

Return type

(empty response body)

Authorization

OAuth2, bearerAuth

HTTP request headers

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

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

GetChannelSubscribers

[]string GetChannelSubscribers(ctx, channelId).Execute()

チャンネルの通知購読者のリストを取得

Example

package main

import (
    "context"
    "fmt"
    "os"
    traq "github.com/traPtitech/go-traq"
)

func main() {
    channelId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | チャンネルUUID

    configuration := traq.NewConfiguration()
    apiClient := traq.NewAPIClient(configuration)
    resp, r, err := apiClient.NotificationApi.GetChannelSubscribers(context.Background(), channelId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.GetChannelSubscribers``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetChannelSubscribers`: []string
    fmt.Fprintf(os.Stdout, "Response from `NotificationApi.GetChannelSubscribers`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
channelId string チャンネルUUID

Other Parameters

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

Name Type Description Notes

Return type

[]string

Authorization

OAuth2, 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]

GetMyChannelSubscriptions

[]UserSubscribeState GetMyChannelSubscriptions(ctx).Execute()

自分のチャンネル購読状態を取得

Example

package main

import (
    "context"
    "fmt"
    "os"
    traq "github.com/traPtitech/go-traq"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]UserSubscribeState

Authorization

OAuth2, 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]

GetMyUnreadChannels

[]UnreadChannel GetMyUnreadChannels(ctx).Execute()

未読チャンネルを取得

Example

package main

import (
    "context"
    "fmt"
    "os"
    traq "github.com/traPtitech/go-traq"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]UnreadChannel

Authorization

OAuth2, 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]

GetMyViewStates

[]MyChannelViewState GetMyViewStates(ctx).Execute()

自身のチャンネル閲覧状態一覧を取得

Example

package main

import (
    "context"
    "fmt"
    "os"
    traq "github.com/traPtitech/go-traq"
)

func main() {

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

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

Return type

[]MyChannelViewState

Authorization

OAuth2, 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]

ReadChannel

ReadChannel(ctx, channelId).Execute()

チャンネルを既読にする

Example

package main

import (
    "context"
    "fmt"
    "os"
    traq "github.com/traPtitech/go-traq"
)

func main() {
    channelId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | チャンネルUUID

    configuration := traq.NewConfiguration()
    apiClient := traq.NewAPIClient(configuration)
    r, err := apiClient.NotificationApi.ReadChannel(context.Background(), channelId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.ReadChannel``: %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.
channelId string チャンネルUUID

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

OAuth2, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

RegisterFCMDevice

RegisterFCMDevice(ctx).PostMyFCMDeviceRequest(postMyFCMDeviceRequest).Execute()

FCMデバイスを登録

Example

package main

import (
    "context"
    "fmt"
    "os"
    traq "github.com/traPtitech/go-traq"
)

func main() {
    postMyFCMDeviceRequest := *traq.NewPostMyFCMDeviceRequest("bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1") // PostMyFCMDeviceRequest |  (optional)

    configuration := traq.NewConfiguration()
    apiClient := traq.NewAPIClient(configuration)
    r, err := apiClient.NotificationApi.RegisterFCMDevice(context.Background()).PostMyFCMDeviceRequest(postMyFCMDeviceRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.RegisterFCMDevice``: %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 apiRegisterFCMDeviceRequest struct via the builder pattern

Name Type Description Notes
postMyFCMDeviceRequest PostMyFCMDeviceRequest

Return type

(empty response body)

Authorization

OAuth2, bearerAuth

HTTP request headers

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

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

SetChannelSubscribeLevel

SetChannelSubscribeLevel(ctx, channelId).PutChannelSubscribeLevelRequest(putChannelSubscribeLevelRequest).Execute()

チャンネル購読レベルを設定

Example

package main

import (
    "context"
    "fmt"
    "os"
    traq "github.com/traPtitech/go-traq"
)

func main() {
    channelId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | チャンネルUUID
    putChannelSubscribeLevelRequest := *traq.NewPutChannelSubscribeLevelRequest(traq.ChannelSubscribeLevel(0)) // PutChannelSubscribeLevelRequest |  (optional)

    configuration := traq.NewConfiguration()
    apiClient := traq.NewAPIClient(configuration)
    r, err := apiClient.NotificationApi.SetChannelSubscribeLevel(context.Background(), channelId).PutChannelSubscribeLevelRequest(putChannelSubscribeLevelRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.SetChannelSubscribeLevel``: %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.
channelId string チャンネルUUID

Other Parameters

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

Name Type Description Notes

putChannelSubscribeLevelRequest | PutChannelSubscribeLevelRequest | |

Return type

(empty response body)

Authorization

OAuth2, bearerAuth

HTTP request headers

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

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

SetChannelSubscribers

SetChannelSubscribers(ctx, channelId).PutChannelSubscribersRequest(putChannelSubscribersRequest).Execute()

チャンネルの通知購読者を設定

Example

package main

import (
    "context"
    "fmt"
    "os"
    traq "github.com/traPtitech/go-traq"
)

func main() {
    channelId := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | チャンネルUUID
    putChannelSubscribersRequest := *traq.NewPutChannelSubscribersRequest([]string{"On_example"}) // PutChannelSubscribersRequest |  (optional)

    configuration := traq.NewConfiguration()
    apiClient := traq.NewAPIClient(configuration)
    r, err := apiClient.NotificationApi.SetChannelSubscribers(context.Background(), channelId).PutChannelSubscribersRequest(putChannelSubscribersRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.SetChannelSubscribers``: %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.
channelId string チャンネルUUID

Other Parameters

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

Name Type Description Notes

putChannelSubscribersRequest | PutChannelSubscribersRequest | |

Return type

(empty response body)

Authorization

OAuth2, bearerAuth

HTTP request headers

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

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

Ws

Ws(ctx).Execute()

WebSocket通知ストリームに接続します

Example

package main

import (
    "context"
    "fmt"
    "os"
    traq "github.com/traPtitech/go-traq"
)

func main() {

    configuration := traq.NewConfiguration()
    apiClient := traq.NewAPIClient(configuration)
    r, err := apiClient.NotificationApi.Ws(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `NotificationApi.Ws``: %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 apiWsRequest struct via the builder pattern

Return type

(empty response body)

Authorization

OAuth2, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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