Resource URL: /platform/<<version=1>>/auth/roles

    Overview: This resource applies the standard collection pattern to roles.

     Methods: GET, POST

********************************************************************************

Method GET: List all roles.

       URL: GET /platform/<<version=1>>/auth/roles

Query arguments:
          sort=<string> The field that will be used for sorting.
resolve_names=<boolean> Filter users by zone.
        limit=<integer> Return no more than this many results at once (see
                        resume).
             dir=<enum> Where <enum> is one of ASC, DESC.  The direction of the
                        sort.
        resume=<string> Continue returning results from previous call using
                        this token (token should come from the previous call,
                        resume cannot be used with other options).

GET response body schema:
{
  "type": "object", 
  "properties": {
    "total": {
      "type": "integer", 
      "description": "Total number of items available."
    }, 
    "roles": {
      "items": {
        "type": "object", 
        "description": "Specifies the role maps privileges to users and groups.", 
        "properties": {
          "name": {
            "required": true, 
            "type": "string", 
            "description": "Specifies the name of the role."
          }, 
          "privileges": {
            "items": {
              "type": "object", 
              "description": "Specifies the system-defined privilege that may be granted to users.", 
              "properties": {
                "read_only": {
                  "type": "boolean", 
                  "description": "True, if the privilege is read-only."
                }, 
                "id": {
                  "required": true, 
                  "type": "string", 
                  "description": "Specifies the ID of the privilege."
                }, 
                "name": {
                  "type": "string", 
                  "description": "Specifies the name of the privilege."
                }
              }
            }, 
            "required": true, 
            "type": "array", 
            "description": "Specifies the privileges granted by this role."
          }, 
          "description": {
            "required": true, 
            "type": [
              {
                "type": "string", 
                "description": "Specifies the description of the role."
              }, 
              {
                "type": "null"
              }
            ]
          }, 
          "members": {
            "items": {
              "type": "object", 
              "description": "Specifies properties for a persona, which consists of either a 'type' and a 'name' or an 'ID'.", 
              "properties": {
                "type": {
                  "enum": [
                    "user", 
                    "group", 
                    "wellknown"
                  ], 
                  "type": "string", 
                  "description": "Specifies the type of persona, which must be combined with a name."
                }, 
                "id": {
                  "type": "string", 
                  "description": "Specifies the serialized form of a persona, which can be 'UID:0', 'USER:name', 'GID:0', 'GROUP:wheel', or 'SID:S-1-1'."
                }, 
                "name": {
                  "type": "string", 
                  "description": "Specifies the persona name, which must be combined with a type."
                }
              }
            }, 
            "required": true, 
            "type": "array", 
            "description": "Specifies the users or groups that have this role."
          }, 
          "id": {
            "required": true, 
            "type": "string", 
            "description": "Specifies the ID of the role."
          }
        }
      }, 
      "type": "array"
    }, 
    "resume": {
      "type": [
        "string", 
        "null"
      ], 
      "description": "Continue returning results from previous call using this token (token should come from the previous call, resume cannot be used with other options)."
    }
  }
}

********************************************************************************

Method POST: Create a new role.

        URL: POST /platform/<<version=1>>/auth/roles

There are no query arguments for this method.

Required POST request body fields:
name

POST request body schema:
{
  "type": "object", 
  "description": "Specifies the role maps privileges to users and groups.", 
  "properties": {
    "privileges": {
      "items": {
        "type": "object", 
        "description": "Specifies the system-defined privilege that may be granted to users.", 
        "properties": {
          "read_only": {
            "type": "boolean", 
            "description": "True, if the privilege is read-only."
          }, 
          "id": {
            "required": true, 
            "type": "string", 
            "description": "Specifies the ID of the privilege."
          }, 
          "name": {
            "type": "string", 
            "description": "Specifies the name of the privilege."
          }
        }
      }, 
      "type": "array", 
      "description": "Specifies the privileges granted by this role."
    }, 
    "description": {
      "type": "string", 
      "description": "Specifies the description of the role."
    }, 
    "members": {
      "items": {
        "type": "object", 
        "description": "Specifies properties for a persona, which consists of either a 'type' and a 'name' or an 'ID'.", 
        "properties": {
          "type": {
            "enum": [
              "user", 
              "group", 
              "wellknown"
            ], 
            "type": "string", 
            "description": "Specifies the type of persona, which must be combined with a name."
          }, 
          "id": {
            "type": "string", 
            "description": "Specifies the serialized form of a persona, which can be 'UID:0', 'USER:name', 'GID:0', 'GROUP:wheel', or 'SID:S-1-1'."
          }, 
          "name": {
            "type": "string", 
            "description": "Specifies the persona name, which must be combined with a type."
          }
        }
      }, 
      "type": "array", 
      "description": "Specifies the users or groups that have this role."
    }, 
    "name": {
      "required": true, 
      "type": "string", 
      "description": "Specifies the name of the role."
    }
  }
}

POST response body schema:
{
  "type": "object", 
  "properties": {
    "id": {
      "required": true, 
      "type": "string", 
      "description": "ID of created item that can be used to refer to item in the collection-item resource path."
    }
  }
}
