All URIs are relative to https://api.segmentapis.com
Method | HTTP request | Description |
---|---|---|
AddPermissionsToUserGroup | Post /groups/{userGroupId}/permissions | Add Permissions to User Group |
AddUsersToUserGroup | Post /groups/{userGroupId}/users | Add Users to User Group |
CreateUserGroup | Post /groups | Create User Group |
DeleteUserGroup | Delete /groups/{userGroupId} | Delete User Group |
GetUserGroup | Get /groups/{userGroupId} | Get User Group |
ListInvitesFromUserGroup | Get /groups/{userGroupId}/invites | List Invites from User Group |
ListUserGroups | Get /groups | List User Groups |
ListUsersFromUserGroup | Get /groups/{userGroupId}/users | List Users from User Group |
RemoveUsersFromUserGroup | Delete /group/{userGroupId}/users | Remove Users from User Group |
ReplacePermissionsForUserGroup | Put /groups/{userGroupId}/permissions | Replace Permissions for User Group |
ReplaceUsersInUserGroup | Put /group/{userGroupId}/users | Replace Users in User Group |
UpdateUserGroup | Patch /groups/{userGroupId} | Update User Group |
AddPermissionsToUserGroup200Response AddPermissionsToUserGroup(ctx, userGroupId).AddPermissionsToUserGroupV1Input(addPermissionsToUserGroupV1Input).Execute()
Add Permissions to User Group
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
userGroupId := "bBABwqbaDf2QdwTbW8bNEm" // string |
addPermissionsToUserGroupV1Input := *api.NewAddPermissionsToUserGroupV1Input([]api.PermissionInputV1{*api.NewPermissionInputV1("RoleId_example", []api.PermissionResourceV1{*api.NewPermissionResourceV1("Id_example", "Type_example")})}) // AddPermissionsToUserGroupV1Input |
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.IAMGroupsAPI.AddPermissionsToUserGroup(ctx, userGroupId).AddPermissionsToUserGroupV1Input(addPermissionsToUserGroupV1Input).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IAMGroupsAPI.AddPermissionsToUserGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `AddPermissionsToUserGroup`: AddPermissionsToUserGroup200Response
fmt.Fprintf(os.Stdout, "Response from `IAMGroupsAPI.AddPermissionsToUserGroup`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userGroupId | string |
Other parameters are passed through a pointer to a apiAddPermissionsToUserGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
addPermissionsToUserGroupV1Input | AddPermissionsToUserGroupV1Input | |
AddPermissionsToUserGroup200Response
- Content-Type: application/json, application/vnd.segment.v1+json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AddUsersToUserGroup200Response AddUsersToUserGroup(ctx, userGroupId).AddUsersToUserGroupV1Input(addUsersToUserGroupV1Input).Execute()
Add Users to User Group
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
userGroupId := "bBABwqbaDf2QdwTbW8bNEm" // string |
addUsersToUserGroupV1Input := *api.NewAddUsersToUserGroupV1Input([]string{"Emails_example"}) // AddUsersToUserGroupV1Input |
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.IAMGroupsAPI.AddUsersToUserGroup(ctx, userGroupId).AddUsersToUserGroupV1Input(addUsersToUserGroupV1Input).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IAMGroupsAPI.AddUsersToUserGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `AddUsersToUserGroup`: AddUsersToUserGroup200Response
fmt.Fprintf(os.Stdout, "Response from `IAMGroupsAPI.AddUsersToUserGroup`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userGroupId | string |
Other parameters are passed through a pointer to a apiAddUsersToUserGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
addUsersToUserGroupV1Input | AddUsersToUserGroupV1Input | |
AddUsersToUserGroup200Response
- Content-Type: application/json, application/vnd.segment.v1+json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
CreateUserGroup200Response CreateUserGroup(ctx).CreateUserGroupV1Input(createUserGroupV1Input).Execute()
Create User Group
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
createUserGroupV1Input := *api.NewCreateUserGroupV1Input("Name_example") // CreateUserGroupV1Input |
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.IAMGroupsAPI.CreateUserGroup(ctx).CreateUserGroupV1Input(createUserGroupV1Input).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IAMGroupsAPI.CreateUserGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `CreateUserGroup`: CreateUserGroup200Response
fmt.Fprintf(os.Stdout, "Response from `IAMGroupsAPI.CreateUserGroup`: %v\n", resp.GetData())
}
Other parameters are passed through a pointer to a apiCreateUserGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
createUserGroupV1Input | CreateUserGroupV1Input |
- Content-Type: application/json, application/vnd.segment.v1+json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteUserGroup200Response DeleteUserGroup(ctx, userGroupId).Execute()
Delete User Group
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
userGroupId := "2c0vZc1kXJ9Nf9wIJ1Gb7JzORGf" // string |
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.IAMGroupsAPI.DeleteUserGroup(ctx, userGroupId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IAMGroupsAPI.DeleteUserGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `DeleteUserGroup`: DeleteUserGroup200Response
fmt.Fprintf(os.Stdout, "Response from `IAMGroupsAPI.DeleteUserGroup`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userGroupId | string |
Other parameters are passed through a pointer to a apiDeleteUserGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GetUserGroup200Response GetUserGroup(ctx, userGroupId).Execute()
Get User Group
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
userGroupId := "bBABwqbaDf2QdwTbW8bNEm" // string |
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.IAMGroupsAPI.GetUserGroup(ctx, userGroupId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IAMGroupsAPI.GetUserGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `GetUserGroup`: GetUserGroup200Response
fmt.Fprintf(os.Stdout, "Response from `IAMGroupsAPI.GetUserGroup`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userGroupId | string |
Other parameters are passed through a pointer to a apiGetUserGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListInvitesFromUserGroup200Response ListInvitesFromUserGroup(ctx, userGroupId).Pagination(pagination).Execute()
List Invites from User Group
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
userGroupId := "bBABwqbaDf2QdwTbW8bNEm" // string |
pagination := *api.NewPaginationInput(10) // PaginationInput | Pagination for invites to the group. This parameter exists in v1. (optional)
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.IAMGroupsAPI.ListInvitesFromUserGroup(ctx, userGroupId).Pagination(pagination).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IAMGroupsAPI.ListInvitesFromUserGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `ListInvitesFromUserGroup`: ListInvitesFromUserGroup200Response
fmt.Fprintf(os.Stdout, "Response from `IAMGroupsAPI.ListInvitesFromUserGroup`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userGroupId | string |
Other parameters are passed through a pointer to a apiListInvitesFromUserGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
pagination | PaginationInput | Pagination for invites to the group. This parameter exists in v1. |
ListInvitesFromUserGroup200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListUserGroups200Response ListUserGroups(ctx).Pagination(pagination).Execute()
List User Groups
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
pagination := *api.NewPaginationInput(10) // PaginationInput | Pagination for user groups. This parameter exists in v1. (optional)
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.IAMGroupsAPI.ListUserGroups(ctx).Pagination(pagination).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IAMGroupsAPI.ListUserGroups``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `ListUserGroups`: ListUserGroups200Response
fmt.Fprintf(os.Stdout, "Response from `IAMGroupsAPI.ListUserGroups`: %v\n", resp.GetData())
}
Other parameters are passed through a pointer to a apiListUserGroupsRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
pagination | PaginationInput | Pagination for user groups. This parameter exists in v1. |
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ListUsersFromUserGroup200Response ListUsersFromUserGroup(ctx, userGroupId).Pagination(pagination).Execute()
List Users from User Group
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
userGroupId := "bBABwqbaDf2QdwTbW8bNEm" // string |
pagination := *api.NewPaginationInput(10) // PaginationInput | Pagination for members of a group. This parameter exists in v1. (optional)
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.IAMGroupsAPI.ListUsersFromUserGroup(ctx, userGroupId).Pagination(pagination).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IAMGroupsAPI.ListUsersFromUserGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `ListUsersFromUserGroup`: ListUsersFromUserGroup200Response
fmt.Fprintf(os.Stdout, "Response from `IAMGroupsAPI.ListUsersFromUserGroup`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userGroupId | string |
Other parameters are passed through a pointer to a apiListUsersFromUserGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
pagination | PaginationInput | Pagination for members of a group. This parameter exists in v1. |
ListUsersFromUserGroup200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RemoveUsersFromUserGroup200Response RemoveUsersFromUserGroup(ctx, userGroupId).Emails(emails).Execute()
Remove Users from User Group
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
userGroupId := "bBABwqbaDf2QdwTbW8bNEm" // string |
emails := []string{"Inner_example"} // []string | The list of emails to remove from the user group. This parameter exists in v1.
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.IAMGroupsAPI.RemoveUsersFromUserGroup(ctx, userGroupId).Emails(emails).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IAMGroupsAPI.RemoveUsersFromUserGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `RemoveUsersFromUserGroup`: RemoveUsersFromUserGroup200Response
fmt.Fprintf(os.Stdout, "Response from `IAMGroupsAPI.RemoveUsersFromUserGroup`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userGroupId | string |
Other parameters are passed through a pointer to a apiRemoveUsersFromUserGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
emails | []string | The list of emails to remove from the user group. This parameter exists in v1. |
RemoveUsersFromUserGroup200Response
- Content-Type: Not defined
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ReplacePermissionsForUserGroup200Response ReplacePermissionsForUserGroup(ctx, userGroupId).ReplacePermissionsForUserGroupV1Input(replacePermissionsForUserGroupV1Input).Execute()
Replace Permissions for User Group
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
userGroupId := "bBABwqbaDf2QdwTbW8bNEm" // string |
replacePermissionsForUserGroupV1Input := *api.NewReplacePermissionsForUserGroupV1Input([]api.PermissionInputV1{*api.NewPermissionInputV1("RoleId_example", []api.PermissionResourceV1{*api.NewPermissionResourceV1("Id_example", "Type_example")})}) // ReplacePermissionsForUserGroupV1Input |
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.IAMGroupsAPI.ReplacePermissionsForUserGroup(ctx, userGroupId).ReplacePermissionsForUserGroupV1Input(replacePermissionsForUserGroupV1Input).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IAMGroupsAPI.ReplacePermissionsForUserGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `ReplacePermissionsForUserGroup`: ReplacePermissionsForUserGroup200Response
fmt.Fprintf(os.Stdout, "Response from `IAMGroupsAPI.ReplacePermissionsForUserGroup`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userGroupId | string |
Other parameters are passed through a pointer to a apiReplacePermissionsForUserGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
replacePermissionsForUserGroupV1Input | ReplacePermissionsForUserGroupV1Input | |
ReplacePermissionsForUserGroup200Response
- Content-Type: application/json, application/vnd.segment.v1+json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ReplaceUsersInUserGroup200Response ReplaceUsersInUserGroup(ctx, userGroupId).ReplaceUsersInUserGroupV1Input(replaceUsersInUserGroupV1Input).Execute()
Replace Users in User Group
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
userGroupId := "bBABwqbaDf2QdwTbW8bNEm" // string |
replaceUsersInUserGroupV1Input := *api.NewReplaceUsersInUserGroupV1Input([]string{"Emails_example"}) // ReplaceUsersInUserGroupV1Input |
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.IAMGroupsAPI.ReplaceUsersInUserGroup(ctx, userGroupId).ReplaceUsersInUserGroupV1Input(replaceUsersInUserGroupV1Input).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IAMGroupsAPI.ReplaceUsersInUserGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `ReplaceUsersInUserGroup`: ReplaceUsersInUserGroup200Response
fmt.Fprintf(os.Stdout, "Response from `IAMGroupsAPI.ReplaceUsersInUserGroup`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userGroupId | string |
Other parameters are passed through a pointer to a apiReplaceUsersInUserGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
replaceUsersInUserGroupV1Input | ReplaceUsersInUserGroupV1Input | |
ReplaceUsersInUserGroup200Response
- Content-Type: application/json, application/vnd.segment.v1+json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateUserGroup200Response UpdateUserGroup(ctx, userGroupId).UpdateUserGroupV1Input(updateUserGroupV1Input).Execute()
Update User Group
package main
import (
"context"
"fmt"
"os"
api "github.com/segmentio/public-api-sdk-go"
)
func main() {
userGroupId := "bBABwqbaDf2QdwTbW8bNEm" // string |
updateUserGroupV1Input := *api.NewUpdateUserGroupV1Input("Name_example") // UpdateUserGroupV1Input |
configuration := api.NewConfiguration()
apiClient := api.NewAPIClient(configuration)
token := "<BEARER_TOKEN>"
ctx := context.WithValue(context.Background(), api.ContextAccessToken, token)
resp, r, err := apiClient.IAMGroupsAPI.UpdateUserGroup(ctx, userGroupId).UpdateUserGroupV1Input(updateUserGroupV1Input).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `IAMGroupsAPI.UpdateUserGroup``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
responseErrors := api.UnwrapFullErrors(err)
if responseErrors != nil {
for _, responseError := range responseErrors.Errors {
fmt.Fprintf(os.Stderr, "Full error message: %v\n", *responseError.Message)
}
}
}
// response from `UpdateUserGroup`: UpdateUserGroup200Response
fmt.Fprintf(os.Stdout, "Response from `IAMGroupsAPI.UpdateUserGroup`: %v\n", resp.GetData())
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
userGroupId | string |
Other parameters are passed through a pointer to a apiUpdateUserGroupRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
updateUserGroupV1Input | UpdateUserGroupV1Input | |
- Content-Type: application/json, application/vnd.segment.v1+json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
- Accept: application/vnd.segment.v1+json, application/json, application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
[Back to top] [Back to API list] [Back to Model list] [Back to README]