<reponame>Valisback/hiring-engineers
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.


from datadog_api_client.v1.model_utils import (
    ModelNormal,
    cached_property,
    none_type,
)


def lazy_import():
    from datadog_api_client.v1.model.creator import Creator
    from datadog_api_client.v1.model.service_level_objective_query import ServiceLevelObjectiveQuery
    from datadog_api_client.v1.model.slo_threshold import SLOThreshold
    from datadog_api_client.v1.model.slo_type import SLOType

    globals()["Creator"] = Creator
    globals()["SLOThreshold"] = SLOThreshold
    globals()["SLOType"] = SLOType
    globals()["ServiceLevelObjectiveQuery"] = ServiceLevelObjectiveQuery


class ServiceLevelObjective(ModelNormal):
    """NOTE: This class is auto generated by OpenAPI Generator.
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    validations = {}

    @cached_property
    def openapi_types():
        lazy_import()
        return {
            "created_at": (int,),
            "creator": (Creator,),
            "description": (
                str,
                none_type,
            ),
            "groups": ([str],),
            "id": (str,),
            "modified_at": (int,),
            "monitor_ids": ([int],),
            "monitor_tags": ([str],),
            "name": (str,),
            "query": (ServiceLevelObjectiveQuery,),
            "tags": ([str],),
            "thresholds": ([SLOThreshold],),
            "type": (SLOType,),
        }

    attribute_map = {
        "name": "name",
        "thresholds": "thresholds",
        "type": "type",
        "created_at": "created_at",
        "creator": "creator",
        "description": "description",
        "groups": "groups",
        "id": "id",
        "modified_at": "modified_at",
        "monitor_ids": "monitor_ids",
        "monitor_tags": "monitor_tags",
        "query": "query",
        "tags": "tags",
    }

    read_only_vars = {
        "created_at",
        "id",
        "modified_at",
    }

    def __init__(self, name, thresholds, type, *args, **kwargs):
        """ServiceLevelObjective - a model defined in OpenAPI

        Args:
            name (str): The name of the service level objective object.
            thresholds ([SLOThreshold]): The thresholds (timeframes and associated targets) for this service level objective object.
            type (SLOType):

        Keyword Args:
            created_at (int): [optional] Creation timestamp (UNIX time in seconds)  Always included in service level objective responses.
            creator (Creator): [optional]
            description (str, none_type): [optional] A user-defined description of the service level objective.  Always included in service level objective responses (but may be `null`). Optional in create/update requests.
            groups ([str]): [optional] A list of (up to 20) monitor groups that narrow the scope of a monitor service level objective.  Included in service level objective responses if it is not empty. Optional in create/update requests for monitor service level objectives, but may only be used when then length of the `monitor_ids` field is one.
            id (str): [optional] A unique identifier for the service level objective object.  Always included in service level objective responses.
            modified_at (int): [optional] Modification timestamp (UNIX time in seconds)  Always included in service level objective responses.
            monitor_ids ([int]): [optional] A list of monitor ids that defines the scope of a monitor service level objective. **Required if type is `monitor`**.
            monitor_tags ([str]): [optional] The union of monitor tags for all monitors referenced by the `monitor_ids` field. Always included in service level objective responses for monitor service level objectives (but may be empty). Ignored in create/update requests. Does not affect which monitors are included in the service level objective (that is determined entirely by the `monitor_ids` field).
            query (ServiceLevelObjectiveQuery): [optional]
            tags ([str]): [optional] A list of tags associated with this service level objective. Always included in service level objective responses (but may be empty). Optional in create/update requests.
        """
        super().__init__(kwargs)

        self._check_pos_args(args)

        self.name = name
        self.thresholds = thresholds
        self.type = type

    @classmethod
    def _from_openapi_data(cls, name, thresholds, type, *args, **kwargs):
        """Helper creating a new instance from a response."""

        self = super(ServiceLevelObjective, cls)._from_openapi_data(kwargs)

        self._check_pos_args(args)

        self.name = name
        self.thresholds = thresholds
        self.type = type
        return self
