aws_chime_sdk

package module
v0.0.0-...-a5f424d Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2018 License: MIT Imports: 19 Imported by: 0

README

aws-chime-sdk

package aws-chime-sdk is a reverse engineered golang client SDK for AWS Chime

warning this package is considered experimental und not stable. The API can change anytime. Contributions are welcome :)

Status

  • Authentication
    • Active-Directory auth (enterprise only)
    • Amazon auth
  • Messaging
    • WebSockets
    • Post with attachments
    • parse mentions
    • Rooms
      • listing
      • posting messages
      • fetching messages
      • memberships
    • Conversations
      • listing
      • posting messages
      • fetching messages
      • filtering
    • Contacts
      • searching
      • fetching
  • VoiP
  • Call

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateConfig

func GenerateConfig(username, password, config string) error

Types

type Attachment

type Attachment struct {
	ContentType string
	UploadId    string
	UploadUrl   string
	UploadEtag  string
}

type ChimeClient

type ChimeClient struct {
	Session *Session

	Rooms         *RoomClient
	Conversations *ConversationsClient
	Contacts      *ContactsClient
	Device        *DeviceClient
	WebSockets    *WebSocketsClient
	// contains filtered or unexported fields
}

func New

func New(config string) (*ChimeClient, error)

func (*ChimeClient) PeriodicRefresh

func (c *ChimeClient) PeriodicRefresh() error

func (*ChimeClient) RefreshSession

func (c *ChimeClient) RefreshSession() (*time.Time, error)

func (*ChimeClient) Shutdown

func (c *ChimeClient) Shutdown()

func (*ChimeClient) SignOut

func (c *ChimeClient) SignOut() error

func (*ChimeClient) Upload

func (c *ChimeClient) Upload(r io.Reader, contentType string) (*Attachment, error)

type Contact

type Contact struct {
	ID              string `json:"id"`
	Email           string `json:"email"`
	DisplayName     string `json:"display_name"`
	FullName        string `json:"full_name"`
	PresenceChannel string `json:"presence_channel"`
	ProfileChannel  string `json:"profile_channel"`
}

type ContactsClient

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

func (*ContactsClient) AutoComplete

func (r *ContactsClient) AutoComplete(needle string) ([]Contact, error)

func (*ContactsClient) List

func (r *ContactsClient) List() ([]Contact, error)

type Conversation

type Conversation struct {
	Channel        string
	ConversationId string
	CreatedOn      time.Time
	Favorite       bool
	LastSent       time.Time
	LastMessage    *Message
	Members        []Member
	Name           string
	UpdatedOn      time.Time
	Visibility     string
	Preferences    struct {
		NotificationPreferences struct {
			DesktopNotificationPreferences string
			MobileNotificationPreferences  string
		}
	}
}

type ConversationListOptions

type ConversationListOptions struct {
	Favorite   bool
	Recent     bool
	Preview    bool
	ProfileIDs []string
	NextToken  string
}

type ConversationsClient

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

func (*ConversationsClient) Create

func (r *ConversationsClient) Create(profiles []string) (*Conversation, error)

func (*ConversationsClient) DeleteMessage

func (r *ConversationsClient) DeleteMessage(conversationID, messageID string) error

func (*ConversationsClient) Get

func (*ConversationsClient) List

func (*ConversationsClient) Messages

func (r *ConversationsClient) Messages(id string, opts *MessageListOptions) ([]Message, string, error)

func (*ConversationsClient) Page

func (r *ConversationsClient) Page(opts *ConversationListOptions, handler func([]Conversation) bool) error

func (*ConversationsClient) Post

func (r *ConversationsClient) Post(conversationID string, msg PostInput) (*Message, error)

type Device

type Device struct {
	Capabilities     int
	DeviceToken      string
	Platform         string
	PlatformDeviceId string
	// part of API responses
	IsEnabled             bool
	UaChannelToken        string
	SessionClaims         map[string]string
	CapabilitiesV2        map[string]string
	Channel               string
	LastKnownActivityTime time.Time
}

func (Device) DeviceType

func (d Device) DeviceType() string

type DeviceClient

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

func (*DeviceClient) PresenceSettings

func (c *DeviceClient) PresenceSettings() (*PresenceSettings, error)

func (*DeviceClient) SetPresenceSettings

func (c *DeviceClient) SetPresenceSettings(presence *PresenceSettings) error

func (*DeviceClient) SetStatus

func (c *DeviceClient) SetStatus(status string) error

type ListOptions

type ListOptions struct {
	MaxResults int
	NextToken  string
}

type Member

type Member struct {
	DisplayName     string
	Email           string
	FullName        string
	LastDelivered   time.Time
	LastRead        time.Time
	PresenceChannel string
	ProfileId       string
	ProfileType     string
}

type Mention

type Mention struct {
	ProfileID string
	Name      string
}

func ParseMessage

func ParseMessage(message string) ([]Mention, bool)

ParseMessage inspects a message and extracts all mentions, if any

type Message

type Message struct {
	Content         string
	CreatedOn       time.Time
	HasMentions     bool
	IsEdited        bool
	IsSystemMessage bool
	MessageId       string
	RoomId          string
	Sender          string
	UpdatedOn       time.Time
}

type MessageListOptions

type MessageListOptions struct {
	ListOptions
	After *time.Time
}

type PostInput

type PostInput struct {
	Content    string
	Attachment *Attachment
}

type PresenceSettings

type PresenceSettings struct {
	ManualAvailability string
	PresenceVisibility string
}

