1// Copyright 2016-2020 The Libsacloud Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package sacloud
16
17// ENoteClass スタートアップスクリプトクラス
18type ENoteClass string
19
20var (
21	// NoteClassShell shellクラス
22	NoteClassShell = ENoteClass("shell")
23	// NoteClassYAMLCloudConfig yaml_cloud_configクラス
24	NoteClassYAMLCloudConfig = ENoteClass("yaml_cloud_config")
25)
26
27// ENoteClasses 設定可能なスタートアップスクリプトクラス
28var ENoteClasses = []ENoteClass{NoteClassShell, NoteClassYAMLCloudConfig}
29
30// propNoteClass スタートアップスクリプトクラス情報内包型
31type propNoteClass struct {
32	Class ENoteClass `json:",omitempty"` // クラス
33}
34
35// GetClass クラス 取得
36func (p *propNoteClass) GetClass() ENoteClass {
37	return p.Class
38}
39
40// SetClass クラス 設定
41func (p *propNoteClass) SetClass(c ENoteClass) {
42	p.Class = c
43}
44
45// GetClassStr クラス 取得(文字列)
46func (p *propNoteClass) GetClassStr() string {
47	return string(p.Class)
48}
49
50// SetClassByStr クラス 設定(文字列)
51func (p *propNoteClass) SetClassByStr(c string) {
52	p.Class = ENoteClass(c)
53}
54