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// propDiskConnection ディスク接続情報内包型 18type propDiskConnection struct { 19 Connection EDiskConnection `json:",omitempty"` // ディスク接続方法 20 ConnectionOrder int `json:",omitempty"` // コネクション順序 21 22} 23 24// GetDiskConnection ディスク接続方法 取得 25func (p *propDiskConnection) GetDiskConnection() EDiskConnection { 26 return p.Connection 27} 28 29// SetDiskConnection ディスク接続方法 設定 30func (p *propDiskConnection) SetDiskConnection(conn EDiskConnection) { 31 p.Connection = conn 32} 33 34// GetDiskConnectionByStr ディスク接続方法 取得 35func (p *propDiskConnection) GetDiskConnectionByStr() string { 36 return string(p.Connection) 37} 38 39// SetDiskConnectionByStr ディスク接続方法 設定 40func (p *propDiskConnection) SetDiskConnectionByStr(conn string) { 41 p.Connection = EDiskConnection(conn) 42} 43 44// GetDiskConnectionOrder コネクション順序 取得 45func (p *propDiskConnection) GetDiskConnectionOrder() int { 46 return p.ConnectionOrder 47} 48