azureclient

package
v0.0.0-...-96f7096 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddMemberRequest

type AddMemberRequest struct {
	ODataID string `json:"@odata.id"`
}

type Client

type Client interface {
	AddMemberToGroup(ctx context.Context, grp *Group, member *Member) error
	CreateGroup(ctx context.Context, grp *Group) (*Group, error)
	GetGroupById(ctx context.Context, id uuid.UUID) (*Group, error)
	GetOrCreateGroup(ctx context.Context, existingGroupID *uuid.UUID, name, description string) (*Group, bool, error)
	GetUser(ctx context.Context, email string) (*Member, error)
	ListGroupMembers(ctx context.Context, grp *Group) ([]*Member, error)
	ListGroupOwners(ctx context.Context, grp *Group) ([]*Member, error)
	RemoveMemberFromGroup(ctx context.Context, grp *Group, member *Member) error
	DeleteGroup(ctx context.Context, grpID uuid.UUID) error
}

func New

func New(c *http.Client) Client

type Group

type Group struct {
	ID              string   `json:"id,omitempty"`
	Description     string   `json:"description,omitempty"`
	DisplayName     string   `json:"displayName,omitempty"`
	GroupTypes      []string `json:"groupTypes,omitempty"`
	MailEnabled     bool     `json:"mailEnabled"`
	MailNickname    string   `json:"mailNickname,omitempty"`
	SecurityEnabled bool     `json:"securityEnabled"`
}

type GroupResponse

type GroupResponse struct {
	Value []*Group
}

type Member

type Member struct {
	ID        string `json:"id,omitempty"`
	GivenName string `json:"givenNAme,omitempty"`
	Surname   string `json:"surname,omitempty"`
	Mail      string `json:"mail,omitempty"`
}

func (Member) Name

func (m Member) Name() string

func (Member) ODataID

func (m Member) ODataID() string

type MemberResponse

type MemberResponse struct {
	Value []*Member
}

type MockClient

type MockClient struct {
	mock.Mock
}

MockClient is an autogenerated mock type for the Client type

func NewMockClient

func NewMockClient(t interface {
	mock.TestingT
	Cleanup(func())
},
) *MockClient

NewMockClient creates a new instance of MockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockClient) AddMemberToGroup

func (_m *MockClient) AddMemberToGroup(ctx context.Context, grp *Group, member *Member) error

AddMemberToGroup provides a mock function with given fields: ctx, grp, member

func (*MockClient) CreateGroup

func (_m *MockClient) CreateGroup(ctx context.Context, grp *Group) (*Group, error)

CreateGroup provides a mock function with given fields: ctx, grp

func (*MockClient) DeleteGroup

func (_m *MockClient) DeleteGroup(ctx context.Context, grpID uuid.UUID) error

DeleteGroup provides a mock function with given fields: ctx, grpID

func (*MockClient) EXPECT

func (_m *MockClient) EXPECT() *MockClient_Expecter

func (*MockClient) GetGroupById

func (_m *MockClient) GetGroupById(ctx context.Context, id uuid.UUID) (*Group, error)

GetGroupById provides a mock function with given fields: ctx, id

func (*MockClient) GetOrCreateGroup

func (_m *MockClient) GetOrCreateGroup(ctx context.Context, existingGroupID *uuid.UUID, name string, description string) (*Group, bool, error)

GetOrCreateGroup provides a mock function with given fields: ctx, existingGroupID, name, description

func (*MockClient) GetUser

func (_m *MockClient) GetUser(ctx context.Context, email string) (*Member, error)

GetUser provides a mock function with given fields: ctx, email

func (*MockClient) ListGroupMembers

func (_m *MockClient) ListGroupMembers(ctx context.Context, grp *Group) ([]*Member, error)

ListGroupMembers provides a mock function with given fields: ctx, grp

func (*MockClient) ListGroupOwners

func (_m *MockClient) ListGroupOwners(ctx context.Context, grp *Group) ([]*Member, error)

ListGroupOwners provides a mock function with given fields: ctx, grp

func (*MockClient) RemoveMemberFromGroup

func (_m *MockClient) RemoveMemberFromGroup(ctx context.Context, grp *Group, member *Member) error

RemoveMemberFromGroup provides a mock function with given fields: ctx, grp, member

type MockClient_AddMemberToGroup_Call

type MockClient_AddMemberToGroup_Call struct {
	*mock.Call
}

MockClient_AddMemberToGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddMemberToGroup'

func (*MockClient_AddMemberToGroup_Call) Return

func (*MockClient_AddMemberToGroup_Call) Run

func (*MockClient_AddMemberToGroup_Call) RunAndReturn

type MockClient_CreateGroup_Call

type MockClient_CreateGroup_Call struct {
	*mock.Call
}

MockClient_CreateGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateGroup'

func (*MockClient_CreateGroup_Call) Return

func (*MockClient_CreateGroup_Call) Run

func (*MockClient_CreateGroup_Call) RunAndReturn

type MockClient_DeleteGroup_Call

type MockClient_DeleteGroup_Call struct {
	*mock.Call
}

MockClient_DeleteGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteGroup'

func (*MockClient_DeleteGroup_Call) Return

func (*MockClient_DeleteGroup_Call) Run

func (*MockClient_DeleteGroup_Call) RunAndReturn

type MockClient_Expecter

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

