saklient 0.0.2.11 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a34285471d25ad0951c4821d887c59d493079d5a
4
- data.tar.gz: d596f05cb7bd45e3e43db1b3862be0731fac57c9
3
+ metadata.gz: f21124a0ab39a29f6738fec54307b59d14b0c94c
4
+ data.tar.gz: 29a28dc476ec0fcaf0f5ce015dfde17d4d646825
5
5
  SHA512:
6
- metadata.gz: dcd7ec29a4eb6109c22a5d18e4cfef666d1b9f754aa963994a7a618b281747aa75e0cc6b559d00375804cc951f5a32a8f696b5a0ba0758cceff86ac637d11408
7
- data.tar.gz: 252380346c8e48775d6679e32fbe815bdb1a412c1c5bb9bcbb72397b2fac7f1a585ecec1a544d659d58cd3ecf29517a62d6be1129558da74fde229e59e570203
6
+ metadata.gz: 06b8a9e95e75f7e0bbb9a41ec12f31cb3358880c63a6e29c4ca9d880eac618088559afbc4dd41252f8f56fb91b3436bce140492661ec991365847d4ecc3b2521
7
+ data.tar.gz: e41c0a56a997850fa5efcb38451be88e3b481662bcb61a0c43fe25e4f98174c10d24f1db60e379958dae8af52fc2b00770591330ccd823e813c0ff481e0e3388
@@ -11,6 +11,7 @@ require_relative 'models/model_server'
11
11
  require_relative 'models/model_disk'
12
12
  require_relative 'models/model_appliance'
13
13
  require_relative 'models/model_archive'
14
+ require_relative 'models/model_common_service_item'
14
15
  require_relative 'models/model_iso_image'
15
16
  require_relative 'models/model_iface'
16
17
  require_relative 'models/model_swytch'
@@ -374,6 +375,29 @@ module Saklient
374
375
 
375
376
  protected
376
377
 
378
+ # @private
379
+ # @return [Saklient::Cloud::Models::Model_CommonServiceItem]
380
+ attr_accessor :_common_service_item
381
+
382
+ # @private
383
+ # @return [Saklient::Cloud::Models::Model_CommonServiceItem]
384
+ def get_common_service_item
385
+ return @_common_service_item
386
+ end
387
+
388
+ public
389
+
390
+ # 共通サービス契約にアクセスするためのモデル.
391
+ #
392
+ # @return [Saklient::Cloud::Models::Model_CommonServiceItem]
393
+ attr_reader :common_service_item
394
+
395
+ def common_service_item
396
+ get_common_service_item
397
+ end
398
+
399
+ protected
400
+
377
401
  # @private
378
402
  # @return [Saklient::Cloud::Models::Model_License]
379
403
  attr_accessor :_license
@@ -416,6 +440,7 @@ module Saklient
416
440
  @_bridge = Saklient::Cloud::Models::Model_Bridge.new(client)
417
441
  @_ipv6_net = Saklient::Cloud::Models::Model_Ipv6Net.new(client)
418
442
  @_script = Saklient::Cloud::Models::Model_Script.new(client)
443
+ @_common_service_item = Saklient::Cloud::Models::Model_CommonServiceItem.new(client)
419
444
  @_license = Saklient::Cloud::Models::Model_License.new(client)
420
445
  end
421
446
 
@@ -73,7 +73,7 @@ module Saklient
73
73
 
