slack

package module
v0.0.0-...-1aaae71 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: MIT Imports: 15 Imported by: 8

README

slack

Build Status

GoDoc

Status

  • Many APIs are still unimplemented (please file an issue!)
  • RTM events are not covered entirely yet (please file an issue!)

Missing parts are missing only because the author does not have immediate need for them. With proper prodding, I will gladly take on implementing them.

Please see #4 for a list of currently known unimplemented methods.

Features

Auto-generated API

All of the APIs in this library is generated by a tool, reducing human errors.

Supports Google App Engine

Google App Engine does not allow the use of raw net/http clients. Instead you need to use the urlfetch package. This library allows you to pass the HTTP client that it should use:

ctx := appengine.NewContext(r)
httpCl := urlfetch.Client(ctx)
slackCl := slack.New(token, slack.WithClient(httpCl))

Google API style library

All of the APIs in this library resemble that of google.golang.org/api, and is very predictable across all APIs.

Full support for context.Context

The API is designed from the ground up to integrate well with context.Context.

Mock Server

A server that mocks the Slack API calls is available, which should help you integrate your applications with Slack while you are still in development.

Note: many mock methods are still NOT properly implemented. Please see server/mockserver/mockserver.go and server/mockserver/response.go. PRs welcome!

Slack Proxy

Sometimes you want a tool that talks to the Slack API, but don't want to really send messages. We have a simple server that can intercept methods that have side effects, while sending everything else to the real Slack API server, called slaproxy (you can compile it from cmd/slaproxy/slaproxy.go)

We even have Docker container for it

docker run -e SLACK_TOKEN=xxx -e SLACK_LISTEN=:9999 lestrrat/slaproxy

Synopsis

Simple REST Client:

package slack_test

import (
  "context"
  "fmt"
  "os"

  "github.com/lestrrat-go/slack"
)

func ExampleClient() {
  ctx, cancel := context.WithCancel(context.Background())
  defer cancel()

  token := os.Getenv("SLACK_TOKEN")
  cl := slack.New(token)

  // check if we are connected
  authres, err := cl.Auth().Test().Do(ctx)
  if err != nil {
    fmt.Printf("failed to test authentication: %s\n", err)
    return
  }
  fmt.Printf("%#v\n", authres)

  // simplest possible message
  chatres, err := cl.Chat().PostMessage("@username").
    Text("Hello, World!").
    Do(ctx)
  if err != nil {
    fmt.Printf("failed to post messsage: %s\n", err)
    return
  }
  fmt.Printf("%#v\n", chatres)
}

A mock server

package slack_test

import (
  "context"
  "net/http"
  "time"

  "github.com/lestrrat-go/slack"
  "github.com/lestrrat-go/slack/server"
  "github.com/lestrrat-go/slack/server/mockserver"
)

func ExampleMockServer() {
  token := "..."
  h := mockserver.New(mockserver.WithToken(token))
  s := server.New()

  h.InstallHandlers(s)

  srv := http.Server{Handler: s, Addr: ":8080"}
  go srv.ListenAndServe()
  ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
  defer cancel()
  cl := slack.New(token, slack.WithAPIEndpoint("http://localhost:8080"))
  if _, err := cl.Auth().Test().Do(ctx); err != nil {
    log.Printf("failed to call auth.test: %s", err)
    return
  }

  srv.Shutdown(ctx)
}

RTM

See the README in the rtm/ directory.

Calling Conventions

