resolver_forward_rule.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  // ResolverForwardRule The representation of ResolverForwardRule
  22  type ResolverForwardRule struct {
  23  
  24  	// A list of CIDR blocks. The query must come from a client within one of the blocks in order for the rule action
  25  	// to apply.
  26  	ClientAddressConditions []string `mandatory:"true" json:"clientAddressConditions"`
  27  
  28  	// A list of domain names. The query must be covered by one of the domains in order for the rule action to apply.
  29  	QnameCoverConditions []string `mandatory:"true" json:"qnameCoverConditions"`
  30  
  31  	// IP addresses to which queries should be forwarded. Currently limited to a single address.
  32  	DestinationAddresses []string `mandatory:"true" json:"destinationAddresses"`
  33  
  34  	// Case-insensitive name of an endpoint, that is a sub-resource of the resolver, to use as the forwarding
  35  	// interface. The endpoint must have isForwarding set to true.
  36  	SourceEndpointName *string `mandatory:"false" json:"sourceEndpointName"`
  37  }
  38  
  39  // GetClientAddressConditions returns ClientAddressConditions
  40  func (m ResolverForwardRule) GetClientAddressConditions() []string {
  41  	return m.ClientAddressConditions
  42  }
  43  
  44  // GetQnameCoverConditions returns QnameCoverConditions
  45  func (m ResolverForwardRule) GetQnameCoverConditions() []string {
  46  	return m.QnameCoverConditions
  47  }
  48  
  49  func (m ResolverForwardRule) String() string {
  50  	return common.PointerString(m)
  51  }
  52  
  53  // ValidateEnumValue returns an error when providing an unsupported enum value
  54  // This function is being called during constructing API request process
  55  // Not recommended for calling this function directly
  56  func (m ResolverForwardRule) ValidateEnumValue() (bool, error) {
  57  	errMessage := []string{}
  58  
  59  	if len(errMessage) > 0 {
  60  		return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
  61  	}
  62  	return false, nil
  63  }
  64  
  65  // MarshalJSON marshals to json representation
  66  func (m ResolverForwardRule) MarshalJSON() (buff []byte, e error) {
  67  	type MarshalTypeResolverForwardRule ResolverForwardRule
  68  	s := struct {
  69  		DiscriminatorParam string `json:"action"`
  70  		MarshalTypeResolverForwardRule
  71  	}{
  72  		"FORWARD",
  73  		(MarshalTypeResolverForwardRule)(m),
  74  	}
  75  
  76  	return json.Marshal(&s)
  77  }
  78