# Class Token

Token class for token functionality.

A token is an opaque string that represents an authorization to access cloud resources. Tokens may be revoked at any time and are valid for a finite duration.

  OpenCloud\Common\Base
  OpenCloud\Common\Resource\BaseResource
  OpenCloud\Common\Resource\PersistentResource
  OpenCloud\Common\PersistentObject
  OpenCloud\Identity\Resource\Token

Namespace: OpenCloud\Identity\Resource
Package: OpenCloud\Identity\Resource
Located at OpenCloud/Identity/Resource/Token.php

Methods summary
`public` | # `setId( mixed $id )` #### Parameters $id `mixed` $id Sets the ID
`public string` | # `getId( )` #### Returns `string` Returns the ID
`public` | # `setExpires( mixed $expires )` #### Parameters $expires `mixed` $expires Set the expiry timestamp
`public string` | # `getExpires( )` #### Returns `string` Get the expiry timestamp
`public boolean` | # `hasExpired( )` #### Returns `boolean` Check whether this token has expired (i.e. still valid or not)

Methods inherited from OpenCloud\Common\Resource\PersistentResource
`checkExtension(), create(), createJson(), delete(), getAlias(), noCreate(), noDelete(), noUpdate(), refresh(), refreshFromLocationUrl(), update(), updateJson(), waitFor()`

Methods inherited from OpenCloud\Common\Resource\BaseResource
`__construct(), findLink(), getClient(), getMetadata(), getParent(), getService(), getUrl(), jsonCollectionElement(), jsonCollectionName(), jsonName(), parseResponse(), primaryKeyField(), resourceName(), setMetadata(), setParent(), setService()`

Methods inherited from OpenCloud\Common\Base
`__call(), checkJsonError(), generateUuid(), getInstance(), getJsonHeader(), getLogger(), getProperty(), makeResourceIteratorOptions(), populate(), propertyExists(), setLogger(), setProperty(), stripNamespace(), toCamel(), toUnderscores()`

Properties summary
`protected static string` | $url_resource | `'tokens'` | #

Properties inherited from OpenCloud\Common\Resource\BaseResource
`$metadata, $parent, $service`

Properties inherited from OpenCloud\Common\Base
`$aliases`