permissions

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPermissionNotFound = fmt.Errorf("permission not found")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	client.Client
}

func New

func New(client client.Client) *Client

func (*Client) Create

func (c *Client) Create(ctx context.Context, params CreateParams) (*Permission, error)

https://kinde.com/api/docs/#create-permission

note: only ID will be populated

func (*Client) Search

func (c *Client) Search(ctx context.Context, params SearchParams) (*Permission, error)

type CreateParams

type CreateParams struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Key         string `json:"key"`
}

type CreateResponse

type CreateResponse struct {
	Code       string     `json:"code"`
	Message    string     `json:"message"`
	Permission Permission `json:"permission"`
}

type ListParams

type ListParams struct {
	Sort      ListSortMethod
	PageSize  int
	NextToken string
}

type ListResponse

type ListResponse struct {
	Code        string       `json:"code"`
	Message     string       `json:"message"`
	NextToken   string       `json:"next_token"`
	Permissions []Permission `json:"permissions"`
}

func (ListResponse) GetData

func (r ListResponse) GetData() []Permission

func (ListResponse) GetNextToken

func (r ListResponse) GetNextToken() string

type ListSortMethod

type ListSortMethod string
const (
	ListSortNameAsc  ListSortMethod = "name_asc"
	ListSortNameDesc ListSortMethod = "name_desc"
	ListSortIDAsc    ListSortMethod = "id_asc"
	ListSortIDDesc   ListSortMethod = "id_desc"
)

func (ListSortMethod) Options

func (t ListSortMethod) Options() []ListSortMethod

func (ListSortMethod) Valid

func (t ListSortMethod) Valid() error

type Permission

type Permission struct {
	ID          string `json:"id"`
	Key         string `json:"key"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

https://kinde.com/api/docs/#kinde-management-api-roles

type SearchParams

type SearchParams struct {
	Name string
	Key  string
}

type UpdateParams

type UpdateParams struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Key         string `json:"key"`
}

Jump to

Keyboard shortcuts

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