chat

package
v0.20241126.1723 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/microsoft-graph/users/beta/chat Documentation

The chat SDK allows for interaction with Microsoft Graph users (API Version beta).

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/users/beta/chat"

Client Initialization

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

Example Usage: ChatClient.CreateChat

ctx := context.TODO()
id := chat.NewUserID("userId")

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


read, err := client.CreateChat(ctx, id, 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.NewUserIdChatID("userId", "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.NewUserIdChatID("userId", "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()
id := chat.NewUserID("userId")

read, err := client.GetChatsCount(ctx, id, 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.NewUserIdChatID("userId", "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()
id := chat.NewUserID("userId")

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

Example Usage: ChatClient.MarkChatReadForUser

ctx := context.TODO()
id := chat.NewUserIdChatID("userId", "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.NewUserIdChatID("userId", "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.RemoveChatAllAccessForUser

ctx := context.TODO()
id := chat.NewUserIdChatID("userId", "chatId")

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


read, err := client.RemoveChatAllAccessForUser(ctx, id, payload, chat.DefaultRemoveChatAllAccessForUserOperationOptions())
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.NewUserIdChatID("userId", "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.NewUserIdChatID("userId", "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.NewUserIdChatID("userId", "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, id beta.UserId, input beta.Chat, options CreateChatOperationOptions) (result CreateChatOperationResponse, err error)

CreateChat - Create new navigation property to chats for users

func (ChatClient) DeleteChat

DeleteChat - Delete navigation property chats for users

func (ChatClient) GetChat

GetChat - Get chat. Retrieve a single chat (without its messages). This method supports federation. To access a chat, at least one chat member must belong to the tenant the request initiated from.

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, id beta.UserId, options ListChatsOperationOptions) (result ListChatsOperationResponse, err error)

ListChats - List chats. Retrieve the list of chats that the user is part of. This method supports federation. When a user ID is provided, the calling application must belong to the same tenant that the user belongs to.

func (ChatClient) ListChatsComplete

ListChatsComplete retrieves all the results into a single object

func (ChatClient) ListChatsCompleteMatchingPredicate

func (c ChatClient) ListChatsCompleteMatchingPredicate(ctx context.Context, id beta.UserId, 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) RemoveChatAllAccessForUser

RemoveChatAllAccessForUser - Invoke action removeAllAccessForUser. Remove access to a chat for a user.

func (ChatClient) SendChatActivityNotification

SendChatActivityNotification - Invoke action sendActivityNotification. Send an activity feed notification in the scope of a chat. For more information, 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 users

type ChatOperationPredicate

type ChatOperationPredicate struct {
}

func (ChatOperationPredicate) Matches

func (p ChatOperationPredicate) Matches(input beta.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        *beta.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        *beta.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 {
	TenantId nullable.Type[string]      `json:"tenantId,omitempty"`
	User     *beta.TeamworkUserIdentity `json:"user,omitempty"`
}

type ListChatsCompleteResult

type ListChatsCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []beta.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        *[]beta.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 {
	TenantId nullable.Type[string]      `json:"tenantId,omitempty"`
	User     *beta.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"`
	TenantId                nullable.Type[string]      `json:"tenantId,omitempty"`
	User                    *beta.TeamworkUserIdentity `json:"user,omitempty"`
}

type RemoveChatAllAccessForUserOperationOptions

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

func DefaultRemoveChatAllAccessForUserOperationOptions

func DefaultRemoveChatAllAccessForUserOperationOptions() RemoveChatAllAccessForUserOperationOptions

func (RemoveChatAllAccessForUserOperationOptions) ToHeaders

func (RemoveChatAllAccessForUserOperationOptions) ToOData

func (RemoveChatAllAccessForUserOperationOptions) ToQuery

type RemoveChatAllAccessForUserOperationResponse

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

type RemoveChatAllAccessForUserRequest

type RemoveChatAllAccessForUserRequest struct {
	User *beta.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        *beta.ItemBody                      `json:"previewText,omitempty"`
	Recipient          *beta.TeamworkNotificationRecipient `json:"recipient,omitempty"`
	TeamsAppId         nullable.Type[string]               `json:"teamsAppId,omitempty"`
	TemplateParameters *[]beta.KeyValuePair                `json:"templateParameters,omitempty"`
	Topic              *beta.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 {
	TenantId nullable.Type[string]      `json:"tenantId,omitempty"`
	User     *beta.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