Class: MistApi::AccountOauthInfoAccountRegion

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/account_oauth_info_account_region.rb

Overview

AccountOauthInfoAccountRegion Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(aggregate_region = SKIP, allocated_bandwidth = SKIP, name = SKIP) ⇒ AccountOauthInfoAccountRegion

Returns a new instance of AccountOauthInfoAccountRegion.



47
48
49
50
51
52
# File 'lib/mist_api/models/account_oauth_info_account_region.rb', line 47

def initialize(aggregate_region = SKIP, allocated_bandwidth = SKIP,
               name = SKIP)
  @aggregate_region = aggregate_region unless aggregate_region == SKIP
  @allocated_bandwidth = allocated_bandwidth unless allocated_bandwidth == SKIP
  @name = name unless name == SKIP
end

Instance Attribute Details

#aggregate_regionString

Bandwidth Aggregate region for this region

Returns:

  • (String)


14
15
16
# File 'lib/mist_api/models/account_oauth_info_account_region.rb', line 14

def aggregate_region
  @aggregate_region
end

#allocated_bandwidthInteger

Allocated bandwidth for the region, in Mbps

Returns:

  • (Integer)


18
19
20
# File 'lib/mist_api/models/account_oauth_info_account_region.rb', line 18

def allocated_bandwidth
  @allocated_bandwidth
end

#nameString

Display name for this region

Returns:

  • (String)


22
23
24
# File 'lib/mist_api/models/account_oauth_info_account_region.rb', line 22

def name
  @name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/mist_api/models/account_oauth_info_account_region.rb', line 55

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  aggregate_region =
    hash.key?('aggregate_region') ? hash['aggregate_region'] : SKIP
  allocated_bandwidth =
    hash.key?('allocated_bandwidth') ? hash['allocated_bandwidth'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP

  # Create object from extracted values.
  AccountOauthInfoAccountRegion.new(aggregate_region,
                                    allocated_bandwidth,
                                    name)
end

.namesObject

A mapping from model property names to API property names.



25
26
27
28
29
30
31
# File 'lib/mist_api/models/account_oauth_info_account_region.rb', line 25

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['aggregate_region'] = 'aggregate_region'
  @_hash['allocated_bandwidth'] = 'allocated_bandwidth'
  @_hash['name'] = 'name'
  @_hash
end

.nullablesObject

An array for nullable fields



43
44
45
# File 'lib/mist_api/models/account_oauth_info_account_region.rb', line 43

def self.nullables
  []
end

.optionalsObject

An array for optional fields



34
35
36
37
38
39
40
# File 'lib/mist_api/models/account_oauth_info_account_region.rb', line 34

def self.optionals
  %w[
    aggregate_region
    allocated_bandwidth
    name
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



79
80
81
82
83
# File 'lib/mist_api/models/account_oauth_info_account_region.rb', line 79

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} aggregate_region: #{@aggregate_region.inspect}, allocated_bandwidth:"\
  " #{@allocated_bandwidth.inspect}, name: #{@name.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



72
73
74
75
76
# File 'lib/mist_api/models/account_oauth_info_account_region.rb', line 72

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} aggregate_region: #{@aggregate_region}, allocated_bandwidth:"\
  " #{@allocated_bandwidth}, name: #{@name}>"
end