Class: Verizon::NetworkResourcesType

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/network_resources_type.rb

Overview

Network resources of a service profile.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

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_msInteger

Maximum response time or latency that the application can handle, in milliseconds. Note: this value must be in multiples of 5.

Returns:

  • (Integer)


28
29
30
# File 'lib/verizon/models/network_resources_type.rb', line 28

def max_latency_ms
  @max_latency_ms
end

#max_request_rateInteger

Maximum request rate that the application can handle.

Returns:

  • (Integer)


23
24
25
# File 'lib/verizon/models/network_resources_type.rb', line 23

def max_request_rate
  @max_request_rate
end

#min_availabilityInteger

Minimum availability required for the server.

Returns:

  • (Integer)


32
33
34
# File 'lib/verizon/models/network_resources_type.rb', line 32

def min_availability
  @min_availability
end

#min_bandwidth_kbitsInteger

Minimum required connection bandwidth in Kbit/s for the application.

Returns:

  • (Integer)


14
15
16
# File 'lib/verizon/models/network_resources_type.rb', line 14

def min_bandwidth_kbits
  @min_bandwidth_kbits
end

#service_continuity_supportTrueClass | FalseClass

Indicates if service continuity support is required or not for the application.

Returns:

  • (TrueClass | FalseClass)


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

.namesObject

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

.nullablesObject

An array for nullable fields



56
57
58
# File 'lib/verizon/models/network_resources_type.rb', line 56

def self.nullables
  []
end

.optionalsObject

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