public class Unauthorized extends Error implements java.io.Serializable, com.vmware.vapi.bindings.StaticStructure
Unauthorized
exception indicates that the user is not authorized to
perform the method.
API requests may include a security context containing user credentials. For example, the user credentials could be a SAML token, a user name and password, or the session identifier for a previously established session. Invoking the method may require that the user identified by those credentials has particular privileges on the method or on one or more resource identifiers passed to the method.
Examples:
Counterexamples:
Unauthenticated
exception would be used instead.
Unauthenticated
exception would
be used instead. Unauthenticated
exception would be used instead.
For security reasons, the Error.getData()
property in this exception is null
, and the Error.getMessages()
property in
this exception does not disclose why the user is not authorized to perform the
method. For example the messages would not disclose which privilege the user did
not have or which resource identifier the user did not have the required
privilege to access. The API documentation should indicate what privileges are
required.
Modifier and Type | Class and Description |
---|---|
static class |
Unauthorized.Builder
Builder class for
Unauthorized . |
Error.Type
__dynamicStructureFields
Modifier | Constructor and Description |
---|---|
|
Unauthorized()
Default constructor.
|
|
Unauthorized(java.util.List<LocalizableMessage> messages,
com.vmware.vapi.bindings.Structure data)
This constructor is provided for backwards compatibility purposes only.
|
protected |
Unauthorized(com.vmware.vapi.data.StructValue __dynamicStructureFields) |
protected |
Unauthorized(com.vmware.vapi.data.StructValue __dynamicStructureFields,
Error.Type errorType) |
Modifier and Type | Method and Description |
---|---|
<T extends com.vmware.vapi.bindings.Structure> |
_convertTo(java.lang.Class<T> clazz) |
java.lang.String |
_getCanonicalName() |
static java.lang.String |
_getCanonicalTypeName()
Returns the canonical type name.
|
static com.vmware.vapi.bindings.type.ErrorType |
_getClassType()
WARNING: Internal method, subject to change in future versions.
|
com.vmware.vapi.data.StructValue |
_getDataValue() |
com.vmware.vapi.data.DataValue |
_getDynamicField(java.lang.String fieldName) |
java.util.Set<java.lang.String> |
_getDynamicFieldNames() |
com.vmware.vapi.bindings.type.ErrorType |
_getType() |
boolean |
_hasTypeNameOf(java.lang.Class<? extends com.vmware.vapi.bindings.Structure> clazz) |
static Unauthorized |
_newInstance(com.vmware.vapi.data.StructValue structValue)
WARNING: Internal method, subject to change in future versions.
Returns new instance of this binding class and injects the provided data value. WARNING: The returned object is not fully initialized. |
static Unauthorized |
_newInstance2(com.vmware.vapi.data.StructValue structValue)
WARNING: Internal method, subject to change in future versions.
Serves as a versioning mechanism. |
void |
_setDynamicField(java.lang.String fieldName,
com.vmware.vapi.data.DataValue fieldValue) |
protected void |
_updateDataValue(com.vmware.vapi.data.StructValue structValue) |
void |
_validate() |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getMessage() |
int |
hashCode() |
getData, getErrorType, getMessages, setData, setMessages
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public Unauthorized(java.util.List<LocalizableMessage> messages, com.vmware.vapi.bindings.Structure data)
public Unauthorized()
protected Unauthorized(com.vmware.vapi.data.StructValue __dynamicStructureFields)
protected Unauthorized(com.vmware.vapi.data.StructValue __dynamicStructureFields, Error.Type errorType)
public com.vmware.vapi.bindings.type.ErrorType _getType()
public com.vmware.vapi.data.StructValue _getDataValue()
_getDataValue
in interface com.vmware.vapi.bindings.Structure
_getDataValue
in class Error
protected void _updateDataValue(com.vmware.vapi.data.StructValue structValue)
_updateDataValue
in class Error
public void _validate()
public java.lang.String getMessage()
getMessage
in class Error
public boolean _hasTypeNameOf(java.lang.Class<? extends com.vmware.vapi.bindings.Structure> clazz)
_hasTypeNameOf
in interface com.vmware.vapi.bindings.Structure
_hasTypeNameOf
in class Error
public <T extends com.vmware.vapi.bindings.Structure> T _convertTo(java.lang.Class<T> clazz)
_convertTo
in interface com.vmware.vapi.bindings.Structure
_convertTo
in class Error
public void _setDynamicField(java.lang.String fieldName, com.vmware.vapi.data.DataValue fieldValue)
_setDynamicField
in interface com.vmware.vapi.bindings.StaticStructure
_setDynamicField
in class Error
public com.vmware.vapi.data.DataValue _getDynamicField(java.lang.String fieldName)
_getDynamicField
in interface com.vmware.vapi.bindings.StaticStructure
_getDynamicField
in class Error
public java.util.Set<java.lang.String> _getDynamicFieldNames()
_getDynamicFieldNames
in interface com.vmware.vapi.bindings.StaticStructure
_getDynamicFieldNames
in class Error
public static com.vmware.vapi.bindings.type.ErrorType _getClassType()
ErrorType
instance representing the static bindings
type for this Error
.public java.lang.String _getCanonicalName()
_getCanonicalName
in interface com.vmware.vapi.bindings.Structure
_getCanonicalName
in class Error
public static java.lang.String _getCanonicalTypeName()
_getCanonicalName()
.public static Unauthorized _newInstance(com.vmware.vapi.data.StructValue structValue)
structValue
- the source of the data contained in the binding object. Could
contain more data than fields of this class can describe i.e.
newer version of the binding object. Could be null.StructType
public static Unauthorized _newInstance2(com.vmware.vapi.data.StructValue structValue)