tsig_key_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  // TsigKeySummary A TSIG key.
  21  type TsigKeySummary struct {
  22  
  23  	// TSIG key algorithms are encoded as domain names, but most consist of only one
  24  	// non-empty label, which is not required to be explicitly absolute.
  25  	// Applicable algorithms include: hmac-sha1, hmac-sha224, hmac-sha256,
  26  	// hmac-sha512. For more information on these algorithms, see RFC 4635 (https://tools.ietf.org/html/rfc4635#section-2).
  27  	Algorithm *string `mandatory:"true" json:"algorithm"`
  28  
  29  	// A globally unique domain name identifying the key for a given pair of hosts.
  30  	Name *string `mandatory:"true" json:"name"`
  31  
  32  	// The OCID of the compartment containing the TSIG key.
  33  	CompartmentId *string `mandatory:"true" json:"compartmentId"`
  34  
  35  	// Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace.
  36  	// For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
  37  	//
  38  	// **Example:** `{"Department": "Finance"}`
  39  	FreeformTags map[string]string `mandatory:"true" json:"freeformTags"`
  40  
  41  	// Defined tags for this resource. Each key is predefined and scoped to a namespace.
  42  	// For more information, see Resource Tags (https://docs.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
  43  	//
  44  	// **Example:** `{"Operations": {"CostCenter": "42"}}`
  45  	DefinedTags map[string]map[string]interface{} `mandatory:"true" json:"definedTags"`
  46  
  47  	// The OCID of the resource.
  48  	Id *string `mandatory:"true" json:"id"`
  49  
  50  	// The canonical absolute URL of the resource.
  51  	Self *string `mandatory:"true" json:"self"`
  52  
  53  	// The date and time the resource was created, expressed in RFC 3339 timestamp format.
  54  	// **Example:** `2016-07-22T17:23:59:60Z`
  55  	TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"`
  56  
  57  	// The current state of the resource.
  58  	LifecycleState TsigKeySummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`
  59  }
  60  
  61  func (m TsigKeySummary) String() string {
  62  	return common.PointerString(m)
  63  }
  64  
  65  // ValidateEnumValue returns an error when providing an unsupported enum value
  66  // This function is being called during constructing API request process
  67  // Not recommended for calling this function directly
  68  func (m TsigKeySummary) ValidateEnumValue() (bool, error) {
  69  	errMessage := []string{}
  70  	if _, ok := GetMappingTsigKeySummaryLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" {
  71  		errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetTsigKeySummaryLifecycleStateEnumStringValues(), ",")))
  72  	}
  73  
  74  	if len(errMessage) > 0 {
  75  		return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
  76  	}
  77  	return false, nil
  78  }
  79  
  80  // TsigKeySummaryLifecycleStateEnum Enum with underlying type: string
  81  type TsigKeySummaryLifecycleStateEnum string
  82  
  83  // Set of constants representing the allowable values for TsigKeySummaryLifecycleStateEnum
  84  const (
  85  	TsigKeySummaryLifecycleStateActive   TsigKeySummaryLifecycleStateEnum = "ACTIVE"
  86  	TsigKeySummaryLifecycleStateCreating TsigKeySummaryLifecycleStateEnum = "CREATING"
  87  	TsigKeySummaryLifecycleStateDeleted  TsigKeySummaryLifecycleStateEnum = "DELETED"
  88  	TsigKeySummaryLifecycleStateDeleting TsigKeySummaryLifecycleStateEnum = "DELETING"
  89  	TsigKeySummaryLifecycleStateFailed   TsigKeySummaryLifecycleStateEnum = "FAILED"
  90  	TsigKeySummaryLifecycleStateUpdating TsigKeySummaryLifecycleStateEnum = "UPDATING"
  91  )
  92  
  93  var mappingTsigKeySummaryLifecycleStateEnum = map[string]TsigKeySummaryLifecycleStateEnum{
  94  	"ACTIVE":   TsigKeySummaryLifecycleStateActive,
  95  	"CREATING": TsigKeySummaryLifecycleStateCreating,
  96  	"DELETED":  TsigKeySummaryLifecycleStateDeleted,
  97  	"DELETING": TsigKeySummaryLifecycleStateDeleting,
  98  	"FAILED":   TsigKeySummaryLifecycleStateFailed,
  99  	"UPDATING": TsigKeySummaryLifecycleStateUpdating,
 100  }
 101  
 102  var mappingTsigKeySummaryLifecycleStateEnumLowerCase = map[string]TsigKeySummaryLifecycleStateEnum{
 103  	"active":   TsigKeySummaryLifecycleStateActive,
 104  	"creating": TsigKeySummaryLifecycleStateCreating,
 105  	"deleted":  TsigKeySummaryLifecycleStateDeleted,
 106  	"deleting": TsigKeySummaryLifecycleStateDeleting,
 107  	"failed":   TsigKeySummaryLifecycleStateFailed,
 108  	"updating": TsigKeySummaryLifecycleStateUpdating,
 109  }
 110  
 111  // GetTsigKeySummaryLifecycleStateEnumValues Enumerates the set of values for TsigKeySummaryLifecycleStateEnum
 112  func GetTsigKeySummaryLifecycleStateEnumValues() []TsigKeySummaryLifecycleStateEnum {
 113  	values := make([]TsigKeySummaryLifecycleStateEnum, 0)
 114  	for _, v := range mappingTsigKeySummaryLifecycleStateEnum {
 115  		values = append(values, v)
 116  	}
 117  	return values
 118  }
 119  
 120  // GetTsigKeySummaryLifecycleStateEnumStringValues Enumerates the set of values in String for TsigKeySummaryLifecycleStateEnum
 121  func GetTsigKeySummaryLifecycleStateEnumStringValues() []string {
 122  	return []string{
 123  		"ACTIVE",
 124  		"CREATING",
 125  		"DELETED",
 126  		"DELETING",
 127  		"FAILED",
 128  		"UPDATING",
 129  	}
 130  }
 131  
 132  // GetMappingTsigKeySummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum
 133  func GetMappingTsigKeySummaryLifecycleStateEnum(val string) (TsigKeySummaryLifecycleStateEnum, bool) {
 134  	enum, ok := mappingTsigKeySummaryLifecycleStateEnumLowerCase[strings.ToLower(val)]
 135  	return enum, ok
 136  }
 137