/
attribute_update_response.go
329 lines (279 loc) · 17.6 KB
/
attribute_update_response.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
// Copyright (c) 2016, 2018, 2024, 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.
// Application Performance Monitoring Trace Explorer API
//
// Use the Application Performance Monitoring Trace Explorer API to query traces and associated spans in Trace Explorer. For more information, see Application Performance Monitoring (https://docs.oracle.com/iaas/application-performance-monitoring/index.html).
//
package apmtraces
import (
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// AttributeUpdateResponse Response of an individual attribute item in the bulk update attribute operation.
type AttributeUpdateResponse struct {
// Attribute for which properties were updated in this bulk operation.
AttributeName *string `mandatory:"true" json:"attributeName"`
// Namespace of the attribute whose properties were updated. The attributeNameSpace will default to TRACES if it is
// not passed in.
AttributeNameSpace AttributeUpdateResponseAttributeNameSpaceEnum `mandatory:"true" json:"attributeNameSpace"`
// Time when the attribute's properties were updated.
TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"`
// Type of the attribute.
AttributeType AttributeUpdateResponseAttributeTypeEnum `mandatory:"false" json:"attributeType,omitempty"`
// Unit updated for this attribute.
Unit AttributeUpdateResponseUnitEnum `mandatory:"false" json:"unit,omitempty"`
// Notes for the attribute.
Notes *string `mandatory:"false" json:"notes"`
// Type of operation - UPDATE_ATTRIBUTE_PROPERTIES.
OperationType AttributeUpdateResponseOperationTypeEnum `mandatory:"false" json:"operationType,omitempty"`
// Status of the attribute after this operation. The attribute can have one of the following statuses after the update operation. The attribute
// can have either a success status or an error status. The status of the attribute must be correlated with the operation status property in the bulk operation metadata
// object. The bulk operation will be successful only when all attributes in the bulk request are processed successfully and they get a success status back.
// The following are successful status values of individual attribute items in a bulk update attribute operation.
// ATTRIBUTE_UPDATED - The attribute's properites have been updated with the given properties.
// DUPLICATE_ATTRIBUTE - The attribute is a duplicate of an attribute that was present in this bulk request. Note that we deduplicate the attribute collection, process only unique attributes,
// and call out duplicates. A duplicate attribute in a bulk request will not prevent the processing of further attributes in the bulk operation.
// The following values are error statuses and the bulk processing is stopped when the first error is encountered.
// INVALID_ATTRIBUTE - The attribute is invalid.
// ATTRIBUTE_NOT_PROCESSED - The attribute was not processed, as there was another attribute in this bulk request collection that resulted in a processing error.
// ATTRIBUTE_DOES_NOT_EXIST - Attribute was neither active nor pinned inactive.
// ATTRIBUTE_UPDATE_NOT_ALLOWED - Attribute update is not allowed as it is an in-built system attribute.
AttributeStatus AttributeUpdateResponseAttributeStatusEnum `mandatory:"false" json:"attributeStatus,omitempty"`
}
func (m AttributeUpdateResponse) 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 AttributeUpdateResponse) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if _, ok := GetMappingAttributeUpdateResponseAttributeNameSpaceEnum(string(m.AttributeNameSpace)); !ok && m.AttributeNameSpace != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeNameSpace: %s. Supported values are: %s.", m.AttributeNameSpace, strings.Join(GetAttributeUpdateResponseAttributeNameSpaceEnumStringValues(), ",")))
}
if _, ok := GetMappingAttributeUpdateResponseAttributeTypeEnum(string(m.AttributeType)); !ok && m.AttributeType != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeType: %s. Supported values are: %s.", m.AttributeType, strings.Join(GetAttributeUpdateResponseAttributeTypeEnumStringValues(), ",")))
}
if _, ok := GetMappingAttributeUpdateResponseUnitEnum(string(m.Unit)); !ok && m.Unit != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for Unit: %s. Supported values are: %s.", m.Unit, strings.Join(GetAttributeUpdateResponseUnitEnumStringValues(), ",")))
}
if _, ok := GetMappingAttributeUpdateResponseOperationTypeEnum(string(m.OperationType)); !ok && m.OperationType != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for OperationType: %s. Supported values are: %s.", m.OperationType, strings.Join(GetAttributeUpdateResponseOperationTypeEnumStringValues(), ",")))
}
if _, ok := GetMappingAttributeUpdateResponseAttributeStatusEnum(string(m.AttributeStatus)); !ok && m.AttributeStatus != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for AttributeStatus: %s. Supported values are: %s.", m.AttributeStatus, strings.Join(GetAttributeUpdateResponseAttributeStatusEnumStringValues(), ",")))
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// AttributeUpdateResponseAttributeTypeEnum Enum with underlying type: string
type AttributeUpdateResponseAttributeTypeEnum string
// Set of constants representing the allowable values for AttributeUpdateResponseAttributeTypeEnum
const (
AttributeUpdateResponseAttributeTypeNumeric AttributeUpdateResponseAttributeTypeEnum = "NUMERIC"
AttributeUpdateResponseAttributeTypeString AttributeUpdateResponseAttributeTypeEnum = "STRING"
)
var mappingAttributeUpdateResponseAttributeTypeEnum = map[string]AttributeUpdateResponseAttributeTypeEnum{
"NUMERIC": AttributeUpdateResponseAttributeTypeNumeric,
"STRING": AttributeUpdateResponseAttributeTypeString,
}
var mappingAttributeUpdateResponseAttributeTypeEnumLowerCase = map[string]AttributeUpdateResponseAttributeTypeEnum{
"numeric": AttributeUpdateResponseAttributeTypeNumeric,
"string": AttributeUpdateResponseAttributeTypeString,
}
// GetAttributeUpdateResponseAttributeTypeEnumValues Enumerates the set of values for AttributeUpdateResponseAttributeTypeEnum
func GetAttributeUpdateResponseAttributeTypeEnumValues() []AttributeUpdateResponseAttributeTypeEnum {
values := make([]AttributeUpdateResponseAttributeTypeEnum, 0)
for _, v := range mappingAttributeUpdateResponseAttributeTypeEnum {
values = append(values, v)
}
return values
}
// GetAttributeUpdateResponseAttributeTypeEnumStringValues Enumerates the set of values in String for AttributeUpdateResponseAttributeTypeEnum
func GetAttributeUpdateResponseAttributeTypeEnumStringValues() []string {
return []string{
"NUMERIC",
"STRING",
}
}
// GetMappingAttributeUpdateResponseAttributeTypeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingAttributeUpdateResponseAttributeTypeEnum(val string) (AttributeUpdateResponseAttributeTypeEnum, bool) {
enum, ok := mappingAttributeUpdateResponseAttributeTypeEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// AttributeUpdateResponseUnitEnum Enum with underlying type: string
type AttributeUpdateResponseUnitEnum string
// Set of constants representing the allowable values for AttributeUpdateResponseUnitEnum
const (
AttributeUpdateResponseUnitNone AttributeUpdateResponseUnitEnum = "NONE"
AttributeUpdateResponseUnitEpochTimeMs AttributeUpdateResponseUnitEnum = "EPOCH_TIME_MS"
AttributeUpdateResponseUnitBytes AttributeUpdateResponseUnitEnum = "BYTES"
AttributeUpdateResponseUnitCount AttributeUpdateResponseUnitEnum = "COUNT"
AttributeUpdateResponseUnitDurationMs AttributeUpdateResponseUnitEnum = "DURATION_MS"
AttributeUpdateResponseUnitTraceStatus AttributeUpdateResponseUnitEnum = "TRACE_STATUS"
AttributeUpdateResponseUnitPercentage AttributeUpdateResponseUnitEnum = "PERCENTAGE"
)
var mappingAttributeUpdateResponseUnitEnum = map[string]AttributeUpdateResponseUnitEnum{
"NONE": AttributeUpdateResponseUnitNone,
"EPOCH_TIME_MS": AttributeUpdateResponseUnitEpochTimeMs,
"BYTES": AttributeUpdateResponseUnitBytes,
"COUNT": AttributeUpdateResponseUnitCount,
"DURATION_MS": AttributeUpdateResponseUnitDurationMs,
"TRACE_STATUS": AttributeUpdateResponseUnitTraceStatus,
"PERCENTAGE": AttributeUpdateResponseUnitPercentage,
}
var mappingAttributeUpdateResponseUnitEnumLowerCase = map[string]AttributeUpdateResponseUnitEnum{
"none": AttributeUpdateResponseUnitNone,
"epoch_time_ms": AttributeUpdateResponseUnitEpochTimeMs,
"bytes": AttributeUpdateResponseUnitBytes,
"count": AttributeUpdateResponseUnitCount,
"duration_ms": AttributeUpdateResponseUnitDurationMs,
"trace_status": AttributeUpdateResponseUnitTraceStatus,
"percentage": AttributeUpdateResponseUnitPercentage,
}
// GetAttributeUpdateResponseUnitEnumValues Enumerates the set of values for AttributeUpdateResponseUnitEnum
func GetAttributeUpdateResponseUnitEnumValues() []AttributeUpdateResponseUnitEnum {
values := make([]AttributeUpdateResponseUnitEnum, 0)
for _, v := range mappingAttributeUpdateResponseUnitEnum {
values = append(values, v)
}
return values
}
// GetAttributeUpdateResponseUnitEnumStringValues Enumerates the set of values in String for AttributeUpdateResponseUnitEnum
func GetAttributeUpdateResponseUnitEnumStringValues() []string {
return []string{
"NONE",
"EPOCH_TIME_MS",
"BYTES",
"COUNT",
"DURATION_MS",
"TRACE_STATUS",
"PERCENTAGE",
}
}
// GetMappingAttributeUpdateResponseUnitEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingAttributeUpdateResponseUnitEnum(val string) (AttributeUpdateResponseUnitEnum, bool) {
enum, ok := mappingAttributeUpdateResponseUnitEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// AttributeUpdateResponseOperationTypeEnum Enum with underlying type: string
type AttributeUpdateResponseOperationTypeEnum string
// Set of constants representing the allowable values for AttributeUpdateResponseOperationTypeEnum
const (
AttributeUpdateResponseOperationTypeUpdateAttributeProperties AttributeUpdateResponseOperationTypeEnum = "UPDATE_ATTRIBUTE_PROPERTIES"
)
var mappingAttributeUpdateResponseOperationTypeEnum = map[string]AttributeUpdateResponseOperationTypeEnum{
"UPDATE_ATTRIBUTE_PROPERTIES": AttributeUpdateResponseOperationTypeUpdateAttributeProperties,
}
var mappingAttributeUpdateResponseOperationTypeEnumLowerCase = map[string]AttributeUpdateResponseOperationTypeEnum{
"update_attribute_properties": AttributeUpdateResponseOperationTypeUpdateAttributeProperties,
}
// GetAttributeUpdateResponseOperationTypeEnumValues Enumerates the set of values for AttributeUpdateResponseOperationTypeEnum
func GetAttributeUpdateResponseOperationTypeEnumValues() []AttributeUpdateResponseOperationTypeEnum {
values := make([]AttributeUpdateResponseOperationTypeEnum, 0)
for _, v := range mappingAttributeUpdateResponseOperationTypeEnum {
values = append(values, v)
}
return values
}
// GetAttributeUpdateResponseOperationTypeEnumStringValues Enumerates the set of values in String for AttributeUpdateResponseOperationTypeEnum
func GetAttributeUpdateResponseOperationTypeEnumStringValues() []string {
return []string{
"UPDATE_ATTRIBUTE_PROPERTIES",
}
}
// GetMappingAttributeUpdateResponseOperationTypeEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingAttributeUpdateResponseOperationTypeEnum(val string) (AttributeUpdateResponseOperationTypeEnum, bool) {
enum, ok := mappingAttributeUpdateResponseOperationTypeEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// AttributeUpdateResponseAttributeStatusEnum Enum with underlying type: string
type AttributeUpdateResponseAttributeStatusEnum string
// Set of constants representing the allowable values for AttributeUpdateResponseAttributeStatusEnum
const (
AttributeUpdateResponseAttributeStatusAttributeUpdated AttributeUpdateResponseAttributeStatusEnum = "ATTRIBUTE_UPDATED"
AttributeUpdateResponseAttributeStatusDuplicateAttribute AttributeUpdateResponseAttributeStatusEnum = "DUPLICATE_ATTRIBUTE"
AttributeUpdateResponseAttributeStatusInvalidAttribute AttributeUpdateResponseAttributeStatusEnum = "INVALID_ATTRIBUTE"
AttributeUpdateResponseAttributeStatusAttributeNotProcessed AttributeUpdateResponseAttributeStatusEnum = "ATTRIBUTE_NOT_PROCESSED"
AttributeUpdateResponseAttributeStatusAttributeDoesNotExist AttributeUpdateResponseAttributeStatusEnum = "ATTRIBUTE_DOES_NOT_EXIST"
AttributeUpdateResponseAttributeStatusAttributeUpdateNotAllowed AttributeUpdateResponseAttributeStatusEnum = "ATTRIBUTE_UPDATE_NOT_ALLOWED"
)
var mappingAttributeUpdateResponseAttributeStatusEnum = map[string]AttributeUpdateResponseAttributeStatusEnum{
"ATTRIBUTE_UPDATED": AttributeUpdateResponseAttributeStatusAttributeUpdated,
"DUPLICATE_ATTRIBUTE": AttributeUpdateResponseAttributeStatusDuplicateAttribute,
"INVALID_ATTRIBUTE": AttributeUpdateResponseAttributeStatusInvalidAttribute,
"ATTRIBUTE_NOT_PROCESSED": AttributeUpdateResponseAttributeStatusAttributeNotProcessed,
"ATTRIBUTE_DOES_NOT_EXIST": AttributeUpdateResponseAttributeStatusAttributeDoesNotExist,
"ATTRIBUTE_UPDATE_NOT_ALLOWED": AttributeUpdateResponseAttributeStatusAttributeUpdateNotAllowed,
}
var mappingAttributeUpdateResponseAttributeStatusEnumLowerCase = map[string]AttributeUpdateResponseAttributeStatusEnum{
"attribute_updated": AttributeUpdateResponseAttributeStatusAttributeUpdated,
"duplicate_attribute": AttributeUpdateResponseAttributeStatusDuplicateAttribute,
"invalid_attribute": AttributeUpdateResponseAttributeStatusInvalidAttribute,
"attribute_not_processed": AttributeUpdateResponseAttributeStatusAttributeNotProcessed,
"attribute_does_not_exist": AttributeUpdateResponseAttributeStatusAttributeDoesNotExist,
"attribute_update_not_allowed": AttributeUpdateResponseAttributeStatusAttributeUpdateNotAllowed,
}
// GetAttributeUpdateResponseAttributeStatusEnumValues Enumerates the set of values for AttributeUpdateResponseAttributeStatusEnum
func GetAttributeUpdateResponseAttributeStatusEnumValues() []AttributeUpdateResponseAttributeStatusEnum {
values := make([]AttributeUpdateResponseAttributeStatusEnum, 0)
for _, v := range mappingAttributeUpdateResponseAttributeStatusEnum {
values = append(values, v)
}
return values
}
// GetAttributeUpdateResponseAttributeStatusEnumStringValues Enumerates the set of values in String for AttributeUpdateResponseAttributeStatusEnum
func GetAttributeUpdateResponseAttributeStatusEnumStringValues() []string {
return []string{
"ATTRIBUTE_UPDATED",
"DUPLICATE_ATTRIBUTE",
"INVALID_ATTRIBUTE",
"ATTRIBUTE_NOT_PROCESSED",
"ATTRIBUTE_DOES_NOT_EXIST",
"ATTRIBUTE_UPDATE_NOT_ALLOWED",
}
}
// GetMappingAttributeUpdateResponseAttributeStatusEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingAttributeUpdateResponseAttributeStatusEnum(val string) (AttributeUpdateResponseAttributeStatusEnum, bool) {
enum, ok := mappingAttributeUpdateResponseAttributeStatusEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// AttributeUpdateResponseAttributeNameSpaceEnum Enum with underlying type: string
type AttributeUpdateResponseAttributeNameSpaceEnum string
// Set of constants representing the allowable values for AttributeUpdateResponseAttributeNameSpaceEnum
const (
AttributeUpdateResponseAttributeNameSpaceTraces AttributeUpdateResponseAttributeNameSpaceEnum = "TRACES"
AttributeUpdateResponseAttributeNameSpaceSynthetic AttributeUpdateResponseAttributeNameSpaceEnum = "SYNTHETIC"
)
var mappingAttributeUpdateResponseAttributeNameSpaceEnum = map[string]AttributeUpdateResponseAttributeNameSpaceEnum{
"TRACES": AttributeUpdateResponseAttributeNameSpaceTraces,
"SYNTHETIC": AttributeUpdateResponseAttributeNameSpaceSynthetic,
}
var mappingAttributeUpdateResponseAttributeNameSpaceEnumLowerCase = map[string]AttributeUpdateResponseAttributeNameSpaceEnum{
"traces": AttributeUpdateResponseAttributeNameSpaceTraces,
"synthetic": AttributeUpdateResponseAttributeNameSpaceSynthetic,
}
// GetAttributeUpdateResponseAttributeNameSpaceEnumValues Enumerates the set of values for AttributeUpdateResponseAttributeNameSpaceEnum
func GetAttributeUpdateResponseAttributeNameSpaceEnumValues() []AttributeUpdateResponseAttributeNameSpaceEnum {
values := make([]AttributeUpdateResponseAttributeNameSpaceEnum, 0)
for _, v := range mappingAttributeUpdateResponseAttributeNameSpaceEnum {
values = append(values, v)
}
return values
}
// GetAttributeUpdateResponseAttributeNameSpaceEnumStringValues Enumerates the set of values in String for AttributeUpdateResponseAttributeNameSpaceEnum
func GetAttributeUpdateResponseAttributeNameSpaceEnumStringValues() []string {
return []string{
"TRACES",
"SYNTHETIC",
}
}
// GetMappingAttributeUpdateResponseAttributeNameSpaceEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingAttributeUpdateResponseAttributeNameSpaceEnum(val string) (AttributeUpdateResponseAttributeNameSpaceEnum, bool) {
enum, ok := mappingAttributeUpdateResponseAttributeNameSpaceEnumLowerCase[strings.ToLower(val)]
return enum, ok
}