Class: Trello::Token

Inherits:
BasicData show all
Defined in:
lib/trello/token.rb

Instance Attribute Summary collapse

Attributes inherited from BasicData

#client

Class Method Summary collapse

Methods inherited from BasicData

#==, #attributes, client, #collection_name, #collection_path, create, #element_name, #element_path, #hash, #initialize, many, one, parse, parse_many, path_name, #refresh!, register_attrs, #save, save, schema, #schema, #update!, #update_fields

Methods included from JsonUtils

included

Constructor Details

This class inherits a constructor from Trello::BasicData

Instance Attribute Details

#created_atDatetime (readonly)

Returns:

  • (Datetime)


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/trello/token.rb', line 17

class Token < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :identifier, readonly: true
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :created_at, readonly: true, remote_key: 'dateCreated', serializer: 'Time'
    attribute :expires_at, readonly: true, remote_key: 'dateExpires', serializer: 'Time'
    attribute :permissions, readonly: true
    attribute :webhooks, readonly: true, default: [], serializer: 'Webhooks'
  end

  class << self
    # Finds a token
    def find(token, params = {webhooks: true})
      client.find(:token, token, params)
    end
  end

  # Returns a reference to the user who authorized the token.
  one :member, path: :members, using: :member_id
end

#expires_atDatetime (readonly)

Returns:

  • (Datetime)


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/trello/token.rb', line 17

class Token < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :identifier, readonly: true
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :created_at, readonly: true, remote_key: 'dateCreated', serializer: 'Time'
    attribute :expires_at, readonly: true, remote_key: 'dateExpires', serializer: 'Time'
    attribute :permissions, readonly: true
    attribute :webhooks, readonly: true, default: [], serializer: 'Webhooks'
  end

  class << self
    # Finds a token
    def find(token, params = {webhooks: true})
      client.find(:token, token, params)
    end
  end

  # Returns a reference to the user who authorized the token.
  one :member, path: :members, using: :member_id
end

#idString (readonly)

Returns:



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/trello/token.rb', line 17

class Token < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :identifier, readonly: true
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :created_at, readonly: true, remote_key: 'dateCreated', serializer: 'Time'
    attribute :expires_at, readonly: true, remote_key: 'dateExpires', serializer: 'Time'
    attribute :permissions, readonly: true
    attribute :webhooks, readonly: true, default: [], serializer: 'Webhooks'
  end

  class << self
    # Finds a token
    def find(token, params = {webhooks: true})
      client.find(:token, token, params)
    end
  end

  # Returns a reference to the user who authorized the token.
  one :member, path: :members, using: :member_id
end

#identifierString (readonly)

Returns:



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/trello/token.rb', line 17

class Token < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :identifier, readonly: true
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :created_at, readonly: true, remote_key: 'dateCreated', serializer: 'Time'
    attribute :expires_at, readonly: true, remote_key: 'dateExpires', serializer: 'Time'
    attribute :permissions, readonly: true
    attribute :webhooks, readonly: true, default: [], serializer: 'Webhooks'
  end

  class << self
    # Finds a token
    def find(token, params = {webhooks: true})
      client.find(:token, token, params)
    end
  end

  # Returns a reference to the user who authorized the token.
  one :member, path: :members, using: :member_id
end

#member_idString (readonly)

Returns:



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/trello/token.rb', line 17

class Token < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :identifier, readonly: true
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :created_at, readonly: true, remote_key: 'dateCreated', serializer: 'Time'
    attribute :expires_at, readonly: true, remote_key: 'dateExpires', serializer: 'Time'
    attribute :permissions, readonly: true
    attribute :webhooks, readonly: true, default: [], serializer: 'Webhooks'
  end

  class << self
    # Finds a token
    def find(token, params = {webhooks: true})
      client.find(:token, token, params)
    end
  end

  # Returns a reference to the user who authorized the token.
  one :member, path: :members, using: :member_id
end

#permissionsObject (readonly)

Returns:

  • (Object)


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/trello/token.rb', line 17

class Token < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :identifier, readonly: true
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :created_at, readonly: true, remote_key: 'dateCreated', serializer: 'Time'
    attribute :expires_at, readonly: true, remote_key: 'dateExpires', serializer: 'Time'
    attribute :permissions, readonly: true
    attribute :webhooks, readonly: true, default: [], serializer: 'Webhooks'
  end

  class << self
    # Finds a token
    def find(token, params = {webhooks: true})
      client.find(:token, token, params)
    end
  end

  # Returns a reference to the user who authorized the token.
  one :member, path: :members, using: :member_id
end

#webhooksObject (readonly)

Returns:

  • (Object)


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/trello/token.rb', line 17

class Token < BasicData

  schema do
    # Readonly
    attribute :id, readonly: true, primary_key: true
    attribute :identifier, readonly: true
    attribute :member_id, readonly: true, remote_key: 'idMember'
    attribute :created_at, readonly: true, remote_key: 'dateCreated', serializer: 'Time'
    attribute :expires_at, readonly: true, remote_key: 'dateExpires', serializer: 'Time'
    attribute :permissions, readonly: true
    attribute :webhooks, readonly: true, default: [], serializer: 'Webhooks'
  end

  class << self
    # Finds a token
    def find(token, params = {webhooks: true})
      client.find(:token, token, params)
    end
  end

  # Returns a reference to the user who authorized the token.
  one :member, path: :members, using: :member_id
end

Class Method Details

.find(token, params = {webhooks: true}) ⇒ Object

Finds a token



32
33
34
# File 'lib/trello/token.rb', line 32

def find(token, params = {webhooks: true})
  client.find(:token, token, params)
end