/
caching_rule.go
71 lines (55 loc) · 3.22 KB
/
caching_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
// Copyright (c) 2016, 2018, 2020, 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.
// Web Application Acceleration and Security Services API
//
// OCI Web Application Acceleration and Security Services
//
package waas
import (
"github.com/oracle/oci-go-sdk/common"
)
// CachingRule The representation of CachingRule
type CachingRule struct {
// The name of the caching rule.
Name *string `mandatory:"true" json:"name"`
// The action to take when the criteria of a caching rule are met.
// - **CACHE:** Caches requested content when the criteria of the rule are met.
// - **BYPASS_CACHE:** Allows requests to bypass the cache and be directed to the origin when the criteria of the rule is met.
Action CachingRuleActionEnum `mandatory:"true" json:"action"`
// The array of the rule criteria with condition and value. The caching rule would be applied for the requests that matched any of the listed conditions.
Criteria []CachingRuleCriteria `mandatory:"true" json:"criteria"`
// The unique key for the caching rule.
Key *string `mandatory:"false" json:"key"`
// The duration to cache content for the caching rule, specified in ISO 8601 extended format. Supported units: seconds, minutes, hours, days, weeks, months. The maximum value that can be set for any unit is `99`. Mixing of multiple units is not supported. Only applies when the `action` is set to `CACHE`.
// Example: `PT1H`
CachingDuration *string `mandatory:"false" json:"cachingDuration"`
// Enables or disables client caching.
// Browsers use the `Cache-Control` header value for caching content locally in the browser. This setting overrides the addition of a `Cache-Control` header in responses.
IsClientCachingEnabled *bool `mandatory:"false" json:"isClientCachingEnabled"`
// The duration to cache content in the user's browser, specified in ISO 8601 extended format. Supported units: seconds, minutes, hours, days, weeks, months. The maximum value that can be set for any unit is `99`. Mixing of multiple units is not supported. Only applies when the `action` is set to `CACHE`.
// Example: `PT1H`
ClientCachingDuration *string `mandatory:"false" json:"clientCachingDuration"`
}
func (m CachingRule) String() string {
return common.PointerString(m)
}
// CachingRuleActionEnum Enum with underlying type: string
type CachingRuleActionEnum string
// Set of constants representing the allowable values for CachingRuleActionEnum
const (
CachingRuleActionCache CachingRuleActionEnum = "CACHE"
CachingRuleActionBypassCache CachingRuleActionEnum = "BYPASS_CACHE"
)
var mappingCachingRuleAction = map[string]CachingRuleActionEnum{
"CACHE": CachingRuleActionCache,
"BYPASS_CACHE": CachingRuleActionBypassCache,
}
// GetCachingRuleActionEnumValues Enumerates the set of values for CachingRuleActionEnum
func GetCachingRuleActionEnumValues() []CachingRuleActionEnum {
values := make([]CachingRuleActionEnum, 0)
for _, v := range mappingCachingRuleAction {
values = append(values, v)
}
return values
}