74
74
  extra_headers = {
75
75
  'Content-Type' => 'application/x-www-form-urlencoded',
76
- 'User-Agent' => 'saklient.ruby ver-0.0.2.11 rev-ba6f656e7fdf2e344bc279593970d0d325ad25dd',
76
+ 'User-Agent' => 'saklient.ruby ver-0.0.5 rev-705e6fc541c30cec41e72e5e531418d64f196863',
77
77
  'X-Requested-With' => 'XMLHttpRequest',
78
78
  'X-Sakura-HTTP-Method' => method,
79
79
  'X-Sakura-Error-Level' => 'warning',
@@ -0,0 +1,157 @@
1
+ # -*- encoding: UTF-8 -*-
2
+
3
+ # This code is automatically transpiled by Saklient Translator
4
+
5
+ require_relative '../client'
6
+ require_relative 'model'
7
+ require_relative '../resources/resource'
8
+ require_relative '../resources/common_service_item'
9
+ require_relative '../resources/gslb'
10
+
11
+ module Saklient
12
+ module Cloud
13
+ module Models
14
+
15
+ # 共通サービス契約を検索・作成するための機能を備えたクラス.
16
+ class Model_CommonServiceItem < Saklient::Cloud::Models::Model
17
+
18
+ protected
19
+
20
+ # @private
21
+ # @return [String]
22
+ def _api_path
23
+ return '/commonserviceitem'
24
+ end
25
+
26
+ # @private
27
+ # @return [String]
28
+ def _root_key
29
+ return 'CommonServiceItem'
30
+ end
31
+
32
+ # @private
33
+ # @return [String]
34
+ def _root_key_m
35
+ return 'CommonServiceItems'
36
+ end
37
+
38
+ # @private
39
+ # @return [String]
40
+ def _class_name
41
+ return 'CommonServiceItem'
42
+ end
43
+
44
+ # @private
45
+ # @param [any] obj
46
+ # @param [bool] wrapped
47
+ # @return [Saklient::Cloud::Resources::Resource]
48
+ def _create_resource_impl(obj, wrapped = false)
49
+ Saklient::Util::validate_type(wrapped, 'bool')
50
+ clazz = Saklient::Util::get_by_path(obj, 'CommonServiceItem.Provider.Class')
51
+ return Saklient::Cloud::Resources::Gslb.new(@_client, obj, wrapped) if clazz == 'gslb'
52
+ return Saklient::Cloud::Resources::CommonServiceItem.new(@_client, obj, wrapped)
53
+ end
54
+
55
+ public
56
+
57
+ # 次に取得するリストの開始オフセットを指定します.
58
+ #
59
+ # @param [Fixnum] offset オフセット
60
+ # @return [Model_CommonServiceItem] this
61
+ def offset(offset)
62
+ Saklient::Util::validate_type(offset, 'Fixnum')
63
+ return _offset(offset)
64
+ end
65
+
66
+ # 次に取得するリストの上限レコード数を指定します.
67
+ #
68
+ # @param [Fixnum] count 上限レコード数
69
+ # @return [Model_CommonServiceItem] this
70
+ def limit(count)
71
+ Saklient::Util::validate_type(count, 'Fixnum')
72
+ return _limit(count)
73
+ end
74
+
75
+ # Web APIのフィルタリング設定を直接指定します.
76
+ #
77
+ # @param [String] key キー
78
+ # @param [any] value 値
79
+ # @param [bool] multiple valueに配列を与え, OR条件で完全一致検索する場合にtrueを指定します. 通常, valueはスカラ値であいまい検索されます.
80
+ # @return [Model_CommonServiceItem]
81
+ def filter_by(key, value, multiple = false)
82
+ Saklient::Util::validate_type(key, 'String')
83
+ Saklient::Util::validate_type(multiple, 'bool')
84
+ return _filter_by(key, value, multiple)
85
+ end
86
+
87
+ # 次のリクエストのために設定されているステートをすべて破棄します.
88
+ #
89
+ # @return [Model_CommonServiceItem] this
90
+ def reset
91
+ return _reset
92
+ end
93
+
94
+ # @param [String] protocol
95
+ # @param [Fixnum] delayLoop
96
+ # @param [bool] weighted
97
+ # @return [Saklient::Cloud::Resources::Gslb]
98
+ def create_gslb(protocol, delayLoop = 10, weighted = true)
99
+ Saklient::Util::validate_type(protocol, 'String')
100
+ Saklient::Util::validate_type(delayLoop, 'Fixnum')
101
+ Saklient::Util::validate_type(weighted, 'bool')
102
+ ret = Saklient::Cloud::Resources::Gslb.new(@_client, nil)
103
+ ret.set_initial_params(protocol, delayLoop, weighted)
104
+ return ret
105
+ end
106
+
107
+ # 指定したIDを持つ唯一のリソースを取得します.
108
+ #
109
+ # @param [String] id
110
+ # @return [Saklient::Cloud::Resources::CommonServiceItem] リソースオブジェクト
111
+ def get_by_id(id)
112
+ Saklient::Util::validate_type(id, 'String')
113
+ return _get_by_id(id)
114
+ end
115
+
116
+ # リソースの検索リクエストを実行し, 結果をリストで取得します.
117
+ #
118
+ # @return [Array<Saklient::Cloud::Resources::CommonServiceItem>] リソースオブジェクトの配列
119
+ def find
120
+ return _find
121
+ end
122
+
123
+ # 指定した文字列を名前に含むリソースに絞り込みます.
124
+ #
125
+ # 大文字・小文字は区別されません.
126
+ # 半角スペースで区切られた複数の文字列は, それらをすべて含むことが条件とみなされます.
127
+ #
128
+ # @todo Implement test case
129
+ # @param [String] name
130
+ # @return [Model_CommonServiceItem]
131
+ def with_name_like(name)
132
+ Saklient::Util::validate_type(name, 'String')
133
+ return _with_name_like(name)
134
+ end
135
+
136
+ # 名前でソートします.
137
+ #
138
+ # @todo Implement test case
139
+ # @param [bool] reverse
140
+ # @return [Model_CommonServiceItem]
141
+ def sort_by_name(reverse = false)
142
+ Saklient::Util::validate_type(reverse, 'bool')
143
+ return _sort_by_name(reverse)
144
+ end
145
+
146
+ # @private
147
+ # @param [Saklient::Cloud::Client] client
148
+ def initialize(client)
149
+ super(client)
150
+ Saklient::Util::validate_type(client, 'Saklient::Cloud::Client')
151
+ end
152
+
153
+ end
154
+
155
+ end
156
+ end
157
+ end
@@ -0,0 +1,499 @@
1
+ # -*- encoding: UTF-8 -*-
2
+
3
+ # This code is automatically transpiled by Saklient Translator
4
+
5
+ require_relative '../../errors/saklient_exception'
6
+ require_relative '../client'
7
+ require_relative 'resource'
8
+ require_relative 'common_service_provider'
9
+
10
+ module Saklient
11
+ module Cloud
12
+ module Resources
13
+
14
+ # 共通サービス契約の実体1つに対応し, 属性の取得や操作を行うためのクラス.
15
+ class CommonServiceItem < Saklient::Cloud::Resources::Resource
16
+
17
+ protected
18
+
19
+ # ID
20
+ #
21
+ # @return [String]
22
+ attr_accessor :m_id
23
+
24
+ # 名前
25
+ #
26
+ # @return [String]
27
+ attr_accessor :m_name
28
+
29
+ # 説明
30
+ #
31
+ # @return [String]
32
+ attr_accessor :m_description
33
+
34
+ # タグ文字列の配列
35
+ #
36
+ # @return [Array<String>]
37
+ attr_accessor :m_tags
38
+
39
+ # アイコン
40
+ #
41
+ # @return [Icon]
42
+ attr_accessor :m_icon
43
+
44
+ # 共通サービスプロバイダ情報
45
+ #
46
+ # @return [CommonServiceProvider]
47
+ attr_accessor :m_provider
48
+
49
+ # 設定の生データ
50
+ #
51
+ # @return [any]
52
+ attr_accessor :m_raw_settings
53
+
54
+ # ステータスの生データ
55
+ #
56
+ # @return [any]
57
+ attr_accessor :m_raw_status
58
+
59
+ # @private
60
+ # @return [String]
61
+ def _api_path
62
+ return '/commonserviceitem'
63
+ end
64
+
65
+ # @private
66
+ # @return [String]
67
+ def _root_key
68
+ return 'CommonServiceItem'
69
+ end
70
+
71
+ # @private
72
+ # @return [String]
73
+ def _root_key_m
74
+ return 'CommonServiceItems'
75
+ end
76
+
77
+ public
78
+
79
+ # @private
80
+ # @return [String]
81
+ def _class_name
82
+ return 'CommonServiceItem'
83
+ end
84
+
85
+ # @private
86
+ # @return [String]
87
+ def _id
88
+ return get_id
89
+ end
90
+
91
+ # このローカルオブジェクトに現在設定されているリソース情報をAPIに送信し, 新規作成または上書き保存します.
92
+ #
93
+ # @return [CommonServiceItem] this
94
+ def save
95
+ return _save
96
+ end
97
+
98
+ # 最新のリソース情報を再取得します.
99
+ #
100
+ # @return [CommonServiceItem] this
101
+ def reload
102
+ return _reload
103
+ end
104
+
105
+ # @private
106
+ # @param [Saklient::Cloud::Client] client
107
+ # @param [any] obj
108
+ # @param [bool] wrapped
109
+ def initialize(client, obj, wrapped = false)
110
+ super(client)
111
+ Saklient::Util::validate_type(client, 'Saklient::Cloud::Client')
112
+ Saklient::Util::validate_type(wrapped, 'bool')
113
+ api_deserialize(obj, wrapped)
114
+ end
115
+
116
+ protected
117
+
118
+ # @return [bool]
119
+ attr_accessor :n_id
120
+
121
+ # (This method is generated in Translator_default#buildImpl)
122
+ #
123
+ # @private
124
+ # @return [String]
125
+ def get_id
126
+ return @m_id
127
+ end
128
+
129
+ public
130
+
131
+ # ID
132
+ #
133
+ # @return [String]
134
+ attr_reader :id
135
+
136
+ def id
137
+ get_id
138
+ end
139
+
140
+ protected
141
+
142
+ # @return [bool]
143
+ attr_accessor :n_name
144
+
145
+ # (This method is generated in Translator_default#buildImpl)
146
+ #
147
+ # @private
148
+ # @return [String]
149
+ def get_name
150
+ return @m_name
151
+ end
152
+
153
+ # (This method is generated in Translator_default#buildImpl)
154
+ #
155
+ # @private
156
+ # @param [String] v
157
+ # @return [String]
158
+ def set_name(v)
159
+ Saklient::Util::validate_type(v, 'String')
160
+ @m_name = v
161
+ @n_name = true
162
+ return @m_name
163
+ end
164
+
165
+ public
166
+
167
+ # 名前
168
+ #
169
+ # @return [String]
170
+ attr_accessor :name
171
+
172
+ def name
173
+ get_name
174
+ end
175
+
176
+ def name=(v)
177
+ set_name(v)
178
+ end
179
+
180
+ protected
181
+
182
+ # @return [bool]
183
+ attr_accessor :n_description
184
+
185
+ # (This method is generated in Translator_default#buildImpl)
186
+ #
187
+ # @private
188
+ # @return [String]
189
+ def get_description
190
+ return @m_description
191
+ end
192
+
193
+ # (This method is generated in Translator_default#buildImpl)
194
+ #
195
+ # @private
196
+ # @param [String] v
197
+ # @return [String]
198
+ def set_description(v)
199
+ Saklient::Util::validate_type(v, 'String')
200
+ @m_description = v
201
+ @n_description = true
202
+ return @m_description
203
+ end
204
+
205
+ public
206
+
207
+ # 説明
208
+ #
209
+ # @return [String]
210
+ attr_accessor :description
211
+
212
+ def description
213
+ get_description
214
+ end
215
+
216
+ def description=(v)
217
+ set_description(v)
218
+ end
219
+
220
+ protected
221
+
222
+ # @return [bool]
223
+ attr_accessor :n_tags
224
+
225
+ # (This method is generated in Translator_default#buildImpl)
226
+ #
227
+ # @private
228
+ # @return [Array<String>]
229
+ def get_tags
230
+ @n_tags = true
231
+ return @m_tags
232
+ end
233
+
234
+ # (This method is generated in Translator_default#buildImpl)
235
+ #
236
+ # @private
237
+ # @param [Array<String>] v
238
+ # @return [Array<String>]
239
+ def set_tags(v)
240
+ Saklient::Util::validate_type(v, 'Array')
241
+ @m_tags = v
242
+ @n_tags = true
243
+ return @m_tags
244
+ end
245
+
246
+ public
247
+
248
+ # タグ文字列の配列
249
+ #
250
+ # @return [Array<String>]
251
+ attr_accessor :tags
252
+
253
+ def tags
254
+ get_tags
255
+ end
256
+
257
+ def tags=(v)
258
+ set_tags(v)
259
+ end
260
+
261
+ protected
262
+
263
+ # @return [bool]
264
+ attr_accessor :n_icon
265
+
266
+ # (This method is generated in Translator_default#buildImpl)
267
+ #
268
+ # @private
269
+ # @return [Icon]
270
+ def get_icon
271
+ return @m_icon
272
+ end
273
+
274
+ # (This method is generated in Translator_default#buildImpl)
275
+ #
276
+ # @private
277
+ # @param [Icon] v
278
+ # @return [Icon]
279
+ def set_icon(v)
280
+ Saklient::Util::validate_type(v, 'Icon')
281
+ @m_icon = v
282
+ @n_icon = true
283
+ return @m_icon
284
+ end
285
+
286
+ public
287
+
288
+ # アイコン
289
+ #
290
+ # @return [Icon]
291
+ attr_accessor :icon
292
+
293
+ def icon
294
+ get_icon
295
+ end
296
+
297
+ def icon=(v)
298
+ set_icon(v)
299
+ end
300
+
301
+ protected
302
+
303
+ # @return [bool]
304
+ attr_accessor :n_provider
305
+
306
+ # (This method is generated in Translator_default#buildImpl)
307
+ #
308
+ # @private
309
+ # @return [CommonServiceProvider]
310
+ def get_provider
311
+ return @m_provider
312
+ end
313
+
314
+ public
315
+
316
+ # 共通サービスプロバイダ情報
317
+ #
318
+ # @return [CommonServiceProvider]
319
+ attr_reader :provider
320
+
321
+ def provider
322
+ get_provider
323
+ end
324
+
325
+ protected
326
+
327
+ # @return [bool]
328
+ attr_accessor :n_raw_settings
329
+
330
+ # (This method is generated in Translator_default#buildImpl)
331
+ #
332
+ # @private
333
+ # @return [any]
334
+ def get_raw_settings
335
+ @n_raw_settings = true
336
+ return @m_raw_settings
337
+ end
338
+
339
+ # (This method is generated in Translator_default#buildImpl)
340
+ #
341
+ # @private
342
+ # @param [any] v
343
+ # @return [any]
344
+ def set_raw_settings(v)
345
+ @m_raw_settings = v
346
+ @n_raw_settings = true
347
+ return @m_raw_settings
348
+ end
349
+
350
+ public
351
+
352
+ # 設定の生データ
353
+ #
354
+ # @return [any]
355
+ attr_accessor :raw_settings
356
+
357
+ def raw_settings
358
+ get_raw_settings
359
+ end
360
+
361
+ def raw_settings=(v)
362
+ set_raw_settings(v)
363
+ end
364
+
365
+ protected
366
+
367
+ # @return [bool]
368
+ attr_accessor :n_raw_status
369
+
370
+ # (This method is generated in Translator_default#buildImpl)
371
+ #
372
+ # @private
373
+ # @return [any]
374
+ def get_raw_status
375
+ return @m_raw_status
376
+ end
377
+
378
+ public
379
+
380
+ # ステータスの生データ
381
+ #
382
+ # @return [any]
383
+ attr_reader :raw_status
384
+
385
+ def raw_status
386
+ get_raw_status
387
+ end
388
+
389
+ protected
390
+
391
+ # (This method is generated in Translator_default#buildImpl)
392
+ #
393
+ # @param [any] r
394
+ def api_deserialize_impl(r)
395
+ @is_new = (r).nil?
396
+ r = {} if @is_new
397
+ @is_incomplete = false
398
+ if Saklient::Util::exists_path(r, 'ID')
399
+ @m_id = (Saklient::Util::get_by_path(r, 'ID')).nil? ? nil : Saklient::Util::get_by_path(r, 'ID').to_s
400
+ else
401
+ @m_id = nil
402
+ @is_incomplete = true
403
+ end
404
+ @n_id = false
405
+ if Saklient::Util::exists_path(r, 'Name')
406
+ @m_name = (Saklient::Util::get_by_path(r, 'Name')).nil? ? nil : Saklient::Util::get_by_path(r, 'Name').to_s
407
+ else
408
+ @m_name = nil
409
+ @is_incomplete = true
410
+ end
411
+ @n_name = false
412
+ if Saklient::Util::exists_path(r, 'Description')
413
+ @m_description = (Saklient::Util::get_by_path(r, 'Description')).nil? ? nil : Saklient::Util::get_by_path(r, 'Description').to_s
414
+ else
415
+ @m_description = nil
416
+ @is_incomplete = true
417
+ end
418
+ @n_description = false
419
+ if Saklient::Util::exists_path(r, 'Tags')
420
+ if (Saklient::Util::get_by_path(r, 'Tags')).nil?
421
+ @m_tags = []
422
+ else
423
+ @m_tags = []
424
+ for t in Saklient::Util::get_by_path(r, 'Tags')
425
+ v1 = nil
426
+ v1 = (t).nil? ? nil : t.to_s
427
+ @m_tags << v1
428
+ end
429
+ end
430
+ else
431
+ @m_tags = nil
432
+ @is_incomplete = true
433
+ end
434
+ @n_tags = false
435
+ if Saklient::Util::exists_path(r, 'Icon')
436
+ @m_icon = (Saklient::Util::get_by_path(r, 'Icon')).nil? ? nil : Icon.new(@_client, Saklient::Util::get_by_path(r, 'Icon'))
437
+ else
438
+ @m_icon = nil
439
+ @is_incomplete = true
440
+ end
441
+ @n_icon = false
442
+ if Saklient::Util::exists_path(r, 'CommonServiceProvider')
443
+ @m_provider = (Saklient::Util::get_by_path(r, 'CommonServiceProvider')).nil? ? nil : Saklient::Cloud::Resources::CommonServiceProvider.new(@_client, Saklient::Util::get_by_path(r, 'CommonServiceProvider'))
444
+ else
445
+ @m_provider = nil
446
+ @is_incomplete = true
447
+ end
448
+ @n_provider = false
449
+ if Saklient::Util::exists_path(r, 'Settings')
450
+ @m_raw_settings = Saklient::Util::get_by_path(r, 'Settings')
451
+ else
452
+ @m_raw_settings = nil
453
+ @is_incomplete = true
454
+ end
455
+ @n_raw_settings = false
456
+ if Saklient::Util::exists_path(r, 'Status')
457
+ @m_raw_status = Saklient::Util::get_by_path(r, 'Status')
458
+ else
459
+ @m_raw_status = nil
460
+ @is_incomplete = true
461
+ end
462
+ @n_raw_status = false
463
+ end
464
+
465
+ # @private
466
+ # @param [bool] withClean
467
+ # @return [any]
468
+ def api_serialize_impl(withClean = false)
469
+ Saklient::Util::validate_type(withClean, 'bool')
470
+ missing = []
471
+ ret = {}
472
+ Saklient::Util::set_by_path(ret, 'ID', @m_id) if withClean || @n_id
473
+ if withClean || @n_name
474
+ Saklient::Util::set_by_path(ret, 'Name', @m_name)
475
+ else
476
+ missing << 'name' if @is_new
477
+ end
478
+ Saklient::Util::set_by_path(ret, 'Description', @m_description) if withClean || @n_description
479
+ if withClean || @n_tags
480
+ Saklient::Util::set_by_path(ret, 'Tags', [])
481
+ for r1 in @m_tags
482
+ v = nil
483
+ v = r1
484
+ ret[:Tags] << v
485
+ end
486
+ end
487
+ 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
488
+ Saklient::Util::set_by_path(ret, 'CommonServiceProvider', withClean ? ((@m_provider).nil? ? nil : @m_provider.api_serialize(withClean)) : ((@m_provider).nil? ? { ID: '0' } : @m_provider.api_serialize_id)) if withClean || @n_provider
489
+ Saklient::Util::set_by_path(ret, 'Settings', @m_raw_settings) if withClean || @n_raw_settings
490
+ Saklient::Util::set_by_path(ret, 'Status', @m_raw_status) if withClean || @n_raw_status
491
+ raise Saklient::Errors::SaklientException.new('required_field', 'Required fields must be set before the CommonServiceItem creation: ' + missing.join(', ')) if missing.length > 0
492
+ return ret
493
+ end
494
+
495
+ end
496
+
497
+ end
498
+ end
499
+ end