githubcomjihuanshetcgwikigo

package module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 18 Imported by: 2

README

Tcgwiki Go API Library

Go Reference

The Tcgwiki Go library provides convenient access to the Tcgwiki REST API from applications written in Go.

It is generated with Stainless.

Installation

import (
	"github.com/jihuanshe/tcgwiki-go" // imported as githubcomjihuanshetcgwikigo
)

Or to pin the version:

go get -u 'github.com/jihuanshe/tcgwiki-go@v0.2.1'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/jihuanshe/tcgwiki-go"
	"github.com/jihuanshe/tcgwiki-go/option"
)

func main() {
	client := githubcomjihuanshetcgwikigo.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("TCGWIKI_API_KEY")
	)
	page, err := client.Qa.List(context.TODO(), githubcomjihuanshetcgwikigo.QaListParams{})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", page)
}

Request fields

All request parameters are wrapped in a generic Field type, which we use to distinguish zero values from null or omitted fields.

This prevents accidentally sending a zero value if you forget a required parameter, and enables explicitly sending null, false, '', or 0 on optional parameters. Any field not specified is not sent.

To construct fields with values, use the helpers String(), Int(), Float(), or most commonly, the generic F[T](). To send a null, use Null[T](), and to send a nonconforming value, use Raw[T](any). For example:

params := FooParams{
	Name: githubcomjihuanshetcgwikigo.F("hello"),

	// Explicitly send `"description": null`
	Description: githubcomjihuanshetcgwikigo.Null[string](),

	Point: githubcomjihuanshetcgwikigo.F(githubcomjihuanshetcgwikigo.Point{
		X: githubcomjihuanshetcgwikigo.Int(0),
		Y: githubcomjihuanshetcgwikigo.Int(1),

		// In cases where the API specifies a given type,
		// but you want to send something else, use `Raw`:
		Z: githubcomjihuanshetcgwikigo.Raw[int64](0.01), // sends a float
	}),
}
Response objects

All fields in response structs are value types (not pointers or wrappers).

If a given field is null, not present, or invalid, the corresponding field will simply be its zero value.

All response structs also include a special JSON field, containing more detailed information about each property, which you can use like so:

if res.Name == "" {
	// true if `"name"` is either not present or explicitly null
	res.JSON.Name.IsNull()

	// true if the `"name"` key was not present in the response JSON at all
	res.JSON.Name.IsMissing()

	// When the API returns data that cannot be coerced to the expected type:
	if res.JSON.Name.IsInvalid() {
		raw := res.JSON.Name.Raw()

		legacyName := struct{
			First string `json:"first"`
			Last  string `json:"last"`
		}{}
		json.Unmarshal([]byte(raw), &legacyName)
		name = legacyName.First + " " + legacyName.Last
	}
}

