All URIs are relative to https://subdomain.okta.com
Method | HTTP request | Description |
---|---|---|
ActivateDevice | Post /api/v1/devices/{deviceId}/lifecycle/activate | Activate a Device |
DeactivateDevice | Post /api/v1/devices/{deviceId}/lifecycle/deactivate | Deactivate a Device |
DeleteDevice | Delete /api/v1/devices/{deviceId} | Delete a Device |
GetDevice | Get /api/v1/devices/{deviceId} | Retrieve a Device |
ListDeviceUsers | Get /api/v1/devices/{deviceId}/users | List all Users for a Device |
ListDevices | Get /api/v1/devices | List all Devices |
SuspendDevice | Post /api/v1/devices/{deviceId}/lifecycle/suspend | Suspend a Device |
UnsuspendDevice | Post /api/v1/devices/{deviceId}/lifecycle/unsuspend | Unsuspend a Device |
ActivateDevice(ctx, deviceId).Execute()
Activate a Device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.DeviceAPI.ActivateDevice(context.Background(), deviceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.ActivateDevice``: %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. | |
deviceId | string | `id` of the device |
Other parameters are passed through a pointer to a apiActivateDeviceRequest 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]
DeactivateDevice(ctx, deviceId).Execute()
Deactivate a Device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.DeviceAPI.DeactivateDevice(context.Background(), deviceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeactivateDevice``: %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. | |
deviceId | string | `id` of the device |
Other parameters are passed through a pointer to a apiDeactivateDeviceRequest 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]
DeleteDevice(ctx, deviceId).Execute()
Delete a Device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.DeviceAPI.DeleteDevice(context.Background(), deviceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeleteDevice``: %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. | |
deviceId | string | `id` of the device |
Other parameters are passed through a pointer to a apiDeleteDeviceRequest 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]
Device GetDevice(ctx, deviceId).Execute()
Retrieve a Device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DeviceAPI.GetDevice(context.Background(), deviceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.GetDevice``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetDevice`: Device
fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.GetDevice`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
deviceId | string | `id` of the device |
Other parameters are passed through a pointer to a apiGetDeviceRequest 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]
[]DeviceUser ListDeviceUsers(ctx, deviceId).Execute()
List all Users for a Device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DeviceAPI.ListDeviceUsers(context.Background(), deviceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.ListDeviceUsers``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListDeviceUsers`: []DeviceUser
fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.ListDeviceUsers`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
deviceId | string | `id` of the device |
Other parameters are passed through a pointer to a apiListDeviceUsersRequest 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]
[]DeviceList ListDevices(ctx).After(after).Limit(limit).Search(search).Expand(expand).Execute()
List all Devices
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
after := "200u3des4afA47rYJu1d7" // string | (optional)
limit := int32(20) // int32 | A limit on the number of objects to return (recommend `20`) (optional) (default to 200)
search := "status eq "ACTIVE"" // string | A SCIM filter expression that filters the results. Searches include all Device `profile` properties and the Device `id`, `status`, and `lastUpdated` properties. (optional)
expand := "user" // string | Includes associated user details and management status for the device in the `_embedded` attribute (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DeviceAPI.ListDevices(context.Background()).After(after).Limit(limit).Search(search).Expand(expand).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.ListDevices``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ListDevices`: []DeviceList
fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.ListDevices`: %v\n", resp)
}
Other parameters are passed through a pointer to a apiListDevicesRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
after | string | ||
limit | int32 | A limit on the number of objects to return (recommend `20`) | [default to 200] |
search | string | A SCIM filter expression that filters the results. Searches include all Device `profile` properties and the Device `id`, `status`, and `lastUpdated` properties. | |
expand | string | Includes associated user details and management status for the device in the `_embedded` attribute |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SuspendDevice(ctx, deviceId).Execute()
Suspend a Device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.DeviceAPI.SuspendDevice(context.Background(), deviceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.SuspendDevice``: %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. | |
deviceId | string | `id` of the device |
Other parameters are passed through a pointer to a apiSuspendDeviceRequest 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]
UnsuspendDevice(ctx, deviceId).Execute()
Unsuspend a Device
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/okta/okta-sdk-golang"
)
func main() {
deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
r, err := apiClient.DeviceAPI.UnsuspendDevice(context.Background(), deviceId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.UnsuspendDevice``: %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. | |
deviceId | string | `id` of the device |
Other parameters are passed through a pointer to a apiUnsuspendDeviceRequest 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]