api

package
v0.0.0-...-adaf6a7 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package api 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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type Admin

type Admin struct {
	// Id traQ ID
	Id string `json:"id"`
}

Admin 管理者の情報

type Customer

type Customer struct {
	// Email Email
	Email *string `json:"email,omitempty"`

	// Id Customer ID
	Id *string `json:"id,omitempty"`

	// Name Name
	Name *string `json:"name,omitempty"`

	// TraqId traQ ID
	TraqId *string `json:"traq_id,omitempty"`
}

Customer Customer の情報

type CustomerId

type CustomerId = string

CustomerId defines model for CustomerId.

type DeleteAdminParams

type DeleteAdminParams struct {
	// Id 管理者の traQ ID
	Id string `form:"id" json:"id"`
}

DeleteAdminParams defines parameters for DeleteAdmin.

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type EndingBefore

type EndingBefore = string

EndingBefore defines model for EndingBefore.

type GetCheckoutSessionsParams

type GetCheckoutSessionsParams struct {
	// CustomerId Customer ID
	CustomerId *CustomerId `form:"customer_id,omitempty" json:"customer_id,omitempty"`

	// SubscriptionId Subscription ID
	SubscriptionId *SubscriptionId `form:"subscription_id,omitempty" json:"subscription_id,omitempty"`

	// Limit 取得件数
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// StartingAfter 指定された ID のオブジェクト以降のオブジェクトを取得
	StartingAfter *StartingAfter `form:"starting_after,omitempty" json:"starting_after,omitempty"`

	// EndingBefore 指定された ID のオブジェクト以前のオブジェクトを取得
	EndingBefore *EndingBefore `form:"ending_before,omitempty" json:"ending_before,omitempty"`

	// PaymentIntentId PaymentIntent ID
	PaymentIntentId *string `form:"payment_intent_id,omitempty" json:"payment_intent_id,omitempty"`

	// Status Checkout Session のステータス
	Status *GetCheckoutSessionsParamsStatus `form:"status,omitempty" json:"status,omitempty"`
}

GetCheckoutSessionsParams defines parameters for GetCheckoutSessions.

type GetCheckoutSessionsParamsStatus

type GetCheckoutSessionsParamsStatus string

GetCheckoutSessionsParamsStatus defines parameters for GetCheckoutSessions.

const (
	GetCheckoutSessionsParamsStatusComplete GetCheckoutSessionsParamsStatus = "complete"
	GetCheckoutSessionsParamsStatusExpired  GetCheckoutSessionsParamsStatus = "expired"
	GetCheckoutSessionsParamsStatusOpen     GetCheckoutSessionsParamsStatus = "open"
)

Defines values for GetCheckoutSessionsParamsStatus.

type GetCheckoutSessionsResponse

type GetCheckoutSessionsResponse struct {
	Data *[]struct {
		// AmountSubtotal 割引・税金を含まない支払い金額
		AmountSubtotal *int `json:"amount_subtotal,omitempty"`

		// AmountTotal 支払い金額
		AmountTotal *int `json:"amount_total,omitempty"`

		// Created 作成日時 (Unix 時間)
		Created *int `json:"created,omitempty"`

		// Customer Customer の情報
		Customer *Customer `json:"customer,omitempty"`

		// Id Checkout Session ID
		Id *string `json:"id,omitempty"`

		// PaymentIntent この Checkout Session に関連付けられた PaymentIntent
		PaymentIntent *string `json:"payment_intent,omitempty"`

		// ProductId Product ID
		ProductId *string `json:"product_id,omitempty"`

		// Status Checkout Session のステータス
		Status *GetCheckoutSessionsResponseDataStatus `json:"status,omitempty"`
	} `json:"data,omitempty"`

	// HasMore 次のページがあるか
	HasMore *bool `json:"has_more,omitempty"`
}

GetCheckoutSessionsResponse オンライン決済ページ由来の入金一覧

type GetCheckoutSessionsResponseDataStatus

type GetCheckoutSessionsResponseDataStatus string

GetCheckoutSessionsResponseDataStatus Checkout Session のステータス

const (
	GetCheckoutSessionsResponseDataStatusComplete GetCheckoutSessionsResponseDataStatus = "complete"
	GetCheckoutSessionsResponseDataStatusExpired  GetCheckoutSessionsResponseDataStatus = "expired"
	GetCheckoutSessionsResponseDataStatusOpen     GetCheckoutSessionsResponseDataStatus = "open"
)

Defines values for GetCheckoutSessionsResponseDataStatus.

type GetCustomerParams

type GetCustomerParams struct {
	// CustomerId Customer ID
	CustomerId *CustomerId `form:"customer_id,omitempty" json:"customer_id,omitempty"`

	// TraqId traQ ID
	TraqId *string `form:"traq_id,omitempty" json:"traq_id,omitempty"`

	// Email Email
	Email *string `form:"email,omitempty" json:"email,omitempty"`
}

