Skip to content

Latest commit

 

History

History
204 lines (126 loc) · 4.74 KB

StarApi.md

File metadata and controls

204 lines (126 loc) · 4.74 KB

\StarApi

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

Method HTTP request Description
AddMyStar Post /users/me/stars チャンネルをスターに追加
GetMyStars Get /users/me/stars スターチャンネルリストを取得
RemoveMyStar Delete /users/me/stars/{channelId} チャンネルをスターから削除します

AddMyStar

AddMyStar(ctx).PostStarRequest(postStarRequest).Execute()

チャンネルをスターに追加

Example

package main

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

func main() {
    postStarRequest := *traq.NewPostStarRequest("ChannelId_example") // PostStarRequest |  (optional)

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

Name Type Description Notes
postStarRequest PostStarRequest

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]

GetMyStars

[]string GetMyStars(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.StarApi.GetMyStars(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `StarApi.GetMyStars``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetMyStars`: []string
    fmt.Fprintf(os.Stdout, "Response from `StarApi.GetMyStars`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

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

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]

RemoveMyStar

RemoveMyStar(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.StarApi.RemoveMyStar(context.Background(), channelId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `StarApi.RemoveMyStar``: %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 apiRemoveMyStarRequest 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]