Class: TaskModel

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/task_model_types.rb

Overview

TaskModel: A structure holding the generic task details.

taskDetail:

A friendly description of the task, usally used to communicate information to users.

subTaskModel:

A generic byte object for the Task developer to store internal serialized data into registry catalogs.

Constant Summary collapse

TASKID =
1
TASKTYPE =
2
PARENTPROCESSID =
3
CREATIONTIME =
4
LASTUPDATETIME =
5
TASKSTATUSES =
6
TASKDETAIL =
7
SUBTASKMODEL =
8
TASKERRORS =
9
JOBS =
10
MAXRETRY =
11
CURRENTRETRY =
12
FIELDS =
{
  TASKID => {:type => ::Thrift::Types::STRING, :name => 'taskId', :default => %q"DO_NOT_SET_AT_CLIENTS"},
  TASKTYPE => {:type => ::Thrift::Types::I32, :name => 'taskType', :enum_class => ::TaskTypes},
  PARENTPROCESSID => {:type => ::Thrift::Types::STRING, :name => 'parentProcessId'},
  CREATIONTIME => {:type => ::Thrift::Types::I64, :name => 'creationTime'},
  LASTUPDATETIME => {:type => ::Thrift::Types::I64, :name => 'lastUpdateTime'},
  TASKSTATUSES => {:type => ::Thrift::Types::LIST, :name => 'taskStatuses', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TaskStatus}},
  TASKDETAIL => {:type => ::Thrift::Types::STRING, :name => 'taskDetail', :optional => true},
  SUBTASKMODEL => {:type => ::Thrift::Types::STRING, :name => 'subTaskModel', :binary => true, :optional => true},
  TASKERRORS => {:type => ::Thrift::Types::LIST, :name => 'taskErrors', :element => {:type => ::Thrift::Types::STRUCT, :class => ::ErrorModel}, :optional => true},
  JOBS => {:type => ::Thrift::Types::LIST, :name => 'jobs', :element => {:type => ::Thrift::Types::STRUCT, :class => ::JobModel}, :optional => true},
  MAXRETRY => {:type => ::Thrift::Types::I32, :name => 'maxRetry', :optional => true},
  CURRENTRETRY => {:type => ::Thrift::Types::I32, :name => 'currentRetry', :optional => true}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



72
# File 'lib/task_model_types.rb', line 72

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (::Thrift::ProtocolException)


74
75
76
77
78
79
80
81
82
83
84
# File 'lib/task_model_types.rb', line 74

def validate
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field taskId is unset!') unless @taskId
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field taskType is unset!') unless @taskType
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field parentProcessId is unset!') unless @parentProcessId
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field creationTime is unset!') unless @creationTime
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field lastUpdateTime is unset!') unless @lastUpdateTime
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field taskStatuses is unset!') unless @taskStatuses
  unless @taskType.nil? || ::TaskTypes::VALID_VALUES.include?(@taskType)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field taskType!')
  end
end