All URIs are relative to https://subdomain.okta.com
Method | HTTP request | Description |
---|---|---|
ActivateGroupRule | Post /api/v1/groups/rules/{groupRuleId}/lifecycle/activate | Activate a Group Rule |
AssignGroupOwner | Post /api/v1/groups/{groupId}/owners | Assign a Group Owner |
AssignUserToGroup | Put /api/v1/groups/{groupId}/users/{userId} | Assign a User |
CreateGroup | Post /api/v1/groups | Create a Group |
CreateGroupRule | Post /api/v1/groups/rules | Create a Group Rule |
DeactivateGroupRule | Post /api/v1/groups/rules/{groupRuleId}/lifecycle/deactivate | Deactivate a Group Rule |
DeleteGroup | Delete /api/v1/groups/{groupId} | Delete a Group |
DeleteGroupOwner | Delete /api/v1/groups/{groupId}/owners/{ownerId} | Delete a Group Owner |
DeleteGroupRule | Delete /api/v1/groups/rules/{groupRuleId} | Delete a group Rule |
GetGroup | Get /api/v1/groups/{groupId} | Retrieve a Group |
GetGroupRule | Get /api/v1/groups/rules/{groupRuleId} | Retrieve a Group Rule |
ListAssignedApplicationsForGroup | Get /api/v1/groups/{groupId}/apps | List all Assigned Applications |
ListGroupOwners | Get /api/v1/groups/{groupId}/owners | List all Group Owners |
ListGroupRules | Get /api/v1/groups/rules | List all Group Rules |
ListGroupUsers | Get /api/v1/groups/{groupId}/users | List all Member Users |
ListGroups | Get /api/v1/groups | List all Groups |
ReplaceGroup | Put /api/v1/groups/{groupId} | Replace a Group |
ReplaceGroupRule | Put /api/v1/groups/rules/{groupRuleId} | Replace a Group Rule |
UnassignUserFromGroup | Delete /api/v1/groups/{groupId}/users/{userId} | Unassign a User |
ActivateGroupRule(ctx, groupRuleId).Execute()
Activate a Group Rule
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupRuleId := "0pr3f7zMZZHPgUoWO0g4" // string | The `id` of the group rule
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.GroupAPI.ActivateGroupRule(context.Background(), groupRuleId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.ActivateGroupRule``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupRuleId | string | The `id` of the group rule |
Other parameters are passed through a pointer to a apiActivateGroupRuleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GroupOwner AssignGroupOwner(ctx, groupId).AssignGroupOwnerRequestBody(assignGroupOwnerRequestBody).Execute()
Assign a Group Owner
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupId := "00g1emaKYZTWRYYRRTSK" // string | The `id` of the group
assignGroupOwnerRequestBody := *openapiclient.NewAssignGroupOwnerRequestBody() // AssignGroupOwnerRequestBody |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.GroupAPI.AssignGroupOwner(context.Background(), groupId).AssignGroupOwnerRequestBody(assignGroupOwnerRequestBody).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.AssignGroupOwner``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AssignGroupOwner`: GroupOwner
fmt.Fprintf(os.Stdout, "Response from `GroupAPI.AssignGroupOwner`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | The `id` of the group |
Other parameters are passed through a pointer to a apiAssignGroupOwnerRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
assignGroupOwnerRequestBody | AssignGroupOwnerRequestBody | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AssignUserToGroup(ctx, groupId, userId).Execute()
Assign a User
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupId := "00g1emaKYZTWRYYRRTSK" // string | The `id` of the group
userId := "userId_example" // string | ID of an existing Okta user
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.GroupAPI.AssignUserToGroup(context.Background(), groupId, userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.AssignUserToGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | The `id` of the group | |
userId | string | ID of an existing Okta user |
Other parameters are passed through a pointer to a apiAssignUserToGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Group CreateGroup(ctx).Group(group).Execute()
Create a Group
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
group := *openapiclient.NewGroup() // Group |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.GroupAPI.CreateGroup(context.Background()).Group(group).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.CreateGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateGroup`: Group
fmt.Fprintf(os.Stdout, "Response from `GroupAPI.CreateGroup`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
group | Group |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GroupRule CreateGroupRule(ctx).GroupRule(groupRule).Execute()
Create a Group Rule
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupRule := *openapiclient.NewGroupRule() // GroupRule |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.GroupAPI.CreateGroupRule(context.Background()).GroupRule(groupRule).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.CreateGroupRule``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateGroupRule`: GroupRule
fmt.Fprintf(os.Stdout, "Response from `GroupAPI.CreateGroupRule`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiCreateGroupRuleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
groupRule | GroupRule |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeactivateGroupRule(ctx, groupRuleId).Execute()
Deactivate a Group Rule
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupRuleId := "0pr3f7zMZZHPgUoWO0g4" // string | The `id` of the group rule
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.GroupAPI.DeactivateGroupRule(context.Background(), groupRuleId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.DeactivateGroupRule``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupRuleId | string | The `id` of the group rule |
Other parameters are passed through a pointer to a apiDeactivateGroupRuleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteGroup(ctx, groupId).Execute()
Delete a Group
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupId := "00g1emaKYZTWRYYRRTSK" // string | The `id` of the group
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.GroupAPI.DeleteGroup(context.Background(), groupId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.DeleteGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | The `id` of the group |
Other parameters are passed through a pointer to a apiDeleteGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteGroupOwner(ctx, groupId, ownerId).Execute()
Delete a Group Owner
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupId := "00g1emaKYZTWRYYRRTSK" // string | The `id` of the group
ownerId := "00u1emaK22TWRYd3TtG" // string | The `id` of the group owner
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.GroupAPI.DeleteGroupOwner(context.Background(), groupId, ownerId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.DeleteGroupOwner``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | The `id` of the group | |
ownerId | string | The `id` of the group owner |
Other parameters are passed through a pointer to a apiDeleteGroupOwnerRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteGroupRule(ctx, groupRuleId).RemoveUsers(removeUsers).Execute()
Delete a group Rule
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupRuleId := "0pr3f7zMZZHPgUoWO0g4" // string | The `id` of the group rule
removeUsers := true // bool | Indicates whether to keep or remove users from groups assigned by this rule. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.GroupAPI.DeleteGroupRule(context.Background(), groupRuleId).RemoveUsers(removeUsers).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.DeleteGroupRule``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupRuleId | string | The `id` of the group rule |
Other parameters are passed through a pointer to a apiDeleteGroupRuleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
removeUsers | bool | Indicates whether to keep or remove users from groups assigned by this rule. |
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Group GetGroup(ctx, groupId).Execute()
Retrieve a Group
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupId := "00g1emaKYZTWRYYRRTSK" // string | The `id` of the group
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.GroupAPI.GetGroup(context.Background(), groupId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.GetGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetGroup`: Group
fmt.Fprintf(os.Stdout, "Response from `GroupAPI.GetGroup`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | The `id` of the group |
Other parameters are passed through a pointer to a apiGetGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GroupRule GetGroupRule(ctx, groupRuleId).Expand(expand).Execute()
Retrieve a Group Rule
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupRuleId := "0pr3f7zMZZHPgUoWO0g4" // string | The `id` of the group rule
expand := "expand_example" // string | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.GroupAPI.GetGroupRule(context.Background(), groupRuleId).Expand(expand).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.GetGroupRule``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetGroupRule`: GroupRule
fmt.Fprintf(os.Stdout, "Response from `GroupAPI.GetGroupRule`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupRuleId | string | The `id` of the group rule |
Other parameters are passed through a pointer to a apiGetGroupRuleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
expand | string | |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]ListApplications200ResponseInner ListAssignedApplicationsForGroup(ctx, groupId).After(after).Limit(limit).Execute()
List all Assigned Applications
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupId := "00g1emaKYZTWRYYRRTSK" // string | The `id` of the group
after := "after_example" // string | Specifies the pagination cursor for the next page of apps (optional)
limit := int32(56) // int32 | Specifies the number of app results for a page (optional) (default to 20)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.GroupAPI.ListAssignedApplicationsForGroup(context.Background(), groupId).After(after).Limit(limit).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.ListAssignedApplicationsForGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListAssignedApplicationsForGroup`: []ListApplications200ResponseInner
fmt.Fprintf(os.Stdout, "Response from `GroupAPI.ListAssignedApplicationsForGroup`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | The `id` of the group |
Other parameters are passed through a pointer to a apiListAssignedApplicationsForGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
after | string | Specifies the pagination cursor for the next page of apps | limit | int32 | Specifies the number of app results for a page | [default to 20]
[]ListApplications200ResponseInner
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]GroupOwner ListGroupOwners(ctx, groupId).Filter(filter).After(after).Limit(limit).Execute()
List all Group Owners
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupId := "00g1emaKYZTWRYYRRTSK" // string | The `id` of the group
filter := "filter_example" // string | SCIM Filter expression for group owners. Allows to filter owners by type. (optional)
after := "after_example" // string | Specifies the pagination cursor for the next page of owners (optional)
limit := int32(56) // int32 | Specifies the number of owner results in a page (optional) (default to 1000)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.GroupAPI.ListGroupOwners(context.Background(), groupId).Filter(filter).After(after).Limit(limit).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.ListGroupOwners``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListGroupOwners`: []GroupOwner
fmt.Fprintf(os.Stdout, "Response from `GroupAPI.ListGroupOwners`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | The `id` of the group |
Other parameters are passed through a pointer to a apiListGroupOwnersRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
filter | string | SCIM Filter expression for group owners. Allows to filter owners by type. | after | string | Specifies the pagination cursor for the next page of owners | limit | int32 | Specifies the number of owner results in a page | [default to 1000]
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]GroupRule ListGroupRules(ctx).Limit(limit).After(after).Search(search).Expand(expand).Execute()
List all Group Rules
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
limit := int32(56) // int32 | Specifies the number of rule results in a page (optional) (default to 50)
after := "after_example" // string | Specifies the pagination cursor for the next page of rules (optional)
search := "search_example" // string | Specifies the keyword to search fules for (optional)
expand := "expand_example" // string | If specified as `groupIdToGroupNameMap`, then show group names (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.GroupAPI.ListGroupRules(context.Background()).Limit(limit).After(after).Search(search).Expand(expand).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.ListGroupRules``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListGroupRules`: []GroupRule
fmt.Fprintf(os.Stdout, "Response from `GroupAPI.ListGroupRules`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiListGroupRulesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
limit | int32 | Specifies the number of rule results in a page | [default to 50] |
after | string | Specifies the pagination cursor for the next page of rules | |
search | string | Specifies the keyword to search fules for | |
expand | string | If specified as `groupIdToGroupNameMap`, then show group names |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]User ListGroupUsers(ctx, groupId).After(after).Limit(limit).Execute()
List all Member Users
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupId := "00g1emaKYZTWRYYRRTSK" // string | The `id` of the group
after := "after_example" // string | Specifies the pagination cursor for the next page of users (optional)
limit := int32(56) // int32 | Specifies the number of user results in a page (optional) (default to 1000)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.GroupAPI.ListGroupUsers(context.Background(), groupId).After(after).Limit(limit).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.ListGroupUsers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListGroupUsers`: []User
fmt.Fprintf(os.Stdout, "Response from `GroupAPI.ListGroupUsers`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | The `id` of the group |
Other parameters are passed through a pointer to a apiListGroupUsersRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
after | string | Specifies the pagination cursor for the next page of users | limit | int32 | Specifies the number of user results in a page | [default to 1000]
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
[]Group ListGroups(ctx).Q(q).Filter(filter).After(after).Limit(limit).Expand(expand).Search(search).SortBy(sortBy).SortOrder(sortOrder).Execute()
List all Groups
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
q := "q_example" // string | Searches the name property of groups for matching value (optional)
filter := "filter_example" // string | Filter expression for groups (optional)
after := "after_example" // string | Specifies the pagination cursor for the next page of groups (optional)
limit := int32(56) // int32 | Specifies the number of group results in a page (optional) (default to 10000)
expand := "expand_example" // string | If specified, it causes additional metadata to be included in the response. (optional)
search := "search_example" // string | Searches for groups with a supported filtering expression for all attributes except for _embedded, _links, and objectClass (optional)
sortBy := "lastUpdated" // string | Specifies field to sort by and can be any single property (for search queries only). (optional)
sortOrder := "sortOrder_example" // string | Specifies sort order `asc` or `desc` (for search queries only). This parameter is ignored if `sortBy` is not present. Groups with the same value for the `sortBy` parameter are ordered by `id`. (optional) (default to "asc")
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.GroupAPI.ListGroups(context.Background()).Q(q).Filter(filter).After(after).Limit(limit).Expand(expand).Search(search).SortBy(sortBy).SortOrder(sortOrder).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.ListGroups``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListGroups`: []Group
fmt.Fprintf(os.Stdout, "Response from `GroupAPI.ListGroups`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiListGroupsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
q | string | Searches the name property of groups for matching value | |
filter | string | Filter expression for groups | |
after | string | Specifies the pagination cursor for the next page of groups | |
limit | int32 | Specifies the number of group results in a page | [default to 10000] |
expand | string | If specified, it causes additional metadata to be included in the response. | |
search | string | Searches for groups with a supported filtering expression for all attributes except for _embedded, _links, and objectClass | |
sortBy | string | Specifies field to sort by and can be any single property (for search queries only). | |
sortOrder | string | Specifies sort order `asc` or `desc` (for search queries only). This parameter is ignored if `sortBy` is not present. Groups with the same value for the `sortBy` parameter are ordered by `id`. | [default to "asc"] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Group ReplaceGroup(ctx, groupId).Group(group).Execute()
Replace a Group
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupId := "00g1emaKYZTWRYYRRTSK" // string | The `id` of the group
group := *openapiclient.NewGroup() // Group |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.GroupAPI.ReplaceGroup(context.Background(), groupId).Group(group).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.ReplaceGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ReplaceGroup`: Group
fmt.Fprintf(os.Stdout, "Response from `GroupAPI.ReplaceGroup`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | The `id` of the group |
Other parameters are passed through a pointer to a apiReplaceGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
group | Group | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GroupRule ReplaceGroupRule(ctx, groupRuleId).GroupRule(groupRule).Execute()
Replace a Group Rule
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupRuleId := "0pr3f7zMZZHPgUoWO0g4" // string | The `id` of the group rule
groupRule := *openapiclient.NewGroupRule() // GroupRule |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.GroupAPI.ReplaceGroupRule(context.Background(), groupRuleId).GroupRule(groupRule).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.ReplaceGroupRule``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ReplaceGroupRule`: GroupRule
fmt.Fprintf(os.Stdout, "Response from `GroupAPI.ReplaceGroupRule`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupRuleId | string | The `id` of the group rule |
Other parameters are passed through a pointer to a apiReplaceGroupRuleRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
groupRule | GroupRule | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UnassignUserFromGroup(ctx, groupId, userId).Execute()
Unassign a User
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
groupId := "00g1emaKYZTWRYYRRTSK" // string | The `id` of the group
userId := "userId_example" // string | ID of an existing Okta user
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.GroupAPI.UnassignUserFromGroup(context.Background(), groupId, userId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `GroupAPI.UnassignUserFromGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
groupId | string | The `id` of the group | |
userId | string | ID of an existing Okta user |
Other parameters are passed through a pointer to a apiUnassignUserFromGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]