|
| 1 | +=begin |
| 2 | +#Datadog API V2 Collection |
| 3 | +
|
| 4 | +#Collection of all Datadog Public endpoints. |
| 5 | +
|
| 6 | +The version of the OpenAPI document: 1.0 |
| 7 | + |
| 8 | +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator |
| 9 | +
|
| 10 | + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. |
| 11 | + This product includes software developed at Datadog (https://www.datadoghq.com/). |
| 12 | + Copyright 2020-Present Datadog, Inc. |
| 13 | +
|
| 14 | +=end |
| 15 | + |
| 16 | +require 'date' |
| 17 | +require 'time' |
| 18 | + |
| 19 | +module DatadogAPIClient::V2 |
| 20 | + # Schema for API entities. |
| 21 | + class EntityV3API |
| 22 | + include BaseGenericModel |
| 23 | + |
| 24 | + # The schema version of entity type. The field is known as schema-version in the previous version. |
| 25 | + attr_reader :api_version |
| 26 | + |
| 27 | + # Datadog product integrations for the API entity. |
| 28 | + attr_accessor :datadog |
| 29 | + |
| 30 | + # Custom extensions. This is the free-formed field to send client-side metadata. No Datadog features are affected by this field. |
| 31 | + attr_accessor :extensions |
| 32 | + |
| 33 | + # A base schema for defining third-party integrations. |
| 34 | + attr_accessor :integrations |
| 35 | + |
| 36 | + # The definition of Entity V3 API Kind object. |
| 37 | + attr_reader :kind |
| 38 | + |
| 39 | + # The definition of Entity V3 Metadata object. |
| 40 | + attr_reader :metadata |
| 41 | + |
| 42 | + # The definition of Entity V3 API Spec object. |
| 43 | + attr_accessor :spec |
| 44 | + |
| 45 | + # Attribute mapping from ruby-style variable name to JSON key. |
| 46 | + # @!visibility private |
| 47 | + def self.attribute_map |
| 48 | + { |
| 49 | + :'api_version' => :'apiVersion', |
| 50 | + :'datadog' => :'datadog', |
| 51 | + :'extensions' => :'extensions', |
| 52 | + :'integrations' => :'integrations', |
| 53 | + :'kind' => :'kind', |
| 54 | + :'metadata' => :'metadata', |
| 55 | + :'spec' => :'spec' |
| 56 | + } |
| 57 | + end |
| 58 | + |
| 59 | + # Attribute type mapping. |
| 60 | + # @!visibility private |
| 61 | + def self.openapi_types |
| 62 | + { |
| 63 | + :'api_version' => :'EntityV3APIVersion', |
| 64 | + :'datadog' => :'EntityV3APIDatadog', |
| 65 | + :'extensions' => :'Hash<String, Object>', |
| 66 | + :'integrations' => :'EntityV3Integrations', |
| 67 | + :'kind' => :'EntityV3APIKind', |
| 68 | + :'metadata' => :'EntityV3Metadata', |
| 69 | + :'spec' => :'EntityV3APISpec' |
| 70 | + } |
| 71 | + end |
| 72 | + |
| 73 | + # Initializes the object |
| 74 | + # @param attributes [Hash] Model attributes in the form of hash |
| 75 | + # @!visibility private |
| 76 | + def initialize(attributes = {}) |
| 77 | + if (!attributes.is_a?(Hash)) |
| 78 | + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::EntityV3API` initialize method" |
| 79 | + end |
| 80 | + |
| 81 | + # check to see if the attribute exists and convert string to symbol for hash key |
| 82 | + attributes = attributes.each_with_object({}) { |(k, v), h| |
| 83 | + if (!self.class.attribute_map.key?(k.to_sym)) |
| 84 | + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::EntityV3API`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect |
| 85 | + end |
| 86 | + h[k.to_sym] = v |
| 87 | + } |
| 88 | + |
| 89 | + if attributes.key?(:'api_version') |
| 90 | + self.api_version = attributes[:'api_version'] |
| 91 | + end |
| 92 | + |
| 93 | + if attributes.key?(:'datadog') |
| 94 | + self.datadog = attributes[:'datadog'] |
| 95 | + end |
| 96 | + |
| 97 | + if attributes.key?(:'extensions') |
| 98 | + self.extensions = attributes[:'extensions'] |
| 99 | + end |
| 100 | + |
| 101 | + if attributes.key?(:'integrations') |
| 102 | + self.integrations = attributes[:'integrations'] |
| 103 | + end |
| 104 | + |
| 105 | + if attributes.key?(:'kind') |
| 106 | + self.kind = attributes[:'kind'] |
| 107 | + end |
| 108 | + |
| 109 | + if attributes.key?(:'metadata') |
| 110 | + self.metadata = attributes[:'metadata'] |
| 111 | + end |
| 112 | + |
| 113 | + if attributes.key?(:'spec') |
| 114 | + self.spec = attributes[:'spec'] |
| 115 | + end |
| 116 | + end |
| 117 | + |
| 118 | + # Check to see if the all the properties in the model are valid |
| 119 | + # @return true if the model is valid |
| 120 | + # @!visibility private |
| 121 | + def valid? |
| 122 | + return false if @api_version.nil? |
| 123 | + return false if @kind.nil? |
| 124 | + return false if @metadata.nil? |
| 125 | + true |
| 126 | + end |
| 127 | + |
| 128 | + # Custom attribute writer method with validation |
| 129 | + # @param api_version [Object] Object to be assigned |
| 130 | + # @!visibility private |
| 131 | + def api_version=(api_version) |
| 132 | + if api_version.nil? |
| 133 | + fail ArgumentError, 'invalid value for "api_version", api_version cannot be nil.' |
| 134 | + end |
| 135 | + @api_version = api_version |
| 136 | + end |
| 137 | + |
| 138 | + # Custom attribute writer method with validation |
| 139 | + # @param kind [Object] Object to be assigned |
| 140 | + # @!visibility private |
| 141 | + def kind=(kind) |
| 142 | + if kind.nil? |
| 143 | + fail ArgumentError, 'invalid value for "kind", kind cannot be nil.' |
| 144 | + end |
| 145 | + @kind = kind |
| 146 | + end |
| 147 | + |
| 148 | + # Custom attribute writer method with validation |
| 149 | + # @param metadata [Object] Object to be assigned |
| 150 | + # @!visibility private |
| 151 | + def metadata=(metadata) |
| 152 | + if metadata.nil? |
| 153 | + fail ArgumentError, 'invalid value for "metadata", metadata cannot be nil.' |
| 154 | + end |
| 155 | + @metadata = metadata |
| 156 | + end |
| 157 | + |
| 158 | + # Checks equality by comparing each attribute. |
| 159 | + # @param o [Object] Object to be compared |
| 160 | + # @!visibility private |
| 161 | + def ==(o) |
| 162 | + return true if self.equal?(o) |
| 163 | + self.class == o.class && |
| 164 | + api_version == o.api_version && |
| 165 | + datadog == o.datadog && |
| 166 | + extensions == o.extensions && |
| 167 | + integrations == o.integrations && |
| 168 | + kind == o.kind && |
| 169 | + metadata == o.metadata && |
| 170 | + spec == o.spec |
| 171 | + end |
| 172 | + |
| 173 | + # Calculates hash code according to all attributes. |
| 174 | + # @return [Integer] Hash code |
| 175 | + # @!visibility private |
| 176 | + def hash |
| 177 | + [api_version, datadog, extensions, integrations, kind, metadata, spec].hash |
| 178 | + end |
| 179 | + end |
| 180 | +end |
0 commit comments