Class: TheCompaniesAPI::Generated::Models::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/thecompaniesapi/generated/models/action.rb

Overview

An action tracks a request made to our job queue and its result.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ Action

Initialize a new Action

Parameters:

  • data (Hash) (defaults to: {})

    Initial data



51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/thecompaniesapi/generated/models/action.rb', line 51

def initialize(data = {})
                @attempts = data['attempts']
                @cost = data['cost']
                @created_at = data['createdAt']
                @data = data['data']
                @id = data['id']
                @list_id = data['listId']
                @prompt_id = data['promptId']
                @result = data['result']
                @status = data['status']
                @team_id = data['teamId']
                @type = data['type']
                @updated_at = data['updatedAt']
end

Instance Attribute Details

#attemptsFloat

Returns attempts.

Returns:

  • (Float)

    attempts



12
13
14
# File 'lib/thecompaniesapi/generated/models/action.rb', line 12

def attempts
  @attempts
end

#costObject

Returns cost.

Returns:

  • (Object)

    cost



15
16
17
# File 'lib/thecompaniesapi/generated/models/action.rb', line 15

def cost
  @cost
end

#created_atObject

Returns createdAt.

Returns:

  • (Object)

    createdAt



18
19
20
# File 'lib/thecompaniesapi/generated/models/action.rb', line 18

def created_at
  @created_at
end

#dataHash

Returns data.

Returns:

  • (Hash)

    data



21
22
23
# File 'lib/thecompaniesapi/generated/models/action.rb', line 21

def data
  @data
end

#idFloat

Returns id.

Returns:

  • (Float)

    id



24
25
26
# File 'lib/thecompaniesapi/generated/models/action.rb', line 24

def id
  @id
end

#list_idFloat

Returns listId.

Returns:

  • (Float)

    listId



27
28
29
# File 'lib/thecompaniesapi/generated/models/action.rb', line 27

def list_id
  @list_id
end

#prompt_idFloat

Returns promptId.

Returns:

  • (Float)

    promptId



30
31
32
# File 'lib/thecompaniesapi/generated/models/action.rb', line 30

def prompt_id
  @prompt_id
end

#resultHash

Returns result.

Returns:

  • (Hash)

    result



33
34
35
# File 'lib/thecompaniesapi/generated/models/action.rb', line 33

def result
  @result
end

#statusString

Returns status.

Returns:

  • (String)

    status



36
37
38
# File 'lib/thecompaniesapi/generated/models/action.rb', line 36

def status
  @status
end

#team_idFloat

Returns teamId.

Returns:

  • (Float)

    teamId



39
40
41
# File 'lib/thecompaniesapi/generated/models/action.rb', line 39

def team_id
  @team_id
end

#typeString

Returns type.

Returns:

  • (String)

    type



42
43
44
# File 'lib/thecompaniesapi/generated/models/action.rb', line 42

def type
  @type
end

#updated_atObject

Returns updatedAt.

Returns:

  • (Object)

    updatedAt



45
46
47
# File 'lib/thecompaniesapi/generated/models/action.rb', line 45

def updated_at
  @updated_at
end

Instance Method Details

#to_hashHash Also known as: to_h

Convert to hash

Returns:

  • (Hash)

    Hash representation



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/thecompaniesapi/generated/models/action.rb', line 70

def to_hash
  {
          'attempts' => @attempts,
          'cost' => @cost,
          'createdAt' => @created_at,
          'data' => @data,
          'id' => @id,
          'listId' => @list_id,
          'promptId' => @prompt_id,
          'result' => @result,
          'status' => @status,
          'teamId' => @team_id,
          'type' => @type,
          'updatedAt' => @updated_at,
  }
end