All URIs are relative to https://api.opal.dev/v1
| Method | HTTP request | Description |
|---|---|---|
| CreateOwner | Post /owners | |
| DeleteOwner | Delete /owners/{owner_id} | |
| GetOwner | Get /owners/{owner_id} | Get owner by ID |
| GetOwnerFromName | Get /owners/name/{owner_name} | |
| GetOwnerUsers | Get /owners/{owner_id}/users | |
| GetOwners | Get /owners | Get owners |
| SetOwnerUsers | Put /owners/{owner_id}/users | |
| UpdateOwners | Put /owners |
Owner CreateOwner(ctx).CreateOwnerInfo(createOwnerInfo).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
createOwnerInfo := *openapiclient.NewCreateOwnerInfo("API Owner", []string{"UserIds_example"}) // CreateOwnerInfo |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.OwnersAPI.CreateOwner(context.Background()).CreateOwnerInfo(createOwnerInfo).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `OwnersAPI.CreateOwner``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateOwner`: Owner
fmt.Fprintf(os.Stdout, "Response from `OwnersAPI.CreateOwner`: %v\n", resp)
}Other parameters are passed through a pointer to a apiCreateOwnerRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| createOwnerInfo | CreateOwnerInfo |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeleteOwner(ctx, ownerId).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
ownerId := "4baf8423-db0a-4037-a4cf-f79c60cb67a5" // string | The ID of the owner.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.OwnersAPI.DeleteOwner(context.Background(), ownerId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `OwnersAPI.DeleteOwner``: %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. | |
| ownerId | string | The ID of the owner. |
Other parameters are passed through a pointer to a apiDeleteOwnerRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Owner GetOwner(ctx, ownerId).Execute()
Get owner by ID
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
ownerId := "32acc112-21ff-4669-91c2-21e27683eaa1" // string | The ID of the owner.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.OwnersAPI.GetOwner(context.Background(), ownerId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `OwnersAPI.GetOwner``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetOwner`: Owner
fmt.Fprintf(os.Stdout, "Response from `OwnersAPI.GetOwner`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| ownerId | string | The ID of the owner. |
Other parameters are passed through a pointer to a apiGetOwnerRequest 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]
Owner GetOwnerFromName(ctx, ownerName).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
ownerName := "MyOwner" // string | The name of the owner.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.OwnersAPI.GetOwnerFromName(context.Background(), ownerName).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `OwnersAPI.GetOwnerFromName``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetOwnerFromName`: Owner
fmt.Fprintf(os.Stdout, "Response from `OwnersAPI.GetOwnerFromName`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| ownerName | string | The name of the owner. |
Other parameters are passed through a pointer to a apiGetOwnerFromNameRequest 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]
UserList GetOwnerUsers(ctx, ownerId).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
ownerId := "4baf8423-db0a-4037-a4cf-f79c60cb67a5" // string | The ID of the owner.
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.OwnersAPI.GetOwnerUsers(context.Background(), ownerId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `OwnersAPI.GetOwnerUsers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetOwnerUsers`: UserList
fmt.Fprintf(os.Stdout, "Response from `OwnersAPI.GetOwnerUsers`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| ownerId | string | The ID of the owner. |
Other parameters are passed through a pointer to a apiGetOwnerUsersRequest 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]
PaginatedOwnersList GetOwners(ctx).Cursor(cursor).PageSize(pageSize).Name(name).Execute()
Get owners
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)
name := "200" // string | Owner name to filter by. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.OwnersAPI.GetOwners(context.Background()).Cursor(cursor).PageSize(pageSize).Name(name).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `OwnersAPI.GetOwners``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetOwners`: PaginatedOwnersList
fmt.Fprintf(os.Stdout, "Response from `OwnersAPI.GetOwners`: %v\n", resp)
}Other parameters are passed through a pointer to a apiGetOwnersRequest 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. | |
| name | string | Owner name to filter by. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserList SetOwnerUsers(ctx, ownerId).UserIDList(userIDList).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
ownerId := "4baf8423-db0a-4037-a4cf-f79c60cb67a5" // string | The ID of the owner.
userIDList := *openapiclient.NewUserIDList([]string{"UserIds_example"}) // UserIDList |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.OwnersAPI.SetOwnerUsers(context.Background(), ownerId).UserIDList(userIDList).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `OwnersAPI.SetOwnerUsers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `SetOwnerUsers`: UserList
fmt.Fprintf(os.Stdout, "Response from `OwnersAPI.SetOwnerUsers`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| ownerId | string | The ID of the owner. |
Other parameters are passed through a pointer to a apiSetOwnerUsersRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
userIDList | UserIDList | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateOwnerInfoList UpdateOwners(ctx).UpdateOwnerInfoList(updateOwnerInfoList).Execute()
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/opalsecurity/opal-go"
)
func main() {
updateOwnerInfoList := *openapiclient.NewUpdateOwnerInfoList([]openapiclient.UpdateOwnerInfo{*openapiclient.NewUpdateOwnerInfo("f454d283-ca87-4a8a-bdbb-df212eca5353")}) // UpdateOwnerInfoList | Owners to be updated
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.OwnersAPI.UpdateOwners(context.Background()).UpdateOwnerInfoList(updateOwnerInfoList).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `OwnersAPI.UpdateOwners``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateOwners`: UpdateOwnerInfoList
fmt.Fprintf(os.Stdout, "Response from `OwnersAPI.UpdateOwners`: %v\n", resp)
}Other parameters are passed through a pointer to a apiUpdateOwnersRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| updateOwnerInfoList | UpdateOwnerInfoList | Owners to be updated |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]