Class: Saklient::Cloud::Models::Model_Swytch
- Defined in:
- lib/saklient/cloud/models/model_swytch.rb
Overview
スイッチを検索・作成するための機能を備えたクラス.
Instance Attribute Summary
Attributes inherited from Model
#client, #count, #query, #total
Instance Method Summary collapse
-
#create ⇒ Saklient::Cloud::Resources::Swytch
新規リソース作成用のオブジェクトを用意します.
-
#filter_by(key, value, multiple = false) ⇒ Model_Swytch
Web APIのフィルタリング設定を直接指定します.
-
#find ⇒ Array<Saklient::Cloud::Resources::Swytch>
リソースの検索リクエストを実行し, 結果をリストで取得します.
-
#get_by_id(id) ⇒ Saklient::Cloud::Resources::Swytch
指定したIDを持つ唯一のリソースを取得します.
-
#initialize(client) ⇒ Model_Swytch
constructor
A new instance of Model_Swytch.
-
#limit(count) ⇒ Model_Swytch
次に取得するリストの上限レコード数を指定します.
-
#offset(offset) ⇒ Model_Swytch
次に取得するリストの開始オフセットを指定します.
-
#reset ⇒ Model_Swytch
次のリクエストのために設定されているステートをすべて破棄します.
-
#sort_by_name(reverse = false) ⇒ Model_Swytch
名前でソートします.
-
#with_name_like(name) ⇒ Model_Swytch
指定した文字列を名前に含むリソースに絞り込みます.
-
#with_tag(tag) ⇒ Model_Swytch
指定したタグを持つリソースに絞り込みます.
-
#with_tag_dnf(dnf) ⇒ Model_Swytch
指定したDNFに合致するタグを持つリソースに絞り込みます.
-
#with_tags(tags) ⇒ Model_Swytch
指定したすべてのタグを持つリソースに絞り込みます.
Constructor Details
#initialize(client) ⇒ Model_Swytch
Returns a new instance of Model_Swytch.
173 174 175 176 |
# File 'lib/saklient/cloud/models/model_swytch.rb', line 173 def initialize(client) super(client) Saklient::Util::validate_type(client, 'Saklient::Cloud::Client') end |
Instance Method Details
#create ⇒ Saklient::Cloud::Resources::Swytch
新規リソース作成用のオブジェクトを用意します.
返り値のオブジェクトにパラメータを設定し, save() を呼ぶことで実際のリソースが作成されます.
96 97 98 |
# File 'lib/saklient/cloud/models/model_swytch.rb', line 96 def create return _create end |
#filter_by(key, value, multiple = false) ⇒ Model_Swytch
Web APIのフィルタリング設定を直接指定します.
78 79 80 81 82 |
# File 'lib/saklient/cloud/models/model_swytch.rb', line 78 def filter_by(key, value, multiple = false) Saklient::Util::validate_type(key, 'String') Saklient::Util::validate_type(multiple, 'bool') return _filter_by(key, value, multiple) end |
#find ⇒ Array<Saklient::Cloud::Resources::Swytch>
リソースの検索リクエストを実行し, 結果をリストで取得します.
112 113 114 |
# File 'lib/saklient/cloud/models/model_swytch.rb', line 112 def find return _find end |
#get_by_id(id) ⇒ Saklient::Cloud::Resources::Swytch
指定したIDを持つ唯一のリソースを取得します.
104 105 106 107 |
# File 'lib/saklient/cloud/models/model_swytch.rb', line 104 def get_by_id(id) Saklient::Util::validate_type(id, 'String') return _get_by_id(id) end |
#limit(count) ⇒ Model_Swytch
次に取得するリストの上限レコード数を指定します.
67 68 69 70 |
# File 'lib/saklient/cloud/models/model_swytch.rb', line 67 def limit(count) Saklient::Util::validate_type(count, 'Fixnum') return _limit(count) end |
#offset(offset) ⇒ Model_Swytch
次に取得するリストの開始オフセットを指定します.
58 59 60 61 |
# File 'lib/saklient/cloud/models/model_swytch.rb', line 58 def offset(offset) Saklient::Util::validate_type(offset, 'Fixnum') return _offset(offset) end |
#reset ⇒ Model_Swytch
次のリクエストのために設定されているステートをすべて破棄します.
87 88 89 |
# File 'lib/saklient/cloud/models/model_swytch.rb', line 87 def reset return _reset end |
#sort_by_name(reverse = false) ⇒ Model_Swytch
Implement test case
名前でソートします.
166 167 168 169 |
# File 'lib/saklient/cloud/models/model_swytch.rb', line 166 def sort_by_name(reverse = false) Saklient::Util::validate_type(reverse, 'bool') return _sort_by_name(reverse) end |
#with_name_like(name) ⇒ Model_Swytch
Implement test case
指定した文字列を名前に含むリソースに絞り込みます.
大文字・小文字は区別されません. 半角スペースで区切られた複数の文字列は, それらをすべて含むことが条件とみなされます.
124 125 126 127 |
# File 'lib/saklient/cloud/models/model_swytch.rb', line 124 def with_name_like(name) Saklient::Util::validate_type(name, 'String') return _with_name_like(name) end |
#with_tag(tag) ⇒ Model_Swytch
Implement test case
指定したタグを持つリソースに絞り込みます.
複数のタグを指定する場合は withTags() を利用してください.
136 137 138 139 |
# File 'lib/saklient/cloud/models/model_swytch.rb', line 136 def with_tag(tag) Saklient::Util::validate_type(tag, 'String') return _with_tag(tag) end |
#with_tag_dnf(dnf) ⇒ Model_Swytch
Implement test case
指定したDNFに合致するタグを持つリソースに絞り込みます.
156 157 158 159 |
# File 'lib/saklient/cloud/models/model_swytch.rb', line 156 def with_tag_dnf(dnf) Saklient::Util::validate_type(dnf, 'Array') return _with_tag_dnf(dnf) end |
#with_tags(tags) ⇒ Model_Swytch
Implement test case
指定したすべてのタグを持つリソースに絞り込みます.
146 147 148 149 |
# File 'lib/saklient/cloud/models/model_swytch.rb', line 146 def () Saklient::Util::validate_type(, 'Array') return () end |