|
| 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 | +from datadog_api_client.v1.model_utils import ( # noqa: F401 |
| 10 | + ApiTypeError, |
| 11 | + ModelComposed, |
| 12 | + ModelNormal, |
| 13 | + ModelSimple, |
| 14 | + cached_property, |
| 15 | + change_keys_js_to_python, |
| 16 | + convert_js_args_to_python_args, |
| 17 | + date, |
| 18 | + datetime, |
| 19 | + file_type, |
| 20 | + none_type, |
| 21 | + validate_get_composed_info, |
| 22 | +) |
| 23 | + |
| 24 | + |
| 25 | +class Pagination(ModelNormal): |
| 26 | + """NOTE: This class is auto generated by OpenAPI Generator. |
| 27 | + Ref: https://openapi-generator.tech |
| 28 | +
|
| 29 | + Do not edit the class manually. |
| 30 | +
|
| 31 | + Attributes: |
| 32 | + allowed_values (dict): The key is the tuple path to the attribute |
| 33 | + and the for var_name this is (var_name,). The value is a dict |
| 34 | + with a capitalized key describing the allowed value and an allowed |
| 35 | + value. These dicts store the allowed enum values. |
| 36 | + attribute_map (dict): The key is attribute name |
| 37 | + and the value is json key in definition. |
| 38 | + discriminator_value_class_map (dict): A dict to go from the discriminator |
| 39 | + variable value to the discriminator class name. |
| 40 | + validations (dict): The key is the tuple path to the attribute |
| 41 | + and the for var_name this is (var_name,). The value is a dict |
| 42 | + that stores validations for max_length, min_length, max_items, |
| 43 | + min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum, |
| 44 | + inclusive_minimum, and regex. |
| 45 | + additional_properties_type (tuple): A tuple of classes accepted |
| 46 | + as additional properties values. |
| 47 | + """ |
| 48 | + |
| 49 | + allowed_values = {} |
| 50 | + |
| 51 | + validations = {} |
| 52 | + |
| 53 | + additional_properties_type = None |
| 54 | + |
| 55 | + _nullable = False |
| 56 | + |
| 57 | + @cached_property |
| 58 | + def openapi_types(): |
| 59 | + """ |
| 60 | + This must be a method because a model may have properties that are |
| 61 | + of type self, this must run after the class is loaded |
| 62 | +
|
| 63 | + Returns |
| 64 | + openapi_types (dict): The key is attribute name |
| 65 | + and the value is attribute type. |
| 66 | + """ |
| 67 | + return { |
| 68 | + "total_count": (int,), # noqa: E501 |
| 69 | + "total_filtered_count": (int,), # noqa: E501 |
| 70 | + } |
| 71 | + |
| 72 | + @cached_property |
| 73 | + def discriminator(): |
| 74 | + return None |
| 75 | + |
| 76 | + attribute_map = { |
| 77 | + "total_count": "total_count", # noqa: E501 |
| 78 | + "total_filtered_count": "total_filtered_count", # noqa: E501 |
| 79 | + } |
| 80 | + |
| 81 | + _composed_schemas = {} |
| 82 | + |
| 83 | + required_properties = set( |
| 84 | + [ |
| 85 | + "_data_store", |
| 86 | + "_check_type", |
| 87 | + "_spec_property_naming", |
| 88 | + "_path_to_item", |
| 89 | + "_configuration", |
| 90 | + "_visited_composed_classes", |
| 91 | + ] |
| 92 | + ) |
| 93 | + |
| 94 | + @convert_js_args_to_python_args |
| 95 | + def __init__(self, *args, **kwargs): # noqa: E501 |
| 96 | + """Pagination - a model defined in OpenAPI |
| 97 | +
|
| 98 | + Keyword Args: |
| 99 | + _check_type (bool): if True, values for parameters in openapi_types |
| 100 | + will be type checked and a TypeError will be |
| 101 | + raised if the wrong type is input. |
| 102 | + Defaults to True |
| 103 | + _path_to_item (tuple/list): This is a list of keys or values to |
| 104 | + drill down to the model in received_data |
| 105 | + when deserializing a response |
| 106 | + _spec_property_naming (bool): True if the variable names in the input data |
| 107 | + are serialized names, as specified in the OpenAPI document. |
| 108 | + False if the variable names in the input data |
| 109 | + are pythonic names, e.g. snake case (default) |
| 110 | + _configuration (Configuration): the instance to use when |
| 111 | + deserializing a file_type parameter. |
| 112 | + If passed, type conversion is attempted |
| 113 | + If omitted no type conversion is done. |
| 114 | + _visited_composed_classes (tuple): This stores a tuple of |
| 115 | + classes that we have traveled through so that |
| 116 | + if we see that class again we will not use its |
| 117 | + discriminator again. |
| 118 | + When traveling through a discriminator, the |
| 119 | + composed schema that is |
| 120 | + is traveled through is added to this set. |
| 121 | + For example if Animal has a discriminator |
| 122 | + petType and we pass in "Dog", and the class Dog |
| 123 | + allOf includes Animal, we move through Animal |
| 124 | + once using the discriminator, and pick Dog. |
| 125 | + Then in Dog, we will make an instance of the |
| 126 | + Animal class but this time we won't travel |
| 127 | + through its discriminator because we passed in |
| 128 | + _visited_composed_classes = (Animal,) |
| 129 | + total_count (int): Total count.. [optional] # noqa: E501 |
| 130 | + total_filtered_count (int): Total count of elements matched by the filter.. [optional] # noqa: E501 |
| 131 | + """ |
| 132 | + |
| 133 | + _check_type = kwargs.pop("_check_type", True) |
| 134 | + _spec_property_naming = kwargs.pop("_spec_property_naming", False) |
| 135 | + _path_to_item = kwargs.pop("_path_to_item", ()) |
| 136 | + _configuration = kwargs.pop("_configuration", None) |
| 137 | + _visited_composed_classes = kwargs.pop("_visited_composed_classes", ()) |
| 138 | + |
| 139 | + if args: |
| 140 | + raise ApiTypeError( |
| 141 | + "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." |
| 142 | + % ( |
| 143 | + args, |
| 144 | + self.__class__.__name__, |
| 145 | + ), |
| 146 | + path_to_item=_path_to_item, |
| 147 | + valid_classes=(self.__class__,), |
| 148 | + ) |
| 149 | + |
| 150 | + self._data_store = {} |
| 151 | + self._check_type = _check_type |
| 152 | + self._spec_property_naming = _spec_property_naming |
| 153 | + self._path_to_item = _path_to_item |
| 154 | + self._configuration = _configuration |
| 155 | + self._visited_composed_classes = _visited_composed_classes + (self.__class__,) |
| 156 | + |
| 157 | + for var_name, var_value in kwargs.items(): |
| 158 | + if ( |
| 159 | + var_name not in self.attribute_map |
| 160 | + and self._configuration is not None |
| 161 | + and self._configuration.discard_unknown_keys |
| 162 | + and self.additional_properties_type is None |
| 163 | + ): |
| 164 | + # discard variable. |
| 165 | + continue |
| 166 | + setattr(self, var_name, var_value) |
0 commit comments