Class: Fastly::Backend
- Inherits:
-
Object
- Object
- Fastly::Backend
- Defined in:
- lib/fastly/models/backend.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
A hostname, IPv4, or IPv6 address for the backend.
-
#auto_loadbalance ⇒ Object
Whether or not this backend should be automatically load balanced.
-
#between_bytes_timeout ⇒ Object
Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend.
-
#client_cert ⇒ Object
Unused.
-
#comment ⇒ Object
A freeform descriptive note.
-
#connect_timeout ⇒ Object
Maximum duration in milliseconds to wait for a connection to this backend to be established.
-
#first_byte_timeout ⇒ Object
Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent.
-
#healthcheck ⇒ Object
The name of the healthcheck to use with this backend.
-
#hostname ⇒ Object
The hostname of the backend.
-
#ipv4 ⇒ Object
IPv4 address of the backend.
-
#ipv6 ⇒ Object
IPv6 address of the backend.
-
#keepalive_time ⇒ Object
How long in seconds to keep a persistent connection to the backend between requests.
-
#max_conn ⇒ Object
Maximum number of concurrent connections this backend will accept.
-
#max_tls_version ⇒ Object
Maximum allowed TLS version on SSL connections to this backend.
-
#min_tls_version ⇒ Object
Minimum allowed TLS version on SSL connections to this backend.
-
#name ⇒ Object
The name of the backend.
-
#override_host ⇒ Object
If set, will replace the client-supplied HTTP ‘Host` header on connections to this backend.
-
#port ⇒ Object
Port on which the backend server is listening for connections from Fastly.
-
#request_condition ⇒ Object
Name of a Condition, which if satisfied, will select this backend during a request.
-
#share_key ⇒ Object
Value that when shared across backends will enable those backends to share the same health check.
-
#shield ⇒ Object
Identifier of the POP to use as a [shield](docs.fastly.com/en/guides/shielding).
-
#ssl_ca_cert ⇒ Object
CA certificate attached to origin.
-
#ssl_cert_hostname ⇒ Object
Overrides ‘ssl_hostname`, but only for cert verification.
-
#ssl_check_cert ⇒ Object
Be strict on checking SSL certs.
-
#ssl_ciphers ⇒ Object
List of [OpenSSL ciphers](www.openssl.org/docs/man1.1.1/man1/ciphers.html) to support for connections to this origin.
-
#ssl_client_cert ⇒ Object
Client certificate attached to origin.
-
#ssl_client_key ⇒ Object
Client key attached to origin.
-
#ssl_hostname ⇒ Object
Use ‘ssl_cert_hostname` and `ssl_sni_hostname` to configure certificate validation.
-
#ssl_sni_hostname ⇒ Object
Overrides ‘ssl_hostname`, but only for SNI in the handshake.
-
#tcp_keepalive_enable ⇒ Object
Whether to enable TCP keepalives for backend connections.
-
#tcp_keepalive_interval ⇒ Object
Interval in seconds between subsequent keepalive probes.
-
#tcp_keepalive_probes ⇒ Object
Number of unacknowledged probes to send before considering the connection dead.
-
#tcp_keepalive_time ⇒ Object
Interval in seconds between the last data packet sent and the first keepalive probe.
-
#use_ssl ⇒ Object
Whether or not to require TLS for connections to this backend.
-
#weight ⇒ Object
Weight used to load balance this backend against others.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.fastly_nullable ⇒ Object
List of attributes with nullable: true.
-
.fastly_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Backend
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Backend
Initializes the object
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
# File 'lib/fastly/models/backend.rb', line 240 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Fastly::Backend` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::Backend`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'address') self.address = attributes[:'address'] end if attributes.key?(:'auto_loadbalance') self.auto_loadbalance = attributes[:'auto_loadbalance'] end if attributes.key?(:'between_bytes_timeout') self.between_bytes_timeout = attributes[:'between_bytes_timeout'] end if attributes.key?(:'client_cert') self.client_cert = attributes[:'client_cert'] end if attributes.key?(:'comment') self.comment = attributes[:'comment'] end if attributes.key?(:'connect_timeout') self.connect_timeout = attributes[:'connect_timeout'] end if attributes.key?(:'first_byte_timeout') self.first_byte_timeout = attributes[:'first_byte_timeout'] end if attributes.key?(:'healthcheck') self.healthcheck = attributes[:'healthcheck'] end if attributes.key?(:'hostname') self.hostname = attributes[:'hostname'] end if attributes.key?(:'ipv4') self.ipv4 = attributes[:'ipv4'] end if attributes.key?(:'ipv6') self.ipv6 = attributes[:'ipv6'] end if attributes.key?(:'keepalive_time') self.keepalive_time = attributes[:'keepalive_time'] end if attributes.key?(:'max_conn') self.max_conn = attributes[:'max_conn'] end if attributes.key?(:'max_tls_version') self.max_tls_version = attributes[:'max_tls_version'] end if attributes.key?(:'min_tls_version') self.min_tls_version = attributes[:'min_tls_version'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'override_host') self.override_host = attributes[:'override_host'] end if attributes.key?(:'port') self.port = attributes[:'port'] end if attributes.key?(:'request_condition') self.request_condition = attributes[:'request_condition'] end if attributes.key?(:'share_key') self.share_key = attributes[:'share_key'] end if attributes.key?(:'shield') self.shield = attributes[:'shield'] end if attributes.key?(:'ssl_ca_cert') self.ssl_ca_cert = attributes[:'ssl_ca_cert'] end if attributes.key?(:'ssl_cert_hostname') self.ssl_cert_hostname = attributes[:'ssl_cert_hostname'] end if attributes.key?(:'ssl_check_cert') self.ssl_check_cert = attributes[:'ssl_check_cert'] else self.ssl_check_cert = true end if attributes.key?(:'ssl_ciphers') self.ssl_ciphers = attributes[:'ssl_ciphers'] end if attributes.key?(:'ssl_client_cert') self.ssl_client_cert = attributes[:'ssl_client_cert'] end if attributes.key?(:'ssl_client_key') self.ssl_client_key = attributes[:'ssl_client_key'] end if attributes.key?(:'ssl_hostname') self.ssl_hostname = attributes[:'ssl_hostname'] end if attributes.key?(:'ssl_sni_hostname') self.ssl_sni_hostname = attributes[:'ssl_sni_hostname'] end if attributes.key?(:'tcp_keepalive_enable') self.tcp_keepalive_enable = attributes[:'tcp_keepalive_enable'] end if attributes.key?(:'tcp_keepalive_interval') self.tcp_keepalive_interval = attributes[:'tcp_keepalive_interval'] end if attributes.key?(:'tcp_keepalive_probes') self.tcp_keepalive_probes = attributes[:'tcp_keepalive_probes'] end if attributes.key?(:'tcp_keepalive_time') self.tcp_keepalive_time = attributes[:'tcp_keepalive_time'] end if attributes.key?(:'use_ssl') self.use_ssl = attributes[:'use_ssl'] end if attributes.key?(:'weight') self.weight = attributes[:'weight'] end end |
Instance Attribute Details
#address ⇒ Object
A hostname, IPv4, or IPv6 address for the backend. This is the preferred way to specify the location of your backend.
17 18 19 |
# File 'lib/fastly/models/backend.rb', line 17 def address @address end |
#auto_loadbalance ⇒ Object
Whether or not this backend should be automatically load balanced. If true, all backends with this setting that don’t have a ‘request_condition` will be selected based on their `weight`.
20 21 22 |
# File 'lib/fastly/models/backend.rb', line 20 def auto_loadbalance @auto_loadbalance end |
#between_bytes_timeout ⇒ Object
Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend. If exceeded, the response received so far will be considered complete and the fetch will end. May be set at runtime using ‘bereq.between_bytes_timeout`.
23 24 25 |
# File 'lib/fastly/models/backend.rb', line 23 def between_bytes_timeout @between_bytes_timeout end |
#client_cert ⇒ Object
Unused.
26 27 28 |
# File 'lib/fastly/models/backend.rb', line 26 def client_cert @client_cert end |
#comment ⇒ Object
A freeform descriptive note.
29 30 31 |
# File 'lib/fastly/models/backend.rb', line 29 def comment @comment end |
#connect_timeout ⇒ Object
Maximum duration in milliseconds to wait for a connection to this backend to be established. If exceeded, the connection is aborted and a synthethic ‘503` response will be presented instead. May be set at runtime using `bereq.connect_timeout`.
32 33 34 |
# File 'lib/fastly/models/backend.rb', line 32 def connect_timeout @connect_timeout end |
#first_byte_timeout ⇒ Object
Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. If exceeded, the connection is aborted and a synthethic ‘503` response will be presented instead. May be set at runtime using `bereq.first_byte_timeout`.
35 36 37 |
# File 'lib/fastly/models/backend.rb', line 35 def first_byte_timeout @first_byte_timeout end |
#healthcheck ⇒ Object
The name of the healthcheck to use with this backend.
38 39 40 |
# File 'lib/fastly/models/backend.rb', line 38 def healthcheck @healthcheck end |
#hostname ⇒ Object
The hostname of the backend. May be used as an alternative to ‘address` to set the backend location.
41 42 43 |
# File 'lib/fastly/models/backend.rb', line 41 def hostname @hostname end |
#ipv4 ⇒ Object
IPv4 address of the backend. May be used as an alternative to ‘address` to set the backend location.
44 45 46 |
# File 'lib/fastly/models/backend.rb', line 44 def ipv4 @ipv4 end |
#ipv6 ⇒ Object
IPv6 address of the backend. May be used as an alternative to ‘address` to set the backend location.
47 48 49 |
# File 'lib/fastly/models/backend.rb', line 47 def ipv6 @ipv6 end |
#keepalive_time ⇒ Object
How long in seconds to keep a persistent connection to the backend between requests.
50 51 52 |
# File 'lib/fastly/models/backend.rb', line 50 def keepalive_time @keepalive_time end |
#max_conn ⇒ Object
Maximum number of concurrent connections this backend will accept.
53 54 55 |
# File 'lib/fastly/models/backend.rb', line 53 def max_conn @max_conn end |
#max_tls_version ⇒ Object
Maximum allowed TLS version on SSL connections to this backend. If your backend server is not able to negotiate a connection meeting this constraint, a synthetic ‘503` error response will be generated.
56 57 58 |
# File 'lib/fastly/models/backend.rb', line 56 def max_tls_version @max_tls_version end |
#min_tls_version ⇒ Object
Minimum allowed TLS version on SSL connections to this backend. If your backend server is not able to negotiate a connection meeting this constraint, a synthetic ‘503` error response will be generated.
59 60 61 |
# File 'lib/fastly/models/backend.rb', line 59 def min_tls_version @min_tls_version end |
#name ⇒ Object
The name of the backend.
62 63 64 |
# File 'lib/fastly/models/backend.rb', line 62 def name @name end |
#override_host ⇒ Object
If set, will replace the client-supplied HTTP ‘Host` header on connections to this backend. Applied after VCL has been processed, so this setting will take precedence over changing `bereq.http.Host` in VCL.
65 66 67 |
# File 'lib/fastly/models/backend.rb', line 65 def override_host @override_host end |
#port ⇒ Object
Port on which the backend server is listening for connections from Fastly. Setting ‘port` to 80 or 443 will also set `use_ssl` automatically (to false and true respectively), unless explicitly overridden by setting `use_ssl` in the same request.
68 69 70 |
# File 'lib/fastly/models/backend.rb', line 68 def port @port end |
#request_condition ⇒ Object
Name of a Condition, which if satisfied, will select this backend during a request. If set, will override any ‘auto_loadbalance` setting. By default, the first backend added to a service is selected for all requests.
71 72 73 |
# File 'lib/fastly/models/backend.rb', line 71 def request_condition @request_condition end |
#share_key ⇒ Object
Value that when shared across backends will enable those backends to share the same health check.
74 75 76 |
# File 'lib/fastly/models/backend.rb', line 74 def share_key @share_key end |
#shield ⇒ Object
Identifier of the POP to use as a [shield](docs.fastly.com/en/guides/shielding).
77 78 79 |
# File 'lib/fastly/models/backend.rb', line 77 def shield @shield end |
#ssl_ca_cert ⇒ Object
CA certificate attached to origin.
80 81 82 |
# File 'lib/fastly/models/backend.rb', line 80 def ssl_ca_cert @ssl_ca_cert end |
#ssl_cert_hostname ⇒ Object
Overrides ‘ssl_hostname`, but only for cert verification. Does not affect SNI at all.
83 84 85 |
# File 'lib/fastly/models/backend.rb', line 83 def ssl_cert_hostname @ssl_cert_hostname end |
#ssl_check_cert ⇒ Object
Be strict on checking SSL certs.
86 87 88 |
# File 'lib/fastly/models/backend.rb', line 86 def ssl_check_cert @ssl_check_cert end |
#ssl_ciphers ⇒ Object
List of [OpenSSL ciphers](www.openssl.org/docs/man1.1.1/man1/ciphers.html) to support for connections to this origin. If your backend server is not able to negotiate a connection meeting this constraint, a synthetic ‘503` error response will be generated.
89 90 91 |
# File 'lib/fastly/models/backend.rb', line 89 def ssl_ciphers @ssl_ciphers end |
#ssl_client_cert ⇒ Object
Client certificate attached to origin.
92 93 94 |
# File 'lib/fastly/models/backend.rb', line 92 def ssl_client_cert @ssl_client_cert end |
#ssl_client_key ⇒ Object
Client key attached to origin.
95 96 97 |
# File 'lib/fastly/models/backend.rb', line 95 def ssl_client_key @ssl_client_key end |
#ssl_hostname ⇒ Object
Use ‘ssl_cert_hostname` and `ssl_sni_hostname` to configure certificate validation.
98 99 100 |
# File 'lib/fastly/models/backend.rb', line 98 def ssl_hostname @ssl_hostname end |
#ssl_sni_hostname ⇒ Object
Overrides ‘ssl_hostname`, but only for SNI in the handshake. Does not affect cert validation at all.
101 102 103 |
# File 'lib/fastly/models/backend.rb', line 101 def ssl_sni_hostname @ssl_sni_hostname end |
#tcp_keepalive_enable ⇒ Object
Whether to enable TCP keepalives for backend connections. Varnish defaults to using keepalives if this is unspecified.
104 105 106 |
# File 'lib/fastly/models/backend.rb', line 104 def tcp_keepalive_enable @tcp_keepalive_enable end |
#tcp_keepalive_interval ⇒ Object
Interval in seconds between subsequent keepalive probes.
107 108 109 |
# File 'lib/fastly/models/backend.rb', line 107 def tcp_keepalive_interval @tcp_keepalive_interval end |
#tcp_keepalive_probes ⇒ Object
Number of unacknowledged probes to send before considering the connection dead.
110 111 112 |
# File 'lib/fastly/models/backend.rb', line 110 def tcp_keepalive_probes @tcp_keepalive_probes end |
#tcp_keepalive_time ⇒ Object
Interval in seconds between the last data packet sent and the first keepalive probe.
113 114 115 |
# File 'lib/fastly/models/backend.rb', line 113 def tcp_keepalive_time @tcp_keepalive_time end |
#use_ssl ⇒ Object
Whether or not to require TLS for connections to this backend.
116 117 118 |
# File 'lib/fastly/models/backend.rb', line 116 def use_ssl @use_ssl end |
#weight ⇒ Object
Weight used to load balance this backend against others. May be any positive integer. If ‘auto_loadbalance` is true, the chance of this backend being selected is equal to its own weight over the sum of all weights for backends that have `auto_loadbalance` set to true.
119 120 121 |
# File 'lib/fastly/models/backend.rb', line 119 def weight @weight end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
163 164 165 |
# File 'lib/fastly/models/backend.rb', line 163 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/fastly/models/backend.rb', line 122 def self.attribute_map { :'address' => :'address', :'auto_loadbalance' => :'auto_loadbalance', :'between_bytes_timeout' => :'between_bytes_timeout', :'client_cert' => :'client_cert', :'comment' => :'comment', :'connect_timeout' => :'connect_timeout', :'first_byte_timeout' => :'first_byte_timeout', :'healthcheck' => :'healthcheck', :'hostname' => :'hostname', :'ipv4' => :'ipv4', :'ipv6' => :'ipv6', :'keepalive_time' => :'keepalive_time', :'max_conn' => :'max_conn', :'max_tls_version' => :'max_tls_version', :'min_tls_version' => :'min_tls_version', :'name' => :'name', :'override_host' => :'override_host', :'port' => :'port', :'request_condition' => :'request_condition', :'share_key' => :'share_key', :'shield' => :'shield', :'ssl_ca_cert' => :'ssl_ca_cert', :'ssl_cert_hostname' => :'ssl_cert_hostname', :'ssl_check_cert' => :'ssl_check_cert', :'ssl_ciphers' => :'ssl_ciphers', :'ssl_client_cert' => :'ssl_client_cert', :'ssl_client_key' => :'ssl_client_key', :'ssl_hostname' => :'ssl_hostname', :'ssl_sni_hostname' => :'ssl_sni_hostname', :'tcp_keepalive_enable' => :'tcp_keepalive_enable', :'tcp_keepalive_interval' => :'tcp_keepalive_interval', :'tcp_keepalive_probes' => :'tcp_keepalive_probes', :'tcp_keepalive_time' => :'tcp_keepalive_time', :'use_ssl' => :'use_ssl', :'weight' => :'weight' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
483 484 485 |
# File 'lib/fastly/models/backend.rb', line 483 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.fastly_nullable ⇒ Object
List of attributes with nullable: true
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/fastly/models/backend.rb', line 209 def self.fastly_nullable Set.new([ :'client_cert', :'comment', :'healthcheck', :'hostname', :'ipv4', :'ipv6', :'keepalive_time', :'max_tls_version', :'min_tls_version', :'override_host', :'share_key', :'shield', :'ssl_ca_cert', :'ssl_cert_hostname', :'ssl_check_cert', :'ssl_ciphers', :'ssl_client_cert', :'ssl_client_key', :'ssl_hostname', :'ssl_sni_hostname', :'tcp_keepalive_enable', :'tcp_keepalive_interval', :'tcp_keepalive_probes', :'tcp_keepalive_time', ]) end |
.fastly_types ⇒ Object
Attribute type mapping.
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/fastly/models/backend.rb', line 168 def self.fastly_types { :'address' => :'String', :'auto_loadbalance' => :'Boolean', :'between_bytes_timeout' => :'Integer', :'client_cert' => :'String', :'comment' => :'String', :'connect_timeout' => :'Integer', :'first_byte_timeout' => :'Integer', :'healthcheck' => :'String', :'hostname' => :'String', :'ipv4' => :'String', :'ipv6' => :'String', :'keepalive_time' => :'Integer', :'max_conn' => :'Integer', :'max_tls_version' => :'String', :'min_tls_version' => :'String', :'name' => :'String', :'override_host' => :'String', :'port' => :'Integer', :'request_condition' => :'String', :'share_key' => :'String', :'shield' => :'String', :'ssl_ca_cert' => :'String', :'ssl_cert_hostname' => :'String', :'ssl_check_cert' => :'Boolean', :'ssl_ciphers' => :'String', :'ssl_client_cert' => :'String', :'ssl_client_key' => :'String', :'ssl_hostname' => :'String', :'ssl_sni_hostname' => :'String', :'tcp_keepalive_enable' => :'Boolean', :'tcp_keepalive_interval' => :'Integer', :'tcp_keepalive_probes' => :'Integer', :'tcp_keepalive_time' => :'Integer', :'use_ssl' => :'Boolean', :'weight' => :'Integer' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 |
# File 'lib/fastly/models/backend.rb', line 428 def ==(o) return true if self.equal?(o) self.class == o.class && address == o.address && auto_loadbalance == o.auto_loadbalance && between_bytes_timeout == o.between_bytes_timeout && client_cert == o.client_cert && comment == o.comment && connect_timeout == o.connect_timeout && first_byte_timeout == o.first_byte_timeout && healthcheck == o.healthcheck && hostname == o.hostname && ipv4 == o.ipv4 && ipv6 == o.ipv6 && keepalive_time == o.keepalive_time && max_conn == o.max_conn && max_tls_version == o.max_tls_version && min_tls_version == o.min_tls_version && name == o.name && override_host == o.override_host && port == o.port && request_condition == o.request_condition && share_key == o.share_key && shield == o.shield && ssl_ca_cert == o.ssl_ca_cert && ssl_cert_hostname == o.ssl_cert_hostname && ssl_check_cert == o.ssl_check_cert && ssl_ciphers == o.ssl_ciphers && ssl_client_cert == o.ssl_client_cert && ssl_client_key == o.ssl_client_key && ssl_hostname == o.ssl_hostname && ssl_sni_hostname == o.ssl_sni_hostname && tcp_keepalive_enable == o.tcp_keepalive_enable && tcp_keepalive_interval == o.tcp_keepalive_interval && tcp_keepalive_probes == o.tcp_keepalive_probes && tcp_keepalive_time == o.tcp_keepalive_time && use_ssl == o.use_ssl && weight == o.weight end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 |
# File 'lib/fastly/models/backend.rb', line 513 def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = Fastly.const_get(type) klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
584 585 586 587 588 589 590 591 592 593 594 595 596 |
# File 'lib/fastly/models/backend.rb', line 584 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 |
# File 'lib/fastly/models/backend.rb', line 490 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.fastly_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.fastly_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
470 471 472 |
# File 'lib/fastly/models/backend.rb', line 470 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
476 477 478 |
# File 'lib/fastly/models/backend.rb', line 476 def hash [address, auto_loadbalance, between_bytes_timeout, client_cert, comment, connect_timeout, first_byte_timeout, healthcheck, hostname, ipv4, ipv6, keepalive_time, max_conn, max_tls_version, min_tls_version, name, override_host, port, request_condition, share_key, shield, ssl_ca_cert, ssl_cert_hostname, ssl_check_cert, ssl_ciphers, ssl_client_cert, ssl_client_key, ssl_hostname, ssl_sni_hostname, tcp_keepalive_enable, tcp_keepalive_interval, tcp_keepalive_probes, tcp_keepalive_time, use_ssl, weight].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
398 399 400 401 402 403 404 405 406 |
# File 'lib/fastly/models/backend.rb', line 398 def list_invalid_properties invalid_properties = Array.new pattern = Regexp.new(/^[A-Za-z0-9]+$/) if !@share_key.nil? && @share_key !~ pattern invalid_properties.push("invalid value for \"share_key\", must conform to the pattern #{pattern}.") end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
560 561 562 |
# File 'lib/fastly/models/backend.rb', line 560 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
566 567 568 569 570 571 572 573 574 575 576 577 578 |
# File 'lib/fastly/models/backend.rb', line 566 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.fastly_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
554 555 556 |
# File 'lib/fastly/models/backend.rb', line 554 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
410 411 412 413 |
# File 'lib/fastly/models/backend.rb', line 410 def valid? return false if !@share_key.nil? && @share_key !~ Regexp.new(/^[A-Za-z0-9]+$/) true end |