organization

package
v0.0.0-...-b77c216 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client provides an API client for organization service

func NewClient

func NewClient(client *rest.HTTPClient) (*Client, error)

NewClient creates a new Client and returns a tuple of a pointer to it along with an error indicating if anything went wrong. The baseURL parameter should be the target API and sessionID a valid session for the target user.

func (*Client) AddUser

func (c *Client) AddUser(userID, organizationID string) error

AddUser adds the user to the organization

func (*Client) Create

func (c *Client) Create(name string) (Organization, error)

Create a new organization with the given name

func (*Client) GetAll

func (c *Client) GetAll() ([]Organization, error)

GetAll returns all organizations

func (*Client) Remove

func (c *Client) Remove(organizationID string) error

Remove an organization

type CreateRequest

type CreateRequest struct {
	Name string `json:"name"`
}

CreateRequest is used when creating a new organization

type CreateResponse

type CreateResponse struct {
	Name           string `json:"name"`
	OrganizationID string `json:"organizationId"`
}

CreateResponse is returned when a new organization was created

type Organization

type Organization struct {
	ID    string
	Name  string
	Owner string
}

Organization describes the basic information of an organization

func (Organization) String

func (o Organization) String() string

type Response

type Response struct {
	ID      string `json:"organizationId"`
	Name    string `json:"name"`
	OwnerID string `json:"ownerId"`
}

Response represents the response model of an organization

type UserRequest

type UserRequest struct {
	UserID string `json:"userId"`
}

UserRequest is used when adding a user to an organization

Jump to

Keyboard shortcuts

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