from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass, field
from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter
from typing import Any, Optional, TYPE_CHECKING, Union
from uuid import UUID

@dataclass
class StatusStepSetsPostResponse_values(Parsable):
    # An immutable string assigned to a status on its creation, typically created by incorporating thestatus's label into a larger string that is guaranteed to be unique within a project. The bucket nameremains the same for the life of the status, and doesn't change even if the label does. The bucket valueis a useful tool for semantic identification.
    bucket: Optional[str] = None
    # The color of the status as the status appears in the Assets UI.This field is not restricted as it is primarily a tool for the Assets UI to use.However, there are only certain colors that the Autodesk Construction Cloud Assets UI knows how tooperate with. Understood color values are: ``adsk-black``, ``adsk-white``, ``adsk-charcoal-900``,``adsk-charcoal-800``, ``adsk-charcoal-700``, ``adsk-charcoal-600``, ``adsk-charcoal-500``,``adsk-charcoal-400``, ``adsk-charcoal-300``, ``adsk-charcoal-200``, ``adsk-charcoal-100``,``adsk-charcoal-050``, ``adsk-blue-700``, ``adsk-blue-500``, ``adsk-blue-300``, ``adsk-blue-100``,``adsk-red-700``, ``adsk-red-500``, ``adsk-red-300``, ``adsk-green-700``, ``adsk-green-500``,``adsk-green-300``, ``adsk-yellow-orange-700``, ``adsk-yellow-orange-500``, ``adsk-yellow-orange-300``,``adsk-dark-blue-700``, ``adsk-dark-blue-500``, ``adsk-dark-blue-300``, ``adsk-pink-700``,``adsk-pink-500``, ``adsk-pink-300``, ``adsk-turquoise-700``, ``adsk-turquoise-500``,``adsk-turquoise-300``, ``adsk-purple-700``, ``adsk-purple-500``, ``adsk-purple-300``,``adsk-salmon-700``, ``adsk-salmon-500``, ``adsk-salmon-300``, ``adsk-brown-700``, ``adsk-brown-500``,``adsk-brown-300``.Using colors other than those specified here is not disallowed, but may result in unexpected behavior inthe Assets UI.
    color: Optional[str] = None
    # The time when the component was created (ISO8601 Date time format in UTC).
    created_at: Optional[str] = None
    # The actor that created the component. This is an Autodesk / Oxygen ID.
    created_by: Optional[str] = None
    # The time when the component was deleted at (ISO8601 Date time format in UTC).
    deleted_at: Optional[str] = None
    # The actor that deleted the component. This is an Autodesk / Oxygen ID.
    deleted_by: Optional[str] = None
    # A description of the status.
    description: Optional[str] = None
    # The ID of the component.
    id: Optional[str] = None
    # A flag indicating whether the component is active or inactive (``isActive`` is ``true`` if-and-only-if ``deletedAt`` is empty).
    is_active: Optional[bool] = None
    # The display label of the status. This label appears in the Assets UI when viewing statuses. The label mustbe unique within this status set, but does not need to be unique within the project (in other words, thesame label can be used in multiple status sets in the same project). ``Uniqueness`` in this context meanscase-insensitive.
    label: Optional[str] = None
    # The Autodesk Construction Cloud project ID. Must be a UUID or a project ID of the form ``b.{UUID}``.
    project_id: Optional[UUID] = None
    # A value that indicates the order of a status within its status set. Each status in the set has a sortorder value that indicates its order relative to other statuses in the set. A status set's sort ordervalues don't necessarily start at 1, and may not be sequential. The only way to know a status's orderwithin a set is to compare its sort order value with the sort order values of other statuses.
    sort_order: Optional[int] = None
    # The ID of the status set to which the new status belongs.
    status_step_set_id: Optional[UUID] = None
    # The time when the component was last updated (ISO8601 Date time format in UTC).
    updated_at: Optional[str] = None
    # The actor that last updated the component. This is an Autodesk / Oxygen ID.
    updated_by: Optional[str] = None
    # A global sequence number that is incremented any time a component of this type is created, updated, or deleted. If you cache components, you can use the version value to compare the cached component to the same component online to see if the component has been updated. If the online component has a higher version value, it has been updated.
    version: Optional[int] = None
    
    @staticmethod
    def create_from_discriminator_value(parse_node: ParseNode) -> StatusStepSetsPostResponse_values:
        """
        Creates a new instance of the appropriate class based on discriminator value
        param parse_node: The parse node to use to read the discriminator value and create the object
        Returns: StatusStepSetsPostResponse_values
        """
        if parse_node is None:
            raise TypeError("parse_node cannot be null.")
        return StatusStepSetsPostResponse_values()
    
    def get_field_deserializers(self,) -> dict[str, Callable[[ParseNode], None]]:
        """
        The deserialization information for the current model
        Returns: dict[str, Callable[[ParseNode], None]]
        """
        fields: dict[str, Callable[[Any], None]] = {
            "bucket": lambda n : setattr(self, 'bucket', n.get_str_value()),
            "color": lambda n : setattr(self, 'color', n.get_str_value()),
            "createdAt": lambda n : setattr(self, 'created_at', n.get_str_value()),
            "createdBy": lambda n : setattr(self, 'created_by', n.get_str_value()),
            "deletedAt": lambda n : setattr(self, 'deleted_at', n.get_str_value()),
            "deletedBy": lambda n : setattr(self, 'deleted_by', n.get_str_value()),
            "description": lambda n : setattr(self, 'description', n.get_str_value()),
            "id": lambda n : setattr(self, 'id', n.get_str_value()),
            "isActive": lambda n : setattr(self, 'is_active', n.get_bool_value()),
            "label": lambda n : setattr(self, 'label', n.get_str_value()),
            "projectId": lambda n : setattr(self, 'project_id', n.get_uuid_value()),
            "sortOrder": lambda n : setattr(self, 'sort_order', n.get_int_value()),
            "statusStepSetId": lambda n : setattr(self, 'status_step_set_id', n.get_uuid_value()),
            "updatedAt": lambda n : setattr(self, 'updated_at', n.get_str_value()),
            "updatedBy": lambda n : setattr(self, 'updated_by', n.get_str_value()),
            "version": lambda n : setattr(self, 'version', n.get_int_value()),
        }
        return fields
    
    def serialize(self,writer: SerializationWriter) -> None:
        """
        Serializes information the current object
        param writer: Serialization writer to use to serialize this model
        Returns: None
        """
        if writer is None:
            raise TypeError("writer cannot be null.")
        writer.write_str_value("bucket", self.bucket)
        writer.write_str_value("color", self.color)
        writer.write_str_value("createdAt", self.created_at)
        writer.write_str_value("createdBy", self.created_by)
        writer.write_str_value("deletedAt", self.deleted_at)
        writer.write_str_value("deletedBy", self.deleted_by)
        writer.write_str_value("description", self.description)
        writer.write_str_value("id", self.id)
        writer.write_bool_value("isActive", self.is_active)
        writer.write_str_value("label", self.label)
        writer.write_uuid_value("projectId", self.project_id)
        writer.write_int_value("sortOrder", self.sort_order)
        writer.write_uuid_value("statusStepSetId", self.status_step_set_id)
        writer.write_str_value("updatedAt", self.updated_at)
        writer.write_str_value("updatedBy", self.updated_by)
        writer.write_int_value("version", self.version)
    

