class Saklient::Cloud::Resources::Script

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

Attributes

annotation[R]

注釈

@return [any]

clazz[RW]

クラス {Saklient::Cloud::Enums::EScriptClass}

@return [String]

content[RW]

内容

@return [String]

description[RW]

説明

@return [String]

icon[RW]

アイコン

@return [Icon]

id[R]

ID

@return [String]

m_annotation[RW]

注釈

@return [any]

m_clazz[RW]

クラス {Saklient::Cloud::Enums::EScriptClass}

@return [String]

m_content[RW]

内容

@return [String]

m_description[RW]

説明

@return [String]

m_icon[RW]

アイコン

@return [Icon]

m_id[RW]

ID

@return [String]

m_name[RW]

名前

@return [String]

m_scope[RW]

スコープ {Saklient::Cloud::Enums::EScope}

@return [String]

m_tags[RW]

タグ文字列の配列

@return [Array<String>]

n_annotation[RW]

@return [bool]

n_clazz[RW]

@return [bool]

n_content[RW]

@return [bool]

n_description[RW]

@return [bool]

n_icon[RW]

@return [bool]

n_id[RW]

@return [bool]

n_name[RW]

@return [bool]

n_scope[RW]

@return [bool]

n_tags[RW]

@return [bool]

name[R]

名前

@return [String]

scope[R]

スコープ {Saklient::Cloud::Enums::EScope}

@return [String]

tags[RW]

タグ文字列の配列

@return [Array<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/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

_class_name() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/script.rb, line 87
def _class_name
  return 'Script'
end
_id() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/script.rb, line 93
def _id
  return get_id
end
clazz=(v) click to toggle source
# File lib/saklient/cloud/resources/script.rb, line 206
def clazz=(v)
  set_clazz(v)
end
content=(v) click to toggle source
# File lib/saklient/cloud/resources/script.rb, line 391
def content=(v)
  set_content(v)
end
description=(v) click to toggle source
# File lib/saklient/cloud/resources/script.rb, line 270
def description=(v)
  set_description(v)
end
icon=(v) click to toggle source
# File lib/saklient/cloud/resources/script.rb, line 351
def icon=(v)
  set_icon(v)
end
reload() click to toggle source

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

@return [Script] this

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

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

@return [Script] this

# File lib/saklient/cloud/resources/script.rb, line 100
def save
  return _save
end
tags=(v) click to toggle source
# File lib/saklient/cloud/resources/script.rb, line 311
def tags=(v)
  set_tags(v)
end

Protected Instance Methods

_api_path() click to toggle source

@private @return [String]

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

@private @return [String]

# File lib/saklient/cloud/resources/script.rb, line 73
def _root_key
  return 'Note'
end
_root_key_m() click to toggle source

@private @return [String]

# File lib/saklient/cloud/resources/script.rb, line 79
def _root_key_m
  return 'Notes'
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/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
api_serialize_impl(withClean = false) click to toggle source

@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
get_annotation() click to toggle source

(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
get_clazz() click to toggle source

(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
get_content() click to toggle source

(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
get_description() click to toggle source

(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
get_icon() click to toggle source

(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
get_id() click to toggle source

(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
get_name() click to toggle source

(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
get_scope() click to toggle source

(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
get_tags() click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @return [Array<String>]

# File lib/saklient/cloud/resources/script.rb, line 283
def get_tags
  @n_tags = true
  return @m_tags
end
set_clazz(v) click to toggle source

(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
set_content(v) click to toggle source

(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
set_description(v) click to toggle source

(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
set_icon(v) click to toggle source

(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
set_tags(v) click to toggle source

(This method is generated in Translator_default#buildImpl)

@private @param [Array<String>] v @return [Array<String>]

# File lib/saklient/cloud/resources/script.rb, line 293
def set_tags(v)
  Saklient::Util::validate_type(v, 'Array')
  @m_tags = v
  @n_tags = true
  return @m_tags
end