GetCustomerParams defines parameters for GetCustomer.

type GetInvoicesParams

type GetInvoicesParams struct {
	// CustomerId Customer ID
	CustomerId *CustomerId `form:"customer_id,omitempty" json:"customer_id,omitempty"`

	// SubscriptionId Subscription ID
	SubscriptionId *SubscriptionId `form:"subscription_id,omitempty" json:"subscription_id,omitempty"`

	// Limit 取得件数
	Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"`

	// StartingAfter 指定された ID のオブジェクト以降のオブジェクトを取得
	StartingAfter *StartingAfter `form:"starting_after,omitempty" json:"starting_after,omitempty"`

	// EndingBefore 指定された ID のオブジェクト以前のオブジェクトを取得
	EndingBefore *EndingBefore `form:"ending_before,omitempty" json:"ending_before,omitempty"`

	// Status 請求書ステータス
	Status *GetInvoicesParamsStatus `form:"status,omitempty" json:"status,omitempty"`

	// CollectionMethod 請求書の支払い方法
	CollectionMethod *GetInvoicesParamsCollectionMethod `form:"collection_method,omitempty" json:"collection_method,omitempty"`
}

GetInvoicesParams defines parameters for GetInvoices.

type GetInvoicesParamsCollectionMethod

type GetInvoicesParamsCollectionMethod string

GetInvoicesParamsCollectionMethod defines parameters for GetInvoices.

const (
	ChargeAutomatically GetInvoicesParamsCollectionMethod = "charge_automatically"
	SendInvoice         GetInvoicesParamsCollectionMethod = "send_invoice"
)

Defines values for GetInvoicesParamsCollectionMethod.

type GetInvoicesParamsStatus

type GetInvoicesParamsStatus string

GetInvoicesParamsStatus defines parameters for GetInvoices.

const (
	GetInvoicesParamsStatusDraft         GetInvoicesParamsStatus = "draft"
	GetInvoicesParamsStatusOpen          GetInvoicesParamsStatus = "open"
	GetInvoicesParamsStatusPaid          GetInvoicesParamsStatus = "paid"
	GetInvoicesParamsStatusUncollectible GetInvoicesParamsStatus = "uncollectible"
	GetInvoicesParamsStatusVoid          GetInvoicesParamsStatus = "void"
)

Defines values for GetInvoicesParamsStatus.

type Invoice

type Invoice struct {
	Data *[]struct {
		// AmountDue 最終的に支払う金額
		AmountDue *int `json:"amount_due,omitempty"`

		// AmountPaid 支払い済み金額
		AmountPaid *int `json:"amount_paid,omitempty"`

		// AmountRemaining 支払い残高
		AmountRemaining *int `json:"amount_remaining,omitempty"`

		// Created 作成日時 (Unix 時間)
		Created *int `json:"created,omitempty"`

		// Customer Customer の情報
		Customer *Customer `json:"customer,omitempty"`

		// Id Invoice ID
		Id *string `json:"id,omitempty"`

		// PaymentIntent この請求書に関連付けられた PaymentIntent
		PaymentIntent *string `json:"payment_intent,omitempty"`

		// ProductId Product ID
		ProductId *string `json:"product_id,omitempty"`

		// Status 請求書ステータス
		Status *InvoiceDataStatus `json:"status,omitempty"`
	} `json:"data,omitempty"`

	// HasMore 次のページがあるか
	HasMore *bool `json:"has_more,omitempty"`
}

Invoice Invoice の情報

type InvoiceDataStatus

type InvoiceDataStatus string

InvoiceDataStatus 請求書ステータス

const (
	InvoiceDataStatusDraft         InvoiceDataStatus = "draft"
	InvoiceDataStatusOpen          InvoiceDataStatus = "open"
	InvoiceDataStatusPaid          InvoiceDataStatus = "paid"
	InvoiceDataStatusUncollectible InvoiceDataStatus = "uncollectible"
	InvoiceDataStatusVoid          InvoiceDataStatus = "void"
)

Defines values for InvoiceDataStatus.

type Limit

type Limit = int

Limit defines model for Limit.

type PatchCustomerJSONRequestBody

type PatchCustomerJSONRequestBody = PostCustomerRequest

PatchCustomerJSONRequestBody defines body for PatchCustomer for application/json ContentType.

type PostAdminJSONRequestBody

type PostAdminJSONRequestBody = Admin

PostAdminJSONRequestBody defines body for PostAdmin for application/json ContentType.

type PostCustomerJSONRequestBody

type PostCustomerJSONRequestBody = PostCustomerRequest

PostCustomerJSONRequestBody defines body for PostCustomer for application/json ContentType.

type PostCustomerRequest