func (*MockClient_Expecter) AddMemberToGroup

func (_e *MockClient_Expecter) AddMemberToGroup(ctx interface{}, grp interface{}, member interface{}) *MockClient_AddMemberToGroup_Call

AddMemberToGroup is a helper method to define mock.On call

  • ctx context.Context
  • grp *Group
  • member *Member

func (*MockClient_Expecter) CreateGroup

func (_e *MockClient_Expecter) CreateGroup(ctx interface{}, grp interface{}) *MockClient_CreateGroup_Call

CreateGroup is a helper method to define mock.On call

  • ctx context.Context
  • grp *Group

func (*MockClient_Expecter) DeleteGroup

func (_e *MockClient_Expecter) DeleteGroup(ctx interface{}, grpID interface{}) *MockClient_DeleteGroup_Call

DeleteGroup is a helper method to define mock.On call

  • ctx context.Context
  • grpID uuid.UUID

func (*MockClient_Expecter) GetGroupById

func (_e *MockClient_Expecter) GetGroupById(ctx interface{}, id interface{}) *MockClient_GetGroupById_Call

GetGroupById is a helper method to define mock.On call

  • ctx context.Context
  • id uuid.UUID

func (*MockClient_Expecter) GetOrCreateGroup

func (_e *MockClient_Expecter) GetOrCreateGroup(ctx interface{}, existingGroupID interface{}, name interface{}, description interface{}) *MockClient_GetOrCreateGroup_Call

GetOrCreateGroup is a helper method to define mock.On call

  • ctx context.Context
  • existingGroupID *uuid.UUID
  • name string
  • description string

func (*MockClient_Expecter) GetUser

func (_e *MockClient_Expecter) GetUser(ctx interface{}, email interface{}) *MockClient_GetUser_Call

GetUser is a helper method to define mock.On call

  • ctx context.Context
  • email string

func (*MockClient_Expecter) ListGroupMembers

func (_e *MockClient_Expecter) ListGroupMembers(ctx interface{}, grp interface{}) *MockClient_ListGroupMembers_Call

ListGroupMembers is a helper method to define mock.On call

  • ctx context.Context
  • grp *Group

func (*MockClient_Expecter) ListGroupOwners

func (_e *MockClient_Expecter) ListGroupOwners(ctx interface{}, grp interface{}) *MockClient_ListGroupOwners_Call

ListGroupOwners is a helper method to define mock.On call

  • ctx context.Context
  • grp *Group

func (*MockClient_Expecter) RemoveMemberFromGroup

func (_e *MockClient_Expecter) RemoveMemberFromGroup(ctx interface{}, grp interface{}, member interface{}) *MockClient_RemoveMemberFromGroup_Call

RemoveMemberFromGroup is a helper method to define mock.On call

  • ctx context.Context
  • grp *Group
  • member *Member

type MockClient_GetGroupById_Call

type MockClient_GetGroupById_Call struct {
	*mock.Call
}

MockClient_GetGroupById_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGroupById'

func (*MockClient_GetGroupById_Call) Return

func (*MockClient_GetGroupById_Call) Run

func (*MockClient_GetGroupById_Call) RunAndReturn

type MockClient_GetOrCreateGroup_Call

type MockClient_GetOrCreateGroup_Call struct {
	*mock.Call
}

MockClient_GetOrCreateGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrCreateGroup'

func (*MockClient_GetOrCreateGroup_Call) Return

func (*MockClient_GetOrCreateGroup_Call) Run

func (_c *MockClient_GetOrCreateGroup_Call) Run(run func(ctx context.Context, existingGroupID *uuid.UUID, name string, description string)) *MockClient_GetOrCreateGroup_Call

func (*MockClient_GetOrCreateGroup_Call) RunAndReturn

type MockClient_GetUser_Call

type MockClient_GetUser_Call struct {
	*mock.Call
}

MockClient_GetUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUser'

func (*MockClient_GetUser_Call) Return

func (*MockClient_GetUser_Call) Run

func (_c *MockClient_GetUser_Call) Run(run func(ctx context.Context, email string)) *MockClient_GetUser_Call

func (*MockClient_GetUser_Call) RunAndReturn

type MockClient_ListGroupMembers_Call

type MockClient_ListGroupMembers_Call struct {
	*mock.Call
}

MockClient_ListGroupMembers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListGroupMembers'

func (*MockClient_ListGroupMembers_Call) Return

func (*MockClient_ListGroupMembers_Call) Run

func (*MockClient_ListGroupMembers_Call) RunAndReturn

type MockClient_ListGroupOwners_Call

type MockClient_ListGroupOwners_Call struct {
	*mock.Call
}

MockClient_ListGroupOwners_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListGroupOwners'

func (*MockClient_ListGroupOwners_Call) Return

func (*MockClient_ListGroupOwners_Call) Run

func (*MockClient_ListGroupOwners_Call) RunAndReturn

type MockClient_RemoveMemberFromGroup_Call

type MockClient_RemoveMemberFromGroup_Call struct {
	*mock.Call
}

MockClient_RemoveMemberFromGroup_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveMemberFromGroup'

func (*MockClient_RemoveMemberFromGroup_Call) Return

func (*MockClient_RemoveMemberFromGroup_Call) Run

func (*MockClient_RemoveMemberFromGroup_Call) RunAndReturn

Jump to

Keyboard shortcuts

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