Skip to content

Latest commit

 

History

History
292 lines (183 loc) · 8.08 KB

File metadata and controls

292 lines (183 loc) · 8.08 KB

\UsersAPI

All URIs are relative to https://api.opal.dev/v1

Method HTTP request Description
GetRemoteUsers Get /users/remote_users
GetUserTags Get /users/{user_id}/tags
GetUsers Get /users
User Get /user

GetRemoteUsers

PaginatedRemoteUsersList GetRemoteUsers(ctx).ThirdPartyProvider(thirdPartyProvider).UserId(userId).RemoteId(remoteId).Cursor(cursor).PageSize(pageSize).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/opalsecurity/opal-go"
)

func main() {
	thirdPartyProvider := []openapiclient.ThirdPartyProviderEnum{openapiclient.ThirdPartyProviderEnum("AUTH0")} // []ThirdPartyProviderEnum | Filter remote users by their third party provider. (optional)
	userId := []string{"Inner_example"} // []string | Filter remote users by their user ID. (optional)
	remoteId := []string{"Inner_example"} // []string | Filter remote users by their remote ID. (optional)
	cursor := "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw" // string | The pagination cursor value. (optional)
	pageSize := int32(200) // int32 | Number of results to return per page. Default is 200. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.UsersAPI.GetRemoteUsers(context.Background()).ThirdPartyProvider(thirdPartyProvider).UserId(userId).RemoteId(remoteId).Cursor(cursor).PageSize(pageSize).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.GetRemoteUsers``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetRemoteUsers`: PaginatedRemoteUsersList
	fmt.Fprintf(os.Stdout, "Response from `UsersAPI.GetRemoteUsers`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
thirdPartyProvider []ThirdPartyProviderEnum Filter remote users by their third party provider.
userId []string Filter remote users by their user ID.
remoteId []string Filter remote users by their remote ID.
cursor string The pagination cursor value.
pageSize int32 Number of results to return per page. Default is 200.

Return type

PaginatedRemoteUsersList

Authorization

BearerAuth

HTTP request headers

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

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

GetUserTags

TagsList GetUserTags(ctx, userId).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/opalsecurity/opal-go"
)

func main() {
	userId := "1b978423-db0a-4037-a4cf-f79c60cb67b3" // string | The ID of the user whose tags to return.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
userId string The ID of the user whose tags to return.

Other Parameters

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

Name Type Description Notes

Return type

TagsList

Authorization

BearerAuth

HTTP request headers

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

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

GetUsers

PaginatedUsersList GetUsers(ctx).Cursor(cursor).PageSize(pageSize).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/opalsecurity/opal-go"
)

func main() {
	cursor := "cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw" // string | The pagination cursor value. (optional)
	pageSize := int32(200) // int32 | Number of results to return per page. Default is 200. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.UsersAPI.GetUsers(context.Background()).Cursor(cursor).PageSize(pageSize).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.GetUsers``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetUsers`: PaginatedUsersList
	fmt.Fprintf(os.Stdout, "Response from `UsersAPI.GetUsers`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
cursor string The pagination cursor value.
pageSize int32 Number of results to return per page. Default is 200.

Return type

PaginatedUsersList

Authorization

BearerAuth

HTTP request headers

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

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

User

User User(ctx).UserId(userId).Email(email).Execute()

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/opalsecurity/opal-go"
)

func main() {
	userId := "32acc112-21ff-4669-91c2-21e27683eaa1" // string | The user ID of the user. (optional)
	email := "johndoe@domain.org" // string | The email of the user. If both user ID and email are provided, user ID will take precedence. If neither are provided, an error will occur. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.UsersAPI.User(context.Background()).UserId(userId).Email(email).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `UsersAPI.User``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `User`: User
	fmt.Fprintf(os.Stdout, "Response from `UsersAPI.User`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
userId string The user ID of the user.
email string The email of the user. If both user ID and email are provided, user ID will take precedence. If neither are provided, an error will occur.

Return type

User

Authorization

BearerAuth

HTTP request headers

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

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