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,554 @@
1
+ # -*- encoding: UTF-8 -*-
2
+
3
+ require_relative '../../errors/saklient_exception'
4
+ require_relative '../client'
5
+ require_relative 'resource'
6
+ require_relative 'icon'
7
+ require_relative '../enums/escope'
8
+ require_relative '../enums/escript_class'
9
+
10
+ module Saklient
11
+ module Cloud
12
+ module Resources
13
+
14
+ # スクリプトの実体1つに対応し, 属性の取得や操作を行うためのクラス.
15
+ class Script < 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
+ # クラス {Saklient::Cloud::Enums::EScriptClass}
30
+ #
31
+ # @return [String]
32
+ attr_accessor :m_clazz
33
+
34
+ # 名前
35
+ #
36
+ # @return [String]
37
+ attr_accessor :m_name
38
+
39
+ # 説明
40
+ #
41
+ # @return [String]
42
+ attr_accessor :m_description
43
+
44
+ # タグ
45
+ #
46
+ # @return [Array<String>]
47
+ attr_accessor :m_tags
48
+
49
+ # アイコン
50
+ #
51
+ # @return [Icon]
52
+ attr_accessor :m_icon
53
+
54
+ # 内容
55
+ #
56
+ # @return [String]
57
+ attr_accessor :m_content
58
+
59
+ # 注釈
60
+ #
61
+ # @return [any]
62
+ attr_accessor :m_annotation
63
+
64
+ # @private
65
+ # @return [String]
66
+ def _api_path
67
+ return '/note'
68
+ end
69
+
70
+ # @private
71
+ # @return [String]
72
+ def _root_key
73
+ return 'Note'
74
+ end
75
+
76
+ # @private
77
+ # @return [String]
78
+ def _root_key_m
79
+ return 'Notes'
80
+ end
81
+
82
+ public
83
+
84
+ # @private
85
+ # @return [String]
86
+ def _class_name
87
+ return 'Script'
88
+ end
89
+
90
+ # @private
91
+ # @return [String]
92
+ def _id
93
+ return get_id
94
+ end
95
+
96
+ # このローカルオブジェクトに現在設定されているリソース情報をAPIに送信し, 新規作成または上書き保存します.
97
+ #
98
+ # @return [Script] this
99
+ def save
100
+ return _save
101
+ end
102
+
103
+ # 最新のリソース情報を再取得します.
104
+ #
105
+ # @return [Script] 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
+ # @return [bool]
124
+ attr_accessor :n_id
125
+
126
+ # (This method is generated in Translator_default#buildImpl)
127
+ #
128
+ # @private
129
+ # @return [String]
130
+ def get_id
131
+ return @m_id
132
+ end
133
+
134
+ public
135
+
136
+ # ID
137
+ #
138
+ # @return [String]
139
+ attr_reader :id
140
+
141
+ def id
142
+ get_id
143
+ end
144
+
145
+ protected
146
+
147
+ # @return [bool]
148
+ attr_accessor :n_scope
149
+
150
+ # (This method is generated in Translator_default#buildImpl)
151
+ #
152
+ # @private
153
+ # @return [String]
154
+ def get_scope
155
+ return @m_scope
156
+ end
157
+
158
+ public
159
+
160
+ # スコープ {Saklient::Cloud::Enums::EScope}
161
+ #
162
+ # @return [String]
163
+ attr_reader :scope
164
+
165
+ def scope
166
+ get_scope
167
+ end
168
+
169
+ protected
170
+
171
+ # @return [bool]
172
+ attr_accessor :n_clazz
173
+
174
+ # (This method is generated in Translator_default#buildImpl)
175
+ #
176
+ # @private
177
+ # @return [String]
178
+ def get_clazz
179
+ return @m_clazz
180
+ end
181
+
182
+ # (This method is generated in Translator_default#buildImpl)
183
+ #
184
+ # @private
185
+ # @param [String] v
186
+ # @return [String]
187
+ def set_clazz(v)
188
+ Saklient::Util::validate_type(v, 'String')
189
+ @m_clazz = v
190
+ @n_clazz = true
191
+ return @m_clazz
192
+ end
193
+
194
+ public
195
+
196
+ # クラス {Saklient::Cloud::Enums::EScriptClass}
197
+ #
198
+ # @return [String]
199
+ attr_accessor :clazz
200
+
201
+ def clazz
202
+ get_clazz
203
+ end
204
+
205
+ def clazz=(v)
206
+ set_clazz(v)
207
+ end
208
+
209
+ protected
210
+
211
+ # @return [bool]
212
+ attr_accessor :n_name
213
+
214
+ # (This method is generated in Translator_default#buildImpl)
215
+ #
216
+ # @private
217
+ # @return [String]
218
+ def get_name
219
+ return @m_name
220
+ end
221
+
222
+ public
223
+
224
+ # 名前
225
+ #
226
+ # @return [String]
227
+ attr_reader :name
228
+
229
+ def name
230
+ get_name
231
+ end
232
+
233
+ protected
234
+
235
+ # @return [bool]
236
+ attr_accessor :n_description
237
+
238
+ # (This method is generated in Translator_default#buildImpl)
239
+ #
240
+ # @private
241
+ # @return [String]
242
+ def get_description
243
+ return @m_description
244
+ end
245
+
246
+ # (This method is generated in Translator_default#buildImpl)
247
+ #
248
+ # @private
249
+ # @param [String] v
250
+ # @return [String]
251
+ def set_description(v)
252
+ Saklient::Util::validate_type(v, 'String')
253
+ @m_description = v
254
+ @n_description = true
255
+ return @m_description
256
+ end
257
+
258
+ public
259
+
260
+ # 説明
261
+ #
262
+ # @return [String]
263
+ attr_accessor :description
264
+
265
+ def description
266
+ get_description
267
+ end
268
+
269
+ def description=(v)
270
+ set_description(v)
271
+ end
272
+
273
+ protected
274
+
275
+ # @return [bool]
276
+ attr_accessor :n_tags
277
+
278
+ # (This method is generated in Translator_default#buildImpl)
279
+ #
280
+ # @private
281
+ # @return [Array<String>]
282
+ def get_tags
283
+ return @m_tags
284
+ end
285
+
286
+ # (This method is generated in Translator_default#buildImpl)
287
+ #
288
+ # @private
289
+ # @param [Array<String>] v
290
+ # @return [Array<String>]
291
+ def set_tags(v)
292
+ Saklient::Util::validate_type(v, 'Array')
293
+ @m_tags = v
294
+ @n_tags = true
295
+ return @m_tags
296
+ end
297
+
298
+ public
299
+
300
+ # タグ
301
+ #
302
+ # @return [Array<String>]
303
+ attr_accessor :tags
304
+
305
+ def tags
306
+ get_tags
307
+ end
308
+
309
+ def tags=(v)
310
+ set_tags(v)
311
+ end
312
+
313
+ protected
314
+
315
+ # @return [bool]
316
+ attr_accessor :n_icon
317
+
318
+ # (This method is generated in Translator_default#buildImpl)
319
+ #
320
+ # @private
321
+ # @return [Icon]
322
+ def get_icon
323
+ return @m_icon
324
+ end
325
+
326
+ # (This method is generated in Translator_default#buildImpl)
327
+ #
328
+ # @private
329
+ # @param [Icon] v
330
+ # @return [Icon]
331
+ def set_icon(v)
332
+ Saklient::Util::validate_type(v, 'Saklient::Cloud::Resources::Icon')
333
+ @m_icon = v
334
+ @n_icon = true
335
+ return @m_icon
336
+ end
337
+
338
+ public
339
+
340
+ # アイコン
341
+ #
342
+ # @return [Icon]
343
+ attr_accessor :icon
344
+
345
+ def icon
346
+ get_icon
347
+ end
348
+
349
+ def icon=(v)
350
+ set_icon(v)
351
+ end
352
+
353
+ protected
354
+
355
+ # @return [bool]
356
+ attr_accessor :n_content
357
+
358
+ # (This method is generated in Translator_default#buildImpl)
359
+ #
360
+ # @private
361
+ # @return [String]
362
+ def get_content
363
+ return @m_content
364
+ end
365
+
366
+ # (This method is generated in Translator_default#buildImpl)
367
+ #
368
+ # @private
369
+ # @param [String] v
370
+ # @return [String]
371
+ def set_content(v)
372
+ Saklient::Util::validate_type(v, 'String')
373
+ @m_content = v
374
+ @n_content = true
375
+ return @m_content
376
+ end
377
+
378
+ public
379
+
380
+ # 内容
381
+ #
382
+ # @return [String]
383
+ attr_accessor :content
384
+
385
+ def content
386
+ get_content
387
+ end
388
+
389
+ def content=(v)
390
+ set_content(v)
391
+ end
392
+
393
+ protected
394
+
395
+ # @return [bool]
396
+ attr_accessor :n_annotation
397
+
398
+ # (This method is generated in Translator_default#buildImpl)
399
+ #
400
+ # @private
401
+ # @return [any]
402
+ def get_annotation
403
+ return @m_annotation
404
+ end
405
+
406
+ # (This method is generated in Translator_default#buildImpl)
407
+ #
408
+ # @private
409
+ # @param [any] v
410
+ # @return [any]
411
+ def set_annotation(v)
412
+ @m_annotation = v
413
+ @n_annotation = true
414
+ return @m_annotation
415
+ end
416
+
417
+ public
418
+
419
+ # 注釈
420
+ #
421
+ # @return [any]
422
+ attr_accessor :annotation
423
+
424
+ def annotation
425
+ get_annotation
426
+ end
427
+
428
+ def annotation=(v)
429
+ set_annotation(v)
430
+ end
431
+
432
+ protected
433
+
434
+ # (This method is generated in Translator_default#buildImpl)
435
+ #
436
+ # @param [any] r
437
+ def api_deserialize_impl(r)
438
+ @is_new = (r).nil?
439
+ r = {} if @is_new
440
+ @is_incomplete = false
441
+ if Saklient::Util::exists_path(r, 'ID')
442
+ @m_id = (Saklient::Util::get_by_path(r, 'ID')).nil? ? nil : Saklient::Util::get_by_path(r, 'ID').to_s
443
+ else
444
+ @m_id = nil
445
+ @is_incomplete = true
446
+ end
447
+ @n_id = false
448
+ if Saklient::Util::exists_path(r, 'Scope')
449
+ @m_scope = (Saklient::Util::get_by_path(r, 'Scope')).nil? ? nil : Saklient::Util::get_by_path(r, 'Scope').to_s
450
+ else
451
+ @m_scope = nil
452
+ @is_incomplete = true
453
+ end
454
+ @n_scope = false
455
+ if Saklient::Util::exists_path(r, 'Class')
456
+ @m_clazz = (Saklient::Util::get_by_path(r, 'Class')).nil? ? nil : Saklient::Util::get_by_path(r, 'Class').to_s
457
+ else
458
+ @m_clazz = nil
459
+ @is_incomplete = true
460
+ end
461
+ @n_clazz = false
462
+ if Saklient::Util::exists_path(r, 'Name')
463
+ @m_name = (Saklient::Util::get_by_path(r, 'Name')).nil? ? nil : Saklient::Util::get_by_path(r, 'Name').to_s
464
+ else
465
+ @m_name = nil
466
+ @is_incomplete = true
467
+ end
468
+ @n_name = false
469
+ if Saklient::Util::exists_path(r, 'Description')
470
+ @m_description = (Saklient::Util::get_by_path(r, 'Description')).nil? ? nil : Saklient::Util::get_by_path(r, 'Description').to_s
471
+ else
472
+ @m_description = nil
473
+ @is_incomplete = true
474
+ end
475
+ @n_description = false
476
+ if Saklient::Util::exists_path(r, 'Tags')
477
+ if (Saklient::Util::get_by_path(r, 'Tags')).nil?
478
+ @m_tags = []
479
+ else
480
+ @m_tags = []
481
+ for t in Saklient::Util::get_by_path(r, 'Tags')
482
+ v1 = nil
483
+ v1 = (t).nil? ? nil : t.to_s
484
+ @m_tags << v1
485
+ end
486
+ end
487
+ else
488
+ @m_tags = nil
489
+ @is_incomplete = true
490
+ end
491
+ @n_tags = false
492
+ if Saklient::Util::exists_path(r, 'Icon')
493
+ @m_icon = (Saklient::Util::get_by_path(r, 'Icon')).nil? ? nil : Saklient::Cloud::Resources::Icon.new(@_client, Saklient::Util::get_by_path(r, 'Icon'))
494
+ else
495
+ @m_icon = nil
496
+ @is_incomplete = true
497
+ end
498
+ @n_icon = false
499
+ if Saklient::Util::exists_path(r, 'Content')
500
+ @m_content = (Saklient::Util::get_by_path(r, 'Content')).nil? ? nil : Saklient::Util::get_by_path(r, 'Content').to_s
501
+ else
502
+ @m_content = nil
503
+ @is_incomplete = true
504
+ end
505
+ @n_content = false
506
+ if Saklient::Util::exists_path(r, 'Remark')
507
+ @m_annotation = Saklient::Util::get_by_path(r, 'Remark')
508
+ else
509
+ @m_annotation = nil
510
+ @is_incomplete = true
511
+ end
512
+ @n_annotation = false
513
+ end
514
+
515
+ # @private
516
+ # @param [bool] withClean
517
+ # @return [any]
518
+ def api_serialize_impl(withClean = false)
519
+ Saklient::Util::validate_type(withClean, 'bool')
520
+ missing = []
521
+ ret = {}
522
+ Saklient::Util::set_by_path(ret, 'ID', @m_id) if withClean || @n_id
523
+ Saklient::Util::set_by_path(ret, 'Scope', @m_scope) if withClean || @n_scope
524
+ Saklient::Util::set_by_path(ret, 'Class', @m_clazz) if withClean || @n_clazz
525
+ if withClean || @n_name
526
+ Saklient::Util::set_by_path(ret, 'Name', @m_name)
527
+ else
528
+ missing << 'name' if @is_new
529
+ end
530
+ Saklient::Util::set_by_path(ret, 'Description', @m_description) if withClean || @n_description
531
+ if withClean || @n_tags
532
+ Saklient::Util::set_by_path(ret, 'Tags', [])
533
+ for r1 in @m_tags
534
+ v = nil
535
+ v = r1
536
+ ret[:Tags] << v
537
+ end
538
+ end
539
+ 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
540
+ if withClean || @n_content
541
+ Saklient::Util::set_by_path(ret, 'Content', @m_content)
542
+ else
543
+ missing << 'content' if @is_new
544
+ end
545
+ Saklient::Util::set_by_path(ret, 'Remark', @m_annotation) if withClean || @n_annotation
546
+ raise Saklient::Errors::SaklientException.new('required_field', 'Required fields must be set before the Script creation: ' + missing.join(', ')) if missing.length > 0
547
+ return ret
548
+ end
549
+
550
+ end
551
+
552
+ end
553
+ end
554
+ end