Documentation
¶
Overview ¶
Package adminapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
Index ¶
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- type BotId
- type BotInfoResponse
- type BotInfoResponseChatMode
- type BotInfoResponseMarkAsReadMode
- type ChiServerOptions
- type CreateBot201JSONResponse
- type CreateBot400JSONResponse
- type CreateBot409JSONResponse
- type CreateBot500JSONResponse
- type CreateBotJSONRequestBody
- type CreateBotRequest
- type CreateBotRequestChatMode
- type CreateBotRequestMarkAsReadMode
- type CreateBotRequestObject
- type CreateBotResponseObject
- type CreateFollowers201JSONResponse
- type CreateFollowers400JSONResponse
- type CreateFollowers404JSONResponse
- type CreateFollowers500JSONResponse
- type CreateFollowersJSONRequestBody
- type CreateFollowersRequest
- type CreateFollowersRequestObject
- type CreateFollowersResponse
- type CreateFollowersResponseObject
- type ErrorResponse
- type FollowerProfile
- type InvalidParamFormatError
- type ListUserMessages200JSONResponse
- type ListUserMessages404JSONResponse
- type ListUserMessages500JSONResponse
- type ListUserMessagesRequestObject
- type ListUserMessagesResponse
- type ListUserMessagesResponseObject
- type MiddlewareFunc
- type ReceivedMessage
- type ReceivedMessageSendType
- type RequiredHeaderError
- type RequiredParamError
- type SendUserEvent200JSONResponse
- type SendUserEvent400JSONResponse
- type SendUserEvent404JSONResponse
- type SendUserEvent500JSONResponse
- type SendUserEventJSONRequestBody
- type SendUserEventRequest
- type SendUserEventRequestObject
- type SendUserEventRequestType
- type SendUserEventResponse
- type SendUserEventResponseObject
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) CreateBot(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreateFollowers(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListUserMessages(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) SendUserEvent(w http.ResponseWriter, r *http.Request)
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) CreateBot(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) CreateFollowers(w http.ResponseWriter, r *http.Request, botId string)
- func (_ Unimplemented) ListUserMessages(w http.ResponseWriter, r *http.Request, botId BotId, userId UserId)
- func (_ Unimplemented) SendUserEvent(w http.ResponseWriter, r *http.Request, botId BotId, userId UserId)
- type UnmarshalingParamError
- type UserId
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type BotInfoResponse ¶
type BotInfoResponse struct {
// BasicId Bot's basic ID
BasicId string `json:"basicId"`
// ChatMode Chat settings set in the LINE Official Account Manager.
// - `chat`: Chat is set to "On"
// - `bot`: Chat is set to "Off"
ChatMode BotInfoResponseChatMode `json:"chatMode"`
// DisplayName Bot's display name
DisplayName string `json:"displayName"`
// MarkAsReadMode Automatic read setting for messages.
// - `auto`: Auto read setting is enabled
// - `manual`: Auto read setting is disabled
MarkAsReadMode BotInfoResponseMarkAsReadMode `json:"markAsReadMode"`
// PictureUrl Profile image URL. HTTPS image URL. Not included if the bot doesn't have a profile image.
PictureUrl *string `json:"pictureUrl,omitempty"`
// PremiumId Bot's premium ID. Not included if the premium ID isn't set.
PremiumId *string `json:"premiumId,omitempty"`
// UserId Bot's user ID
UserId string `json:"userId"`
}
BotInfoResponse defines model for BotInfoResponse.
type BotInfoResponseChatMode ¶
type BotInfoResponseChatMode string
BotInfoResponseChatMode Chat settings set in the LINE Official Account Manager. - `chat`: Chat is set to "On" - `bot`: Chat is set to "Off"
const ( BotInfoResponseChatModeBot BotInfoResponseChatMode = "bot" BotInfoResponseChatModeChat BotInfoResponseChatMode = "chat" )
Defines values for BotInfoResponseChatMode.
type BotInfoResponseMarkAsReadMode ¶
type BotInfoResponseMarkAsReadMode string
BotInfoResponseMarkAsReadMode Automatic read setting for messages. - `auto`: Auto read setting is enabled - `manual`: Auto read setting is disabled
const ( BotInfoResponseMarkAsReadModeAuto BotInfoResponseMarkAsReadMode = "auto" BotInfoResponseMarkAsReadModeManual BotInfoResponseMarkAsReadMode = "manual" )
Defines values for BotInfoResponseMarkAsReadMode.
type ChiServerOptions ¶
type ChiServerOptions struct {
BaseURL string
BaseRouter chi.Router
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type CreateBot201JSONResponse ¶
type CreateBot201JSONResponse BotInfoResponse
func (CreateBot201JSONResponse) VisitCreateBotResponse ¶
func (response CreateBot201JSONResponse) VisitCreateBotResponse(w http.ResponseWriter) error
type CreateBot400JSONResponse ¶
type CreateBot400JSONResponse ErrorResponse
func (CreateBot400JSONResponse) VisitCreateBotResponse ¶
func (response CreateBot400JSONResponse) VisitCreateBotResponse(w http.ResponseWriter) error
type CreateBot409JSONResponse ¶
type CreateBot409JSONResponse ErrorResponse
func (CreateBot409JSONResponse) VisitCreateBotResponse ¶
func (response CreateBot409JSONResponse) VisitCreateBotResponse(w http.ResponseWriter) error
type CreateBot500JSONResponse ¶
type CreateBot500JSONResponse ErrorResponse
func (CreateBot500JSONResponse) VisitCreateBotResponse ¶
func (response CreateBot500JSONResponse) VisitCreateBotResponse(w http.ResponseWriter) error
type CreateBotJSONRequestBody ¶
type CreateBotJSONRequestBody = CreateBotRequest
CreateBotJSONRequestBody defines body for CreateBot for application/json ContentType.
type CreateBotRequest ¶
type CreateBotRequest struct {
// BasicId Bot's basic ID
BasicId *string `json:"basicId,omitempty"`
// ChatMode Chat settings set in the LINE Official Account Manager.
// - `chat`: Chat is set to "On"
// - `bot`: Chat is set to "Off"
ChatMode *CreateBotRequestChatMode `json:"chatMode,omitempty"`
// DisplayName Bot's display name
DisplayName string `json:"displayName"`
// MarkAsReadMode Automatic read setting for messages.
// - `auto`: Auto read setting is enabled
// - `manual`: Auto read setting is disabled
MarkAsReadMode *CreateBotRequestMarkAsReadMode `json:"markAsReadMode,omitempty"`
// PictureUrl Profile image URL. Must be an HTTPS URL.
PictureUrl *string `json:"pictureUrl,omitempty"`
// PremiumId Bot's premium ID
PremiumId *string `json:"premiumId,omitempty"`
// UserId Bot's user ID
UserId *string `json:"userId,omitempty"`
}
CreateBotRequest defines model for CreateBotRequest.
type CreateBotRequestChatMode ¶
type CreateBotRequestChatMode string
CreateBotRequestChatMode Chat settings set in the LINE Official Account Manager. - `chat`: Chat is set to "On" - `bot`: Chat is set to "Off"
const ( CreateBotRequestChatModeBot CreateBotRequestChatMode = "bot" CreateBotRequestChatModeChat CreateBotRequestChatMode = "chat" )
Defines values for CreateBotRequestChatMode.
type CreateBotRequestMarkAsReadMode ¶
type CreateBotRequestMarkAsReadMode string
CreateBotRequestMarkAsReadMode Automatic read setting for messages. - `auto`: Auto read setting is enabled - `manual`: Auto read setting is disabled
const ( CreateBotRequestMarkAsReadModeAuto CreateBotRequestMarkAsReadMode = "auto" CreateBotRequestMarkAsReadModeManual CreateBotRequestMarkAsReadMode = "manual" )
Defines values for CreateBotRequestMarkAsReadMode.
type CreateBotRequestObject ¶
type CreateBotRequestObject struct {
Body *CreateBotJSONRequestBody
}
type CreateBotResponseObject ¶
type CreateBotResponseObject interface {
VisitCreateBotResponse(w http.ResponseWriter) error
}
type CreateFollowers201JSONResponse ¶
type CreateFollowers201JSONResponse CreateFollowersResponse
func (CreateFollowers201JSONResponse) VisitCreateFollowersResponse ¶
func (response CreateFollowers201JSONResponse) VisitCreateFollowersResponse(w http.ResponseWriter) error
type CreateFollowers400JSONResponse ¶
type CreateFollowers400JSONResponse ErrorResponse
func (CreateFollowers400JSONResponse) VisitCreateFollowersResponse ¶
func (response CreateFollowers400JSONResponse) VisitCreateFollowersResponse(w http.ResponseWriter) error
type CreateFollowers404JSONResponse ¶
type CreateFollowers404JSONResponse ErrorResponse
func (CreateFollowers404JSONResponse) VisitCreateFollowersResponse ¶
func (response CreateFollowers404JSONResponse) VisitCreateFollowersResponse(w http.ResponseWriter) error
type CreateFollowers500JSONResponse ¶
type CreateFollowers500JSONResponse ErrorResponse
func (CreateFollowers500JSONResponse) VisitCreateFollowersResponse ¶
func (response CreateFollowers500JSONResponse) VisitCreateFollowersResponse(w http.ResponseWriter) error
type CreateFollowersJSONRequestBody ¶
type CreateFollowersJSONRequestBody = CreateFollowersRequest
CreateFollowersJSONRequestBody defines body for CreateFollowers for application/json ContentType.
type CreateFollowersRequest ¶
type CreateFollowersRequest struct {
// Count Number of dummy followers to create
Count int `json:"count"`
}
CreateFollowersRequest defines model for CreateFollowersRequest.
type CreateFollowersRequestObject ¶
type CreateFollowersRequestObject struct {
BotId string `json:"botId"`
Body *CreateFollowersJSONRequestBody
}
type CreateFollowersResponse ¶
type CreateFollowersResponse struct {
// Count Number of followers created
Count int `json:"count"`
// Followers List of created follower profiles
Followers []FollowerProfile `json:"followers"`
}
CreateFollowersResponse defines model for CreateFollowersResponse.
type CreateFollowersResponseObject ¶
type CreateFollowersResponseObject interface {
VisitCreateFollowersResponse(w http.ResponseWriter) error
}
type ErrorResponse ¶
type ErrorResponse struct {
Error struct {
// Code Error code
Code *string `json:"code,omitempty"`
// Message Error message
Message string `json:"message"`
} `json:"error"`
}
ErrorResponse defines model for ErrorResponse.
type FollowerProfile ¶
type FollowerProfile struct {
// DisplayName Display name of the follower
DisplayName string `json:"displayName"`
// Language User's language
Language *string `json:"language,omitempty"`
// PictureUrl Profile image URL. HTTPS image URL. Not included if the user doesn't have a profile image.
PictureUrl *string `json:"pictureUrl,omitempty"`
// StatusMessage User's status message. Not included if the user doesn't have a status message.
StatusMessage *string `json:"statusMessage,omitempty"`
// UserId User ID of the follower
UserId string `json:"userId"`
}
FollowerProfile defines model for FollowerProfile.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type ListUserMessages200JSONResponse ¶
type ListUserMessages200JSONResponse ListUserMessagesResponse
func (ListUserMessages200JSONResponse) VisitListUserMessagesResponse ¶
func (response ListUserMessages200JSONResponse) VisitListUserMessagesResponse(w http.ResponseWriter) error
type ListUserMessages404JSONResponse ¶
type ListUserMessages404JSONResponse ErrorResponse
func (ListUserMessages404JSONResponse) VisitListUserMessagesResponse ¶
func (response ListUserMessages404JSONResponse) VisitListUserMessagesResponse(w http.ResponseWriter) error
type ListUserMessages500JSONResponse ¶
type ListUserMessages500JSONResponse ErrorResponse
func (ListUserMessages500JSONResponse) VisitListUserMessagesResponse ¶
func (response ListUserMessages500JSONResponse) VisitListUserMessagesResponse(w http.ResponseWriter) error
type ListUserMessagesResponse ¶
type ListUserMessagesResponse struct {
Messages []ReceivedMessage `json:"messages"`
}
ListUserMessagesResponse defines model for ListUserMessagesResponse.
type ListUserMessagesResponseObject ¶
type ListUserMessagesResponseObject interface {
VisitListUserMessagesResponse(w http.ResponseWriter) error
}
type ReceivedMessage ¶
type ReceivedMessage struct {
// Id ID of the send request
Id string `json:"id"`
// Messages Message objects exactly as the bot sent them
Messages []map[string]interface{} `json:"messages"`
// SendType How the bot sent the messages
SendType ReceivedMessageSendType `json:"sendType"`
// SentAt When the bot sent the messages
SentAt time.Time `json:"sentAt"`
}
ReceivedMessage defines model for ReceivedMessage.
type ReceivedMessageSendType ¶
type ReceivedMessageSendType string
ReceivedMessageSendType How the bot sent the messages
const ( Broadcast ReceivedMessageSendType = "broadcast" Multicast ReceivedMessageSendType = "multicast" Narrowcast ReceivedMessageSendType = "narrowcast" Push ReceivedMessageSendType = "push" Reply ReceivedMessageSendType = "reply" )
Defines values for ReceivedMessageSendType.
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type SendUserEvent200JSONResponse ¶
type SendUserEvent200JSONResponse SendUserEventResponse
func (SendUserEvent200JSONResponse) VisitSendUserEventResponse ¶
func (response SendUserEvent200JSONResponse) VisitSendUserEventResponse(w http.ResponseWriter) error
type SendUserEvent400JSONResponse ¶
type SendUserEvent400JSONResponse ErrorResponse
func (SendUserEvent400JSONResponse) VisitSendUserEventResponse ¶
func (response SendUserEvent400JSONResponse) VisitSendUserEventResponse(w http.ResponseWriter) error
type SendUserEvent404JSONResponse ¶
type SendUserEvent404JSONResponse ErrorResponse
func (SendUserEvent404JSONResponse) VisitSendUserEventResponse ¶
func (response SendUserEvent404JSONResponse) VisitSendUserEventResponse(w http.ResponseWriter) error
type SendUserEvent500JSONResponse ¶
type SendUserEvent500JSONResponse ErrorResponse
func (SendUserEvent500JSONResponse) VisitSendUserEventResponse ¶
func (response SendUserEvent500JSONResponse) VisitSendUserEventResponse(w http.ResponseWriter) error
type SendUserEventJSONRequestBody ¶
type SendUserEventJSONRequestBody = SendUserEventRequest
SendUserEventJSONRequestBody defines body for SendUserEvent for application/json ContentType.
type SendUserEventRequest ¶
type SendUserEventRequest struct {
// Message Required when type is `message`
Message *struct {
// Text Text of the message
Text string `json:"text"`
} `json:"message,omitempty"`
// Postback Required when type is `postback`
Postback *struct {
// Data Postback data of the action
Data string `json:"data"`
// Params Values selected in a datetime picker or rich menu switch action
Params *map[string]string `json:"params,omitempty"`
} `json:"postback,omitempty"`
// Type Action the user performs.
// - `follow`: Adds the bot as a friend
// - `unfollow`: Blocks the bot
// - `message`: Sends a text message. The user must follow the bot.
// - `postback`: Triggers a postback action. The user must follow the bot.
Type SendUserEventRequestType `json:"type"`
}
SendUserEventRequest defines model for SendUserEventRequest.
type SendUserEventRequestObject ¶
type SendUserEventRequestObject struct {
BotId BotId `json:"botId"`
UserId UserId `json:"userId"`
Body *SendUserEventJSONRequestBody
}
type SendUserEventRequestType ¶
type SendUserEventRequestType string
SendUserEventRequestType Action the user performs. - `follow`: Adds the bot as a friend - `unfollow`: Blocks the bot - `message`: Sends a text message. The user must follow the bot. - `postback`: Triggers a postback action. The user must follow the bot.
const ( Follow SendUserEventRequestType = "follow" Message SendUserEventRequestType = "message" Postback SendUserEventRequestType = "postback" Unfollow SendUserEventRequestType = "unfollow" )
Defines values for SendUserEventRequestType.
type SendUserEventResponse ¶
type SendUserEventResponse struct {
// Delivered Whether the bot's webhook endpoint accepted the event
Delivered bool `json:"delivered"`
// Detail Why the event wasn't delivered. Not included when delivered is true.
Detail *string `json:"detail,omitempty"`
// ReplyToken Reply token of the event. Not included for events that can't be replied to.
ReplyToken *string `json:"replyToken,omitempty"`
// WebhookEventId ID of the webhook event generated for the action
WebhookEventId string `json:"webhookEventId"`
}
SendUserEventResponse defines model for SendUserEventResponse.
type SendUserEventResponseObject ¶
type SendUserEventResponseObject interface {
VisitSendUserEventResponse(w http.ResponseWriter) error
}
type ServerInterface ¶
type ServerInterface interface {
// Create a new bot
// (POST /admin/bots)
CreateBot(w http.ResponseWriter, r *http.Request)
// Create dummy followers for a bot
// (POST /admin/bots/{botId}/followers)
CreateFollowers(w http.ResponseWriter, r *http.Request, botId string)
// Act as a user towards a bot
// (POST /admin/bots/{botId}/users/{userId}/events)
SendUserEvent(w http.ResponseWriter, r *http.Request, botId BotId, userId UserId)
// List messages a user received from a bot
// (GET /admin/bots/{botId}/users/{userId}/messages)
ListUserMessages(w http.ResponseWriter, r *http.Request, botId BotId, userId UserId)
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
func NewStrictHandlerWithOptions ¶
func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) CreateBot ¶
func (siw *ServerInterfaceWrapper) CreateBot(w http.ResponseWriter, r *http.Request)
CreateBot operation middleware
func (*ServerInterfaceWrapper) CreateFollowers ¶
func (siw *ServerInterfaceWrapper) CreateFollowers(w http.ResponseWriter, r *http.Request)
CreateFollowers operation middleware
func (*ServerInterfaceWrapper) ListUserMessages ¶
func (siw *ServerInterfaceWrapper) ListUserMessages(w http.ResponseWriter, r *http.Request)
ListUserMessages operation middleware
func (*ServerInterfaceWrapper) SendUserEvent ¶
func (siw *ServerInterfaceWrapper) SendUserEvent(w http.ResponseWriter, r *http.Request)
SendUserEvent operation middleware
type StrictHTTPServerOptions ¶
type StrictHTTPServerOptions struct {
RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type StrictHandlerFunc ¶
type StrictHandlerFunc = strictnethttp.StrictHTTPHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictnethttp.StrictHTTPMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// Create a new bot
// (POST /admin/bots)
CreateBot(ctx context.Context, request CreateBotRequestObject) (CreateBotResponseObject, error)
// Create dummy followers for a bot
// (POST /admin/bots/{botId}/followers)
CreateFollowers(ctx context.Context, request CreateFollowersRequestObject) (CreateFollowersResponseObject, error)
// Act as a user towards a bot
// (POST /admin/bots/{botId}/users/{userId}/events)
SendUserEvent(ctx context.Context, request SendUserEventRequestObject) (SendUserEventResponseObject, error)
// List messages a user received from a bot
// (GET /admin/bots/{botId}/users/{userId}/messages)
ListUserMessages(ctx context.Context, request ListUserMessagesRequestObject) (ListUserMessagesResponseObject, error)
}
StrictServerInterface represents all server handlers.
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) CreateBot ¶
func (_ Unimplemented) CreateBot(w http.ResponseWriter, r *http.Request)
Create a new bot (POST /admin/bots)
func (Unimplemented) CreateFollowers ¶
func (_ Unimplemented) CreateFollowers(w http.ResponseWriter, r *http.Request, botId string)
Create dummy followers for a bot (POST /admin/bots/{botId}/followers)
func (Unimplemented) ListUserMessages ¶
func (_ Unimplemented) ListUserMessages(w http.ResponseWriter, r *http.Request, botId BotId, userId UserId)
List messages a user received from a bot (GET /admin/bots/{botId}/users/{userId}/messages)
func (Unimplemented) SendUserEvent ¶
func (_ Unimplemented) SendUserEvent(w http.ResponseWriter, r *http.Request, botId BotId, userId UserId)
Act as a user towards a bot (POST /admin/bots/{botId}/users/{userId}/events)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error