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 // SteeringPolicyAttachmentSummary An attachment between a steering policy and a domain.
21 type SteeringPolicyAttachmentSummary struct {
22 23 // The OCID of the attached steering policy.
24 SteeringPolicyId *string `mandatory:"true" json:"steeringPolicyId"`
25 26 // The OCID of the attached zone.
27 ZoneId *string `mandatory:"true" json:"zoneId"`
28 29 // The attached domain within the attached zone.
30 DomainName *string `mandatory:"true" json:"domainName"`
31 32 // A user-friendly name for the steering policy attachment.
33 // Does not have to be unique and can be changed.
34 // Avoid entering confidential information.
35 DisplayName *string `mandatory:"true" json:"displayName"`
36 37 // The record types covered by the attachment at the domain. The set of record types is
38 // determined by aggregating the record types from the answers defined in the steering
39 // policy.
40 Rtypes []string `mandatory:"true" json:"rtypes"`
41 42 // The OCID of the compartment containing the steering policy attachment.
43 CompartmentId *string `mandatory:"true" json:"compartmentId"`
44 45 // The canonical absolute URL of the resource.
46 Self *string `mandatory:"true" json:"self"`
47 48 // The OCID of the resource.
49 Id *string `mandatory:"true" json:"id"`
50 51 // The date and time the resource was created, expressed in RFC 3339 timestamp format.
52 // **Example:** `2016-07-22T17:23:59:60Z`
53 TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"`
54 55 // The current state of the resource.
56 LifecycleState SteeringPolicyAttachmentSummaryLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`
57 }
58 59 func (m SteeringPolicyAttachmentSummary) String() string {
60 return common.PointerString(m)
61 }
62 63 // ValidateEnumValue returns an error when providing an unsupported enum value
64 // This function is being called during constructing API request process
65 // Not recommended for calling this function directly
66 func (m SteeringPolicyAttachmentSummary) ValidateEnumValue() (bool, error) {
67 errMessage := []string{}
68 if _, ok := GetMappingSteeringPolicyAttachmentSummaryLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" {
69 errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetSteeringPolicyAttachmentSummaryLifecycleStateEnumStringValues(), ",")))
70 }
71 72 if len(errMessage) > 0 {
73 return true, fmt.Errorf("%s", strings.Join(errMessage, "\n"))
74 }
75 return false, nil
76 }
77 78 // SteeringPolicyAttachmentSummaryLifecycleStateEnum Enum with underlying type: string
79 type SteeringPolicyAttachmentSummaryLifecycleStateEnum string
80 81 // Set of constants representing the allowable values for SteeringPolicyAttachmentSummaryLifecycleStateEnum
82 const (
83 SteeringPolicyAttachmentSummaryLifecycleStateCreating SteeringPolicyAttachmentSummaryLifecycleStateEnum = "CREATING"
84 SteeringPolicyAttachmentSummaryLifecycleStateActive SteeringPolicyAttachmentSummaryLifecycleStateEnum = "ACTIVE"
85 SteeringPolicyAttachmentSummaryLifecycleStateDeleting SteeringPolicyAttachmentSummaryLifecycleStateEnum = "DELETING"
86 )
87 88 var mappingSteeringPolicyAttachmentSummaryLifecycleStateEnum = map[string]SteeringPolicyAttachmentSummaryLifecycleStateEnum{
89 "CREATING": SteeringPolicyAttachmentSummaryLifecycleStateCreating,
90 "ACTIVE": SteeringPolicyAttachmentSummaryLifecycleStateActive,
91 "DELETING": SteeringPolicyAttachmentSummaryLifecycleStateDeleting,
92 }
93 94 var mappingSteeringPolicyAttachmentSummaryLifecycleStateEnumLowerCase = map[string]SteeringPolicyAttachmentSummaryLifecycleStateEnum{
95 "creating": SteeringPolicyAttachmentSummaryLifecycleStateCreating,
96 "active": SteeringPolicyAttachmentSummaryLifecycleStateActive,
97 "deleting": SteeringPolicyAttachmentSummaryLifecycleStateDeleting,
98 }
99 100 // GetSteeringPolicyAttachmentSummaryLifecycleStateEnumValues Enumerates the set of values for SteeringPolicyAttachmentSummaryLifecycleStateEnum
101 func GetSteeringPolicyAttachmentSummaryLifecycleStateEnumValues() []SteeringPolicyAttachmentSummaryLifecycleStateEnum {
102 values := make([]SteeringPolicyAttachmentSummaryLifecycleStateEnum, 0)
103 for _, v := range mappingSteeringPolicyAttachmentSummaryLifecycleStateEnum {
104 values = append(values, v)
105 }
106 return values
107 }
108 109 // GetSteeringPolicyAttachmentSummaryLifecycleStateEnumStringValues Enumerates the set of values in String for SteeringPolicyAttachmentSummaryLifecycleStateEnum
110 func GetSteeringPolicyAttachmentSummaryLifecycleStateEnumStringValues() []string {
111 return []string{
112 "CREATING",
113 "ACTIVE",
114 "DELETING",
115 }
116 }
117 118 // GetMappingSteeringPolicyAttachmentSummaryLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum
119 func GetMappingSteeringPolicyAttachmentSummaryLifecycleStateEnum(val string) (SteeringPolicyAttachmentSummaryLifecycleStateEnum, bool) {
120 enum, ok := mappingSteeringPolicyAttachmentSummaryLifecycleStateEnumLowerCase[strings.ToLower(val)]
121 return enum, ok
122 }
123