chimesdkmessagingiface

package
v1.40.20 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Overview

Package chimesdkmessagingiface provides an interface to enable mocking the Amazon Chime SDK Messaging service client for testing your code.

It is important to note that this interface will have breaking changes when the service model is updated and adds new API operations, paginators, and waiters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChimeSDKMessagingAPI

type ChimeSDKMessagingAPI interface {
	BatchCreateChannelMembership(*chimesdkmessaging.BatchCreateChannelMembershipInput) (*chimesdkmessaging.BatchCreateChannelMembershipOutput, error)
	BatchCreateChannelMembershipWithContext(aws.Context, *chimesdkmessaging.BatchCreateChannelMembershipInput, ...request.Option) (*chimesdkmessaging.BatchCreateChannelMembershipOutput, error)
	BatchCreateChannelMembershipRequest(*chimesdkmessaging.BatchCreateChannelMembershipInput) (*request.Request, *chimesdkmessaging.BatchCreateChannelMembershipOutput)

	CreateChannel(*chimesdkmessaging.CreateChannelInput) (*chimesdkmessaging.CreateChannelOutput, error)
	CreateChannelWithContext(aws.Context, *chimesdkmessaging.CreateChannelInput, ...request.Option) (*chimesdkmessaging.CreateChannelOutput, error)
	CreateChannelRequest(*chimesdkmessaging.CreateChannelInput) (*request.Request, *chimesdkmessaging.CreateChannelOutput)

	CreateChannelBan(*chimesdkmessaging.CreateChannelBanInput) (*chimesdkmessaging.CreateChannelBanOutput, error)
	CreateChannelBanWithContext(aws.Context, *chimesdkmessaging.CreateChannelBanInput, ...request.Option) (*chimesdkmessaging.CreateChannelBanOutput, error)
	CreateChannelBanRequest(*chimesdkmessaging.CreateChannelBanInput) (*request.Request, *chimesdkmessaging.CreateChannelBanOutput)

	CreateChannelMembership(*chimesdkmessaging.CreateChannelMembershipInput) (*chimesdkmessaging.CreateChannelMembershipOutput, error)
	CreateChannelMembershipWithContext(aws.Context, *chimesdkmessaging.CreateChannelMembershipInput, ...request.Option) (*chimesdkmessaging.CreateChannelMembershipOutput, error)
	CreateChannelMembershipRequest(*chimesdkmessaging.CreateChannelMembershipInput) (*request.Request, *chimesdkmessaging.CreateChannelMembershipOutput)

	CreateChannelModerator(*chimesdkmessaging.CreateChannelModeratorInput) (*chimesdkmessaging.CreateChannelModeratorOutput, error)
	CreateChannelModeratorWithContext(aws.Context, *chimesdkmessaging.CreateChannelModeratorInput, ...request.Option) (*chimesdkmessaging.CreateChannelModeratorOutput, error)
	CreateChannelModeratorRequest(*chimesdkmessaging.CreateChannelModeratorInput) (*request.Request, *chimesdkmessaging.CreateChannelModeratorOutput)

	DeleteChannel(*chimesdkmessaging.DeleteChannelInput) (*chimesdkmessaging.DeleteChannelOutput, error)
	DeleteChannelWithContext(aws.Context, *chimesdkmessaging.DeleteChannelInput, ...request.Option) (*chimesdkmessaging.DeleteChannelOutput, error)
	DeleteChannelRequest(*chimesdkmessaging.DeleteChannelInput) (*request.Request, *chimesdkmessaging.DeleteChannelOutput)

	DeleteChannelBan(*chimesdkmessaging.DeleteChannelBanInput) (*chimesdkmessaging.DeleteChannelBanOutput, error)
	DeleteChannelBanWithContext(aws.Context, *chimesdkmessaging.DeleteChannelBanInput, ...request.Option) (*chimesdkmessaging.DeleteChannelBanOutput, error)
	DeleteChannelBanRequest(*chimesdkmessaging.DeleteChannelBanInput) (*request.Request, *chimesdkmessaging.DeleteChannelBanOutput)

	DeleteChannelMembership(*chimesdkmessaging.DeleteChannelMembershipInput) (*chimesdkmessaging.DeleteChannelMembershipOutput, error)
	DeleteChannelMembershipWithContext(aws.Context, *chimesdkmessaging.DeleteChannelMembershipInput, ...request.Option) (*chimesdkmessaging.DeleteChannelMembershipOutput, error)
	DeleteChannelMembershipRequest(*chimesdkmessaging.DeleteChannelMembershipInput) (*request.Request, *chimesdkmessaging.DeleteChannelMembershipOutput)

	DeleteChannelMessage(*chimesdkmessaging.DeleteChannelMessageInput) (*chimesdkmessaging.DeleteChannelMessageOutput, error)
	DeleteChannelMessageWithContext(aws.Context, *chimesdkmessaging.DeleteChannelMessageInput, ...request.Option) (*chimesdkmessaging.DeleteChannelMessageOutput, error)
	DeleteChannelMessageRequest(*chimesdkmessaging.DeleteChannelMessageInput) (*request.Request, *chimesdkmessaging.DeleteChannelMessageOutput)

	DeleteChannelModerator(*chimesdkmessaging.DeleteChannelModeratorInput) (*chimesdkmessaging.DeleteChannelModeratorOutput, error)
	DeleteChannelModeratorWithContext(aws.Context, *chimesdkmessaging.DeleteChannelModeratorInput, ...request.Option) (*chimesdkmessaging.DeleteChannelModeratorOutput, error)
	DeleteChannelModeratorRequest(*chimesdkmessaging.DeleteChannelModeratorInput) (*request.Request, *chimesdkmessaging.DeleteChannelModeratorOutput)

	DescribeChannel(*chimesdkmessaging.DescribeChannelInput) (*chimesdkmessaging.DescribeChannelOutput, error)
	DescribeChannelWithContext(aws.Context, *chimesdkmessaging.DescribeChannelInput, ...request.Option) (*chimesdkmessaging.DescribeChannelOutput, error)
	DescribeChannelRequest(*chimesdkmessaging.DescribeChannelInput) (*request.Request, *chimesdkmessaging.DescribeChannelOutput)

	DescribeChannelBan(*chimesdkmessaging.DescribeChannelBanInput) (*chimesdkmessaging.DescribeChannelBanOutput, error)
	DescribeChannelBanWithContext(aws.Context, *chimesdkmessaging.DescribeChannelBanInput, ...request.Option) (*chimesdkmessaging.DescribeChannelBanOutput, error)
	DescribeChannelBanRequest(*chimesdkmessaging.DescribeChannelBanInput) (*request.Request, *chimesdkmessaging.DescribeChannelBanOutput)

	DescribeChannelMembership(*chimesdkmessaging.DescribeChannelMembershipInput) (*chimesdkmessaging.DescribeChannelMembershipOutput, error)
	DescribeChannelMembershipWithContext(aws.Context, *chimesdkmessaging.DescribeChannelMembershipInput, ...request.Option) (*chimesdkmessaging.DescribeChannelMembershipOutput, error)
	DescribeChannelMembershipRequest(*chimesdkmessaging.DescribeChannelMembershipInput) (*request.Request, *chimesdkmessaging.DescribeChannelMembershipOutput)

	DescribeChannelMembershipForAppInstanceUser(*chimesdkmessaging.DescribeChannelMembershipForAppInstanceUserInput) (*chimesdkmessaging.DescribeChannelMembershipForAppInstanceUserOutput, error)
	DescribeChannelMembershipForAppInstanceUserWithContext(aws.Context, *chimesdkmessaging.DescribeChannelMembershipForAppInstanceUserInput, ...request.Option) (*chimesdkmessaging.DescribeChannelMembershipForAppInstanceUserOutput, error)
	DescribeChannelMembershipForAppInstanceUserRequest(*chimesdkmessaging.DescribeChannelMembershipForAppInstanceUserInput) (*request.Request, *chimesdkmessaging.DescribeChannelMembershipForAppInstanceUserOutput)

	DescribeChannelModeratedByAppInstanceUser(*chimesdkmessaging.DescribeChannelModeratedByAppInstanceUserInput) (*chimesdkmessaging.DescribeChannelModeratedByAppInstanceUserOutput, error)
	DescribeChannelModeratedByAppInstanceUserWithContext(aws.Context, *chimesdkmessaging.DescribeChannelModeratedByAppInstanceUserInput, ...request.Option) (*chimesdkmessaging.DescribeChannelModeratedByAppInstanceUserOutput, error)
	DescribeChannelModeratedByAppInstanceUserRequest(*chimesdkmessaging.DescribeChannelModeratedByAppInstanceUserInput) (*request.Request, *chimesdkmessaging.DescribeChannelModeratedByAppInstanceUserOutput)

	DescribeChannelModerator(*chimesdkmessaging.DescribeChannelModeratorInput) (*chimesdkmessaging.DescribeChannelModeratorOutput, error)
	DescribeChannelModeratorWithContext(aws.Context, *chimesdkmessaging.DescribeChannelModeratorInput, ...request.Option) (*chimesdkmessaging.DescribeChannelModeratorOutput, error)
	DescribeChannelModeratorRequest(*chimesdkmessaging.DescribeChannelModeratorInput) (*request.Request, *chimesdkmessaging.DescribeChannelModeratorOutput)

	GetChannelMessage(*chimesdkmessaging.GetChannelMessageInput) (*chimesdkmessaging.GetChannelMessageOutput, error)
	GetChannelMessageWithContext(aws.Context, *chimesdkmessaging.GetChannelMessageInput, ...request.Option) (*chimesdkmessaging.GetChannelMessageOutput, error)
	GetChannelMessageRequest(*chimesdkmessaging.GetChannelMessageInput) (*request.Request, *chimesdkmessaging.GetChannelMessageOutput)

	GetMessagingSessionEndpoint(*chimesdkmessaging.GetMessagingSessionEndpointInput) (*chimesdkmessaging.GetMessagingSessionEndpointOutput, error)
	GetMessagingSessionEndpointWithContext(aws.Context, *chimesdkmessaging.GetMessagingSessionEndpointInput, ...request.Option) (*chimesdkmessaging.GetMessagingSessionEndpointOutput, error)
	GetMessagingSessionEndpointRequest(*chimesdkmessaging.GetMessagingSessionEndpointInput) (*request.Request, *chimesdkmessaging.GetMessagingSessionEndpointOutput)

	ListChannelBans(*chimesdkmessaging.ListChannelBansInput) (*chimesdkmessaging.ListChannelBansOutput, error)
	ListChannelBansWithContext(aws.Context, *chimesdkmessaging.ListChannelBansInput, ...request.Option) (*chimesdkmessaging.ListChannelBansOutput, error)
	ListChannelBansRequest(*chimesdkmessaging.ListChannelBansInput) (*request.Request, *chimesdkmessaging.ListChannelBansOutput)

	ListChannelBansPages(*chimesdkmessaging.ListChannelBansInput, func(*chimesdkmessaging.ListChannelBansOutput, bool) bool) error
	ListChannelBansPagesWithContext(aws.Context, *chimesdkmessaging.ListChannelBansInput, func(*chimesdkmessaging.ListChannelBansOutput, bool) bool, ...request.Option) error

	ListChannelMemberships(*chimesdkmessaging.ListChannelMembershipsInput) (*chimesdkmessaging.ListChannelMembershipsOutput, error)
	ListChannelMembershipsWithContext(aws.Context, *chimesdkmessaging.ListChannelMembershipsInput, ...request.Option) (*chimesdkmessaging.ListChannelMembershipsOutput, error)
	ListChannelMembershipsRequest(*chimesdkmessaging.ListChannelMembershipsInput) (*request.Request, *chimesdkmessaging.ListChannelMembershipsOutput)

	ListChannelMembershipsPages(*chimesdkmessaging.ListChannelMembershipsInput, func(*chimesdkmessaging.ListChannelMembershipsOutput, bool) bool) error
	ListChannelMembershipsPagesWithContext(aws.Context, *chimesdkmessaging.ListChannelMembershipsInput, func(*chimesdkmessaging.ListChannelMembershipsOutput, bool) bool, ...request.Option) error

	ListChannelMembershipsForAppInstanceUser(*chimesdkmessaging.ListChannelMembershipsForAppInstanceUserInput) (*chimesdkmessaging.ListChannelMembershipsForAppInstanceUserOutput, error)
	ListChannelMembershipsForAppInstanceUserWithContext(aws.Context, *chimesdkmessaging.ListChannelMembershipsForAppInstanceUserInput, ...request.Option) (*chimesdkmessaging.ListChannelMembershipsForAppInstanceUserOutput, error)
	ListChannelMembershipsForAppInstanceUserRequest(*chimesdkmessaging.ListChannelMembershipsForAppInstanceUserInput) (*request.Request, *chimesdkmessaging.ListChannelMembershipsForAppInstanceUserOutput)

	ListChannelMembershipsForAppInstanceUserPages(*chimesdkmessaging.ListChannelMembershipsForAppInstanceUserInput, func(*chimesdkmessaging.ListChannelMembershipsForAppInstanceUserOutput, bool) bool) error
	ListChannelMembershipsForAppInstanceUserPagesWithContext(aws.Context, *chimesdkmessaging.ListChannelMembershipsForAppInstanceUserInput, func(*chimesdkmessaging.ListChannelMembershipsForAppInstanceUserOutput, bool) bool, ...request.Option) error

	ListChannelMessages(*chimesdkmessaging.ListChannelMessagesInput) (*chimesdkmessaging.ListChannelMessagesOutput, error)
	ListChannelMessagesWithContext(aws.Context, *chimesdkmessaging.ListChannelMessagesInput, ...request.Option) (*chimesdkmessaging.ListChannelMessagesOutput, error)
	ListChannelMessagesRequest(*chimesdkmessaging.ListChannelMessagesInput) (*request.Request, *chimesdkmessaging.ListChannelMessagesOutput)

	ListChannelMessagesPages(*chimesdkmessaging.ListChannelMessagesInput, func(*chimesdkmessaging.ListChannelMessagesOutput, bool) bool) error
	ListChannelMessagesPagesWithContext(aws.Context, *chimesdkmessaging.ListChannelMessagesInput, func(*chimesdkmessaging.ListChannelMessagesOutput, bool) bool, ...request.Option) error

	ListChannelModerators(*chimesdkmessaging.ListChannelModeratorsInput) (*chimesdkmessaging.ListChannelModeratorsOutput, error)
	ListChannelModeratorsWithContext(aws.Context, *chimesdkmessaging.ListChannelModeratorsInput, ...request.Option) (*chimesdkmessaging.ListChannelModeratorsOutput, error)
	ListChannelModeratorsRequest(*chimesdkmessaging.ListChannelModeratorsInput) (*request.Request, *chimesdkmessaging.ListChannelModeratorsOutput)

	ListChannelModeratorsPages(*chimesdkmessaging.ListChannelModeratorsInput, func(*chimesdkmessaging.ListChannelModeratorsOutput, bool) bool) error
	ListChannelModeratorsPagesWithContext(aws.Context, *chimesdkmessaging.ListChannelModeratorsInput, func(*chimesdkmessaging.ListChannelModeratorsOutput, bool) bool, ...request.Option) error

	ListChannels(*chimesdkmessaging.ListChannelsInput) (*chimesdkmessaging.ListChannelsOutput, error)
	ListChannelsWithContext(aws.Context, *chimesdkmessaging.ListChannelsInput, ...request.Option) (*chimesdkmessaging.ListChannelsOutput, error)
	ListChannelsRequest(*chimesdkmessaging.ListChannelsInput) (*request.Request, *chimesdkmessaging.ListChannelsOutput)

	ListChannelsPages(*chimesdkmessaging.ListChannelsInput, func(*chimesdkmessaging.ListChannelsOutput, bool) bool) error
	ListChannelsPagesWithContext(aws.Context, *chimesdkmessaging.ListChannelsInput, func(*chimesdkmessaging.ListChannelsOutput, bool) bool, ...request.Option) error

	ListChannelsModeratedByAppInstanceUser(*chimesdkmessaging.ListChannelsModeratedByAppInstanceUserInput) (*chimesdkmessaging.ListChannelsModeratedByAppInstanceUserOutput, error)
	ListChannelsModeratedByAppInstanceUserWithContext(aws.Context, *chimesdkmessaging.ListChannelsModeratedByAppInstanceUserInput, ...request.Option) (*chimesdkmessaging.ListChannelsModeratedByAppInstanceUserOutput, error)
	ListChannelsModeratedByAppInstanceUserRequest(*chimesdkmessaging.ListChannelsModeratedByAppInstanceUserInput) (*request.Request, *chimesdkmessaging.ListChannelsModeratedByAppInstanceUserOutput)

	ListChannelsModeratedByAppInstanceUserPages(*chimesdkmessaging.ListChannelsModeratedByAppInstanceUserInput, func(*chimesdkmessaging.ListChannelsModeratedByAppInstanceUserOutput, bool) bool) error
	ListChannelsModeratedByAppInstanceUserPagesWithContext(aws.Context, *chimesdkmessaging.ListChannelsModeratedByAppInstanceUserInput, func(*chimesdkmessaging.ListChannelsModeratedByAppInstanceUserOutput, bool) bool, ...request.Option) error

	RedactChannelMessage(*chimesdkmessaging.RedactChannelMessageInput) (*chimesdkmessaging.RedactChannelMessageOutput, error)
	RedactChannelMessageWithContext(aws.Context, *chimesdkmessaging.RedactChannelMessageInput, ...request.Option) (*chimesdkmessaging.RedactChannelMessageOutput, error)
	RedactChannelMessageRequest(*chimesdkmessaging.RedactChannelMessageInput) (*request.Request, *chimesdkmessaging.RedactChannelMessageOutput)

	SendChannelMessage(*chimesdkmessaging.SendChannelMessageInput) (*chimesdkmessaging.SendChannelMessageOutput, error)
	SendChannelMessageWithContext(aws.Context, *chimesdkmessaging.SendChannelMessageInput, ...request.Option) (*chimesdkmessaging.SendChannelMessageOutput, error)
	SendChannelMessageRequest(*chimesdkmessaging.SendChannelMessageInput) (*request.Request, *chimesdkmessaging.SendChannelMessageOutput)

	UpdateChannel(*chimesdkmessaging.UpdateChannelInput) (*chimesdkmessaging.UpdateChannelOutput, error)
	UpdateChannelWithContext(aws.Context, *chimesdkmessaging.UpdateChannelInput, ...request.Option) (*chimesdkmessaging.UpdateChannelOutput, error)
	UpdateChannelRequest(*chimesdkmessaging.UpdateChannelInput) (*request.Request, *chimesdkmessaging.UpdateChannelOutput)

	UpdateChannelMessage(*chimesdkmessaging.UpdateChannelMessageInput) (*chimesdkmessaging.UpdateChannelMessageOutput, error)
	UpdateChannelMessageWithContext(aws.Context, *chimesdkmessaging.UpdateChannelMessageInput, ...request.Option) (*chimesdkmessaging.UpdateChannelMessageOutput, error)
	UpdateChannelMessageRequest(*chimesdkmessaging.UpdateChannelMessageInput) (*request.Request, *chimesdkmessaging.UpdateChannelMessageOutput)

	UpdateChannelReadMarker(*chimesdkmessaging.UpdateChannelReadMarkerInput) (*chimesdkmessaging.UpdateChannelReadMarkerOutput, error)
	UpdateChannelReadMarkerWithContext(aws.Context, *chimesdkmessaging.UpdateChannelReadMarkerInput, ...request.Option) (*chimesdkmessaging.UpdateChannelReadMarkerOutput, error)
	UpdateChannelReadMarkerRequest(*chimesdkmessaging.UpdateChannelReadMarkerInput) (*request.Request, *chimesdkmessaging.UpdateChannelReadMarkerOutput)
}

