Skip to content
  • Auto
  • Light
  • Dark
Get Started

List

List
client.IAM.Roles.List(ctx, query) (*ListarrayNextPageTokenstringIAMRoleListResponse, error)
get/api/v1/iam/roles

List all roles for the current user.

Parameters
queryPageSizefieldPageTokenfieldIAMRoleListParams
Hide ParametersShow Parameters
PageSizefield
optional
param.Field[int64]

The pageSize field.

formatint32
PageTokenfield
optional
param.Field[string]

The pageToken field.

Returns
IAMRoleListResponsestruct

The ListRolesResponse message contains a list of results and a nextPageToken if applicable.

Hide ParametersShow Parameters
Listarray
optional
[]IDstringCreatedAtTimeDeletedAtTimeDisplayNamestringNamestringPermissionsarrayServiceRolesarraySystemAPIOnlyboolSystemBuiltinboolUpdatedAtTimeRole

The list of results containing up to X results, where X is the page size defined in the request.

Hide ParametersShow Parameters
IDstring
optional

The id of the role.

CreatedAtTime
optional
formatdate-time
DeletedAtTime
optional
formatdate-time
DisplayNamestring
optional

The display name of the role.

Namestring
optional

The internal name of the role.

Permissionsarray
optional
[]string

The list of permissions this role has.

ServiceRolesarray
optional
[]string

The list of serviceRoles that this role has.

SystemAPIOnlybool
optional

This Role is intended for API keys usage only, and the user interface may not function as expected.

SystemBuiltinbool
optional

The system builtin field. If this field is set, the role is not editable.

UpdatedAtTime
optional
formatdate-time
NextPageTokenstring
optional

The nextPageToken is shown for the next page if the number of results is larger than the max page size. The server returns one page of results and the nextPageToken until all results are retreived. To retrieve the next page, use the same request and append a pageToken field with the value of nextPageToken shown on the previous page.

Request example Go
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/-go"
  "github.com/stainless-sdks/-go/option"
)

func main() {
  client := conductoronesdk.NewClient(
    option.WithAPIKey("My API Key"),
  )
  roles, err := client.IAM.Roles.List(context.TODO(), conductoronesdk.IAMRoleListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", roles.List)
}
200 Example
{
  "list": [
    {
      "displayName": "displayName",
      "permissions": [
        "string"
      ],
      "serviceRoles": [
        "string"
      ]
    }
  ],
  "nextPageToken": "nextPageToken"
}