diff --git a/applications.go b/applications.go index 8d825bc..b3a9b12 100644 --- a/applications.go +++ b/applications.go @@ -9,9 +9,6 @@ import ( ) // GetAllApplications returns all applications -// -// Example: -// allApps, err := c.GetAllApplications() func (c *Client) GetAllApplications() (allApplications AllApps, err error) { // Prepare request totalApps := 0 @@ -66,9 +63,6 @@ func (c *Client) GetAllApplications() (allApplications AllApps, err error) { } // GetApplication returns a single application -// -// Example: -// app, err := c.GetApplication("5f5e3e3e4f7d3d7e3e3e3e3e") func (c *Client) GetApplication(appId string) (application App, err error) { // Prepare request c.HostURL.Path = "/api/v2/applications/" + appId @@ -86,9 +80,6 @@ func (c *Client) GetApplication(appId string) (application App, err error) { // GetAppAssociations returns a single application // groupType can be either "user_group" or "user" -// -// Example: -// appAssociations, err := c.GetAppAssociations("5f5e3e3e4f7d3d7e3e3e3e3e", "user_group") func (c *Client) GetAppAssociations(appId string, groupType string) (appAssociations AppAssociations, err error) { // Prepare request totalAssociations := 0 @@ -127,9 +118,6 @@ func (c *Client) GetAppAssociations(appId string, groupType string) (appAssociat } // AssociateGroupWithApp associates a group with an application -// -// Example: -// err := c.AssociateGroupWithApp(appId: "5f5e3e3e4f7d3d7e3e3e3e3e", groupId: "5f5e3e3e4f7d3d7e3e3e3e3e") func (c *Client) AssociateGroupWithApp(appId string, groupId string) (err error) { // Prepare request c.HostURL.Path = "/api/v2/applications/" + appId + "/associations" @@ -152,9 +140,6 @@ func (c *Client) AssociateGroupWithApp(appId string, groupId string) (err error) } // RemoveGroupFromApp removes a group from an application -// -// Example: -// err := c.RemoveGroupFromApp(appId: "5f5e3e3e4f7d3d7e3e3e3e3e", groupId: "5f5e3e3e4f7d3d7e3e3e3e3e") func (c *Client) RemoveGroupFromApp(appId string, groupId string) (err error) { // Prepare request c.HostURL.Path = "/api/v2/applications/" + appId + "/associations" diff --git a/client.go b/client.go index 0a65b20..f716556 100644 --- a/client.go +++ b/client.go @@ -4,7 +4,7 @@ // c, err := jumpcloud.NewClient(os.Getenv("JC_API_KEY")) // // # Use the Client -// groups, _ := c.GetAllUserGroups() +// groups, err := c.GetAllUserGroups() // package jumpcloud @@ -26,9 +26,7 @@ type Client struct { } // NewClient factory returns a prepared client -// -// Example: -// c, err := jumpcloud.NewClient(os.Getenv("JC_API_KEY")) +// token is the JumpCloud API key func NewClient(token string) (*Client, error) { parsedUrl, err := url.Parse(HostURL) c := Client{ diff --git a/usergroups.go b/usergroups.go index 38eceed..b8a639c 100644 --- a/usergroups.go +++ b/usergroups.go @@ -9,9 +9,6 @@ import ( ) // GetAllUserGroups returns a list of all usergroups in Jumpcloud -// -// Example: -// allUserGroups, err := c.GetAllUserGroups() func (c *Client) GetAllUserGroups() (allUserGroups UserGroups, err error) { // Prepare request c.HostURL.Path = "/api/v2/usergroups" @@ -62,9 +59,6 @@ func (c *Client) GetAllUserGroups() (allUserGroups UserGroups, err error) { } // CreateUserGroup creates a new user group -// -// Example: -// newGroup, err := c.CreateUserGroup(UserGroup{Name: "New Group"}) func (c *Client) CreateUserGroup(newUser UserGroup) (userGroup UserGroup, err error) { // Prepare request c.HostURL.Path = "/api/v2/usergroups" @@ -87,9 +81,6 @@ func (c *Client) CreateUserGroup(newUser UserGroup) (userGroup UserGroup, err er } // CreateUserGroups creates multiple user groups -// -// Example: -// newGroups, err := c.CreateUserGroups([]UserGroup{{Name: "New Group 1"}, {Name: "New Group 2"}}) func (c *Client) CreateUserGroups(newUserGroups []UserGroup) (userGroups []UserGroup, err error) { // Iterate through the user groups and create them for _, usergroup := range newUserGroups { @@ -104,9 +95,6 @@ func (c *Client) CreateUserGroups(newUserGroups []UserGroup) (userGroups []UserG } // GetUserGroup query for a specific user group by ID -// -// Example: -// userGroup, err := c.GetUserGroup("5f5e3e3e4f7d3d7e3e3e3e3e") func (c *Client) GetUserGroup(groupId string) (userGroup UserGroup, err error) { // Prepare request c.HostURL.Path = "/api/v2/usergroups/" + groupId @@ -128,9 +116,6 @@ func (c *Client) GetUserGroup(groupId string) (userGroup UserGroup, err error) { } // DeleteUserGroup deletes a user group -// -// Example: -// err := c.DeleteUserGroup("5f5e3e3e4f7d3d7e3e3e3e3e") func (c *Client) DeleteUserGroup(groupId string) (err error) { // Prepare request c.HostURL.Path = "/api/v2/usergroups/" + groupId @@ -149,9 +134,6 @@ func (c *Client) DeleteUserGroup(groupId string) (err error) { } // GetGroupMembers returns a list of users in a group -// -// Example: -// groupMembers, err := c.GetGroupMembers("5f5e3e3e4f7d3d7e3e3e3e3e") func (c *Client) GetGroupMembers(groupId string) (groupMembers GroupMembership, err error) { // Prepare request c.HostURL.Path = "/api/v2/usergroups/" + groupId + "/members" @@ -201,9 +183,6 @@ func (c *Client) GetGroupMembers(groupId string) (groupMembers GroupMembership, } // GetUserGroupByName returns a group by name -// -// Example: -// userGroup, err := c.GetUserGroupByName("New Group") func (c *Client) GetUserGroupByName(groupName string) (userGroup UserGroup, err error) { // Prepare request var results UserGroups @@ -232,9 +211,6 @@ func (c *Client) GetUserGroupByName(groupName string) (userGroup UserGroup, err } // UpdateUserGroup updates a user group -// -// Example: -// updatedGroup, err := c.UpdateUserGroup("5f5e3e3e4f7d3d7e3e3e3e3e", UserGroup{Name: "Updated Group"}) func (c *Client) UpdateUserGroup(groupId string, updatedUserGroup UserGroup) (userGroup UserGroup, err error) { // If update does not contain a description field, set it to the old description // We do this because the API will overwrite the description field with an empty string if not passed diff --git a/users.go b/users.go index 4aec1a8..5f4b861 100644 --- a/users.go +++ b/users.go @@ -7,9 +7,6 @@ import ( ) // GetUser returns the details of a user by ID -// -// Example: -// user, err := c.GetUser("5f5e3e3e") func (c *Client) GetUser(userId string) (user SystemUser, err error) { // Prepare request c.HostURL.Path = "/api/systemusers/" + userId