Skip to content

Latest commit

 

History

History
645 lines (409 loc) · 18.9 KB

UserManagementApi.md

File metadata and controls

645 lines (409 loc) · 18.9 KB

\UserManagementApi

All URIs are relative to https://api.au.sumologic.com/api

Method HTTP request Description
CreateUser Post /v1/users Create a new user.
DeleteUser Delete /v1/users/{id} Delete a user.
DisableMfa Put /v1/users/{id}/mfa/disable Disable MFA for user.
GetUser Get /v1/users/{id} Get a user.
ListUsers Get /v1/users Get a list of users.
RequestChangeEmail Post /v1/users/{id}/email/requestChange Change email address.
ResetPassword Post /v1/users/{id}/password/reset Reset password.
UnlockUser Post /v1/users/{id}/unlock Unlock a user.
UpdateUser Put /v1/users/{id} Update a user.

CreateUser

UserModel CreateUser(ctx).CreateUserDefinition(createUserDefinition).Execute()

Create a new user.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    createUserDefinition := *openapiclient.NewCreateUserDefinition("John", "Doe", "johndoe@acme.com", []string{"RoleIds_example"}) // CreateUserDefinition | Information about the new user.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.UserManagementApi.CreateUser(context.Background()).CreateUserDefinition(createUserDefinition).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.CreateUser``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateUser`: UserModel
    fmt.Fprintf(os.Stdout, "Response from `UserManagementApi.CreateUser`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateUserRequest struct via the builder pattern

Name Type Description Notes
createUserDefinition CreateUserDefinition Information about the new user.

Return type

UserModel

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteUser

DeleteUser(ctx, id).TransferTo(transferTo).DeleteContent(deleteContent).Execute()

Delete a user.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | Identifier of the user to delete.
    transferTo := "transferTo_example" // string | Identifier of the user to receive the transfer of content from the deleted user. <br> **Note:** If `deleteContent` is not set to `true`, and no user identifier is specified in `transferTo`, content from the deleted user is transferred to the executing user. (optional)
    deleteContent := true // bool | Whether to delete content from the deleted user or not. <br> **Warning:** If `deleteContent` is set to `true`, all of the content for the user being deleted is permanently deleted and cannot be recovered. (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.UserManagementApi.DeleteUser(context.Background(), id).TransferTo(transferTo).DeleteContent(deleteContent).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.DeleteUser``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string Identifier of the user to delete.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteUserRequest struct via the builder pattern

Name Type Description Notes

transferTo | string | Identifier of the user to receive the transfer of content from the deleted user. <br> Note: If `deleteContent` is not set to `true`, and no user identifier is specified in `transferTo`, content from the deleted user is transferred to the executing user. | deleteContent | bool | Whether to delete content from the deleted user or not. <br> Warning: If `deleteContent` is set to `true`, all of the content for the user being deleted is permanently deleted and cannot be recovered. |

Return type

(empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DisableMfa

DisableMfa(ctx, id).DisableMfaRequest(disableMfaRequest).Execute()

Disable MFA for user.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | Identifier of the user to disable MFA for.
    disableMfaRequest := *openapiclient.NewDisableMfaRequest("johndoe@cme.com", "Password_example") // DisableMfaRequest | Email and Password of the user to disable MFA for.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.UserManagementApi.DisableMfa(context.Background(), id).DisableMfaRequest(disableMfaRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.DisableMfa``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string Identifier of the user to disable MFA for.

Other Parameters

Other parameters are passed through a pointer to a apiDisableMfaRequest struct via the builder pattern

Name Type Description Notes

disableMfaRequest | DisableMfaRequest | Email and Password of the user to disable MFA for. |

Return type

(empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetUser

UserModel GetUser(ctx, id).Execute()

Get a user.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | Identifier of user to return.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.UserManagementApi.GetUser(context.Background(), id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.GetUser``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetUser`: UserModel
    fmt.Fprintf(os.Stdout, "Response from `UserManagementApi.GetUser`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string Identifier of user to return.

Other Parameters

Other parameters are passed through a pointer to a apiGetUserRequest struct via the builder pattern

Name Type Description Notes

Return type

UserModel

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListUsers

ListUserModelsResponse ListUsers(ctx).Limit(limit).Token(token).SortBy(sortBy).Email(email).Execute()

Get a list of users.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    limit := int32(56) // int32 | Limit the number of users returned in the response. The number of users returned may be less than the `limit`. (optional) (default to 100)
    token := "token_example" // string | Continuation token to get the next page of results. A page object with the next continuation token is returned in the response body. Subsequent GET requests should specify the continuation token to get the next page of results. `token` is set to null when no more pages are left. (optional)
    sortBy := "sortBy_example" // string | Sort the list of users by the `firstName`, `lastName`, or `email` field. (optional)
    email := "email_example" // string | Find user with the given email address. (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.UserManagementApi.ListUsers(context.Background()).Limit(limit).Token(token).SortBy(sortBy).Email(email).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.ListUsers``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListUsers`: ListUserModelsResponse
    fmt.Fprintf(os.Stdout, "Response from `UserManagementApi.ListUsers`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListUsersRequest struct via the builder pattern

Name Type Description Notes
limit int32 Limit the number of users returned in the response. The number of users returned may be less than the `limit`. [default to 100]
token string Continuation token to get the next page of results. A page object with the next continuation token is returned in the response body. Subsequent GET requests should specify the continuation token to get the next page of results. `token` is set to null when no more pages are left.
sortBy string Sort the list of users by the `firstName`, `lastName`, or `email` field.
email string Find user with the given email address.

Return type

ListUserModelsResponse

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RequestChangeEmail

RequestChangeEmail(ctx, id).ChangeEmailRequest(changeEmailRequest).Execute()

Change email address.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | Identifier of the user to change email address.
    changeEmailRequest := *openapiclient.NewChangeEmailRequest("johndoe@acme.com") // ChangeEmailRequest | New email address of the user.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.UserManagementApi.RequestChangeEmail(context.Background(), id).ChangeEmailRequest(changeEmailRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.RequestChangeEmail``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string Identifier of the user to change email address.

Other Parameters

Other parameters are passed through a pointer to a apiRequestChangeEmailRequest struct via the builder pattern

Name Type Description Notes

changeEmailRequest | ChangeEmailRequest | New email address of the user. |

Return type

(empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ResetPassword

ResetPassword(ctx, id).Execute()

Reset password.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | Identifier of the user to reset password.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.UserManagementApi.ResetPassword(context.Background(), id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.ResetPassword``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string Identifier of the user to reset password.

Other Parameters

Other parameters are passed through a pointer to a apiResetPasswordRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UnlockUser

UnlockUser(ctx, id).Execute()

Unlock a user.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | The id of the user that needs to be unlocked.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.UserManagementApi.UnlockUser(context.Background(), id).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.UnlockUser``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string The id of the user that needs to be unlocked.

Other Parameters

Other parameters are passed through a pointer to a apiUnlockUserRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateUser

UserModel UpdateUser(ctx, id).UpdateUserDefinition(updateUserDefinition).Execute()

Update a user.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    id := "id_example" // string | Identifier of the user to update.
    updateUserDefinition := *openapiclient.NewUpdateUserDefinition("John", "Doe", true, []string{"RoleIds_example"}) // UpdateUserDefinition | Information to update about the user.

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.UserManagementApi.UpdateUser(context.Background(), id).UpdateUserDefinition(updateUserDefinition).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `UserManagementApi.UpdateUser``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateUser`: UserModel
    fmt.Fprintf(os.Stdout, "Response from `UserManagementApi.UpdateUser`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
id string Identifier of the user to update.

Other Parameters

Other parameters are passed through a pointer to a apiUpdateUserRequest struct via the builder pattern

Name Type Description Notes

updateUserDefinition | UpdateUserDefinition | Information to update about the user. |

Return type

UserModel

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]