saklient 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +43 -0
  6. data/Rakefile +1 -0
  7. data/config.sh.sample +5 -0
  8. data/example.rb +83 -0
  9. data/example.sh +6 -0
  10. data/lib/saklient/cloud/api.rb +382 -0
  11. data/lib/saklient/cloud/client.rb +111 -0
  12. data/lib/saklient/cloud/enums/eappliance_class.rb +39 -0
  13. data/lib/saklient/cloud/enums/eavailability.rb +79 -0
  14. data/lib/saklient/cloud/enums/edisk_connection.rb +39 -0
  15. data/lib/saklient/cloud/enums/escope.rb +39 -0
  16. data/lib/saklient/cloud/enums/escript_class.rb +39 -0
  17. data/lib/saklient/cloud/enums/eserver_instance_status.rb +44 -0
  18. data/lib/saklient/cloud/enums/estorage_class.rb +34 -0
  19. data/lib/saklient/cloud/errors/access_api_key_disabled_exception.rb +23 -0
  20. data/lib/saklient/cloud/errors/access_sakura_exception.rb +23 -0
  21. data/lib/saklient/cloud/errors/access_staff_exception.rb +23 -0
  22. data/lib/saklient/cloud/errors/access_token_exception.rb +23 -0
  23. data/lib/saklient/cloud/errors/access_xhr_or_api_key_exception.rb +23 -0
  24. data/lib/saklient/cloud/errors/account_not_found_exception.rb +23 -0
  25. data/lib/saklient/cloud/errors/account_not_specified_exception.rb +23 -0
  26. data/lib/saklient/cloud/errors/ambiguous_identifier_exception.rb +23 -0
  27. data/lib/saklient/cloud/errors/ambiguous_zone_exception.rb +23 -0
  28. data/lib/saklient/cloud/errors/api_proxy_timeout_exception.rb +23 -0
  29. data/lib/saklient/cloud/errors/api_proxy_timeout_non_get_exception.rb +23 -0
  30. data/lib/saklient/cloud/errors/archive_is_incomplete_exception.rb +23 -0
  31. data/lib/saklient/cloud/errors/boot_failure_by_lock_exception.rb +23 -0
  32. data/lib/saklient/cloud/errors/boot_failure_in_group_exception.rb +23 -0
  33. data/lib/saklient/cloud/errors/busy_exception.rb +23 -0
  34. data/lib/saklient/cloud/errors/cant_resize_smaller_exception.rb +23 -0
  35. data/lib/saklient/cloud/errors/cdrom_device_locked_exception.rb +23 -0
  36. data/lib/saklient/cloud/errors/cdrom_disabled_exception.rb +23 -0
  37. data/lib/saklient/cloud/errors/cdrom_in_use_exception.rb +23 -0
  38. data/lib/saklient/cloud/errors/cdrom_is_incomplete_exception.rb +23 -0
  39. data/lib/saklient/cloud/errors/connect_to_same_switch_exception.rb +23 -0
  40. data/lib/saklient/cloud/errors/contract_creation_exception.rb +23 -0
  41. data/lib/saklient/cloud/errors/copy_to_itself_exception.rb +23 -0
  42. data/lib/saklient/cloud/errors/delete_disk_b4_template_exception.rb +23 -0
  43. data/lib/saklient/cloud/errors/delete_ip_v6_nets_first_exception.rb +23 -0
  44. data/lib/saklient/cloud/errors/delete_res_b4_account_exception.rb +23 -0
  45. data/lib/saklient/cloud/errors/delete_router_b4_switch_exception.rb +23 -0
  46. data/lib/saklient/cloud/errors/delete_static_route_first_exception.rb +23 -0
  47. data/lib/saklient/cloud/errors/disabled_in_sandbox_exception.rb +23 -0
  48. data/lib/saklient/cloud/errors/disconnect_b4_delete_exception.rb +23 -0
  49. data/lib/saklient/cloud/errors/disconnect_b4_update_exception.rb +23 -0
  50. data/lib/saklient/cloud/errors/disk_connection_limit_exception.rb +23 -0
  51. data/lib/saklient/cloud/errors/disk_is_copying_exception.rb +23 -0
  52. data/lib/saklient/cloud/errors/disk_is_not_available_exception.rb +23 -0
  53. data/lib/saklient/cloud/errors/disk_license_mismatch_exception.rb +23 -0
  54. data/lib/saklient/cloud/errors/disk_or_ss_in_migration_exception.rb +23 -0
  55. data/lib/saklient/cloud/errors/disk_stock_run_out_exception.rb +23 -0
  56. data/lib/saklient/cloud/errors/dns_aaaa_record_not_found_exception.rb +23 -0
  57. data/lib/saklient/cloud/errors/dns_arecord_not_found_exception.rb +23 -0
  58. data/lib/saklient/cloud/errors/dns_ptr_update_failure_exception.rb +23 -0
  59. data/lib/saklient/cloud/errors/dont_create_in_sandbox_exception.rb +23 -0
  60. data/lib/saklient/cloud/errors/duplicate_account_code_exception.rb +23 -0
  61. data/lib/saklient/cloud/errors/duplicate_entry_exception.rb +23 -0
  62. data/lib/saklient/cloud/errors/duplicate_user_code_exception.rb +23 -0
  63. data/lib/saklient/cloud/errors/file_not_uploaded_exception.rb +23 -0
  64. data/lib/saklient/cloud/errors/filter_array_comparison_exception.rb +23 -0
  65. data/lib/saklient/cloud/errors/filter_bad_operator_exception.rb +23 -0
  66. data/lib/saklient/cloud/errors/filter_null_comparison_exception.rb +23 -0
  67. data/lib/saklient/cloud/errors/filter_unknown_operator_exception.rb +23 -0
  68. data/lib/saklient/cloud/errors/ftp_cannot_close_exception.rb +23 -0
  69. data/lib/saklient/cloud/errors/ftp_is_already_close_exception.rb +23 -0
  70. data/lib/saklient/cloud/errors/ftp_is_already_open_exception.rb +23 -0
  71. data/lib/saklient/cloud/errors/ftp_must_be_closed_exception.rb +23 -0
  72. data/lib/saklient/cloud/errors/host_operation_failure_exception.rb +23 -0
  73. data/lib/saklient/cloud/errors/illegal_das_usage_exception.rb +23 -0
  74. data/lib/saklient/cloud/errors/in_migration_exception.rb +23 -0
  75. data/lib/saklient/cloud/errors/invalid_format_exception.rb +23 -0
  76. data/lib/saklient/cloud/errors/invalid_param_comb_exception.rb +23 -0
  77. data/lib/saklient/cloud/errors/invalid_range_exception.rb +23 -0
  78. data/lib/saklient/cloud/errors/invalid_uri_argument_exception.rb +23 -0
  79. data/lib/saklient/cloud/errors/ip_v6_net_already_attached_exception.rb +23 -0
  80. data/lib/saklient/cloud/errors/limit_count_in_account_exception.rb +23 -0
  81. data/lib/saklient/cloud/errors/limit_count_in_member_exception.rb +23 -0
  82. data/lib/saklient/cloud/errors/limit_count_in_network_exception.rb +23 -0
  83. data/lib/saklient/cloud/errors/limit_count_in_router_exception.rb +23 -0
  84. data/lib/saklient/cloud/errors/limit_count_in_zone_exception.rb +23 -0
  85. data/lib/saklient/cloud/errors/limit_memory_in_account_exception.rb +23 -0
  86. data/lib/saklient/cloud/errors/limit_size_in_account_exception.rb +23 -0
  87. data/lib/saklient/cloud/errors/missing_iso_image_exception.rb +23 -0
  88. data/lib/saklient/cloud/errors/missing_param_exception.rb +23 -0
  89. data/lib/saklient/cloud/errors/must_be_of_same_zone_exception.rb +23 -0
  90. data/lib/saklient/cloud/errors/no_display_response_exception.rb +23 -0
  91. data/lib/saklient/cloud/errors/not_for_router_exception.rb +23 -0
  92. data/lib/saklient/cloud/errors/not_replicating_exception.rb +23 -0
  93. data/lib/saklient/cloud/errors/not_with_hybridconn_exception.rb +23 -0
  94. data/lib/saklient/cloud/errors/old_storage_plan_exception.rb +23 -0
  95. data/lib/saklient/cloud/errors/operation_failure_exception.rb +23 -0
  96. data/lib/saklient/cloud/errors/operation_timeout_exception.rb +23 -0
  97. data/lib/saklient/cloud/errors/original_hash_mismatch_exception.rb +23 -0
  98. data/lib/saklient/cloud/errors/packet_filter_applying_exception.rb +23 -0
  99. data/lib/saklient/cloud/errors/packet_filter_version_mismatch_exception.rb +23 -0
  100. data/lib/saklient/cloud/errors/param_ip_not_found_exception.rb +23 -0
  101. data/lib/saklient/cloud/errors/param_res_not_found_exception.rb +23 -0
  102. data/lib/saklient/cloud/errors/payment_credit_card_exception.rb +23 -0
  103. data/lib/saklient/cloud/errors/payment_payment_exception.rb +23 -0
  104. data/lib/saklient/cloud/errors/payment_registration_exception.rb +23 -0
  105. data/lib/saklient/cloud/errors/payment_tel_certification_exception.rb +23 -0
  106. data/lib/saklient/cloud/errors/payment_unpayable_exception.rb +23 -0
  107. data/lib/saklient/cloud/errors/penalty_operation_exception.rb +23 -0
  108. data/lib/saklient/cloud/errors/replica_already_exists_exception.rb +23 -0
  109. data/lib/saklient/cloud/errors/replica_not_found_exception.rb +23 -0
  110. data/lib/saklient/cloud/errors/res_already_connected_exception.rb +23 -0
  111. data/lib/saklient/cloud/errors/res_already_disconnected_exception.rb +23 -0
  112. data/lib/saklient/cloud/errors/res_already_exists_exception.rb +23 -0
  113. data/lib/saklient/cloud/errors/res_used_in_zone_exception.rb +23 -0
  114. data/lib/saklient/cloud/errors/resource_path_not_found_exception.rb +23 -0
  115. data/lib/saklient/cloud/errors/run_out_of_ip_address_exception.rb +23 -0
  116. data/lib/saklient/cloud/errors/same_license_required_exception.rb +23 -0
  117. data/lib/saklient/cloud/errors/server_could_not_stop_exception.rb +23 -0
  118. data/lib/saklient/cloud/errors/server_is_cleaning_exception.rb +23 -0
  119. data/lib/saklient/cloud/errors/server_operation_failure_exception.rb +23 -0
  120. data/lib/saklient/cloud/errors/server_power_must_be_down_exception.rb +23 -0
  121. data/lib/saklient/cloud/errors/server_power_must_be_up_exception.rb +23 -0
  122. data/lib/saklient/cloud/errors/service_temporarily_unavailable_exception.rb +23 -0
  123. data/lib/saklient/cloud/errors/size_mismatch_exception.rb +23 -0
  124. data/lib/saklient/cloud/errors/snapshot_in_migration_exception.rb +23 -0
  125. data/lib/saklient/cloud/errors/still_creating_exception.rb +23 -0
  126. data/lib/saklient/cloud/errors/storage_abnormal_exception.rb +23 -0
  127. data/lib/saklient/cloud/errors/storage_operation_failure_exception.rb +23 -0
  128. data/lib/saklient/cloud/errors/switch_hybrid_connected_exception.rb +23 -0
  129. data/lib/saklient/cloud/errors/template_ftp_is_open_exception.rb +23 -0
  130. data/lib/saklient/cloud/errors/template_is_incomplete_exception.rb +23 -0
  131. data/lib/saklient/cloud/errors/too_many_request_exception.rb +23 -0
  132. data/lib/saklient/cloud/errors/unknown_exception.rb +23 -0
  133. data/lib/saklient/cloud/errors/unknown_os_type_exception.rb +23 -0
  134. data/lib/saklient/cloud/errors/unsupported_res_class_exception.rb +23 -0
  135. data/lib/saklient/cloud/errors/user_not_specified_exception.rb +23 -0
  136. data/lib/saklient/cloud/errors/vnc_proxy_request_failure_exception.rb +23 -0
  137. data/lib/saklient/cloud/models/model.rb +348 -0
  138. data/lib/saklient/cloud/models/model_appliance.rb +161 -0
  139. data/lib/saklient/cloud/models/model_archive.rb +207 -0
  140. data/lib/saklient/cloud/models/model_disk.rb +200 -0
  141. data/lib/saklient/cloud/models/model_disk_plan.rb +156 -0
  142. data/lib/saklient/cloud/models/model_icon.rb +178 -0
  143. data/lib/saklient/cloud/models/model_iface.rb +115 -0
  144. data/lib/saklient/cloud/models/model_ipv6_net.rb +106 -0
  145. data/lib/saklient/cloud/models/model_iso_image.rb +207 -0
  146. data/lib/saklient/cloud/models/model_router.rb +148 -0
  147. data/lib/saklient/cloud/models/model_router_plan.rb +106 -0
  148. data/lib/saklient/cloud/models/model_script.rb +178 -0
  149. data/lib/saklient/cloud/models/model_server.rb +237 -0
  150. data/lib/saklient/cloud/models/model_server_plan.rb +119 -0
  151. data/lib/saklient/cloud/models/model_swytch.rb +138 -0
  152. data/lib/saklient/cloud/models/query_params.rb +44 -0
  153. data/lib/saklient/cloud/product.rb +95 -0
  154. data/lib/saklient/cloud/resources/appliance.rb +551 -0
  155. data/lib/saklient/cloud/resources/archive.rb +861 -0
  156. data/lib/saklient/cloud/resources/disk.rb +802 -0
  157. data/lib/saklient/cloud/resources/disk_config.rb +353 -0
  158. data/lib/saklient/cloud/resources/disk_plan.rb +194 -0
  159. data/lib/saklient/cloud/resources/ftp_info.rb +93 -0
  160. data/lib/saklient/cloud/resources/icon.rb +268 -0
  161. data/lib/saklient/cloud/resources/iface.rb +329 -0
  162. data/lib/saklient/cloud/resources/ipv4_net.rb +275 -0
  163. data/lib/saklient/cloud/resources/ipv6_net.rb +238 -0
  164. data/lib/saklient/cloud/resources/iso_image.rb +666 -0
  165. data/lib/saklient/cloud/resources/resource.rb +287 -0
  166. data/lib/saklient/cloud/resources/router.rb +508 -0
  167. data/lib/saklient/cloud/resources/router_plan.rb +230 -0
  168. data/lib/saklient/cloud/resources/script.rb +554 -0
  169. data/lib/saklient/cloud/resources/server.rb +730 -0
  170. data/lib/saklient/cloud/resources/server_instance.rb +217 -0
  171. data/lib/saklient/cloud/resources/server_plan.rb +285 -0
  172. data/lib/saklient/cloud/resources/swytch.rb +521 -0
  173. data/lib/saklient/errors/exception_factory.rb +532 -0
  174. data/lib/saklient/errors/http_bad_gateway_exception.rb +21 -0
  175. data/lib/saklient/errors/http_bad_request_exception.rb +21 -0
  176. data/lib/saklient/errors/http_conflict_exception.rb +21 -0
  177. data/lib/saklient/errors/http_exception.rb +27 -0
  178. data/lib/saklient/errors/http_expectation_failed_exception.rb +21 -0
  179. data/lib/saklient/errors/http_failed_dependency_exception.rb +21 -0
  180. data/lib/saklient/errors/http_forbidden_exception.rb +21 -0
  181. data/lib/saklient/errors/http_gateway_timeout_exception.rb +21 -0
  182. data/lib/saklient/errors/http_gone_exception.rb +21 -0
  183. data/lib/saklient/errors/http_http_version_not_supported_exception.rb +21 -0
  184. data/lib/saklient/errors/http_insufficient_storage_exception.rb +21 -0
  185. data/lib/saklient/errors/http_internal_server_error_exception.rb +21 -0
  186. data/lib/saklient/errors/http_length_required_exception.rb +21 -0
  187. data/lib/saklient/errors/http_locked_exception.rb +21 -0
  188. data/lib/saklient/errors/http_method_not_allowed_exception.rb +21 -0
  189. data/lib/saklient/errors/http_not_acceptable_exception.rb +21 -0
  190. data/lib/saklient/errors/http_not_extended_exception.rb +21 -0
  191. data/lib/saklient/errors/http_not_found_exception.rb +21 -0
  192. data/lib/saklient/errors/http_not_implemented_exception.rb +21 -0
  193. data/lib/saklient/errors/http_payment_required_exception.rb +21 -0
  194. data/lib/saklient/errors/http_precondition_failed_exception.rb +21 -0
  195. data/lib/saklient/errors/http_proxy_authentication_required_exception.rb +21 -0
  196. data/lib/saklient/errors/http_request_entity_too_large_exception.rb +21 -0
  197. data/lib/saklient/errors/http_request_timeout_exception.rb +21 -0
  198. data/lib/saklient/errors/http_request_uri_too_long_exception.rb +21 -0
  199. data/lib/saklient/errors/http_requested_range_not_satisfiable_exception.rb +21 -0
  200. data/lib/saklient/errors/http_service_unavailable_exception.rb +21 -0
  201. data/lib/saklient/errors/http_unauthorized_exception.rb +21 -0
  202. data/lib/saklient/errors/http_unprocessable_entity_exception.rb +21 -0
  203. data/lib/saklient/errors/http_unsupported_media_type_exception.rb +21 -0
  204. data/lib/saklient/errors/http_upgrade_required_exception.rb +21 -0
  205. data/lib/saklient/errors/http_variant_also_negotiates_exception.rb +21 -0
  206. data/lib/saklient/errors/saklient_exception.rb +22 -0
  207. data/lib/saklient/util.rb +121 -0
  208. data/lib/saklient/version.rb +5 -0
  209. data/saklient.gemspec +24 -0
  210. data/spec/archive_spec.rb +141 -0
  211. data/spec/enum_spec.rb +24 -0
  212. data/spec/exception_spec.rb +25 -0
  213. data/spec/iso_image_spec.rb +172 -0
  214. data/spec/router_spec.rb +124 -0
  215. data/spec/server_spec.rb +261 -0
  216. data/spec/util_spec.rb +72 -0
  217. data/test-sshkey.txt +27 -0
  218. metadata +281 -0