These .JSON structs also include an Extras map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := githubcomjihuanshetcgwikigo.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Qa.List(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

iter := client.Qa.ListAutoPaging(context.TODO(), githubcomjihuanshetcgwikigo.QaListParams{})
// Automatically fetches more pages as needed.
for iter.Next() {
	qaListResponse := iter.Current()
	fmt.Printf("%+v\n", qaListResponse)
}
if err := iter.Err(); err != nil {
	panic(err.Error())
}

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

page, err := client.Qa.List(context.TODO(), githubcomjihuanshetcgwikigo.QaListParams{})
for page != nil {
	for _, qa := range page.Data.Items {
		fmt.Printf("%+v\n", qa)
	}
	page, err = page.GetNextPage()
}
if err != nil {
	panic(err.Error())
}
Errors

When the API returns a non-success status code, we return an error with type *githubcomjihuanshetcgwikigo.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Qa.List(context.TODO(), githubcomjihuanshetcgwikigo.QaListParams{})
if err != nil {
	var apierr *githubcomjihuanshetcgwikigo.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/api/v1/qa/list": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Qa.List(
	ctx,
	githubcomjihuanshetcgwikigo.QaListParams{},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as param.Field[io.Reader]. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper githubcomjihuanshetcgwikigo.FileParam(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := githubcomjihuanshetcgwikigo.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Qa.List(
	context.TODO(),
	githubcomjihuanshetcgwikigo.QaListParams{},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
page, err := client.Qa.List(
	context.TODO(),
	githubcomjihuanshetcgwikigo.QaListParams{},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", page)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]interface{}

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   githubcomjihuanshetcgwikigo.F("id_xxxx"),
    Data: githubcomjihuanshetcgwikigo.F(FooNewParamsData{
        FirstName: githubcomjihuanshetcgwikigo.F("John"),
    }),
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := githubcomjihuanshetcgwikigo.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

View Source
const I18nImageKindBanner = shared.I18nImageKindBanner

This is an alias to an internal value.

View Source
const I18nImageKindCover = shared.I18nImageKindCover

This is an alias to an internal value.

View Source
const I18nImageKindFront = shared.I18nImageKindFront

This is an alias to an internal value.

View Source
const I18nImageKindIcon = shared.I18nImageKindIcon

This is an alias to an internal value.

View Source
const I18nImageKindImage = shared.I18nImageKindImage

This is an alias to an internal value.

View Source

This is an alias to an internal value.

View Source
const I18nLanguageEnUs = shared.I18nLanguageEnUs

This is an alias to an internal value.

View Source
const I18nLanguageJaJp = shared.I18nLanguageJaJp

This is an alias to an internal value.

View Source
const I18nLanguageKoKr = shared.I18nLanguageKoKr

This is an alias to an internal value.

View Source
const I18nLanguageZhCn = shared.I18nLanguageZhCn

This is an alias to an internal value.

View Source
const I18nLanguageZhTw = shared.I18nLanguageZhTw

This is an alias to an internal value.

Variables

This section is empty.

Functions

func Bool

func Bool(value bool) param.Field[bool]

Bool is a param field helper which helps specify bools.

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (TCGWIKI_API_KEY, TCGWIKI_BASE_URL). This should be used to initialize new clients.

func F

func F[T any](value T) param.Field[T]

F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.

func FileParam

func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]

FileParam is a param field helper which helps files with a mime content-type.

func Float

func Float(value float64) param.Field[float64]

Float is a param field helper which helps specify floats.

func Int

func Int(value int64) param.Field[int64]

Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.

func Null

func Null[T any]() param.Field[T]

Null is a param field helper which explicitly sends null to the API.

func Raw

func Raw[T any](value any) param.Field[T]

Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).

func String

func String(value string) param.Field[string]

String is a param field helper which helps specify strings.

Types

type AdminUserGenAPIKeyParams

type AdminUserGenAPIKeyParams struct {
	SkipAuth param.Field[bool] `header:"Skip-Auth"`
}

type AdminUserGenAPIKeyResponse

type AdminUserGenAPIKeyResponse struct {
	Code    int64                          `json:"code,required"`
	Data    AdminUserGenAPIKeyResponseData `json:"data,required"`
	Msg     string                         `json:"msg,required"`
	TraceID string                         `json:"trace_id"`
	JSON    adminUserGenAPIKeyResponseJSON `json:"-"`
}

func (*AdminUserGenAPIKeyResponse) UnmarshalJSON

func (r *AdminUserGenAPIKeyResponse) UnmarshalJSON(data []byte) (err error)

type AdminUserGenAPIKeyResponseData

type AdminUserGenAPIKeyResponseData struct {
	APIKey    string                             `json:"api_key,required"`
	APISecret string                             `json:"api_secret,required"`
	JSON      adminUserGenAPIKeyResponseDataJSON `json:"-"`
}

func (*AdminUserGenAPIKeyResponseData) UnmarshalJSON

func (r *AdminUserGenAPIKeyResponseData) UnmarshalJSON(data []byte) (err error)

type AdminUserRevokeAPIKeyParams

type AdminUserRevokeAPIKeyParams struct {
	APIKey   param.Field[string] `json:"api_key,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (AdminUserRevokeAPIKeyParams) MarshalJSON

func (r AdminUserRevokeAPIKeyParams) MarshalJSON() (data []byte, err error)

type AdminUserRevokeAPIKeyResponse

type AdminUserRevokeAPIKeyResponse struct {
	Code    int64                                  `json:"code,required"`
	Data    AdminUserRevokeAPIKeyResponseDataUnion `json:"data,required,nullable"`
	Msg     string                                 `json:"msg,required"`
	TraceID string                                 `json:"trace_id"`
	JSON    adminUserRevokeAPIKeyResponseJSON      `json:"-"`
}

func (*AdminUserRevokeAPIKeyResponse) UnmarshalJSON

func (r *AdminUserRevokeAPIKeyResponse) UnmarshalJSON(data []byte) (err error)

type AdminUserRevokeAPIKeyResponseData

type AdminUserRevokeAPIKeyResponseData []interface{}

func (AdminUserRevokeAPIKeyResponseData) ImplementsAdminUserRevokeAPIKeyResponseDataUnion

func (r AdminUserRevokeAPIKeyResponseData) ImplementsAdminUserRevokeAPIKeyResponseDataUnion()

type AdminUserRevokeAPIKeyResponseDataUnion

type AdminUserRevokeAPIKeyResponseDataUnion interface {
	ImplementsAdminUserRevokeAPIKeyResponseDataUnion()
}

Union satisfied by shared.UnionString, shared.UnionBool, AdminUserRevokeAPIKeyResponseData, AdminUserRevokeAPIKeyResponseData or shared.UnionFloat.

type AdminUserService

type AdminUserService struct {
	Options []option.RequestOption
}

AdminUserService contains methods and other services that help with interacting with the tcgwiki API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAdminUserService method instead.

func NewAdminUserService

func NewAdminUserService(opts ...option.RequestOption) (r *AdminUserService)

NewAdminUserService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AdminUserService) GenAPIKey

生成 API-Key

func (*AdminUserService) RevokeAPIKey

撤销 API-Key

type AuthExchangeFeishuCodeParams

type AuthExchangeFeishuCodeParams struct {
	// quer 参数中的 code
	Code param.Field[string] `json:"code,required"`
	// quer 参数中的 state
	State    param.Field[string] `json:"state,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (AuthExchangeFeishuCodeParams) MarshalJSON

func (r AuthExchangeFeishuCodeParams) MarshalJSON() (data []byte, err error)

type AuthExchangeFeishuCodeResponse

type AuthExchangeFeishuCodeResponse struct {
	Code    int64                              `json:"code,required"`
	Data    AuthExchangeFeishuCodeResponseData `json:"data,required"`
	Msg     string                             `json:"msg,required"`
	TraceID string                             `json:"trace_id,required"`
	JSON    authExchangeFeishuCodeResponseJSON `json:"-"`
}

func (*AuthExchangeFeishuCodeResponse) UnmarshalJSON

func (r *AuthExchangeFeishuCodeResponse) UnmarshalJSON(data []byte) (err error)

type AuthExchangeFeishuCodeResponseData

type AuthExchangeFeishuCodeResponseData struct {
	Token      string                                 `json:"token,required"`
	User       AuthExchangeFeishuCodeResponseDataUser `json:"user,required"`
	RefererURL string                                 `json:"referer_url"`
	JSON       authExchangeFeishuCodeResponseDataJSON `json:"-"`
}

func (*AuthExchangeFeishuCodeResponseData) UnmarshalJSON

func (r *AuthExchangeFeishuCodeResponseData) UnmarshalJSON(data []byte) (err error)

type AuthExchangeFeishuCodeResponseDataUser

type AuthExchangeFeishuCodeResponseDataUser struct {
	ID        string                                     `json:"id,required"`
	CreatedAt time.Time                                  `json:"created_at,required" format:"date-time"`
	Nickname  string                                     `json:"nickname,required"`
	Status    string                                     `json:"status,required"`
	UpdatedAt time.Time                                  `json:"updated_at,required" format:"date-time"`
	Username  string                                     `json:"username,required"`
	Email     string                                     `json:"email,nullable"`
	JSON      authExchangeFeishuCodeResponseDataUserJSON `json:"-"`
}

func (*AuthExchangeFeishuCodeResponseDataUser) UnmarshalJSON

func (r *AuthExchangeFeishuCodeResponseDataUser) UnmarshalJSON(data []byte) (err error)

type AuthService

type AuthService struct {
	Options []option.RequestOption
}

AuthService contains methods and other services that help with interacting with the tcgwiki API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAuthService method instead.

func NewAuthService

func NewAuthService(opts ...option.RequestOption) (r *AuthService)

NewAuthService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AuthService) ExchangeFeishuCode

func (r *AuthService) ExchangeFeishuCode(ctx context.Context, params AuthExchangeFeishuCodeParams, opts ...option.RequestOption) (res *AuthExchangeFeishuCodeResponse, err error)

飞书 Auth 回调 Code 获取用户 Token

type Client

type Client struct {
	Options     []option.RequestOption
	Qa          *QaService
	Collections *CollectionService
	Games       *GameService
	Products    *ProductService
	System      *SystemService
	Schemas     *SchemaService
	Upload      *UploadService
	Auth        *AuthService
	AdminUsers  *AdminUserService
	Statistics  *StatisticService
}

Client creates a struct with services and top level methods that help with interacting with the tcgwiki API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r *Client)

NewClient generates a new client with the default option read from the environment (TCGWIKI_API_KEY, TCGWIKI_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type Collection

type Collection = shared.Collection

This is an alias to an internal type.

type CollectionDataArray

type CollectionDataArray = shared.CollectionDataArray

This is an alias to an internal type.

type CollectionDataMap

type CollectionDataMap = shared.CollectionDataMap

This is an alias to an internal type.

type CollectionDataUnion

type CollectionDataUnion = shared.CollectionDataUnion

This is an alias to an internal type.

type CollectionDeleteParams

type CollectionDeleteParams struct {
	Uuid     param.Field[string] `json:"uuid,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (CollectionDeleteParams) MarshalJSON

func (r CollectionDeleteParams) MarshalJSON() (data []byte, err error)

type CollectionDeleteResponse

type CollectionDeleteResponse struct {
	Code    int64                        `json:"code,required"`
	Data    interface{}                  `json:"data,required,nullable"`
	Msg     string                       `json:"msg,required"`
	TraceID string                       `json:"trace_id,required"`
	JSON    collectionDeleteResponseJSON `json:"-"`
}

func (*CollectionDeleteResponse) UnmarshalJSON

func (r *CollectionDeleteResponse) UnmarshalJSON(data []byte) (err error)

type CollectionGetParams

type CollectionGetParams struct {
	// 集合 UUID
	Uuid     param.Field[string] `query:"uuid,required" format:"uuid"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (CollectionGetParams) URLQuery

func (r CollectionGetParams) URLQuery() (v url.Values)

URLQuery serializes CollectionGetParams's query parameters as `url.Values`.

type CollectionGetResponse

type CollectionGetResponse struct {
	Code    int64                     `json:"code,required"`
	Data    shared.Collection         `json:"data,required"`
	Msg     string                    `json:"msg,required"`
	TraceID string                    `json:"trace_id,required"`
	JSON    collectionGetResponseJSON `json:"-"`
}

func (*CollectionGetResponse) UnmarshalJSON

func (r *CollectionGetResponse) UnmarshalJSON(data []byte) (err error)

type CollectionListParams

type CollectionListParams struct {
	// 游戏过滤
	GameKey param.Field[[]string] `query:"game_key"`
	// 过滤缺失或未缺失数据的集合
	HasMissing param.Field[bool] `query:"has_missing"`
	// 过滤已隐藏或未隐藏的集合
	IsHidden param.Field[bool] `query:"is_hidden"`
	// 过滤已发布或未发布的集合
	IsPublished param.Field[bool] `query:"is_published"`
	// 集合类型过滤,默认为空,如果填写则必须是 product, event, tournament
	Kind param.Field[CollectionListParamsKind] `query:"kind"`
	// 语言过滤
	Language param.Field[string] `query:"language"`
	// 集合名称模糊匹配
	Name param.Field[string] `query:"name"`
	// 集合 number 模糊匹配
	Number param.Field[string] `query:"number"`
	// 排序规则,支持 uuid desc,uuid asc,sort_at desc,sort_at asc 排序(uuid 是创建时间
	// ,sort_at 是卡包发售时间)
	Order param.Field[[]string] `query:"order"`
	// 页码,默认为 1
	Page param.Field[int64] `query:"page"`
	// 每页数量,默认为 50
	PageSize param.Field[int64] `query:"page_size"`
	// mysql 中的 pkm_categories 表的 level = 2 或 3 and type = 1 的节点 id
	ParentCategoryID param.Field[int64]  `query:"parent_category_id"`
	SKUUuid          param.Field[string] `query:"sku_uuid" format:"uuid"`
	// 过滤集合 uuid
	Uuid     param.Field[[]string] `query:"uuid"`
	SkipAuth param.Field[bool]     `header:"Skip-Auth"`
}

func (CollectionListParams) URLQuery

func (r CollectionListParams) URLQuery() (v url.Values)

URLQuery serializes CollectionListParams's query parameters as `url.Values`.

type CollectionListParamsKind

type CollectionListParamsKind string

集合类型过滤,默认为空,如果填写则必须是 product, event, tournament

const (
	CollectionListParamsKindProduct    CollectionListParamsKind = "product"
	CollectionListParamsKindEvent      CollectionListParamsKind = "event"
	CollectionListParamsKindTournament CollectionListParamsKind = "tournament"
)

func (CollectionListParamsKind) IsKnown

func (r CollectionListParamsKind) IsKnown() bool

type CollectionNewParams

type CollectionNewParams struct {
	// 其他数据
	Data param.Field[CollectionNewParamsDataUnion] `json:"data,required"`
	// 关联游戏 GameKey 列表
	GameKeys param.Field[[]string] `json:"game_keys,required"`
	// 描述国际化
	I18nDescriptions param.Field[[]shared.I18nParam] `json:"i18n_descriptions,required"`
	// 名称国际化
	I18nNames param.Field[[]shared.I18nParam] `json:"i18n_names,required"`
	// 集合类型
	Kind param.Field[CollectionNewParamsKind] `json:"kind,required"`
	// 语言列表
	Languages param.Field[[]shared.GameLanguageParam] `json:"languages,required"`
	// 集合名称
	Name param.Field[string] `json:"name,required"`
	// 集合编号
	Number param.Field[string] `json:"number,required"`
	// 集合描述
	Description param.Field[string] `json:"description"`
	// 集合图片
	Images param.Field[[]shared.I18nImageParam] `json:"images"`
	// 关联 SKU UUID 列表
	SKUUuids param.Field[[]string] `json:"sku_uuids" format:"uuid"`
	// 排序时间
	SortAt   param.Field[time.Time] `json:"sort_at" format:"date-time"`
	SkipAuth param.Field[bool]      `header:"Skip-Auth"`
}

func (CollectionNewParams) MarshalJSON

func (r CollectionNewParams) MarshalJSON() (data []byte, err error)

type CollectionNewParamsDataArray

type CollectionNewParamsDataArray []interface{}

func (CollectionNewParamsDataArray) ImplementsCollectionNewParamsDataUnion

func (r CollectionNewParamsDataArray) ImplementsCollectionNewParamsDataUnion()

type CollectionNewParamsDataMap

type CollectionNewParamsDataMap map[string]interface{}

func (CollectionNewParamsDataMap) ImplementsCollectionNewParamsDataUnion

func (r CollectionNewParamsDataMap) ImplementsCollectionNewParamsDataUnion()

type CollectionNewParamsDataUnion

type CollectionNewParamsDataUnion interface {
	ImplementsCollectionNewParamsDataUnion()
}

其他数据

Satisfied by shared.UnionString, shared.UnionBool, CollectionNewParamsDataArray, CollectionNewParamsDataMap, shared.UnionFloat.

type CollectionNewParamsKind

type CollectionNewParamsKind string

集合类型

const (
	CollectionNewParamsKindProduct    CollectionNewParamsKind = "product"
	CollectionNewParamsKindEvent      CollectionNewParamsKind = "event"
	CollectionNewParamsKindTournament CollectionNewParamsKind = "tournament"
)

func (CollectionNewParamsKind) IsKnown

func (r CollectionNewParamsKind) IsKnown() bool

type CollectionNewResponse

type CollectionNewResponse struct {
	Code    int64                     `json:"code,required"`
	Data    CollectionNewResponseData `json:"data,required"`
	Msg     string                    `json:"msg,required"`
	TraceID string                    `json:"trace_id,required"`
	JSON    collectionNewResponseJSON `json:"-"`
}

func (*CollectionNewResponse) UnmarshalJSON

func (r *CollectionNewResponse) UnmarshalJSON(data []byte) (err error)

type CollectionNewResponseData

type CollectionNewResponseData struct {
	Uuid string                        `json:"uuid,required" format:"uuid"`
	JSON collectionNewResponseDataJSON `json:"-"`
}

func (*CollectionNewResponseData) UnmarshalJSON

func (r *CollectionNewResponseData) UnmarshalJSON(data []byte) (err error)

type CollectionPublishParams

type CollectionPublishParams struct {
	Uuid     param.Field[string] `json:"uuid,required" format:"uuid"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (CollectionPublishParams) MarshalJSON

func (r CollectionPublishParams) MarshalJSON() (data []byte, err error)

type CollectionPublishResponse

type CollectionPublishResponse struct {
	Code    int64                         `json:"code,required"`
	Data    interface{}                   `json:"data,required,nullable"`
	Msg     string                        `json:"msg,required"`
	TraceID string                        `json:"trace_id,required"`
	JSON    collectionPublishResponseJSON `json:"-"`
}

func (*CollectionPublishResponse) UnmarshalJSON

func (r *CollectionPublishResponse) UnmarshalJSON(data []byte) (err error)

type CollectionRelationByPackIDParams

type CollectionRelationByPackIDParams struct {
	ID       param.Field[[]int64] `query:"id,required"`
	GameKey  param.Field[string]  `query:"game_key"`
	SkipAuth param.Field[bool]    `header:"Skip-Auth"`
}

func (CollectionRelationByPackIDParams) URLQuery

func (r CollectionRelationByPackIDParams) URLQuery() (v url.Values)

URLQuery serializes CollectionRelationByPackIDParams's query parameters as `url.Values`.

type CollectionRelationByPackIDResponse

type CollectionRelationByPackIDResponse struct {
	Code    int64                                  `json:"code,required"`
	Data    []TempPackCollectionRelation           `json:"data,required"`
	Msg     string                                 `json:"msg,required"`
	TraceID string                                 `json:"trace_id,required"`
	JSON    collectionRelationByPackIDResponseJSON `json:"-"`
}

func (*CollectionRelationByPackIDResponse) UnmarshalJSON

func (r *CollectionRelationByPackIDResponse) UnmarshalJSON(data []byte) (err error)

type CollectionRelationByPackIDSearchParams

type CollectionRelationByPackIDSearchParams struct {
	IDs      param.Field[[]int64] `json:"ids,required"`
	GameKey  param.Field[string]  `json:"game_key"`
	SkipAuth param.Field[bool]    `header:"Skip-Auth"`
}

func (CollectionRelationByPackIDSearchParams) MarshalJSON

func (r CollectionRelationByPackIDSearchParams) MarshalJSON() (data []byte, err error)

type CollectionRelationByPackIDSearchResponse

type CollectionRelationByPackIDSearchResponse struct {
	Code    int64                                        `json:"code,required"`
	Data    []TempPackCollectionRelation                 `json:"data,required"`
	Msg     string                                       `json:"msg,required"`
	TraceID string                                       `json:"trace_id,required"`
	JSON    collectionRelationByPackIDSearchResponseJSON `json:"-"`
}

func (*CollectionRelationByPackIDSearchResponse) UnmarshalJSON

func (r *CollectionRelationByPackIDSearchResponse) UnmarshalJSON(data []byte) (err error)

type CollectionRelationByUuidParams

type CollectionRelationByUuidParams struct {
	// 支持批量
	Uuid     param.Field[[]string] `query:"uuid,required"`
	SkipAuth param.Field[bool]     `header:"Skip-Auth"`
}

func (CollectionRelationByUuidParams) URLQuery

func (r CollectionRelationByUuidParams) URLQuery() (v url.Values)

URLQuery serializes CollectionRelationByUuidParams's query parameters as `url.Values`.

type CollectionRelationByUuidResponse

type CollectionRelationByUuidResponse struct {
	Code    int64                                `json:"code,required"`
	Data    []TempPackCollectionRelation         `json:"data,required"`
	Msg     string                               `json:"msg,required"`
	TraceID string                               `json:"trace_id,required"`
	JSON    collectionRelationByUuidResponseJSON `json:"-"`
}

func (*CollectionRelationByUuidResponse) UnmarshalJSON

func (r *CollectionRelationByUuidResponse) UnmarshalJSON(data []byte) (err error)

type CollectionRelationByUuidSearchParams

type CollectionRelationByUuidSearchParams struct {
	Uuids    param.Field[[]string] `json:"uuids,required"`
	SkipAuth param.Field[bool]     `header:"Skip-Auth"`
}

func (CollectionRelationByUuidSearchParams) MarshalJSON

func (r CollectionRelationByUuidSearchParams) MarshalJSON() (data []byte, err error)

type CollectionRelationByUuidSearchResponse

type CollectionRelationByUuidSearchResponse struct {
	Code    int64                                      `json:"code,required"`
	Data    []TempPackCollectionRelation               `json:"data,required"`
	Msg     string                                     `json:"msg,required"`
	TraceID string                                     `json:"trace_id,required"`
	JSON    collectionRelationByUuidSearchResponseJSON `json:"-"`
}

func (*CollectionRelationByUuidSearchResponse) UnmarshalJSON

func (r *CollectionRelationByUuidSearchResponse) UnmarshalJSON(data []byte) (err error)

type CollectionSearchParams

type CollectionSearchParams struct {
	Page     param.Field[int64] `query:"page"`
	PageSize param.Field[int64] `query:"page_size"`
	// 游戏过滤
	GameKeys param.Field[[]string] `json:"game_keys"`
	// 过滤缺失或未缺失数据的集合
	HasMissing param.Field[bool] `json:"has_missing"`
	// 过滤已隐藏或未隐藏的集合
	IsHidden param.Field[bool] `json:"is_hidden"`
	// 过滤已发布或未发布的集合
	IsPublished param.Field[bool] `json:"is_published"`
	// 集合类型过滤,默认为空,如果填写则必须是 product, event, tournament
	Kind param.Field[CollectionSearchParamsKind] `json:"kind"`
	// 语言过滤
	Language param.Field[string] `json:"language"`
	// 集合名称模糊匹配
	Name param.Field[string] `json:"name"`
	// 集合 number 模糊匹配
	Number param.Field[string] `json:"number"`
	// 排序规则,支持 uuid desc,uuid asc,sort_at desc,sort_at asc 排序(uuid 是创建时间
	// ,sort_at 是卡包发售时间)
	Orders param.Field[[]CollectionSearchParamsOrder] `json:"orders"`
	// mysql 中的 pkm_categories 表的 level = 2 或 3 and type = 1 的节点 id
	ParentCategoryID param.Field[int64]  `json:"parent_category_id"`
	SKUUuid          param.Field[string] `json:"sku_uuid"`
	// 集合 uuids 列表
	Uuids    param.Field[[]string] `json:"uuids"`
	SkipAuth param.Field[bool]     `header:"Skip-Auth"`
}

func (CollectionSearchParams) MarshalJSON

func (r CollectionSearchParams) MarshalJSON() (data []byte, err error)

func (CollectionSearchParams) URLQuery

func (r CollectionSearchParams) URLQuery() (v url.Values)

URLQuery serializes CollectionSearchParams's query parameters as `url.Values`.

type CollectionSearchParamsKind

type CollectionSearchParamsKind string

集合类型过滤,默认为空,如果填写则必须是 product, event, tournament

const (
	CollectionSearchParamsKindProduct    CollectionSearchParamsKind = "product"
	CollectionSearchParamsKindEvent      CollectionSearchParamsKind = "event"
	CollectionSearchParamsKindTournament CollectionSearchParamsKind = "tournament"
)

func (CollectionSearchParamsKind) IsKnown

func (r CollectionSearchParamsKind) IsKnown() bool

type CollectionSearchParamsOrder

type CollectionSearchParamsOrder string
const (
	CollectionSearchParamsOrderUuidDesc   CollectionSearchParamsOrder = "uuid desc"
	CollectionSearchParamsOrderUuidAsc    CollectionSearchParamsOrder = "uuid asc"
	CollectionSearchParamsOrderSortAtDesc CollectionSearchParamsOrder = "sort_at desc"
	CollectionSearchParamsOrderSortAtAsc  CollectionSearchParamsOrder = "sort_at asc"
)

func (CollectionSearchParamsOrder) IsKnown

func (r CollectionSearchParamsOrder) IsKnown() bool

type CollectionService

type CollectionService struct {
	Options []option.RequestOption
}

CollectionService contains methods and other services that help with interacting with the tcgwiki API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCollectionService method instead.

func NewCollectionService

func NewCollectionService(opts ...option.RequestOption) (r *CollectionService)

NewCollectionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CollectionService) Delete

根据 UUID 删除集合

func (*CollectionService) Get

根据 UUID 获取集合详细信息

func (*CollectionService) List

根据过滤条件获取集合列表,支持分页

func (*CollectionService) ListAutoPaging

根据过滤条件获取集合列表,支持分页

func (*CollectionService) New

创建新的集合

func (*CollectionService) Publish

发布集合

func (*CollectionService) RelationByPackID

根据 pack_ids 获取关联关系

func (*CollectionService) RelationByPackIDSearch

根据 pack_ids 获取关联关系

func (*CollectionService) RelationByUuid

根据 collection uuids 获取关联关系

func (*CollectionService) RelationByUuidSearch

根据 collection uuids 获取关联关系

func (*CollectionService) Search

根据过滤条件获取集合列表,支持分页

func (*CollectionService) SearchAutoPaging

根据过滤条件获取集合列表,支持分页

func (*CollectionService) Update

更新现有集合信息

type CollectionUpdateParams

type CollectionUpdateParams struct {
	// 其他数据
	Data param.Field[CollectionUpdateParamsDataUnion] `json:"data,required"`
	// 关联游戏 GameKey 列表
	GameKeys param.Field[[]string] `json:"game_keys,required"`
	// 描述国际化
	I18nDescriptions param.Field[[]shared.I18nParam] `json:"i18n_descriptions,required"`
	// 名称国际化
	I18nNames param.Field[[]shared.I18nParam] `json:"i18n_names,required"`
	// 集合类型
	Kind param.Field[CollectionUpdateParamsKind] `json:"kind,required"`
	// 语言列表
	Languages param.Field[[]shared.GameLanguageParam] `json:"languages,required"`
	// 集合名称
	Name param.Field[string] `json:"name,required"`
	// 集合编号
	Number param.Field[string] `json:"number,required"`
	Uuid   param.Field[string] `json:"uuid,required" format:"uuid"`
	// 集合描述
	Description param.Field[string] `json:"description"`
	// 集合图片
	Images param.Field[[]shared.I18nImageParam] `json:"images"`
	// 关联 SKU UUID 列表
	SKUUuids param.Field[[]string] `json:"sku_uuids" format:"uuid"`
	// 排序时间
	SortAt   param.Field[time.Time] `json:"sort_at" format:"date-time"`
	SkipAuth param.Field[bool]      `header:"Skip-Auth"`
}

func (CollectionUpdateParams) MarshalJSON

func (r CollectionUpdateParams) MarshalJSON() (data []byte, err error)

type CollectionUpdateParamsDataArray

type CollectionUpdateParamsDataArray []interface{}

func (CollectionUpdateParamsDataArray) ImplementsCollectionUpdateParamsDataUnion

func (r CollectionUpdateParamsDataArray) ImplementsCollectionUpdateParamsDataUnion()

type CollectionUpdateParamsDataMap

type CollectionUpdateParamsDataMap map[string]interface{}

func (CollectionUpdateParamsDataMap) ImplementsCollectionUpdateParamsDataUnion

func (r CollectionUpdateParamsDataMap) ImplementsCollectionUpdateParamsDataUnion()

type CollectionUpdateParamsDataUnion

type CollectionUpdateParamsDataUnion interface {
	ImplementsCollectionUpdateParamsDataUnion()
}

其他数据

Satisfied by shared.UnionString, shared.UnionBool, CollectionUpdateParamsDataArray, CollectionUpdateParamsDataMap, shared.UnionFloat.

type CollectionUpdateParamsKind

type CollectionUpdateParamsKind string

集合类型

const (
	CollectionUpdateParamsKindProduct    CollectionUpdateParamsKind = "product"
	CollectionUpdateParamsKindEvent      CollectionUpdateParamsKind = "event"
	CollectionUpdateParamsKindTournament CollectionUpdateParamsKind = "tournament"
)

func (CollectionUpdateParamsKind) IsKnown

func (r CollectionUpdateParamsKind) IsKnown() bool

type CollectionUpdateResponse

type CollectionUpdateResponse struct {
	Code    int64                        `json:"code,required"`
	Data    interface{}                  `json:"data,required,nullable"`
	Msg     string                       `json:"msg,required"`
	TraceID string                       `json:"trace_id,required"`
	JSON    collectionUpdateResponseJSON `json:"-"`
}

func (*CollectionUpdateResponse) UnmarshalJSON

func (r *CollectionUpdateResponse) UnmarshalJSON(data []byte) (err error)

type Error

type Error = apierror.Error

type GameDeleteParams

type GameDeleteParams struct {
	// game_key
	GameKey  param.Field[string] `json:"game_key,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (GameDeleteParams) MarshalJSON

func (r GameDeleteParams) MarshalJSON() (data []byte, err error)

type GameDeleteResponse

type GameDeleteResponse struct {
	Code    int64                  `json:"code,required"`
	Data    interface{}            `json:"data,required,nullable"`
	Msg     string                 `json:"msg,required"`
	TraceID string                 `json:"trace_id,required"`
	JSON    gameDeleteResponseJSON `json:"-"`
}

func (*GameDeleteResponse) UnmarshalJSON

func (r *GameDeleteResponse) UnmarshalJSON(data []byte) (err error)

type GameGetParams

type GameGetParams struct {
	// game_key,游戏简写
	GameKey param.Field[string] `query:"game_key,required"`
	// 不生成 filter 数据
	ParseFiltersDisabled param.Field[bool] `query:"parse_filters_disabled"`
	SkipAuth             param.Field[bool] `header:"Skip-Auth"`
}

func (GameGetParams) URLQuery

func (r GameGetParams) URLQuery() (v url.Values)

URLQuery serializes GameGetParams's query parameters as `url.Values`.

type GameGetResponse

type GameGetResponse struct {
	Code    int64               `json:"code,required"`
	Data    GameGetResponseData `json:"data,required"`
	Msg     string              `json:"msg,required"`
	TraceID string              `json:"trace_id,required"`
	JSON    gameGetResponseJSON `json:"-"`
}

func (*GameGetResponse) UnmarshalJSON

func (r *GameGetResponse) UnmarshalJSON(data []byte) (err error)

type GameGetResponseData

type GameGetResponseData struct {
	CreatedAt        time.Time                          `json:"created_at,required" format:"date-time"`
	GameConfig       GameGetResponseDataGameConfigUnion `json:"game_config,required,nullable"`
	GameExtend       GameGetResponseDataGameExtendUnion `json:"game_extend,required,nullable"`
	GameKey          string                             `json:"game_key,required"`
	I18nDescriptions []shared.I18n                      `json:"i18n_descriptions,required,nullable"`
	I18nImages       []shared.I18nImage                 `json:"i18n_images,required"`
	I18nNames        []shared.I18n                      `json:"i18n_names,required"`
	Kind             GameGetResponseDataKind            `json:"kind,required"`
	PublishCompany   string                             `json:"publish_company,required"`
	Regions          []string                           `json:"regions,required"`
	Series           string                             `json:"series,required"`
	UpdatedAt        time.Time                          `json:"updated_at,required" format:"date-time"`
	PublishDate      int64                              `json:"publish_date,nullable"`
	JSON             gameGetResponseDataJSON            `json:"-"`
}

func (*GameGetResponseData) UnmarshalJSON

func (r *GameGetResponseData) UnmarshalJSON(data []byte) (err error)

type GameGetResponseDataGameConfigArray

type GameGetResponseDataGameConfigArray []interface{}

func (GameGetResponseDataGameConfigArray) ImplementsGameGetResponseDataGameConfigUnion

func (r GameGetResponseDataGameConfigArray) ImplementsGameGetResponseDataGameConfigUnion()

type GameGetResponseDataGameConfigMap

type GameGetResponseDataGameConfigMap map[string]interface{}

func (GameGetResponseDataGameConfigMap) ImplementsGameGetResponseDataGameConfigUnion

func (r GameGetResponseDataGameConfigMap) ImplementsGameGetResponseDataGameConfigUnion()

type GameGetResponseDataGameConfigUnion

type GameGetResponseDataGameConfigUnion interface {
	ImplementsGameGetResponseDataGameConfigUnion()
}

Union satisfied by shared.UnionString, shared.UnionBool, GameGetResponseDataGameConfigArray, GameGetResponseDataGameConfigMap or shared.UnionFloat.

type GameGetResponseDataGameExtendArray

type GameGetResponseDataGameExtendArray []interface{}

func (GameGetResponseDataGameExtendArray) ImplementsGameGetResponseDataGameExtendUnion

func (r GameGetResponseDataGameExtendArray) ImplementsGameGetResponseDataGameExtendUnion()

type GameGetResponseDataGameExtendMap

type GameGetResponseDataGameExtendMap map[string]interface{}

func (GameGetResponseDataGameExtendMap) ImplementsGameGetResponseDataGameExtendUnion

func (r GameGetResponseDataGameExtendMap) ImplementsGameGetResponseDataGameExtendUnion()

type GameGetResponseDataGameExtendUnion

type GameGetResponseDataGameExtendUnion interface {
	ImplementsGameGetResponseDataGameExtendUnion()
}

Union satisfied by shared.UnionString, shared.UnionBool, GameGetResponseDataGameExtendArray, GameGetResponseDataGameExtendMap or shared.UnionFloat.

type GameGetResponseDataKind

type GameGetResponseDataKind string
const (
	GameGetResponseDataKindPhysical GameGetResponseDataKind = "physical"
	GameGetResponseDataKindDigital  GameGetResponseDataKind = "digital"
	GameGetResponseDataKindOnline   GameGetResponseDataKind = "online"
)

func (GameGetResponseDataKind) IsKnown

func (r GameGetResponseDataKind) IsKnown() bool

type GameLanguage

type GameLanguage = shared.GameLanguage

This is an alias to an internal type.

type GameLanguageParam

type GameLanguageParam = shared.GameLanguageParam

This is an alias to an internal type.

type GameListParams

type GameListParams struct {
	// 游戏标识 key 过滤
	GameKey param.Field[string] `query:"game_key"`
	// 游戏名称关键词搜索
	Name param.Field[string] `query:"name"`
	// 页号默认 1
	Page param.Field[int64] `query:"page"`
	// 页大小默认 50
	PageSize param.Field[int64] `query:"page_size"`
	SkipAuth param.Field[bool]  `header:"Skip-Auth"`
}

func (GameListParams) URLQuery

func (r GameListParams) URLQuery() (v url.Values)

URLQuery serializes GameListParams's query parameters as `url.Values`.

type GameListResponse

type GameListResponse struct {
	CreatedAt        time.Time                       `json:"created_at,required" format:"date-time"`
	GameConfig       GameListResponseGameConfigUnion `json:"game_config,required,nullable"`
	GameExtend       GameListResponseGameExtendUnion `json:"game_extend,required,nullable"`
	GameKey          string                          `json:"game_key,required"`
	I18nDescriptions []shared.I18n                   `json:"i18n_descriptions,required,nullable"`
	I18nImages       []shared.I18nImage              `json:"i18n_images,required"`
	I18nNames        []shared.I18n                   `json:"i18n_names,required"`
	Kind             GameListResponseKind            `json:"kind,required"`
	PublishCompany   string                          `json:"publish_company,required"`
	Regions          []string                        `json:"regions,required"`
	Series           string                          `json:"series,required"`
	UpdatedAt        time.Time                       `json:"updated_at,required" format:"date-time"`
	PublishDate      int64                           `json:"publish_date,nullable"`
	JSON             gameListResponseJSON            `json:"-"`
}

func (*GameListResponse) UnmarshalJSON

func (r *GameListResponse) UnmarshalJSON(data []byte) (err error)

type GameListResponseGameConfigArray

type GameListResponseGameConfigArray []interface{}

func (GameListResponseGameConfigArray) ImplementsGameListResponseGameConfigUnion

func (r GameListResponseGameConfigArray) ImplementsGameListResponseGameConfigUnion()

type GameListResponseGameConfigMap

type GameListResponseGameConfigMap map[string]interface{}

func (GameListResponseGameConfigMap) ImplementsGameListResponseGameConfigUnion

func (r GameListResponseGameConfigMap) ImplementsGameListResponseGameConfigUnion()

type GameListResponseGameConfigUnion

type GameListResponseGameConfigUnion interface {
	ImplementsGameListResponseGameConfigUnion()
}

Union satisfied by shared.UnionString, shared.UnionBool, GameListResponseGameConfigArray, GameListResponseGameConfigMap or shared.UnionFloat.

type GameListResponseGameExtendArray

type GameListResponseGameExtendArray []interface{}

func (GameListResponseGameExtendArray) ImplementsGameListResponseGameExtendUnion

func (r GameListResponseGameExtendArray) ImplementsGameListResponseGameExtendUnion()

type GameListResponseGameExtendMap

type GameListResponseGameExtendMap map[string]interface{}

func (GameListResponseGameExtendMap) ImplementsGameListResponseGameExtendUnion

func (r GameListResponseGameExtendMap) ImplementsGameListResponseGameExtendUnion()

type GameListResponseGameExtendUnion

type GameListResponseGameExtendUnion interface {
	ImplementsGameListResponseGameExtendUnion()
}

Union satisfied by shared.UnionString, shared.UnionBool, GameListResponseGameExtendArray, GameListResponseGameExtendMap or shared.UnionFloat.

type GameListResponseKind

type GameListResponseKind string
const (
	GameListResponseKindPhysical GameListResponseKind = "physical"
	GameListResponseKindDigital  GameListResponseKind = "digital"
	GameListResponseKindOnline   GameListResponseKind = "online"
)

func (GameListResponseKind) IsKnown

func (r GameListResponseKind) IsKnown() bool

type GameNewParams

type GameNewParams struct {
	// 游戏标识 key
	GameKey param.Field[string] `json:"game_key,required"`
	// 游戏图标 URL logo icon 等
	I18nImages param.Field[[]shared.I18nImageParam] `json:"i18n_images,required"`
	// 名称国际化
	I18nNames param.Field[[]shared.I18nParam] `json:"i18n_names,required"`
	// 游戏类型 (physical:实体游戏,digital:电子游戏,online:网络发行)
	Kind param.Field[GameNewParamsKind] `json:"kind,required"`
	// 发布时间
	PublishDate param.Field[int64] `json:"publish_date,required"`
	// 发行地区列表
	Regions param.Field[[]string] `json:"regions,required"`
	// 游戏系列
	Series param.Field[string] `json:"series,required"`
	// 游戏配置
	GameConfig param.Field[GameNewParamsGameConfigUnion] `json:"game_config"`
	// 游戏扩展信息
	GameExtend param.Field[GameNewParamsGameExtendUnion] `json:"game_extend"`
	// 国际化游戏描述
	I18nDescriptions param.Field[[]shared.I18nParam] `json:"i18n_descriptions"`
	// 发行公司
	PublishCompany param.Field[string] `json:"publish_company"`
	SkipAuth       param.Field[bool]   `header:"Skip-Auth"`
}

func (GameNewParams) MarshalJSON

func (r GameNewParams) MarshalJSON() (data []byte, err error)

type GameNewParamsGameConfigArray

type GameNewParamsGameConfigArray []interface{}

func (GameNewParamsGameConfigArray) ImplementsGameNewParamsGameConfigUnion

func (r GameNewParamsGameConfigArray) ImplementsGameNewParamsGameConfigUnion()

type GameNewParamsGameConfigMap

type GameNewParamsGameConfigMap map[string]interface{}

func (GameNewParamsGameConfigMap) ImplementsGameNewParamsGameConfigUnion

func (r GameNewParamsGameConfigMap) ImplementsGameNewParamsGameConfigUnion()

type GameNewParamsGameConfigUnion

type GameNewParamsGameConfigUnion interface {
	ImplementsGameNewParamsGameConfigUnion()
}

游戏配置

Satisfied by shared.UnionString, shared.UnionBool, GameNewParamsGameConfigArray, GameNewParamsGameConfigMap, shared.UnionFloat.

type GameNewParamsGameExtendArray

type GameNewParamsGameExtendArray []interface{}

func (GameNewParamsGameExtendArray) ImplementsGameNewParamsGameExtendUnion

func (r GameNewParamsGameExtendArray) ImplementsGameNewParamsGameExtendUnion()

type GameNewParamsGameExtendMap

type GameNewParamsGameExtendMap map[string]interface{}

func (GameNewParamsGameExtendMap) ImplementsGameNewParamsGameExtendUnion

func (r GameNewParamsGameExtendMap) ImplementsGameNewParamsGameExtendUnion()

type GameNewParamsGameExtendUnion

type GameNewParamsGameExtendUnion interface {
	ImplementsGameNewParamsGameExtendUnion()
}

游戏扩展信息

Satisfied by shared.UnionString, shared.UnionBool, GameNewParamsGameExtendArray, GameNewParamsGameExtendMap, shared.UnionFloat.

type GameNewParamsKind

type GameNewParamsKind string

游戏类型 (physical:实体游戏,digital:电子游戏,online:网络发行)

const (
	GameNewParamsKindPhysical GameNewParamsKind = "physical"
	GameNewParamsKindDigital  GameNewParamsKind = "digital"
	GameNewParamsKindOnline   GameNewParamsKind = "online"
)

func (GameNewParamsKind) IsKnown

func (r GameNewParamsKind) IsKnown() bool

type GameNewResponse

type GameNewResponse struct {
	Code    int64               `json:"code,required"`
	Data    GameNewResponseData `json:"data,required"`
	Msg     string              `json:"msg,required"`
	TraceID string              `json:"trace_id,required"`
	JSON    gameNewResponseJSON `json:"-"`
}

func (*GameNewResponse) UnmarshalJSON

func (r *GameNewResponse) UnmarshalJSON(data []byte) (err error)

type GameNewResponseData

type GameNewResponseData struct {
	GameKey string                  `json:"game_key,required"`
	JSON    gameNewResponseDataJSON `json:"-"`
}

func (*GameNewResponseData) UnmarshalJSON

func (r *GameNewResponseData) UnmarshalJSON(data []byte) (err error)

type GameService

type GameService struct {
	Options []option.RequestOption
}

GameService contains methods and other services that help with interacting with the tcgwiki API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewGameService method instead.

func NewGameService

func NewGameService(opts ...option.RequestOption) (r *GameService)

NewGameService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*GameService) Delete

func (r *GameService) Delete(ctx context.Context, params GameDeleteParams, opts ...option.RequestOption) (res *GameDeleteResponse, err error)

根据 game_key 删除游戏

func (*GameService) Get

func (r *GameService) Get(ctx context.Context, params GameGetParams, opts ...option.RequestOption) (res *GameGetResponse, err error)

获取游戏详情

func (*GameService) List

根据过滤条件获取游戏列表,支持分页

func (*GameService) ListAutoPaging

根据过滤条件获取游戏列表,支持分页

func (*GameService) New

func (r *GameService) New(ctx context.Context, params GameNewParams, opts ...option.RequestOption) (res *GameNewResponse, err error)

创建新的游戏

func (*GameService) Update

func (r *GameService) Update(ctx context.Context, params GameUpdateParams, opts ...option.RequestOption) (res *GameUpdateResponse, err error)

更新现有游戏信息

type GameUpdateParams

type GameUpdateParams struct {
	// 游戏标识 key
	GameKey param.Field[string] `json:"game_key,required"`
	// 游戏图标 URL logo icon 等
	I18nImages param.Field[[]shared.I18nImageParam] `json:"i18n_images,required"`
	// 名称国际化
	I18nNames param.Field[[]shared.I18nParam] `json:"i18n_names,required"`
	// 游戏类型 (physical:实体游戏,digital:电子游戏,online:网络发行)
	Kind param.Field[GameUpdateParamsKind] `json:"kind,required"`
	// 发布时间
	PublishDate param.Field[int64] `json:"publish_date,required"`
	// 发行地区列表
	Regions param.Field[[]string] `json:"regions,required"`
	// 游戏系列
	Series param.Field[string] `json:"series,required"`
	// 游戏配置
	GameConfig param.Field[GameUpdateParamsGameConfigUnion] `json:"game_config"`
	// 游戏扩展信息
	GameExtend param.Field[GameUpdateParamsGameExtendUnion] `json:"game_extend"`
	// 国际化游戏描述
	I18nDescriptions param.Field[[]shared.I18nParam] `json:"i18n_descriptions"`
	// 发行公司
	PublishCompany param.Field[string] `json:"publish_company"`
	SkipAuth       param.Field[bool]   `header:"Skip-Auth"`
}

func (GameUpdateParams) MarshalJSON

func (r GameUpdateParams) MarshalJSON() (data []byte, err error)

type GameUpdateParamsGameConfigArray

type GameUpdateParamsGameConfigArray []interface{}

func (GameUpdateParamsGameConfigArray) ImplementsGameUpdateParamsGameConfigUnion

func (r GameUpdateParamsGameConfigArray) ImplementsGameUpdateParamsGameConfigUnion()

type GameUpdateParamsGameConfigMap

type GameUpdateParamsGameConfigMap map[string]interface{}

func (GameUpdateParamsGameConfigMap) ImplementsGameUpdateParamsGameConfigUnion

func (r GameUpdateParamsGameConfigMap) ImplementsGameUpdateParamsGameConfigUnion()

type GameUpdateParamsGameConfigUnion

type GameUpdateParamsGameConfigUnion interface {
	ImplementsGameUpdateParamsGameConfigUnion()
}

游戏配置

Satisfied by shared.UnionString, shared.UnionBool, GameUpdateParamsGameConfigArray, GameUpdateParamsGameConfigMap, shared.UnionFloat.

type GameUpdateParamsGameExtendArray

type GameUpdateParamsGameExtendArray []interface{}

func (GameUpdateParamsGameExtendArray) ImplementsGameUpdateParamsGameExtendUnion

func (r GameUpdateParamsGameExtendArray) ImplementsGameUpdateParamsGameExtendUnion()

type GameUpdateParamsGameExtendMap

type GameUpdateParamsGameExtendMap map[string]interface{}

func (GameUpdateParamsGameExtendMap) ImplementsGameUpdateParamsGameExtendUnion

func (r GameUpdateParamsGameExtendMap) ImplementsGameUpdateParamsGameExtendUnion()

type GameUpdateParamsGameExtendUnion

type GameUpdateParamsGameExtendUnion interface {
	ImplementsGameUpdateParamsGameExtendUnion()
}

游戏扩展信息

Satisfied by shared.UnionString, shared.UnionBool, GameUpdateParamsGameExtendArray, GameUpdateParamsGameExtendMap, shared.UnionFloat.

type GameUpdateParamsKind

type GameUpdateParamsKind string

游戏类型 (physical:实体游戏,digital:电子游戏,online:网络发行)

const (
	GameUpdateParamsKindPhysical GameUpdateParamsKind = "physical"
	GameUpdateParamsKindDigital  GameUpdateParamsKind = "digital"
	GameUpdateParamsKindOnline   GameUpdateParamsKind = "online"
)

func (GameUpdateParamsKind) IsKnown

func (r GameUpdateParamsKind) IsKnown() bool

type GameUpdateResponse

type GameUpdateResponse struct {
	Code    int64                  `json:"code,required"`
	Data    interface{}            `json:"data,required,nullable"`
	Msg     string                 `json:"msg,required"`
	TraceID string                 `json:"trace_id,required"`
	JSON    gameUpdateResponseJSON `json:"-"`
}

func (*GameUpdateResponse) UnmarshalJSON

func (r *GameUpdateResponse) UnmarshalJSON(data []byte) (err error)

type I18n

type I18n = shared.I18n

国际化名称结构

This is an alias to an internal type.

type I18nImage

type I18nImage = shared.I18nImage

图片结构

This is an alias to an internal type.

type I18nImageKind

type I18nImageKind = shared.I18nImageKind

图片类型例:cover, banner, icon

This is an alias to an internal type.

type I18nImageParam

type I18nImageParam = shared.I18nImageParam

图片结构

This is an alias to an internal type.

type I18nLanguage

type I18nLanguage = shared.I18nLanguage

语言代码 (zh-CN,zh-TW,ja-JP,en-US 等等)

This is an alias to an internal type.

type I18nParam

type I18nParam = shared.I18nParam

国际化名称结构

This is an alias to an internal type.

type ProductSKUDeleteParams

type ProductSKUDeleteParams struct {
	// sku uuid
	Uuid     param.Field[string] `json:"uuid,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (ProductSKUDeleteParams) MarshalJSON

func (r ProductSKUDeleteParams) MarshalJSON() (data []byte, err error)

type ProductSKUDeleteResponse

type ProductSKUDeleteResponse struct {
	Code    int64                        `json:"code,required"`
	Data    interface{}                  `json:"data,required,nullable"`
	Msg     string                       `json:"msg,required"`
	TraceID string                       `json:"trace_id,required"`
	JSON    productSKUDeleteResponseJSON `json:"-"`
}

func (*ProductSKUDeleteResponse) UnmarshalJSON

func (r *ProductSKUDeleteResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKUGetManyParams

type ProductSKUGetManyParams struct {
	// sku uuid
	Uuid     param.Field[[]string] `query:"uuid,required"`
	SkipAuth param.Field[bool]     `header:"Skip-Auth"`
}

func (ProductSKUGetManyParams) URLQuery

func (r ProductSKUGetManyParams) URLQuery() (v url.Values)

URLQuery serializes ProductSKUGetManyParams's query parameters as `url.Values`.

type ProductSKUGetManyResponse

type ProductSKUGetManyResponse struct {
	Code    int64                         `json:"code,required"`
	Data    []SKU                         `json:"data,required"`
	Msg     string                        `json:"msg,required"`
	TraceID string                        `json:"trace_id,required"`
	JSON    productSKUGetManyResponseJSON `json:"-"`
}

func (*ProductSKUGetManyResponse) UnmarshalJSON

func (r *ProductSKUGetManyResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKUGetManySearchParams

type ProductSKUGetManySearchParams struct {
	// uuids 列表
	Uuids    param.Field[[]string] `json:"uuids,required" format:"uuid"`
	SkipAuth param.Field[bool]     `header:"Skip-Auth"`
}

func (ProductSKUGetManySearchParams) MarshalJSON

func (r ProductSKUGetManySearchParams) MarshalJSON() (data []byte, err error)

type ProductSKUGetManySearchResponse

type ProductSKUGetManySearchResponse struct {
	Code    int64                               `json:"code,required"`
	Data    []SKU                               `json:"data,required"`
	Msg     string                              `json:"msg,required"`
	TraceID string                              `json:"trace_id,required"`
	JSON    productSKUGetManySearchResponseJSON `json:"-"`
}

func (*ProductSKUGetManySearchResponse) UnmarshalJSON

func (r *ProductSKUGetManySearchResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKUGetParams

type ProductSKUGetParams struct {
	// sku uuid
	Uuid     param.Field[string] `query:"uuid,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (ProductSKUGetParams) URLQuery

func (r ProductSKUGetParams) URLQuery() (v url.Values)

URLQuery serializes ProductSKUGetParams's query parameters as `url.Values`.

type ProductSKUGetResponse

type ProductSKUGetResponse struct {
	Code    int64                     `json:"code,required"`
	Data    SKU                       `json:"data,required"`
	Msg     string                    `json:"msg,required"`
	TraceID string                    `json:"trace_id,required"`
	JSON    productSKUGetResponseJSON `json:"-"`
}

func (*ProductSKUGetResponse) UnmarshalJSON

func (r *ProductSKUGetResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKUListParams

type ProductSKUListParams struct {
	// game_key
	GameKey param.Field[string] `query:"game_key"`
	// 过滤缺失或未缺失数据的卡牌
	HasMissing param.Field[bool] `query:"has_missing"`
	// 过滤已隐藏或未隐藏的卡牌
	IsHidden param.Field[bool] `query:"is_hidden"`
	// 过滤已发布或未发布的卡牌
	IsPublished param.Field[bool] `query:"is_published"`
	// 类型,card 和 goods
	Kind param.Field[ProductSKUListParamsKind] `query:"kind"`
	// 语言,zh-TW, zh-CN 等
	Language param.Field[string] `query:"language"`
	// 过滤卡名,模糊匹配
	Name param.Field[string] `query:"name"`
	// 卡编号,模糊匹配
	Number param.Field[string] `query:"number"`
	// 页码,默认 1
	Page param.Field[int64] `query:"page"`
	// 每页条数,默认 50
	PageSize param.Field[int64] `query:"page_size"`
	// 罕贵度,精确查询
	Rarity   param.Field[string] `query:"rarity"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (ProductSKUListParams) URLQuery

func (r ProductSKUListParams) URLQuery() (v url.Values)

URLQuery serializes ProductSKUListParams's query parameters as `url.Values`.

type ProductSKUListParamsKind

type ProductSKUListParamsKind string

类型,card 和 goods

const (
	ProductSKUListParamsKindCard  ProductSKUListParamsKind = "card"
	ProductSKUListParamsKindGoods ProductSKUListParamsKind = "goods"
)

func (ProductSKUListParamsKind) IsKnown

func (r ProductSKUListParamsKind) IsKnown() bool

type ProductSKUMergeParams

type ProductSKUMergeParams struct {
	// 不可以是已发布的
	FromUuid   param.Field[string] `json:"from_uuid,required"`
	TargetUuid param.Field[string] `json:"target_uuid,required"`
	// 空时代表以 target 信息为准,字段参考创建 sku 接口
	MergeData param.Field[ProductSKUMergeParamsMergeDataUnion] `json:"merge_data"`
	SkipAuth  param.Field[bool]                                `header:"Skip-Auth"`
}

func (ProductSKUMergeParams) MarshalJSON

func (r ProductSKUMergeParams) MarshalJSON() (data []byte, err error)

type ProductSKUMergeParamsMergeDataMergeDataArray

type ProductSKUMergeParamsMergeDataMergeDataArray []interface{}

func (ProductSKUMergeParamsMergeDataMergeDataArray) ImplementsProductSKUMergeParamsMergeDataUnion

func (r ProductSKUMergeParamsMergeDataMergeDataArray) ImplementsProductSKUMergeParamsMergeDataUnion()

type ProductSKUMergeParamsMergeDataMergeDataObject

type ProductSKUMergeParamsMergeDataMergeDataObject map[string]interface{}

func (ProductSKUMergeParamsMergeDataMergeDataObject) ImplementsProductSKUMergeParamsMergeDataUnion

func (r ProductSKUMergeParamsMergeDataMergeDataObject) ImplementsProductSKUMergeParamsMergeDataUnion()

type ProductSKUMergeParamsMergeDataUnion

type ProductSKUMergeParamsMergeDataUnion interface {
	ImplementsProductSKUMergeParamsMergeDataUnion()
}

空时代表以 target 信息为准,字段参考创建 sku 接口

Satisfied by shared.UnionString, shared.UnionBool, ProductSKUMergeParamsMergeDataMergeDataArray, ProductSKUMergeParamsMergeDataMergeDataObject, shared.UnionFloat.

type ProductSKUMergeRelationParams

type ProductSKUMergeRelationParams struct {
	FromUuid param.Field[[]string] `query:"from_uuid,required"`
	SkipAuth param.Field[bool]     `header:"Skip-Auth"`
}

func (ProductSKUMergeRelationParams) URLQuery

func (r ProductSKUMergeRelationParams) URLQuery() (v url.Values)

URLQuery serializes ProductSKUMergeRelationParams's query parameters as `url.Values`.

type ProductSKUMergeRelationResponse

type ProductSKUMergeRelationResponse struct {
	Code    int64                               `json:"code,required"`
	Data    ProductSKUMergeRelationResponseData `json:"data,required"`
	Msg     string                              `json:"msg,required"`
	TraceID string                              `json:"trace_id,required"`
	JSON    productSKUMergeRelationResponseJSON `json:"-"`
}

func (*ProductSKUMergeRelationResponse) UnmarshalJSON

func (r *ProductSKUMergeRelationResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKUMergeRelationResponseData

type ProductSKUMergeRelationResponseData struct {
	// key: from_uuid, value: target_uuid
	MergeMap map[string]string                       `json:"merge_map,required,nullable"`
	JSON     productSKUMergeRelationResponseDataJSON `json:"-"`
}

func (*ProductSKUMergeRelationResponseData) UnmarshalJSON

func (r *ProductSKUMergeRelationResponseData) UnmarshalJSON(data []byte) (err error)

type ProductSKUMergeResponse

type ProductSKUMergeResponse struct {
	Code    int64                       `json:"code,required"`
	Data    interface{}                 `json:"data,required,nullable"`
	Msg     string                      `json:"msg,required"`
	TraceID string                      `json:"trace_id,required"`
	JSON    productSKUMergeResponseJSON `json:"-"`
}

func (*ProductSKUMergeResponse) UnmarshalJSON

func (r *ProductSKUMergeResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKUNewParams

type ProductSKUNewParams struct {
	// 卡牌别名数组
	Aliases param.Field[[]string] `json:"aliases,required"`
	// 不同游戏结构不同,具体参考"字段描述"文档
	Data param.Field[ProductSKUNewParamsDataUnion] `json:"data,required"`
	// 游戏唯一标识,pkm, ygo,pocket 等
	GameKey param.Field[string] `json:"game_key,required"`
	// 卡牌图片描述,如卡牌封面,卡牌背面
	Images param.Field[[]shared.I18nImageParam] `json:"images,required"`
	// 分类,card 和 goods
	Kind param.Field[string] `json:"kind,required"`
	// 卡牌语言,zh-TW, zh-CN 等
	Language param.Field[string] `json:"language,required"`
	// 卡牌名字
	Name param.Field[string] `json:"name,required"`
	// 卡牌编号
	Number param.Field[string] `json:"number,required"`
	// 发布时间
	PublishedAt param.Field[time.Time] `json:"published_at,required" format:"date-time"`
	// 区域,数字编码
	Region param.Field[[]string] `json:"region,required"`
	// 所属集合,如果传为空,则不修改,如果传了则为全量更新
	CollectionUuids param.Field[[]string] `json:"collection_uuids"`
	// 是否缺失
	HasMissing param.Field[bool] `json:"has_missing"`
	// 是否隐藏
	IsHidden    param.Field[bool] `json:"is_hidden"`
	IsPublished param.Field[bool] `json:"is_published"`
	// spu uuid,如果没传则自动根据当前 sku 信息创建一个新的 spu,否则关联指定 spu_uuid
	SpuUuid  param.Field[string] `json:"spu_uuid"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (ProductSKUNewParams) MarshalJSON

func (r ProductSKUNewParams) MarshalJSON() (data []byte, err error)

type ProductSKUNewParamsDataArray

type ProductSKUNewParamsDataArray []interface{}

func (ProductSKUNewParamsDataArray) ImplementsProductSKUNewParamsDataUnion

func (r ProductSKUNewParamsDataArray) ImplementsProductSKUNewParamsDataUnion()

type ProductSKUNewParamsDataMap

type ProductSKUNewParamsDataMap map[string]interface{}

func (ProductSKUNewParamsDataMap) ImplementsProductSKUNewParamsDataUnion

func (r ProductSKUNewParamsDataMap) ImplementsProductSKUNewParamsDataUnion()

type ProductSKUNewParamsDataUnion

type ProductSKUNewParamsDataUnion interface {
	ImplementsProductSKUNewParamsDataUnion()
}

不同游戏结构不同,具体参考"字段描述"文档

Satisfied by shared.UnionString, shared.UnionBool, ProductSKUNewParamsDataArray, ProductSKUNewParamsDataMap, shared.UnionFloat.

type ProductSKUNewResponse

type ProductSKUNewResponse struct {
	Code    int64                     `json:"code,required"`
	Data    ProductSKUNewResponseData `json:"data,required"`
	Msg     string                    `json:"msg,required"`
	TraceID string                    `json:"trace_id,required"`
	JSON    productSKUNewResponseJSON `json:"-"`
}

func (*ProductSKUNewResponse) UnmarshalJSON

func (r *ProductSKUNewResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKUNewResponseData

type ProductSKUNewResponseData struct {
	Uuid string                        `json:"uuid,required" format:"uuid"`
	JSON productSKUNewResponseDataJSON `json:"-"`
}

func (*ProductSKUNewResponseData) UnmarshalJSON

func (r *ProductSKUNewResponseData) UnmarshalJSON(data []byte) (err error)

type ProductSKUPublishParams

type ProductSKUPublishParams struct {
	Uuid     param.Field[string] `json:"uuid,required" format:"uuid"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (ProductSKUPublishParams) MarshalJSON

func (r ProductSKUPublishParams) MarshalJSON() (data []byte, err error)

type ProductSKUPublishResponse

type ProductSKUPublishResponse struct {
	Code    int64                         `json:"code,required"`
	Data    interface{}                   `json:"data,required,nullable"`
	Msg     string                        `json:"msg,required"`
	TraceID string                        `json:"trace_id,required"`
	JSON    productSKUPublishResponseJSON `json:"-"`
}

func (*ProductSKUPublishResponse) UnmarshalJSON

func (r *ProductSKUPublishResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKURelationByCvidParams

type ProductSKURelationByCvidParams struct {
	// card version ids 列表,批量查询
	ID       param.Field[[]int64] `query:"id,required"`
	GameKey  param.Field[string]  `query:"game_key"`
	SkipAuth param.Field[bool]    `header:"Skip-Auth"`
}

func (ProductSKURelationByCvidParams) URLQuery

func (r ProductSKURelationByCvidParams) URLQuery() (v url.Values)

URLQuery serializes ProductSKURelationByCvidParams's query parameters as `url.Values`.

type ProductSKURelationByCvidResponse

type ProductSKURelationByCvidResponse struct {
	Code    int64                                `json:"code,required"`
	Data    []TempCardSKURelation                `json:"data,required"`
	Msg     string                               `json:"msg,required"`
	TraceID string                               `json:"trace_id,required"`
	JSON    productSKURelationByCvidResponseJSON `json:"-"`
}

func (*ProductSKURelationByCvidResponse) UnmarshalJSON

func (r *ProductSKURelationByCvidResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKURelationByCvidSearchParams

type ProductSKURelationByCvidSearchParams struct {
	// 游戏 key,可以为空
	GameKey  param.Field[string]  `json:"game_key,required"`
	IDs      param.Field[[]int64] `json:"ids,required"`
	SkipAuth param.Field[bool]    `header:"Skip-Auth"`
}

func (ProductSKURelationByCvidSearchParams) MarshalJSON

func (r ProductSKURelationByCvidSearchParams) MarshalJSON() (data []byte, err error)

type ProductSKURelationByCvidSearchResponse

type ProductSKURelationByCvidSearchResponse struct {
	Code    int64                                      `json:"code,required"`
	Data    []TempCardSKURelation                      `json:"data,required"`
	Msg     string                                     `json:"msg,required"`
	TraceID string                                     `json:"trace_id,required"`
	JSON    productSKURelationByCvidSearchResponseJSON `json:"-"`
}

func (*ProductSKURelationByCvidSearchResponse) UnmarshalJSON

func (r *ProductSKURelationByCvidSearchResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKURelationByUuidParams

type ProductSKURelationByUuidParams struct {
	// sku uuids 列表,批量查询
	Uuid     param.Field[[]string] `query:"uuid,required"`
	SkipAuth param.Field[bool]     `header:"Skip-Auth"`
}

func (ProductSKURelationByUuidParams) URLQuery

func (r ProductSKURelationByUuidParams) URLQuery() (v url.Values)

URLQuery serializes ProductSKURelationByUuidParams's query parameters as `url.Values`.

type ProductSKURelationByUuidResponse

type ProductSKURelationByUuidResponse struct {
	Code    int64                                `json:"code,required"`
	Data    []TempCardSKURelation                `json:"data,required"`
	Msg     string                               `json:"msg,required"`
	TraceID string                               `json:"trace_id,required"`
	JSON    productSKURelationByUuidResponseJSON `json:"-"`
}

func (*ProductSKURelationByUuidResponse) UnmarshalJSON

func (r *ProductSKURelationByUuidResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKURelationByUuidSearchParams

type ProductSKURelationByUuidSearchParams struct {
	Uuids    param.Field[[]string] `json:"uuids,required" format:"uuid"`
	SkipAuth param.Field[bool]     `header:"Skip-Auth"`
}

func (ProductSKURelationByUuidSearchParams) MarshalJSON

func (r ProductSKURelationByUuidSearchParams) MarshalJSON() (data []byte, err error)

type ProductSKURelationByUuidSearchResponse

type ProductSKURelationByUuidSearchResponse struct {
	Code    int64                                      `json:"code,required"`
	Data    []TempCardSKURelation                      `json:"data,required"`
	Msg     string                                     `json:"msg,required"`
	TraceID string                                     `json:"trace_id,required"`
	JSON    productSKURelationByUuidSearchResponseJSON `json:"-"`
}

func (*ProductSKURelationByUuidSearchResponse) UnmarshalJSON

func (r *ProductSKURelationByUuidSearchResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKUSearchParams

type ProductSKUSearchParams struct {
	Page     param.Field[int64] `query:"page"`
	PageSize param.Field[int64] `query:"page_size"`
	// 所属集合 uuid
	CollectionUuid param.Field[[]string] `json:"collection_uuid"`
	// 游戏标识
	GameKey param.Field[string] `json:"game_key"`
	// 是否缺失
	HasMissing param.Field[bool] `json:"has_missing"`
	// 是否隐藏
	IsHidden param.Field[bool] `json:"is_hidden"`
	// 多语言
	IsMultiLanguage param.Field[bool] `json:"is_multi_language"`
	// 是否发布
	IsPublished param.Field[bool] `json:"is_published"`
	// sku 类型
	Kind param.Field[ProductSKUSearchParamsKind] `json:"kind"`
	// 卡牌语言
	Language param.Field[string] `json:"language"`
	// 卡牌名
	Name param.Field[string] `json:"name"`
	// 卡牌编号
	Number param.Field[string]                        `json:"number"`
	Orders param.Field[[]ProductSKUSearchParamsOrder] `json:"orders"`
	// 罕贵度
	Rarity param.Field[string] `json:"rarity"`
	// 指定 spu
	SpuUuid param.Field[string] `json:"spu_uuid"`
	// uuids 列表
	Uuids    param.Field[[]string] `json:"uuids"`
	SkipAuth param.Field[bool]     `header:"Skip-Auth"`
}

func (ProductSKUSearchParams) MarshalJSON

func (r ProductSKUSearchParams) MarshalJSON() (data []byte, err error)

func (ProductSKUSearchParams) URLQuery

func (r ProductSKUSearchParams) URLQuery() (v url.Values)

URLQuery serializes ProductSKUSearchParams's query parameters as `url.Values`.

type ProductSKUSearchParamsKind

type ProductSKUSearchParamsKind string

sku 类型

const (
	ProductSKUSearchParamsKindGoods ProductSKUSearchParamsKind = "goods"
	ProductSKUSearchParamsKindCard  ProductSKUSearchParamsKind = "card"
)

func (ProductSKUSearchParamsKind) IsKnown

func (r ProductSKUSearchParamsKind) IsKnown() bool

type ProductSKUSearchParamsOrder

type ProductSKUSearchParamsOrder string
const (
	ProductSKUSearchParamsOrderUuidDesc        ProductSKUSearchParamsOrder = "uuid desc"
	ProductSKUSearchParamsOrderUuidAsc         ProductSKUSearchParamsOrder = "uuid asc"
	ProductSKUSearchParamsOrderKindDesc        ProductSKUSearchParamsOrder = "kind desc"
	ProductSKUSearchParamsOrderKindAsc         ProductSKUSearchParamsOrder = "kind asc"
	ProductSKUSearchParamsOrderNumberDesc      ProductSKUSearchParamsOrder = "number desc"
	ProductSKUSearchParamsOrderNumberAsc       ProductSKUSearchParamsOrder = "number asc"
	ProductSKUSearchParamsOrderRarityDesc      ProductSKUSearchParamsOrder = "rarity desc"
	ProductSKUSearchParamsOrderRarityAsc       ProductSKUSearchParamsOrder = "rarity asc"
	ProductSKUSearchParamsOrderFinishDesc      ProductSKUSearchParamsOrder = "finish desc"
	ProductSKUSearchParamsOrderFinishAsc       ProductSKUSearchParamsOrder = "finish asc"
	ProductSKUSearchParamsOrderPublishedAtDesc ProductSKUSearchParamsOrder = "published_at desc"
	ProductSKUSearchParamsOrderPublishedAtAsc  ProductSKUSearchParamsOrder = "published_at asc"
)

func (ProductSKUSearchParamsOrder) IsKnown

func (r ProductSKUSearchParamsOrder) IsKnown() bool

type ProductSKUService

type ProductSKUService struct {
	Options []option.RequestOption
}

ProductSKUService contains methods and other services that help with interacting with the tcgwiki API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProductSKUService method instead.

func NewProductSKUService

func NewProductSKUService(opts ...option.RequestOption) (r *ProductSKUService)

NewProductSKUService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProductSKUService) Delete

删除 sku

func (*ProductSKUService) Get

获取 sku 详情

func (*ProductSKUService) GetMany

批量获取 sku 详情

func (*ProductSKUService) GetManySearch

批量获取 sku 详情

func (*ProductSKUService) List

获取 sku 列表 Copy

func (*ProductSKUService) ListAutoPaging

获取 sku 列表 Copy

func (*ProductSKUService) Merge

合并 sku

func (*ProductSKUService) MergeRelation

查找被合并的 SKU

func (*ProductSKUService) New

创建 sku

func (*ProductSKUService) Publish

发布 sku

func (*ProductSKUService) RelationByCvid

根据 card version id 批量获取关系

func (*ProductSKUService) RelationByCvidSearch

根据 card version id 批量获取关系

func (*ProductSKUService) RelationByUuid

根据 sku uuid 获取关系

func (*ProductSKUService) RelationByUuidSearch

根据 sku uuid 获取关系

func (*ProductSKUService) Search

获取 sku 列表

func (*ProductSKUService) SearchAutoPaging

获取 sku 列表

func (*ProductSKUService) Update

更新 sku

func (*ProductSKUService) UpdateImages

更新 sku Images

func (*ProductSKUService) UpdateName

更新 sku Name

type ProductSKUUpdateImagesParams

type ProductSKUUpdateImagesParams struct {
	// 新的图片
	Images param.Field[[]shared.I18nImageParam] `json:"images,required"`
	// sku uuid
	Uuid     param.Field[string] `json:"uuid,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (ProductSKUUpdateImagesParams) MarshalJSON

func (r ProductSKUUpdateImagesParams) MarshalJSON() (data []byte, err error)

type ProductSKUUpdateImagesResponse

type ProductSKUUpdateImagesResponse struct {
	Code    int64                              `json:"code,required"`
	Data    interface{}                        `json:"data,required,nullable"`
	Msg     string                             `json:"msg,required"`
	TraceID string                             `json:"trace_id,required"`
	JSON    productSKUUpdateImagesResponseJSON `json:"-"`
}

func (*ProductSKUUpdateImagesResponse) UnmarshalJSON

func (r *ProductSKUUpdateImagesResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKUUpdateNameParams

type ProductSKUUpdateNameParams struct {
	// 新的卡名
	Name param.Field[string] `json:"name,required"`
	// sku uuid
	Uuid     param.Field[string] `json:"uuid,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (ProductSKUUpdateNameParams) MarshalJSON

func (r ProductSKUUpdateNameParams) MarshalJSON() (data []byte, err error)

type ProductSKUUpdateNameResponse

type ProductSKUUpdateNameResponse struct {
	Code    int64                            `json:"code,required"`
	Data    interface{}                      `json:"data,required,nullable"`
	Msg     string                           `json:"msg,required"`
	TraceID string                           `json:"trace_id,required"`
	JSON    productSKUUpdateNameResponseJSON `json:"-"`
}

func (*ProductSKUUpdateNameResponse) UnmarshalJSON

func (r *ProductSKUUpdateNameResponse) UnmarshalJSON(data []byte) (err error)

type ProductSKUUpdateParams

type ProductSKUUpdateParams struct {
	// 卡牌别名数组
	Aliases param.Field[[]string] `json:"aliases,required"`
	// 不同游戏结构不同,具体参考"字段描述"文档
	Data param.Field[ProductSKUUpdateParamsDataUnion] `json:"data,required"`
	// 游戏唯一标识,pkm, ygo,pocket 等
	GameKey param.Field[string] `json:"game_key,required"`
	// 卡牌图片描述,如卡牌封面,卡牌背面
	Images param.Field[[]shared.I18nImageParam] `json:"images,required"`
	// 分类,card 和 goods
	Kind param.Field[string] `json:"kind,required"`
	// 卡牌语言,zh-TW, zh-CN 等
	Language param.Field[string] `json:"language,required"`
	// 卡牌名字
	Name param.Field[string] `json:"name,required"`
	// 卡牌编号
	Number param.Field[string] `json:"number,required"`
	// 发布时间
	PublishedAt param.Field[time.Time] `json:"published_at,required" format:"date-time"`
	// 区域,数字编码
	Region param.Field[[]string] `json:"region,required"`
	Uuid   param.Field[string]   `json:"uuid,required" format:"uuid"`
	// 所属集合,如果传为空,则不修改,如果传了则为全量更新
	CollectionUuids param.Field[[]string] `json:"collection_uuids"`
	// 是否缺失
	HasMissing param.Field[bool] `json:"has_missing"`
	// 是否隐藏
	IsHidden    param.Field[bool] `json:"is_hidden"`
	IsPublished param.Field[bool] `json:"is_published"`
	// spu uuid,如果没传则自动根据当前 sku 信息创建一个新的 spu,否则关联指定 spu_uuid
	SpuUuid  param.Field[string] `json:"spu_uuid"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (ProductSKUUpdateParams) MarshalJSON

func (r ProductSKUUpdateParams) MarshalJSON() (data []byte, err error)

type ProductSKUUpdateParamsDataArray

type ProductSKUUpdateParamsDataArray []interface{}

func (ProductSKUUpdateParamsDataArray) ImplementsProductSKUUpdateParamsDataUnion

func (r ProductSKUUpdateParamsDataArray) ImplementsProductSKUUpdateParamsDataUnion()

type ProductSKUUpdateParamsDataMap

type ProductSKUUpdateParamsDataMap map[string]interface{}

func (ProductSKUUpdateParamsDataMap) ImplementsProductSKUUpdateParamsDataUnion

func (r ProductSKUUpdateParamsDataMap) ImplementsProductSKUUpdateParamsDataUnion()

type ProductSKUUpdateParamsDataUnion

type ProductSKUUpdateParamsDataUnion interface {
	ImplementsProductSKUUpdateParamsDataUnion()
}

不同游戏结构不同,具体参考"字段描述"文档

Satisfied by shared.UnionString, shared.UnionBool, ProductSKUUpdateParamsDataArray, ProductSKUUpdateParamsDataMap, shared.UnionFloat.

type ProductSKUUpdateResponse

type ProductSKUUpdateResponse struct {
	Code    int64                        `json:"code,required"`
	Data    interface{}                  `json:"data,required,nullable"`
	Msg     string                       `json:"msg,required"`
	TraceID string                       `json:"trace_id,required"`
	JSON    productSKUUpdateResponseJSON `json:"-"`
}

func (*ProductSKUUpdateResponse) UnmarshalJSON

func (r *ProductSKUUpdateResponse) UnmarshalJSON(data []byte) (err error)

type ProductService

type ProductService struct {
	Options []option.RequestOption
	SKUs    *ProductSKUService
	Spus    *ProductSpusService
}

ProductService contains methods and other services that help with interacting with the tcgwiki API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProductService method instead.

func NewProductService

func NewProductService(opts ...option.RequestOption) (r *ProductService)

NewProductService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type ProductSpusGetParams

type ProductSpusGetParams struct {
	// spu uuid
	Uuid     param.Field[string] `query:"uuid,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (ProductSpusGetParams) URLQuery

func (r ProductSpusGetParams) URLQuery() (v url.Values)

URLQuery serializes ProductSpusGetParams's query parameters as `url.Values`.

type ProductSpusGetResponse

type ProductSpusGetResponse struct {
	Code    int64                      `json:"code,required"`
	Data    Spu                        `json:"data,required"`
	Msg     string                     `json:"msg,required"`
	TraceID string                     `json:"trace_id,required"`
	JSON    productSpusGetResponseJSON `json:"-"`
}

func (*ProductSpusGetResponse) UnmarshalJSON

func (r *ProductSpusGetResponse) UnmarshalJSON(data []byte) (err error)

type ProductSpusListParams

type ProductSpusListParams struct {
	// 游戏标识
	GameKey param.Field[string] `query:"game_key"`
	// 过滤缺失或未缺失数据的卡牌
	HasMissing param.Field[bool] `query:"has_missing"`
	// 过滤已隐藏或未隐藏的卡牌
	IsHidden param.Field[bool] `query:"is_hidden"`
	// 过滤已发布或未发布的卡牌
	IsPublished param.Field[bool] `query:"is_published"`
	// 分类,card 和 goods
	Kind param.Field[ProductSpusListParamsKind] `query:"kind"`
	// spu 名字
	Name param.Field[string] `query:"name"`
	// 页码
	Page param.Field[int64] `query:"page"`
	// 每页条数
	PageSize param.Field[int64] `query:"page_size"`
	SkipAuth param.Field[bool]  `header:"Skip-Auth"`
}

func (ProductSpusListParams) URLQuery

func (r ProductSpusListParams) URLQuery() (v url.Values)

URLQuery serializes ProductSpusListParams's query parameters as `url.Values`.

type ProductSpusListParamsKind

type ProductSpusListParamsKind string

分类,card 和 goods

const (
	ProductSpusListParamsKindCard  ProductSpusListParamsKind = "card"
	ProductSpusListParamsKindGoods ProductSpusListParamsKind = "goods"
)

func (ProductSpusListParamsKind) IsKnown

func (r ProductSpusListParamsKind) IsKnown() bool

type ProductSpusOriginParams

type ProductSpusOriginParams struct {
	// spu uuid
	Uuid     param.Field[string] `query:"uuid"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (ProductSpusOriginParams) URLQuery

func (r ProductSpusOriginParams) URLQuery() (v url.Values)

URLQuery serializes ProductSpusOriginParams's query parameters as `url.Values`.

type ProductSpusOriginResponse

type ProductSpusOriginResponse struct {
	Code    int64                         `json:"code,required"`
	Data    ProductSpusOriginResponseData `json:"data,required"`
	Msg     string                        `json:"msg,required"`
	TraceID string                        `json:"trace_id"`
	JSON    productSpusOriginResponseJSON `json:"-"`
}

func (*ProductSpusOriginResponse) UnmarshalJSON

func (r *ProductSpusOriginResponse) UnmarshalJSON(data []byte) (err error)

type ProductSpusOriginResponseData

type ProductSpusOriginResponseData struct {
	// 实际被合并进 spu 的 sku 信息
	Origin []SKU `json:"origin,required"`
	// spu 关联的所有 sku 信息
	SKUs []SKU `json:"skus,required"`
	// spu 详情
	Spu  Spu                               `json:"spu,required"`
	JSON productSpusOriginResponseDataJSON `json:"-"`
}

func (*ProductSpusOriginResponseData) UnmarshalJSON

func (r *ProductSpusOriginResponseData) UnmarshalJSON(data []byte) (err error)

type ProductSpusService

type ProductSpusService struct {
	Options []option.RequestOption
}

ProductSpusService contains methods and other services that help with interacting with the tcgwiki API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProductSpusService method instead.

func NewProductSpusService

func NewProductSpusService(opts ...option.RequestOption) (r *ProductSpusService)

NewProductSpusService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProductSpusService) Get

获取 spu 详情

func (*ProductSpusService) List

获取 spu 列表

func (*ProductSpusService) ListAutoPaging

获取 spu 列表

func (*ProductSpusService) Origin

获取 SPU 数据来源

func (*ProductSpusService) Update

更新 spu

type ProductSpusUpdateParams

type ProductSpusUpdateParams struct {
	I18nData param.Field[[]ProductSpusUpdateParamsI18nData] `json:"i18n_data,required"`
	Kind     param.Field[ProductSpusUpdateParamsKind]       `json:"kind,required"`
	Name     param.Field[string]                            `json:"name,required"`
	QaUuids  param.Field[[]string]                          `json:"qa_uuids,required" format:"uuid"`
	Uuid     param.Field[string]                            `json:"uuid,required"`
	SkipAuth param.Field[bool]                              `header:"Skip-Auth"`
}

func (ProductSpusUpdateParams) MarshalJSON

func (r ProductSpusUpdateParams) MarshalJSON() (data []byte, err error)

type ProductSpusUpdateParamsI18nData

type ProductSpusUpdateParamsI18nData struct {
	Language param.Field[string] `json:"language,required"`
	// 不同游戏结构不同,具体参考"字段描述"文档
	Text       param.Field[map[string]interface{}] `json:"text,required"`
	Translator param.Field[string]                 `json:"translator,required"`
}

func (ProductSpusUpdateParamsI18nData) MarshalJSON

func (r ProductSpusUpdateParamsI18nData) MarshalJSON() (data []byte, err error)

type ProductSpusUpdateParamsKind

type ProductSpusUpdateParamsKind string
const (
	ProductSpusUpdateParamsKindCard  ProductSpusUpdateParamsKind = "card"
	ProductSpusUpdateParamsKindGoods ProductSpusUpdateParamsKind = "goods"
)

func (ProductSpusUpdateParamsKind) IsKnown

func (r ProductSpusUpdateParamsKind) IsKnown() bool

type ProductSpusUpdateResponse

type ProductSpusUpdateResponse struct {
	Code    int64                         `json:"code,required"`
	Data    interface{}                   `json:"data,required,nullable"`
	Msg     string                        `json:"msg,required"`
	TraceID string                        `json:"trace_id,required"`
	JSON    productSpusUpdateResponseJSON `json:"-"`
}

func (*ProductSpusUpdateResponse) UnmarshalJSON

func (r *ProductSpusUpdateResponse) UnmarshalJSON(data []byte) (err error)

type QaDeleteParams

type QaDeleteParams struct {
	Uuid     param.Field[string] `json:"uuid,required" format:"uuid"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (QaDeleteParams) MarshalJSON

func (r QaDeleteParams) MarshalJSON() (data []byte, err error)

type QaDeleteResponse

type QaDeleteResponse struct {
	Code    int64                `json:"code,required"`
	Data    interface{}          `json:"data,required,nullable"`
	Msg     string               `json:"msg,required"`
	TraceID string               `json:"trace_id,required"`
	JSON    qaDeleteResponseJSON `json:"-"`
}

func (*QaDeleteResponse) UnmarshalJSON

func (r *QaDeleteResponse) UnmarshalJSON(data []byte) (err error)

type QaGetParams

type QaGetParams struct {
	// QA 主键
	Uuid     param.Field[string] `query:"uuid,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (QaGetParams) URLQuery

func (r QaGetParams) URLQuery() (v url.Values)

URLQuery serializes QaGetParams's query parameters as `url.Values`.

type QaGetResponse

type QaGetResponse struct {
	Code int64 `json:"code,required"`
	// 问答判例对象
	Data    QaGetResponseData `json:"data,required"`
	Msg     string            `json:"msg,required"`
	TraceID string            `json:"trace_id,required"`
	JSON    qaGetResponseJSON `json:"-"`
}

func (*QaGetResponse) UnmarshalJSON

func (r *QaGetResponse) UnmarshalJSON(data []byte) (err error)

type QaGetResponseData

type QaGetResponseData struct {
	// 创建时间
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// 关联的游戏
	GameKey string `json:"game_key,required"`
	// 答案多语言
	I18nAnswers []shared.I18n `json:"i18n_answers,required"`
	// 问题多语言
	I18nQuestions []shared.I18n `json:"i18n_questions,required"`
	// 问题标题多语言
	I18nTitles []shared.I18n         `json:"i18n_titles,required"`
	Kind       QaGetResponseDataKind `json:"kind,required"`
	// 更新时间
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	// 问答判例 UUID
	Uuid string `json:"uuid,required" format:"uuid"`
	// 判例的官方显示更新时间
	PublishedAt time.Time `json:"published_at,nullable" format:"date-time"`
	// 判例链接
	URL  string                `json:"url"`
	JSON qaGetResponseDataJSON `json:"-"`
}

问答判例对象

func (*QaGetResponseData) UnmarshalJSON

func (r *QaGetResponseData) UnmarshalJSON(data []byte) (err error)

type QaGetResponseDataKind

type QaGetResponseDataKind string
const (
	QaGetResponseDataKindQa         QaGetResponseDataKind = "qa"
	QaGetResponseDataKindAdjustment QaGetResponseDataKind = "adjustment"
	QaGetResponseDataKindRulings    QaGetResponseDataKind = "rulings"
)

func (QaGetResponseDataKind) IsKnown

func (r QaGetResponseDataKind) IsKnown() bool

type QaListParams

type QaListParams struct {
	// game_key 过滤
	GameKey param.Field[string] `query:"game_key"`
	// 页码,默认为 1
	Page param.Field[int64] `query:"page"`
	// 每页数量,默认 50,最大 200
	PageSize param.Field[int64] `query:"page_size"`
	SkipAuth param.Field[bool]  `header:"Skip-Auth"`
}

func (QaListParams) URLQuery

func (r QaListParams) URLQuery() (v url.Values)

URLQuery serializes QaListParams's query parameters as `url.Values`.

type QaListResponse

type QaListResponse struct {
	// 创建时间
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// 关联的游戏
	GameKey string `json:"game_key,required"`
	// 答案多语言
	I18nAnswers []shared.I18n `json:"i18n_answers,required"`
	// 问题多语言
	I18nQuestions []shared.I18n `json:"i18n_questions,required"`
	// 问题标题多语言
	I18nTitles []shared.I18n      `json:"i18n_titles,required"`
	Kind       QaListResponseKind `json:"kind,required"`
	// 更新时间
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	// 问答判例 UUID
	Uuid string `json:"uuid,required" format:"uuid"`
	// 判例的官方显示更新时间
	PublishedAt time.Time `json:"published_at,nullable" format:"date-time"`
	// 判例链接
	URL  string             `json:"url"`
	JSON qaListResponseJSON `json:"-"`
}

问答判例对象

func (*QaListResponse) UnmarshalJSON

func (r *QaListResponse) UnmarshalJSON(data []byte) (err error)

type QaListResponseKind

type QaListResponseKind string
const (
	QaListResponseKindQa         QaListResponseKind = "qa"
	QaListResponseKindAdjustment QaListResponseKind = "adjustment"
	QaListResponseKindRulings    QaListResponseKind = "rulings"
)

func (QaListResponseKind) IsKnown

func (r QaListResponseKind) IsKnown() bool

type QaNewParams

type QaNewParams struct {
	GameKey       param.Field[string]             `json:"game_key,required"`
	I18nAnswers   param.Field[[]shared.I18nParam] `json:"i18n_answers,required"`
	I18nQuestions param.Field[[]shared.I18nParam] `json:"i18n_questions,required"`
	I18nTitles    param.Field[[]shared.I18nParam] `json:"i18n_titles,required"`
	Kind          param.Field[QaNewParamsKind]    `json:"kind,required"`
	// null 代表未知
	PublishedAt param.Field[time.Time] `json:"published_at" format:"date-time"`
	URL         param.Field[string]    `json:"url"`
	SkipAuth    param.Field[bool]      `header:"Skip-Auth"`
}

func (QaNewParams) MarshalJSON

func (r QaNewParams) MarshalJSON() (data []byte, err error)

type QaNewParamsKind

type QaNewParamsKind string
const (
	QaNewParamsKindQa         QaNewParamsKind = "qa"
	QaNewParamsKindAdjustment QaNewParamsKind = "adjustment"
	QaNewParamsKindRulings    QaNewParamsKind = "rulings"
)

func (QaNewParamsKind) IsKnown

func (r QaNewParamsKind) IsKnown() bool

type QaNewResponse

type QaNewResponse struct {
	Code    int64             `json:"code,required"`
	Data    QaNewResponseData `json:"data,required"`
	Msg     string            `json:"msg,required"`
	TraceID string            `json:"trace_id,required"`
	JSON    qaNewResponseJSON `json:"-"`
}

func (*QaNewResponse) UnmarshalJSON

func (r *QaNewResponse) UnmarshalJSON(data []byte) (err error)

type QaNewResponseData

type QaNewResponseData struct {
	Uuid string                `json:"uuid,required" format:"uuid"`
	JSON qaNewResponseDataJSON `json:"-"`
}

func (*QaNewResponseData) UnmarshalJSON

func (r *QaNewResponseData) UnmarshalJSON(data []byte) (err error)

type QaService

type QaService struct {
	Options []option.RequestOption
}

QaService contains methods and other services that help with interacting with the tcgwiki API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewQaService method instead.

func NewQaService

func NewQaService(opts ...option.RequestOption) (r *QaService)

NewQaService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*QaService) Delete

func (r *QaService) Delete(ctx context.Context, params QaDeleteParams, opts ...option.RequestOption) (res *QaDeleteResponse, err error)

根据 UUID 删除问答判例

func (*QaService) Get

func (r *QaService) Get(ctx context.Context, params QaGetParams, opts ...option.RequestOption) (res *QaGetResponse, err error)

获取问答判例详情

func (*QaService) List

根据过滤条件获取问答判例列表,支持分页

func (*QaService) ListAutoPaging

根据过滤条件获取问答判例列表,支持分页

func (*QaService) New

func (r *QaService) New(ctx context.Context, params QaNewParams, opts ...option.RequestOption) (res *QaNewResponse, err error)

创建新的问答判例

func (*QaService) Update

func (r *QaService) Update(ctx context.Context, params QaUpdateParams, opts ...option.RequestOption) (res *QaUpdateResponse, err error)

更新判例

type QaUpdateParams

type QaUpdateParams struct {
	GameKey       param.Field[string]             `json:"game_key,required"`
	I18nAnswers   param.Field[[]shared.I18nParam] `json:"i18n_answers,required"`
	I18nQuestions param.Field[[]shared.I18nParam] `json:"i18n_questions,required"`
	I18nTitles    param.Field[[]shared.I18nParam] `json:"i18n_titles,required"`
	Kind          param.Field[QaUpdateParamsKind] `json:"kind,required"`
	Uuid          param.Field[string]             `json:"uuid,required" format:"uuid"`
	// null 代表未知
	PublishedAt param.Field[time.Time] `json:"published_at" format:"date-time"`
	URL         param.Field[string]    `json:"url"`
	SkipAuth    param.Field[bool]      `header:"Skip-Auth"`
}

func (QaUpdateParams) MarshalJSON

func (r QaUpdateParams) MarshalJSON() (data []byte, err error)

type QaUpdateParamsKind

type QaUpdateParamsKind string
const (
	QaUpdateParamsKindQa         QaUpdateParamsKind = "qa"
	QaUpdateParamsKindAdjustment QaUpdateParamsKind = "adjustment"
	QaUpdateParamsKindRulings    QaUpdateParamsKind = "rulings"
)

func (QaUpdateParamsKind) IsKnown

func (r QaUpdateParamsKind) IsKnown() bool

type QaUpdateResponse

type QaUpdateResponse struct {
	Code    int64                `json:"code,required"`
	Data    interface{}          `json:"data,required,nullable"`
	Msg     string               `json:"msg,required"`
	TraceID string               `json:"trace_id,required"`
	JSON    qaUpdateResponseJSON `json:"-"`
}

func (*QaUpdateResponse) UnmarshalJSON

func (r *QaUpdateResponse) UnmarshalJSON(data []byte) (err error)

type SKU

type SKU struct {
	// 该卡所属的集合
	Collections []shared.Collection `json:"collections,required"`
	// 记录创建时间
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// 不同游戏结构不一样,详细参
	// 考https://c1t2ed3gem.feishu.cn/wiki/PiTUwdwNbibqyukygjLcdRlpn6c?table=tbliqPTKMnXhFome&view=vewJ9UnMCE
	Data SKUDataUnion `json:"data,required,nullable"`
	// 游戏 game_key
	GameKey string `json:"game_key,required"`
	// 是否有缺失数据
	HasMissing bool `json:"has_missing,required"`
	// spu 上的多语言信息
	I18nData []Skui18nDataUnion `json:"i18n_data,required,nullable"`
	// 是否隐藏
	IsHidden bool `json:"is_hidden,required"`
	// 是否发布
	IsPublished bool `json:"is_published,required"`
	// sku 类型,goods 或者 card
	Kind SKUKind `json:"kind,required"`
	// 卡牌语言
	Language SKULanguage `json:"language,required"`
	// 卡牌名称
	Name string `json:"name,required"`
	// 卡牌 number
	Number string `json:"number,required"`
	// 发行地区
	Region []string `json:"region,required"`
	// 当前数据所使用的 schema uuid
	SchemaUuid string `json:"schema_uuid,required" format:"uuid"`
	// 关联的 spu uuids
	SpuUuid string `json:"spu_uuid,required"`
	// 记录最近更新时间
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	// sku uuid
	Uuid string `json:"uuid,required"`
	// 别名,搜索使用
	Aliases []string `json:"aliases"`
	// sku 扩展数据
	Extra SKUExtra `json:"extra"`
	// 卡图列表
	Images []shared.I18nImage `json:"images"`
	// 卡牌发布时间
	PublishedAt time.Time `json:"published_at,nullable" format:"date-time"`
	JSON        skuJSON   `json:"-"`
}

func (*SKU) UnmarshalJSON

func (r *SKU) UnmarshalJSON(data []byte) (err error)

type SKUDataArray

type SKUDataArray []interface{}

func (SKUDataArray) ImplementsSKUDataUnion

func (r SKUDataArray) ImplementsSKUDataUnion()

type SKUDataMap

type SKUDataMap map[string]interface{}

func (SKUDataMap) ImplementsSKUDataUnion

func (r SKUDataMap) ImplementsSKUDataUnion()

type SKUDataUnion

type SKUDataUnion interface {
	ImplementsSKUDataUnion()
}

不同游戏结构不一样,详细参 考https://c1t2ed3gem.feishu.cn/wiki/PiTUwdwNbibqyukygjLcdRlpn6c?table=tbliqPTKMnXhFome&view=vewJ9UnMCE

Union satisfied by shared.UnionString, shared.UnionBool, SKUDataArray, SKUDataMap or shared.UnionFloat.

type SKUExtra

type SKUExtra struct {
	// spu 的别名
	SpuAliases []string     `json:"spu_aliases"`
	JSON       skuExtraJSON `json:"-"`
}

sku 扩展数据

func (*SKUExtra) UnmarshalJSON

func (r *SKUExtra) UnmarshalJSON(data []byte) (err error)

type SKUI18nDataArray

type SKUI18nDataArray []interface{}

func (SKUI18nDataArray) ImplementsSkui18nDataUnion

func (r SKUI18nDataArray) ImplementsSkui18nDataUnion()

type SKUI18nDataMap

type SKUI18nDataMap map[string]interface{}

func (SKUI18nDataMap) ImplementsSkui18nDataUnion

func (r SKUI18nDataMap) ImplementsSkui18nDataUnion()

type SKUKind

type SKUKind string

sku 类型,goods 或者 card

const (
	SKUKindGoods SKUKind = "goods"
	SKUKindCard  SKUKind = "card"
)

func (SKUKind) IsKnown

func (r SKUKind) IsKnown() bool

type SKULanguage

type SKULanguage string

卡牌语言

const (
	SKULanguageZhCn SKULanguage = "zh-CN"
	SKULanguageZhTw SKULanguage = "zh-TW"
	SKULanguageJaJp SKULanguage = "ja-JP"
	SKULanguageEnUs SKULanguage = "en-US"
)

func (SKULanguage) IsKnown

func (r SKULanguage) IsKnown() bool

type SchemaGetParams

type SchemaGetParams struct {
	Uuid     param.Field[string] `query:"uuid,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (SchemaGetParams) URLQuery

func (r SchemaGetParams) URLQuery() (v url.Values)

URLQuery serializes SchemaGetParams's query parameters as `url.Values`.

type SchemaGetResponse

type SchemaGetResponse struct {
	Code    int64                 `json:"code,required"`
	Data    SchemaGetResponseData `json:"data,required"`
	Msg     string                `json:"msg,required"`
	TraceID string                `json:"trace_id,required"`
	JSON    schemaGetResponseJSON `json:"-"`
}

func (*SchemaGetResponse) UnmarshalJSON

func (r *SchemaGetResponse) UnmarshalJSON(data []byte) (err error)

type SchemaGetResponseData

type SchemaGetResponseData struct {
	CreatedAt time.Time                      `json:"created_at,required" format:"date-time"`
	Data      SchemaGetResponseDataDataUnion `json:"data,required,nullable"`
	GameKey   string                         `json:"game_key,required"`
	Name      string                         `json:"name,required"`
	UpdatedAt time.Time                      `json:"updated_at,required" format:"date-time"`
	Uuid      string                         `json:"uuid,required" format:"uuid"`
	JSON      schemaGetResponseDataJSON      `json:"-"`
}

func (*SchemaGetResponseData) UnmarshalJSON

func (r *SchemaGetResponseData) UnmarshalJSON(data []byte) (err error)

type SchemaGetResponseDataDataArray

type SchemaGetResponseDataDataArray []interface{}

func (SchemaGetResponseDataDataArray) ImplementsSchemaGetResponseDataDataUnion

func (r SchemaGetResponseDataDataArray) ImplementsSchemaGetResponseDataDataUnion()

type SchemaGetResponseDataDataMap

type SchemaGetResponseDataDataMap map[string]interface{}

func (SchemaGetResponseDataDataMap) ImplementsSchemaGetResponseDataDataUnion

func (r SchemaGetResponseDataDataMap) ImplementsSchemaGetResponseDataDataUnion()

type SchemaGetResponseDataDataUnion

type SchemaGetResponseDataDataUnion interface {
	ImplementsSchemaGetResponseDataDataUnion()
}

Union satisfied by shared.UnionString, shared.UnionBool, SchemaGetResponseDataDataArray, SchemaGetResponseDataDataMap or shared.UnionFloat.

type SchemaListParams

type SchemaListParams struct {
	// 游戏标识,不传则不过滤
	GameKey param.Field[string] `query:"game_key"`
	// schema 名称,不传则不过滤
	Name param.Field[string] `query:"name"`
	Page param.Field[int64]  `query:"page"`
	// 每页条数 默认 50
	PageSize param.Field[int64] `query:"page_size"`
	SkipAuth param.Field[bool]  `header:"Skip-Auth"`
}

func (SchemaListParams) URLQuery

func (r SchemaListParams) URLQuery() (v url.Values)

URLQuery serializes SchemaListParams's query parameters as `url.Values`.

type SchemaListResponse

type SchemaListResponse struct {
	CreatedAt time.Time                   `json:"created_at,required" format:"date-time"`
	Data      SchemaListResponseDataUnion `json:"data,required,nullable"`
	GameKey   string                      `json:"game_key,required"`
	Name      string                      `json:"name,required"`
	UpdatedAt time.Time                   `json:"updated_at,required" format:"date-time"`
	Uuid      string                      `json:"uuid,required" format:"uuid"`
	JSON      schemaListResponseJSON      `json:"-"`
}

func (*SchemaListResponse) UnmarshalJSON

func (r *SchemaListResponse) UnmarshalJSON(data []byte) (err error)

type SchemaListResponseDataArray

type SchemaListResponseDataArray []interface{}

func (SchemaListResponseDataArray) ImplementsSchemaListResponseDataUnion

func (r SchemaListResponseDataArray) ImplementsSchemaListResponseDataUnion()

type SchemaListResponseDataMap

type SchemaListResponseDataMap map[string]interface{}

func (SchemaListResponseDataMap) ImplementsSchemaListResponseDataUnion

func (r SchemaListResponseDataMap) ImplementsSchemaListResponseDataUnion()

type SchemaListResponseDataUnion

type SchemaListResponseDataUnion interface {
	ImplementsSchemaListResponseDataUnion()
}

Union satisfied by shared.UnionString, shared.UnionBool, SchemaListResponseDataArray, SchemaListResponseDataMap or shared.UnionFloat.

type SchemaNewParams

type SchemaNewParams struct {
	Data param.Field[SchemaNewParamsDataUnion] `json:"data,required"`
	// 游戏简写
	GameKey param.Field[string] `json:"game_key,required"`
	// 简要说明
	Name     param.Field[string] `json:"name,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (SchemaNewParams) MarshalJSON

func (r SchemaNewParams) MarshalJSON() (data []byte, err error)

type SchemaNewParamsDataArray

type SchemaNewParamsDataArray []interface{}

func (SchemaNewParamsDataArray) ImplementsSchemaNewParamsDataUnion

func (r SchemaNewParamsDataArray) ImplementsSchemaNewParamsDataUnion()

type SchemaNewParamsDataMap

type SchemaNewParamsDataMap map[string]interface{}

func (SchemaNewParamsDataMap) ImplementsSchemaNewParamsDataUnion

func (r SchemaNewParamsDataMap) ImplementsSchemaNewParamsDataUnion()

type SchemaNewParamsDataUnion

type SchemaNewParamsDataUnion interface {
	ImplementsSchemaNewParamsDataUnion()
}

Satisfied by shared.UnionString, shared.UnionBool, SchemaNewParamsDataArray, SchemaNewParamsDataMap, shared.UnionFloat.

type SchemaNewResponse

type SchemaNewResponse struct {
	Code    int64                 `json:"code,required"`
	Data    SchemaNewResponseData `json:"data,required"`
	Msg     string                `json:"msg,required"`
	TraceID string                `json:"trace_id,required"`
	JSON    schemaNewResponseJSON `json:"-"`
}

func (*SchemaNewResponse) UnmarshalJSON

func (r *SchemaNewResponse) UnmarshalJSON(data []byte) (err error)

type SchemaNewResponseData

type SchemaNewResponseData struct {
	Uuid string                    `json:"uuid,required" format:"uuid"`
	JSON schemaNewResponseDataJSON `json:"-"`
}

func (*SchemaNewResponseData) UnmarshalJSON

func (r *SchemaNewResponseData) UnmarshalJSON(data []byte) (err error)

type SchemaService

type SchemaService struct {
	Options []option.RequestOption
}

SchemaService contains methods and other services that help with interacting with the tcgwiki API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSchemaService method instead.

func NewSchemaService

func NewSchemaService(opts ...option.RequestOption) (r *SchemaService)

NewSchemaService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SchemaService) Get

func (r *SchemaService) Get(ctx context.Context, params SchemaGetParams, opts ...option.RequestOption) (res *SchemaGetResponse, err error)

获取 schema 详情

func (*SchemaService) List

获取 schema 列表

func (*SchemaService) ListAutoPaging

获取 schema 列表

func (*SchemaService) New

func (r *SchemaService) New(ctx context.Context, params SchemaNewParams, opts ...option.RequestOption) (res *SchemaNewResponse, err error)

创建 schema

func (*SchemaService) Update

func (r *SchemaService) Update(ctx context.Context, params SchemaUpdateParams, opts ...option.RequestOption) (res *SchemaUpdateResponse, err error)

修改 schema

type SchemaUpdateParams

type SchemaUpdateParams struct {
	Data param.Field[SchemaUpdateParamsDataUnion] `json:"data,required"`
	// 游戏简写
	GameKey param.Field[string] `json:"game_key,required"`
	// 简要说明
	Name     param.Field[string] `json:"name,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (SchemaUpdateParams) MarshalJSON

func (r SchemaUpdateParams) MarshalJSON() (data []byte, err error)

type SchemaUpdateParamsDataArray

type SchemaUpdateParamsDataArray []interface{}

func (SchemaUpdateParamsDataArray) ImplementsSchemaUpdateParamsDataUnion

func (r SchemaUpdateParamsDataArray) ImplementsSchemaUpdateParamsDataUnion()

type SchemaUpdateParamsDataMap

type SchemaUpdateParamsDataMap map[string]interface{}

func (SchemaUpdateParamsDataMap) ImplementsSchemaUpdateParamsDataUnion

func (r SchemaUpdateParamsDataMap) ImplementsSchemaUpdateParamsDataUnion()

type SchemaUpdateParamsDataUnion

type SchemaUpdateParamsDataUnion interface {
	ImplementsSchemaUpdateParamsDataUnion()
}

Satisfied by shared.UnionString, shared.UnionBool, SchemaUpdateParamsDataArray, SchemaUpdateParamsDataMap, shared.UnionFloat.

type SchemaUpdateResponse

type SchemaUpdateResponse struct {
	Code    int64                    `json:"code,required"`
	Data    interface{}              `json:"data,required,nullable"`
	Msg     string                   `json:"msg,required"`
	TraceID string                   `json:"trace_id,required"`
	JSON    schemaUpdateResponseJSON `json:"-"`
}

func (*SchemaUpdateResponse) UnmarshalJSON

func (r *SchemaUpdateResponse) UnmarshalJSON(data []byte) (err error)

type Skui18nDataUnion

type Skui18nDataUnion interface {
	ImplementsSkui18nDataUnion()
}

Union satisfied by shared.UnionString, shared.UnionInt, shared.UnionBool, SKUI18nDataArray, SKUI18nDataMap or shared.UnionFloat.

type Spu

type Spu struct {
	// 记录创建时间
	CreatedAt string `json:"created_at,required"`
	// game_key
	GameKey string `json:"game_key,required"`
	// 是否缺失数据
	HasMissing bool `json:"has_missing,required"`
	// 多个卡的聚合
	I18nData []SpuI18nData `json:"i18n_data,required"`
	// 是否隐藏
	IsHidden bool `json:"is_hidden,required"`
	// 是否发布
	IsPublished bool `json:"is_published,required"`
	// spu 类型
	Kind SpuKind `json:"kind,required"`
	// 后台展示的名称
	Name string `json:"name,required"`
	// 关联的 qa uuid 列表
	QaUuids []string `json:"qa_uuids,required"`
	// 记录更新时间
	UpdatedAt string `json:"updated_at,required"`
	// spu uuid
	Uuid  string   `json:"uuid,required"`
	Extra SpuExtra `json:"extra"`
	// 不同卡版本之间最早的发布时间
	PublishedAt time.Time `json:"published_at,nullable" format:"date-time"`
	JSON        spuJSON   `json:"-"`
}

func (*Spu) UnmarshalJSON

func (r *Spu) UnmarshalJSON(data []byte) (err error)

type SpuExtra

type SpuExtra struct {
	// spu 别名数据
	Aliases []string     `json:"aliases"`
	JSON    spuExtraJSON `json:"-"`
}

func (*SpuExtra) UnmarshalJSON

func (r *SpuExtra) UnmarshalJSON(data []byte) (err error)

type SpuI18nData

type SpuI18nData struct {
	// 语言代码 (zh-CN,zh-TW,ja-JP,en-US 等等)
	Language SpuI18nDataLanguage `json:"language,required"`
	// 文本数据为 sku data 数据,格式参
	// 考https://c1t2ed3gem.feishu.cn/wiki/PiTUwdwNbibqyukygjLcdRlpn6c?table=tbliqPTKMnXhFome&view=vewJ9UnMCE
	Text SpuI18nDataTextUnion `json:"text,nullable"`
	// 翻译提供者
	Translator string          `json:"translator"`
	JSON       spuI18nDataJSON `json:"-"`
}

func (*SpuI18nData) UnmarshalJSON

func (r *SpuI18nData) UnmarshalJSON(data []byte) (err error)

type SpuI18nDataLanguage

type SpuI18nDataLanguage string

语言代码 (zh-CN,zh-TW,ja-JP,en-US 等等)

const (
	SpuI18nDataLanguageZhCn SpuI18nDataLanguage = "zh-CN"
	SpuI18nDataLanguageZhTw SpuI18nDataLanguage = "zh-TW"
	SpuI18nDataLanguageJaJp SpuI18nDataLanguage = "ja-JP"
	SpuI18nDataLanguageEnUs SpuI18nDataLanguage = "en-US"
	SpuI18nDataLanguageKoKr SpuI18nDataLanguage = "ko-KR"
)

func (SpuI18nDataLanguage) IsKnown

func (r SpuI18nDataLanguage) IsKnown() bool

type SpuI18nDataTextArray

type SpuI18nDataTextArray []interface{}

func (SpuI18nDataTextArray) ImplementsSpuI18nDataTextUnion

func (r SpuI18nDataTextArray) ImplementsSpuI18nDataTextUnion()

type SpuI18nDataTextMap

type SpuI18nDataTextMap map[string]interface{}

func (SpuI18nDataTextMap) ImplementsSpuI18nDataTextUnion

func (r SpuI18nDataTextMap) ImplementsSpuI18nDataTextUnion()

type SpuI18nDataTextUnion

type SpuI18nDataTextUnion interface {
	ImplementsSpuI18nDataTextUnion()
}

文本数据为 sku data 数据,格式参 考https://c1t2ed3gem.feishu.cn/wiki/PiTUwdwNbibqyukygjLcdRlpn6c?table=tbliqPTKMnXhFome&view=vewJ9UnMCE

Union satisfied by shared.UnionString, shared.UnionBool, SpuI18nDataTextArray, SpuI18nDataTextMap or shared.UnionFloat.

type SpuKind

type SpuKind string

spu 类型

const (
	SpuKindGoods SpuKind = "goods"
	SpuKindCard  SpuKind = "card"
)

func (SpuKind) IsKnown

func (r SpuKind) IsKnown() bool

type StatisticOverviewParams

type StatisticOverviewParams struct {
	// 获取最近多少天的数据,默认 7 天
	Day      param.Field[int64] `query:"day"`
	SkipAuth param.Field[bool]  `header:"Skip-Auth"`
}

func (StatisticOverviewParams) URLQuery

func (r StatisticOverviewParams) URLQuery() (v url.Values)

URLQuery serializes StatisticOverviewParams's query parameters as `url.Values`.

type StatisticOverviewResponse

type StatisticOverviewResponse struct {
	Code    int64                              `json:"code,required"`
	Data    StatisticOverviewResponseDataUnion `json:"data,required,nullable"`
	Msg     string                             `json:"msg,required"`
	TraceID string                             `json:"trace_id"`
	JSON    statisticOverviewResponseJSON      `json:"-"`
}

func (*StatisticOverviewResponse) UnmarshalJSON

func (r *StatisticOverviewResponse) UnmarshalJSON(data []byte) (err error)

type StatisticOverviewResponseData

type StatisticOverviewResponseData []interface{}

func (StatisticOverviewResponseData) ImplementsStatisticOverviewResponseDataUnion

func (r StatisticOverviewResponseData) ImplementsStatisticOverviewResponseDataUnion()

type StatisticOverviewResponseDataUnion

type StatisticOverviewResponseDataUnion interface {
	ImplementsStatisticOverviewResponseDataUnion()
}

Union satisfied by shared.UnionString, shared.UnionBool, StatisticOverviewResponseData, StatisticOverviewResponseData or shared.UnionFloat.

type StatisticOverviewSearchParams

type StatisticOverviewSearchParams struct {
	// 获取最近多少天的数据,默认 7 天
	Day      param.Field[int64] `json:"day,required"`
	SkipAuth param.Field[bool]  `header:"Skip-Auth"`
}

func (StatisticOverviewSearchParams) MarshalJSON

func (r StatisticOverviewSearchParams) MarshalJSON() (data []byte, err error)

type StatisticOverviewSearchResponse

type StatisticOverviewSearchResponse struct {
	Code    int64                                    `json:"code,required"`
	Data    StatisticOverviewSearchResponseDataUnion `json:"data,required,nullable"`
	Msg     string                                   `json:"msg,required"`
	TraceID string                                   `json:"trace_id"`
	JSON    statisticOverviewSearchResponseJSON      `json:"-"`
}

func (*StatisticOverviewSearchResponse) UnmarshalJSON

func (r *StatisticOverviewSearchResponse) UnmarshalJSON(data []byte) (err error)

type StatisticOverviewSearchResponseData

type StatisticOverviewSearchResponseData []interface{}

func (StatisticOverviewSearchResponseData) ImplementsStatisticOverviewSearchResponseDataUnion

func (r StatisticOverviewSearchResponseData) ImplementsStatisticOverviewSearchResponseDataUnion()

type StatisticOverviewSearchResponseDataUnion

type StatisticOverviewSearchResponseDataUnion interface {
	ImplementsStatisticOverviewSearchResponseDataUnion()
}

Union satisfied by shared.UnionString, shared.UnionBool, StatisticOverviewSearchResponseData, StatisticOverviewSearchResponseData or shared.UnionFloat.

type StatisticService

type StatisticService struct {
	Options []option.RequestOption
}

StatisticService contains methods and other services that help with interacting with the tcgwiki API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStatisticService method instead.

func NewStatisticService

func NewStatisticService(opts ...option.RequestOption) (r *StatisticService)

NewStatisticService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*StatisticService) Overview

看板统计信息查询

func (*StatisticService) OverviewSearch

看板统计信息查询

type SystemConfigDeleteParams

type SystemConfigDeleteParams struct {
	Key      param.Field[string] `json:"key,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (SystemConfigDeleteParams) MarshalJSON

func (r SystemConfigDeleteParams) MarshalJSON() (data []byte, err error)

type SystemConfigDeleteResponse

type SystemConfigDeleteResponse struct {
	Code    int64                          `json:"code,required"`
	Data    interface{}                    `json:"data,required,nullable"`
	Msg     string                         `json:"msg,required"`
	TraceID string                         `json:"trace_id,required"`
	JSON    systemConfigDeleteResponseJSON `json:"-"`
}

func (*SystemConfigDeleteResponse) UnmarshalJSON

func (r *SystemConfigDeleteResponse) UnmarshalJSON(data []byte) (err error)

type SystemConfigGetParams

type SystemConfigGetParams struct {
	Key      param.Field[string] `query:"key,required"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (SystemConfigGetParams) URLQuery

func (r SystemConfigGetParams) URLQuery() (v url.Values)

URLQuery serializes SystemConfigGetParams's query parameters as `url.Values`.

type SystemConfigGetResponse

type SystemConfigGetResponse struct {
	Code    int64                       `json:"code,required"`
	Data    SystemConfigGetResponseData `json:"data,required"`
	Msg     string                      `json:"msg,required"`
	TraceID string                      `json:"trace_id,required"`
	JSON    systemConfigGetResponseJSON `json:"-"`
}

func (*SystemConfigGetResponse) UnmarshalJSON

func (r *SystemConfigGetResponse) UnmarshalJSON(data []byte) (err error)

type SystemConfigGetResponseData

type SystemConfigGetResponseData struct {
	Key         string                                `json:"key,required"`
	Value       SystemConfigGetResponseDataValueUnion `json:"value,required,nullable"`
	CreatedAt   time.Time                             `json:"created_at" format:"date-time"`
	DeletedAt   time.Time                             `json:"deleted_at,nullable" format:"date-time"`
	Description string                                `json:"description"`
	UpdatedAt   time.Time                             `json:"updated_at" format:"date-time"`
	JSON        systemConfigGetResponseDataJSON       `json:"-"`
}

func (*SystemConfigGetResponseData) UnmarshalJSON

func (r *SystemConfigGetResponseData) UnmarshalJSON(data []byte) (err error)

type SystemConfigGetResponseDataValueArray

type SystemConfigGetResponseDataValueArray []interface{}

func (SystemConfigGetResponseDataValueArray) ImplementsSystemConfigGetResponseDataValueUnion

func (r SystemConfigGetResponseDataValueArray) ImplementsSystemConfigGetResponseDataValueUnion()

type SystemConfigGetResponseDataValueMap

type SystemConfigGetResponseDataValueMap map[string]interface{}

func (SystemConfigGetResponseDataValueMap) ImplementsSystemConfigGetResponseDataValueUnion

func (r SystemConfigGetResponseDataValueMap) ImplementsSystemConfigGetResponseDataValueUnion()

type SystemConfigGetResponseDataValueUnion

type SystemConfigGetResponseDataValueUnion interface {
	ImplementsSystemConfigGetResponseDataValueUnion()
}

Union satisfied by shared.UnionString, shared.UnionBool, SystemConfigGetResponseDataValueArray, SystemConfigGetResponseDataValueMap or shared.UnionFloat.

type SystemConfigListParams

type SystemConfigListParams struct {
	// 默认 1
	Page param.Field[int64] `query:"page"`
	// 默认 50
	PageSize param.Field[int64] `query:"page_size"`
	SkipAuth param.Field[bool]  `header:"Skip-Auth"`
}

func (SystemConfigListParams) URLQuery

func (r SystemConfigListParams) URLQuery() (v url.Values)

URLQuery serializes SystemConfigListParams's query parameters as `url.Values`.

type SystemConfigListResponse

type SystemConfigListResponse struct {
	Key         string                             `json:"key,required"`
	Value       SystemConfigListResponseValueUnion `json:"value,required,nullable"`
	CreatedAt   time.Time                          `json:"created_at" format:"date-time"`
	DeletedAt   time.Time                          `json:"deleted_at,nullable" format:"date-time"`
	Description string                             `json:"description"`
	UpdatedAt   time.Time                          `json:"updated_at" format:"date-time"`
	JSON        systemConfigListResponseJSON       `json:"-"`
}

func (*SystemConfigListResponse) UnmarshalJSON

func (r *SystemConfigListResponse) UnmarshalJSON(data []byte) (err error)

type SystemConfigListResponseValueArray

type SystemConfigListResponseValueArray []interface{}

func (SystemConfigListResponseValueArray) ImplementsSystemConfigListResponseValueUnion

func (r SystemConfigListResponseValueArray) ImplementsSystemConfigListResponseValueUnion()

type SystemConfigListResponseValueMap

type SystemConfigListResponseValueMap map[string]interface{}

func (SystemConfigListResponseValueMap) ImplementsSystemConfigListResponseValueUnion

func (r SystemConfigListResponseValueMap) ImplementsSystemConfigListResponseValueUnion()

type SystemConfigListResponseValueUnion

type SystemConfigListResponseValueUnion interface {
	ImplementsSystemConfigListResponseValueUnion()
}

Union satisfied by shared.UnionString, shared.UnionBool, SystemConfigListResponseValueArray, SystemConfigListResponseValueMap or shared.UnionFloat.

type SystemConfigNewParams

type SystemConfigNewParams struct {
	Key         param.Field[string]                          `json:"key,required"`
	Value       param.Field[SystemConfigNewParamsValueUnion] `json:"value,required"`
	Description param.Field[string]                          `json:"description"`
	SkipAuth    param.Field[bool]                            `header:"Skip-Auth"`
}

func (SystemConfigNewParams) MarshalJSON

func (r SystemConfigNewParams) MarshalJSON() (data []byte, err error)

type SystemConfigNewParamsValueArray

type SystemConfigNewParamsValueArray []interface{}

func (SystemConfigNewParamsValueArray) ImplementsSystemConfigNewParamsValueUnion

func (r SystemConfigNewParamsValueArray) ImplementsSystemConfigNewParamsValueUnion()

type SystemConfigNewParamsValueMap

type SystemConfigNewParamsValueMap map[string]interface{}

func (SystemConfigNewParamsValueMap) ImplementsSystemConfigNewParamsValueUnion

func (r SystemConfigNewParamsValueMap) ImplementsSystemConfigNewParamsValueUnion()

type SystemConfigNewParamsValueUnion

type SystemConfigNewParamsValueUnion interface {
	ImplementsSystemConfigNewParamsValueUnion()
}

Satisfied by shared.UnionString, shared.UnionBool, SystemConfigNewParamsValueArray, SystemConfigNewParamsValueMap, shared.UnionFloat.

type SystemConfigNewResponse

type SystemConfigNewResponse struct {
	Code    int64                       `json:"code,required"`
	Data    interface{}                 `json:"data,required,nullable"`
	Msg     string                      `json:"msg,required"`
	TraceID string                      `json:"trace_id,required"`
	JSON    systemConfigNewResponseJSON `json:"-"`
}

func (*SystemConfigNewResponse) UnmarshalJSON

func (r *SystemConfigNewResponse) UnmarshalJSON(data []byte) (err error)

type SystemConfigService

type SystemConfigService struct {
	Options []option.RequestOption
}

SystemConfigService contains methods and other services that help with interacting with the tcgwiki API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSystemConfigService method instead.

func NewSystemConfigService

func NewSystemConfigService(opts ...option.RequestOption) (r *SystemConfigService)

NewSystemConfigService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SystemConfigService) Delete

删除系统配置

func (*SystemConfigService) Get

获取系统配置

func (*SystemConfigService) List

系统配置列表

func (*SystemConfigService) ListAutoPaging

系统配置列表

func (*SystemConfigService) New

创建系统配置

func (*SystemConfigService) Update

更新系统配置

type SystemConfigUpdateParams

type SystemConfigUpdateParams struct {
	Key         param.Field[string]                             `json:"key,required"`
	Value       param.Field[SystemConfigUpdateParamsValueUnion] `json:"value,required"`
	Description param.Field[string]                             `json:"description"`
	SkipAuth    param.Field[bool]                               `header:"Skip-Auth"`
}

func (SystemConfigUpdateParams) MarshalJSON

func (r SystemConfigUpdateParams) MarshalJSON() (data []byte, err error)

type SystemConfigUpdateParamsValueArray

type SystemConfigUpdateParamsValueArray []interface{}

func (SystemConfigUpdateParamsValueArray) ImplementsSystemConfigUpdateParamsValueUnion

func (r SystemConfigUpdateParamsValueArray) ImplementsSystemConfigUpdateParamsValueUnion()

type SystemConfigUpdateParamsValueMap

type SystemConfigUpdateParamsValueMap map[string]interface{}

func (SystemConfigUpdateParamsValueMap) ImplementsSystemConfigUpdateParamsValueUnion

func (r SystemConfigUpdateParamsValueMap) ImplementsSystemConfigUpdateParamsValueUnion()

type SystemConfigUpdateParamsValueUnion

type SystemConfigUpdateParamsValueUnion interface {
	ImplementsSystemConfigUpdateParamsValueUnion()
}

Satisfied by shared.UnionString, shared.UnionBool, SystemConfigUpdateParamsValueArray, SystemConfigUpdateParamsValueMap, shared.UnionFloat.

type SystemConfigUpdateResponse

type SystemConfigUpdateResponse struct {
	Code    int64                          `json:"code,required"`
	Data    interface{}                    `json:"data,required,nullable"`
	Msg     string                         `json:"msg,required"`
	TraceID string                         `json:"trace_id,required"`
	JSON    systemConfigUpdateResponseJSON `json:"-"`
}

func (*SystemConfigUpdateResponse) UnmarshalJSON

func (r *SystemConfigUpdateResponse) UnmarshalJSON(data []byte) (err error)

type SystemConstantsParams

type SystemConstantsParams struct {
	SkipAuth param.Field[bool] `header:"Skip-Auth"`
}

type SystemConstantsResponse

type SystemConstantsResponse struct {
	Code    int64                       `json:"code,required"`
	Data    SystemConstantsResponseData `json:"data,required"`
	Msg     string                      `json:"msg,required"`
	TraceID string                      `json:"trace_id,required"`
	JSON    systemConstantsResponseJSON `json:"-"`
}

func (*SystemConstantsResponse) UnmarshalJSON

func (r *SystemConstantsResponse) UnmarshalJSON(data []byte) (err error)

type SystemConstantsResponseData

type SystemConstantsResponseData struct {
	Games     []SystemConstantsResponseDataGame     `json:"games,required"`
	Languages []SystemConstantsResponseDataLanguage `json:"languages,required"`
	Regions   []SystemConstantsResponseDataRegion   `json:"regions,required"`
	JSON      systemConstantsResponseDataJSON       `json:"-"`
}

func (*SystemConstantsResponseData) UnmarshalJSON

func (r *SystemConstantsResponseData) UnmarshalJSON(data []byte) (err error)

type SystemConstantsResponseDataGame

type SystemConstantsResponseDataGame struct {
	GameKey string                              `json:"game_key,required"`
	Name    string                              `json:"name,required"`
	JSON    systemConstantsResponseDataGameJSON `json:"-"`
}

func (*SystemConstantsResponseDataGame) UnmarshalJSON

func (r *SystemConstantsResponseDataGame) UnmarshalJSON(data []byte) (err error)

type SystemConstantsResponseDataLanguage

type SystemConstantsResponseDataLanguage struct {
	Language string                                  `json:"language,required"`
	Name     string                                  `json:"name,required"`
	JSON     systemConstantsResponseDataLanguageJSON `json:"-"`
}

func (*SystemConstantsResponseDataLanguage) UnmarshalJSON

func (r *SystemConstantsResponseDataLanguage) UnmarshalJSON(data []byte) (err error)

type SystemConstantsResponseDataRegion

type SystemConstantsResponseDataRegion struct {
	Code []string                              `json:"code,required"`
	Name string                                `json:"name,required"`
	JSON systemConstantsResponseDataRegionJSON `json:"-"`
}

func (*SystemConstantsResponseDataRegion) UnmarshalJSON

func (r *SystemConstantsResponseDataRegion) UnmarshalJSON(data []byte) (err error)

type SystemService

type SystemService struct {
	Options []option.RequestOption
	Config  *SystemConfigService
}

SystemService contains methods and other services that help with interacting with the tcgwiki API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSystemService method instead.

func NewSystemService

func NewSystemService(opts ...option.RequestOption) (r *SystemService)

NewSystemService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SystemService) Constants

获取常量枚举定义

type TempCardSKURelation

type TempCardSKURelation struct {
	CardID         int64                         `json:"card_id,required"`
	CardVersionID  int64                         `json:"card_version_id,required"`
	Extra          TempCardSKURelationExtraUnion `json:"extra,required,nullable"`
	GameKey        string                        `json:"game_key,required"`
	Kind           string                        `json:"kind,required"`
	OriginalCardID int64                         `json:"original_card_id,required"`
	SKUUuid        string                        `json:"sku_uuid,required" format:"uuid"`
	SpuUuid        string                        `json:"spu_uuid,required" format:"uuid"`
	JSON           tempCardSKURelationJSON       `json:"-"`
}

func (*TempCardSKURelation) UnmarshalJSON

func (r *TempCardSKURelation) UnmarshalJSON(data []byte) (err error)

type TempCardSKURelationExtraArray

type TempCardSKURelationExtraArray []interface{}

func (TempCardSKURelationExtraArray) ImplementsTempCardSKURelationExtraUnion

func (r TempCardSKURelationExtraArray) ImplementsTempCardSKURelationExtraUnion()

type TempCardSKURelationExtraMap

type TempCardSKURelationExtraMap map[string]interface{}

func (TempCardSKURelationExtraMap) ImplementsTempCardSKURelationExtraUnion

func (r TempCardSKURelationExtraMap) ImplementsTempCardSKURelationExtraUnion()

type TempCardSKURelationExtraUnion

type TempCardSKURelationExtraUnion interface {
	ImplementsTempCardSKURelationExtraUnion()
}

Union satisfied by shared.UnionString, shared.UnionBool, TempCardSKURelationExtraArray, TempCardSKURelationExtraMap or shared.UnionFloat.

type TempPackCollectionRelation

type TempPackCollectionRelation struct {
	CollectionUuid string                         `json:"collection_uuid,required"`
	GameKey        string                         `json:"game_key,required"`
	Language       string                         `json:"language,required"`
	PackID         int64                          `json:"pack_id,required"`
	JSON           tempPackCollectionRelationJSON `json:"-"`
}

func (*TempPackCollectionRelation) UnmarshalJSON

func (r *TempPackCollectionRelation) UnmarshalJSON(data []byte) (err error)

type UploadPresignedURLParams

type UploadPresignedURLParams struct {
	// 游戏简写,目前仅用于兼容老的数据结构
	GameKey   param.Field[string] `json:"game_key,required"`
	TargetKey param.Field[string] `json:"target_key,required"`
	FileHash  param.Field[string] `json:"file_hash"`
	// 单位(字节)
	FileSize param.Field[int64] `json:"file_size"`
	// 空时服务端生成,推荐客户端处理
	Filename param.Field[string] `json:"filename"`
	SkipAuth param.Field[bool]   `header:"Skip-Auth"`
}

func (UploadPresignedURLParams) MarshalJSON

func (r UploadPresignedURLParams) MarshalJSON() (data []byte, err error)

type UploadPresignedURLResponse

type UploadPresignedURLResponse struct {
	Code    int64                          `json:"code,required"`
	Data    UploadPresignedURLResponseData `json:"data,required"`
	Msg     string                         `json:"msg,required"`
	TraceID string                         `json:"trace_id,required"`
	JSON    uploadPresignedURLResponseJSON `json:"-"`
}

func (*UploadPresignedURLResponse) UnmarshalJSON

func (r *UploadPresignedURLResponse) UnmarshalJSON(data []byte) (err error)

type UploadPresignedURLResponseData

type UploadPresignedURLResponseData struct {
	CdnURL     string                                     `json:"cdn_url,required"`
	Driver     UploadPresignedURLResponseDataDriver       `json:"driver,required"`
	FileID     string                                     `json:"file_id,required" format:"uuid"`
	Payload    UploadPresignedURLResponseDataPayloadUnion `json:"payload,required,nullable"`
	PreviewURL string                                     `json:"preview_url,required"`
	TargetURL  string                                     `json:"target_url,required"`
	// 兼容老的上传路径
	LegacyFilename string                             `json:"legacy_filename"`
	JSON           uploadPresignedURLResponseDataJSON `json:"-"`
}

func (*UploadPresignedURLResponseData) UnmarshalJSON

func (r *UploadPresignedURLResponseData) UnmarshalJSON(data []byte) (err error)

type UploadPresignedURLResponseDataDriver

type UploadPresignedURLResponseDataDriver string
const (
	UploadPresignedURLResponseDataDriverR2  UploadPresignedURLResponseDataDriver = "r2"
	UploadPresignedURLResponseDataDriverTos UploadPresignedURLResponseDataDriver = "tos"
	UploadPresignedURLResponseDataDriverS3  UploadPresignedURLResponseDataDriver = "s3"
)

func (UploadPresignedURLResponseDataDriver) IsKnown

type UploadPresignedURLResponseDataPayload

type UploadPresignedURLResponseDataPayload []interface{}

func (UploadPresignedURLResponseDataPayload) ImplementsUploadPresignedURLResponseDataPayloadUnion

func (r UploadPresignedURLResponseDataPayload) ImplementsUploadPresignedURLResponseDataPayloadUnion()

type UploadPresignedURLResponseDataPayloadUnion

type UploadPresignedURLResponseDataPayloadUnion interface {
	ImplementsUploadPresignedURLResponseDataPayloadUnion()
}

Union satisfied by shared.UnionString, shared.UnionBool, UploadPresignedURLResponseDataPayload, UploadPresignedURLResponseDataPayload or shared.UnionFloat.

type UploadService

type UploadService struct {
	Options []option.RequestOption
}

UploadService contains methods and other services that help with interacting with the tcgwiki API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUploadService method instead.

func NewUploadService

func NewUploadService(opts ...option.RequestOption) (r *UploadService)

NewUploadService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

Directories

Path Synopsis
packages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL