Skip to content

Commit 425b4ad

Browse files
box-sdk-buildbox-sdk-build
andauthored
feat: Add new schema for Metadata Error (box/box-openapi#539) (#538)
Co-authored-by: box-sdk-build <[email protected]>
1 parent f2584cd commit 425b4ad

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "fe7a2b2", "specHash": "7871ded", "version": "1.10.0" }
1+
{ "engineHash": "fe7a2b2", "specHash": "eaa9cf0", "version": "1.10.0" }
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using Box.Sdk.Gen;
2+
using System.Text.Json.Serialization;
3+
using System.Collections.Generic;
4+
using Box.Sdk.Gen.Internal;
5+
6+
namespace Box.Sdk.Gen.Schemas {
7+
public class MetadataError : ISerializable {
8+
/// <summary>
9+
/// A Box-specific error code.
10+
/// </summary>
11+
[JsonPropertyName("code")]
12+
public string? Code { get; init; }
13+
14+
/// <summary>
15+
/// A short message describing the error.
16+
/// </summary>
17+
[JsonPropertyName("message")]
18+
public string? Message { get; init; }
19+
20+
/// <summary>
21+
/// A unique identifier for this response, which can be used
22+
/// when contacting Box support.
23+
/// </summary>
24+
[JsonPropertyName("request_id")]
25+
public string? RequestId { get; init; }
26+
27+
public MetadataError() {
28+
29+
}
30+
internal string? RawJson { get; set; } = default;
31+
32+
void ISerializable.SetJson(string json) {
33+
RawJson = json;
34+
}
35+
36+
string? ISerializable.GetJson() {
37+
return RawJson;
38+
}
39+
40+
/// <summary>
41+
/// Returns raw json response returned from the API.
42+
/// </summary>
43+
public Dictionary<string, object?>? GetRawData() {
44+
return SimpleJsonSerializer.GetAllFields(this);
45+
}
46+
47+
}
48+
}

0 commit comments

Comments
 (0)