generation

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

It also provides some helper functions for the struct to make it easier to work with.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ListAccountsForParentPaginator

type ListAccountsForParentPaginator interface {
	HasMorePages() bool
	NextPage(ctx context.Context,
		optFns ...func(*organizations.Options),
	) (
		*organizations.ListAccountsForParentOutput,
		error,
	)
}

--- ListAccountsForParentPaginator ------------------------------------------ ListAccountsForParentPaginator is an interface for the organizations ListAccountsForParentPaginator function in the AWS SDK that allows for mocking, this is a paginator function so it has a HasMorePages and NextPage function.

type ListOrganizationalUnitsForParent

type ListOrganizationalUnitsForParent interface {
	ListOrganizationalUnitsForParent(
		ctx context.Context,
		params *organizations.ListOrganizationalUnitsForParentInput,
		optFns ...func(*organizations.Options),
	) (
		*organizations.ListOrganizationalUnitsForParentOutput,
		error,
	)
}

--- ListOrganizationalUnitsForParent ---------------------------------------- ListOrganizationalUnitsForParent is an interface for the organizations ListOrganizationalUnitsForParent function in the AWS SDK that allows for mocking.

type ListOrganizationalUnitsForParentMock

type ListOrganizationalUnitsForParentMock struct {
	ListOrganizationalUnitsForParentFunc func(
		ctx context.Context,
		params *organizations.ListOrganizationalUnitsForParentInput,
		optFns ...func(*organizations.Options),
	) (
		*organizations.ListOrganizationalUnitsForParentOutput,
		error,
	)
}

func (*ListOrganizationalUnitsForParentMock) ListOrganizationalUnitsForParent

type ListRoots

type ListRoots interface {
	ListRoots(
		ctx context.Context,
		params *organizations.ListRootsInput,
		optFns ...func(*organizations.Options),
	) (
		*organizations.ListRootsOutput,
		error,
	)
}

--- ListRoots --------------------------------------------------------------- ListRoots is an interface for the ListRoots function from the organizations service in the AWS SDK that allows for mocking.

type ListRootsMock

type ListRootsMock struct {
	ListRootsFunc func(
		ctx context.Context,
		params *organizations.ListRootsInput,
		optFns ...func(*organizations.Options),
	) (
		*organizations.ListRootsOutput,
		error,
	)
}

func (*ListRootsMock) ListRoots

func (m *ListRootsMock) ListRoots(
	ctx context.Context,
	params *organizations.ListRootsInput,
	optFns ...func(*organizations.Options),
) (
	*organizations.ListRootsOutput,
	error,
)

type OU

type OU struct {
	Id       string          `json:"id"`
	Name     string          `json:"name"`
	Children []*OU           `json:"children"`
	Accounts []types.Account `json:"accounts"`
}

--- OU ---------------------------------------------------------------------- OU is a struct that represents an OU in the AWS Organizations structure. It can be used to represent the entire structure or a substructure in the style of a tree.

func GenerateStructure

func GenerateStructure(ctx context.Context, orgClient *organizations.Client) (*OU, error)

GenerateStructure takes in an Organizations Client and returns a custom tree structure that contains all the information about the organization.

func (*OU) GetAccounts

func (o *OU) GetAccounts() []types.Account

GetAccounts returns a list of the accounts in the OU.

func (*OU) GetChildren

func (o *OU) GetChildren() []*OU

GetChildren returns the OU's child OUs.

func (*OU) GetId

func (o *OU) GetId() string

GetId returns the OU's ID.

func (*OU) GetName

func (o *OU) GetName() string

GetName returns the OU's name.

func (*OU) RemoveSuspendedAccounts added in v0.1.2

func (parent *OU) RemoveSuspendedAccounts() *OU

removeSuspendedAccounts removes all suspended accounts from the OU tree.

func (*OU) ToJSON added in v0.0.10

func (o *OU) ToJSON() ([]byte, error)

ToJSON returns a JSON representation of the OU.

Jump to

Keyboard shortcuts

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