class Saklient::Cloud::Resources::ServerPlan

サーバプラン情報の1レコードに対応するクラス.

Attributes

cpu[R]

仮想コア数

@return [Fixnum]

id[R]

ID

@return [String]

m_cpu[RW]

仮想コア数

@return [Fixnum]

m_id[RW]

ID

@return [String]

m_memory_mib[RW]

メモリ容量

@return [Fixnum]

m_name[RW]

名前

@return [String]

m_service_class[RW]

サービスクラス

@return [String]

memory_gib[R]

@return [Fixnum]

memory_mib[R]

メモリ容量

@return [Fixnum]

n_cpu[RW]

@return [bool]

n_id[RW]

@return [bool]

n_memory_mib[RW]

@return [bool]

n_name[RW]

@return [bool]

n_service_class[RW]

@return [bool]

name[R]

名前

@return [String]

service_class[R]

サービスクラス

@return [String]

Public Class Methods

new(client, obj, wrapped = false) click to toggle source

@private @param [Saklient::Cloud::Client] client @param [any] obj @param [bool] wrapped

# File lib/saklient/cloud/resources/server_plan.rb, line 77
def initialize(client, obj, wrapped = false)
  super(client)
  Saklient::Util::validate_type(client, 'Saklient::Cloud::Client')
  Saklient::Util::validate_type(wrapped, 'bool')
  api_deserialize(obj, wrapped)
end

Public Instance Methods

_class_name() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/server_plan.rb, line 63
def _class_name
  return 'ServerPlan'
end
_id() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/server_plan.rb, line 69
def _id
  return get_id
end

Protected Instance Methods

_api_path() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/server_plan.rb, line 43
def _api_path
  return '/product/server'
end
_root_key() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/server_plan.rb, line 49
def _root_key
  return 'ServerPlan'
end
_root_key_m() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/server_plan.rb, line 55
def _root_key_m
  return 'ServerPlans'
end
api_deserialize_impl(r) click to toggle source

(This method is generated in Translator_default#buildImpl)

@param [any] r

# File lib/saklient/cloud/resources/server_plan.rb, line 227
def api_deserialize_impl(r)
  @is_new = (r).nil?
  r = {} if @is_new
  @is_incomplete = false
  if Saklient::Util::exists_path(r, 'ID')
    @m_id = (Saklient::Util::get_by_path(r, 'ID')).nil? ? nil : Saklient::Util::get_by_path(r, 'ID').to_s
  else
    @m_id = nil
    @is_incomplete = true
  end
  @n_id = false
  if Saklient::Util::exists_path(r, 'Name')
    @m_name = (Saklient::Util::get_by_path(r, 'Name')).nil? ? nil : Saklient::Util::get_by_path(r, 'Name').to_s
  else
    @m_name = nil
    @is_incomplete = true
  end
  @n_name = false
  if Saklient::Util::exists_path(r, 'CPU')
    @m_cpu = (Saklient::Util::get_by_path(r, 'CPU')).nil? ? nil : (Saklient::Util::get_by_path(r, 'CPU').to_s).to_s().to_i(10)
  else
    @m_cpu = nil
    @is_incomplete = true
  end
  @n_cpu = false
  if Saklient::Util::exists_path(r, 'MemoryMB')
    @m_memory_mib = (Saklient::Util::get_by_path(r, 'MemoryMB')).nil? ? nil : (Saklient::Util::get_by_path(r, 'MemoryMB').to_s).to_s().to_i(10)
  else
    @m_memory_mib = nil
    @is_incomplete = true
  end
  @n_memory_mib = false
  if Saklient::Util::exists_path(r, 'ServiceClass')
    @m_service_class = (Saklient::Util::get_by_path(r, 'ServiceClass')).nil? ? nil : Saklient::Util::get_by_path(r, 'ServiceClass').to_s
  else
    @m_service_class = nil
    @is_incomplete = true
  end
  @n_service_class = false
end
api_serialize_impl(withClean = false) click to toggle source

@private @param [bool] withClean @return [any]

# File lib/saklient/cloud/resources/server_plan.rb, line 271
def api_serialize_impl(withClean = false)
  Saklient::Util::validate_type(withClean, 'bool')
  ret = {}
  Saklient::Util::set_by_path(ret, 'ID', @m_id) if withClean || @n_id
  Saklient::Util::set_by_path(ret, 'Name', @m_name) if withClean || @n_name
  Saklient::Util::set_by_path(ret, 'CPU', @m_cpu) if withClean || @n_cpu
  Saklient::Util::set_by_path(ret, 'MemoryMB', @m_memory_mib) if withClean || @n_memory_mib
  Saklient::Util::set_by_path(ret, 'ServiceClass', @m_service_class) if withClean || @n_service_class
  return ret
end
get_cpu() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [Fixnum]

# File lib/saklient/cloud/resources/server_plan.rb, line 159
def get_cpu
  return @m_cpu
end
get_id() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [String]

# File lib/saklient/cloud/resources/server_plan.rb, line 111
def get_id
  return @m_id
end
get_memory_gib() click to toggle source

@private @return [Fixnum]

# File lib/saklient/cloud/resources/server_plan.rb, line 88
def get_memory_gib
  memoryMib = get_memory_mib
  return (memoryMib).nil? ? nil : memoryMib >> 10
end
get_memory_mib() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [Fixnum]

# File lib/saklient/cloud/resources/server_plan.rb, line 183
def get_memory_mib
  return @m_memory_mib
end
get_name() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [String]

# File lib/saklient/cloud/resources/server_plan.rb, line 135
def get_name
  return @m_name
end
get_service_class() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [String]

# File lib/saklient/cloud/resources/server_plan.rb, line 207
def get_service_class
  return @m_service_class
end