resolver_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  	"fmt"
  15  	"strings"
  16  
  17  	"github.com/nrdcg/oci-go-sdk/common/v1065"
  18  )
  19  
  20  // ResolverSummary An OCI DNS resolver. If the resolver has an attached VCN, the VCN will attempt to answer queries based on the
  21  // attached views in priority order. If the query does not match any of the attached views, the query will be
  22  // evaluated against the default view. If the default view does not match, the rules will be evaluated in
  23  // priority order. If no rules match the query, answers come from Internet DNS. A resolver may have a maximum of 10
  24  // resolver endpoints.
  25  // **Warning:** Oracle recommends that you avoid using any confidential information when you supply string values using the API.
  26  type ResolverSummary struct {
  27  
  28  	// The OCID of the owning compartment.
  29  	CompartmentId *string `mandatory:"true" json:"compartmentId"`
  30  
  31  	// The display name of the resolver.
  32  	DisplayName *string `mandatory:"true" json:"displayName"`
  33  
  34  	// Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
  35  	// For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
  36  	//
  37  	// **Example:** `{"Department": "Finance"}`
  38  	FreeformTags map[string]string `mandatory:"true" json:"freeformTags"`
  39  
  40  	// Defined tags for this resource. Each key is predefined and scoped to a namespace.
  41  	// For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
  42  	//
  43  	// **Example:** `{"Operations": {"CostCenter": "42"}}`
  44  	DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"`
  45  
  46  	// The OCID of the resolver.
  47  	Id *string `mandatory:"true" json:"id"`
  48  
  49  	// The date and time the resource was created in "YYYY-MM-ddThh:mm:ssZ" format
  50  	// with a Z offset, as defined by RFC 3339.
  51  	// **Example:** `2016-07-22T17:23:59:60Z`
  52  	TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"`
  53  
  54  	// The date and time the resource was last updated in "YYYY-MM-ddThh:mm:ssZ"
  55  	// format with a Z offset, as defined by RFC 3339.
  56  	// **Example:** `2016-07-22T17:23:59:60Z`
  57  	TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"`
  58  
  59  	// The current state of the resource.
  60  	LifecycleState ResolverSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`
  61  
  62  	// The canonical absolute URL of the resource.
  63  	Self *string `mandatory:"true" json:"self"`
  64  
  65  	// A Boolean flag indicating whether or not parts of the resource are unable to be explicitly managed.
  66  	IsProtected *bool `mandatory:"true" json:"isProtected"`
  67  
  68  	// The OCID of the attached VCN.
  69  	AttachedVcnId *string `mandatory:"false" json:"attachedVcnId"`
  70  
  71  	// The OCID of the default view.
  72  	DefaultViewId *string `mandatory:"false" json:"defaultViewId"`
  73  }
  74  
  75  func (m ResolverSummary) String() string {
  76  	return common.PointerString(m)
  77  }
  78  
  79  // ValidateEnumValue returns an error when providing an unsupported enum value
  80  // This function is being called during constructing API request process
  81  // Not recommended for calling this function directly
  82  func (m ResolverSummary) ValidateEnumValue() (bool, error) {
  83  	errMessage := []string{}
  84  	if _, ok := GetMappingResolverSummaryLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" {
  85  		errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetResolverSummaryLifecycleStateEnumStringValues(), ",")))
  86  	}
  87  
  88  	if len(errMessage) > 0 {
  89  		return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
  90  	}
  91  	return false, nil
  92  }
  93  
  94  // ResolverSummaryLifecycleStateEnum Enum with underlying type: string
  95  type ResolverSummaryLifecycleStateEnum string
  96  
  97  // Set of constants representing the allowable values for ResolverSummaryLifecycleStateEnum
  98  const (
  99  	ResolverSummaryLifecycleStateActive   ResolverSummaryLifecycleStateEnum = "ACTIVE"
 100  	ResolverSummaryLifecycleStateCreating ResolverSummaryLifecycleStateEnum = "CREATING"
 101  	ResolverSummaryLifecycleStateDeleted  ResolverSummaryLifecycleStateEnum = "DELETED"
 102  	ResolverSummaryLifecycleStateDeleting ResolverSummaryLifecycleStateEnum = "DELETING"
 103  	ResolverSummaryLifecycleStateFailed   ResolverSummaryLifecycleStateEnum = "FAILED"
 104  	ResolverSummaryLifecycleStateUpdating ResolverSummaryLifecycleStateEnum = "UPDATING"
 105  )
 106  
 107  var mappingResolverSummaryLifecycleStateEnum = map[string]ResolverSummaryLifecycleStateEnum{
 108  	"ACTIVE":   ResolverSummaryLifecycleStateActive,
 109  	"CREATING": ResolverSummaryLifecycleStateCreating,
 110  	"DELETED":  ResolverSummaryLifecycleStateDeleted,
 111  	"DELETING": ResolverSummaryLifecycleStateDeleting,
 112  	"FAILED":   ResolverSummaryLifecycleStateFailed,
 113  	"UPDATING": ResolverSummaryLifecycleStateUpdating,
 114  }
 115  
 116  var mappingResolverSummaryLifecycleStateEnumLowerCase = map[string]ResolverSummaryLifecycleStateEnum{
 117  	"active":   ResolverSummaryLifecycleStateActive,
 118  	"creating": ResolverSummaryLifecycleStateCreating,
 119  	"deleted":  ResolverSummaryLifecycleStateDeleted,
 120  	"deleting": ResolverSummaryLifecycleStateDeleting,
 121  	"failed":   ResolverSummaryLifecycleStateFailed,
 122  	"updating": ResolverSummaryLifecycleStateUpdating,
 123  }
 124  
 125  // GetResolverSummaryLifecycleStateEnumValues Enumerates the set of values for ResolverSummaryLifecycleStateEnum
 126  func GetResolverSummaryLifecycleStateEnumValues() []ResolverSummaryLifecycleStateEnum {
 127  	values := make([]ResolverSummaryLifecycleStateEnum, 0)
 128  	for _, v := range mappingResolverSummaryLifecycleStateEnum {
 129  		values = append(values, v)
 130  	}
 131  	return values
 132  }
 133  
 134  // GetResolverSummaryLifecycleStateEnumStringValues Enumerates the set of values in String for ResolverSummaryLifecycleStateEnum
 135  func GetResolverSummaryLifecycleStateEnumStringValues() []string {
 136  	return []string{
 137  		"ACTIVE",
 138  		"CREATING",
 139  		"DELETED",
 140  		"DELETING",
 141  		"FAILED",
 142  		"UPDATING",
 143  	}
 144  }
 145  
 146  // GetMappingResolverSummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum
 147  func GetMappingResolverSummaryLifecycleStateEnum(val string) (ResolverSummaryLifecycleStateEnum, bool) {
 148  	enum, ok := mappingResolverSummaryLifecycleStateEnumLowerCase[strings.ToLower(val)]
 149  	return enum, ok
 150  }
 151