The API is constructed along the same lines of Google API Go libraries (https://google.golang.org/api), so if you are familiar with that style you should have no problem. But if you have not used their API, I'm sure you're confused - I know I was when I first saw their API.

This section will walk you through how the APIs in this REST client generally work. The basic idea is that you have a central client, which you can create via New:

  client := slack.New(token)

The client is nothing but a placeholder for other "services". For example, to use the slack APIs for chat.* endpoints, lookup the ChatService object which can be obtained by calling the Chat() method:

  service := client.Chat()

The ChatService object can construct an intermediate object, which are called the Call objects. These objects exist to accumulate parameters that you want to ultimately call the API endpoint with.

In the initial call to construct the objects, you will have to enter the mandatory parameters. For example, to start a PostMessage call (which is supposed to access chat.postMessage endpoint), you do:

  call := service.PostMessage(channel)

The channel parameter is required, so you must pass that to the PostMessage method (you would think that text is always required, but you could either provide text, or an attachment with text, so it's not always the case)

Once you have the call object, you can specify additional parameters which are optional. The following would specify a text attribute for this call.

  call.Text(yourMessage)

Finally, when you are done tweaking your call object, you should call Do, which will fire the actual request.

  res, err := call.Do(ctx)

And you are done. Don't for get to pass a context.Context to all Do calls.

Also, for your convenience these call object methods can all be chained. So the above example could look like the following:

  res, err := client.Chat().PostMessage(channel).Text(yourMessage).Do(ctx)

Hacking

To add REST endpoints, edit endpoints.json, and then run

make generate

New code will be generated, and you can run your tests, or compile your program with it.

If you want to dump what go-slack is sending/receiving you can compile your program using the "debug0" tag. Just be aware that it will be very noisy:

go build -tags debug0 -o your-program your-code.go 

Acknowledgements

Based on github.com/nlopes/slack.

Documentation

Overview

Package slack implements a REST client for Slack services.

Index

Examples

Constants

View Source
const (
	ParseFull = "full"
	ParseNone = "none"
)
View Source
const (
	DefaultAPIEndpoint         = "https://slack.com/api/"
	DefaultOAuth2AuthEndpoint  = "https://slack.com/oauth/authorize"
	DefaultOAuth2TokenEndpoint = "https://slack.com/api/oauth.access"
)

DefaultSlackAPIEndpoint contains the prefix used for Slack REST API

View Source
const (
	ChannelsHistoryScope   = "channels:history"
	ChannelsReadScope      = "channels:read"
	ChannelsWriteScope     = "channels:write"
	ChatWriteBotScope      = "chat:write:bot"
	ChatWriteUserScope     = "chat:write:user"
	DndReadScope           = "dnd:read"
	DndWriteScope          = "dnd:write"
	EmojiReadScope         = "emoji:read"
	FilesReadScope         = "files:read"
	FilesWriteUserScope    = "files:write:user"
	GroupsHistoryScope     = "groups:history"
	GroupsReadScope        = "groups:read"
	GroupsWriteScope       = "groups:write"
	IdentityBasicScope     = "identity.basic"
	ImHistoryScope         = "im:history"
	ImReadScope            = "im:read"
	ImWriteScope           = "im:write"
	LinksWriteScope        = "links:write"
	MpimHistoryScope       = "mpim:history"
	MpimReadScope          = "mpim:read"
	MpimWriteScope         = "mpim:write"
	PinsReadScope          = "pins:read"
	PinsWriteScope         = "pins:write"
	ReactionsReadScope     = "reactions:read"
	ReactionsWriteScope    = "reactions:write"
	RemindersReadScope     = "reminders:read"
	RemindersWriteScope    = "reminders:write"
	SearchReadScope        = "search:read"
	StarsReadScope         = "stars:read"
	StarsWriteScope        = "stars:write"
	TeamReadScope          = "team:read"
	UsergroupsReadScope    = "usergroups:read"
	UsergroupsWriteScope   = "usergroups:write"
	UsersProfileReadScope  = "users.profile:read"
	UsersProfileWriteScope = "users.profile:write"
	UsersReadScope         = "users:read"
	UsersWriteScope        = "users:write"
)

These constants match the scopes provided by Slack API

Variables

View Source
var OAuth2Endpoint = oauth2.Endpoint{
	AuthURL:  DefaultOAuth2AuthEndpoint,
	TokenURL: DefaultOAuth2TokenEndpoint,
}

Oauth2Endpoint contains the Slack OAuth2 endpoint configuration

Functions

This section is empty.

Types

type AuthRevokeCall

type AuthRevokeCall struct {
	// contains filtered or unexported fields
}

AuthRevokeCall is created by AuthService.Revoke method call

func (*AuthRevokeCall) Do

func (c *AuthRevokeCall) Do(ctx context.Context) error

Do executes the call to access auth.revoke endpoint

func (*AuthRevokeCall) FromValues

func (c *AuthRevokeCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*AuthRevokeCall) Test

func (c *AuthRevokeCall) Test(test bool) *AuthRevokeCall

Test sets the value for optional test parameter

func (*AuthRevokeCall) ValidateArgs

func (c *AuthRevokeCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the AuthRevokeCall object

func (*AuthRevokeCall) Values

func (c *AuthRevokeCall) Values() (url.Values, error)

Values returns the AuthRevokeCall object as url.Values

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

AuthService handles Auth related endpoints

func (*AuthService) Revoke

func (s *AuthService) Revoke() *AuthRevokeCall

Revoke creates a AuthRevokeCall object in preparation for accessing the auth.revoke endpoint

func (*AuthService) Test

func (s *AuthService) Test() *AuthTestCall

Test creates a AuthTestCall object in preparation for accessing the auth.test endpoint

type AuthTestCall

type AuthTestCall struct {
	// contains filtered or unexported fields
}

AuthTestCall is created by AuthService.Test method call

func (*AuthTestCall) Do

Do executes the call to access auth.test endpoint

func (*AuthTestCall) FromValues

func (c *AuthTestCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*AuthTestCall) ValidateArgs

func (c *AuthTestCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the AuthTestCall object

func (*AuthTestCall) Values

func (c *AuthTestCall) Values() (url.Values, error)

Values returns the AuthTestCall object as url.Values

type BotsInfoCall

type BotsInfoCall struct {
	// contains filtered or unexported fields
}

BotsInfoCall is created by BotsService.Info method call

func (*BotsInfoCall) Do

func (c *BotsInfoCall) Do(ctx context.Context) (*objects.Bot, error)

Do executes the call to access bots.info endpoint

func (*BotsInfoCall) FromValues

func (c *BotsInfoCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*BotsInfoCall) ValidateArgs

func (c *BotsInfoCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the BotsInfoCall object

func (*BotsInfoCall) Values

func (c *BotsInfoCall) Values() (url.Values, error)

Values returns the BotsInfoCall object as url.Values

type BotsService

type BotsService struct {
	// contains filtered or unexported fields
}

BotsService handles Bots related endpoints

func (*BotsService) Info

func (s *BotsService) Info(bot string) *BotsInfoCall

Info creates a BotsInfoCall object in preparation for accessing the bots.info endpoint

type ChannelLink struct {
	ID      string
	Channel string
}

func (*ChannelLink) Data

func (l *ChannelLink) Data() string

func (*ChannelLink) String

func (l *ChannelLink) String() string

func (*ChannelLink) Surface

func (l *ChannelLink) Surface() string

type ChannelsArchiveCall

type ChannelsArchiveCall struct {
	// contains filtered or unexported fields
}

ChannelsArchiveCall is created by ChannelsService.Archive method call

func (*ChannelsArchiveCall) Do

Do executes the call to access channels.archive endpoint

func (*ChannelsArchiveCall) FromValues

func (c *ChannelsArchiveCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsArchiveCall) ValidateArgs

func (c *ChannelsArchiveCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsArchiveCall object

func (*ChannelsArchiveCall) Values

func (c *ChannelsArchiveCall) Values() (url.Values, error)

Values returns the ChannelsArchiveCall object as url.Values

type ChannelsCreateCall

type ChannelsCreateCall struct {
	// contains filtered or unexported fields
}

ChannelsCreateCall is created by ChannelsService.Create method call

func (*ChannelsCreateCall) Do

Do executes the call to access channels.create endpoint

func (*ChannelsCreateCall) FromValues

func (c *ChannelsCreateCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsCreateCall) Validate

func (c *ChannelsCreateCall) Validate(validate bool) *ChannelsCreateCall

Validate sets the value for optional validate parameter

func (*ChannelsCreateCall) ValidateArgs

func (c *ChannelsCreateCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsCreateCall object

func (*ChannelsCreateCall) Values

func (c *ChannelsCreateCall) Values() (url.Values, error)

Values returns the ChannelsCreateCall object as url.Values

type ChannelsHistoryCall

type ChannelsHistoryCall struct {
	// contains filtered or unexported fields
}

ChannelsHistoryCall is created by ChannelsService.History method call

func (*ChannelsHistoryCall) Count

func (c *ChannelsHistoryCall) Count(count int) *ChannelsHistoryCall

Count sets the value for optional count parameter

func (*ChannelsHistoryCall) Do

Do executes the call to access channels.history endpoint

func (*ChannelsHistoryCall) FromValues

func (c *ChannelsHistoryCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsHistoryCall) Inclusive

func (c *ChannelsHistoryCall) Inclusive(inclusive bool) *ChannelsHistoryCall

Inclusive sets the value for optional inclusive parameter

func (*ChannelsHistoryCall) Latest

func (c *ChannelsHistoryCall) Latest(latest string) *ChannelsHistoryCall

Latest sets the value for optional latest parameter

func (*ChannelsHistoryCall) Oldest

func (c *ChannelsHistoryCall) Oldest(oldest string) *ChannelsHistoryCall

Oldest sets the value for optional oldest parameter

func (*ChannelsHistoryCall) Timestamp

func (c *ChannelsHistoryCall) Timestamp(timestamp string) *ChannelsHistoryCall

Timestamp sets the value for optional timestamp parameter

func (*ChannelsHistoryCall) Unreads

func (c *ChannelsHistoryCall) Unreads(unreads bool) *ChannelsHistoryCall

Unreads sets the value for optional unreads parameter

func (*ChannelsHistoryCall) ValidateArgs

func (c *ChannelsHistoryCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsHistoryCall object

func (*ChannelsHistoryCall) Values

func (c *ChannelsHistoryCall) Values() (url.Values, error)

Values returns the ChannelsHistoryCall object as url.Values

type ChannelsInfoCall

type ChannelsInfoCall struct {
	// contains filtered or unexported fields
}

ChannelsInfoCall is created by ChannelsService.Info method call

func (*ChannelsInfoCall) Do

Do executes the call to access channels.info endpoint

func (*ChannelsInfoCall) FromValues

func (c *ChannelsInfoCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsInfoCall) IncludeLocale

func (c *ChannelsInfoCall) IncludeLocale(includeLocale bool) *ChannelsInfoCall

IncludeLocale sets the value for optional includeLocale parameter

func (*ChannelsInfoCall) ValidateArgs

func (c *ChannelsInfoCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsInfoCall object

func (*ChannelsInfoCall) Values

func (c *ChannelsInfoCall) Values() (url.Values, error)

Values returns the ChannelsInfoCall object as url.Values

type ChannelsInviteCall

type ChannelsInviteCall struct {
	// contains filtered or unexported fields
}

ChannelsInviteCall is created by ChannelsService.Invite method call

func (*ChannelsInviteCall) Do

Do executes the call to access channels.invite endpoint

func (*ChannelsInviteCall) FromValues

func (c *ChannelsInviteCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsInviteCall) ValidateArgs

func (c *ChannelsInviteCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsInviteCall object

func (*ChannelsInviteCall) Values

func (c *ChannelsInviteCall) Values() (url.Values, error)

Values returns the ChannelsInviteCall object as url.Values

type ChannelsJoinCall

type ChannelsJoinCall struct {
	// contains filtered or unexported fields
}

ChannelsJoinCall is created by ChannelsService.Join method call

func (*ChannelsJoinCall) Do

Do executes the call to access channels.join endpoint

func (*ChannelsJoinCall) FromValues

func (c *ChannelsJoinCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsJoinCall) Validate

func (c *ChannelsJoinCall) Validate(validate bool) *ChannelsJoinCall

Validate sets the value for optional validate parameter

func (*ChannelsJoinCall) ValidateArgs

func (c *ChannelsJoinCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsJoinCall object

func (*ChannelsJoinCall) Values

func (c *ChannelsJoinCall) Values() (url.Values, error)

Values returns the ChannelsJoinCall object as url.Values

type ChannelsKickCall

type ChannelsKickCall struct {
	// contains filtered or unexported fields
}

ChannelsKickCall is created by ChannelsService.Kick method call

func (*ChannelsKickCall) Do

Do executes the call to access channels.kick endpoint

func (*ChannelsKickCall) FromValues

func (c *ChannelsKickCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsKickCall) ValidateArgs

func (c *ChannelsKickCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsKickCall object

func (*ChannelsKickCall) Values

func (c *ChannelsKickCall) Values() (url.Values, error)

Values returns the ChannelsKickCall object as url.Values

type ChannelsLeaveCall

type ChannelsLeaveCall struct {
	// contains filtered or unexported fields
}

ChannelsLeaveCall is created by ChannelsService.Leave method call

func (*ChannelsLeaveCall) Do

Do executes the call to access channels.leave endpoint

func (*ChannelsLeaveCall) FromValues

func (c *ChannelsLeaveCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsLeaveCall) ValidateArgs

func (c *ChannelsLeaveCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsLeaveCall object

func (*ChannelsLeaveCall) Values

func (c *ChannelsLeaveCall) Values() (url.Values, error)

Values returns the ChannelsLeaveCall object as url.Values

type ChannelsListCall

type ChannelsListCall struct {
	// contains filtered or unexported fields
}

ChannelsListCall is created by ChannelsService.List method call

func (*ChannelsListCall) Do

Do executes the call to access channels.list endpoint

func (*ChannelsListCall) ExcludeArchive

func (c *ChannelsListCall) ExcludeArchive(excludeArchive bool) *ChannelsListCall

ExcludeArchive sets the value for optional excludeArchive parameter

func (*ChannelsListCall) ExcludeMembers

func (c *ChannelsListCall) ExcludeMembers(excludeMembers bool) *ChannelsListCall

ExcludeMembers sets the value for optional excludeMembers parameter

func (*ChannelsListCall) FromValues

func (c *ChannelsListCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsListCall) Limit

func (c *ChannelsListCall) Limit(limit int) *ChannelsListCall

Limit sets the value for optional limit parameter

func (*ChannelsListCall) ValidateArgs

func (c *ChannelsListCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsListCall object

func (*ChannelsListCall) Values

func (c *ChannelsListCall) Values() (url.Values, error)

Values returns the ChannelsListCall object as url.Values

type ChannelsMarkCall

type ChannelsMarkCall struct {
	// contains filtered or unexported fields
}

ChannelsMarkCall is created by ChannelsService.Mark method call

func (*ChannelsMarkCall) Do

Do executes the call to access channels.mark endpoint

func (*ChannelsMarkCall) FromValues

func (c *ChannelsMarkCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsMarkCall) Timestamp

func (c *ChannelsMarkCall) Timestamp(timestamp string) *ChannelsMarkCall

Timestamp sets the value for optional timestamp parameter

func (*ChannelsMarkCall) ValidateArgs

func (c *ChannelsMarkCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsMarkCall object

func (*ChannelsMarkCall) Values

func (c *ChannelsMarkCall) Values() (url.Values, error)

Values returns the ChannelsMarkCall object as url.Values

type ChannelsRenameCall

type ChannelsRenameCall struct {
	// contains filtered or unexported fields
}

ChannelsRenameCall is created by ChannelsService.Rename method call

func (*ChannelsRenameCall) Do

Do executes the call to access channels.rename endpoint

func (*ChannelsRenameCall) FromValues

func (c *ChannelsRenameCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsRenameCall) Validate

func (c *ChannelsRenameCall) Validate(validate bool) *ChannelsRenameCall

Validate sets the value for optional validate parameter

func (*ChannelsRenameCall) ValidateArgs

func (c *ChannelsRenameCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsRenameCall object

func (*ChannelsRenameCall) Values

func (c *ChannelsRenameCall) Values() (url.Values, error)

Values returns the ChannelsRenameCall object as url.Values

type ChannelsRepliesCall

type ChannelsRepliesCall struct {
	// contains filtered or unexported fields
}

ChannelsRepliesCall is created by ChannelsService.Replies method call

func (*ChannelsRepliesCall) Do

Do executes the call to access channels.replies endpoint

func (*ChannelsRepliesCall) FromValues

func (c *ChannelsRepliesCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsRepliesCall) ValidateArgs

func (c *ChannelsRepliesCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsRepliesCall object

func (*ChannelsRepliesCall) Values

func (c *ChannelsRepliesCall) Values() (url.Values, error)

Values returns the ChannelsRepliesCall object as url.Values

type ChannelsService

type ChannelsService struct {
	// contains filtered or unexported fields
}

ChannelsService handles Channels related endpoints

func (*ChannelsService) Archive

func (s *ChannelsService) Archive(channel string) *ChannelsArchiveCall

Archive creates a ChannelsArchiveCall object in preparation for accessing the channels.archive endpoint

func (*ChannelsService) Create

func (s *ChannelsService) Create(name string) *ChannelsCreateCall

Create creates a ChannelsCreateCall object in preparation for accessing the channels.create endpoint

func (*ChannelsService) History

func (s *ChannelsService) History(channel string) *ChannelsHistoryCall

History creates a ChannelsHistoryCall object in preparation for accessing the channels.history endpoint

func (*ChannelsService) Info

func (s *ChannelsService) Info(channel string) *ChannelsInfoCall

Info creates a ChannelsInfoCall object in preparation for accessing the channels.info endpoint

func (*ChannelsService) Invite

func (s *ChannelsService) Invite(channel string, user string) *ChannelsInviteCall

Invite creates a ChannelsInviteCall object in preparation for accessing the channels.invite endpoint

func (*ChannelsService) Join

func (s *ChannelsService) Join(name string) *ChannelsJoinCall

Join creates a ChannelsJoinCall object in preparation for accessing the channels.join endpoint

func (*ChannelsService) Kick

func (s *ChannelsService) Kick(channel string, user string) *ChannelsKickCall

Kick creates a ChannelsKickCall object in preparation for accessing the channels.kick endpoint

func (*ChannelsService) Leave

func (s *ChannelsService) Leave(channel string) *ChannelsLeaveCall

Leave creates a ChannelsLeaveCall object in preparation for accessing the channels.leave endpoint

func (*ChannelsService) List

func (s *ChannelsService) List() *ChannelsListCall

List creates a ChannelsListCall object in preparation for accessing the channels.list endpoint

func (*ChannelsService) Mark

func (s *ChannelsService) Mark(channel string) *ChannelsMarkCall

Mark creates a ChannelsMarkCall object in preparation for accessing the channels.mark endpoint

func (*ChannelsService) Rename

func (s *ChannelsService) Rename(channel string, name string) *ChannelsRenameCall

Rename creates a ChannelsRenameCall object in preparation for accessing the channels.rename endpoint

func (*ChannelsService) Replies

func (s *ChannelsService) Replies(channel string, threadTimestamp string) *ChannelsRepliesCall

Replies creates a ChannelsRepliesCall object in preparation for accessing the channels.replies endpoint

func (*ChannelsService) SetPurpose

func (s *ChannelsService) SetPurpose(channel string, purpose string) *ChannelsSetPurposeCall

SetPurpose creates a ChannelsSetPurposeCall object in preparation for accessing the channels.setPurpose endpoint

func (*ChannelsService) SetTopic

func (s *ChannelsService) SetTopic(channel string, topic string) *ChannelsSetTopicCall

SetTopic creates a ChannelsSetTopicCall object in preparation for accessing the channels.setTopic endpoint

func (*ChannelsService) Unarchive

func (s *ChannelsService) Unarchive(channel string) *ChannelsUnarchiveCall

Unarchive creates a ChannelsUnarchiveCall object in preparation for accessing the channels.unarchive endpoint

type ChannelsSetPurposeCall

type ChannelsSetPurposeCall struct {
	// contains filtered or unexported fields
}

ChannelsSetPurposeCall is created by ChannelsService.SetPurpose method call

func (*ChannelsSetPurposeCall) Do

Do executes the call to access channels.setPurpose endpoint

func (*ChannelsSetPurposeCall) FromValues

func (c *ChannelsSetPurposeCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsSetPurposeCall) ValidateArgs

func (c *ChannelsSetPurposeCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsSetPurposeCall object

func (*ChannelsSetPurposeCall) Values

func (c *ChannelsSetPurposeCall) Values() (url.Values, error)

Values returns the ChannelsSetPurposeCall object as url.Values

type ChannelsSetTopicCall

type ChannelsSetTopicCall struct {
	// contains filtered or unexported fields
}

ChannelsSetTopicCall is created by ChannelsService.SetTopic method call

func (*ChannelsSetTopicCall) Do

Do executes the call to access channels.setTopic endpoint

func (*ChannelsSetTopicCall) FromValues

func (c *ChannelsSetTopicCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsSetTopicCall) ValidateArgs

func (c *ChannelsSetTopicCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsSetTopicCall object

func (*ChannelsSetTopicCall) Values

func (c *ChannelsSetTopicCall) Values() (url.Values, error)

Values returns the ChannelsSetTopicCall object as url.Values

type ChannelsUnarchiveCall

type ChannelsUnarchiveCall struct {
	// contains filtered or unexported fields
}

ChannelsUnarchiveCall is created by ChannelsService.Unarchive method call

func (*ChannelsUnarchiveCall) Do

Do executes the call to access channels.unarchive endpoint

func (*ChannelsUnarchiveCall) FromValues

func (c *ChannelsUnarchiveCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChannelsUnarchiveCall) ValidateArgs

func (c *ChannelsUnarchiveCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChannelsUnarchiveCall object

func (*ChannelsUnarchiveCall) Values

func (c *ChannelsUnarchiveCall) Values() (url.Values, error)

Values returns the ChannelsUnarchiveCall object as url.Values

type ChatDeleteCall

type ChatDeleteCall struct {
	// contains filtered or unexported fields
}

ChatDeleteCall is created by ChatService.Delete method call

func (*ChatDeleteCall) AsUser

func (c *ChatDeleteCall) AsUser(asUser bool) *ChatDeleteCall

AsUser sets the value for optional asUser parameter

func (*ChatDeleteCall) Do

Do executes the call to access chat.delete endpoint

func (*ChatDeleteCall) FromValues

func (c *ChatDeleteCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChatDeleteCall) Timestamp

func (c *ChatDeleteCall) Timestamp(timestamp string) *ChatDeleteCall

Timestamp sets the value for optional timestamp parameter

func (*ChatDeleteCall) ValidateArgs

func (c *ChatDeleteCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChatDeleteCall object

func (*ChatDeleteCall) Values

func (c *ChatDeleteCall) Values() (url.Values, error)

Values returns the ChatDeleteCall object as url.Values

type ChatGetPermalinkCall

type ChatGetPermalinkCall struct {
	// contains filtered or unexported fields
}

ChatGetPermalinkCall is created by ChatService.GetPermalink method call

func (*ChatGetPermalinkCall) Do

Do executes the call to access chat.getPermalink endpoint

func (*ChatGetPermalinkCall) FromValues

func (c *ChatGetPermalinkCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChatGetPermalinkCall) ValidateArgs

func (c *ChatGetPermalinkCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChatGetPermalinkCall object

func (*ChatGetPermalinkCall) Values

func (c *ChatGetPermalinkCall) Values() (url.Values, error)

Values returns the ChatGetPermalinkCall object as url.Values

type ChatMeMessageCall

type ChatMeMessageCall struct {
	// contains filtered or unexported fields
}

ChatMeMessageCall is created by ChatService.MeMessage method call

func (*ChatMeMessageCall) Do

Do executes the call to access chat.meMessage endpoint

func (*ChatMeMessageCall) FromValues

func (c *ChatMeMessageCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChatMeMessageCall) Text

Text sets the value for optional text parameter

func (*ChatMeMessageCall) ValidateArgs

func (c *ChatMeMessageCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChatMeMessageCall object

func (*ChatMeMessageCall) Values

func (c *ChatMeMessageCall) Values() (url.Values, error)

Values returns the ChatMeMessageCall object as url.Values

type ChatPostEphemeralCall

type ChatPostEphemeralCall struct {
	// contains filtered or unexported fields
}

ChatPostEphemeralCall is created by ChatService.PostEphemeral method call

func (*ChatPostEphemeralCall) AsUser

AsUser sets the value for optional asUser parameter

func (*ChatPostEphemeralCall) Attachment

func (c *ChatPostEphemeralCall) Attachment(attachment *objects.Attachment) *ChatPostEphemeralCall

Attachment appends to the attachments list

func (*ChatPostEphemeralCall) Do

Do executes the call to access chat.postEphemeral endpoint

func (*ChatPostEphemeralCall) FromValues

func (c *ChatPostEphemeralCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChatPostEphemeralCall) LinkNames

func (c *ChatPostEphemeralCall) LinkNames(linkNames bool) *ChatPostEphemeralCall

LinkNames sets the value for optional linkNames parameter

func (*ChatPostEphemeralCall) Parse

Parse sets the value for optional parse parameter

func (*ChatPostEphemeralCall) SetAttachments

func (c *ChatPostEphemeralCall) SetAttachments(attachments objects.AttachmentList) *ChatPostEphemeralCall

SetAttachments sets the attachments list

func (*ChatPostEphemeralCall) ValidateArgs

func (c *ChatPostEphemeralCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChatPostEphemeralCall object

func (*ChatPostEphemeralCall) Values

func (c *ChatPostEphemeralCall) Values() (url.Values, error)

Values returns the ChatPostEphemeralCall object as url.Values

type ChatPostMessageCall

type ChatPostMessageCall struct {
	// contains filtered or unexported fields
}

ChatPostMessageCall is created by ChatService.PostMessage method call

func (*ChatPostMessageCall) AsUser

func (c *ChatPostMessageCall) AsUser(asUser bool) *ChatPostMessageCall

AsUser sets the value for optional asUser parameter

func (*ChatPostMessageCall) Attachment

func (c *ChatPostMessageCall) Attachment(attachment *objects.Attachment) *ChatPostMessageCall

Attachment appends to the attachments list

func (*ChatPostMessageCall) Do

Do executes the call to access chat.postMessage endpoint

func (*ChatPostMessageCall) EscapeText

func (c *ChatPostMessageCall) EscapeText(escapeText bool) *ChatPostMessageCall

EscapeText sets the value for optional escapeText parameter

func (*ChatPostMessageCall) FromValues

func (c *ChatPostMessageCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChatPostMessageCall) IconEmoji

func (c *ChatPostMessageCall) IconEmoji(iconEmoji string) *ChatPostMessageCall

IconEmoji sets the value for optional iconEmoji parameter

func (*ChatPostMessageCall) IconURL

func (c *ChatPostMessageCall) IconURL(iconURL string) *ChatPostMessageCall

IconURL sets the value for optional iconURL parameter

func (*ChatPostMessageCall) LinkNames

func (c *ChatPostMessageCall) LinkNames(linkNames bool) *ChatPostMessageCall

LinkNames sets the value for optional linkNames parameter

func (*ChatPostMessageCall) Markdown

func (c *ChatPostMessageCall) Markdown(markdown bool) *ChatPostMessageCall

Markdown sets the value for optional markdown parameter

func (*ChatPostMessageCall) Parse

Parse sets the value for optional parse parameter

func (*ChatPostMessageCall) SetAttachments

func (c *ChatPostMessageCall) SetAttachments(attachments objects.AttachmentList) *ChatPostMessageCall

SetAttachments sets the attachments list

func (*ChatPostMessageCall) Text

Text sets the value for optional text parameter

func (c *ChatPostMessageCall) UnfurlLinks(unfurlLinks bool) *ChatPostMessageCall

UnfurlLinks sets the value for optional unfurlLinks parameter

func (*ChatPostMessageCall) UnfurlMedia

func (c *ChatPostMessageCall) UnfurlMedia(unfurlMedia bool) *ChatPostMessageCall

UnfurlMedia sets the value for optional unfurlMedia parameter

func (*ChatPostMessageCall) Username

func (c *ChatPostMessageCall) Username(username string) *ChatPostMessageCall

Username sets the value for optional username parameter

func (*ChatPostMessageCall) ValidateArgs

func (c *ChatPostMessageCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChatPostMessageCall object

func (*ChatPostMessageCall) Values

func (c *ChatPostMessageCall) Values() (url.Values, error)

Values returns the ChatPostMessageCall object as url.Values

type ChatService

type ChatService struct {
	// contains filtered or unexported fields
}

ChatService handles Chat related endpoints

func (*ChatService) Delete

func (s *ChatService) Delete(channel string) *ChatDeleteCall

Delete creates a ChatDeleteCall object in preparation for accessing the chat.delete endpoint

func (s *ChatService) GetPermalink(channel string, messageTimestamp string) *ChatGetPermalinkCall

GetPermalink creates a ChatGetPermalinkCall object in preparation for accessing the chat.getPermalink endpoint

func (*ChatService) MeMessage

func (s *ChatService) MeMessage(channel string) *ChatMeMessageCall

MeMessage creates a ChatMeMessageCall object in preparation for accessing the chat.meMessage endpoint

func (*ChatService) PostEphemeral

func (s *ChatService) PostEphemeral(channel string, text string, user string) *ChatPostEphemeralCall

PostEphemeral creates a ChatPostEphemeralCall object in preparation for accessing the chat.postEphemeral endpoint

func (*ChatService) PostMessage

func (s *ChatService) PostMessage(channel string) *ChatPostMessageCall

PostMessage creates a ChatPostMessageCall object in preparation for accessing the chat.postMessage endpoint

func (*ChatService) Unfurl

func (s *ChatService) Unfurl(channel string, timestamp string, unfurls string) *ChatUnfurlCall

Unfurl creates a ChatUnfurlCall object in preparation for accessing the chat.unfurl endpoint

func (*ChatService) Update

func (s *ChatService) Update(channel string) *ChatUpdateCall

Update creates a ChatUpdateCall object in preparation for accessing the chat.update endpoint

type ChatUnfurlCall

type ChatUnfurlCall struct {
	// contains filtered or unexported fields
}

ChatUnfurlCall is created by ChatService.Unfurl method call

func (*ChatUnfurlCall) Do

func (c *ChatUnfurlCall) Do(ctx context.Context) error

Do executes the call to access chat.unfurl endpoint

func (*ChatUnfurlCall) FromValues

func (c *ChatUnfurlCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChatUnfurlCall) UserAuthRequired

func (c *ChatUnfurlCall) UserAuthRequired(userAuthRequired bool) *ChatUnfurlCall

UserAuthRequired sets the value for optional userAuthRequired parameter

func (*ChatUnfurlCall) ValidateArgs

func (c *ChatUnfurlCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChatUnfurlCall object

func (*ChatUnfurlCall) Values

func (c *ChatUnfurlCall) Values() (url.Values, error)

Values returns the ChatUnfurlCall object as url.Values

type ChatUpdateCall

type ChatUpdateCall struct {
	// contains filtered or unexported fields
}

ChatUpdateCall is created by ChatService.Update method call

func (*ChatUpdateCall) AsUser

func (c *ChatUpdateCall) AsUser(asUser bool) *ChatUpdateCall

AsUser sets the value for optional asUser parameter

func (*ChatUpdateCall) Attachment

func (c *ChatUpdateCall) Attachment(attachment *objects.Attachment) *ChatUpdateCall

Attachment appends to the attachments list

func (*ChatUpdateCall) Do

Do executes the call to access chat.update endpoint

func (*ChatUpdateCall) FromValues

func (c *ChatUpdateCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ChatUpdateCall) LinkNames

func (c *ChatUpdateCall) LinkNames(linkNames bool) *ChatUpdateCall

LinkNames sets the value for optional linkNames parameter

func (*ChatUpdateCall) Parse

func (c *ChatUpdateCall) Parse(parse string) *ChatUpdateCall

Parse sets the value for optional parse parameter

func (*ChatUpdateCall) SetAttachments

func (c *ChatUpdateCall) SetAttachments(attachments objects.AttachmentList) *ChatUpdateCall

SetAttachments sets the attachments list

func (*ChatUpdateCall) Text

func (c *ChatUpdateCall) Text(text string) *ChatUpdateCall

Text sets the value for optional text parameter

func (*ChatUpdateCall) Timestamp

func (c *ChatUpdateCall) Timestamp(timestamp string) *ChatUpdateCall

Timestamp sets the value for optional timestamp parameter

func (*ChatUpdateCall) ValidateArgs

func (c *ChatUpdateCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ChatUpdateCall object

func (*ChatUpdateCall) Values

func (c *ChatUpdateCall) Values() (url.Values, error)

Values returns the ChatUpdateCall object as url.Values

type Client

type Client struct {
	// contains filtered or unexported fields
}
Example
package main

import (
	"context"
	"fmt"
	"os"

	slack "github.com/lestrrat-go/slack"
)

func main() {
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	token := os.Getenv("SLACK_TOKEN")
	cl := slack.New(token)

	// check if we are connected
	authres, err := cl.Auth().Test().Do(ctx)
	if err != nil {
		fmt.Printf("failed to test authentication: %s\n", err)
		return
	}
	fmt.Printf("%#v\n", authres)

	// simplest possible message
	chatres, err := cl.Chat().PostMessage("@username").
		Text("Hello, World!").
		Do(ctx)
	if err != nil {
		fmt.Printf("failed to post messsage: %s\n", err)
		return
	}
	fmt.Printf("%#v\n", chatres)
}
Output:

func New

func New(token string, options ...Option) *Client

New creates a new REST Slack API client. The `token` is required. Other optional parameters can be passed using the various `WithXXXX` functions

func (*Client) Auth

func (c *Client) Auth() *AuthService

Auth returns the Service object for `auth.*` endpoints

func (*Client) Bots

func (c *Client) Bots() *BotsService

Bots returns the Service object for `bots.*` endpoints

func (*Client) Channels

func (c *Client) Channels() *ChannelsService

Channels returns the Service object for `channels.*` endpoints

func (*Client) Chat

func (c *Client) Chat() *ChatService

Chat returns the Service object for `chat.*` endpoints

func (*Client) Dialog

func (c *Client) Dialog() *DialogService

Dialog returns the Service object for `dialog.*` endpoints

func (*Client) Emoji

func (c *Client) Emoji() *EmojiService

Emoji returns the Service object for `emoji.*` endpoints

func (*Client) Groups

func (c *Client) Groups() *GroupsService

Groups returns the Service object for `emoji.*` endpoints

func (*Client) OAuth

func (c *Client) OAuth() *OAuthService

OAuth returns the Service object for `oauth.*` endpoints

func (*Client) RTM

func (c *Client) RTM() *RTMService

RTM returns the Service object for `rtm.*` endpoints

func (*Client) Reactions

func (c *Client) Reactions() *ReactionsService

Reactions returns the Service object for `reactions.*` endpoints

func (*Client) Reminders

func (c *Client) Reminders() *RemindersService

Reminders returns the Service object for `reminders.*` endpoints

func (*Client) Usergroups

func (c *Client) Usergroups() *UsergroupsService

Usergroups returns the Service object for `usergroups.*` endpoints

func (*Client) UsergroupsUsers

func (c *Client) UsergroupsUsers() *UsergroupsUsersService

UsergroupsUsers returns the Service object for `usergroups.users.*` endpoints

func (*Client) Users

func (c *Client) Users() *UsersService

Users returns the Service object for `users.*` endpoints

func (*Client) UsersProfile

func (c *Client) UsersProfile() *UsersProfileService

UsersProfile returns the Service object for `users.profile.*` endpoints

type ControlSequence

type ControlSequence interface {
	Data() string
	Surface() string
	String() string
}

func ParseControlSequence

func ParseControlSequence(s string) (ControlSequence, error)

type DialogOpenCall

type DialogOpenCall struct {
	// contains filtered or unexported fields
}

DialogOpenCall is created by DialogService.Open method call

func (*DialogOpenCall) Do

Do executes the call to access dialog.open endpoint

func (*DialogOpenCall) FromValues

func (c *DialogOpenCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*DialogOpenCall) ValidateArgs

func (c *DialogOpenCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the DialogOpenCall object

func (*DialogOpenCall) Values

func (c *DialogOpenCall) Values() (url.Values, error)

Values returns the DialogOpenCall object as url.Values

type DialogService

type DialogService struct {
	// contains filtered or unexported fields
}

DialogService handles Dialog related endpoints

func (*DialogService) Open

func (s *DialogService) Open(dialog *objects.Dialog, trigger_id string) *DialogOpenCall

Open creates a DialogOpenCall object in preparation for accessing the dialog.open endpoint

type EmojiListCall

type EmojiListCall struct {
	// contains filtered or unexported fields
}

EmojiListCall is created by EmojiService.List method call

func (*EmojiListCall) Do

Do executes the call to access emoji.list endpoint

func (*EmojiListCall) FromValues

func (c *EmojiListCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*EmojiListCall) ValidateArgs

func (c *EmojiListCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the EmojiListCall object

func (*EmojiListCall) Values

func (c *EmojiListCall) Values() (url.Values, error)

Values returns the EmojiListCall object as url.Values

type EmojiService

type EmojiService struct {
	// contains filtered or unexported fields
}

EmojiService handles Emoji related endpoints

func (*EmojiService) List

func (s *EmojiService) List() *EmojiListCall

List creates a EmojiListCall object in preparation for accessing the emoji.list endpoint

type ExternalLink struct {
	URL  string
	Text string
}

func (*ExternalLink) Data

func (l *ExternalLink) Data() string

func (*ExternalLink) String

func (l *ExternalLink) String() string

func (*ExternalLink) Surface

func (l *ExternalLink) Surface() string

type GroupsArchiveCall

type GroupsArchiveCall struct {
	// contains filtered or unexported fields
}

GroupsArchiveCall is created by GroupsService.Archive method call

func (*GroupsArchiveCall) Do

Do executes the call to access groups.archive endpoint

func (*GroupsArchiveCall) FromValues

func (c *GroupsArchiveCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsArchiveCall) ValidateArgs

func (c *GroupsArchiveCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsArchiveCall object

func (*GroupsArchiveCall) Values

func (c *GroupsArchiveCall) Values() (url.Values, error)

Values returns the GroupsArchiveCall object as url.Values

type GroupsCreateCall

type GroupsCreateCall struct {
	// contains filtered or unexported fields
}

GroupsCreateCall is created by GroupsService.Create method call

func (*GroupsCreateCall) Do

Do executes the call to access groups.create endpoint

func (*GroupsCreateCall) FromValues

func (c *GroupsCreateCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsCreateCall) Validate

func (c *GroupsCreateCall) Validate(validate bool) *GroupsCreateCall

Validate sets the value for optional validate parameter

func (*GroupsCreateCall) ValidateArgs

func (c *GroupsCreateCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsCreateCall object

func (*GroupsCreateCall) Values

func (c *GroupsCreateCall) Values() (url.Values, error)

Values returns the GroupsCreateCall object as url.Values

type GroupsCreateChildCall

type GroupsCreateChildCall struct {
	// contains filtered or unexported fields
}

GroupsCreateChildCall is created by GroupsService.CreateChild method call

func (*GroupsCreateChildCall) Do

Do executes the call to access groups.createChild endpoint

func (*GroupsCreateChildCall) FromValues

func (c *GroupsCreateChildCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsCreateChildCall) ValidateArgs

func (c *GroupsCreateChildCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsCreateChildCall object

func (*GroupsCreateChildCall) Values

func (c *GroupsCreateChildCall) Values() (url.Values, error)

Values returns the GroupsCreateChildCall object as url.Values

type GroupsHistoryCall

type GroupsHistoryCall struct {
	// contains filtered or unexported fields
}

GroupsHistoryCall is created by GroupsService.History method call

func (*GroupsHistoryCall) Count

func (c *GroupsHistoryCall) Count(count int) *GroupsHistoryCall

Count sets the value for optional count parameter

func (*GroupsHistoryCall) Do

Do executes the call to access groups.history endpoint

func (*GroupsHistoryCall) FromValues

func (c *GroupsHistoryCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsHistoryCall) Inclusive

func (c *GroupsHistoryCall) Inclusive(inclusive bool) *GroupsHistoryCall

Inclusive sets the value for optional inclusive parameter

func (*GroupsHistoryCall) Latest

func (c *GroupsHistoryCall) Latest(latest string) *GroupsHistoryCall

Latest sets the value for optional latest parameter

func (*GroupsHistoryCall) Oldest

func (c *GroupsHistoryCall) Oldest(oldest string) *GroupsHistoryCall

Oldest sets the value for optional oldest parameter

func (*GroupsHistoryCall) Unreads

func (c *GroupsHistoryCall) Unreads(unreads bool) *GroupsHistoryCall

Unreads sets the value for optional unreads parameter

func (*GroupsHistoryCall) ValidateArgs

func (c *GroupsHistoryCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsHistoryCall object

func (*GroupsHistoryCall) Values

func (c *GroupsHistoryCall) Values() (url.Values, error)

Values returns the GroupsHistoryCall object as url.Values

type GroupsInfoCall

type GroupsInfoCall struct {
	// contains filtered or unexported fields
}

GroupsInfoCall is created by GroupsService.Info method call

func (*GroupsInfoCall) Do

Do executes the call to access groups.info endpoint

func (*GroupsInfoCall) FromValues

func (c *GroupsInfoCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsInfoCall) IncludeLocale

func (c *GroupsInfoCall) IncludeLocale(includeLocale bool) *GroupsInfoCall

IncludeLocale sets the value for optional includeLocale parameter

func (*GroupsInfoCall) ValidateArgs

func (c *GroupsInfoCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsInfoCall object

func (*GroupsInfoCall) Values

func (c *GroupsInfoCall) Values() (url.Values, error)

Values returns the GroupsInfoCall object as url.Values

type GroupsInviteCall

type GroupsInviteCall struct {
	// contains filtered or unexported fields
}

GroupsInviteCall is created by GroupsService.Invite method call

func (*GroupsInviteCall) Do

Do executes the call to access groups.invite endpoint

func (*GroupsInviteCall) FromValues

func (c *GroupsInviteCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsInviteCall) ValidateArgs

func (c *GroupsInviteCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsInviteCall object

func (*GroupsInviteCall) Values

func (c *GroupsInviteCall) Values() (url.Values, error)

Values returns the GroupsInviteCall object as url.Values

type GroupsKickCall

type GroupsKickCall struct {
	// contains filtered or unexported fields
}

GroupsKickCall is created by GroupsService.Kick method call

func (*GroupsKickCall) Do

func (c *GroupsKickCall) Do(ctx context.Context) error

Do executes the call to access groups.kick endpoint

func (*GroupsKickCall) FromValues

func (c *GroupsKickCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsKickCall) ValidateArgs

func (c *GroupsKickCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsKickCall object

func (*GroupsKickCall) Values

func (c *GroupsKickCall) Values() (url.Values, error)

Values returns the GroupsKickCall object as url.Values

type GroupsLeaveCall

type GroupsLeaveCall struct {
	// contains filtered or unexported fields
}

GroupsLeaveCall is created by GroupsService.Leave method call

func (*GroupsLeaveCall) Do

func (c *GroupsLeaveCall) Do(ctx context.Context) error

Do executes the call to access groups.leave endpoint

func (*GroupsLeaveCall) FromValues

func (c *GroupsLeaveCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsLeaveCall) ValidateArgs

func (c *GroupsLeaveCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsLeaveCall object

func (*GroupsLeaveCall) Values

func (c *GroupsLeaveCall) Values() (url.Values, error)

Values returns the GroupsLeaveCall object as url.Values

type GroupsListCall

type GroupsListCall struct {
	// contains filtered or unexported fields
}

GroupsListCall is created by GroupsService.List method call

func (*GroupsListCall) Do

Do executes the call to access groups.list endpoint

func (*GroupsListCall) ExcludeArchived

func (c *GroupsListCall) ExcludeArchived(excludeArchived bool) *GroupsListCall

ExcludeArchived sets the value for optional excludeArchived parameter

func (*GroupsListCall) ExcludeMembers

func (c *GroupsListCall) ExcludeMembers(excludeMembers bool) *GroupsListCall

ExcludeMembers sets the value for optional excludeMembers parameter

func (*GroupsListCall) FromValues

func (c *GroupsListCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsListCall) ValidateArgs

func (c *GroupsListCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsListCall object

func (*GroupsListCall) Values

func (c *GroupsListCall) Values() (url.Values, error)

Values returns the GroupsListCall object as url.Values

type GroupsMarkCall

type GroupsMarkCall struct {
	// contains filtered or unexported fields
}

GroupsMarkCall is created by GroupsService.Mark method call

func (*GroupsMarkCall) Do

func (c *GroupsMarkCall) Do(ctx context.Context) error

Do executes the call to access groups.mark endpoint

func (*GroupsMarkCall) FromValues

func (c *GroupsMarkCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsMarkCall) ValidateArgs

func (c *GroupsMarkCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsMarkCall object

func (*GroupsMarkCall) Values

func (c *GroupsMarkCall) Values() (url.Values, error)

Values returns the GroupsMarkCall object as url.Values

type GroupsOpenCall

type GroupsOpenCall struct {
	// contains filtered or unexported fields
}

GroupsOpenCall is created by GroupsService.Open method call

func (*GroupsOpenCall) Do

func (c *GroupsOpenCall) Do(ctx context.Context) error

Do executes the call to access groups.open endpoint

func (*GroupsOpenCall) FromValues

func (c *GroupsOpenCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsOpenCall) ValidateArgs

func (c *GroupsOpenCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsOpenCall object

func (*GroupsOpenCall) Values

func (c *GroupsOpenCall) Values() (url.Values, error)

Values returns the GroupsOpenCall object as url.Values

type GroupsRenameCall

type GroupsRenameCall struct {
	// contains filtered or unexported fields
}

GroupsRenameCall is created by GroupsService.Rename method call

func (*GroupsRenameCall) Do

Do executes the call to access groups.rename endpoint

func (*GroupsRenameCall) FromValues

func (c *GroupsRenameCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsRenameCall) Validate

func (c *GroupsRenameCall) Validate(validate bool) *GroupsRenameCall

Validate sets the value for optional validate parameter

func (*GroupsRenameCall) ValidateArgs

func (c *GroupsRenameCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsRenameCall object

func (*GroupsRenameCall) Values

func (c *GroupsRenameCall) Values() (url.Values, error)

Values returns the GroupsRenameCall object as url.Values

type GroupsRepliesCall

type GroupsRepliesCall struct {
	// contains filtered or unexported fields
}

GroupsRepliesCall is created by GroupsService.Replies method call

func (*GroupsRepliesCall) Do

Do executes the call to access groups.replies endpoint

func (*GroupsRepliesCall) FromValues

func (c *GroupsRepliesCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsRepliesCall) ValidateArgs

func (c *GroupsRepliesCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsRepliesCall object

func (*GroupsRepliesCall) Values

func (c *GroupsRepliesCall) Values() (url.Values, error)

Values returns the GroupsRepliesCall object as url.Values

type GroupsService

type GroupsService struct {
	// contains filtered or unexported fields
}

GroupsService handles Groups related endpoints

func (*GroupsService) Archive

func (s *GroupsService) Archive(channel string) *GroupsArchiveCall

Archive creates a GroupsArchiveCall object in preparation for accessing the groups.archive endpoint

func (*GroupsService) Create

func (s *GroupsService) Create(name string) *GroupsCreateCall

Create creates a GroupsCreateCall object in preparation for accessing the groups.create endpoint

func (*GroupsService) CreateChild

func (s *GroupsService) CreateChild(channel string) *GroupsCreateChildCall

CreateChild creates a GroupsCreateChildCall object in preparation for accessing the groups.createChild endpoint

func (*GroupsService) History

func (s *GroupsService) History(channel string) *GroupsHistoryCall

History creates a GroupsHistoryCall object in preparation for accessing the groups.history endpoint

func (*GroupsService) Info

func (s *GroupsService) Info(channel string) *GroupsInfoCall

Info creates a GroupsInfoCall object in preparation for accessing the groups.info endpoint

func (*GroupsService) Invite

func (s *GroupsService) Invite(channel string, user string) *GroupsInviteCall

Invite creates a GroupsInviteCall object in preparation for accessing the groups.invite endpoint

func (*GroupsService) Kick

func (s *GroupsService) Kick(channel string, user string) *GroupsKickCall

Kick creates a GroupsKickCall object in preparation for accessing the groups.kick endpoint

func (*GroupsService) Leave

func (s *GroupsService) Leave(channel string) *GroupsLeaveCall

Leave creates a GroupsLeaveCall object in preparation for accessing the groups.leave endpoint

func (*GroupsService) List

func (s *GroupsService) List() *GroupsListCall

List creates a GroupsListCall object in preparation for accessing the groups.list endpoint

func (*GroupsService) Mark

func (s *GroupsService) Mark(channel string, timestamp string) *GroupsMarkCall

Mark creates a GroupsMarkCall object in preparation for accessing the groups.mark endpoint

func (*GroupsService) Open

func (s *GroupsService) Open(channel string) *GroupsOpenCall

Open creates a GroupsOpenCall object in preparation for accessing the groups.open endpoint

func (*GroupsService) Rename

func (s *GroupsService) Rename(channel string, name string) *GroupsRenameCall

Rename creates a GroupsRenameCall object in preparation for accessing the groups.rename endpoint

func (*GroupsService) Replies

func (s *GroupsService) Replies(channel string, threadTimestamp string) *GroupsRepliesCall

Replies creates a GroupsRepliesCall object in preparation for accessing the groups.replies endpoint

func (*GroupsService) SetPurpose

func (s *GroupsService) SetPurpose(channel string, purpose string) *GroupsSetPurposeCall

SetPurpose creates a GroupsSetPurposeCall object in preparation for accessing the groups.setPurpose endpoint

func (*GroupsService) SetTopic

func (s *GroupsService) SetTopic(channel string, topic string) *GroupsSetTopicCall

SetTopic creates a GroupsSetTopicCall object in preparation for accessing the groups.setTopic endpoint

func (*GroupsService) Unarchive

func (s *GroupsService) Unarchive(channel string) *GroupsUnarchiveCall

Unarchive creates a GroupsUnarchiveCall object in preparation for accessing the groups.unarchive endpoint

type GroupsSetPurposeCall

type GroupsSetPurposeCall struct {
	// contains filtered or unexported fields
}

GroupsSetPurposeCall is created by GroupsService.SetPurpose method call

func (*GroupsSetPurposeCall) Do

Do executes the call to access groups.setPurpose endpoint

func (*GroupsSetPurposeCall) FromValues

func (c *GroupsSetPurposeCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsSetPurposeCall) ValidateArgs

func (c *GroupsSetPurposeCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsSetPurposeCall object

func (*GroupsSetPurposeCall) Values

func (c *GroupsSetPurposeCall) Values() (url.Values, error)

Values returns the GroupsSetPurposeCall object as url.Values

type GroupsSetTopicCall

type GroupsSetTopicCall struct {
	// contains filtered or unexported fields
}

GroupsSetTopicCall is created by GroupsService.SetTopic method call

func (*GroupsSetTopicCall) Do

Do executes the call to access groups.setTopic endpoint

func (*GroupsSetTopicCall) FromValues

func (c *GroupsSetTopicCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsSetTopicCall) ValidateArgs

func (c *GroupsSetTopicCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsSetTopicCall object

func (*GroupsSetTopicCall) Values

func (c *GroupsSetTopicCall) Values() (url.Values, error)

Values returns the GroupsSetTopicCall object as url.Values

type GroupsUnarchiveCall

type GroupsUnarchiveCall struct {
	// contains filtered or unexported fields
}

GroupsUnarchiveCall is created by GroupsService.Unarchive method call

func (*GroupsUnarchiveCall) Do

Do executes the call to access groups.unarchive endpoint

func (*GroupsUnarchiveCall) FromValues

func (c *GroupsUnarchiveCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*GroupsUnarchiveCall) ValidateArgs

func (c *GroupsUnarchiveCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the GroupsUnarchiveCall object

func (*GroupsUnarchiveCall) Values

func (c *GroupsUnarchiveCall) Values() (url.Values, error)

Values returns the GroupsUnarchiveCall object as url.Values

type Logger

type Logger interface {
	Debugf(context.Context, string, ...interface{})
	Infof(context.Context, string, ...interface{})
}

Logger is an interface for logging/tracing the client's execution.

In particular, `Debugf` will only be called if `WithDebug` is provided to the constructor.

type OAuthAccessCall

type OAuthAccessCall struct {
	// contains filtered or unexported fields
}

OAuthAccessCall is created by OAuthService.Access method call

func (*OAuthAccessCall) Do

Do executes the call to access oauth.access endpoint

func (*OAuthAccessCall) FromValues

func (c *OAuthAccessCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*OAuthAccessCall) RedirectURI

func (c *OAuthAccessCall) RedirectURI(redirectURI string) *OAuthAccessCall

RedirectURI sets the value for optional redirectURI parameter

func (*OAuthAccessCall) ValidateArgs

func (c *OAuthAccessCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the OAuthAccessCall object

func (*OAuthAccessCall) Values

func (c *OAuthAccessCall) Values() (url.Values, error)

Values returns the OAuthAccessCall object as url.Values

type OAuthService

type OAuthService struct {
	// contains filtered or unexported fields
}

OAuthService handles OAuth related endpoints

func (*OAuthService) Access

func (s *OAuthService) Access(clientID string, clientSecret string, code string) *OAuthAccessCall

Access creates a OAuthAccessCall object in preparation for accessing the oauth.access endpoint

type Option

type Option interface {
	Name() string
	Value() interface{}
}

Option defines an interface of optional parameters to the `slack.New` constructor.

func WithAPIEndpoint

func WithAPIEndpoint(s string) Option

WithAPIEndpoint allows you to specify an alternate API endpoint. The default is DefaultAPIEndpoint.

func WithClient

func WithClient(cl *http.Client) Option

WithClient allows you to specify an net/http.Client object to use to communicate with the Slack endpoints. For example, if you need to use this in Google App Engine, you can pass it the result of `urlfetch.Client`

func WithDebug

func WithDebug(b bool) Option

WithDebug specifies that we want to run in debugging mode. You can set this value manually to override any existing global defaults.

If one is not specified, the default value is false, or the value specified in SLACK_DEBUG environment variable

func WithLogger

func WithLogger(l Logger) Option

WithLogger specifies the logger object to be used. If not specified and `WithDebug` is enabled, then a default logger which writes to os.Stderr

type RTMService

type RTMService struct {
	// contains filtered or unexported fields
}

RTMService handles RTM related endpoints

func (*RTMService) Start

func (s *RTMService) Start() *RTMStartCall

Start creates a RTMStartCall object in preparation for accessing the rtm.start endpoint

type RTMStartCall

type RTMStartCall struct {
	// contains filtered or unexported fields
}

RTMStartCall is created by RTMService.Start method call

func (*RTMStartCall) Do

Do executes the call to access rtm.start endpoint

func (*RTMStartCall) FromValues

func (c *RTMStartCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*RTMStartCall) ValidateArgs

func (c *RTMStartCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the RTMStartCall object

func (*RTMStartCall) Values

func (c *RTMStartCall) Values() (url.Values, error)

Values returns the RTMStartCall object as url.Values

type ReactionsAddCall

type ReactionsAddCall struct {
	// contains filtered or unexported fields
}

ReactionsAddCall is created by ReactionsService.Add method call

func (*ReactionsAddCall) Channel

func (c *ReactionsAddCall) Channel(channel string) *ReactionsAddCall

Channel sets the value for optional channel parameter

func (*ReactionsAddCall) Do

Do executes the call to access reactions.add endpoint

func (*ReactionsAddCall) File

func (c *ReactionsAddCall) File(file string) *ReactionsAddCall

File sets the value for optional file parameter

func (*ReactionsAddCall) FileComment

func (c *ReactionsAddCall) FileComment(fileComment string) *ReactionsAddCall

FileComment sets the value for optional fileComment parameter

func (*ReactionsAddCall) FromValues

func (c *ReactionsAddCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ReactionsAddCall) Timestamp

func (c *ReactionsAddCall) Timestamp(timestamp string) *ReactionsAddCall

Timestamp sets the value for optional timestamp parameter

func (*ReactionsAddCall) ValidateArgs

func (c *ReactionsAddCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ReactionsAddCall object

func (*ReactionsAddCall) Values

func (c *ReactionsAddCall) Values() (url.Values, error)

Values returns the ReactionsAddCall object as url.Values

type ReactionsGetCall

type ReactionsGetCall struct {
	// contains filtered or unexported fields
}

ReactionsGetCall is created by ReactionsService.Get method call

func (*ReactionsGetCall) Channel

func (c *ReactionsGetCall) Channel(channel string) *ReactionsGetCall

Channel sets the value for optional channel parameter

func (*ReactionsGetCall) Do

Do executes the call to access reactions.get endpoint

func (*ReactionsGetCall) File

func (c *ReactionsGetCall) File(file string) *ReactionsGetCall

File sets the value for optional file parameter

func (*ReactionsGetCall) FileComment

func (c *ReactionsGetCall) FileComment(fileComment string) *ReactionsGetCall

FileComment sets the value for optional fileComment parameter

func (*ReactionsGetCall) FromValues

func (c *ReactionsGetCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ReactionsGetCall) Full

func (c *ReactionsGetCall) Full(full bool) *ReactionsGetCall

Full sets the value for optional full parameter

func (*ReactionsGetCall) Timestamp

func (c *ReactionsGetCall) Timestamp(timestamp string) *ReactionsGetCall

Timestamp sets the value for optional timestamp parameter

func (*ReactionsGetCall) ValidateArgs

func (c *ReactionsGetCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ReactionsGetCall object

func (*ReactionsGetCall) Values

func (c *ReactionsGetCall) Values() (url.Values, error)

Values returns the ReactionsGetCall object as url.Values

type ReactionsListCall

type ReactionsListCall struct {
	// contains filtered or unexported fields
}

ReactionsListCall is created by ReactionsService.List method call

func (*ReactionsListCall) Count

func (c *ReactionsListCall) Count(count int) *ReactionsListCall

Count sets the value for optional count parameter

func (*ReactionsListCall) Do

Do executes the call to access reactions.list endpoint

func (*ReactionsListCall) FromValues

func (c *ReactionsListCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ReactionsListCall) Full

func (c *ReactionsListCall) Full(full bool) *ReactionsListCall

Full sets the value for optional full parameter

func (*ReactionsListCall) Page

func (c *ReactionsListCall) Page(page int) *ReactionsListCall

Page sets the value for optional page parameter

func (*ReactionsListCall) User

User sets the value for optional user parameter

func (*ReactionsListCall) ValidateArgs

func (c *ReactionsListCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ReactionsListCall object

func (*ReactionsListCall) Values

func (c *ReactionsListCall) Values() (url.Values, error)

Values returns the ReactionsListCall object as url.Values

type ReactionsRemoveCall

type ReactionsRemoveCall struct {
	// contains filtered or unexported fields
}

ReactionsRemoveCall is created by ReactionsService.Remove method call

func (*ReactionsRemoveCall) Channel

func (c *ReactionsRemoveCall) Channel(channel string) *ReactionsRemoveCall

Channel sets the value for optional channel parameter

func (*ReactionsRemoveCall) Do

Do executes the call to access reactions.remove endpoint

func (*ReactionsRemoveCall) File

File sets the value for optional file parameter

func (*ReactionsRemoveCall) FileComment

func (c *ReactionsRemoveCall) FileComment(fileComment string) *ReactionsRemoveCall

FileComment sets the value for optional fileComment parameter

func (*ReactionsRemoveCall) FromValues

func (c *ReactionsRemoveCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*ReactionsRemoveCall) Timestamp

func (c *ReactionsRemoveCall) Timestamp(timestamp string) *ReactionsRemoveCall

Timestamp sets the value for optional timestamp parameter

func (*ReactionsRemoveCall) ValidateArgs

func (c *ReactionsRemoveCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the ReactionsRemoveCall object

func (*ReactionsRemoveCall) Values

func (c *ReactionsRemoveCall) Values() (url.Values, error)

Values returns the ReactionsRemoveCall object as url.Values

type ReactionsService

type ReactionsService struct {
	// contains filtered or unexported fields
}

ReactionsService handles Reactions related endpoints

func (*ReactionsService) Add

Add creates a ReactionsAddCall object in preparation for accessing the reactions.add endpoint

func (*ReactionsService) Get

Get creates a ReactionsGetCall object in preparation for accessing the reactions.get endpoint

func (*ReactionsService) List

List creates a ReactionsListCall object in preparation for accessing the reactions.list endpoint

func (*ReactionsService) Remove

func (s *ReactionsService) Remove(name string) *ReactionsRemoveCall

Remove creates a ReactionsRemoveCall object in preparation for accessing the reactions.remove endpoint

type RemindersAddCall

type RemindersAddCall struct {
	// contains filtered or unexported fields
}

RemindersAddCall is created by RemindersService.Add method call

func (*RemindersAddCall) Do

Do executes the call to access reminders.add endpoint

func (*RemindersAddCall) FromValues

func (c *RemindersAddCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*RemindersAddCall) User

func (c *RemindersAddCall) User(user string) *RemindersAddCall

User sets the value for optional user parameter

func (*RemindersAddCall) ValidateArgs

func (c *RemindersAddCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the RemindersAddCall object

func (*RemindersAddCall) Values

func (c *RemindersAddCall) Values() (url.Values, error)

Values returns the RemindersAddCall object as url.Values

type RemindersCompleteCall

type RemindersCompleteCall struct {
	// contains filtered or unexported fields
}

RemindersCompleteCall is created by RemindersService.Complete method call

func (*RemindersCompleteCall) Do

Do executes the call to access reminders.complete endpoint

func (*RemindersCompleteCall) FromValues

func (c *RemindersCompleteCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*RemindersCompleteCall) ValidateArgs

func (c *RemindersCompleteCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the RemindersCompleteCall object

func (*RemindersCompleteCall) Values

func (c *RemindersCompleteCall) Values() (url.Values, error)

Values returns the RemindersCompleteCall object as url.Values

type RemindersDeleteCall

type RemindersDeleteCall struct {
	// contains filtered or unexported fields
}

RemindersDeleteCall is created by RemindersService.Delete method call

func (*RemindersDeleteCall) Do

Do executes the call to access reminders.delete endpoint

func (*RemindersDeleteCall) FromValues

func (c *RemindersDeleteCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*RemindersDeleteCall) ValidateArgs

func (c *RemindersDeleteCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the RemindersDeleteCall object

func (*RemindersDeleteCall) Values

func (c *RemindersDeleteCall) Values() (url.Values, error)

Values returns the RemindersDeleteCall object as url.Values

type RemindersInfoCall

type RemindersInfoCall struct {
	// contains filtered or unexported fields
}

RemindersInfoCall is created by RemindersService.Info method call

func (*RemindersInfoCall) Do

Do executes the call to access reminders.info endpoint

func (*RemindersInfoCall) FromValues

func (c *RemindersInfoCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*RemindersInfoCall) ValidateArgs

func (c *RemindersInfoCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the RemindersInfoCall object

func (*RemindersInfoCall) Values

func (c *RemindersInfoCall) Values() (url.Values, error)

Values returns the RemindersInfoCall object as url.Values

type RemindersListCall

type RemindersListCall struct {
	// contains filtered or unexported fields
}

RemindersListCall is created by RemindersService.List method call

func (*RemindersListCall) Do

Do executes the call to access reminders.list endpoint

func (*RemindersListCall) FromValues

func (c *RemindersListCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*RemindersListCall) ValidateArgs

func (c *RemindersListCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the RemindersListCall object

func (*RemindersListCall) Values

func (c *RemindersListCall) Values() (url.Values, error)

Values returns the RemindersListCall object as url.Values

type RemindersService

type RemindersService struct {
	// contains filtered or unexported fields
}

RemindersService handles Reminders related endpoints

func (*RemindersService) Add

func (s *RemindersService) Add(text string, time int) *RemindersAddCall

Add creates a RemindersAddCall object in preparation for accessing the reminders.add endpoint

func (*RemindersService) Complete

func (s *RemindersService) Complete(reminder string) *RemindersCompleteCall

Complete creates a RemindersCompleteCall object in preparation for accessing the reminders.complete endpoint

func (*RemindersService) Delete

func (s *RemindersService) Delete(reminder string) *RemindersDeleteCall

Delete creates a RemindersDeleteCall object in preparation for accessing the reminders.delete endpoint

func (*RemindersService) Info

func (s *RemindersService) Info(reminder string) *RemindersInfoCall

Info creates a RemindersInfoCall object in preparation for accessing the reminders.info endpoint

func (*RemindersService) List

List creates a RemindersListCall object in preparation for accessing the reminders.list endpoint

type UserLink struct {
	ID       string
	Username string
}

func (*UserLink) Data

func (l *UserLink) Data() string

func (*UserLink) String

func (l *UserLink) String() string

func (*UserLink) Surface

func (l *UserLink) Surface() string

type UsergroupsCreateCall

type UsergroupsCreateCall struct {
	// contains filtered or unexported fields
}

UsergroupsCreateCall is created by UsergroupsService.Create method call

func (*UsergroupsCreateCall) Channels

func (c *UsergroupsCreateCall) Channels(channels string) *UsergroupsCreateCall

Channels sets the value for optional channels parameter

func (*UsergroupsCreateCall) Description

func (c *UsergroupsCreateCall) Description(description string) *UsergroupsCreateCall

Description sets the value for optional description parameter

func (*UsergroupsCreateCall) Do

Do executes the call to access usergroups.create endpoint

func (*UsergroupsCreateCall) FromValues

func (c *UsergroupsCreateCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsergroupsCreateCall) Handle

Handle sets the value for optional handle parameter

func (*UsergroupsCreateCall) IncludeCount

func (c *UsergroupsCreateCall) IncludeCount(includeCount bool) *UsergroupsCreateCall

IncludeCount sets the value for optional includeCount parameter

func (*UsergroupsCreateCall) ValidateArgs

func (c *UsergroupsCreateCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsergroupsCreateCall object

func (*UsergroupsCreateCall) Values

func (c *UsergroupsCreateCall) Values() (url.Values, error)

Values returns the UsergroupsCreateCall object as url.Values

type UsergroupsDisableCall

type UsergroupsDisableCall struct {
	// contains filtered or unexported fields
}

UsergroupsDisableCall is created by UsergroupsService.Disable method call

func (*UsergroupsDisableCall) Do

Do executes the call to access usergroups.disable endpoint

func (*UsergroupsDisableCall) FromValues

func (c *UsergroupsDisableCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsergroupsDisableCall) IncludeCount

func (c *UsergroupsDisableCall) IncludeCount(includeCount bool) *UsergroupsDisableCall

IncludeCount sets the value for optional includeCount parameter

func (*UsergroupsDisableCall) ValidateArgs

func (c *UsergroupsDisableCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsergroupsDisableCall object

func (*UsergroupsDisableCall) Values

func (c *UsergroupsDisableCall) Values() (url.Values, error)

Values returns the UsergroupsDisableCall object as url.Values

type UsergroupsEnableCall

type UsergroupsEnableCall struct {
	// contains filtered or unexported fields
}

UsergroupsEnableCall is created by UsergroupsService.Enable method call

func (*UsergroupsEnableCall) Do

Do executes the call to access usergroups.enable endpoint

func (*UsergroupsEnableCall) FromValues

func (c *UsergroupsEnableCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsergroupsEnableCall) IncludeCount

func (c *UsergroupsEnableCall) IncludeCount(includeCount bool) *UsergroupsEnableCall

IncludeCount sets the value for optional includeCount parameter

func (*UsergroupsEnableCall) ValidateArgs

func (c *UsergroupsEnableCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsergroupsEnableCall object

func (*UsergroupsEnableCall) Values

func (c *UsergroupsEnableCall) Values() (url.Values, error)

Values returns the UsergroupsEnableCall object as url.Values

type UsergroupsListCall

type UsergroupsListCall struct {
	// contains filtered or unexported fields
}

UsergroupsListCall is created by UsergroupsService.List method call

func (*UsergroupsListCall) Do

Do executes the call to access usergroups.list endpoint

func (*UsergroupsListCall) FromValues

func (c *UsergroupsListCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsergroupsListCall) IncludeCount

func (c *UsergroupsListCall) IncludeCount(includeCount bool) *UsergroupsListCall

IncludeCount sets the value for optional includeCount parameter

func (*UsergroupsListCall) IncludeDisabled

func (c *UsergroupsListCall) IncludeDisabled(includeDisabled bool) *UsergroupsListCall

IncludeDisabled sets the value for optional includeDisabled parameter

func (*UsergroupsListCall) IncludeUsers

func (c *UsergroupsListCall) IncludeUsers(includeUsers bool) *UsergroupsListCall

IncludeUsers sets the value for optional includeUsers parameter

func (*UsergroupsListCall) ValidateArgs

func (c *UsergroupsListCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsergroupsListCall object

func (*UsergroupsListCall) Values

func (c *UsergroupsListCall) Values() (url.Values, error)

Values returns the UsergroupsListCall object as url.Values

type UsergroupsService

type UsergroupsService struct {
	// contains filtered or unexported fields
}

UsergroupsService handles Usergroups related endpoints

func (*UsergroupsService) Create

Create creates a UsergroupsCreateCall object in preparation for accessing the usergroups.create endpoint

func (*UsergroupsService) Disable

func (s *UsergroupsService) Disable(usergroup string) *UsergroupsDisableCall

Disable creates a UsergroupsDisableCall object in preparation for accessing the usergroups.disable endpoint

func (*UsergroupsService) Enable

func (s *UsergroupsService) Enable(usergroup string) *UsergroupsEnableCall

Enable creates a UsergroupsEnableCall object in preparation for accessing the usergroups.enable endpoint

func (*UsergroupsService) List

List creates a UsergroupsListCall object in preparation for accessing the usergroups.list endpoint

func (*UsergroupsService) Update

func (s *UsergroupsService) Update(usergroup string) *UsergroupsUpdateCall

Update creates a UsergroupsUpdateCall object in preparation for accessing the usergroups.update endpoint

type UsergroupsUpdateCall

type UsergroupsUpdateCall struct {
	// contains filtered or unexported fields
}

UsergroupsUpdateCall is created by UsergroupsService.Update method call

func (*UsergroupsUpdateCall) Channels

func (c *UsergroupsUpdateCall) Channels(channels string) *UsergroupsUpdateCall

Channels sets the value for optional channels parameter

func (*UsergroupsUpdateCall) Description

func (c *UsergroupsUpdateCall) Description(description string) *UsergroupsUpdateCall

Description sets the value for optional description parameter

func (*UsergroupsUpdateCall) Do

Do executes the call to access usergroups.update endpoint

func (*UsergroupsUpdateCall) FromValues

func (c *UsergroupsUpdateCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsergroupsUpdateCall) Handle

Handle sets the value for optional handle parameter

func (*UsergroupsUpdateCall) IncludeCount

func (c *UsergroupsUpdateCall) IncludeCount(includeCount bool) *UsergroupsUpdateCall

IncludeCount sets the value for optional includeCount parameter

func (*UsergroupsUpdateCall) Name

Name sets the value for optional name parameter

func (*UsergroupsUpdateCall) ValidateArgs

func (c *UsergroupsUpdateCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsergroupsUpdateCall object

func (*UsergroupsUpdateCall) Values

func (c *UsergroupsUpdateCall) Values() (url.Values, error)

Values returns the UsergroupsUpdateCall object as url.Values

type UsergroupsUsersListCall

type UsergroupsUsersListCall struct {
	// contains filtered or unexported fields
}

UsergroupsUsersListCall is created by UsergroupsUsersService.List method call

func (*UsergroupsUsersListCall) Do

Do executes the call to access usergroups.users.list endpoint

func (*UsergroupsUsersListCall) FromValues

func (c *UsergroupsUsersListCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsergroupsUsersListCall) IncludeDisabled

func (c *UsergroupsUsersListCall) IncludeDisabled(includeDisabled bool) *UsergroupsUsersListCall

IncludeDisabled sets the value for optional includeDisabled parameter

func (*UsergroupsUsersListCall) ValidateArgs

func (c *UsergroupsUsersListCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsergroupsUsersListCall object

func (*UsergroupsUsersListCall) Values

func (c *UsergroupsUsersListCall) Values() (url.Values, error)

Values returns the UsergroupsUsersListCall object as url.Values

type UsergroupsUsersService

type UsergroupsUsersService struct {
	// contains filtered or unexported fields
}

UsergroupsUsersService handles UsergroupsUsers related endpoints

func (*UsergroupsUsersService) List

List creates a UsergroupsUsersListCall object in preparation for accessing the usergroups.users.list endpoint

func (*UsergroupsUsersService) Update

func (s *UsergroupsUsersService) Update(usergroup string, users string) *UsergroupsUsersUpdateCall

Update creates a UsergroupsUsersUpdateCall object in preparation for accessing the usergroups.users.update endpoint

type UsergroupsUsersUpdateCall

type UsergroupsUsersUpdateCall struct {
	// contains filtered or unexported fields
}

UsergroupsUsersUpdateCall is created by UsergroupsUsersService.Update method call

func (*UsergroupsUsersUpdateCall) Do

Do executes the call to access usergroups.users.update endpoint

func (*UsergroupsUsersUpdateCall) FromValues

func (c *UsergroupsUsersUpdateCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsergroupsUsersUpdateCall) IncludeCount

func (c *UsergroupsUsersUpdateCall) IncludeCount(includeCount bool) *UsergroupsUsersUpdateCall

IncludeCount sets the value for optional includeCount parameter

func (*UsergroupsUsersUpdateCall) ValidateArgs

func (c *UsergroupsUsersUpdateCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsergroupsUsersUpdateCall object

func (*UsergroupsUsersUpdateCall) Values

func (c *UsergroupsUsersUpdateCall) Values() (url.Values, error)

Values returns the UsergroupsUsersUpdateCall object as url.Values

type UsersDeletePhotoCall

type UsersDeletePhotoCall struct {
	// contains filtered or unexported fields
}

UsersDeletePhotoCall is created by UsersService.DeletePhoto method call

func (*UsersDeletePhotoCall) Do

Do executes the call to access users.deletePhoto endpoint

func (*UsersDeletePhotoCall) FromValues

func (c *UsersDeletePhotoCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsersDeletePhotoCall) ValidateArgs

func (c *UsersDeletePhotoCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsersDeletePhotoCall object

func (*UsersDeletePhotoCall) Values

func (c *UsersDeletePhotoCall) Values() (url.Values, error)

Values returns the UsersDeletePhotoCall object as url.Values

type UsersGetPresenceCall

type UsersGetPresenceCall struct {
	// contains filtered or unexported fields
}

UsersGetPresenceCall is created by UsersService.GetPresence method call

func (*UsersGetPresenceCall) Do

Do executes the call to access users.getPresence endpoint

func (*UsersGetPresenceCall) FromValues

func (c *UsersGetPresenceCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsersGetPresenceCall) ValidateArgs

func (c *UsersGetPresenceCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsersGetPresenceCall object

func (*UsersGetPresenceCall) Values

func (c *UsersGetPresenceCall) Values() (url.Values, error)

Values returns the UsersGetPresenceCall object as url.Values

type UsersIdentityCall

type UsersIdentityCall struct {
	// contains filtered or unexported fields
}

UsersIdentityCall is created by UsersService.Identity method call

func (*UsersIdentityCall) Do

Do executes the call to access users.identity endpoint

func (*UsersIdentityCall) FromValues

func (c *UsersIdentityCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsersIdentityCall) ValidateArgs

func (c *UsersIdentityCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsersIdentityCall object

func (*UsersIdentityCall) Values

func (c *UsersIdentityCall) Values() (url.Values, error)

Values returns the UsersIdentityCall object as url.Values

type UsersInfoCall

type UsersInfoCall struct {
	// contains filtered or unexported fields
}

UsersInfoCall is created by UsersService.Info method call

func (*UsersInfoCall) Do

func (c *UsersInfoCall) Do(ctx context.Context) (*objects.User, error)

Do executes the call to access users.info endpoint

func (*UsersInfoCall) FromValues

func (c *UsersInfoCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsersInfoCall) IncludeLocale

func (c *UsersInfoCall) IncludeLocale(includeLocale bool) *UsersInfoCall

IncludeLocale sets the value for optional includeLocale parameter

func (*UsersInfoCall) ValidateArgs

func (c *UsersInfoCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsersInfoCall object

func (*UsersInfoCall) Values

func (c *UsersInfoCall) Values() (url.Values, error)

Values returns the UsersInfoCall object as url.Values

type UsersListCall

type UsersListCall struct {
	// contains filtered or unexported fields
}

UsersListCall is created by UsersService.List method call

func (*UsersListCall) Do

Do executes the call to access users.list endpoint

func (*UsersListCall) FromValues

func (c *UsersListCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsersListCall) IncludeLocale

func (c *UsersListCall) IncludeLocale(includeLocale bool) *UsersListCall

IncludeLocale sets the value for optional includeLocale parameter

func (*UsersListCall) Limit

func (c *UsersListCall) Limit(limit int) *UsersListCall

Limit sets the value for optional limit parameter

func (*UsersListCall) Presence

func (c *UsersListCall) Presence(presence bool) *UsersListCall

Presence sets the value for optional presence parameter

func (*UsersListCall) ValidateArgs

func (c *UsersListCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsersListCall object

func (*UsersListCall) Values

func (c *UsersListCall) Values() (url.Values, error)

Values returns the UsersListCall object as url.Values

type UsersLookupByEmailCall

type UsersLookupByEmailCall struct {
	// contains filtered or unexported fields
}

UsersLookupByEmailCall is created by UsersService.LookupByEmail method call

func (*UsersLookupByEmailCall) Do

Do executes the call to access users.lookupByEmail endpoint

func (*UsersLookupByEmailCall) FromValues

func (c *UsersLookupByEmailCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsersLookupByEmailCall) ValidateArgs

func (c *UsersLookupByEmailCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsersLookupByEmailCall object

func (*UsersLookupByEmailCall) Values

func (c *UsersLookupByEmailCall) Values() (url.Values, error)

Values returns the UsersLookupByEmailCall object as url.Values

type UsersProfileGetCall

type UsersProfileGetCall struct {
	// contains filtered or unexported fields
}

UsersProfileGetCall is created by UsersProfileService.Get method call

func (*UsersProfileGetCall) Do

Do executes the call to access users.profile.get endpoint

func (*UsersProfileGetCall) FromValues

func (c *UsersProfileGetCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsersProfileGetCall) IncludeLabels

func (c *UsersProfileGetCall) IncludeLabels(includeLabels bool) *UsersProfileGetCall

IncludeLabels sets the value for optional includeLabels parameter

func (*UsersProfileGetCall) User

User sets the value for optional user parameter

func (*UsersProfileGetCall) ValidateArgs

func (c *UsersProfileGetCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsersProfileGetCall object

func (*UsersProfileGetCall) Values

func (c *UsersProfileGetCall) Values() (url.Values, error)

Values returns the UsersProfileGetCall object as url.Values

type UsersProfileService

type UsersProfileService struct {
	// contains filtered or unexported fields
}

UsersProfileService handles UsersProfile related endpoints

func (*UsersProfileService) Get

Get creates a UsersProfileGetCall object in preparation for accessing the users.profile.get endpoint

func (*UsersProfileService) Set

Set creates a UsersProfileSetCall object in preparation for accessing the users.profile.set endpoint

type UsersProfileSetCall

type UsersProfileSetCall struct {
	// contains filtered or unexported fields
}

UsersProfileSetCall is created by UsersProfileService.Set method call

func (*UsersProfileSetCall) Do

Do executes the call to access users.profile.set endpoint

func (*UsersProfileSetCall) FromValues

func (c *UsersProfileSetCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsersProfileSetCall) Name

Name sets the value for optional name parameter

func (*UsersProfileSetCall) Profile

Profile sets the value for optional profile parameter

func (*UsersProfileSetCall) User

User sets the value for optional user parameter

func (*UsersProfileSetCall) ValidateArgs

func (c *UsersProfileSetCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsersProfileSetCall object

func (*UsersProfileSetCall) Value

Value sets the value for optional value parameter

func (*UsersProfileSetCall) Values

func (c *UsersProfileSetCall) Values() (url.Values, error)

Values returns the UsersProfileSetCall object as url.Values

type UsersService

type UsersService struct {
	// contains filtered or unexported fields
}

UsersService handles Users related endpoints

func (*UsersService) DeletePhoto

func (s *UsersService) DeletePhoto() *UsersDeletePhotoCall

DeletePhoto creates a UsersDeletePhotoCall object in preparation for accessing the users.deletePhoto endpoint

func (*UsersService) GetPresence

func (s *UsersService) GetPresence(user string) *UsersGetPresenceCall

GetPresence creates a UsersGetPresenceCall object in preparation for accessing the users.getPresence endpoint

func (*UsersService) Identity

func (s *UsersService) Identity() *UsersIdentityCall

Identity creates a UsersIdentityCall object in preparation for accessing the users.identity endpoint

func (*UsersService) Info

func (s *UsersService) Info(user string) *UsersInfoCall

Info creates a UsersInfoCall object in preparation for accessing the users.info endpoint

func (*UsersService) List

func (s *UsersService) List() *UsersListCall

List creates a UsersListCall object in preparation for accessing the users.list endpoint

func (*UsersService) LookupByEmail

func (s *UsersService) LookupByEmail(email string) *UsersLookupByEmailCall

LookupByEmail creates a UsersLookupByEmailCall object in preparation for accessing the users.lookupByEmail endpoint

func (*UsersService) SetActive

func (s *UsersService) SetActive() *UsersSetActiveCall

SetActive creates a UsersSetActiveCall object in preparation for accessing the users.setActive endpoint

func (*UsersService) SetPresence

func (s *UsersService) SetPresence(presence string) *UsersSetPresenceCall

SetPresence creates a UsersSetPresenceCall object in preparation for accessing the users.setPresence endpoint

type UsersSetActiveCall

type UsersSetActiveCall struct {
	// contains filtered or unexported fields
}

UsersSetActiveCall is created by UsersService.SetActive method call

func (*UsersSetActiveCall) Do

Do executes the call to access users.setActive endpoint

func (*UsersSetActiveCall) FromValues

func (c *UsersSetActiveCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsersSetActiveCall) ValidateArgs

func (c *UsersSetActiveCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsersSetActiveCall object

func (*UsersSetActiveCall) Values

func (c *UsersSetActiveCall) Values() (url.Values, error)

Values returns the UsersSetActiveCall object as url.Values

type UsersSetPresenceCall

type UsersSetPresenceCall struct {
	// contains filtered or unexported fields
}

UsersSetPresenceCall is created by UsersService.SetPresence method call

func (*UsersSetPresenceCall) Do

Do executes the call to access users.setPresence endpoint

func (*UsersSetPresenceCall) FromValues

func (c *UsersSetPresenceCall) FromValues(v url.Values) error

FromValues parses the data in v and populates `c`

func (*UsersSetPresenceCall) ValidateArgs

func (c *UsersSetPresenceCall) ValidateArgs() error

ValidateArgs checks that all required fields are set in the UsersSetPresenceCall object

func (*UsersSetPresenceCall) Values

func (c *UsersSetPresenceCall) Values() (url.Values, error)

Values returns the UsersSetPresenceCall object as url.Values

Directories

Path Synopsis
cmd
slaproxy Module
internal

Jump to

Keyboard shortcuts

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