roles

package
v1.1.20 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Role

type Role struct {
	ID     *int32  `json:"id,omitempty"`
	Name   *string `json:"name,omitempty"`
	Admins []int32 `json:"admins,omitempty"`
	Apps   []int32 `json:"apps,omitempty"`
	Users  []int32 `json:"users,omitempty"`
}

Role represents the Role resource in OneLogin

type RoleQuery

type RoleQuery struct {
	Limit  string
	Page   string
	Cursor string
}

RoleQuery represents available query parameters

type V1Service

type V1Service struct {
	Endpoint, ErrorContext string
	Repository             services.Repository
}

V1Service holds the information needed to interface with a repository

func New

func New(repo services.Repository, host string) *V1Service

New creates the new svc service v1.

func (*V1Service) Create

func (svc *V1Service) Create(role *Role) error

Create takes a role without an id and attempts to use the parameters to create it in the API. Modifies the role in place, or returns an error if one occurs

func (*V1Service) Destroy

func (svc *V1Service) Destroy(id int32) error

Destroy deletes the role with the given id, and if successful, it returns nil

func (*V1Service) GetOne

func (svc *V1Service) GetOne(id int32) (*Role, error)

GetOne retrieves the role by id and returns it

func (*V1Service) Query

func (svc *V1Service) Query(query *RoleQuery) ([]Role, error)

Query retrieves all the roles from the repository that meet the query criteria passed in the request payload. If an empty payload is given, it will retrieve all roles

func (*V1Service) Update

func (svc *V1Service) Update(role *Role) error

Update takes a role and an id and attempts to use the parameters to update it in the API. Modifies the role in place, or returns an error if one occurs

func (*V1Service) UpdateRaw added in v1.1.20

func (svc *V1Service) UpdateRaw(id int32, role interface{}) ([]byte, error)

UpdateRaw takes a role and an id and attempts to use the parameters to update it in the API. Returned the raw response bytes, or returns an error if one occurs

Jump to

Keyboard shortcuts

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