Class Role
-
- All Implemented Interfaces:
public final class RoleDetails about a role that can be assigned through the public Roles API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classRole.BuilderA builder for Role.
-
Method Summary
Modifier and Type Method Description final Stringid()Identifier for the role. final Optional<String>description()Optional description of the role. final Stringname()Unique name for the role. final JsonValue_object_()Always role.final List<String>permissions()Permissions granted by the role. final BooleanpredefinedRole()Whether the role is predefined and managed by OpenAI. final StringresourceType()Resource type the role is bound to (for example api.organizationorapi.project).final JsonField<String>_id()Returns the raw JSON value of id. final JsonField<String>_description()Returns the raw JSON value of description. final JsonField<String>_name()Returns the raw JSON value of name. final JsonField<List<String>>_permissions()Returns the raw JSON value of permissions. final JsonField<Boolean>_predefinedRole()Returns the raw JSON value of predefinedRole. final JsonField<String>_resourceType()Returns the raw JSON value of resourceType. final Map<String, JsonValue>_additionalProperties()final Role.BuildertoBuilder()final Rolevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static Role.Builderbuilder()Returns a mutable builder for constructing an instance of Role. -
-
Method Detail
-
description
final Optional<String> description()
Optional description of the role.
-
_object_
final JsonValue _object_()
Always
role.Expected to always return the following:
JsonValue.from("role")However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).
-
permissions
final List<String> permissions()
Permissions granted by the role.
-
predefinedRole
final Boolean predefinedRole()
Whether the role is predefined and managed by OpenAI.
-
resourceType
final String resourceType()
Resource type the role is bound to (for example
api.organizationorapi.project).
-
_id
final JsonField<String> _id()
Returns the raw JSON value of id.
Unlike id, this method doesn't throw if the JSON field has an unexpected type.
-
_description
final JsonField<String> _description()
Returns the raw JSON value of description.
Unlike description, this method doesn't throw if the JSON field has an unexpected type.
-
_name
final JsonField<String> _name()
Returns the raw JSON value of name.
Unlike name, this method doesn't throw if the JSON field has an unexpected type.
-
_permissions
final JsonField<List<String>> _permissions()
Returns the raw JSON value of permissions.
Unlike permissions, this method doesn't throw if the JSON field has an unexpected type.
-
_predefinedRole
final JsonField<Boolean> _predefinedRole()
Returns the raw JSON value of predefinedRole.
Unlike predefinedRole, this method doesn't throw if the JSON field has an unexpected type.
-
_resourceType
final JsonField<String> _resourceType()
Returns the raw JSON value of resourceType.
Unlike resourceType, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final Role.Builder toBuilder()
-
validate
final Role validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static Role.Builder builder()
Returns a mutable builder for constructing an instance of Role.
The following fields are required:
.id() .description() .name() .permissions() .predefinedRole() .resourceType()
-
-
-
-