-
Notifications
You must be signed in to change notification settings - Fork 80
/
template.go
139 lines (106 loc) · 5.4 KB
/
template.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
// Code generated. DO NOT EDIT.
// Resource Manager API
//
// API for the Resource Manager service.
// Use this API to install, configure, and manage resources via the "infrastructure-as-code" model.
// For more information, see
// Overview of Resource Manager (https://docs.cloud.oracle.com/iaas/Content/ResourceManager/Concepts/resourcemanager.htm).
//
package resourcemanager
import (
"encoding/json"
"github.com/oracle/oci-go-sdk/v43/common"
)
// Template The properties that define a template. A template is a pre-built Terraform configuration that provisions a set of resources used in a common scenario.
type Template struct {
// Unique identifier (OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm)) for the template.
Id *string `mandatory:"true" json:"id"`
// The OCID (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing this template.
CompartmentId *string `mandatory:"false" json:"compartmentId"`
// Unique identifier for the category where the template is located.
CategoryId *string `mandatory:"false" json:"categoryId"`
// Human-readable name of the template.
DisplayName *string `mandatory:"false" json:"displayName"`
// Brief description of the template.
Description *string `mandatory:"false" json:"description"`
// Detailed description of the template. This description is displayed in the Console page listing templates when the template is expanded. Avoid entering confidential information.
LongDescription *string `mandatory:"false" json:"longDescription"`
// The date and time at which the template was created.
// Format is defined by RFC3339.
// Example: `2020-11-25T21:10:29.600Z`
TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"`
TemplateConfigSource TemplateConfigSource `mandatory:"false" json:"templateConfigSource"`
// The current lifecycle state of the template.
LifecycleState TemplateLifecycleStateEnum `mandatory:"false" json:"lifecycleState,omitempty"`
// Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace.
// For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
// Example: `{"Department": "Finance"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
// Defined tags for this resource. Each key is predefined and scoped to a namespace.
// For more information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
// Example: `{"Operations": {"CostCenter": "42"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
}
func (m Template) String() string {
return common.PointerString(m)
}
// UnmarshalJSON unmarshals from json
func (m *Template) UnmarshalJSON(data []byte) (e error) {
model := struct {
CompartmentId *string `json:"compartmentId"`
CategoryId *string `json:"categoryId"`
DisplayName *string `json:"displayName"`
Description *string `json:"description"`
LongDescription *string `json:"longDescription"`
TimeCreated *common.SDKTime `json:"timeCreated"`
TemplateConfigSource templateconfigsource `json:"templateConfigSource"`
LifecycleState TemplateLifecycleStateEnum `json:"lifecycleState"`
FreeformTags map[string]string `json:"freeformTags"`
DefinedTags map[string]map[string]interface{} `json:"definedTags"`
Id *string `json:"id"`
}{}
e = json.Unmarshal(data, &model)
if e != nil {
return
}
var nn interface{}
m.CompartmentId = model.CompartmentId
m.CategoryId = model.CategoryId
m.DisplayName = model.DisplayName
m.Description = model.Description
m.LongDescription = model.LongDescription
m.TimeCreated = model.TimeCreated
nn, e = model.TemplateConfigSource.UnmarshalPolymorphicJSON(model.TemplateConfigSource.JsonData)
if e != nil {
return
}
if nn != nil {
m.TemplateConfigSource = nn.(TemplateConfigSource)
} else {
m.TemplateConfigSource = nil
}
m.LifecycleState = model.LifecycleState
m.FreeformTags = model.FreeformTags
m.DefinedTags = model.DefinedTags
m.Id = model.Id
return
}
// TemplateLifecycleStateEnum Enum with underlying type: string
type TemplateLifecycleStateEnum string
// Set of constants representing the allowable values for TemplateLifecycleStateEnum
const (
TemplateLifecycleStateActive TemplateLifecycleStateEnum = "ACTIVE"
)
var mappingTemplateLifecycleState = map[string]TemplateLifecycleStateEnum{
"ACTIVE": TemplateLifecycleStateActive,
}
// GetTemplateLifecycleStateEnumValues Enumerates the set of values for TemplateLifecycleStateEnum
func GetTemplateLifecycleStateEnumValues() []TemplateLifecycleStateEnum {
values := make([]TemplateLifecycleStateEnum, 0)
for _, v := range mappingTemplateLifecycleState {
values = append(values, v)
}
return values
}