ChimeSDKMessagingAPI provides an interface to enable mocking the chimesdkmessaging.ChimeSDKMessaging service client's API operation, paginators, and waiters. This make unit testing your code that calls out to the SDK's service client's calls easier.

The best way to use this interface is so the SDK's service client's calls can be stubbed out for unit testing your code with the SDK without needing to inject custom request handlers into the SDK's request pipeline.

// myFunc uses an SDK service client to make a request to
// Amazon Chime SDK Messaging.
func myFunc(svc chimesdkmessagingiface.ChimeSDKMessagingAPI) bool {
    // Make svc.BatchCreateChannelMembership request
}

func main() {
    sess := session.New()
    svc := chimesdkmessaging.New(sess)

    myFunc(svc)
}

In your _test.go file:

// Define a mock struct to be used in your unit tests of myFunc.
type mockChimeSDKMessagingClient struct {
    chimesdkmessagingiface.ChimeSDKMessagingAPI
}
func (m *mockChimeSDKMessagingClient) BatchCreateChannelMembership(input *chimesdkmessaging.BatchCreateChannelMembershipInput) (*chimesdkmessaging.BatchCreateChannelMembershipOutput, error) {
    // mock response/functionality
}

func TestMyFunc(t *testing.T) {
    // Setup Test
    mockSvc := &mockChimeSDKMessagingClient{}

    myfunc(mockSvc)

    // Verify myFunc's functionality
}

It is important to note that this interface will have breaking changes when the service model is updated and adds new API operations, paginators, and waiters. Its suggested to use the pattern above for testing, or using tooling to generate mocks to satisfy the interfaces.

Jump to

Keyboard shortcuts

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