type PostCustomerRequest struct {
	// Email Email
	Email string `json:"email"`

	// Name Name
	Name string `json:"name"`

	// TraqId traQ ID
	TraqId *string `json:"traq_id,omitempty"`
}

PostCustomerRequest Customer 作成リクエスト

type PostInvoiceJSONRequestBody

type PostInvoiceJSONRequestBody = PostInvoiceRequest

PostInvoiceJSONRequestBody defines body for PostInvoice for application/json ContentType.

type PostInvoiceRequest

type PostInvoiceRequest struct {
	// CustomerId Customer ID
	CustomerId string `json:"customer_id"`

	// ProductId Product ID
	ProductId string `json:"product_id"`
}

PostInvoiceRequest Invoice 作成リクエスト

type PostWebhookInvoicePaidJSONRequestBody

type PostWebhookInvoicePaidJSONRequestBody = Invoice

PostWebhookInvoicePaidJSONRequestBody defines body for PostWebhookInvoicePaid for application/json ContentType.

type PostWebhookInvoicePaidParams

type PostWebhookInvoicePaidParams struct {
	// StripeSignature Stripe が送信する認証情報
	StripeSignature string `json:"Stripe-Signature"`
}

PostWebhookInvoicePaidParams defines parameters for PostWebhookInvoicePaid.

type ServerInterface

type ServerInterface interface {
	// 管理者を削除
	// (DELETE /admin)
	DeleteAdmin(ctx echo.Context, params DeleteAdminParams) error
	// 管理者の一覧を取得
	// (GET /admin)
	GetAdmins(ctx echo.Context) error
	// 管理者を作成
	// (POST /admin)
	PostAdmin(ctx echo.Context) error
	// Customer を取得
	// (GET /customer)
	GetCustomer(ctx echo.Context, params GetCustomerParams) error
	// Customer を更新
	// (PATCH /customer)
	PatchCustomer(ctx echo.Context) error
	// Customer を作成
	// (POST /customer)
	PostCustomer(ctx echo.Context) error
	// Invoice を作成
	// (POST /invoice)
	PostInvoice(ctx echo.Context) error
	// オンライン決済ページ由来の入金一覧を取得
	// (GET /list/checkout-sessions)
	GetCheckoutSessions(ctx echo.Context, params GetCheckoutSessionsParams) error
	// 請求書由来の入金一覧を取得
	// (GET /list/invoices)
	GetInvoices(ctx echo.Context, params GetInvoicesParams) error
	// Webhook の invoice.paid イベントを受け取る
	// (POST /webhook/invoice-paid)
	PostWebhookInvoicePaid(ctx echo.Context, params PostWebhookInvoicePaidParams) error
}

ServerInterface represents all server handlers.

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) DeleteAdmin

func (w *ServerInterfaceWrapper) DeleteAdmin(ctx echo.Context) error

DeleteAdmin converts echo context to params.

func (*ServerInterfaceWrapper) GetAdmins

func (w *ServerInterfaceWrapper) GetAdmins(ctx echo.Context) error

GetAdmins converts echo context to params.

func (*ServerInterfaceWrapper) GetCheckoutSessions

func (w *ServerInterfaceWrapper) GetCheckoutSessions(ctx echo.Context) error

GetCheckoutSessions converts echo context to params.

func (*ServerInterfaceWrapper) GetCustomer

func (w *ServerInterfaceWrapper) GetCustomer(ctx echo.Context) error

GetCustomer converts echo context to params.

func (*ServerInterfaceWrapper) GetInvoices

func (w *ServerInterfaceWrapper) GetInvoices(ctx echo.Context) error

GetInvoices converts echo context to params.

func (*ServerInterfaceWrapper) PatchCustomer

func (w *ServerInterfaceWrapper) PatchCustomer(ctx echo.Context) error

PatchCustomer converts echo context to params.

func (*ServerInterfaceWrapper) PostAdmin

func (w *ServerInterfaceWrapper) PostAdmin(ctx echo.Context) error

PostAdmin converts echo context to params.

func (*ServerInterfaceWrapper) PostCustomer

func (w *ServerInterfaceWrapper) PostCustomer(ctx echo.Context) error

PostCustomer converts echo context to params.

func (*ServerInterfaceWrapper) PostInvoice

func (w *ServerInterfaceWrapper) PostInvoice(ctx echo.Context) error

PostInvoice converts echo context to params.

func (*ServerInterfaceWrapper) PostWebhookInvoicePaid

func (w *ServerInterfaceWrapper) PostWebhookInvoicePaid(ctx echo.Context) error

PostWebhookInvoicePaid converts echo context to params.

type StartingAfter

type StartingAfter = string

StartingAfter defines model for StartingAfter.

type SubscriptionId

type SubscriptionId = string

SubscriptionId defines model for SubscriptionId.

Jump to

Keyboard shortcuts

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