type Profile

type Profile struct {
	ID              string `json:"id"`
	Email           string `json:"email"`
	DisplayName     string `json:"display_name"`
	FullName        string `json:"full_name"`
	PresenceChannel string `json:"presence_channel"`
	ProfileChannel  string `json:"profile_channel"`
}

type Room

type Room struct {
	Channel       string
	CreatedOn     string
	LastMentioned string
	LastRead      string
	LastSent      string
	Name          string
	Open          bool
	Preferences   struct {
		NotificationPreferences struct {
			DesktopNotificationPreferences string
			MobileNotificationPreferences  string
		}
	}
	Privacy    string
	RoomId     string
	Type       string
	UpdatedOn  string
	Visibility string
}

type RoomClient

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

func (*RoomClient) AddMember

func (r *RoomClient) AddMember(roomID, profileID string) error

func (*RoomClient) Create

func (r *RoomClient) Create(name string) (*Room, error)

func (*RoomClient) Delete

func (r *RoomClient) Delete(roomID string) error

func (*RoomClient) DeleteMessage

func (r *RoomClient) DeleteMessage(roomID, messageID string) error

func (*RoomClient) Get

func (r *RoomClient) Get(roomID string) (*Room, error)

func (*RoomClient) List

func (r *RoomClient) List(opts *RoomListOptions) ([]Room, string, error)

func (*RoomClient) Memberships

func (r *RoomClient) Memberships(roomID string) (RoomMemberships, error)

func (*RoomClient) Message

func (r *RoomClient) Message(roomID, messageID string) (*Message, error)

func (*RoomClient) Messages

func (r *RoomClient) Messages(roomID string, opts *MessageListOptions) ([]Message, string, error)

func (*RoomClient) Post

func (r *RoomClient) Post(roomID string, msg PostInput) (*Message, error)

func (*RoomClient) Visibility

func (r *RoomClient) Visibility(roomID, visibility string) (*Room, error)

type RoomListOptions

type RoomListOptions struct {
	ListOptions
	Visibility *string
}

type RoomMembership

type RoomMembership struct {
	Presence  string
	Role      string
	RoomId    string
	Status    string
	UpdatedOn time.Time
	Member    Member
}

type RoomMemberships

type RoomMemberships map[string]RoomMembership

type Session

type Session struct {
	Profile       Profile
	Device        Device
	SessionToken  string
	SessionId     string
	ServiceConfig serviceConfig
}

type WebSocketsClient

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

func (*WebSocketsClient) Connect

func (w *WebSocketsClient) Connect(parent context.Context, subscriptions []string) (<-chan WebsocketPushEvent, error)

type WebsocketConversationEvent

type WebsocketConversationEvent struct {
	Channel     string
	Members     []Member
	Preferences struct {
		NotificationPreferences struct {
			DesktopNotificationPreferences string
			MobileNotificationPreferences  string
		}
	}
	ConversationID string `json:"ConversationId"`
	Name           string
	Visibility     string
	CreatedOn      time.Time
	Favorite       bool
	LastSent       time.Time
	UpdatedOn      time.Time
}

klass == Conversation

type WebsocketConversationMembershipEvent

type WebsocketConversationMembershipEvent struct {
	UpdatedOn      time.Time
	Member         Member
	ConversationID string `json:"ConversationId"`
}

type WebsocketConversationMessageEvent

type WebsocketConversationMessageEvent struct {
	ConversationID  string `json:"ConversationId"`
	CreatedOn       time.Time
	Content         string
	MessageID       string `json:"MessageId"`
	UpdatedOn       time.Time
	IsEdited        bool
	IsSystemMessage bool
	Sender          string
}

type WebsocketJoinableMeetingsEvent

type WebsocketJoinableMeetingsEvent struct {
	Klass    string      `json:"klass"`
	Meetings interface{} `json:"meetings"`
}

klass == JoinableMeetings

type WebsocketPresenceEvent

type WebsocketPresenceEvent struct {
	ProfileID    string `json:"ProfileId"`
	Revision     int64
	Availability int64
}

klass == Presence

type WebsocketPushEvent

type WebsocketPushEvent struct {
	Channel string `json:"channel"`
	Data    struct {
		ID           string          `json:"id"`
		Klass        string          `json:"klass"`
		Record       json.RawMessage `json:"record"`
		ParsedRecord interface{}
		Type         string `json:"type"`
		Metadata     struct {
			IsNoisy bool
		} `json:"metadata"`
		TraceID string `json:"trace_id"`
	} `json:"data"`
}

type WebsocketRoomEvent

type WebsocketRoomEvent struct {
	Open        bool
	Preferences struct {
		NotificationPreferences struct {
			DesktopNotificationPreferences string
			MobileNotificationPreferences  string
		}
	}
	Channel    string
	Type       string
	RoomID     string `json:"RoomId"`
	Name       string
	Visibility string
	Privacy    string
	Favorite   bool
	CreatedOn  time.Time
	LastRead   time.Time
	LastSent   time.Time
	UpdatedOn  time.Time
}

klass == Room

type WebsocketRoomMessageEvent

type WebsocketRoomMessageEvent struct {
	RoomID          string `json:"RoomId"`
	HasMentions     bool
	CreatedOn       time.Time
	Content         string
	MessageID       string `json:"MessageId"`
	UpdatedOn       time.Time
	IsEdited        bool
	IsSystemMessage bool
	Sender          string
}

klass == RoomMessage

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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