zsk_dnssec_key_version.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  // ZskDnssecKeyVersion A zone signing key (ZSK) version. The version information contains timing and configuration data for the ZSK that is used to
  21  // apply DNSSEC on the zone.
  22  type ZskDnssecKeyVersion struct {
  23  
  24  	// The UUID of the `DnssecKeyVersion`.
  25  	Uuid *string `mandatory:"false" json:"uuid"`
  26  
  27  	// The signing algorithm used for the key.
  28  	Algorithm DnssecSigningAlgorithmEnum `mandatory:"false" json:"algorithm,omitempty"`
  29  
  30  	// The length of the corresponding private key in bytes, expressed as an integer.
  31  	LengthInBytes *int `mandatory:"false" json:"lengthInBytes"`
  32  
  33  	// The date and time the key version was created, expressed in RFC 3339 timestamp format.
  34  	// **Example:** `2016-07-22T17:23:59:00Z`
  35  	TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"`
  36  
  37  	// The date and time the key version was, or will be, published, expressed in RFC 3339 timestamp format. This is
  38  	// when the zone contents will include a DNSKEY record corresponding to the key material.
  39  	// **Example:** `2016-07-22T17:23:59:00Z`
  40  	TimePublished *common.SDKTime `mandatory:"false" json:"timePublished"`
  41  
  42  	// The date and time the key version went, or will go, active, expressed in RFC 3339 timestamp format. This is
  43  	// when the key material will be used to generate RRSIGs.
  44  	// **Example:** `2016-07-22T17:23:59:00Z`
  45  	TimeActivated *common.SDKTime `mandatory:"false" json:"timeActivated"`
  46  
  47  	// The date and time the key version went, or will go, inactive, expressed in RFC 3339 timestamp format. This
  48  	// is when the key material will no longer be used to generate RRSIGs. For a key signing key (KSK) `DnssecKeyVersion`, this is
  49  	// populated after `PromoteZoneDnssecKeyVersion` has been called on its successor `DnssecKeyVersion`.
  50  	// **Example:** `2016-07-22T17:23:59:00Z`
  51  	TimeInactivated *common.SDKTime `mandatory:"false" json:"timeInactivated"`
  52  
  53  	// The date and time the key version was, or will be, unpublished, expressed in RFC 3339 timestamp format. This
  54  	// is when the corresponding DNSKEY will be removed from zone contents. For a key signing key (KSK) `DnssecKeyVersion`, this is
  55  	// populated after `PromoteZoneDnssecKeyVersion` has been called on its successor `DnssecKeyVersion`.
  56  	// **Example:** `2016-07-22T17:23:59:00Z`
  57  	TimeUnpublished *common.SDKTime `mandatory:"false" json:"timeUnpublished"`
  58  
  59  	// The date and time at which the recommended key version publication/activation lifetime ends, expressed in RFC
  60  	// 3339 timestamp format. This is when the corresponding DNSKEY should no longer exist in zone contents and no
  61  	// longer be used to generate RRSIGs. For a key sigining key (KSK), if `PromoteZoneDnssecKeyVersion` has not been called on this
  62  	// `DnssecKeyVersion`'s successor then it will remain active for arbitrarily long past its recommended lifetime.
  63  	// This prevents service disruption at the potential increased risk of key compromise.
  64  	// **Example:** `2016-07-22T17:23:59:00Z`
  65  	TimeExpired *common.SDKTime `mandatory:"false" json:"timeExpired"`
  66  
  67  	// The date and time the key version was promoted expressed in RFC 3339 timestamp format.
  68  	// **Example:** `2016-07-22T17:23:59:00Z`
  69  	TimePromoted *common.SDKTime `mandatory:"false" json:"timePromoted"`
  70  
  71  	// When populated, this is the UUID of the `DnssecKeyVersion` that this `DnssecKeyVersion` will replace or has
  72  	// replaced.
  73  	PredecessorDnssecKeyVersionUuid *string `mandatory:"false" json:"predecessorDnssecKeyVersionUuid"`
  74  
  75  	// When populated, this is the UUID of the `DnssecKeyVersion` that will replace, or has replaced, this
  76  	// `DnssecKeyVersion`.
  77  	SuccessorDnssecKeyVersionUuid *string `mandatory:"false" json:"successorDnssecKeyVersionUuid"`
  78  
  79  	// The key tag associated with the `DnssecKeyVersion`. This key tag will be present in the RRSIG and DS records
  80  	// associated with the key material for this `DnssecKeyVersion`. For more information about key tags, see
  81  	// RFC 4034 (https://tools.ietf.org/html/rfc4034).
  82  	KeyTag *int `mandatory:"false" json:"keyTag"`
  83  }
  84  
  85  func (m ZskDnssecKeyVersion) String() string {
  86  	return common.PointerString(m)
  87  }
  88  
  89  // ValidateEnumValue returns an error when providing an unsupported enum value
  90  // This function is being called during constructing API request process
  91  // Not recommended for calling this function directly
  92  func (m ZskDnssecKeyVersion) ValidateEnumValue() (bool, error) {
  93  	errMessage := []string{}
  94  
  95  	if _, ok := GetMappingDnssecSigningAlgorithmEnum(string(m.Algorithm)); !ok && m.Algorithm != "" {
  96  		errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Algorithm: %s. Supported values are: %s.", m.Algorithm, strings.Join(GetDnssecSigningAlgorithmEnumStringValues(), ",")))
  97  	}
  98  	if len(errMessage) > 0 {
  99  		return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
 100  	}
 101  	return false, nil
 102  }
 103