Sha256: ef376fd6383a8894836f89b813182d5b4c0e18803afb75275b65d5c08c85637d

Contents?: true

Size: 955 Bytes

Versions: 11

Compression:

Stored size: 955 Bytes

Contents

require_relative 'gen/jobs_base'

module Asana
  module Resources
    # A _job_ represents a process that handles asynchronous work.
    #
    # Jobs are created when an endpoint requests an action that will be handled asynchronously.
    # Such as project or task duplication.
    class Job < JobsBase


      attr_reader :gid

      attr_reader :resource_type

      attr_reader :resource_subtype

      attr_reader :status

      attr_reader :new_project

      attr_reader :new_task

      class << self
        # Returns the plural name of the resource.
        def plural_name
          'jobs'
        end

        # Returns the complete job record for a single job.
        #
        # id - [Gid] The job to get.
        # options - [Hash] the request I/O options.
        def find_by_id(client, id, options: {})

          self.new(parse(client.get("/jobs/#{id}", options: options)).first, client: client)
        end
      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
asana-2.0.3 lib/asana/resources/job.rb
asana-2.0.2 lib/asana/resources/job.rb
asana-2.0.1 lib/asana/resources/job.rb
asana-2.0.0 lib/asana/resources/job.rb
asana-1.0.0 lib/asana/resources/job.rb
asana-0.10.13 lib/asana/resources/job.rb
asana-0.10.12 lib/asana/resources/job.rb
asana-0.10.3 lib/asana/resources/job.rb
asana-0.10.2 lib/asana/resources/job.rb
asana-0.10.1 lib/asana/resources/job.rb
asana-0.10.0 lib/asana/resources/job.rb