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