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 "encoding/json"
15 "fmt"
16 "strings"
17 18 "github.com/nrdcg/oci-go-sdk/common/v1065"
19 )
20 21 // ResolverVnicEndpoint An OCI DNS resolver VNIC endpoint. A VNIC is created for each ResolverVnicEndpoint. VCNs and subnets cannot be
22 // deleted while ResolverVnicEndpoints exist in them due to the VNIC.
23 // **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
24 type ResolverVnicEndpoint struct {
25 26 // The name of the resolver endpoint. Must be unique, case-insensitive, within the resolver.
27 Name *string `mandatory:"true" json:"name"`
28 29 // A Boolean flag indicating whether or not the resolver endpoint is for forwarding.
30 IsForwarding *bool `mandatory:"true" json:"isForwarding"`
31 32 // A Boolean flag indicating whether or not the resolver endpoint is for listening.
33 IsListening *bool `mandatory:"true" json:"isListening"`
34 35 // The OCID of the owning compartment. This will match the resolver that the resolver endpoint is under
36 // and will be updated if the resolver's compartment is changed.
37 CompartmentId *string `mandatory:"true" json:"compartmentId"`
38 39 // The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format
40 // with a Z offset, as defined by RFC 3339.
41 // **Example:** `2016-07-22T17:23:59:60Z`
42 TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"`
43 44 // The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ"
45 // format with a Z offset, as defined by RFC 3339.
46 // **Example:** `2016-07-22T17:23:59:60Z`
47 TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"`
48 49 // The canonical absolute URL of the resource.
50 Self *string `mandatory:"true" json:"self"`
51 52 // An IP address from which forwarded queries may be sent. For VNIC endpoints, this IP address must be part
53 // of the subnet and will be assigned by the system if unspecified when isForwarding is true.
54 ForwardingAddress *string `mandatory:"false" json:"forwardingAddress"`
55 56 // An IP address to listen to queries on. For VNIC endpoints this IP address must be part of the
57 // subnet and will be assigned by the system if unspecified when isListening is true.
58 ListeningAddress *string `mandatory:"false" json:"listeningAddress"`
59 60 // The OCID of a subnet. Must be part of the VCN that the resolver is attached to.
61 SubnetId *string `mandatory:"false" json:"subnetId"`
62 63 // An array of network security group OCIDs for the resolver endpoint. These must be part of the VCN that the
64 // resolver endpoint is a part of.
65 NsgIds []string `mandatory:"false" json:"nsgIds"`
66 67 // The current state of the resource.
68 LifecycleState ResolverEndpointLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`
69 }
70 71 // GetName returns Name
72 func (m ResolverVnicEndpoint) GetName() *string {
73 return m.Name
74 }
75 76 // GetForwardingAddress returns ForwardingAddress
77 func (m ResolverVnicEndpoint) GetForwardingAddress() *string {
78 return m.ForwardingAddress
79 }
80 81 // GetIsForwarding returns IsForwarding
82 func (m ResolverVnicEndpoint) GetIsForwarding() *bool {
83 return m.IsForwarding
84 }
85 86 // GetIsListening returns IsListening
87 func (m ResolverVnicEndpoint) GetIsListening() *bool {
88 return m.IsListening
89 }
90 91 // GetListeningAddress returns ListeningAddress
92 func (m ResolverVnicEndpoint) GetListeningAddress() *string {
93 return m.ListeningAddress
94 }
95 96 // GetCompartmentId returns CompartmentId
97 func (m ResolverVnicEndpoint) GetCompartmentId() *string {
98 return m.CompartmentId
99 }
100 101 // GetTimeCreated returns TimeCreated
102 func (m ResolverVnicEndpoint) GetTimeCreated() *common.SDKTime {
103 return m.TimeCreated
104 }
105 106 // GetTimeUpdated returns TimeUpdated
107 func (m ResolverVnicEndpoint) GetTimeUpdated() *common.SDKTime {
108 return m.TimeUpdated
109 }
110 111 // GetLifecycleState returns LifecycleState
112 func (m ResolverVnicEndpoint) GetLifecycleState() ResolverEndpointLifecycleStateEnum {
113 return m.LifecycleState
114 }
115 116 // GetSelf returns Self
117 func (m ResolverVnicEndpoint) GetSelf() *string {
118 return m.Self
119 }
120 121 func (m ResolverVnicEndpoint) String() string {
122 return common.PointerString(m)
123 }
124 125 // ValidateEnumValue returns an error when providing an unsupported enum value
126 // This function is being called during constructing API request process
127 // Not recommended for calling this function directly
128 func (m ResolverVnicEndpoint) ValidateEnumValue() (bool, error) {
129 errMessage := []string{}
130 131 if _, ok := GetMappingResolverEndpointLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" {
132 errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetResolverEndpointLifecycleStateEnumStringValues(), ",")))
133 }
134 if len(errMessage) > 0 {
135 return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
136 }
137 return false, nil
138 }
139 140 // MarshalJSON marshals to json representation
141 func (m ResolverVnicEndpoint) MarshalJSON() (buff []byte, e error) {
142 type MarshalTypeResolverVnicEndpoint ResolverVnicEndpoint
143 s := struct {
144 DiscriminatorParam string `json:"endpointType"`
145 MarshalTypeResolverVnicEndpoint
146 }{
147 "VNIC",
148 (MarshalTypeResolverVnicEndpoint)(m),
149 }
150 151 return json.Marshal(&s)
152 }
153