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) 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
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 ¶
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