Documentation ¶
Index ¶
- Constants
- func Bool(v bool) *bool
- func Int(v int) *int
- func Int64(v int64) *int64
- func MustParseInt64(v string) int64
- func ParseInt64(v string) (int64, error)
- func String(v string) *string
- type AccessTokenResponse
- type Attributes
- type CalendarAppAuthenticator
- type CalendarAppClient
- func (c *CalendarAppClient) CreateCalendarEvent(ctx context.Context, accessToken string, req *CreateCalendarEventRequest) (*CreateCalendarEventResponse, *http.Response, error)
- func (c *CalendarAppClient) DeleteCalendarEvent(ctx context.Context, accessToken string, eventID string) (*DeleteCalendarEventResponse, *http.Response, error)
- func (c *CalendarAppClient) UpdateCalendarEvent(ctx context.Context, accessToken string, eventID string, ...) (*UpdateCalendarEventResponse, *http.Response, error)
- type CalendarAppWebhook
- type CalendarEventRequest
- type CalendarEventRequestData
- type CalendarEventResponse
- type CalendarEventResponseData
- type Client
- func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*http.Response, error)
- func (c *Client) NewCalendarRequest(method, path string, accessToken string, body interface{}) (*http.Request, error)
- func (c *Client) NewInstallationsRequest(method, path string, body interface{}) (*http.Request, error)
- func (c *Client) WithHTTPClient(httpClient *http.Client) *Client
- type CreateCalendarEventRequest
- type CreateCalendarEventResponse
- type DeleteCalendarEventResponse
- type ErrorResponse
- type RateLimit
- type UpdateCalendarEventRequest
- type UpdateCalendarEventResponse
Constants ¶
View Source
const ( HeaderRateLimit = "X-RateLimit-Limit" HeaderRateRemaining = "X-RateLimit-Remaining" HeaderRateReset = "X-RateLimit-Reset" )
View Source
const (
APIEndpoint = "https://timetreeapis.com"
)
API endpoint base constants
View Source
const DefaultAccessTokenLifetime = 600
DefaultAccessTokenLifetime token expiration time (10 minute maximum)
Variables ¶
This section is empty.
Functions ¶
func MustParseInt64 ¶
MustParseInt64 string to int64 without error function
Types ¶
type AccessTokenResponse ¶
type AccessTokenResponse struct { ErrorResponse AccessToken string `json:"access_token,omitempty"` ExpireAt int64 `json:"expire_at,omitempty"` TokenType string `json:"token_type,omitempty"` }
AccessTokenResponse type
type Attributes ¶
type Attributes struct { Category string `json:"category,omitempty"` Title string `json:"title,omitempty"` AllDay *bool `json:"all_day,omitempty"` StartAt string `json:"start_at,omitempty"` StartTimezone string `json:"start_timezone,omitempty"` EndAt string `json:"end_at,omitempty"` EndTimezone string `json:"end_timezone,omitempty"` Description string `json:"description,omitempty"` Location string `json:"location,omitempty"` URL string `json:"url,omitempty"` }
type CalendarAppAuthenticator ¶
type CalendarAppAuthenticator struct {
// contains filtered or unexported fields
}
func (*CalendarAppAuthenticator) AccessToken ¶
func (c *CalendarAppAuthenticator) AccessToken(ctx context.Context, installationID string) (*AccessTokenResponse, *http.Response, error)
AccessToken アクセストークンの取得
type CalendarAppClient ¶
type CalendarAppClient struct {
// contains filtered or unexported fields
}
func NewCalendarAppClient ¶
func NewCalendarAppClient(httpClient *http.Client) (*CalendarAppClient, error)
func (*CalendarAppClient) CreateCalendarEvent ¶
func (c *CalendarAppClient) CreateCalendarEvent(ctx context.Context, accessToken string, req *CreateCalendarEventRequest) (*CreateCalendarEventResponse, *http.Response, error)
CreateCalendarEvent 予定の作成
func (*CalendarAppClient) DeleteCalendarEvent ¶
func (c *CalendarAppClient) DeleteCalendarEvent(ctx context.Context, accessToken string, eventID string) (*DeleteCalendarEventResponse, *http.Response, error)
DeleteCalendarEvent 予定の削除
func (*CalendarAppClient) UpdateCalendarEvent ¶
func (c *CalendarAppClient) UpdateCalendarEvent(ctx context.Context, accessToken string, eventID string, req *UpdateCalendarEventRequest) (*UpdateCalendarEventResponse, *http.Response, error)
UpdateCalendarEvent 予定の更新
type CalendarAppWebhook ¶
type CalendarAppWebhook struct {
// contains filtered or unexported fields
}
func NewCalendarAppWebhook ¶
func NewCalendarAppWebhook(secret string) *CalendarAppWebhook
type CalendarEventRequest ¶
type CalendarEventRequest struct {
Data *CalendarEventRequestData `json:"data,omitempty"`
}
type CalendarEventRequestData ¶
type CalendarEventRequestData struct {
Attributes *Attributes `json:"attributes,omitempty"`
}
type CalendarEventResponse ¶
type CalendarEventResponse struct { ErrorResponse Data *CalendarEventResponseData `json:"data,omitempty"` }
type CalendarEventResponseData ¶
type CalendarEventResponseData struct { ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` Attributes *Attributes `json:"attributes,omitempty"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client type
func (*Client) NewCalendarRequest ¶
func (c *Client) NewCalendarRequest(method, path string, accessToken string, body interface{}) (*http.Request, error)
NewCalendarRequest method
type CreateCalendarEventRequest ¶
type CreateCalendarEventRequest CalendarEventRequest
type CreateCalendarEventResponse ¶
type CreateCalendarEventResponse CalendarEventResponse
type DeleteCalendarEventResponse ¶
type DeleteCalendarEventResponse struct {
ErrorResponse
}
type ErrorResponse ¶
type RateLimit ¶
type RateLimit struct { Limit int `json:"limit"` Remaining int `json:"remaining"` Reset int64 `json:"reset"` }
func ParseRateLimit ¶
type UpdateCalendarEventRequest ¶
type UpdateCalendarEventRequest CalendarEventRequest
type UpdateCalendarEventResponse ¶
type UpdateCalendarEventResponse CalendarEventResponse
Click to show internal directories.
Click to hide internal directories.