resolver_vnic_endpoint_summary.go raw

   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  // ResolverVnicEndpointSummary 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 ResolverVnicEndpointSummary 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  	// The OCID of a subnet. Must be part of the VCN that the resolver is attached to.
  53  	SubnetId *string `mandatory:"true" json:"subnetId"`
  54  
  55  	// An IP address from which forwarded queries may be sent. For VNIC endpoints, this IP address must be part
  56  	// of the subnet and will be assigned by the system if unspecified when isForwarding is true.
  57  	ForwardingAddress *string `mandatory:"false" json:"forwardingAddress"`
  58  
  59  	// An IP address to listen to queries on. For VNIC endpoints this IP address must be part of the
  60  	// subnet and will be assigned by the system if unspecified when isListening is true.
  61  	ListeningAddress *string `mandatory:"false" json:"listeningAddress"`
  62  
  63  	// The current state of the resource.
  64  	LifecycleState ResolverEndpointSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`
  65  }
  66  
  67  // GetName returns Name
  68  func (m ResolverVnicEndpointSummary) GetName() *string {
  69  	return m.Name
  70  }
  71  
  72  // GetForwardingAddress returns ForwardingAddress
  73  func (m ResolverVnicEndpointSummary) GetForwardingAddress() *string {
  74  	return m.ForwardingAddress
  75  }
  76  
  77  // GetIsForwarding returns IsForwarding
  78  func (m ResolverVnicEndpointSummary) GetIsForwarding() *bool {
  79  	return m.IsForwarding
  80  }
  81  
  82  // GetIsListening returns IsListening
  83  func (m ResolverVnicEndpointSummary) GetIsListening() *bool {
  84  	return m.IsListening
  85  }
  86  
  87  // GetListeningAddress returns ListeningAddress
  88  func (m ResolverVnicEndpointSummary) GetListeningAddress() *string {
  89  	return m.ListeningAddress
  90  }
  91  
  92  // GetCompartmentId returns CompartmentId
  93  func (m ResolverVnicEndpointSummary) GetCompartmentId() *string {
  94  	return m.CompartmentId
  95  }
  96  
  97  // GetTimeCreated returns TimeCreated
  98  func (m ResolverVnicEndpointSummary) GetTimeCreated() *common.SDKTime {
  99  	return m.TimeCreated
 100  }
 101  
 102  // GetTimeUpdated returns TimeUpdated
 103  func (m ResolverVnicEndpointSummary) GetTimeUpdated() *common.SDKTime {
 104  	return m.TimeUpdated
 105  }
 106  
 107  // GetLifecycleState returns LifecycleState
 108  func (m ResolverVnicEndpointSummary) GetLifecycleState() ResolverEndpointSummaryLifecycleStateEnum {
 109  	return m.LifecycleState
 110  }
 111  
 112  // GetSelf returns Self
 113  func (m ResolverVnicEndpointSummary) GetSelf() *string {
 114  	return m.Self
 115  }
 116  
 117  func (m ResolverVnicEndpointSummary) String() string {
 118  	return common.PointerString(m)
 119  }
 120  
 121  // ValidateEnumValue returns an error when providing an unsupported enum value
 122  // This function is being called during constructing API request process
 123  // Not recommended for calling this function directly
 124  func (m ResolverVnicEndpointSummary) ValidateEnumValue() (bool, error) {
 125  	errMessage := []string{}
 126  
 127  	if _, ok := GetMappingResolverEndpointSummaryLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" {
 128  		errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetResolverEndpointSummaryLifecycleStateEnumStringValues(), ",")))
 129  	}
 130  	if len(errMessage) > 0 {
 131  		return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
 132  	}
 133  	return false, nil
 134  }
 135  
 136  // MarshalJSON marshals to json representation
 137  func (m ResolverVnicEndpointSummary) MarshalJSON() (buff []byte, e error) {
 138  	type MarshalTypeResolverVnicEndpointSummary ResolverVnicEndpointSummary
 139  	s := struct {
 140  		DiscriminatorParam string `json:"endpointType"`
 141  		MarshalTypeResolverVnicEndpointSummary
 142  	}{
 143  		"VNIC",
 144  		(MarshalTypeResolverVnicEndpointSummary)(m),
 145  	}
 146  
 147  	return json.Marshal(&s)
 148  }
 149