|
| 1 | +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. |
| 2 | +# This product includes software developed at Datadog (https://www.datadoghq.com/). |
| 3 | +# Copyright 2019-Present Datadog, Inc. |
| 4 | + |
| 5 | + |
| 6 | +import re # noqa: F401 |
| 7 | +import sys # noqa: F401 |
| 8 | + |
| 9 | +import nulltype # noqa: F401 |
| 10 | + |
| 11 | +from datadog_api_client.v1.model_utils import ( # noqa: F401 |
| 12 | + ApiTypeError, |
| 13 | + ModelComposed, |
| 14 | + ModelNormal, |
| 15 | + ModelSimple, |
| 16 | + cached_property, |
| 17 | + change_keys_js_to_python, |
| 18 | + convert_js_args_to_python_args, |
| 19 | + date, |
| 20 | + datetime, |
| 21 | + file_type, |
| 22 | + none_type, |
| 23 | + validate_get_composed_info, |
| 24 | +) |
| 25 | + |
| 26 | + |
| 27 | +class SLOHistoryMetricsSeriesMetadataUnit(ModelSimple): |
| 28 | + """NOTE: This class is auto generated by OpenAPI Generator. |
| 29 | + Ref: https://openapi-generator.tech |
| 30 | +
|
| 31 | + Do not edit the class manually. |
| 32 | +
|
| 33 | + Attributes: |
| 34 | + allowed_values (dict): The key is the tuple path to the attribute |
| 35 | + and the for var_name this is (var_name,). The value is a dict |
| 36 | + with a capitalized key describing the allowed value and an allowed |
| 37 | + value. These dicts store the allowed enum values. |
| 38 | + validations (dict): The key is the tuple path to the attribute |
| 39 | + and the for var_name this is (var_name,). The value is a dict |
| 40 | + that stores validations for max_length, min_length, max_items, |
| 41 | + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, |
| 42 | + inclusive_minimum, and regex. |
| 43 | + additional_properties_type (tuple): A tuple of classes accepted |
| 44 | + as additional properties values. |
| 45 | + """ |
| 46 | + |
| 47 | + allowed_values = {} |
| 48 | + |
| 49 | + validations = {} |
| 50 | + |
| 51 | + additional_properties_type = None |
| 52 | + |
| 53 | + _nullable = False |
| 54 | + |
| 55 | + @cached_property |
| 56 | + def openapi_types(): |
| 57 | + """ |
| 58 | + This must be a method because a model may have properties that are |
| 59 | + of type self, this must run after the class is loaded |
| 60 | +
|
| 61 | + Returns |
| 62 | + openapi_types (dict): The key is attribute name |
| 63 | + and the value is attribute type. |
| 64 | + """ |
| 65 | + return { |
| 66 | + "value": ( |
| 67 | + [{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], |
| 68 | + none_type, |
| 69 | + ), |
| 70 | + } |
| 71 | + |
| 72 | + @cached_property |
| 73 | + def discriminator(): |
| 74 | + return None |
| 75 | + |
| 76 | + attribute_map = {} |
| 77 | + |
| 78 | + _composed_schemas = None |
| 79 | + |
| 80 | + required_properties = set( |
| 81 | + [ |
| 82 | + "_data_store", |
| 83 | + "_check_type", |
| 84 | + "_spec_property_naming", |
| 85 | + "_path_to_item", |
| 86 | + "_configuration", |
| 87 | + "_visited_composed_classes", |
| 88 | + ] |
| 89 | + ) |
| 90 | + |
| 91 | + @convert_js_args_to_python_args |
| 92 | + def __init__(self, *args, **kwargs): |
| 93 | + """SLOHistoryMetricsSeriesMetadataUnit - a model defined in OpenAPI |
| 94 | +
|
| 95 | + Note that value can be passed either in args or in kwargs, but not in both. |
| 96 | +
|
| 97 | + Args: |
| 98 | + args[0] ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type): An array of metric units that contains up to two unit objects. For example, bytes represents one unit object and bytes per second represents two unit objects. If a metric query only has one unit object, the second array element is null.. # noqa: E501 |
| 99 | +
|
| 100 | + Keyword Args: |
| 101 | + value ([{str: (bool, date, datetime, dict, float, int, list, str, none_type)}], none_type): An array of metric units that contains up to two unit objects. For example, bytes represents one unit object and bytes per second represents two unit objects. If a metric query only has one unit object, the second array element is null.. # noqa: E501 |
| 102 | + _check_type (bool): if True, values for parameters in openapi_types |
| 103 | + will be type checked and a TypeError will be |
| 104 | + raised if the wrong type is input. |
| 105 | + Defaults to True |
| 106 | + _path_to_item (tuple/list): This is a list of keys or values to |
| 107 | + drill down to the model in received_data |
| 108 | + when deserializing a response |
| 109 | + _spec_property_naming (bool): True if the variable names in the input data |
| 110 | + are serialized names, as specified in the OpenAPI document. |
| 111 | + False if the variable names in the input data |
| 112 | + are pythonic names, e.g. snake case (default) |
| 113 | + _configuration (Configuration): the instance to use when |
| 114 | + deserializing a file_type parameter. |
| 115 | + If passed, type conversion is attempted |
| 116 | + If omitted no type conversion is done. |
| 117 | + _visited_composed_classes (tuple): This stores a tuple of |
| 118 | + classes that we have traveled through so that |
| 119 | + if we see that class again we will not use its |
| 120 | + discriminator again. |
| 121 | + When traveling through a discriminator, the |
| 122 | + composed schema that is |
| 123 | + is traveled through is added to this set. |
| 124 | + For example if Animal has a discriminator |
| 125 | + petType and we pass in "Dog", and the class Dog |
| 126 | + allOf includes Animal, we move through Animal |
| 127 | + once using the discriminator, and pick Dog. |
| 128 | + Then in Dog, we will make an instance of the |
| 129 | + Animal class but this time we won't travel |
| 130 | + through its discriminator because we passed in |
| 131 | + _visited_composed_classes = (Animal,) |
| 132 | + """ |
| 133 | + |
| 134 | + if "value" in kwargs: |
| 135 | + value = kwargs.pop("value") |
| 136 | + elif args: |
| 137 | + args = list(args) |
| 138 | + value = args.pop(0) |
| 139 | + else: |
| 140 | + raise ApiTypeError( |
| 141 | + "value is required, but not passed in args or kwargs and doesn't have default", |
| 142 | + path_to_item=_path_to_item, |
| 143 | + valid_classes=(self.__class__,), |
| 144 | + ) |
| 145 | + |
| 146 | + _check_type = kwargs.pop("_check_type", True) |
| 147 | + _spec_property_naming = kwargs.pop("_spec_property_naming", False) |
| 148 | + _path_to_item = kwargs.pop("_path_to_item", ()) |
| 149 | + _configuration = kwargs.pop("_configuration", None) |
| 150 | + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) |
| 151 | + |
| 152 | + if args: |
| 153 | + raise ApiTypeError( |
| 154 | + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." |
| 155 | + % ( |
| 156 | + args, |
| 157 | + self.__class__.__name__, |
| 158 | + ), |
| 159 | + path_to_item=_path_to_item, |
| 160 | + valid_classes=(self.__class__,), |
| 161 | + ) |
| 162 | + |
| 163 | + self._data_store = {} |
| 164 | + self._check_type = _check_type |
| 165 | + self._spec_property_naming = _spec_property_naming |
| 166 | + self._path_to_item = _path_to_item |
| 167 | + self._configuration = _configuration |
| 168 | + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) |
| 169 | + self.value = value |
| 170 | + if kwargs: |
| 171 | + raise ApiTypeError( |
| 172 | + "Invalid named arguments=%s passed to %s. Remove those invalid named arguments." |
| 173 | + % ( |
| 174 | + kwargs, |
| 175 | + self.__class__.__name__, |
| 176 | + ), |
| 177 | + path_to_item=_path_to_item, |
| 178 | + valid_classes=(self.__class__,), |
| 179 | + ) |
0 commit comments