forked from oracle/oci-go-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unified_agent_logging_source.go
99 lines (82 loc) · 2.98 KB
/
unified_agent_logging_source.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
// 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.
// loggingManagementControlplane API
//
// loggingManagementControlplane API specification
//
package logging
import (
"encoding/json"
"github.com/oracle/oci-go-sdk/common"
)
// UnifiedAgentLoggingSource logging source object.
type UnifiedAgentLoggingSource interface {
// unique name for the source
GetName() *string
}
type unifiedagentloggingsource struct {
JsonData []byte
Name *string `mandatory:"true" json:"name"`
SourceType string `json:"sourceType"`
}
// UnmarshalJSON unmarshals json
func (m *unifiedagentloggingsource) UnmarshalJSON(data []byte) error {
m.JsonData = data
type Unmarshalerunifiedagentloggingsource unifiedagentloggingsource
s := struct {
Model Unmarshalerunifiedagentloggingsource
}{}
err := json.Unmarshal(data, &s.Model)
if err != nil {
return err
}
m.Name = s.Model.Name
m.SourceType = s.Model.SourceType
return err
}
// UnmarshalPolymorphicJSON unmarshals polymorphic json
func (m *unifiedagentloggingsource) UnmarshalPolymorphicJSON(data []byte) (interface{}, error) {
if data == nil || string(data) == "null" {
return nil, nil
}
var err error
switch m.SourceType {
case "WINDOWS_EVENT_LOG":
mm := UnifiedAgentWindowsEventSource{}
err = json.Unmarshal(data, &mm)
return mm, err
case "LOG_TAIL":
mm := UnifiedAgentTailLogSource{}
err = json.Unmarshal(data, &mm)
return mm, err
default:
return *m, nil
}
}
//GetName returns Name
func (m unifiedagentloggingsource) GetName() *string {
return m.Name
}
func (m unifiedagentloggingsource) String() string {
return common.PointerString(m)
}
// UnifiedAgentLoggingSourceSourceTypeEnum Enum with underlying type: string
type UnifiedAgentLoggingSourceSourceTypeEnum string
// Set of constants representing the allowable values for UnifiedAgentLoggingSourceSourceTypeEnum
const (
UnifiedAgentLoggingSourceSourceTypeLogTail UnifiedAgentLoggingSourceSourceTypeEnum = "LOG_TAIL"
UnifiedAgentLoggingSourceSourceTypeWindowsEventLog UnifiedAgentLoggingSourceSourceTypeEnum = "WINDOWS_EVENT_LOG"
)
var mappingUnifiedAgentLoggingSourceSourceType = map[string]UnifiedAgentLoggingSourceSourceTypeEnum{
"LOG_TAIL": UnifiedAgentLoggingSourceSourceTypeLogTail,
"WINDOWS_EVENT_LOG": UnifiedAgentLoggingSourceSourceTypeWindowsEventLog,
}
// GetUnifiedAgentLoggingSourceSourceTypeEnumValues Enumerates the set of values for UnifiedAgentLoggingSourceSourceTypeEnum
func GetUnifiedAgentLoggingSourceSourceTypeEnumValues() []UnifiedAgentLoggingSourceSourceTypeEnum {
values := make([]UnifiedAgentLoggingSourceSourceTypeEnum, 0)
for _, v := range mappingUnifiedAgentLoggingSourceSourceType {
values = append(values, v)
}
return values
}