# coding: utf-8
# Copyright (c) 2016, 2026, Oracle and/or its affiliates.  All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.

# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20251031

from .batch_task import BatchTask
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel  # noqa: F401
from oci.decorators import init_model_state_from_kwargs


@init_model_state_from_kwargs
class GroupTask(BatchTask):
    """
    Group task is a construct that represents a container of tasks for execution.
    """

    def __init__(self, **kwargs):
        """
        Initializes a new GroupTask object with values from keyword arguments. The default value of the :py:attr:`~oci.batch.models.GroupTask.type` attribute
        of this class is ``GROUP`` and it should not be changed.
        The following keyword arguments are supported (corresponding to the getters/setters of this class):

        :param id:
            The value to assign to the id property of this GroupTask.
        :type id: str

        :param name:
            The value to assign to the name property of this GroupTask.
        :type name: str

        :param hierarchical_name:
            The value to assign to the hierarchical_name property of this GroupTask.
        :type hierarchical_name: str

        :param group_task_name:
            The value to assign to the group_task_name property of this GroupTask.
        :type group_task_name: str

        :param description:
            The value to assign to the description property of this GroupTask.
        :type description: str

        :param type:
            The value to assign to the type property of this GroupTask.
            Allowed values for this property are: "COMPUTE", "GROUP"
        :type type: str

        :param lifecycle_state:
            The value to assign to the lifecycle_state property of this GroupTask.
            Allowed values for this property are: "ACCEPTED", "WAITING", "IN_PROGRESS", "SUCCEEDED", "FAILED", "CANCELING", "CANCELED"
        :type lifecycle_state: str

        :param lifecycle_details:
            The value to assign to the lifecycle_details property of this GroupTask.
        :type lifecycle_details: str

        :param entitlement_claims:
            The value to assign to the entitlement_claims property of this GroupTask.
        :type entitlement_claims: list[str]

        :param dependencies:
            The value to assign to the dependencies property of this GroupTask.
        :type dependencies: list[str]

        :param environment_variables:
            The value to assign to the environment_variables property of this GroupTask.
        :type environment_variables: list[oci.batch.models.EnvironmentVariable]

        :param tasks:
            The value to assign to the tasks property of this GroupTask.
        :type tasks: list[str]

        """
        self.swagger_types = {
            'id': 'str',
            'name': 'str',
            'hierarchical_name': 'str',
            'group_task_name': 'str',
            'description': 'str',
            'type': 'str',
            'lifecycle_state': 'str',
            'lifecycle_details': 'str',
            'entitlement_claims': 'list[str]',
            'dependencies': 'list[str]',
            'environment_variables': 'list[EnvironmentVariable]',
            'tasks': 'list[str]'
        }
        self.attribute_map = {
            'id': 'id',
            'name': 'name',
            'hierarchical_name': 'hierarchicalName',
            'group_task_name': 'groupTaskName',
            'description': 'description',
            'type': 'type',
            'lifecycle_state': 'lifecycleState',
            'lifecycle_details': 'lifecycleDetails',
            'entitlement_claims': 'entitlementClaims',
            'dependencies': 'dependencies',
            'environment_variables': 'environmentVariables',
            'tasks': 'tasks'
        }
        self._id = None
        self._name = None
        self._hierarchical_name = None
        self._group_task_name = None
        self._description = None
        self._type = None
        self._lifecycle_state = None
        self._lifecycle_details = None
        self._entitlement_claims = None
        self._dependencies = None
        self._environment_variables = None
        self._tasks = None
        self._type = 'GROUP'

    @property
    def tasks(self):
        """
        Gets the tasks of this GroupTask.
        The names of tasks contained directly (non-recursively) within this group task.


        :return: The tasks of this GroupTask.
        :rtype: list[str]
        """
        return self._tasks

    @tasks.setter
    def tasks(self, tasks):
        """
        Sets the tasks of this GroupTask.
        The names of tasks contained directly (non-recursively) within this group task.


        :param tasks: The tasks of this GroupTask.
        :type: list[str]
        """
        self._tasks = tasks

    def __repr__(self):
        return formatted_flat_dict(self)

    def __eq__(self, other):
        if other is None:
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not self == other
