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