class Saklient::Cloud::Resources::License

ライセンスの実体1つに対応し, 属性の取得や操作を行うためのクラス.

Attributes

id[R]

ID

@return [String]

info[RW]

ライセンス種別情報

@return [LicenseInfo]

m_id[RW]

ID

@return [String]

m_info[RW]

ライセンス種別情報

@return [LicenseInfo]

m_name[RW]

名前

@return [String]

n_id[RW]

@return [bool]

n_info[RW]

@return [bool]

n_name[RW]

@return [bool]

name[RW]

名前

@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/license.rb, line 83
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/license.rb, line 55
def _class_name
  return 'License'
end
_id() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/license.rb, line 61
def _id
  return get_id
end
info=(v) click to toggle source
# File lib/saklient/cloud/resources/license.rb, line 191
def info=(v)
  set_info(v)
end
name=(v) click to toggle source
# File lib/saklient/cloud/resources/license.rb, line 150
def name=(v)
  set_name(v)
end
reload() click to toggle source

最新のリソース情報を再取得します.

@return [License] this

# File lib/saklient/cloud/resources/license.rb, line 75
def reload
  return _reload
end
save() click to toggle source

このローカルオブジェクトに現在設定されているリソース情報をAPIに送信し, 新規作成または上書き保存します.

@return [License] this

# File lib/saklient/cloud/resources/license.rb, line 68
def save
  return _save
end

Protected Instance Methods

_api_path() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/license.rb, line 35
def _api_path
  return '/license'
end
_root_key() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/license.rb, line 41
def _root_key
  return 'License'
end
_root_key_m() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/license.rb, line 47
def _root_key_m
  return 'Licenses'
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/license.rb, line 200
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, 'LicenseInfo')
    @m_info = (Saklient::Util::get_by_path(r, 'LicenseInfo')).nil? ? nil : Saklient::Cloud::Resources::LicenseInfo.new(@_client, Saklient::Util::get_by_path(r, 'LicenseInfo'))
  else
    @m_info = nil
    @is_incomplete = true
  end
  @n_info = false
end
api_serialize_impl(withClean = false) click to toggle source

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

# File lib/saklient/cloud/resources/license.rb, line 230
def api_serialize_impl(withClean = false)
  Saklient::Util::validate_type(withClean, 'bool')
  missing = []
  ret = {}
  Saklient::Util::set_by_path(ret, 'ID', @m_id) if withClean || @n_id
  if withClean || @n_name
    Saklient::Util::set_by_path(ret, 'Name', @m_name)
  else
    missing << 'name' if @is_new
  end
  if withClean || @n_info
    Saklient::Util::set_by_path(ret, 'LicenseInfo', withClean ? ((@m_info).nil? ? nil : @m_info.api_serialize(withClean)) : ((@m_info).nil? ? { ID: '0' } : @m_info.api_serialize_id))
  else
    missing << 'info' if @is_new
  end
  raise Saklient::Errors::SaklientException.new('required_field', 'Required fields must be set before the License creation: ' + missing.join(', ')) if missing.length > 0
  return ret
end
get_id() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [String]

# File lib/saklient/cloud/resources/license.rb, line 99
def get_id
  return @m_id
end
get_info() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [LicenseInfo]

# File lib/saklient/cloud/resources/license.rb, line 163
def get_info
  return @m_info
end
get_name() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [String]

# File lib/saklient/cloud/resources/license.rb, line 123
def get_name
  return @m_name
end
set_info(v) click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @param [LicenseInfo] v @return [LicenseInfo]

# File lib/saklient/cloud/resources/license.rb, line 172
def set_info(v)
  Saklient::Util::validate_type(v, 'Saklient::Cloud::Resources::LicenseInfo')
  raise Saklient::Errors::SaklientException.new('immutable_field', 'Immutable fields cannot be modified after the resource creation: ' + 'Saklient::Cloud::Resources::License#info') if !@is_new
  @m_info = v
  @n_info = true
  return @m_info
end
set_name(v) click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @param [String] v @return [String]

# File lib/saklient/cloud/resources/license.rb, line 132
def set_name(v)
  Saklient::Util::validate_type(v, 'String')
  @m_name = v
  @n_name = true
  return @m_name
end