class Saklient::Cloud::Resources::Script
スクリプトの実体1つに対応し, 属性の取得や操作を行うためのクラス.
Attributes
注釈
@return [any]
クラス {Saklient::Cloud::Enums::EScriptClass}
@return [String]
内容
@return [String]
説明
@return [String]
アイコン
@return [Icon]
ID
@return [String]
注釈
@return [any]
クラス {Saklient::Cloud::Enums::EScriptClass}
@return [String]
内容
@return [String]
説明
@return [String]
アイコン
@return [Icon]
ID
@return [String]
名前
@return [String]
スコープ {Saklient::Cloud::Enums::EScope}
@return [String]
@return [bool]
@return [bool]
@return [bool]
@return [bool]
@return [bool]
@return [bool]
@return [bool]
@return [bool]
名前
@return [String]
スコープ {Saklient::Cloud::Enums::EScope}
@return [String]
Public Class Methods
@private @param [Saklient::Cloud::Client] client @param [any] obj @param [bool] wrapped
Saklient::Cloud::Resources::Resource::new
# File lib/saklient/cloud/resources/script.rb, line 115 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
@private @return [String]
# File lib/saklient/cloud/resources/script.rb, line 87 def _class_name return 'Script' end
@private @return [String]
# File lib/saklient/cloud/resources/script.rb, line 93 def _id return get_id end
# File lib/saklient/cloud/resources/script.rb, line 206 def clazz=(v) set_clazz(v) end
# File lib/saklient/cloud/resources/script.rb, line 391 def content=(v) set_content(v) end
# File lib/saklient/cloud/resources/script.rb, line 270 def description=(v) set_description(v) end
# File lib/saklient/cloud/resources/script.rb, line 351 def icon=(v) set_icon(v) end
最新のリソース情報を再取得します.
@return [Script] this
# File lib/saklient/cloud/resources/script.rb, line 107 def reload return _reload end
このローカルオブジェクトに現在設定されているリソース情報をAPIに送信し, 新規作成または上書き保存します.
@return [Script] this
# File lib/saklient/cloud/resources/script.rb, line 100 def save return _save end
Protected Instance Methods
@private @return [String]
# File lib/saklient/cloud/resources/script.rb, line 67 def _api_path return '/note' end
@private @return [String]
# File lib/saklient/cloud/resources/script.rb, line 73 def _root_key return 'Note' end
@private @return [String]
# File lib/saklient/cloud/resources/script.rb, line 79 def _root_key_m return 'Notes' end
(This method is generated in Translator_default#buildImpl)
@param [any] r
# File lib/saklient/cloud/resources/script.rb, line 424 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, 'Scope') @m_scope = (Saklient::Util::get_by_path(r, 'Scope')).nil? ? nil : Saklient::Util::get_by_path(r, 'Scope').to_s else @m_scope = nil @is_incomplete = true end @n_scope = false if Saklient::Util::exists_path(r, 'Class') @m_clazz = (Saklient::Util::get_by_path(r, 'Class')).nil? ? nil : Saklient::Util::get_by_path(r, 'Class').to_s else @m_clazz = nil @is_incomplete = true end @n_clazz = 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, 'Description') @m_description = (Saklient::Util::get_by_path(r, 'Description')).nil? ? nil : Saklient::Util::get_by_path(r, 'Description').to_s else @m_description = nil @is_incomplete = true end @n_description = false if Saklient::Util::exists_path(r, 'Tags') if (Saklient::Util::get_by_path(r, 'Tags')).nil? @m_tags = [] else @m_tags = [] for t in Saklient::Util::get_by_path(r, 'Tags') v1 = nil v1 = (t).nil? ? nil : t.to_s @m_tags << v1 end end else @m_tags = nil @is_incomplete = true end @n_tags = false if Saklient::Util::exists_path(r, 'Icon') @m_icon = (Saklient::Util::get_by_path(r, 'Icon')).nil? ? nil : Saklient::Cloud::Resources::Icon.new(@_client, Saklient::Util::get_by_path(r, 'Icon')) else @m_icon = nil @is_incomplete = true end @n_icon = false if Saklient::Util::exists_path(r, 'Content') @m_content = (Saklient::Util::get_by_path(r, 'Content')).nil? ? nil : Saklient::Util::get_by_path(r, 'Content').to_s else @m_content = nil @is_incomplete = true end @n_content = false if Saklient::Util::exists_path(r, 'Remark') @m_annotation = Saklient::Util::get_by_path(r, 'Remark') else @m_annotation = nil @is_incomplete = true end @n_annotation = false end
@private @param [bool] withClean @return [any]
# File lib/saklient/cloud/resources/script.rb, line 505 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 Saklient::Util::set_by_path(ret, 'Scope', @m_scope) if withClean || @n_scope Saklient::Util::set_by_path(ret, 'Class', @m_clazz) if withClean || @n_clazz if withClean || @n_name Saklient::Util::set_by_path(ret, 'Name', @m_name) else missing << 'name' if @is_new end Saklient::Util::set_by_path(ret, 'Description', @m_description) if withClean || @n_description if withClean || @n_tags Saklient::Util::set_by_path(ret, 'Tags', []) for r1 in @m_tags v = nil v = r1 ret[:Tags] << v end end Saklient::Util::set_by_path(ret, 'Icon', withClean ? ((@m_icon).nil? ? nil : @m_icon.api_serialize(withClean)) : ((@m_icon).nil? ? { ID: '0' } : @m_icon.api_serialize_id)) if withClean || @n_icon if withClean || @n_content Saklient::Util::set_by_path(ret, 'Content', @m_content) else missing << 'content' if @is_new end Saklient::Util::set_by_path(ret, 'Remark', @m_annotation) if withClean || @n_annotation raise Saklient::Errors::SaklientException.new('required_field', 'Required fields must be set before the Script creation: ' + missing.join(', ')) if missing.length > 0 return ret end
(This method is generated in Translator_default#buildImpl)
@private @return [any]
# File lib/saklient/cloud/resources/script.rb, line 404 def get_annotation return @m_annotation end
(This method is generated in Translator_default#buildImpl)
@private @return [String]
# File lib/saklient/cloud/resources/script.rb, line 179 def get_clazz return @m_clazz end
(This method is generated in Translator_default#buildImpl)
@private @return [String]
# File lib/saklient/cloud/resources/script.rb, line 364 def get_content return @m_content end
(This method is generated in Translator_default#buildImpl)
@private @return [String]
# File lib/saklient/cloud/resources/script.rb, line 243 def get_description return @m_description end
(This method is generated in Translator_default#buildImpl)
@private @return [Icon]
# File lib/saklient/cloud/resources/script.rb, line 324 def get_icon return @m_icon end
(This method is generated in Translator_default#buildImpl)
@private @return [String]
# File lib/saklient/cloud/resources/script.rb, line 131 def get_id return @m_id end
(This method is generated in Translator_default#buildImpl)
@private @return [String]
# File lib/saklient/cloud/resources/script.rb, line 219 def get_name return @m_name end
(This method is generated in Translator_default#buildImpl)
@private @return [String]
# File lib/saklient/cloud/resources/script.rb, line 155 def get_scope return @m_scope end
(This method is generated in Translator_default#buildImpl)
@private @param [String] v @return [String]
# File lib/saklient/cloud/resources/script.rb, line 188 def set_clazz(v) Saklient::Util::validate_type(v, 'String') @m_clazz = v @n_clazz = true return @m_clazz end
(This method is generated in Translator_default#buildImpl)
@private @param [String] v @return [String]
# File lib/saklient/cloud/resources/script.rb, line 373 def set_content(v) Saklient::Util::validate_type(v, 'String') @m_content = v @n_content = true return @m_content end
(This method is generated in Translator_default#buildImpl)
@private @param [String] v @return [String]
# File lib/saklient/cloud/resources/script.rb, line 252 def set_description(v) Saklient::Util::validate_type(v, 'String') @m_description = v @n_description = true return @m_description end
(This method is generated in Translator_default#buildImpl)
@private @param [Icon] v @return [Icon]
# File lib/saklient/cloud/resources/script.rb, line 333 def set_icon(v) Saklient::Util::validate_type(v, 'Saklient::Cloud::Resources::Icon') @m_icon = v @n_icon = true return @m_icon end