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// License ライセンス
18type License struct {
19	*Resource       // ID
20	propName        // 名称
21	propDescription // 説明
22	propCreatedAt   // 作成日時
23	propModifiedAt  // 変更日時
24
25	LicenseInfo *ProductLicense `json:",omitempty"` // ライセンス情報
26}
27
28// GetLicenseInfo ライセンス情報 取得
29func (l *License) GetLicenseInfo() *ProductLicense {
30	return l.LicenseInfo
31}
32
33// SetLicenseInfo ライセンス情報 設定
34func (l *License) SetLicenseInfo(license *ProductLicense) {
35	l.LicenseInfo = license
36}
37
38// SetLicenseInfoByID ライセンス情報 設定
39func (l *License) SetLicenseInfoByID(id ID) {
40	l.LicenseInfo = &ProductLicense{Resource: NewResource(id)}
41}
42