1// Copyright (c) 2016, 2018, 2019, Oracle and/or its affiliates. All rights reserved.
2// Code generated. DO NOT EDIT.
3
4// Audit API
5//
6// API for the Audit Service. Use this API for compliance monitoring in your tenancy.
7// For more information, see Overview of Audit (https://docs.cloud.oracle.com/iaas/Content/Audit/Concepts/auditoverview.htm).
8// **Tip**: This API is good for queries, but not bulk-export operations.
9//
10
11package audit
12
13import (
14	"github.com/oracle/oci-go-sdk/common"
15)
16
17// Data The payload of the event. Information within `data` comes from the resource emitting the event.
18// Example:
19//   -----
20//     {
21//       "eventGroupingId": null,
22//       "eventName": "GetInstance",
23//       "compartmentId": "ocid1.tenancy.oc1..<unique_ID>",
24//       "compartmentName": "compartmentA",
25//       "resourceName": "my_instance",
26//       "resourceId": "ocid1.instance.oc1.phx.<unique_ID>",
27//       "availabilityDomain": "<availability_domain>",
28//       "freeformTags": null,
29//       "definedTags": null,
30//       "identity": {
31//         "principalName": "ExampleName",
32//         "principalId": "ocid1.user.oc1..<unique_ID>",
33//         "authType": "natv",
34//         "callerName": null,
35//         "callerId": null,
36//         "tenantId": "ocid1.tenancy.oc1..<unique_ID>",
37//         "ipAddress": "172.24.80.88",
38//         "credentials": null,
39//         "userAgent": "Jersey/2.23 (HttpUrlConnection 1.8.0_212)",
40//         "consoleSessionId": null
41//       },
42//       "request": {
43//         "id": "<unique_ID>",
44//         "path": "/20160918/instances/ocid1.instance.oc1.phx.<unique_ID>",
45//         "action": "GET",
46//         "parameters": {},
47//         "headers": {
48//           "opc-principal": [
49//             "{\"tenantId\":\"ocid1.tenancy.oc1..<unique_ID>\",\"subjectId\":\"ocid1.user.oc1..<unique_ID>\",\"claims\":[{\"key\":\"pstype\",\"value\":\"natv\",\"issuer\":\"authService.oracle.com\"},{\"key\":\"h_host\",\"value\":\"iaas.r2.oracleiaas.com\",\"issuer\":\"h\"},{\"key\":\"h_opc-request-id\",\"value\":\"<unique_ID>\",\"issuer\":\"h\"},{\"key\":\"ptype\",\"value\":\"user\",\"issuer\":\"authService.oracle.com\"},{\"key\":\"h_date\",\"value\":\"Wed, 18 Sep 2019 00:10:58 UTC\",\"issuer\":\"h\"},{\"key\":\"h_accept\",\"value\":\"application/json\",\"issuer\":\"h\"},{\"key\":\"authorization\",\"value\":\"Signature headers=\\\"date (request-target) host accept opc-request-id\\\",keyId=\\\"ocid1.tenancy.oc1..<unique_ID>/ocid1.user.oc1..<unique_ID>/8c:b4:5f:18:e7:ec:db:08:b8:fa:d2:2a:7d:11:76:ac\\\",algorithm=\\\"rsa-pss-sha256\\\",signature=\\\"<unique_ID>\\\",version=\\\"1\\\"\",\"issuer\":\"h\"},{\"key\":\"h_(request-target)\",\"value\":\"get /20160918/instances/ocid1.instance.oc1.phx.<unique_ID>\",\"issuer\":\"h\"}]}"
50//           ],
51//           "Accept": [
52//             "application/json"
53//           ],
54//           "X-Oracle-Auth-Client-CN": [
55//             "splat-proxy-se-02302.node.ad2.r2"
56//           ],
57//           "X-Forwarded-Host": [
58//             "compute-api.svc.ad1.r2"
59//           ],
60//           "Connection": [
61//             "close"
62//           ],
63//           "User-Agent": [
64//             "Jersey/2.23 (HttpUrlConnection 1.8.0_212)"
65//           ],
66//           "X-Forwarded-For": [
67//             "172.24.80.88"
68//           ],
69//           "X-Real-IP": [
70//             "172.24.80.88"
71//           ],
72//           "oci-original-url": [
73//             "https://iaas.r2.oracleiaas.com/20160918/instances/ocid1.instance.oc1.phx.<unique_ID>"
74//           ],
75//           "opc-request-id": [
76//             "<unique_ID>"
77//           ],
78//           "Date": [
79//             "Wed, 18 Sep 2019 00:10:58 UTC"
80//           ]
81//         }
82//       },
83//       "response": {
84//         "status": "200",
85//         "responseTime": "2019-09-18T00:10:59.278Z",
86//         "headers": {
87//           "ETag": [
88//             "<unique_ID>"
89//           ],
90//           "Connection": [
91//             "close"
92//           ],
93//           "Content-Length": [
94//             "1828"
95//           ],
96//           "opc-request-id": [
97//             "<unique_ID>"
98//           ],
99//           "Date": [
100//             "Wed, 18 Sep 2019 00:10:59 GMT"
101//           ],
102//           "Content-Type": [
103//             "application/json"
104//           ]
105//         },
106//         "payload": {
107//           "resourceName": "my_instance",
108//           "id": "ocid1.instance.oc1.phx.<unique_ID>"
109//         },
110//         "message": null
111//       },
112//       "stateChange": {
113//         "previous": null,
114//         "current": null
115//       },
116//       "additionalDetails": {
117//         "imageId": "ocid1.image.oc1.phx.<unique_ID>",
118//         "shape": "VM.Standard1.1",
119//         "type": "CustomerVmi"
120//       }
121//     }
122//   -----
123type Data struct {
124
125	// This value links multiple audit events that are part of the same API operation. For example,
126	// a long running API operations that emit an event at the start and the end of an operation
127	// would use the same value in this field for both events.
128	EventGroupingId *string `mandatory:"false" json:"eventGroupingId"`
129
130	// Name of the API operation that generated this event.
131	// Example: `GetInstance`
132	EventName *string `mandatory:"false" json:"eventName"`
133
134	// The OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment of the resource
135	// emitting the event.
136	CompartmentId *string `mandatory:"false" json:"compartmentId"`
137
138	// The name of the compartment. This value is the friendly name associated with compartmentId.
139	// This value can change, but the service logs the value that appeared at the time of the audit
140	// event.
141	// Example: `CompartmentA`
142	CompartmentName *string `mandatory:"false" json:"compartmentName"`
143
144	// The name of the resource emitting the event.
145	ResourceName *string `mandatory:"false" json:"resourceName"`
146
147	// An OCID (https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) or some other ID for the resource
148	// emitting the event.
149	ResourceId *string `mandatory:"false" json:"resourceId"`
150
151	// The availability domain where the resource resides.
152	AvailabilityDomain *string `mandatory:"false" json:"availabilityDomain"`
153
154	// Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name,
155	// type, or namespace. Exists for cross-compatibility only. For more information,
156	// see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
157	// Example: `{"Department": "Finance"}`
158	FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
159
160	// Defined tags for this resource. Each key is predefined and scoped to a namespace. For more
161	// information, see Resource Tags (https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
162	// Example: `{"Operations": {"CostCenter": "42"}}`
163	DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
164
165	Identity *Identity `mandatory:"false" json:"identity"`
166
167	Request *Request `mandatory:"false" json:"request"`
168
169	Response *Response `mandatory:"false" json:"response"`
170
171	StateChange *StateChange `mandatory:"false" json:"stateChange"`
172
173	// A container object for attribues unique to the resource emitting the event.
174	// Example:
175	//   -----
176	//     {
177	//       "imageId": "ocid1.image.oc1.phx.<unique_ID>",
178	//       "shape": "VM.Standard1.1",
179	//       "type": "CustomerVmi"
180	//     }
181	//   -----
182	AdditionalDetails map[string]interface{} `mandatory:"false" json:"additionalDetails"`
183}
184
185func (m Data) String() string {
186	return common.PointerString(m)
187}
188