@@ -0,0 +1,666 @@
1
+ # -*- encoding: UTF-8 -*-
2
+
3
+ require_relative '../client'
4
+ require_relative 'resource'
5
+ require_relative 'icon'
6
+ require_relative 'ftp_info'
7
+ require_relative '../enums/escope'
8
+ require_relative '../../errors/saklient_exception'
9
+
10
+ module Saklient
11
+ module Cloud
12
+ module Resources
13
+
14
+ # ISOイメージの実体1つに対応し, 属性の取得や操作を行うためのクラス.
15
+ class IsoImage < Saklient::Cloud::Resources::Resource
16
+
17
+ protected
18
+
19
+ # ID
20
+ #
21
+ # @return [String]
22
+ attr_accessor :m_id
23
+
24
+ # スコープ {Saklient::Cloud::Enums::EScope}
25
+ #
26
+ # @return [String]
27
+ attr_accessor :m_scope
28
+
29
+ # 名前
30
+ #
31
+ # @return [String]
32
+ attr_accessor :m_name
33
+
34
+ # 説明
35
+ #
36
+ # @return [String]
37
+ attr_accessor :m_description
38
+
39
+ # タグ
40
+ #
41
+ # @return [Array<String>]
42
+ attr_accessor :m_tags
43
+
44
+ # アイコン
45
+ #
46
+ # @return [Icon]
47
+ attr_accessor :m_icon
48
+
49
+ # 表示順序
50
+ #
51
+ # @return [Fixnum]
52
+ attr_accessor :m_display_order
53
+
54
+ # サイズ[MiB]
55
+ #
56
+ # @return [Fixnum]
57
+ attr_accessor :m_size_mib
58
+
59
+ # サービスクラス
60
+ #
61
+ # @return [String]
62
+ attr_accessor :m_service_class
63
+
64
+ # @private
65
+ # @return [String]
66
+ def _api_path
67
+ return '/cdrom'
68
+ end
69
+
70
+ # @private
71
+ # @return [String]
72
+ def _root_key
73
+ return 'CDROM'
74
+ end
75
+
76
+ # @private
77
+ # @return [String]
78
+ def _root_key_m
79
+ return 'CDROMs'
80
+ end
81
+
82
+ public
83
+
84
+ # @private
85
+ # @return [String]
86
+ def _class_name
87
+ return 'IsoImage'
88
+ end
89
+
90
+ # @private
91
+ # @return [String]
92
+ def _id
93
+ return get_id
94
+ end
95
+
96
+ # このローカルオブジェクトに現在設定されているリソース情報をAPIに送信し, 新規作成または上書き保存します.
97
+ #
98
+ # @return [IsoImage] this
99
+ def save
100
+ return _save
101
+ end
102
+
103
+ # 最新のリソース情報を再取得します.
104
+ #
105
+ # @return [IsoImage] this
106
+ def reload
107
+ return _reload
108
+ end
109
+
110
+ # @private
111
+ # @param [Saklient::Cloud::Client] client
112
+ # @param [any] obj
113
+ # @param [bool] wrapped
114
+ def initialize(client, obj, wrapped = false)
115
+ super(client)
116
+ Saklient::Util::validate_type(client, 'Saklient::Cloud::Client')
117
+ Saklient::Util::validate_type(wrapped, 'bool')
118
+ api_deserialize(obj, wrapped)
119
+ end
120
+
121
+ protected
122
+
123
+ # @private
124
+ # @param [any] r
125
+ # @param [any] root
126
+ # @return [void]
127
+ def _on_after_api_deserialize(r, root)
128
+ return nil if (root).nil?
129
+ if !root.nil? && root.key?(:FTPServer)
130
+ ftp = root[:FTPServer]
131
+ @_ftp_info = Saklient::Cloud::Resources::FtpInfo.new(ftp) if !(ftp).nil?
132
+ end
133
+ end
134
+
135
+ # @private
136
+ # @return [Fixnum]
137
+ def get_size_gib
138
+ sizeMib = get_size_mib
139
+ return (sizeMib).nil? ? nil : sizeMib >> 10
140
+ end
141
+
142
+ # @private
143
+ # @param [Fixnum] sizeGib
144
+ # @return [Fixnum]
145
+ def set_size_gib(sizeGib)
146
+ Saklient::Util::validate_type(sizeGib, 'Fixnum')
147
+ set_size_mib((sizeGib).nil? ? nil : sizeGib * 1024)
148
+ return sizeGib
149
+ end
150
+
151
+ public
152
+
153
+ # サイズ[GiB]
154
+ #
155
+ # @return [Fixnum]
156
+ attr_accessor :size_gib
157
+
158
+ def size_gib
159
+ get_size_gib
160
+ end
161
+
162
+ def size_gib=(v)
163
+ set_size_gib(v)
164
+ end
165
+
166
+ protected
167
+
168
+ # @private
169
+ # @return [FtpInfo]
170
+ attr_accessor :_ftp_info
171
+
172
+ public
173
+
174
+ # @private
175
+ # @return [FtpInfo]
176
+ def get_ftp_info
177
+ return @_ftp_info
178
+ end
179
+
180
+ # FTP情報
181
+ #
182
+ # @return [FtpInfo]
183
+ attr_reader :ftp_info
184
+
185
+ def ftp_info
186
+ get_ftp_info
187
+ end
188
+
189
+ # FTPSを開始し, イメージファイルをアップロード・ダウンロードできる状態にします.
190
+ #
191
+ # アカウント情報は, ftpInfo プロパティから取得することができます.
192
+ #
193
+ # @param [bool] reset 既にFTPSが開始されているとき, trueを指定してこのメソッドを呼ぶことでパスワードを再設定します.
194
+ # @return [IsoImage] this
195
+ def open_ftp(reset = false)
196
+ Saklient::Util::validate_type(reset, 'bool')
197
+ path = _api_path + '/' + Saklient::Util::url_encode(_id) + '/ftp'
198
+ q = {}
199
+ Saklient::Util::set_by_path(q, 'ChangePassword', reset)
200
+ result = @_client.request('PUT', path, q)
201
+ _on_after_api_deserialize(nil, result)
202
+ return self
203
+ end
204
+
205
+ # FTPSを終了し, ISOイメージを利用可能な状態にします.
206
+ #
207
+ # @return [IsoImage] this
208
+ def close_ftp
209
+ path = _api_path + '/' + Saklient::Util::url_encode(_id) + '/ftp'
210
+ @_client.request('DELETE', path)
211
+ @_ftp_info = nil
212
+ return self
213
+ end
214
+
215
+ protected
216
+
217
+ # @return [bool]
218
+ attr_accessor :n_id
219
+
220
+ # (This method is generated in Translator_default#buildImpl)
221
+ #
222
+ # @private
223
+ # @return [String]
224
+ def get_id
225
+ return @m_id
226
+ end
227
+
228
+ public
229
+
230
+ # ID
231
+ #
232
+ # @return [String]
233
+ attr_reader :id
234
+
235
+ def id
236
+ get_id
237
+ end
238
+
239
+ protected
240
+
241
+ # @return [bool]
242
+ attr_accessor :n_scope
243
+
244
+ # (This method is generated in Translator_default#buildImpl)
245
+ #
246
+ # @private
247
+ # @return [String]
248
+ def get_scope
249
+ return @m_scope
250
+ end
251
+
252
+ # (This method is generated in Translator_default#buildImpl)
253
+ #
254
+ # @private
255
+ # @param [String] v
256
+ # @return [String]
257
+ def set_scope(v)
258
+ Saklient::Util::validate_type(v, 'String')
259
+ @m_scope = v
260
+ @n_scope = true
261
+ return @m_scope
262
+ end
263
+
264
+ public
265
+
266
+ # スコープ {Saklient::Cloud::Enums::EScope}
267
+ #
268
+ # @return [String]
269
+ attr_accessor :scope
270
+
271
+ def scope
272
+ get_scope
273
+ end
274
+
275
+ def scope=(v)
276
+ set_scope(v)
277
+ end
278
+
279
+ protected
280
+
281
+ # @return [bool]
282
+ attr_accessor :n_name
283
+
284
+ # (This method is generated in Translator_default#buildImpl)
285
+ #
286
+ # @private
287
+ # @return [String]
288
+ def get_name
289
+ return @m_name
290
+ end
291
+
292
+ # (This method is generated in Translator_default#buildImpl)
293
+ #
294
+ # @private
295
+ # @param [String] v
296
+ # @return [String]
297
+ def set_name(v)
298
+ Saklient::Util::validate_type(v, 'String')
299
+ @m_name = v
300
+ @n_name = true
301
+ return @m_name
302
+ end
303
+
304
+ public
305
+
306
+ # 名前
307
+ #
308
+ # @return [String]
309
+ attr_accessor :name
310
+
311
+ def name
312
+ get_name
313
+ end
314
+
315
+ def name=(v)
316
+ set_name(v)
317
+ end
318
+
319
+ protected
320
+
321
+ # @return [bool]
322
+ attr_accessor :n_description
323
+
324
+ # (This method is generated in Translator_default#buildImpl)
325
+ #
326
+ # @private
327
+ # @return [String]
328
+ def get_description
329
+ return @m_description
330
+ end
331
+
332
+ # (This method is generated in Translator_default#buildImpl)
333
+ #
334
+ # @private
335
+ # @param [String] v
336
+ # @return [String]
337
+ def set_description(v)
338
+ Saklient::Util::validate_type(v, 'String')
339
+ @m_description = v
340
+ @n_description = true
341
+ return @m_description
342
+ end
343
+
344
+ public
345
+
346
+ # 説明
347
+ #
348
+ # @return [String]
349
+ attr_accessor :description
350
+
351
+ def description
352
+ get_description
353
+ end
354
+
355
+ def description=(v)
356
+ set_description(v)
357
+ end
358
+
359
+ protected
360
+
361
+ # @return [bool]
362
+ attr_accessor :n_tags
363
+
364
+ # (This method is generated in Translator_default#buildImpl)
365
+ #
366
+ # @private
367
+ # @return [Array<String>]
368
+ def get_tags
369
+ return @m_tags
370
+ end
371
+
372
+ # (This method is generated in Translator_default#buildImpl)
373
+ #
374
+ # @private
375
+ # @param [Array<String>] v
376
+ # @return [Array<String>]
377
+ def set_tags(v)
378
+ Saklient::Util::validate_type(v, 'Array')
379
+ @m_tags = v
380
+ @n_tags = true
381
+ return @m_tags
382
+ end
383
+
384
+ public
385
+
386
+ # タグ
387
+ #
388
+ # @return [Array<String>]
389
+ attr_accessor :tags
390
+
391
+ def tags
392
+ get_tags
393
+ end
394
+
395
+ def tags=(v)
396
+ set_tags(v)
397
+ end
398
+
399
+ protected
400
+
401
+ # @return [bool]
402
+ attr_accessor :n_icon
403
+
404
+ # (This method is generated in Translator_default#buildImpl)
405
+ #
406
+ # @private
407
+ # @return [Icon]
408
+ def get_icon
409
+ return @m_icon
410
+ end
411
+
412
+ # (This method is generated in Translator_default#buildImpl)
413
+ #
414
+ # @private
415
+ # @param [Icon] v
416
+ # @return [Icon]
417
+ def set_icon(v)
418
+ Saklient::Util::validate_type(v, 'Saklient::Cloud::Resources::Icon')
419
+ @m_icon = v
420
+ @n_icon = true
421
+ return @m_icon
422
+ end
423
+
424
+ public
425
+
426
+ # アイコン
427
+ #
428
+ # @return [Icon]
429
+ attr_accessor :icon
430
+
431
+ def icon
432
+ get_icon
433
+ end
434
+
435
+ def icon=(v)
436
+ set_icon(v)
437
+ end
438
+
439
+ protected
440
+
441
+ # @return [bool]
442
+ attr_accessor :n_display_order
443
+
444
+ # (This method is generated in Translator_default#buildImpl)
445
+ #
446
+ # @private
447
+ # @return [Fixnum]
448
+ def get_display_order
449
+ return @m_display_order
450
+ end
451
+
452
+ # (This method is generated in Translator_default#buildImpl)
453
+ #
454
+ # @private
455
+ # @param [Fixnum] v
456
+ # @return [Fixnum]
457
+ def set_display_order(v)
458
+ Saklient::Util::validate_type(v, 'Fixnum')
459
+ @m_display_order = v
460
+ @n_display_order = true
461
+ return @m_display_order
462
+ end
463
+
464
+ public
465
+
466
+ # 表示順序
467
+ #
468
+ # @return [Fixnum]
469
+ attr_accessor :display_order
470
+
471
+ def display_order
472
+ get_display_order
473
+ end
474
+
475
+ def display_order=(v)
476
+ set_display_order(v)
477
+ end
478
+
479
+ protected
480
+
481
+ # @return [bool]
482
+ attr_accessor :n_size_mib
483
+
484
+ # (This method is generated in Translator_default#buildImpl)
485
+ #
486
+ # @private
487
+ # @return [Fixnum]
488
+ def get_size_mib
489
+ return @m_size_mib
490
+ end
491
+
492
+ # (This method is generated in Translator_default#buildImpl)
493
+ #
494
+ # @private
495
+ # @param [Fixnum] v
496
+ # @return [Fixnum]
497
+ def set_size_mib(v)
498
+ Saklient::Util::validate_type(v, 'Fixnum')
499
+ raise Saklient::Errors::SaklientException.new('immutable_field', 'Immutable fields cannot be modified after the resource creation: ' + 'Saklient::Cloud::Resources::IsoImage#size_mib') if !@is_new
500
+ @m_size_mib = v
501
+ @n_size_mib = true
502
+ return @m_size_mib
503
+ end
504
+
505
+ public
506
+
507
+ # サイズ[MiB]
508
+ #
509
+ # @return [Fixnum]
510
+ attr_accessor :size_mib
511
+
512
+ def size_mib
513
+ get_size_mib
514
+ end
515
+
516
+ def size_mib=(v)
517
+ set_size_mib(v)
518
+ end
519
+
520
+ protected
521
+
522
+ # @return [bool]
523
+ attr_accessor :n_service_class
524
+
525
+ # (This method is generated in Translator_default#buildImpl)
526
+ #
527
+ # @private
528
+ # @return [String]
529
+ def get_service_class
530
+ return @m_service_class
531
+ end
532
+
533
+ public
534
+
535
+ # サービスクラス
536
+ #
537
+ # @return [String]
538
+ attr_reader :service_class
539
+
540
+ def service_class
541
+ get_service_class
542
+ end
543
+
544
+ protected
545
+
546
+ # (This method is generated in Translator_default#buildImpl)
547
+ #
548
+ # @param [any] r
549
+ def api_deserialize_impl(r)
550
+ @is_new = (r).nil?
551
+ r = {} if @is_new
552
+ @is_incomplete = false
553
+ if Saklient::Util::exists_path(r, 'ID')
554
+ @m_id = (Saklient::Util::get_by_path(r, 'ID')).nil? ? nil : Saklient::Util::get_by_path(r, 'ID').to_s
555
+ else
556
+ @m_id = nil
557
+ @is_incomplete = true
558
+ end
559
+ @n_id = false
560
+ if Saklient::Util::exists_path(r, 'Scope')
561
+ @m_scope = (Saklient::Util::get_by_path(r, 'Scope')).nil? ? nil : Saklient::Util::get_by_path(r, 'Scope').to_s
562
+ else
563
+ @m_scope = nil
564
+ @is_incomplete = true
565
+ end
566
+ @n_scope = false
567
+ if Saklient::Util::exists_path(r, 'Name')
568
+ @m_name = (Saklient::Util::get_by_path(r, 'Name')).nil? ? nil : Saklient::Util::get_by_path(r, 'Name').to_s
569
+ else
570
+ @m_name = nil
571
+ @is_incomplete = true
572
+ end
573
+ @n_name = false
574
+ if Saklient::Util::exists_path(r, 'Description')
575
+ @m_description = (Saklient::Util::get_by_path(r, 'Description')).nil? ? nil : Saklient::Util::get_by_path(r, 'Description').to_s
576
+ else
577
+ @m_description = nil
578
+ @is_incomplete = true
579
+ end
580
+ @n_description = false
581
+ if Saklient::Util::exists_path(r, 'Tags')
582
+ if (Saklient::Util::get_by_path(r, 'Tags')).nil?
583
+ @m_tags = []
584
+ else
585
+ @m_tags = []
586
+ for t in Saklient::Util::get_by_path(r, 'Tags')
587
+ v1 = nil
588
+ v1 = (t).nil? ? nil : t.to_s
589
+ @m_tags << v1
590
+ end
591
+ end
592
+ else
593
+ @m_tags = nil
594
+ @is_incomplete = true
595
+ end
596
+ @n_tags = false
597
+ if Saklient::Util::exists_path(r, 'Icon')
598
+ @m_icon = (Saklient::Util::get_by_path(r, 'Icon')).nil? ? nil : Saklient::Cloud::Resources::Icon.new(@_client, Saklient::Util::get_by_path(r, 'Icon'))
599
+ else
600
+ @m_icon = nil
601
+ @is_incomplete = true
602
+ end
603
+ @n_icon = false
604
+ if Saklient::Util::exists_path(r, 'DisplayOrder')
605
+ @m_display_order = (Saklient::Util::get_by_path(r, 'DisplayOrder')).nil? ? nil : (Saklient::Util::get_by_path(r, 'DisplayOrder').to_s).to_i(10)
606
+ else
607
+ @m_display_order = nil
608
+ @is_incomplete = true
609
+ end
610
+ @n_display_order = false
611
+ if Saklient::Util::exists_path(r, 'SizeMB')
612
+ @m_size_mib = (Saklient::Util::get_by_path(r, 'SizeMB')).nil? ? nil : (Saklient::Util::get_by_path(r, 'SizeMB').to_s).to_i(10)
613
+ else
614
+ @m_size_mib = nil
615
+ @is_incomplete = true
616
+ end
617
+ @n_size_mib = false
618
+ if Saklient::Util::exists_path(r, 'ServiceClass')
619
+ @m_service_class = (Saklient::Util::get_by_path(r, 'ServiceClass')).nil? ? nil : Saklient::Util::get_by_path(r, 'ServiceClass').to_s
620
+ else
621
+ @m_service_class = nil
622
+ @is_incomplete = true
623
+ end
624
+ @n_service_class = false
625
+ end
626
+
627
+ # @private
628
+ # @param [bool] withClean
629
+ # @return [any]
630
+ def api_serialize_impl(withClean = false)
631
+ Saklient::Util::validate_type(withClean, 'bool')
632
+ missing = []
633
+ ret = {}
634
+ Saklient::Util::set_by_path(ret, 'ID', @m_id) if withClean || @n_id
635
+ Saklient::Util::set_by_path(ret, 'Scope', @m_scope) if withClean || @n_scope
636
+ if withClean || @n_name
637
+ Saklient::Util::set_by_path(ret, 'Name', @m_name)
638
+ else
639
+ missing << 'name' if @is_new
640
+ end
641
+ Saklient::Util::set_by_path(ret, 'Description', @m_description) if withClean || @n_description
642
+ if withClean || @n_tags
643
+ Saklient::Util::set_by_path(ret, 'Tags', [])
644
+ for r1 in @m_tags
645
+ v = nil
646
+ v = r1
647
+ ret[:Tags] << v
648
+ end
649
+ end
650
+ 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
651
+ Saklient::Util::set_by_path(ret, 'DisplayOrder', @m_display_order) if withClean || @n_display_order
652
+ if withClean || @n_size_mib
653
+ Saklient::Util::set_by_path(ret, 'SizeMB', @m_size_mib)
654
+ else
655
+ missing << 'size_mib' if @is_new
656
+ end
657
+ Saklient::Util::set_by_path(ret, 'ServiceClass', @m_service_class) if withClean || @n_service_class
658
+ raise Saklient::Errors::SaklientException.new('required_field', 'Required fields must be set before the IsoImage creation: ' + missing.join(', ')) if missing.length > 0
659
+ return ret
660
+ end
661
+
662
+ end
663
+
664
+ end
665
+ end
666
+ end