view_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  // ViewSummary 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 ViewSummary 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 ViewSummaryLifecycleStateEnum `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 ViewSummary) 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 ViewSummary) ValidateEnumValue() (bool, error) {
  73  	errMessage := []string{}
  74  	if _, ok := GetMappingViewSummaryLifecycleStateEnum(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(GetViewSummaryLifecycleStateEnumStringValues(), ",")))
  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  // ViewSummaryLifecycleStateEnum Enum with underlying type: string
  85  type ViewSummaryLifecycleStateEnum string
  86  
  87  // Set of constants representing the allowable values for ViewSummaryLifecycleStateEnum
  88  const (
  89  	ViewSummaryLifecycleStateActive   ViewSummaryLifecycleStateEnum = "ACTIVE"
  90  	ViewSummaryLifecycleStateDeleted  ViewSummaryLifecycleStateEnum = "DELETED"
  91  	ViewSummaryLifecycleStateDeleting ViewSummaryLifecycleStateEnum = "DELETING"
  92  	ViewSummaryLifecycleStateUpdating ViewSummaryLifecycleStateEnum = "UPDATING"
  93  )
  94  
  95  var mappingViewSummaryLifecycleStateEnum = map[string]ViewSummaryLifecycleStateEnum{
  96  	"ACTIVE":   ViewSummaryLifecycleStateActive,
  97  	"DELETED":  ViewSummaryLifecycleStateDeleted,
  98  	"DELETING": ViewSummaryLifecycleStateDeleting,
  99  	"UPDATING": ViewSummaryLifecycleStateUpdating,
 100  }
 101  
 102  var mappingViewSummaryLifecycleStateEnumLowerCase = map[string]ViewSummaryLifecycleStateEnum{
 103  	"active":   ViewSummaryLifecycleStateActive,
 104  	"deleted":  ViewSummaryLifecycleStateDeleted,
 105  	"deleting": ViewSummaryLifecycleStateDeleting,
 106  	"updating": ViewSummaryLifecycleStateUpdating,
 107  }
 108  
 109  // GetViewSummaryLifecycleStateEnumValues Enumerates the set of values for ViewSummaryLifecycleStateEnum
 110  func GetViewSummaryLifecycleStateEnumValues() []ViewSummaryLifecycleStateEnum {
 111  	values := make([]ViewSummaryLifecycleStateEnum, 0)
 112  	for _, v := range mappingViewSummaryLifecycleStateEnum {
 113  		values = append(values, v)
 114  	}
 115  	return values
 116  }
 117  
 118  // GetViewSummaryLifecycleStateEnumStringValues Enumerates the set of values in String for ViewSummaryLifecycleStateEnum
 119  func GetViewSummaryLifecycleStateEnumStringValues() []string {
 120  	return []string{
 121  		"ACTIVE",
 122  		"DELETED",
 123  		"DELETING",
 124  		"UPDATING",
 125  	}
 126  }
 127  
 128  // GetMappingViewSummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum
 129  func GetMappingViewSummaryLifecycleStateEnum(val string) (ViewSummaryLifecycleStateEnum, bool) {
 130  	enum, ok := mappingViewSummaryLifecycleStateEnumLowerCase[strings.ToLower(val)]
 131  	return enum, ok
 132  }
 133