Class: Contentful::Management::PersonalAccessToken

Inherits:
Object
  • Object
show all
Includes:
Resource, Resource::Refresher, Resource::SystemProperties
Defined in:
lib/contentful/management/personal_access_token.rb

Overview

Resource class for PersonalAccessToken.

See Also:

  • https://www.contentful.com/developers/docs/references/content-management-api/#/reference/personal-access-tokens

Instance Attribute Summary

Attributes included from Resource::SystemProperties

#sys

Attributes included from Resource

#client, #properties, #raw_object, #request

Instance Method Summary collapse

Methods included from Resource::Refresher

#reload

Methods included from Resource

#array?, #default_locale, #environment_id, #fields, #nested_locale_fields?, #resource?, #save, #sys, #update

Instance Method Details

#destroyObject

Not supported



33
34
35
# File 'lib/contentful/management/personal_access_token.rb', line 33

def destroy
  fail 'Not supported'
end

#revokeObject

Revokes the personal access token.



38
39
40
41
42
43
44
# File 'lib/contentful/management/personal_access_token.rb', line 38

def revoke
  ResourceRequester.new(client, self.class).update(
    self,
    resource_id: id,
    suffix: '/revoked'
  )
end