chat

package
v0.20240923.1151247 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MPL-2.0 Imports: 9 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/microsoft-graph/me/stable/chat Documentation

The chat SDK allows for interaction with Microsoft Graph me (API Version stable).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/microsoft-graph/me/stable/chat"

Client Initialization

client := chat.NewChatClientWithBaseURI("https://graph.microsoft.com")
client.Client.Authorizer = authorizer

Example Usage: ChatClient.CreateChat

ctx := context.TODO()

payload := chat.Chat{
	// ...
}


read, err := client.CreateChat(ctx, payload, chat.DefaultCreateChatOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ChatClient.DeleteChat

ctx := context.TODO()
id := chat.NewMeChatID("chatId")

read, err := client.DeleteChat(ctx, id, chat.DefaultDeleteChatOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ChatClient.GetChat

ctx := context.TODO()
id := chat.NewMeChatID("chatId")

read, err := client.GetChat(ctx, id, chat.DefaultGetChatOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ChatClient.GetChatsCount

ctx := context.TODO()


read, err := client.GetChatsCount(ctx, chat.DefaultGetChatsCountOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ChatClient.HideChatForUser

ctx := context.TODO()
id := chat.NewMeChatID("chatId")

payload := chat.HideChatForUserRequest{
	// ...
}


read, err := client.HideChatForUser(ctx, id, payload, chat.DefaultHideChatForUserOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ChatClient.ListChats

ctx := context.TODO()


// alternatively `client.ListChats(ctx, chat.DefaultListChatsOperationOptions())` can be used to do batched pagination
items, err := client.ListChatsComplete(ctx, chat.DefaultListChatsOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: ChatClient.MarkChatReadForUser

ctx := context.TODO()
id := chat.NewMeChatID("chatId")

payload := chat.MarkChatReadForUserRequest{
	// ...
}


read, err := client.MarkChatReadForUser(ctx, id, payload, chat.DefaultMarkChatReadForUserOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ChatClient.MarkChatUnreadForUser

ctx := context.TODO()
id := chat.NewMeChatID("chatId")

payload := chat.MarkChatUnreadForUserRequest{
	// ...
}


read, err := client.MarkChatUnreadForUser(ctx, id, payload, chat.DefaultMarkChatUnreadForUserOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ChatClient.SendChatActivityNotification

ctx := context.TODO()
id := chat.NewMeChatID("chatId")

payload := chat.SendChatActivityNotificationRequest{
	// ...
}


read, err := client.SendChatActivityNotification(ctx, id, payload, chat.DefaultSendChatActivityNotificationOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ChatClient.UnhideChatForUser

ctx := context.TODO()
id := chat.NewMeChatID("chatId")

payload := chat.UnhideChatForUserRequest{
	// ...
}


read, err := client.UnhideChatForUser(ctx, id, payload, chat.DefaultUnhideChatForUserOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: ChatClient.UpdateChat

ctx := context.TODO()
id := chat.NewMeChatID("chatId")

payload := chat.Chat{
	// ...
}


read, err := client.UpdateChat(ctx, id, payload, chat.DefaultUpdateChatOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatClient

type ChatClient struct {
	Client *msgraph.Client
}

func NewChatClientWithBaseURI

func NewChatClientWithBaseURI(sdkApi sdkEnv.Api) (*ChatClient, error)

func (ChatClient) CreateChat

func (c ChatClient) CreateChat(ctx context.Context, input stable.Chat, options CreateChatOperationOptions) (result CreateChatOperationResponse, err error)

CreateChat - Create new navigation property to chats for me

func (ChatClient) DeleteChat

DeleteChat - Delete navigation property chats for me

func (ChatClient) GetChat

GetChat - Get chats from me

func (ChatClient) GetChatsCount

GetChatsCount - Get the number of the resource

func (ChatClient) HideChatForUser

HideChatForUser - Invoke action hideForUser. Hide a chat for a user.

func (ChatClient) ListChats

func (c ChatClient) ListChats(ctx context.Context, options ListChatsOperationOptions) (result ListChatsOperationResponse, err error)

ListChats - Get chats from me

func (ChatClient) ListChatsComplete

ListChatsComplete retrieves all the results into a single object

func (ChatClient) ListChatsCompleteMatchingPredicate

func (c ChatClient) ListChatsCompleteMatchingPredicate(ctx context.Context, options ListChatsOperationOptions, predicate ChatOperationPredicate) (result ListChatsCompleteResult, err error)

ListChatsCompleteMatchingPredicate retrieves all the results and then applies the predicate

func (ChatClient) MarkChatReadForUser

MarkChatReadForUser - Invoke action markChatReadForUser. Mark a chat as read for a user.

func (ChatClient) MarkChatUnreadForUser

MarkChatUnreadForUser - Invoke action markChatUnreadForUser. Mark a chat as unread for a user.

func (ChatClient) SendChatActivityNotification

SendChatActivityNotification - Invoke action sendActivityNotification. Send an activity feed notification in scope of a chat. For more information about sending notifications and the requirements for doing so, see sending Teams activity notifications.

func (ChatClient) UnhideChatForUser

UnhideChatForUser - Invoke action unhideForUser. Unhide a chat for a user.

func (ChatClient) UpdateChat

UpdateChat - Update the navigation property chats in me

type ChatOperationPredicate

type ChatOperationPredicate struct {
}

func (ChatOperationPredicate) Matches

func (p ChatOperationPredicate) Matches(input stable.Chat) bool

type CreateChatOperationOptions

type CreateChatOperationOptions struct {
	Metadata  *odata.Metadata
	RetryFunc client.RequestRetryFunc
}

func DefaultCreateChatOperationOptions

func DefaultCreateChatOperationOptions() CreateChatOperationOptions

func (CreateChatOperationOptions) ToHeaders

func (o CreateChatOperationOptions) ToHeaders() *client.Headers

func (CreateChatOperationOptions) ToOData

func (o CreateChatOperationOptions) ToOData() *odata.Query

func (CreateChatOperationOptions) ToQuery

type CreateChatOperationResponse

type CreateChatOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *stable.Chat
}

type DeleteChatOperationOptions

type DeleteChatOperationOptions struct {
	IfMatch   *string
	Metadata  *odata.Metadata
	RetryFunc client.RequestRetryFunc
}

func DefaultDeleteChatOperationOptions

func DefaultDeleteChatOperationOptions() DeleteChatOperationOptions

func (DeleteChatOperationOptions) ToHeaders

func (o DeleteChatOperationOptions) ToHeaders() *client.Headers

func (DeleteChatOperationOptions) ToOData

func (o DeleteChatOperationOptions) ToOData() *odata.Query

func (DeleteChatOperationOptions) ToQuery

type DeleteChatOperationResponse

type DeleteChatOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type GetChatOperationOptions

type GetChatOperationOptions struct {
	Expand    *odata.Expand
	Metadata  *odata.Metadata
	RetryFunc client.RequestRetryFunc
	Select    *[]string
}

func DefaultGetChatOperationOptions

func DefaultGetChatOperationOptions() GetChatOperationOptions

func (GetChatOperationOptions) ToHeaders

func (o GetChatOperationOptions) ToHeaders() *client.Headers

func (GetChatOperationOptions) ToOData

func (o GetChatOperationOptions) ToOData() *odata.Query

func (GetChatOperationOptions) ToQuery

type GetChatOperationResponse

type GetChatOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *stable.Chat
}

type GetChatsCountOperationOptions

type GetChatsCountOperationOptions struct {
	Filter    *string
	Metadata  *odata.Metadata
	RetryFunc client.RequestRetryFunc
	Search    *string
}

func DefaultGetChatsCountOperationOptions

func DefaultGetChatsCountOperationOptions() GetChatsCountOperationOptions

func (GetChatsCountOperationOptions) ToHeaders

func (GetChatsCountOperationOptions) ToOData

func (GetChatsCountOperationOptions) ToQuery

type GetChatsCountOperationResponse

type GetChatsCountOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]byte
}

type HideChatForUserOperationOptions

type HideChatForUserOperationOptions struct {
	Metadata  *odata.Metadata
	RetryFunc client.RequestRetryFunc
}

func DefaultHideChatForUserOperationOptions

func DefaultHideChatForUserOperationOptions() HideChatForUserOperationOptions

func (HideChatForUserOperationOptions) ToHeaders

func (HideChatForUserOperationOptions) ToOData

func (HideChatForUserOperationOptions) ToQuery

type HideChatForUserOperationResponse

type HideChatForUserOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type HideChatForUserRequest

type HideChatForUserRequest struct {
	User *stable.TeamworkUserIdentity `json:"user,omitempty"`
}

type ListChatsCompleteResult

type ListChatsCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []stable.Chat
}

type ListChatsCustomPager

type ListChatsCustomPager struct {
	NextLink *odata.Link `json:"@odata.nextLink"`
}
func (p *ListChatsCustomPager) NextPageLink() *odata.Link

type ListChatsOperationOptions

type ListChatsOperationOptions struct {
	Count     *bool
	Expand    *odata.Expand
	Filter    *string
	Metadata  *odata.Metadata
	OrderBy   *odata.OrderBy
	RetryFunc client.RequestRetryFunc
	Search    *string
	Select    *[]string
	Skip      *int64
	Top       *int64
}

func DefaultListChatsOperationOptions

func DefaultListChatsOperationOptions() ListChatsOperationOptions

func (ListChatsOperationOptions) ToHeaders

func (o ListChatsOperationOptions) ToHeaders() *client.Headers

func (ListChatsOperationOptions) ToOData

func (o ListChatsOperationOptions) ToOData() *odata.Query

func (ListChatsOperationOptions) ToQuery

type ListChatsOperationResponse

type ListChatsOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]stable.Chat
}

type MarkChatReadForUserOperationOptions

type MarkChatReadForUserOperationOptions struct {
	Metadata  *odata.Metadata
	RetryFunc client.RequestRetryFunc
}

func DefaultMarkChatReadForUserOperationOptions

func DefaultMarkChatReadForUserOperationOptions() MarkChatReadForUserOperationOptions

func (MarkChatReadForUserOperationOptions) ToHeaders

func (MarkChatReadForUserOperationOptions) ToOData

func (MarkChatReadForUserOperationOptions) ToQuery

type MarkChatReadForUserOperationResponse

type MarkChatReadForUserOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type MarkChatReadForUserRequest

type MarkChatReadForUserRequest struct {
	User *stable.TeamworkUserIdentity `json:"user,omitempty"`
}

type MarkChatUnreadForUserOperationOptions

type MarkChatUnreadForUserOperationOptions struct {
	Metadata  *odata.Metadata
	RetryFunc client.RequestRetryFunc
}

func DefaultMarkChatUnreadForUserOperationOptions

func DefaultMarkChatUnreadForUserOperationOptions() MarkChatUnreadForUserOperationOptions

func (MarkChatUnreadForUserOperationOptions) ToHeaders

func (MarkChatUnreadForUserOperationOptions) ToOData

func (MarkChatUnreadForUserOperationOptions) ToQuery

type MarkChatUnreadForUserOperationResponse

type MarkChatUnreadForUserOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type MarkChatUnreadForUserRequest

type MarkChatUnreadForUserRequest struct {
	LastMessageReadDateTime nullable.Type[string]        `json:"lastMessageReadDateTime,omitempty"`
	User                    *stable.TeamworkUserIdentity `json:"user,omitempty"`
}

type SendChatActivityNotificationOperationOptions

type SendChatActivityNotificationOperationOptions struct {
	Metadata  *odata.Metadata
	RetryFunc client.RequestRetryFunc
}

func DefaultSendChatActivityNotificationOperationOptions

func DefaultSendChatActivityNotificationOperationOptions() SendChatActivityNotificationOperationOptions

func (SendChatActivityNotificationOperationOptions) ToHeaders

func (SendChatActivityNotificationOperationOptions) ToOData

func (SendChatActivityNotificationOperationOptions) ToQuery

type SendChatActivityNotificationOperationResponse

type SendChatActivityNotificationOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type SendChatActivityNotificationRequest

type SendChatActivityNotificationRequest struct {
	ActivityType       nullable.Type[string]                 `json:"activityType,omitempty"`
	ChainId            nullable.Type[int64]                  `json:"chainId,omitempty"`
	PreviewText        *stable.ItemBody                      `json:"previewText,omitempty"`
	Recipient          *stable.TeamworkNotificationRecipient `json:"recipient,omitempty"`
	TeamsAppId         nullable.Type[string]                 `json:"teamsAppId,omitempty"`
	TemplateParameters *[]stable.KeyValuePair                `json:"templateParameters,omitempty"`
	Topic              *stable.TeamworkActivityTopic         `json:"topic,omitempty"`
}

type UnhideChatForUserOperationOptions

type UnhideChatForUserOperationOptions struct {
	Metadata  *odata.Metadata
	RetryFunc client.RequestRetryFunc
}

func DefaultUnhideChatForUserOperationOptions

func DefaultUnhideChatForUserOperationOptions() UnhideChatForUserOperationOptions

func (UnhideChatForUserOperationOptions) ToHeaders

func (UnhideChatForUserOperationOptions) ToOData

func (UnhideChatForUserOperationOptions) ToQuery

type UnhideChatForUserOperationResponse

type UnhideChatForUserOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type UnhideChatForUserRequest

type UnhideChatForUserRequest struct {
	User *stable.TeamworkUserIdentity `json:"user,omitempty"`
}

type UpdateChatOperationOptions

type UpdateChatOperationOptions struct {
	Metadata  *odata.Metadata
	RetryFunc client.RequestRetryFunc
}

func DefaultUpdateChatOperationOptions

func DefaultUpdateChatOperationOptions() UpdateChatOperationOptions

func (UpdateChatOperationOptions) ToHeaders

func (o UpdateChatOperationOptions) ToHeaders() *client.Headers

func (UpdateChatOperationOptions) ToOData

func (o UpdateChatOperationOptions) ToOData() *odata.Query

func (UpdateChatOperationOptions) ToQuery

type UpdateChatOperationResponse

type UpdateChatOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

Jump to

Keyboard shortcuts

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