-
Notifications
You must be signed in to change notification settings - Fork 4
/
hashicorp_cloud_consul_telemetry20230414_intentions_authorization.go
100 lines (79 loc) · 5.51 KB
/
hashicorp_cloud_consul_telemetry20230414_intentions_authorization.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// HashicorpCloudConsulTelemetry20230414IntentionsAuthorization authorization are the authorization results of intentions between services.
// Either traffic is allowed, denied, or undefined.
//
// - AUTHORIZATION_ALLOW_INTENTIONS: traffic is allowed because of an intention
// - AUTHORIZATION_DENY_INTENTIONS: traffic is denied because of an intention
// - AUTHORIZATION_ALLOW_DEFAULT: traffic is allowed because of a default acl policy
// - AUTHORIZATION_DENY_DEFAULT: traffic is denied because of a default acl policy
// - AUTHORIZATION_UNDEFINED_APP_AWARE: traffic is either allowed or denied based on paths in the request. We cannot tell, from the
//
// intentions/default_policy alone, whether calls will be allowed or denied. This is the case if
// HTTP is set on intention permissions: https://developer.hashicorp.com/consul/docs/connect/config-entries/service-intentions#sources-permissions-http
//
// swagger:model hashicorp.cloud.consul_telemetry_20230414.Intentions.Authorization
type HashicorpCloudConsulTelemetry20230414IntentionsAuthorization string
func NewHashicorpCloudConsulTelemetry20230414IntentionsAuthorization(value HashicorpCloudConsulTelemetry20230414IntentionsAuthorization) *HashicorpCloudConsulTelemetry20230414IntentionsAuthorization {
return &value
}
// Pointer returns a pointer to a freshly-allocated HashicorpCloudConsulTelemetry20230414IntentionsAuthorization.
func (m HashicorpCloudConsulTelemetry20230414IntentionsAuthorization) Pointer() *HashicorpCloudConsulTelemetry20230414IntentionsAuthorization {
return &m
}
const (
// HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONUNSPECIFIED captures enum value "AUTHORIZATION_UNSPECIFIED"
HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONUNSPECIFIED HashicorpCloudConsulTelemetry20230414IntentionsAuthorization = "AUTHORIZATION_UNSPECIFIED"
// HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONALLOWINTENTIONS captures enum value "AUTHORIZATION_ALLOW_INTENTIONS"
HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONALLOWINTENTIONS HashicorpCloudConsulTelemetry20230414IntentionsAuthorization = "AUTHORIZATION_ALLOW_INTENTIONS"
// HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONDENYINTENTIONS captures enum value "AUTHORIZATION_DENY_INTENTIONS"
HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONDENYINTENTIONS HashicorpCloudConsulTelemetry20230414IntentionsAuthorization = "AUTHORIZATION_DENY_INTENTIONS"
// HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONALLOWDEFAULT captures enum value "AUTHORIZATION_ALLOW_DEFAULT"
HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONALLOWDEFAULT HashicorpCloudConsulTelemetry20230414IntentionsAuthorization = "AUTHORIZATION_ALLOW_DEFAULT"
// HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONDENYDEFAULT captures enum value "AUTHORIZATION_DENY_DEFAULT"
HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONDENYDEFAULT HashicorpCloudConsulTelemetry20230414IntentionsAuthorization = "AUTHORIZATION_DENY_DEFAULT"
// HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONUNDEFINEDAPPAWARE captures enum value "AUTHORIZATION_UNDEFINED_APP_AWARE"
HashicorpCloudConsulTelemetry20230414IntentionsAuthorizationAUTHORIZATIONUNDEFINEDAPPAWARE HashicorpCloudConsulTelemetry20230414IntentionsAuthorization = "AUTHORIZATION_UNDEFINED_APP_AWARE"
)
// for schema
var hashicorpCloudConsulTelemetry20230414IntentionsAuthorizationEnum []interface{}
func init() {
var res []HashicorpCloudConsulTelemetry20230414IntentionsAuthorization
if err := json.Unmarshal([]byte(`["AUTHORIZATION_UNSPECIFIED","AUTHORIZATION_ALLOW_INTENTIONS","AUTHORIZATION_DENY_INTENTIONS","AUTHORIZATION_ALLOW_DEFAULT","AUTHORIZATION_DENY_DEFAULT","AUTHORIZATION_UNDEFINED_APP_AWARE"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
hashicorpCloudConsulTelemetry20230414IntentionsAuthorizationEnum = append(hashicorpCloudConsulTelemetry20230414IntentionsAuthorizationEnum, v)
}
}
func (m HashicorpCloudConsulTelemetry20230414IntentionsAuthorization) validateHashicorpCloudConsulTelemetry20230414IntentionsAuthorizationEnum(path, location string, value HashicorpCloudConsulTelemetry20230414IntentionsAuthorization) error {
if err := validate.EnumCase(path, location, value, hashicorpCloudConsulTelemetry20230414IntentionsAuthorizationEnum, true); err != nil {
return err
}
return nil
}
// Validate validates this hashicorp cloud consul telemetry 20230414 intentions authorization
func (m HashicorpCloudConsulTelemetry20230414IntentionsAuthorization) Validate(formats strfmt.Registry) error {
var res []error
// value enum
if err := m.validateHashicorpCloudConsulTelemetry20230414IntentionsAuthorizationEnum("", "body", m); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// ContextValidate validates this hashicorp cloud consul telemetry 20230414 intentions authorization based on context it is used
func (m HashicorpCloudConsulTelemetry20230414IntentionsAuthorization) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}