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 // View An OCI DNS view.
21 // **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
22 type View struct {
23 24 // The OCID of the owning compartment.
25 CompartmentId *string `mandatory:"true" json:"compartmentId"`
26 27 // The display name of the view.
28 DisplayName *string `mandatory:"true" json:"displayName"`
29 30 // Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
31 // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
32 //
33 // **Example:** `{"Department": "Finance"}`
34 FreeformTags map[string]string `mandatory:"true" json:"freeformTags"`
35 36 // Defined tags for this resource. Each key is predefined and scoped to a namespace.
37 // For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
38 //
39 // **Example:** `{"Operations": {"CostCenter": "42"}}`
40 DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"`
41 42 // The OCID of the view.
43 Id *string `mandatory:"true" json:"id"`
44 45 // The canonical absolute URL of the resource.
46 Self *string `mandatory:"true" json:"self"`
47 48 // The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format
49 // with a Z offset, as defined by RFC 3339.
50 // **Example:** `2016-07-22T17:23:59:60Z`
51 TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"`
52 53 // The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ"
54 // format with a Z offset, as defined by RFC 3339.
55 // **Example:** `2016-07-22T17:23:59:60Z`
56 TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"`
57 58 // The current state of the resource.
59 LifecycleState ViewLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`
60 61 // A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
62 IsProtected *bool `mandatory:"true" json:"isProtected"`
63 }
64 65 func (m View) String() string {
66 return common.PointerString(m)
67 }
68 69 // ValidateEnumValue returns an error when providing an unsupported enum value
70 // This function is being called during constructing API request process
71 // Not recommended for calling this function directly
72 func (m View) ValidateEnumValue() (bool, error) {
73 errMessage := []string{}
74 if _, ok := GetMappingViewLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" {
75 errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetViewLifecycleStateEnumStringValues(), ",")))
76 }
77 78 if len(errMessage) > 0 {
79 return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
80 }
81 return false, nil
82 }
83 84 // ViewLifecycleStateEnum Enum with underlying type: string
85 type ViewLifecycleStateEnum string
86 87 // Set of constants representing the allowable values for ViewLifecycleStateEnum
88 const (
89 ViewLifecycleStateActive ViewLifecycleStateEnum = "ACTIVE"
90 ViewLifecycleStateDeleted ViewLifecycleStateEnum = "DELETED"
91 ViewLifecycleStateDeleting ViewLifecycleStateEnum = "DELETING"
92 ViewLifecycleStateUpdating ViewLifecycleStateEnum = "UPDATING"
93 )
94 95 var mappingViewLifecycleStateEnum = map[string]ViewLifecycleStateEnum{
96 "ACTIVE": ViewLifecycleStateActive,
97 "DELETED": ViewLifecycleStateDeleted,
98 "DELETING": ViewLifecycleStateDeleting,
99 "UPDATING": ViewLifecycleStateUpdating,
100 }
101 102 var mappingViewLifecycleStateEnumLowerCase = map[string]ViewLifecycleStateEnum{
103 "active": ViewLifecycleStateActive,
104 "deleted": ViewLifecycleStateDeleted,
105 "deleting": ViewLifecycleStateDeleting,
106 "updating": ViewLifecycleStateUpdating,
107 }
108 109 // GetViewLifecycleStateEnumValues Enumerates the set of values for ViewLifecycleStateEnum
110 func GetViewLifecycleStateEnumValues() []ViewLifecycleStateEnum {
111 values := make([]ViewLifecycleStateEnum, 0)
112 for _, v := range mappingViewLifecycleStateEnum {
113 values = append(values, v)
114 }
115 return values
116 }
117 118 // GetViewLifecycleStateEnumStringValues Enumerates the set of values in String for ViewLifecycleStateEnum
119 func GetViewLifecycleStateEnumStringValues() []string {
120 return []string{
121 "ACTIVE",
122 "DELETED",
123 "DELETING",
124 "UPDATING",
125 }
126 }
127 128 // GetMappingViewLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum
129 func GetMappingViewLifecycleStateEnum(val string) (ViewLifecycleStateEnum, bool) {
130 enum, ok := mappingViewLifecycleStateEnumLowerCase[strings.ToLower(val)]
131 return enum, ok
132 }
133