-
Notifications
You must be signed in to change notification settings - Fork 82
/
steering_policy_priority_rule.go
76 lines (63 loc) · 3.22 KB
/
steering_policy_priority_rule.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved.
// 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.
// Code generated. DO NOT EDIT.
// DNS API
//
// API for the DNS service. Use this API to manage DNS zones, records, and other DNS resources.
// For more information, see Overview of the DNS Service (https://docs.cloud.oracle.com/iaas/Content/DNS/Concepts/dnszonemanagement.htm).
//
package dns
import (
"encoding/json"
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// SteeringPolicyPriorityRule The representation of SteeringPolicyPriorityRule
type SteeringPolicyPriorityRule struct {
// A user-defined description of the rule's purpose or behavior.
Description *string `mandatory:"false" json:"description"`
// An array of `caseConditions`. A rule may optionally include a sequence of cases defining alternate
// configurations for how it should behave during processing for any given DNS query. When a rule has
// no sequence of `cases`, it is always evaluated with the same configuration during processing. When
// a rule has an empty sequence of `cases`, it is always ignored during processing. When a rule has a
// non-empty sequence of `cases`, its behavior during processing is configured by the first matching
// `case` in the sequence. When a rule has no matching cases the rule is ignored. A rule case with no
// `caseCondition` always matches. A rule case with a `caseCondition` matches only when that expression
// evaluates to true for the given query.
Cases []SteeringPolicyPriorityRuleCase `mandatory:"false" json:"cases"`
// Defines a default set of answer conditions and values that are applied to an answer when
// `cases` is not defined for the rule or a matching case does not have any matching
// `answerCondition`s in its `answerData`. `defaultAnswerData` is not applied if `cases` is
// defined and there are no matching cases. In this scenario, the next rule will be processed.
DefaultAnswerData []SteeringPolicyPriorityAnswerData `mandatory:"false" json:"defaultAnswerData"`
}
//GetDescription returns Description
func (m SteeringPolicyPriorityRule) GetDescription() *string {
return m.Description
}
func (m SteeringPolicyPriorityRule) String() string {
return common.PointerString(m)
}
// ValidateEnumValue returns an error when providing an unsupported enum value
// This function is being called during constructing API request process
// Not recommended for calling this function directly
func (m SteeringPolicyPriorityRule) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// MarshalJSON marshals to json representation
func (m SteeringPolicyPriorityRule) MarshalJSON() (buff []byte, e error) {
type MarshalTypeSteeringPolicyPriorityRule SteeringPolicyPriorityRule
s := struct {
DiscriminatorParam string `json:"ruleType"`
MarshalTypeSteeringPolicyPriorityRule
}{
"PRIORITY",
(MarshalTypeSteeringPolicyPriorityRule)(m),
}
return json.Marshal(&s)
}