Class: Verizon::NetworkResourcesType
- Defined in:
- lib/verizon/models/network_resources_type.rb
Overview
Network resources of a service profile.
Instance Attribute Summary collapse
-
#max_latency_ms ⇒ Integer
Maximum response time or latency that the application can handle, in milliseconds.
-
#max_request_rate ⇒ Integer
Maximum request rate that the application can handle.
-
#min_availability ⇒ Integer
Minimum availability required for the server.
-
#min_bandwidth_kbits ⇒ Integer
Minimum required connection bandwidth in Kbit/s for the application.
-
#service_continuity_support ⇒ TrueClass | FalseClass
Indicates if service continuity support is required or not for the application.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(max_latency_ms = nil, min_bandwidth_kbits = SKIP, service_continuity_support = SKIP, max_request_rate = SKIP, min_availability = SKIP) ⇒ NetworkResourcesType
constructor
A new instance of NetworkResourcesType.
Methods inherited from BaseModel
Constructor Details
#initialize(max_latency_ms = nil, min_bandwidth_kbits = SKIP, service_continuity_support = SKIP, max_request_rate = SKIP, min_availability = SKIP) ⇒ NetworkResourcesType
Returns a new instance of NetworkResourcesType.
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/verizon/models/network_resources_type.rb', line 60 def initialize(max_latency_ms = nil, min_bandwidth_kbits = SKIP, service_continuity_support = SKIP, max_request_rate = SKIP, min_availability = SKIP) @min_bandwidth_kbits = min_bandwidth_kbits unless min_bandwidth_kbits == SKIP unless service_continuity_support == SKIP @service_continuity_support = service_continuity_support end @max_request_rate = max_request_rate unless max_request_rate == SKIP @max_latency_ms = max_latency_ms @min_availability = min_availability unless min_availability == SKIP end |
Instance Attribute Details
#max_latency_ms ⇒ Integer
Maximum response time or latency that the application can handle, in milliseconds. Note: this value must be in multiples of 5.
28 29 30 |
# File 'lib/verizon/models/network_resources_type.rb', line 28 def max_latency_ms @max_latency_ms end |
#max_request_rate ⇒ Integer
Maximum request rate that the application can handle.
23 24 25 |
# File 'lib/verizon/models/network_resources_type.rb', line 23 def max_request_rate @max_request_rate end |
#min_availability ⇒ Integer
Minimum availability required for the server.
32 33 34 |
# File 'lib/verizon/models/network_resources_type.rb', line 32 def min_availability @min_availability end |
#min_bandwidth_kbits ⇒ Integer
Minimum required connection bandwidth in Kbit/s for the application.
14 15 16 |
# File 'lib/verizon/models/network_resources_type.rb', line 14 def min_bandwidth_kbits @min_bandwidth_kbits end |
#service_continuity_support ⇒ TrueClass | FalseClass
Indicates if service continuity support is required or not for the application.
19 20 21 |
# File 'lib/verizon/models/network_resources_type.rb', line 19 def service_continuity_support @service_continuity_support end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/verizon/models/network_resources_type.rb', line 74 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. max_latency_ms = hash.key?('maxLatencyMs') ? hash['maxLatencyMs'] : nil min_bandwidth_kbits = hash.key?('minBandwidthKbits') ? hash['minBandwidthKbits'] : SKIP service_continuity_support = hash.key?('serviceContinuitySupport') ? hash['serviceContinuitySupport'] : SKIP max_request_rate = hash.key?('maxRequestRate') ? hash['maxRequestRate'] : SKIP min_availability = hash.key?('minAvailability') ? hash['minAvailability'] : SKIP # Create object from extracted values. NetworkResourcesType.new(max_latency_ms, min_bandwidth_kbits, service_continuity_support, max_request_rate, min_availability) end |
.names ⇒ Object
A mapping from model property names to API property names.
35 36 37 38 39 40 41 42 43 |
# File 'lib/verizon/models/network_resources_type.rb', line 35 def self.names @_hash = {} if @_hash.nil? @_hash['min_bandwidth_kbits'] = 'minBandwidthKbits' @_hash['service_continuity_support'] = 'serviceContinuitySupport' @_hash['max_request_rate'] = 'maxRequestRate' @_hash['max_latency_ms'] = 'maxLatencyMs' @_hash['min_availability'] = 'minAvailability' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/verizon/models/network_resources_type.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 49 50 51 52 53 |
# File 'lib/verizon/models/network_resources_type.rb', line 46 def self.optionals %w[ min_bandwidth_kbits service_continuity_support max_request_rate min_availability ] end |