3176 lines
100 KiB
Go
3176 lines
100 KiB
Go
// Package client provides primitives to interact with the openapi HTTP API.
|
|
//
|
|
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
|
|
package client
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"fmt"
|
|
"io"
|
|
"net/http"
|
|
"net/url"
|
|
"strings"
|
|
"time"
|
|
|
|
"github.com/oapi-codegen/runtime"
|
|
)
|
|
|
|
const (
|
|
CookieAuthScopes = "cookieAuth.Scopes"
|
|
)
|
|
|
|
// Defines values for GetAccountFavoritesParamsType.
|
|
const (
|
|
Artist GetAccountFavoritesParamsType = "artist"
|
|
Post GetAccountFavoritesParamsType = "post"
|
|
)
|
|
|
|
// GetAccountFavoritesParams defines parameters for GetAccountFavorites.
|
|
type GetAccountFavoritesParams struct {
|
|
// Type Type of favorites to list (post or creator (artist) )
|
|
Type *GetAccountFavoritesParamsType `form:"type,omitempty" json:"type,omitempty"`
|
|
}
|
|
|
|
// GetAccountFavoritesParamsType defines parameters for GetAccountFavorites.
|
|
type GetAccountFavoritesParamsType string
|
|
|
|
// GetDiscordChannelChannelIdParams defines parameters for GetDiscordChannelChannelId.
|
|
type GetDiscordChannelChannelIdParams struct {
|
|
// O Result offset, stepping of 150 is enforced
|
|
O *int `form:"o,omitempty" json:"o,omitempty"`
|
|
}
|
|
|
|
// GetPostsParams defines parameters for GetPosts.
|
|
type GetPostsParams struct {
|
|
// Q Search query
|
|
Q *string `form:"q,omitempty" json:"q,omitempty"`
|
|
|
|
// O Result offset, stepping of 50 is enforced
|
|
O *int `form:"o,omitempty" json:"o,omitempty"`
|
|
}
|
|
|
|
// GetServiceUserCreatorIdParams defines parameters for GetServiceUserCreatorId.
|
|
type GetServiceUserCreatorIdParams struct {
|
|
// Q Search query
|
|
Q *string `form:"q,omitempty" json:"q,omitempty"`
|
|
|
|
// O Result offset, stepping of 50 is enforced
|
|
O *int `form:"o,omitempty" json:"o,omitempty"`
|
|
}
|
|
|
|
// RequestEditorFn is the function signature for the RequestEditor callback function
|
|
type RequestEditorFn func(ctx context.Context, req *http.Request) error
|
|
|
|
// Doer performs HTTP requests.
|
|
//
|
|
// The standard http.Client implements this interface.
|
|
type HttpRequestDoer interface {
|
|
Do(req *http.Request) (*http.Response, error)
|
|
}
|
|
|
|
// Client which conforms to the OpenAPI3 specification for this service.
|
|
type Client struct {
|
|
// The endpoint of the server conforming to this interface, with scheme,
|
|
// https://api.deepmap.com for example. This can contain a path relative
|
|
// to the server, such as https://api.deepmap.com/dev-test, and all the
|
|
// paths in the swagger spec will be appended to the server.
|
|
Server string
|
|
|
|
// Doer for performing requests, typically a *http.Client with any
|
|
// customized settings, such as certificate chains.
|
|
Client HttpRequestDoer
|
|
|
|
// A list of callbacks for modifying requests which are generated before sending over
|
|
// the network.
|
|
RequestEditors []RequestEditorFn
|
|
}
|
|
|
|
// ClientOption allows setting custom parameters during construction
|
|
type ClientOption func(*Client) error
|
|
|
|
// Creates a new Client, with reasonable defaults
|
|
func NewClient(server string, opts ...ClientOption) (*Client, error) {
|
|
// create a client with sane default values
|
|
client := Client{
|
|
Server: server,
|
|
}
|
|
// mutate client and add all optional params
|
|
for _, o := range opts {
|
|
if err := o(&client); err != nil {
|
|
return nil, err
|
|
}
|
|
}
|
|
// ensure the server URL always has a trailing slash
|
|
if !strings.HasSuffix(client.Server, "/") {
|
|
client.Server += "/"
|
|
}
|
|
// create httpClient, if not already present
|
|
if client.Client == nil {
|
|
client.Client = &http.Client{}
|
|
}
|
|
return &client, nil
|
|
}
|
|
|
|
// WithHTTPClient allows overriding the default Doer, which is
|
|
// automatically created using http.Client. This is useful for tests.
|
|
func WithHTTPClient(doer HttpRequestDoer) ClientOption {
|
|
return func(c *Client) error {
|
|
c.Client = doer
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// WithRequestEditorFn allows setting up a callback function, which will be
|
|
// called right before sending the request. This can be used to mutate the request.
|
|
func WithRequestEditorFn(fn RequestEditorFn) ClientOption {
|
|
return func(c *Client) error {
|
|
c.RequestEditors = append(c.RequestEditors, fn)
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// The interface specification for the client above.
|
|
type ClientInterface interface {
|
|
// GetAccountFavorites request
|
|
GetAccountFavorites(ctx context.Context, params *GetAccountFavoritesParams, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetAppVersion request
|
|
GetAppVersion(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetCreatorsTxt request
|
|
GetCreatorsTxt(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetDiscordChannelLookupDiscordServer request
|
|
GetDiscordChannelLookupDiscordServer(ctx context.Context, discordServer string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetDiscordChannelChannelId request
|
|
GetDiscordChannelChannelId(ctx context.Context, channelId string, params *GetDiscordChannelChannelIdParams, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// DeleteFavoritesCreatorServiceCreatorId request
|
|
DeleteFavoritesCreatorServiceCreatorId(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// PostFavoritesCreatorServiceCreatorId request
|
|
PostFavoritesCreatorServiceCreatorId(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// DeleteFavoritesPostServiceCreatorIdPostId request
|
|
DeleteFavoritesPostServiceCreatorIdPostId(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// PostFavoritesPostServiceCreatorIdPostId request
|
|
PostFavoritesPostServiceCreatorIdPostId(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetPosts request
|
|
GetPosts(ctx context.Context, params *GetPostsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetSearchHashFileHash request
|
|
GetSearchHashFileHash(ctx context.Context, fileHash string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetServiceUserCreatorId request
|
|
GetServiceUserCreatorId(ctx context.Context, service string, creatorId string, params *GetServiceUserCreatorIdParams, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetServiceUserCreatorIdAnnouncements request
|
|
GetServiceUserCreatorIdAnnouncements(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetServiceUserCreatorIdFancards request
|
|
GetServiceUserCreatorIdFancards(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetServiceUserCreatorIdLinks request
|
|
GetServiceUserCreatorIdLinks(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetServiceUserCreatorIdPostPostId request
|
|
GetServiceUserCreatorIdPostPostId(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetServiceUserCreatorIdPostPostIdComments request
|
|
GetServiceUserCreatorIdPostPostIdComments(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetServiceUserCreatorIdPostPostIdRevisions request
|
|
GetServiceUserCreatorIdPostPostIdRevisions(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetServiceUserCreatorIdPostPostFlag request
|
|
GetServiceUserCreatorIdPostPostFlag(ctx context.Context, service string, creatorId string, post string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// PostServiceUserCreatorIdPostPostFlag request
|
|
PostServiceUserCreatorIdPostPostFlag(ctx context.Context, service string, creatorId string, post string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
|
|
// GetServiceUserCreatorIdProfile request
|
|
GetServiceUserCreatorIdProfile(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*http.Response, error)
|
|
}
|
|
|
|
func (c *Client) GetAccountFavorites(ctx context.Context, params *GetAccountFavoritesParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetAccountFavoritesRequest(c.Server, params)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetAppVersion(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetAppVersionRequest(c.Server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetCreatorsTxt(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetCreatorsTxtRequest(c.Server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetDiscordChannelLookupDiscordServer(ctx context.Context, discordServer string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetDiscordChannelLookupDiscordServerRequest(c.Server, discordServer)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetDiscordChannelChannelId(ctx context.Context, channelId string, params *GetDiscordChannelChannelIdParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetDiscordChannelChannelIdRequest(c.Server, channelId, params)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) DeleteFavoritesCreatorServiceCreatorId(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewDeleteFavoritesCreatorServiceCreatorIdRequest(c.Server, service, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) PostFavoritesCreatorServiceCreatorId(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPostFavoritesCreatorServiceCreatorIdRequest(c.Server, service, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) DeleteFavoritesPostServiceCreatorIdPostId(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewDeleteFavoritesPostServiceCreatorIdPostIdRequest(c.Server, service, creatorId, postId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) PostFavoritesPostServiceCreatorIdPostId(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPostFavoritesPostServiceCreatorIdPostIdRequest(c.Server, service, creatorId, postId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetPosts(ctx context.Context, params *GetPostsParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetPostsRequest(c.Server, params)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetSearchHashFileHash(ctx context.Context, fileHash string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetSearchHashFileHashRequest(c.Server, fileHash)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetServiceUserCreatorId(ctx context.Context, service string, creatorId string, params *GetServiceUserCreatorIdParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetServiceUserCreatorIdRequest(c.Server, service, creatorId, params)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetServiceUserCreatorIdAnnouncements(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetServiceUserCreatorIdAnnouncementsRequest(c.Server, service, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetServiceUserCreatorIdFancards(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetServiceUserCreatorIdFancardsRequest(c.Server, service, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetServiceUserCreatorIdLinks(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetServiceUserCreatorIdLinksRequest(c.Server, service, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetServiceUserCreatorIdPostPostId(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetServiceUserCreatorIdPostPostIdRequest(c.Server, service, creatorId, postId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetServiceUserCreatorIdPostPostIdComments(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetServiceUserCreatorIdPostPostIdCommentsRequest(c.Server, service, creatorId, postId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetServiceUserCreatorIdPostPostIdRevisions(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetServiceUserCreatorIdPostPostIdRevisionsRequest(c.Server, service, creatorId, postId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetServiceUserCreatorIdPostPostFlag(ctx context.Context, service string, creatorId string, post string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetServiceUserCreatorIdPostPostFlagRequest(c.Server, service, creatorId, post)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) PostServiceUserCreatorIdPostPostFlag(ctx context.Context, service string, creatorId string, post string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewPostServiceUserCreatorIdPostPostFlagRequest(c.Server, service, creatorId, post)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
func (c *Client) GetServiceUserCreatorIdProfile(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
|
|
req, err := NewGetServiceUserCreatorIdProfileRequest(c.Server, service, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
req = req.WithContext(ctx)
|
|
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
|
|
return nil, err
|
|
}
|
|
return c.Client.Do(req)
|
|
}
|
|
|
|
// NewGetAccountFavoritesRequest generates requests for GetAccountFavorites
|
|
func NewGetAccountFavoritesRequest(server string, params *GetAccountFavoritesParams) (*http.Request, error) {
|
|
var err error
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/account/favorites")
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if params != nil {
|
|
queryValues := queryURL.Query()
|
|
|
|
if params.Type != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "type", runtime.ParamLocationQuery, *params.Type); err != nil {
|
|
return nil, err
|
|
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
|
|
return nil, err
|
|
} else {
|
|
for k, v := range parsed {
|
|
for _, v2 := range v {
|
|
queryValues.Add(k, v2)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
queryURL.RawQuery = queryValues.Encode()
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetAppVersionRequest generates requests for GetAppVersion
|
|
func NewGetAppVersionRequest(server string) (*http.Request, error) {
|
|
var err error
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/app_version")
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetCreatorsTxtRequest generates requests for GetCreatorsTxt
|
|
func NewGetCreatorsTxtRequest(server string) (*http.Request, error) {
|
|
var err error
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/creators.txt")
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetDiscordChannelLookupDiscordServerRequest generates requests for GetDiscordChannelLookupDiscordServer
|
|
func NewGetDiscordChannelLookupDiscordServerRequest(server string, discordServer string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "discord_server", runtime.ParamLocationPath, discordServer)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/discord/channel/lookup/%s", pathParam0)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetDiscordChannelChannelIdRequest generates requests for GetDiscordChannelChannelId
|
|
func NewGetDiscordChannelChannelIdRequest(server string, channelId string, params *GetDiscordChannelChannelIdParams) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "channel_id", runtime.ParamLocationPath, channelId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/discord/channel/%s", pathParam0)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if params != nil {
|
|
queryValues := queryURL.Query()
|
|
|
|
if params.O != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "o", runtime.ParamLocationQuery, *params.O); err != nil {
|
|
return nil, err
|
|
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
|
|
return nil, err
|
|
} else {
|
|
for k, v := range parsed {
|
|
for _, v2 := range v {
|
|
queryValues.Add(k, v2)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
queryURL.RawQuery = queryValues.Encode()
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewDeleteFavoritesCreatorServiceCreatorIdRequest generates requests for DeleteFavoritesCreatorServiceCreatorId
|
|
func NewDeleteFavoritesCreatorServiceCreatorIdRequest(server string, service string, creatorId string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/favorites/creator/%s/%s", pathParam0, pathParam1)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("DELETE", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewPostFavoritesCreatorServiceCreatorIdRequest generates requests for PostFavoritesCreatorServiceCreatorId
|
|
func NewPostFavoritesCreatorServiceCreatorIdRequest(server string, service string, creatorId string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/favorites/creator/%s/%s", pathParam0, pathParam1)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("POST", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewDeleteFavoritesPostServiceCreatorIdPostIdRequest generates requests for DeleteFavoritesPostServiceCreatorIdPostId
|
|
func NewDeleteFavoritesPostServiceCreatorIdPostIdRequest(server string, service string, creatorId string, postId string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam2 string
|
|
|
|
pathParam2, err = runtime.StyleParamWithLocation("simple", false, "post_id", runtime.ParamLocationPath, postId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/favorites/post/%s/%s/%s", pathParam0, pathParam1, pathParam2)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("DELETE", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewPostFavoritesPostServiceCreatorIdPostIdRequest generates requests for PostFavoritesPostServiceCreatorIdPostId
|
|
func NewPostFavoritesPostServiceCreatorIdPostIdRequest(server string, service string, creatorId string, postId string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam2 string
|
|
|
|
pathParam2, err = runtime.StyleParamWithLocation("simple", false, "post_id", runtime.ParamLocationPath, postId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/favorites/post/%s/%s/%s", pathParam0, pathParam1, pathParam2)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("POST", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetPostsRequest generates requests for GetPosts
|
|
func NewGetPostsRequest(server string, params *GetPostsParams) (*http.Request, error) {
|
|
var err error
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/posts")
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if params != nil {
|
|
queryValues := queryURL.Query()
|
|
|
|
if params.Q != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "q", runtime.ParamLocationQuery, *params.Q); err != nil {
|
|
return nil, err
|
|
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
|
|
return nil, err
|
|
} else {
|
|
for k, v := range parsed {
|
|
for _, v2 := range v {
|
|
queryValues.Add(k, v2)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.O != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "o", runtime.ParamLocationQuery, *params.O); err != nil {
|
|
return nil, err
|
|
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
|
|
return nil, err
|
|
} else {
|
|
for k, v := range parsed {
|
|
for _, v2 := range v {
|
|
queryValues.Add(k, v2)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
queryURL.RawQuery = queryValues.Encode()
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetSearchHashFileHashRequest generates requests for GetSearchHashFileHash
|
|
func NewGetSearchHashFileHashRequest(server string, fileHash string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "file_hash", runtime.ParamLocationPath, fileHash)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/search_hash/%s", pathParam0)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetServiceUserCreatorIdRequest generates requests for GetServiceUserCreatorId
|
|
func NewGetServiceUserCreatorIdRequest(server string, service string, creatorId string, params *GetServiceUserCreatorIdParams) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/%s/user/%s", pathParam0, pathParam1)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if params != nil {
|
|
queryValues := queryURL.Query()
|
|
|
|
if params.Q != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "q", runtime.ParamLocationQuery, *params.Q); err != nil {
|
|
return nil, err
|
|
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
|
|
return nil, err
|
|
} else {
|
|
for k, v := range parsed {
|
|
for _, v2 := range v {
|
|
queryValues.Add(k, v2)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
if params.O != nil {
|
|
|
|
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "o", runtime.ParamLocationQuery, *params.O); err != nil {
|
|
return nil, err
|
|
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
|
|
return nil, err
|
|
} else {
|
|
for k, v := range parsed {
|
|
for _, v2 := range v {
|
|
queryValues.Add(k, v2)
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
queryURL.RawQuery = queryValues.Encode()
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetServiceUserCreatorIdAnnouncementsRequest generates requests for GetServiceUserCreatorIdAnnouncements
|
|
func NewGetServiceUserCreatorIdAnnouncementsRequest(server string, service string, creatorId string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/%s/user/%s/announcements", pathParam0, pathParam1)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetServiceUserCreatorIdFancardsRequest generates requests for GetServiceUserCreatorIdFancards
|
|
func NewGetServiceUserCreatorIdFancardsRequest(server string, service string, creatorId string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/%s/user/%s/fancards", pathParam0, pathParam1)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetServiceUserCreatorIdLinksRequest generates requests for GetServiceUserCreatorIdLinks
|
|
func NewGetServiceUserCreatorIdLinksRequest(server string, service string, creatorId string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/%s/user/%s/links", pathParam0, pathParam1)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetServiceUserCreatorIdPostPostIdRequest generates requests for GetServiceUserCreatorIdPostPostId
|
|
func NewGetServiceUserCreatorIdPostPostIdRequest(server string, service string, creatorId string, postId string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam2 string
|
|
|
|
pathParam2, err = runtime.StyleParamWithLocation("simple", false, "post_id", runtime.ParamLocationPath, postId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/%s/user/%s/post/%s", pathParam0, pathParam1, pathParam2)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetServiceUserCreatorIdPostPostIdCommentsRequest generates requests for GetServiceUserCreatorIdPostPostIdComments
|
|
func NewGetServiceUserCreatorIdPostPostIdCommentsRequest(server string, service string, creatorId string, postId string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam2 string
|
|
|
|
pathParam2, err = runtime.StyleParamWithLocation("simple", false, "post_id", runtime.ParamLocationPath, postId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/%s/user/%s/post/%s/comments", pathParam0, pathParam1, pathParam2)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetServiceUserCreatorIdPostPostIdRevisionsRequest generates requests for GetServiceUserCreatorIdPostPostIdRevisions
|
|
func NewGetServiceUserCreatorIdPostPostIdRevisionsRequest(server string, service string, creatorId string, postId string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam2 string
|
|
|
|
pathParam2, err = runtime.StyleParamWithLocation("simple", false, "post_id", runtime.ParamLocationPath, postId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/%s/user/%s/post/%s/revisions", pathParam0, pathParam1, pathParam2)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetServiceUserCreatorIdPostPostFlagRequest generates requests for GetServiceUserCreatorIdPostPostFlag
|
|
func NewGetServiceUserCreatorIdPostPostFlagRequest(server string, service string, creatorId string, post string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam2 string
|
|
|
|
pathParam2, err = runtime.StyleParamWithLocation("simple", false, "post", runtime.ParamLocationPath, post)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/%s/user/%s/post/%s/flag", pathParam0, pathParam1, pathParam2)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewPostServiceUserCreatorIdPostPostFlagRequest generates requests for PostServiceUserCreatorIdPostPostFlag
|
|
func NewPostServiceUserCreatorIdPostPostFlagRequest(server string, service string, creatorId string, post string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam2 string
|
|
|
|
pathParam2, err = runtime.StyleParamWithLocation("simple", false, "post", runtime.ParamLocationPath, post)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/%s/user/%s/post/%s/flag", pathParam0, pathParam1, pathParam2)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("POST", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
// NewGetServiceUserCreatorIdProfileRequest generates requests for GetServiceUserCreatorIdProfile
|
|
func NewGetServiceUserCreatorIdProfileRequest(server string, service string, creatorId string) (*http.Request, error) {
|
|
var err error
|
|
|
|
var pathParam0 string
|
|
|
|
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "service", runtime.ParamLocationPath, service)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
var pathParam1 string
|
|
|
|
pathParam1, err = runtime.StyleParamWithLocation("simple", false, "creator_id", runtime.ParamLocationPath, creatorId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
serverURL, err := url.Parse(server)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
operationPath := fmt.Sprintf("/%s/user/%s/profile", pathParam0, pathParam1)
|
|
if operationPath[0] == '/' {
|
|
operationPath = "." + operationPath
|
|
}
|
|
|
|
queryURL, err := serverURL.Parse(operationPath)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
req, err := http.NewRequest("GET", queryURL.String(), nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return req, nil
|
|
}
|
|
|
|
func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error {
|
|
for _, r := range c.RequestEditors {
|
|
if err := r(ctx, req); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
for _, r := range additionalEditors {
|
|
if err := r(ctx, req); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// ClientWithResponses builds on ClientInterface to offer response payloads
|
|
type ClientWithResponses struct {
|
|
ClientInterface
|
|
}
|
|
|
|
// NewClientWithResponses creates a new ClientWithResponses, which wraps
|
|
// Client with return type handling
|
|
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) {
|
|
client, err := NewClient(server, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &ClientWithResponses{client}, nil
|
|
}
|
|
|
|
// WithBaseURL overrides the baseURL.
|
|
func WithBaseURL(baseURL string) ClientOption {
|
|
return func(c *Client) error {
|
|
newBaseURL, err := url.Parse(baseURL)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
c.Server = newBaseURL.String()
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// ClientWithResponsesInterface is the interface specification for the client with responses above.
|
|
type ClientWithResponsesInterface interface {
|
|
// GetAccountFavoritesWithResponse request
|
|
GetAccountFavoritesWithResponse(ctx context.Context, params *GetAccountFavoritesParams, reqEditors ...RequestEditorFn) (*GetAccountFavoritesResponse, error)
|
|
|
|
// GetAppVersionWithResponse request
|
|
GetAppVersionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAppVersionResponse, error)
|
|
|
|
// GetCreatorsTxtWithResponse request
|
|
GetCreatorsTxtWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCreatorsTxtResponse, error)
|
|
|
|
// GetDiscordChannelLookupDiscordServerWithResponse request
|
|
GetDiscordChannelLookupDiscordServerWithResponse(ctx context.Context, discordServer string, reqEditors ...RequestEditorFn) (*GetDiscordChannelLookupDiscordServerResponse, error)
|
|
|
|
// GetDiscordChannelChannelIdWithResponse request
|
|
GetDiscordChannelChannelIdWithResponse(ctx context.Context, channelId string, params *GetDiscordChannelChannelIdParams, reqEditors ...RequestEditorFn) (*GetDiscordChannelChannelIdResponse, error)
|
|
|
|
// DeleteFavoritesCreatorServiceCreatorIdWithResponse request
|
|
DeleteFavoritesCreatorServiceCreatorIdWithResponse(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*DeleteFavoritesCreatorServiceCreatorIdResponse, error)
|
|
|
|
// PostFavoritesCreatorServiceCreatorIdWithResponse request
|
|
PostFavoritesCreatorServiceCreatorIdWithResponse(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*PostFavoritesCreatorServiceCreatorIdResponse, error)
|
|
|
|
// DeleteFavoritesPostServiceCreatorIdPostIdWithResponse request
|
|
DeleteFavoritesPostServiceCreatorIdPostIdWithResponse(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*DeleteFavoritesPostServiceCreatorIdPostIdResponse, error)
|
|
|
|
// PostFavoritesPostServiceCreatorIdPostIdWithResponse request
|
|
PostFavoritesPostServiceCreatorIdPostIdWithResponse(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*PostFavoritesPostServiceCreatorIdPostIdResponse, error)
|
|
|
|
// GetPostsWithResponse request
|
|
GetPostsWithResponse(ctx context.Context, params *GetPostsParams, reqEditors ...RequestEditorFn) (*GetPostsResponse, error)
|
|
|
|
// GetSearchHashFileHashWithResponse request
|
|
GetSearchHashFileHashWithResponse(ctx context.Context, fileHash string, reqEditors ...RequestEditorFn) (*GetSearchHashFileHashResponse, error)
|
|
|
|
// GetServiceUserCreatorIdWithResponse request
|
|
GetServiceUserCreatorIdWithResponse(ctx context.Context, service string, creatorId string, params *GetServiceUserCreatorIdParams, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdResponse, error)
|
|
|
|
// GetServiceUserCreatorIdAnnouncementsWithResponse request
|
|
GetServiceUserCreatorIdAnnouncementsWithResponse(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdAnnouncementsResponse, error)
|
|
|
|
// GetServiceUserCreatorIdFancardsWithResponse request
|
|
GetServiceUserCreatorIdFancardsWithResponse(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdFancardsResponse, error)
|
|
|
|
// GetServiceUserCreatorIdLinksWithResponse request
|
|
GetServiceUserCreatorIdLinksWithResponse(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdLinksResponse, error)
|
|
|
|
// GetServiceUserCreatorIdPostPostIdWithResponse request
|
|
GetServiceUserCreatorIdPostPostIdWithResponse(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdPostPostIdResponse, error)
|
|
|
|
// GetServiceUserCreatorIdPostPostIdCommentsWithResponse request
|
|
GetServiceUserCreatorIdPostPostIdCommentsWithResponse(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdPostPostIdCommentsResponse, error)
|
|
|
|
// GetServiceUserCreatorIdPostPostIdRevisionsWithResponse request
|
|
GetServiceUserCreatorIdPostPostIdRevisionsWithResponse(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdPostPostIdRevisionsResponse, error)
|
|
|
|
// GetServiceUserCreatorIdPostPostFlagWithResponse request
|
|
GetServiceUserCreatorIdPostPostFlagWithResponse(ctx context.Context, service string, creatorId string, post string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdPostPostFlagResponse, error)
|
|
|
|
// PostServiceUserCreatorIdPostPostFlagWithResponse request
|
|
PostServiceUserCreatorIdPostPostFlagWithResponse(ctx context.Context, service string, creatorId string, post string, reqEditors ...RequestEditorFn) (*PostServiceUserCreatorIdPostPostFlagResponse, error)
|
|
|
|
// GetServiceUserCreatorIdProfileWithResponse request
|
|
GetServiceUserCreatorIdProfileWithResponse(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdProfileResponse, error)
|
|
}
|
|
|
|
type GetAccountFavoritesResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
// FavedSeq The sequence number of the favorite
|
|
FavedSeq *int `json:"faved_seq,omitempty"`
|
|
|
|
// Id The ID of the favorite (post or creator)
|
|
Id *string `json:"id,omitempty"`
|
|
|
|
// Indexed Timestamp when the creator was indexed isoformat
|
|
Indexed *string `json:"indexed,omitempty"`
|
|
|
|
// LastImported Timestamp when the creator was last imported
|
|
LastImported *string `json:"last_imported,omitempty"`
|
|
|
|
// Name The name of the creator
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// Service The service where the creator is located
|
|
Service *string `json:"service,omitempty"`
|
|
|
|
// Updated Timestamp when the creator was last updated
|
|
Updated *string `json:"updated,omitempty"`
|
|
}
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetAccountFavoritesResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetAccountFavoritesResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetAppVersionResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetAppVersionResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetAppVersionResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetCreatorsTxtResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
// Favorited The number of times this creator has been favorited
|
|
Favorited *int `json:"favorited,omitempty"`
|
|
|
|
// Id The ID of the creator
|
|
Id *string `json:"id,omitempty"`
|
|
|
|
// Indexed Timestamp when the creator was indexed, Unix time as integer
|
|
Indexed *float32 `json:"indexed,omitempty"`
|
|
|
|
// Name The name of the creator
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// Service The service for the creator
|
|
Service *string `json:"service,omitempty"`
|
|
|
|
// Updated Timestamp when the creator was last updated, Unix time as integer
|
|
Updated *float32 `json:"updated,omitempty"`
|
|
}
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetCreatorsTxtResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetCreatorsTxtResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetDiscordChannelLookupDiscordServerResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
Id *string `json:"id,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
}
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetDiscordChannelLookupDiscordServerResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetDiscordChannelLookupDiscordServerResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetDiscordChannelChannelIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
Author *struct {
|
|
Avatar *string `json:"avatar,omitempty"`
|
|
Discriminator *string `json:"discriminator,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
PublicFlags *int `json:"public_flags,omitempty"`
|
|
Username *string `json:"username,omitempty"`
|
|
} `json:"author,omitempty"`
|
|
Channel *string `json:"channel,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Edited *time.Time `json:"edited,omitempty"`
|
|
Embeds *[]interface{} `json:"embeds,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Mentions *[]interface{} `json:"mentions,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Server *string `json:"server,omitempty"`
|
|
}
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetDiscordChannelChannelIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetDiscordChannelChannelIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type DeleteFavoritesCreatorServiceCreatorIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r DeleteFavoritesCreatorServiceCreatorIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r DeleteFavoritesCreatorServiceCreatorIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type PostFavoritesCreatorServiceCreatorIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r PostFavoritesCreatorServiceCreatorIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r PostFavoritesCreatorServiceCreatorIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type DeleteFavoritesPostServiceCreatorIdPostIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r DeleteFavoritesPostServiceCreatorIdPostIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r DeleteFavoritesPostServiceCreatorIdPostIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type PostFavoritesPostServiceCreatorIdPostIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r PostFavoritesPostServiceCreatorIdPostIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r PostFavoritesPostServiceCreatorIdPostIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetPostsResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Edited *time.Time `json:"edited,omitempty"`
|
|
Embed *map[string]interface{} `json:"embed,omitempty"`
|
|
File *struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"file,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
SharedFile *bool `json:"shared_file,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
User *string `json:"user,omitempty"`
|
|
}
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetPostsResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetPostsResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetSearchHashFileHashResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Ctime *time.Time `json:"ctime,omitempty"`
|
|
DiscordPosts *[]struct {
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
Channel *string `json:"channel,omitempty"`
|
|
Embeds *[]interface{} `json:"embeds,omitempty"`
|
|
FileId *int `json:"file_id,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Mentions *[]interface{} `json:"mentions,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Server *string `json:"server,omitempty"`
|
|
Substring *string `json:"substring,omitempty"`
|
|
} `json:"discord_posts,omitempty"`
|
|
Ext *string `json:"ext,omitempty"`
|
|
Hash *string `json:"hash,omitempty"`
|
|
Id *int `json:"id,omitempty"`
|
|
Ihash *string `json:"ihash,omitempty"`
|
|
Mime *string `json:"mime,omitempty"`
|
|
Mtime *time.Time `json:"mtime,omitempty"`
|
|
Posts *[]struct {
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
File *struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"file,omitempty"`
|
|
FileId *int `json:"file_id,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
Substring *string `json:"substring,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
User *string `json:"user,omitempty"`
|
|
} `json:"posts,omitempty"`
|
|
Size *int `json:"size,omitempty"`
|
|
}
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetSearchHashFileHashResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetSearchHashFileHashResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetServiceUserCreatorIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Edited *time.Time `json:"edited,omitempty"`
|
|
Embed *map[string]interface{} `json:"embed,omitempty"`
|
|
File *struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"file,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
SharedFile *bool `json:"shared_file,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
User *string `json:"user,omitempty"`
|
|
}
|
|
JSON404 *struct {
|
|
// Error The error message
|
|
Error *GetServiceUserCreatorId404Error `json:"error,omitempty"`
|
|
}
|
|
}
|
|
type GetServiceUserCreatorId404Error string
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetServiceUserCreatorIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetServiceUserCreatorIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetServiceUserCreatorIdAnnouncementsResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
// Added isoformat UTC
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
|
|
// Hash sha256
|
|
Hash *string `json:"hash,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
UserId *string `json:"user_id,omitempty"`
|
|
}
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetServiceUserCreatorIdAnnouncementsResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetServiceUserCreatorIdAnnouncementsResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetServiceUserCreatorIdFancardsResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Ctime *time.Time `json:"ctime,omitempty"`
|
|
Ext *string `json:"ext,omitempty"`
|
|
FileId *int `json:"file_id,omitempty"`
|
|
Hash *string `json:"hash,omitempty"`
|
|
Id *int `json:"id,omitempty"`
|
|
Ihash *string `json:"ihash,omitempty"`
|
|
Mime *string `json:"mime,omitempty"`
|
|
Mtime *time.Time `json:"mtime,omitempty"`
|
|
Size *int `json:"size,omitempty"`
|
|
UserId *string `json:"user_id,omitempty"`
|
|
}
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetServiceUserCreatorIdFancardsResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetServiceUserCreatorIdFancardsResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetServiceUserCreatorIdLinksResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
// Id The ID of the creator
|
|
Id *string `json:"id,omitempty"`
|
|
|
|
// Indexed The time the creator was last indexed
|
|
Indexed *time.Time `json:"indexed,omitempty"`
|
|
|
|
// Name The creator's display name
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// PublicId The public ID of the creator
|
|
PublicId *string `json:"public_id"`
|
|
|
|
// Service The service where the creator is located
|
|
Service *string `json:"service,omitempty"`
|
|
|
|
// Updated The time the creator was last updated
|
|
Updated *time.Time `json:"updated,omitempty"`
|
|
}
|
|
JSON404 *struct {
|
|
// Error The error message
|
|
Error *GetServiceUserCreatorIdLinks404Error `json:"error,omitempty"`
|
|
}
|
|
}
|
|
type GetServiceUserCreatorIdLinks404Error string
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetServiceUserCreatorIdLinksResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetServiceUserCreatorIdLinksResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetServiceUserCreatorIdPostPostIdResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Edited *time.Time `json:"edited,omitempty"`
|
|
Embed *map[string]interface{} `json:"embed,omitempty"`
|
|
File *struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"file,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Next *string `json:"next,omitempty"`
|
|
Prev *string `json:"prev,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
SharedFile *bool `json:"shared_file,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
User *string `json:"user,omitempty"`
|
|
}
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetServiceUserCreatorIdPostPostIdResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetServiceUserCreatorIdPostPostIdResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetServiceUserCreatorIdPostPostIdCommentsResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
Commenter *string `json:"commenter,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
ParentId *string `json:"parent_id"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Revisions *[]struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Id *int `json:"id,omitempty"`
|
|
} `json:"revisions,omitempty"`
|
|
}
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetServiceUserCreatorIdPostPostIdCommentsResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetServiceUserCreatorIdPostPostIdCommentsResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetServiceUserCreatorIdPostPostIdRevisionsResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *[]struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Edited *time.Time `json:"edited,omitempty"`
|
|
Embed *map[string]interface{} `json:"embed,omitempty"`
|
|
File *struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"file,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
RevisionId *int `json:"revision_id,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
SharedFile *bool `json:"shared_file,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
User *string `json:"user,omitempty"`
|
|
}
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetServiceUserCreatorIdPostPostIdRevisionsResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetServiceUserCreatorIdPostPostIdRevisionsResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetServiceUserCreatorIdPostPostFlagResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetServiceUserCreatorIdPostPostFlagResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetServiceUserCreatorIdPostPostFlagResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type PostServiceUserCreatorIdPostPostFlagResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
}
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r PostServiceUserCreatorIdPostPostFlagResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r PostServiceUserCreatorIdPostPostFlagResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
type GetServiceUserCreatorIdProfileResponse struct {
|
|
Body []byte
|
|
HTTPResponse *http.Response
|
|
JSON200 *struct {
|
|
// Id The ID of the creator
|
|
Id *string `json:"id,omitempty"`
|
|
|
|
// Indexed The time the creator was last indexed
|
|
Indexed *time.Time `json:"indexed,omitempty"`
|
|
|
|
// Name The creator's display name
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// PublicId The public ID of the creator
|
|
PublicId *string `json:"public_id"`
|
|
|
|
// Service The service where the creator is located
|
|
Service *string `json:"service,omitempty"`
|
|
|
|
// Updated The time the creator was last updated
|
|
Updated *time.Time `json:"updated,omitempty"`
|
|
}
|
|
JSON404 *struct {
|
|
// Error The error message
|
|
Error *GetServiceUserCreatorIdProfile404Error `json:"error,omitempty"`
|
|
}
|
|
}
|
|
type GetServiceUserCreatorIdProfile404Error string
|
|
|
|
// Status returns HTTPResponse.Status
|
|
func (r GetServiceUserCreatorIdProfileResponse) Status() string {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.Status
|
|
}
|
|
return http.StatusText(0)
|
|
}
|
|
|
|
// StatusCode returns HTTPResponse.StatusCode
|
|
func (r GetServiceUserCreatorIdProfileResponse) StatusCode() int {
|
|
if r.HTTPResponse != nil {
|
|
return r.HTTPResponse.StatusCode
|
|
}
|
|
return 0
|
|
}
|
|
|
|
// GetAccountFavoritesWithResponse request returning *GetAccountFavoritesResponse
|
|
func (c *ClientWithResponses) GetAccountFavoritesWithResponse(ctx context.Context, params *GetAccountFavoritesParams, reqEditors ...RequestEditorFn) (*GetAccountFavoritesResponse, error) {
|
|
rsp, err := c.GetAccountFavorites(ctx, params, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetAccountFavoritesResponse(rsp)
|
|
}
|
|
|
|
// GetAppVersionWithResponse request returning *GetAppVersionResponse
|
|
func (c *ClientWithResponses) GetAppVersionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetAppVersionResponse, error) {
|
|
rsp, err := c.GetAppVersion(ctx, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetAppVersionResponse(rsp)
|
|
}
|
|
|
|
// GetCreatorsTxtWithResponse request returning *GetCreatorsTxtResponse
|
|
func (c *ClientWithResponses) GetCreatorsTxtWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetCreatorsTxtResponse, error) {
|
|
rsp, err := c.GetCreatorsTxt(ctx, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetCreatorsTxtResponse(rsp)
|
|
}
|
|
|
|
// GetDiscordChannelLookupDiscordServerWithResponse request returning *GetDiscordChannelLookupDiscordServerResponse
|
|
func (c *ClientWithResponses) GetDiscordChannelLookupDiscordServerWithResponse(ctx context.Context, discordServer string, reqEditors ...RequestEditorFn) (*GetDiscordChannelLookupDiscordServerResponse, error) {
|
|
rsp, err := c.GetDiscordChannelLookupDiscordServer(ctx, discordServer, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetDiscordChannelLookupDiscordServerResponse(rsp)
|
|
}
|
|
|
|
// GetDiscordChannelChannelIdWithResponse request returning *GetDiscordChannelChannelIdResponse
|
|
func (c *ClientWithResponses) GetDiscordChannelChannelIdWithResponse(ctx context.Context, channelId string, params *GetDiscordChannelChannelIdParams, reqEditors ...RequestEditorFn) (*GetDiscordChannelChannelIdResponse, error) {
|
|
rsp, err := c.GetDiscordChannelChannelId(ctx, channelId, params, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetDiscordChannelChannelIdResponse(rsp)
|
|
}
|
|
|
|
// DeleteFavoritesCreatorServiceCreatorIdWithResponse request returning *DeleteFavoritesCreatorServiceCreatorIdResponse
|
|
func (c *ClientWithResponses) DeleteFavoritesCreatorServiceCreatorIdWithResponse(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*DeleteFavoritesCreatorServiceCreatorIdResponse, error) {
|
|
rsp, err := c.DeleteFavoritesCreatorServiceCreatorId(ctx, service, creatorId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseDeleteFavoritesCreatorServiceCreatorIdResponse(rsp)
|
|
}
|
|
|
|
// PostFavoritesCreatorServiceCreatorIdWithResponse request returning *PostFavoritesCreatorServiceCreatorIdResponse
|
|
func (c *ClientWithResponses) PostFavoritesCreatorServiceCreatorIdWithResponse(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*PostFavoritesCreatorServiceCreatorIdResponse, error) {
|
|
rsp, err := c.PostFavoritesCreatorServiceCreatorId(ctx, service, creatorId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePostFavoritesCreatorServiceCreatorIdResponse(rsp)
|
|
}
|
|
|
|
// DeleteFavoritesPostServiceCreatorIdPostIdWithResponse request returning *DeleteFavoritesPostServiceCreatorIdPostIdResponse
|
|
func (c *ClientWithResponses) DeleteFavoritesPostServiceCreatorIdPostIdWithResponse(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*DeleteFavoritesPostServiceCreatorIdPostIdResponse, error) {
|
|
rsp, err := c.DeleteFavoritesPostServiceCreatorIdPostId(ctx, service, creatorId, postId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseDeleteFavoritesPostServiceCreatorIdPostIdResponse(rsp)
|
|
}
|
|
|
|
// PostFavoritesPostServiceCreatorIdPostIdWithResponse request returning *PostFavoritesPostServiceCreatorIdPostIdResponse
|
|
func (c *ClientWithResponses) PostFavoritesPostServiceCreatorIdPostIdWithResponse(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*PostFavoritesPostServiceCreatorIdPostIdResponse, error) {
|
|
rsp, err := c.PostFavoritesPostServiceCreatorIdPostId(ctx, service, creatorId, postId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePostFavoritesPostServiceCreatorIdPostIdResponse(rsp)
|
|
}
|
|
|
|
// GetPostsWithResponse request returning *GetPostsResponse
|
|
func (c *ClientWithResponses) GetPostsWithResponse(ctx context.Context, params *GetPostsParams, reqEditors ...RequestEditorFn) (*GetPostsResponse, error) {
|
|
rsp, err := c.GetPosts(ctx, params, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetPostsResponse(rsp)
|
|
}
|
|
|
|
// GetSearchHashFileHashWithResponse request returning *GetSearchHashFileHashResponse
|
|
func (c *ClientWithResponses) GetSearchHashFileHashWithResponse(ctx context.Context, fileHash string, reqEditors ...RequestEditorFn) (*GetSearchHashFileHashResponse, error) {
|
|
rsp, err := c.GetSearchHashFileHash(ctx, fileHash, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetSearchHashFileHashResponse(rsp)
|
|
}
|
|
|
|
// GetServiceUserCreatorIdWithResponse request returning *GetServiceUserCreatorIdResponse
|
|
func (c *ClientWithResponses) GetServiceUserCreatorIdWithResponse(ctx context.Context, service string, creatorId string, params *GetServiceUserCreatorIdParams, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdResponse, error) {
|
|
rsp, err := c.GetServiceUserCreatorId(ctx, service, creatorId, params, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetServiceUserCreatorIdResponse(rsp)
|
|
}
|
|
|
|
// GetServiceUserCreatorIdAnnouncementsWithResponse request returning *GetServiceUserCreatorIdAnnouncementsResponse
|
|
func (c *ClientWithResponses) GetServiceUserCreatorIdAnnouncementsWithResponse(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdAnnouncementsResponse, error) {
|
|
rsp, err := c.GetServiceUserCreatorIdAnnouncements(ctx, service, creatorId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetServiceUserCreatorIdAnnouncementsResponse(rsp)
|
|
}
|
|
|
|
// GetServiceUserCreatorIdFancardsWithResponse request returning *GetServiceUserCreatorIdFancardsResponse
|
|
func (c *ClientWithResponses) GetServiceUserCreatorIdFancardsWithResponse(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdFancardsResponse, error) {
|
|
rsp, err := c.GetServiceUserCreatorIdFancards(ctx, service, creatorId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetServiceUserCreatorIdFancardsResponse(rsp)
|
|
}
|
|
|
|
// GetServiceUserCreatorIdLinksWithResponse request returning *GetServiceUserCreatorIdLinksResponse
|
|
func (c *ClientWithResponses) GetServiceUserCreatorIdLinksWithResponse(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdLinksResponse, error) {
|
|
rsp, err := c.GetServiceUserCreatorIdLinks(ctx, service, creatorId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetServiceUserCreatorIdLinksResponse(rsp)
|
|
}
|
|
|
|
// GetServiceUserCreatorIdPostPostIdWithResponse request returning *GetServiceUserCreatorIdPostPostIdResponse
|
|
func (c *ClientWithResponses) GetServiceUserCreatorIdPostPostIdWithResponse(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdPostPostIdResponse, error) {
|
|
rsp, err := c.GetServiceUserCreatorIdPostPostId(ctx, service, creatorId, postId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetServiceUserCreatorIdPostPostIdResponse(rsp)
|
|
}
|
|
|
|
// GetServiceUserCreatorIdPostPostIdCommentsWithResponse request returning *GetServiceUserCreatorIdPostPostIdCommentsResponse
|
|
func (c *ClientWithResponses) GetServiceUserCreatorIdPostPostIdCommentsWithResponse(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdPostPostIdCommentsResponse, error) {
|
|
rsp, err := c.GetServiceUserCreatorIdPostPostIdComments(ctx, service, creatorId, postId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetServiceUserCreatorIdPostPostIdCommentsResponse(rsp)
|
|
}
|
|
|
|
// GetServiceUserCreatorIdPostPostIdRevisionsWithResponse request returning *GetServiceUserCreatorIdPostPostIdRevisionsResponse
|
|
func (c *ClientWithResponses) GetServiceUserCreatorIdPostPostIdRevisionsWithResponse(ctx context.Context, service string, creatorId string, postId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdPostPostIdRevisionsResponse, error) {
|
|
rsp, err := c.GetServiceUserCreatorIdPostPostIdRevisions(ctx, service, creatorId, postId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetServiceUserCreatorIdPostPostIdRevisionsResponse(rsp)
|
|
}
|
|
|
|
// GetServiceUserCreatorIdPostPostFlagWithResponse request returning *GetServiceUserCreatorIdPostPostFlagResponse
|
|
func (c *ClientWithResponses) GetServiceUserCreatorIdPostPostFlagWithResponse(ctx context.Context, service string, creatorId string, post string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdPostPostFlagResponse, error) {
|
|
rsp, err := c.GetServiceUserCreatorIdPostPostFlag(ctx, service, creatorId, post, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetServiceUserCreatorIdPostPostFlagResponse(rsp)
|
|
}
|
|
|
|
// PostServiceUserCreatorIdPostPostFlagWithResponse request returning *PostServiceUserCreatorIdPostPostFlagResponse
|
|
func (c *ClientWithResponses) PostServiceUserCreatorIdPostPostFlagWithResponse(ctx context.Context, service string, creatorId string, post string, reqEditors ...RequestEditorFn) (*PostServiceUserCreatorIdPostPostFlagResponse, error) {
|
|
rsp, err := c.PostServiceUserCreatorIdPostPostFlag(ctx, service, creatorId, post, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParsePostServiceUserCreatorIdPostPostFlagResponse(rsp)
|
|
}
|
|
|
|
// GetServiceUserCreatorIdProfileWithResponse request returning *GetServiceUserCreatorIdProfileResponse
|
|
func (c *ClientWithResponses) GetServiceUserCreatorIdProfileWithResponse(ctx context.Context, service string, creatorId string, reqEditors ...RequestEditorFn) (*GetServiceUserCreatorIdProfileResponse, error) {
|
|
rsp, err := c.GetServiceUserCreatorIdProfile(ctx, service, creatorId, reqEditors...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return ParseGetServiceUserCreatorIdProfileResponse(rsp)
|
|
}
|
|
|
|
// ParseGetAccountFavoritesResponse parses an HTTP response from a GetAccountFavoritesWithResponse call
|
|
func ParseGetAccountFavoritesResponse(rsp *http.Response) (*GetAccountFavoritesResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetAccountFavoritesResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
// FavedSeq The sequence number of the favorite
|
|
FavedSeq *int `json:"faved_seq,omitempty"`
|
|
|
|
// Id The ID of the favorite (post or creator)
|
|
Id *string `json:"id,omitempty"`
|
|
|
|
// Indexed Timestamp when the creator was indexed isoformat
|
|
Indexed *string `json:"indexed,omitempty"`
|
|
|
|
// LastImported Timestamp when the creator was last imported
|
|
LastImported *string `json:"last_imported,omitempty"`
|
|
|
|
// Name The name of the creator
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// Service The service where the creator is located
|
|
Service *string `json:"service,omitempty"`
|
|
|
|
// Updated Timestamp when the creator was last updated
|
|
Updated *string `json:"updated,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetAppVersionResponse parses an HTTP response from a GetAppVersionWithResponse call
|
|
func ParseGetAppVersionResponse(rsp *http.Response) (*GetAppVersionResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetAppVersionResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetCreatorsTxtResponse parses an HTTP response from a GetCreatorsTxtWithResponse call
|
|
func ParseGetCreatorsTxtResponse(rsp *http.Response) (*GetCreatorsTxtResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetCreatorsTxtResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
// Favorited The number of times this creator has been favorited
|
|
Favorited *int `json:"favorited,omitempty"`
|
|
|
|
// Id The ID of the creator
|
|
Id *string `json:"id,omitempty"`
|
|
|
|
// Indexed Timestamp when the creator was indexed, Unix time as integer
|
|
Indexed *float32 `json:"indexed,omitempty"`
|
|
|
|
// Name The name of the creator
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// Service The service for the creator
|
|
Service *string `json:"service,omitempty"`
|
|
|
|
// Updated Timestamp when the creator was last updated, Unix time as integer
|
|
Updated *float32 `json:"updated,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetDiscordChannelLookupDiscordServerResponse parses an HTTP response from a GetDiscordChannelLookupDiscordServerWithResponse call
|
|
func ParseGetDiscordChannelLookupDiscordServerResponse(rsp *http.Response) (*GetDiscordChannelLookupDiscordServerResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetDiscordChannelLookupDiscordServerResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
Id *string `json:"id,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetDiscordChannelChannelIdResponse parses an HTTP response from a GetDiscordChannelChannelIdWithResponse call
|
|
func ParseGetDiscordChannelChannelIdResponse(rsp *http.Response) (*GetDiscordChannelChannelIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetDiscordChannelChannelIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
Author *struct {
|
|
Avatar *string `json:"avatar,omitempty"`
|
|
Discriminator *string `json:"discriminator,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
PublicFlags *int `json:"public_flags,omitempty"`
|
|
Username *string `json:"username,omitempty"`
|
|
} `json:"author,omitempty"`
|
|
Channel *string `json:"channel,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Edited *time.Time `json:"edited,omitempty"`
|
|
Embeds *[]interface{} `json:"embeds,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Mentions *[]interface{} `json:"mentions,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Server *string `json:"server,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseDeleteFavoritesCreatorServiceCreatorIdResponse parses an HTTP response from a DeleteFavoritesCreatorServiceCreatorIdWithResponse call
|
|
func ParseDeleteFavoritesCreatorServiceCreatorIdResponse(rsp *http.Response) (*DeleteFavoritesCreatorServiceCreatorIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &DeleteFavoritesCreatorServiceCreatorIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParsePostFavoritesCreatorServiceCreatorIdResponse parses an HTTP response from a PostFavoritesCreatorServiceCreatorIdWithResponse call
|
|
func ParsePostFavoritesCreatorServiceCreatorIdResponse(rsp *http.Response) (*PostFavoritesCreatorServiceCreatorIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &PostFavoritesCreatorServiceCreatorIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseDeleteFavoritesPostServiceCreatorIdPostIdResponse parses an HTTP response from a DeleteFavoritesPostServiceCreatorIdPostIdWithResponse call
|
|
func ParseDeleteFavoritesPostServiceCreatorIdPostIdResponse(rsp *http.Response) (*DeleteFavoritesPostServiceCreatorIdPostIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &DeleteFavoritesPostServiceCreatorIdPostIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParsePostFavoritesPostServiceCreatorIdPostIdResponse parses an HTTP response from a PostFavoritesPostServiceCreatorIdPostIdWithResponse call
|
|
func ParsePostFavoritesPostServiceCreatorIdPostIdResponse(rsp *http.Response) (*PostFavoritesPostServiceCreatorIdPostIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &PostFavoritesPostServiceCreatorIdPostIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetPostsResponse parses an HTTP response from a GetPostsWithResponse call
|
|
func ParseGetPostsResponse(rsp *http.Response) (*GetPostsResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetPostsResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Edited *time.Time `json:"edited,omitempty"`
|
|
Embed *map[string]interface{} `json:"embed,omitempty"`
|
|
File *struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"file,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
SharedFile *bool `json:"shared_file,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
User *string `json:"user,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetSearchHashFileHashResponse parses an HTTP response from a GetSearchHashFileHashWithResponse call
|
|
func ParseGetSearchHashFileHashResponse(rsp *http.Response) (*GetSearchHashFileHashResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetSearchHashFileHashResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Ctime *time.Time `json:"ctime,omitempty"`
|
|
DiscordPosts *[]struct {
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
Channel *string `json:"channel,omitempty"`
|
|
Embeds *[]interface{} `json:"embeds,omitempty"`
|
|
FileId *int `json:"file_id,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Mentions *[]interface{} `json:"mentions,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Server *string `json:"server,omitempty"`
|
|
Substring *string `json:"substring,omitempty"`
|
|
} `json:"discord_posts,omitempty"`
|
|
Ext *string `json:"ext,omitempty"`
|
|
Hash *string `json:"hash,omitempty"`
|
|
Id *int `json:"id,omitempty"`
|
|
Ihash *string `json:"ihash,omitempty"`
|
|
Mime *string `json:"mime,omitempty"`
|
|
Mtime *time.Time `json:"mtime,omitempty"`
|
|
Posts *[]struct {
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
File *struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"file,omitempty"`
|
|
FileId *int `json:"file_id,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
Substring *string `json:"substring,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
User *string `json:"user,omitempty"`
|
|
} `json:"posts,omitempty"`
|
|
Size *int `json:"size,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetServiceUserCreatorIdResponse parses an HTTP response from a GetServiceUserCreatorIdWithResponse call
|
|
func ParseGetServiceUserCreatorIdResponse(rsp *http.Response) (*GetServiceUserCreatorIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetServiceUserCreatorIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Edited *time.Time `json:"edited,omitempty"`
|
|
Embed *map[string]interface{} `json:"embed,omitempty"`
|
|
File *struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"file,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
SharedFile *bool `json:"shared_file,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
User *string `json:"user,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
// Error The error message
|
|
Error *GetServiceUserCreatorId404Error `json:"error,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON404 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetServiceUserCreatorIdAnnouncementsResponse parses an HTTP response from a GetServiceUserCreatorIdAnnouncementsWithResponse call
|
|
func ParseGetServiceUserCreatorIdAnnouncementsResponse(rsp *http.Response) (*GetServiceUserCreatorIdAnnouncementsResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetServiceUserCreatorIdAnnouncementsResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
// Added isoformat UTC
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
|
|
// Hash sha256
|
|
Hash *string `json:"hash,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
UserId *string `json:"user_id,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetServiceUserCreatorIdFancardsResponse parses an HTTP response from a GetServiceUserCreatorIdFancardsWithResponse call
|
|
func ParseGetServiceUserCreatorIdFancardsResponse(rsp *http.Response) (*GetServiceUserCreatorIdFancardsResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetServiceUserCreatorIdFancardsResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Ctime *time.Time `json:"ctime,omitempty"`
|
|
Ext *string `json:"ext,omitempty"`
|
|
FileId *int `json:"file_id,omitempty"`
|
|
Hash *string `json:"hash,omitempty"`
|
|
Id *int `json:"id,omitempty"`
|
|
Ihash *string `json:"ihash,omitempty"`
|
|
Mime *string `json:"mime,omitempty"`
|
|
Mtime *time.Time `json:"mtime,omitempty"`
|
|
Size *int `json:"size,omitempty"`
|
|
UserId *string `json:"user_id,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetServiceUserCreatorIdLinksResponse parses an HTTP response from a GetServiceUserCreatorIdLinksWithResponse call
|
|
func ParseGetServiceUserCreatorIdLinksResponse(rsp *http.Response) (*GetServiceUserCreatorIdLinksResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetServiceUserCreatorIdLinksResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
// Id The ID of the creator
|
|
Id *string `json:"id,omitempty"`
|
|
|
|
// Indexed The time the creator was last indexed
|
|
Indexed *time.Time `json:"indexed,omitempty"`
|
|
|
|
// Name The creator's display name
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// PublicId The public ID of the creator
|
|
PublicId *string `json:"public_id"`
|
|
|
|
// Service The service where the creator is located
|
|
Service *string `json:"service,omitempty"`
|
|
|
|
// Updated The time the creator was last updated
|
|
Updated *time.Time `json:"updated,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
// Error The error message
|
|
Error *GetServiceUserCreatorIdLinks404Error `json:"error,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON404 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetServiceUserCreatorIdPostPostIdResponse parses an HTTP response from a GetServiceUserCreatorIdPostPostIdWithResponse call
|
|
func ParseGetServiceUserCreatorIdPostPostIdResponse(rsp *http.Response) (*GetServiceUserCreatorIdPostPostIdResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetServiceUserCreatorIdPostPostIdResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Edited *time.Time `json:"edited,omitempty"`
|
|
Embed *map[string]interface{} `json:"embed,omitempty"`
|
|
File *struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"file,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Next *string `json:"next,omitempty"`
|
|
Prev *string `json:"prev,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
SharedFile *bool `json:"shared_file,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
User *string `json:"user,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetServiceUserCreatorIdPostPostIdCommentsResponse parses an HTTP response from a GetServiceUserCreatorIdPostPostIdCommentsWithResponse call
|
|
func ParseGetServiceUserCreatorIdPostPostIdCommentsResponse(rsp *http.Response) (*GetServiceUserCreatorIdPostPostIdCommentsResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetServiceUserCreatorIdPostPostIdCommentsResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
Commenter *string `json:"commenter,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
ParentId *string `json:"parent_id"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
Revisions *[]struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Id *int `json:"id,omitempty"`
|
|
} `json:"revisions,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetServiceUserCreatorIdPostPostIdRevisionsResponse parses an HTTP response from a GetServiceUserCreatorIdPostPostIdRevisionsWithResponse call
|
|
func ParseGetServiceUserCreatorIdPostPostIdRevisionsResponse(rsp *http.Response) (*GetServiceUserCreatorIdPostPostIdRevisionsResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetServiceUserCreatorIdPostPostIdRevisionsResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest []struct {
|
|
Added *time.Time `json:"added,omitempty"`
|
|
Attachments *[]struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"attachments,omitempty"`
|
|
Content *string `json:"content,omitempty"`
|
|
Edited *time.Time `json:"edited,omitempty"`
|
|
Embed *map[string]interface{} `json:"embed,omitempty"`
|
|
File *struct {
|
|
Name *string `json:"name,omitempty"`
|
|
Path *string `json:"path,omitempty"`
|
|
} `json:"file,omitempty"`
|
|
Id *string `json:"id,omitempty"`
|
|
Published *time.Time `json:"published,omitempty"`
|
|
RevisionId *int `json:"revision_id,omitempty"`
|
|
Service *string `json:"service,omitempty"`
|
|
SharedFile *bool `json:"shared_file,omitempty"`
|
|
Title *string `json:"title,omitempty"`
|
|
User *string `json:"user,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetServiceUserCreatorIdPostPostFlagResponse parses an HTTP response from a GetServiceUserCreatorIdPostPostFlagWithResponse call
|
|
func ParseGetServiceUserCreatorIdPostPostFlagResponse(rsp *http.Response) (*GetServiceUserCreatorIdPostPostFlagResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetServiceUserCreatorIdPostPostFlagResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParsePostServiceUserCreatorIdPostPostFlagResponse parses an HTTP response from a PostServiceUserCreatorIdPostPostFlagWithResponse call
|
|
func ParsePostServiceUserCreatorIdPostPostFlagResponse(rsp *http.Response) (*PostServiceUserCreatorIdPostPostFlagResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &PostServiceUserCreatorIdPostPostFlagResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
return response, nil
|
|
}
|
|
|
|
// ParseGetServiceUserCreatorIdProfileResponse parses an HTTP response from a GetServiceUserCreatorIdProfileWithResponse call
|
|
func ParseGetServiceUserCreatorIdProfileResponse(rsp *http.Response) (*GetServiceUserCreatorIdProfileResponse, error) {
|
|
bodyBytes, err := io.ReadAll(rsp.Body)
|
|
defer func() { _ = rsp.Body.Close() }()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := &GetServiceUserCreatorIdProfileResponse{
|
|
Body: bodyBytes,
|
|
HTTPResponse: rsp,
|
|
}
|
|
|
|
switch {
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
|
|
var dest struct {
|
|
// Id The ID of the creator
|
|
Id *string `json:"id,omitempty"`
|
|
|
|
// Indexed The time the creator was last indexed
|
|
Indexed *time.Time `json:"indexed,omitempty"`
|
|
|
|
// Name The creator's display name
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// PublicId The public ID of the creator
|
|
PublicId *string `json:"public_id"`
|
|
|
|
// Service The service where the creator is located
|
|
Service *string `json:"service,omitempty"`
|
|
|
|
// Updated The time the creator was last updated
|
|
Updated *time.Time `json:"updated,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON200 = &dest
|
|
|
|
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
|
|
var dest struct {
|
|
// Error The error message
|
|
Error *GetServiceUserCreatorIdProfile404Error `json:"error,omitempty"`
|
|
}
|
|
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
|
|
return nil, err
|
|
}
|
|
response.JSON404 = &dest
|
|
|
|
}
|
|
|
|
return response, nil
|
|
}
|