Class: Google::Apis::TaskqueueV1beta2::Task

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/taskqueue_v1beta2/classes.rb,
generated/google/apis/taskqueue_v1beta2/representations.rb,
generated/google/apis/taskqueue_v1beta2/representations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Task

Returns a new instance of Task.



71
72
73
# File 'generated/google/apis/taskqueue_v1beta2/classes.rb', line 71

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#enqueue_timestampString

Time (in seconds since the epoch) at which the task was enqueued. Corresponds to the JSON property enqueueTimestamp

Returns:

  • (String)


32
33
34
# File 'generated/google/apis/taskqueue_v1beta2/classes.rb', line 32

def enqueue_timestamp
  @enqueue_timestamp
end

#idString

Name of the task. Corresponds to the JSON property id

Returns:

  • (String)


37
38
39
# File 'generated/google/apis/taskqueue_v1beta2/classes.rb', line 37

def id
  @id
end

#kindString

The kind of object returned, in this case set to task. Corresponds to the JSON property kind

Returns:

  • (String)


42
43
44
# File 'generated/google/apis/taskqueue_v1beta2/classes.rb', line 42

def kind
  @kind
end

#lease_timestampString

Time (in seconds since the epoch) at which the task lease will expire. This value is 0 if the task isnt currently leased out to a worker. Corresponds to the JSON property leaseTimestamp

Returns:

  • (String)


48
49
50
# File 'generated/google/apis/taskqueue_v1beta2/classes.rb', line 48

def lease_timestamp
  @lease_timestamp
end

#payload_base64String

A bag of bytes which is the task payload. The payload on the JSON side is always Base64 encoded. Corresponds to the JSON property payloadBase64

Returns:

  • (String)


54
55
56
# File 'generated/google/apis/taskqueue_v1beta2/classes.rb', line 54

def payload_base64
  @payload_base64
end

#queue_nameString

Name of the queue that the task is in. Corresponds to the JSON property queueName

Returns:

  • (String)


59
60
61
# File 'generated/google/apis/taskqueue_v1beta2/classes.rb', line 59

def queue_name
  @queue_name
end

#retry_countFixnum

The number of leases applied to this task. Corresponds to the JSON property retry_count

Returns:

  • (Fixnum)


64
65
66
# File 'generated/google/apis/taskqueue_v1beta2/classes.rb', line 64

def retry_count
  @retry_count
end

#tagString

Tag for the task, could be used later to lease tasks grouped by a specific tag. Corresponds to the JSON property tag

Returns:

  • (String)


69
70
71
# File 'generated/google/apis/taskqueue_v1beta2/classes.rb', line 69

def tag
  @tag
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



76
77
78
79
80
81
82
83
84
85
# File 'generated/google/apis/taskqueue_v1beta2/classes.rb', line 76

def update!(**args)
  @enqueue_timestamp = args[:enqueue_timestamp] if args.key?(:enqueue_timestamp)
  @id = args[:id] if args.key?(:id)
  @kind = args[:kind] if args.key?(:kind)
  @lease_timestamp = args[:lease_timestamp] if args.key?(:lease_timestamp)
  @payload_base64 = args[:payload_base64] if args.key?(:payload_base64)
  @queue_name = args[:queue_name] if args.key?(:queue_name)
  @retry_count = args[:retry_count] if args.key?(:retry_count)
  @tag = args[:tag] if args.key?(:tag)
end