|
| 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 | +Contact: support@datadoghq.com |
| 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 | + # Configuration for enabling TLS encryption between the pipeline component and external services. |
| 21 | + class ObservabilityPipelineClientTls |
| 22 | + include BaseGenericModel |
| 23 | + |
| 24 | + # Path to the Certificate Authority (CA) file used to validate the server’s TLS certificate. |
| 25 | + attr_accessor :ca_file |
| 26 | + |
| 27 | + # Path to the TLS client certificate file used to authenticate the pipeline component with upstream or downstream services. |
| 28 | + attr_reader :crt_file |
| 29 | + |
| 30 | + # Path to the private key file associated with the TLS client certificate. Used for mutual TLS authentication. |
| 31 | + attr_accessor :key_file |
| 32 | + |
| 33 | + # Name of the environment variable or secret that holds the passphrase for the private key file. |
| 34 | + attr_accessor :key_pass_key |
| 35 | + |
| 36 | + # Server name to use for Server Name Indication (SNI) and to verify against the certificate presented by the remote host. Use this when the address you connect to doesn't match the certificate's Common Name or Subject Alternative Name. |
| 37 | + attr_reader :server_name |
| 38 | + |
| 39 | + attr_accessor :additional_properties |
| 40 | + |
| 41 | + # Attribute mapping from ruby-style variable name to JSON key. |
| 42 | + # @!visibility private |
| 43 | + def self.attribute_map |
| 44 | + { |
| 45 | + :'ca_file' => :'ca_file', |
| 46 | + :'crt_file' => :'crt_file', |
| 47 | + :'key_file' => :'key_file', |
| 48 | + :'key_pass_key' => :'key_pass_key', |
| 49 | + :'server_name' => :'server_name' |
| 50 | + } |
| 51 | + end |
| 52 | + |
| 53 | + # Attribute type mapping. |
| 54 | + # @!visibility private |
| 55 | + def self.openapi_types |
| 56 | + { |
| 57 | + :'ca_file' => :'String', |
| 58 | + :'crt_file' => :'String', |
| 59 | + :'key_file' => :'String', |
| 60 | + :'key_pass_key' => :'String', |
| 61 | + :'server_name' => :'String' |
| 62 | + } |
| 63 | + end |
| 64 | + |
| 65 | + # Initializes the object |
| 66 | + # @param attributes [Hash] Model attributes in the form of hash |
| 67 | + # @!visibility private |
| 68 | + def initialize(attributes = {}) |
| 69 | + if (!attributes.is_a?(Hash)) |
| 70 | + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ObservabilityPipelineClientTls` initialize method" |
| 71 | + end |
| 72 | + |
| 73 | + self.additional_properties = {} |
| 74 | + # check to see if the attribute exists and convert string to symbol for hash key |
| 75 | + attributes = attributes.each_with_object({}) { |(k, v), h| |
| 76 | + if (!self.class.attribute_map.key?(k.to_sym)) |
| 77 | + self.additional_properties[k.to_sym] = v |
| 78 | + else |
| 79 | + h[k.to_sym] = v |
| 80 | + end |
| 81 | + } |
| 82 | + |
| 83 | + if attributes.key?(:'ca_file') |
| 84 | + self.ca_file = attributes[:'ca_file'] |
| 85 | + end |
| 86 | + |
| 87 | + if attributes.key?(:'crt_file') |
| 88 | + self.crt_file = attributes[:'crt_file'] |
| 89 | + end |
| 90 | + |
| 91 | + if attributes.key?(:'key_file') |
| 92 | + self.key_file = attributes[:'key_file'] |
| 93 | + end |
| 94 | + |
| 95 | + if attributes.key?(:'key_pass_key') |
| 96 | + self.key_pass_key = attributes[:'key_pass_key'] |
| 97 | + end |
| 98 | + |
| 99 | + if attributes.key?(:'server_name') |
| 100 | + self.server_name = attributes[:'server_name'] |
| 101 | + end |
| 102 | + end |
| 103 | + |
| 104 | + # Check to see if the all the properties in the model are valid |
| 105 | + # @return true if the model is valid |
| 106 | + # @!visibility private |
| 107 | + def valid? |
| 108 | + return false if @crt_file.nil? |
| 109 | + return false if !@server_name.nil? && @server_name.to_s.length > 253 |
| 110 | + return false if !@server_name.nil? && @server_name.to_s.length < 1 |
| 111 | + true |
| 112 | + end |
| 113 | + |
| 114 | + # Custom attribute writer method with validation |
| 115 | + # @param crt_file [Object] Object to be assigned |
| 116 | + # @!visibility private |
| 117 | + def crt_file=(crt_file) |
| 118 | + if crt_file.nil? |
| 119 | + fail ArgumentError, 'invalid value for "crt_file", crt_file cannot be nil.' |
| 120 | + end |
| 121 | + @crt_file = crt_file |
| 122 | + end |
| 123 | + |
| 124 | + # Custom attribute writer method with validation |
| 125 | + # @param server_name [Object] Object to be assigned |
| 126 | + # @!visibility private |
| 127 | + def server_name=(server_name) |
| 128 | + if !server_name.nil? && server_name.to_s.length > 253 |
| 129 | + fail ArgumentError, 'invalid value for "server_name", the character length must be smaller than or equal to 253.' |
| 130 | + end |
| 131 | + if !server_name.nil? && server_name.to_s.length < 1 |
| 132 | + fail ArgumentError, 'invalid value for "server_name", the character length must be great than or equal to 1.' |
| 133 | + end |
| 134 | + @server_name = server_name |
| 135 | + end |
| 136 | + |
| 137 | + # Returns the object in the form of hash, with additionalProperties support. |
| 138 | + # @return [Hash] Returns the object in the form of hash |
| 139 | + # @!visibility private |
| 140 | + def to_hash |
| 141 | + hash = {} |
| 142 | + self.class.attribute_map.each_pair do |attr, param| |
| 143 | + value = self.send(attr) |
| 144 | + if value.nil? |
| 145 | + is_nullable = self.class.openapi_nullable.include?(attr) |
| 146 | + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) |
| 147 | + end |
| 148 | + |
| 149 | + hash[param] = _to_hash(value) |
| 150 | + end |
| 151 | + self.additional_properties.each_pair do |attr, value| |
| 152 | + hash[attr] = value |
| 153 | + end |
| 154 | + hash |
| 155 | + end |
| 156 | + |
| 157 | + # Checks equality by comparing each attribute. |
| 158 | + # @param o [Object] Object to be compared |
| 159 | + # @!visibility private |
| 160 | + def ==(o) |
| 161 | + return true if self.equal?(o) |
| 162 | + self.class == o.class && |
| 163 | + ca_file == o.ca_file && |
| 164 | + crt_file == o.crt_file && |
| 165 | + key_file == o.key_file && |
| 166 | + key_pass_key == o.key_pass_key && |
| 167 | + server_name == o.server_name && |
| 168 | + additional_properties == o.additional_properties |
| 169 | + end |
| 170 | + |
| 171 | + # Calculates hash code according to all attributes. |
| 172 | + # @return [Integer] Hash code |
| 173 | + # @!visibility private |
| 174 | + def hash |
| 175 | + [ca_file, crt_file, key_file, key_pass_key, server_name, additional_properties].hash |
| 176 | + end |
| 177 | + end |
| 178 | +end |
0 commit comments