% DefaultProperties - defaults for new Job/Task objects

% Copyright 2011-2021 The MathWorks, Inc.

classdef ( Sealed, Hidden ) DefaultProperties

    methods ( Static )
        function str = getNewJobPropStruct()
            str = struct( ...
                'AdditionalPaths'      , {{}}, ...
                'ApiTag'               , '', ...
                'AttachedFileData'     , int8([]), ...
                'AttachedFilePaths'    , [], ...
                'AttachedFiles'        , {{}}, ...
                'AutoAttachFiles'      , true, ...
                'AutoAddClientPath'    , false, ...
                'CreateDateTime'       , datetime('now', 'TimeZone', 'local'), ...
                'CreateTime'           , '', ... % Derived from CreateDateTime
                'DependentFiles'       , {{}}, ...
                'EnvironmentVariables' , {{}}, ...
                'ExecutionMode'        , 0, ...
                'FinishDateTime'       , datetime.empty(), ...
                'FinishTime'           , '', ...
                'IsSubmitted'          , false, ...
                'JobData'              , [], ...
                'MATLABDrivePathMap'   , [], ...
                'Name'                 , '', ... % Typically set outside
                'NumPathsToAppend'     , 0, ...
                'NumThreads'           , [], ...
                'ProductKeys'          , uint8([]), ...
                'StartDateTime'        , datetime.empty(), ...
                'StartTime'            , '', ...
                'StateEnum'            , parallel.internal.types.States.Pending, ...
                'SubmitDateTime'       , datetime.empty(), ...
                'SubmitTime'           , '', ...
                'Tag'                  , '', ...
                'Username'             , distcomp.pGetDefaultUsername() );
            % NB: No 'Version' here because not used by MJS.
        end

        function str = getNewTaskPropStruct()
            str = struct( ...
                'CaptureDiary'         , false, ...
                'CreateDateTime'       , datetime('now', 'TimeZone', 'local'), ...
                'CreateTime'           , '', ... % Derived from CreateDateTime
                'DependentFiles'       , {{}}, ...
                'DiagnosticWarnings'   , matlab.internal.diagnostic.Warning.empty(0, 1), ...
                'Diary'                , '', ...
                'Error'                , ParallelException.empty(), ...
                'ErrorIdentifier'      , '', ...
                'ErrorMessage'         , '', ...
                'FinishDateTime'       , datetime.empty(), ...
                'FinishTime'           , '', ...
                'Function'             , @(x) x, ...
                'InputArguments'       , {cell( 1, 0 )}, ...
                'Name'                 , '', ... % Typically set outside
                'NumOutputArguments'   , 1, ...
                'OutputArguments'      , {cell( 1, 0 )}, ...
                'StartDateTime'        , datetime.empty(), ...
                'StartTime'            , '', ...
                'StateEnum'            , parallel.internal.types.States.Pending, ...
                'Worker'               , [] );
        end
    end

end
