Desktop Configuration Profiles

A Desktop Configuration Profile centrally defines desktop mount point mappings for users in a Site or Workspace.

List Desktop Configuration Profiles

SDK Method

desktopconfigurationprofile.List()

Return Object

[]*DesktopConfigurationProfile

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    desktop_configuration_profile "github.com/Files-com/files-sdk-go/v3/desktopconfigurationprofile"
)

desktopConfigurationProfileIterator, err := desktop_configuration_profile.List(files_sdk.DesktopConfigurationProfileListParams{})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

for desktopConfigurationProfileIterator.Next() {
    desktopConfigurationProfile := desktopConfigurationProfileIterator.desktopConfigurationProfile()
}
err = desktopConfigurationProfileIterator.Err()
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Show Desktop Configuration Profile

SDK Method

desktopconfigurationprofile.Find()

Return Object

DesktopConfigurationProfile

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

DesktopConfigurationProfileFindParams Fields

FieldDescription
Id
int64
Required
Desktop Configuration Profile ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    desktop_configuration_profile "github.com/Files-com/files-sdk-go/v3/desktopconfigurationprofile"
)

desktopConfigurationProfile, err := desktop_configuration_profile.Find(files_sdk.DesktopConfigurationProfileFindParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Create Desktop Configuration Profile

SDK Method

desktopconfigurationprofile.Create()

Return Object

DesktopConfigurationProfile

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

DesktopConfigurationProfileCreateParams Fields

FieldDefaultDescription
Name
string
Required
Profile name
MountMappings
object
Required
Mount point mappings for the desktop app. Keys must be a single uppercase Windows drive letter other than A, B, or C, and values are Files.com paths to mount there.
WorkspaceId
int64
0Workspace ID
UseForAllUsers
boolean
falseWhether this profile applies to all users in the Workspace by default
DisableDriveMounting
boolean
falseWhether the desktop app should hide drive mounting, prevent new drive mounts, and unmount active drive mounts for users with this profile

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    desktop_configuration_profile "github.com/Files-com/files-sdk-go/v3/desktopconfigurationprofile"
)

desktopConfigurationProfile, err := desktop_configuration_profile.Create(files_sdk.DesktopConfigurationProfileCreateParams{
  Name: "North America Desktop Profile",
  MountMappings: {"key":"example value"}
})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Update Desktop Configuration Profile

SDK Method

desktopconfigurationprofile.Update()

Return Object

DesktopConfigurationProfile

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

DesktopConfigurationProfileUpdateParams Fields

FieldDescription
Id
int64
Required
Desktop Configuration Profile ID.
Name
string
Profile name
WorkspaceId
int64
Workspace ID
MountMappings
object
Mount point mappings for the desktop app. Keys must be a single uppercase Windows drive letter other than A, B, or C, and values are Files.com paths to mount there.
UseForAllUsers
boolean
Whether this profile applies to all users in the Workspace by default
DisableDriveMounting
boolean
Whether the desktop app should hide drive mounting, prevent new drive mounts, and unmount active drive mounts for users with this profile

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    desktop_configuration_profile "github.com/Files-com/files-sdk-go/v3/desktopconfigurationprofile"
)

desktopConfigurationProfile, err := desktop_configuration_profile.Update(files_sdk.DesktopConfigurationProfileUpdateParams{
  Id: 1,
  Name: "North America Desktop Profile"
})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

Delete Desktop Configuration Profile

SDK Method

desktopconfigurationprofile.Delete()

Return Object

No return value.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

DesktopConfigurationProfileDeleteParams Fields

FieldDescription
Id
int64
Required
Desktop Configuration Profile ID.

Example Request

import (
    "fmt"
    "errors"

    files_sdk "github.com/Files-com/files-sdk-go/v3"
    desktop_configuration_profile "github.com/Files-com/files-sdk-go/v3/desktopconfigurationprofile"
)

err := desktop_configuration_profile.Delete(files_sdk.DesktopConfigurationProfileDeleteParams{Id: 1})
if err != nil {
    var respErr files_sdk.ResponseError
    if errors.As(err, &respErr) {
        fmt.Println("Response Error Occurred (" + respErr.Type + "): " + respErr.ErrorMessage)
    } else {
        fmt.Printf("Unexpected Error: %s\n", err.Error())
    }
}

The DesktopConfigurationProfile Object

Some of the methods above return a DesktopConfigurationProfile object. The attributes of this object are listed below.

AttributeDescription
Id
int64
Desktop Configuration Profile ID
Name
string
Profile name
WorkspaceId
int64
Workspace ID
UseForAllUsers
boolean
Whether this profile applies to all users in the Workspace by default
DisableDriveMounting
boolean
Whether the desktop app should hide drive mounting, prevent new drive mounts, and unmount active drive mounts for users with this profile
MountMappings
object
Mount point mappings for the desktop app. Keys must be a single uppercase Windows drive letter other than A, B, or C, and values are Files.com paths to mount there.