1 // Copyright (c) 2016, 2018, 2025, Oracle and/or its affiliates. All rights reserved.
2 // 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.
3 // Code generated. DO NOT EDIT.
4 5 // DNS API
6 //
7 // API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
8 // For more information, see Overview of the DNS Service (https://docs.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
9 //
10 11 package dns
12 13 import (
14 "fmt"
15 "strings"
16 17 "github.com/nrdcg/oci-go-sdk/common/v1065"
18 )
19 20 // ZoneSummary A DNS zone.
21 // **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
22 type ZoneSummary struct {
23 24 // The name of the zone.
25 Name *string `mandatory:"true" json:"name"`
26 27 // The type of the zone. Must be either `PRIMARY` or `SECONDARY`. `SECONDARY` is only supported for GLOBAL zones.
28 ZoneType ZoneSummaryZoneTypeEnum `mandatory:"true" json:"zoneType"`
29 30 // The OCID of the compartment containing the zone.
31 CompartmentId *string `mandatory:"true" json:"compartmentId"`
32 33 // The scope of the zone.
34 Scope ScopeEnum `mandatory:"true" json:"scope"`
35 36 // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
37 // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
38 //
39 // **Example:** `{"Department": "Finance"}`
40 FreeformTags map[string]string `mandatory:"true" json:"freeformTags"`
41 42 // Defined tags for this resource. Each key is predefined and scoped to a namespace.
43 // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
44 //
45 // **Example:** `{"Operations": {"CostCenter": "42"}}`
46 DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"`
47 48 // The state of DNSSEC on the zone.
49 // For DNSSEC to function, every parent zone in the DNS tree up to the top-level domain (or an independent
50 // trust anchor) must also have DNSSEC correctly set up.
51 // After enabling DNSSEC, you must add a DS record to the zone's parent zone containing the
52 // `KskDnssecKeyVersion` data. You can find the DS data in the `dsData` attribute of the `KskDnssecKeyVersion`.
53 // Then, use the `PromoteZoneDnssecKeyVersion` operation to promote the `KskDnssecKeyVersion`.
54 // New `KskDnssecKeyVersion`s are generated annually, a week before the existing `KskDnssecKeyVersion`'s expiration.
55 // To rollover a `KskDnssecKeyVersion`, you must replace the parent zone's DS record containing the old
56 // `KskDnssecKeyVersion` data with the data from the new `KskDnssecKeyVersion`.
57 // To remove the old DS record without causing service disruption, wait until the old DS record's TTL has
58 // expired, and the new DS record has propagated. After the DS replacement has been completed, then the
59 // `PromoteZoneDnssecKeyVersion` operation must be called.
60 // Metrics are emitted in the `oci_dns` namespace daily for each `KskDnssecKeyVersion` indicating how many
61 // days are left until expiration.
62 // We recommend that you set up alarms and notifications for KskDnssecKeyVersion expiration so that the
63 // necessary parent zone updates can be made and the `PromoteZoneDnssecKeyVersion` operation can be called.
64 // Enabling DNSSEC results in additional records in DNS responses which increases their size and can
65 // cause higher response latency.
66 // For more information, see DNSSEC (https://docs.oracle.com/iaas/Content/DNS/Concepts/dnssec.htm).
67 DnssecState ZoneDnssecStateEnum `mandatory:"true" json:"dnssecState"`
68 69 // The canonical absolute URL of the resource.
70 Self *string `mandatory:"true" json:"self"`
71 72 // The OCID of the zone.
73 Id *string `mandatory:"true" json:"id"`
74 75 // The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format
76 // with a Z offset, as defined by RFC 3339.
77 // **Example:** `2016-07-22T17:23:59:60Z`
78 TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"`
79 80 // Version is the never-repeating, totally-orderable, version of the
81 // zone, from which the serial field of the zone's SOA record is
82 // derived.
83 Version *string `mandatory:"true" json:"version"`
84 85 // The current serial of the zone. As seen in the zone's SOA record.
86 Serial *int64 `mandatory:"true" json:"serial"`
87 88 // The current state of the zone resource.
89 LifecycleState ZoneSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`
90 91 // A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
92 IsProtected *bool `mandatory:"true" json:"isProtected"`
93 94 // The OCID of the private view containing the zone. This value will
95 // be null for zones in the global DNS, which are publicly resolvable and
96 // not part of a private view.
97 ViewId *string `mandatory:"false" json:"viewId"`
98 99 DnssecConfig *DnssecConfig `mandatory:"false" json:"dnssecConfig"`
100 }
101 102 func (m ZoneSummary) String() string {
103 return common.PointerString(m)
104 }
105 106 // ValidateEnumValue returns an error when providing an unsupported enum value
107 // This function is being called during constructing API request process
108 // Not recommended for calling this function directly
109 func (m ZoneSummary) ValidateEnumValue() (bool, error) {
110 errMessage := []string{}
111 if _, ok := GetMappingZoneSummaryZoneTypeEnum(string(m.ZoneType)); !ok && m.ZoneType != "" {
112 errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ZoneType: %s. Supported values are: %s.", m.ZoneType, strings.Join(GetZoneSummaryZoneTypeEnumStringValues(), ",")))
113 }
114 if _, ok := GetMappingScopeEnum(string(m.Scope)); !ok && m.Scope != "" {
115 errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Scope: %s. Supported values are: %s.", m.Scope, strings.Join(GetScopeEnumStringValues(), ",")))
116 }
117 if _, ok := GetMappingZoneDnssecStateEnum(string(m.DnssecState)); !ok && m.DnssecState != "" {
118 errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DnssecState: %s. Supported values are: %s.", m.DnssecState, strings.Join(GetZoneDnssecStateEnumStringValues(), ",")))
119 }
120 if _, ok := GetMappingZoneSummaryLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" {
121 errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetZoneSummaryLifecycleStateEnumStringValues(), ",")))
122 }
123 124 if len(errMessage) > 0 {
125 return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
126 }
127 return false, nil
128 }
129 130 // ZoneSummaryZoneTypeEnum Enum with underlying type: string
131 type ZoneSummaryZoneTypeEnum string
132 133 // Set of constants representing the allowable values for ZoneSummaryZoneTypeEnum
134 const (
135 ZoneSummaryZoneTypePrimary ZoneSummaryZoneTypeEnum = "PRIMARY"
136 ZoneSummaryZoneTypeSecondary ZoneSummaryZoneTypeEnum = "SECONDARY"
137 )
138 139 var mappingZoneSummaryZoneTypeEnum = map[string]ZoneSummaryZoneTypeEnum{
140 "PRIMARY": ZoneSummaryZoneTypePrimary,
141 "SECONDARY": ZoneSummaryZoneTypeSecondary,
142 }
143 144 var mappingZoneSummaryZoneTypeEnumLowerCase = map[string]ZoneSummaryZoneTypeEnum{
145 "primary": ZoneSummaryZoneTypePrimary,
146 "secondary": ZoneSummaryZoneTypeSecondary,
147 }
148 149 // GetZoneSummaryZoneTypeEnumValues Enumerates the set of values for ZoneSummaryZoneTypeEnum
150 func GetZoneSummaryZoneTypeEnumValues() []ZoneSummaryZoneTypeEnum {
151 values := make([]ZoneSummaryZoneTypeEnum, 0)
152 for _, v := range mappingZoneSummaryZoneTypeEnum {
153 values = append(values, v)
154 }
155 return values
156 }
157 158 // GetZoneSummaryZoneTypeEnumStringValues Enumerates the set of values in String for ZoneSummaryZoneTypeEnum
159 func GetZoneSummaryZoneTypeEnumStringValues() []string {
160 return []string{
161 "PRIMARY",
162 "SECONDARY",
163 }
164 }
165 166 // GetMappingZoneSummaryZoneTypeEnum performs case Insensitive comparison on enum value and return the desired enum
167 func GetMappingZoneSummaryZoneTypeEnum(val string) (ZoneSummaryZoneTypeEnum, bool) {
168 enum, ok := mappingZoneSummaryZoneTypeEnumLowerCase[strings.ToLower(val)]
169 return enum, ok
170 }
171 172 // ZoneSummaryLifecycleStateEnum Enum with underlying type: string
173 type ZoneSummaryLifecycleStateEnum string
174 175 // Set of constants representing the allowable values for ZoneSummaryLifecycleStateEnum
176 const (
177 ZoneSummaryLifecycleStateActive ZoneSummaryLifecycleStateEnum = "ACTIVE"
178 ZoneSummaryLifecycleStateCreating ZoneSummaryLifecycleStateEnum = "CREATING"
179 ZoneSummaryLifecycleStateDeleted ZoneSummaryLifecycleStateEnum = "DELETED"
180 ZoneSummaryLifecycleStateDeleting ZoneSummaryLifecycleStateEnum = "DELETING"
181 ZoneSummaryLifecycleStateFailed ZoneSummaryLifecycleStateEnum = "FAILED"
182 ZoneSummaryLifecycleStateUpdating ZoneSummaryLifecycleStateEnum = "UPDATING"
183 )
184 185 var mappingZoneSummaryLifecycleStateEnum = map[string]ZoneSummaryLifecycleStateEnum{
186 "ACTIVE": ZoneSummaryLifecycleStateActive,
187 "CREATING": ZoneSummaryLifecycleStateCreating,
188 "DELETED": ZoneSummaryLifecycleStateDeleted,
189 "DELETING": ZoneSummaryLifecycleStateDeleting,
190 "FAILED": ZoneSummaryLifecycleStateFailed,
191 "UPDATING": ZoneSummaryLifecycleStateUpdating,
192 }
193 194 var mappingZoneSummaryLifecycleStateEnumLowerCase = map[string]ZoneSummaryLifecycleStateEnum{
195 "active": ZoneSummaryLifecycleStateActive,
196 "creating": ZoneSummaryLifecycleStateCreating,
197 "deleted": ZoneSummaryLifecycleStateDeleted,
198 "deleting": ZoneSummaryLifecycleStateDeleting,
199 "failed": ZoneSummaryLifecycleStateFailed,
200 "updating": ZoneSummaryLifecycleStateUpdating,
201 }
202 203 // GetZoneSummaryLifecycleStateEnumValues Enumerates the set of values for ZoneSummaryLifecycleStateEnum
204 func GetZoneSummaryLifecycleStateEnumValues() []ZoneSummaryLifecycleStateEnum {
205 values := make([]ZoneSummaryLifecycleStateEnum, 0)
206 for _, v := range mappingZoneSummaryLifecycleStateEnum {
207 values = append(values, v)
208 }
209 return values
210 }
211 212 // GetZoneSummaryLifecycleStateEnumStringValues Enumerates the set of values in String for ZoneSummaryLifecycleStateEnum
213 func GetZoneSummaryLifecycleStateEnumStringValues() []string {
214 return []string{
215 "ACTIVE",
216 "CREATING",
217 "DELETED",
218 "DELETING",
219 "FAILED",
220 "UPDATING",
221 }
222 }
223 224 // GetMappingZoneSummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum
225 func GetMappingZoneSummaryLifecycleStateEnum(val string) (ZoneSummaryLifecycleStateEnum, bool) {
226 enum, ok := mappingZoneSummaryLifecycleStateEnumLowerCase[strings.ToLower(val)]
227 return enum, ok
228 }
229