Skip to content

Commit 1047bcd

Browse files
committed
docs: Shield Lists documentation (box/box-openapi#528)
1 parent c5a82eb commit 1047bcd

32 files changed

+1305
-1
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "20cb559", "specHash": "a54170e", "version": "1.10.0" }
1+
{ "engineHash": "20cb559", "specHash": "630fc85", "version": "1.10.0" }

Box.Sdk.Gen/Client/BoxClient.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ public class BoxClient : IBoxClient {
157157

158158
public IDocgenManager Docgen { get; }
159159

160+
public IShieldListsManager ShieldLists { get; }
161+
160162
public BoxClient(IAuthentication auth, NetworkSession? networkSession = default) {
161163
Auth = auth;
162164
NetworkSession = networkSession ?? new NetworkSession(baseUrls: new BaseUrls());
@@ -234,6 +236,7 @@ public BoxClient(IAuthentication auth, NetworkSession? networkSession = default)
234236
AiStudio = new AiStudioManager(networkSession: this.NetworkSession) { Auth = this.Auth };
235237
DocgenTemplate = new DocgenTemplateManager(networkSession: this.NetworkSession) { Auth = this.Auth };
236238
Docgen = new DocgenManager(networkSession: this.NetworkSession) { Auth = this.Auth };
239+
ShieldLists = new ShieldListsManager(networkSession: this.NetworkSession) { Auth = this.Auth };
237240
}
238241
/// <summary>
239242
/// Make a custom http request using the client authentication and network session.

Box.Sdk.Gen/Client/IBoxClient.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,5 +155,7 @@ public interface IBoxClient {
155155

156156
public IDocgenManager Docgen { get => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it."); }
157157

158+
public IShieldListsManager ShieldLists { get => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it."); }
159+
158160
}
159161
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Box.Sdk.Gen;
2+
using System.Collections.Generic;
3+
using System.Collections.ObjectModel;
4+
using Box.Sdk.Gen.Internal;
5+
using Box.Sdk.Gen.Schemas;
6+
using Box.Sdk.Gen.Parameters;
7+
8+
namespace Box.Sdk.Gen.Managers {
9+
public class CreateShieldListV2025R0Headers {
10+
/// <summary>
11+
/// Version header
12+
/// </summary>
13+
public StringEnum<BoxVersionHeaderV2025R0> BoxVersion { get; }
14+
15+
/// <summary>
16+
/// Extra headers that will be included in the HTTP request.
17+
/// </summary>
18+
public Dictionary<string, string?> ExtraHeaders { get; }
19+
20+
public CreateShieldListV2025R0Headers(BoxVersionHeaderV2025R0 boxVersion = BoxVersionHeaderV2025R0._20250, Dictionary<string, string?>? extraHeaders = default) {
21+
BoxVersion = boxVersion;
22+
ExtraHeaders = extraHeaders ?? new Dictionary<string, string?>() { };
23+
}
24+
}
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Box.Sdk.Gen;
2+
using System.Collections.Generic;
3+
using System.Collections.ObjectModel;
4+
using Box.Sdk.Gen.Internal;
5+
using Box.Sdk.Gen.Schemas;
6+
using Box.Sdk.Gen.Parameters;
7+
8+
namespace Box.Sdk.Gen.Managers {
9+
public class DeleteShieldListByIdV2025R0Headers {
10+
/// <summary>
11+
/// Version header
12+
/// </summary>
13+
public StringEnum<BoxVersionHeaderV2025R0> BoxVersion { get; }
14+
15+
/// <summary>
16+
/// Extra headers that will be included in the HTTP request.
17+
/// </summary>
18+
public Dictionary<string, string?> ExtraHeaders { get; }
19+
20+
public DeleteShieldListByIdV2025R0Headers(BoxVersionHeaderV2025R0 boxVersion = BoxVersionHeaderV2025R0._20250, Dictionary<string, string?>? extraHeaders = default) {
21+
BoxVersion = boxVersion;
22+
ExtraHeaders = extraHeaders ?? new Dictionary<string, string?>() { };
23+
}
24+
}
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Box.Sdk.Gen;
2+
using System.Collections.Generic;
3+
using System.Collections.ObjectModel;
4+
using Box.Sdk.Gen.Internal;
5+
using Box.Sdk.Gen.Schemas;
6+
using Box.Sdk.Gen.Parameters;
7+
8+
namespace Box.Sdk.Gen.Managers {
9+
public class GetShieldListByIdV2025R0Headers {
10+
/// <summary>
11+
/// Version header
12+
/// </summary>
13+
public StringEnum<BoxVersionHeaderV2025R0> BoxVersion { get; }
14+
15+
/// <summary>
16+
/// Extra headers that will be included in the HTTP request.
17+
/// </summary>
18+
public Dictionary<string, string?> ExtraHeaders { get; }
19+
20+
public GetShieldListByIdV2025R0Headers(BoxVersionHeaderV2025R0 boxVersion = BoxVersionHeaderV2025R0._20250, Dictionary<string, string?>? extraHeaders = default) {
21+
BoxVersion = boxVersion;
22+
ExtraHeaders = extraHeaders ?? new Dictionary<string, string?>() { };
23+
}
24+
}
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Box.Sdk.Gen;
2+
using System.Collections.Generic;
3+
using System.Collections.ObjectModel;
4+
using Box.Sdk.Gen.Internal;
5+
using Box.Sdk.Gen.Schemas;
6+
using Box.Sdk.Gen.Parameters;
7+
8+
namespace Box.Sdk.Gen.Managers {
9+
public class GetShieldListsV2025R0Headers {
10+
/// <summary>
11+
/// Version header
12+
/// </summary>
13+
public StringEnum<BoxVersionHeaderV2025R0> BoxVersion { get; }
14+
15+
/// <summary>
16+
/// Extra headers that will be included in the HTTP request.
17+
/// </summary>
18+
public Dictionary<string, string?> ExtraHeaders { get; }
19+
20+
public GetShieldListsV2025R0Headers(BoxVersionHeaderV2025R0 boxVersion = BoxVersionHeaderV2025R0._20250, Dictionary<string, string?>? extraHeaders = default) {
21+
BoxVersion = boxVersion;
22+
ExtraHeaders = extraHeaders ?? new Dictionary<string, string?>() { };
23+
}
24+
}
25+
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
using Box.Sdk.Gen;
2+
using System.Collections.Generic;
3+
using System.Collections.ObjectModel;
4+
using Box.Sdk.Gen.Internal;
5+
using Box.Sdk.Gen.Schemas;
6+
using Box.Sdk.Gen.Parameters;
7+
8+
namespace Box.Sdk.Gen.Managers {
9+
public interface IShieldListsManager {
10+
/// <summary>
11+
/// Retrieves all shield lists in the enterprise.
12+
/// </summary>
13+
/// <param name="headers">
14+
/// Headers of getShieldListsV2025R0 method
15+
/// </param>
16+
/// <param name="cancellationToken">
17+
/// Token used for request cancellation.
18+
/// </param>
19+
public System.Threading.Tasks.Task<ShieldListsV2025R0> GetShieldListsV2025R0Async(GetShieldListsV2025R0Headers? headers = default, System.Threading.CancellationToken? cancellationToken = null) => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it.");
20+
21+
/// <summary>
22+
/// Creates a shield list.
23+
/// </summary>
24+
/// <param name="requestBody">
25+
/// Request body of createShieldListV2025R0 method
26+
/// </param>
27+
/// <param name="headers">
28+
/// Headers of createShieldListV2025R0 method
29+
/// </param>
30+
/// <param name="cancellationToken">
31+
/// Token used for request cancellation.
32+
/// </param>
33+
public System.Threading.Tasks.Task<ShieldListV2025R0> CreateShieldListV2025R0Async(ShieldListsCreateV2025R0 requestBody, CreateShieldListV2025R0Headers? headers = default, System.Threading.CancellationToken? cancellationToken = null) => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it.");
34+
35+
/// <summary>
36+
/// Retrieves a single shield list by its ID.
37+
/// </summary>
38+
/// <param name="shieldListId">
39+
/// The unique identifier that represents a shield list.
40+
/// The ID for any Shield List can be determined by the response from the endpoint
41+
/// fetching all shield lists for the enterprise.
42+
/// Example: "90fb0e17-c332-40ed-b4f9-fa8908fbbb24 "
43+
/// </param>
44+
/// <param name="headers">
45+
/// Headers of getShieldListByIdV2025R0 method
46+
/// </param>
47+
/// <param name="cancellationToken">
48+
/// Token used for request cancellation.
49+
/// </param>
50+
public System.Threading.Tasks.Task<ShieldListV2025R0> GetShieldListByIdV2025R0Async(string shieldListId, GetShieldListByIdV2025R0Headers? headers = default, System.Threading.CancellationToken? cancellationToken = null) => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it.");
51+
52+
/// <summary>
53+
/// Delete a single shield list by its ID.
54+
/// </summary>
55+
/// <param name="shieldListId">
56+
/// The unique identifier that represents a shield list.
57+
/// The ID for any Shield List can be determined by the response from the endpoint
58+
/// fetching all shield lists for the enterprise.
59+
/// Example: "90fb0e17-c332-40ed-b4f9-fa8908fbbb24 "
60+
/// </param>
61+
/// <param name="headers">
62+
/// Headers of deleteShieldListByIdV2025R0 method
63+
/// </param>
64+
/// <param name="cancellationToken">
65+
/// Token used for request cancellation.
66+
/// </param>
67+
public System.Threading.Tasks.Task DeleteShieldListByIdV2025R0Async(string shieldListId, DeleteShieldListByIdV2025R0Headers? headers = default, System.Threading.CancellationToken? cancellationToken = null) => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it.");
68+
69+
/// <summary>
70+
/// Updates a shield list.
71+
/// </summary>
72+
/// <param name="shieldListId">
73+
/// The unique identifier that represents a shield list.
74+
/// The ID for any Shield List can be determined by the response from the endpoint
75+
/// fetching all shield lists for the enterprise.
76+
/// Example: "90fb0e17-c332-40ed-b4f9-fa8908fbbb24 "
77+
/// </param>
78+
/// <param name="requestBody">
79+
/// Request body of updateShieldListByIdV2025R0 method
80+
/// </param>
81+
/// <param name="headers">
82+
/// Headers of updateShieldListByIdV2025R0 method
83+
/// </param>
84+
/// <param name="cancellationToken">
85+
/// Token used for request cancellation.
86+
/// </param>
87+
public System.Threading.Tasks.Task<ShieldListV2025R0> UpdateShieldListByIdV2025R0Async(string shieldListId, ShieldListsUpdateV2025R0 requestBody, UpdateShieldListByIdV2025R0Headers? headers = default, System.Threading.CancellationToken? cancellationToken = null) => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it.");
88+
89+
}
90+
}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
using Box.Sdk.Gen;
2+
using System.Collections.Generic;
3+
using System.Collections.ObjectModel;
4+
using Box.Sdk.Gen.Internal;
5+
using Box.Sdk.Gen.Schemas;
6+
using Box.Sdk.Gen.Parameters;
7+
8+
namespace Box.Sdk.Gen.Managers {
9+
public class ShieldListsManager : IShieldListsManager {
10+
public IAuthentication? Auth { get; init; }
11+
12+
public NetworkSession NetworkSession { get; }
13+
14+
public ShieldListsManager(NetworkSession? networkSession = default) {
15+
NetworkSession = networkSession ?? new NetworkSession();
16+
}
17+
/// <summary>
18+
/// Retrieves all shield lists in the enterprise.
19+
/// </summary>
20+
/// <param name="headers">
21+
/// Headers of getShieldListsV2025R0 method
22+
/// </param>
23+
/// <param name="cancellationToken">
24+
/// Token used for request cancellation.
25+
/// </param>
26+
public async System.Threading.Tasks.Task<ShieldListsV2025R0> GetShieldListsV2025R0Async(GetShieldListsV2025R0Headers? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
27+
headers = headers ?? new GetShieldListsV2025R0Headers();
28+
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { { "box-version", StringUtils.ToStringRepresentation(headers.BoxVersion) } }, headers.ExtraHeaders));
29+
FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_lists"), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
30+
return SimpleJsonSerializer.Deserialize<ShieldListsV2025R0>(NullableUtils.Unwrap(response.Data));
31+
}
32+
33+
/// <summary>
34+
/// Creates a shield list.
35+
/// </summary>
36+
/// <param name="requestBody">
37+
/// Request body of createShieldListV2025R0 method
38+
/// </param>
39+
/// <param name="headers">
40+
/// Headers of createShieldListV2025R0 method
41+
/// </param>
42+
/// <param name="cancellationToken">
43+
/// Token used for request cancellation.
44+
/// </param>
45+
public async System.Threading.Tasks.Task<ShieldListV2025R0> CreateShieldListV2025R0Async(ShieldListsCreateV2025R0 requestBody, CreateShieldListV2025R0Headers? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
46+
headers = headers ?? new CreateShieldListV2025R0Headers();
47+
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { { "box-version", StringUtils.ToStringRepresentation(headers.BoxVersion) } }, headers.ExtraHeaders));
48+
FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_lists"), method: "POST", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
49+
return SimpleJsonSerializer.Deserialize<ShieldListV2025R0>(NullableUtils.Unwrap(response.Data));
50+
}
51+
52+
/// <summary>
53+
/// Retrieves a single shield list by its ID.
54+
/// </summary>
55+
/// <param name="shieldListId">
56+
/// The unique identifier that represents a shield list.
57+
/// The ID for any Shield List can be determined by the response from the endpoint
58+
/// fetching all shield lists for the enterprise.
59+
/// Example: "90fb0e17-c332-40ed-b4f9-fa8908fbbb24 "
60+
/// </param>
61+
/// <param name="headers">
62+
/// Headers of getShieldListByIdV2025R0 method
63+
/// </param>
64+
/// <param name="cancellationToken">
65+
/// Token used for request cancellation.
66+
/// </param>
67+
public async System.Threading.Tasks.Task<ShieldListV2025R0> GetShieldListByIdV2025R0Async(string shieldListId, GetShieldListByIdV2025R0Headers? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
68+
headers = headers ?? new GetShieldListByIdV2025R0Headers();
69+
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { { "box-version", StringUtils.ToStringRepresentation(headers.BoxVersion) } }, headers.ExtraHeaders));
70+
FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_lists/", StringUtils.ToStringRepresentation(shieldListId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
71+
return SimpleJsonSerializer.Deserialize<ShieldListV2025R0>(NullableUtils.Unwrap(response.Data));
72+
}
73+
74+
/// <summary>
75+
/// Delete a single shield list by its ID.
76+
/// </summary>
77+
/// <param name="shieldListId">
78+
/// The unique identifier that represents a shield list.
79+
/// The ID for any Shield List can be determined by the response from the endpoint
80+
/// fetching all shield lists for the enterprise.
81+
/// Example: "90fb0e17-c332-40ed-b4f9-fa8908fbbb24 "
82+
/// </param>
83+
/// <param name="headers">
84+
/// Headers of deleteShieldListByIdV2025R0 method
85+
/// </param>
86+
/// <param name="cancellationToken">
87+
/// Token used for request cancellation.
88+
/// </param>
89+
public async System.Threading.Tasks.Task DeleteShieldListByIdV2025R0Async(string shieldListId, DeleteShieldListByIdV2025R0Headers? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
90+
headers = headers ?? new DeleteShieldListByIdV2025R0Headers();
91+
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { { "box-version", StringUtils.ToStringRepresentation(headers.BoxVersion) } }, headers.ExtraHeaders));
92+
FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_lists/", StringUtils.ToStringRepresentation(shieldListId)), method: "DELETE", responseFormat: Box.Sdk.Gen.ResponseFormat.NoContent) { Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
93+
}
94+
95+
/// <summary>
96+
/// Updates a shield list.
97+
/// </summary>
98+
/// <param name="shieldListId">
99+
/// The unique identifier that represents a shield list.
100+
/// The ID for any Shield List can be determined by the response from the endpoint
101+
/// fetching all shield lists for the enterprise.
102+
/// Example: "90fb0e17-c332-40ed-b4f9-fa8908fbbb24 "
103+
/// </param>
104+
/// <param name="requestBody">
105+
/// Request body of updateShieldListByIdV2025R0 method
106+
/// </param>
107+
/// <param name="headers">
108+
/// Headers of updateShieldListByIdV2025R0 method
109+
/// </param>
110+
/// <param name="cancellationToken">
111+
/// Token used for request cancellation.
112+
/// </param>
113+
public async System.Threading.Tasks.Task<ShieldListV2025R0> UpdateShieldListByIdV2025R0Async(string shieldListId, ShieldListsUpdateV2025R0 requestBody, UpdateShieldListByIdV2025R0Headers? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
114+
headers = headers ?? new UpdateShieldListByIdV2025R0Headers();
115+
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { { "box-version", StringUtils.ToStringRepresentation(headers.BoxVersion) } }, headers.ExtraHeaders));
116+
FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/shield_lists/", StringUtils.ToStringRepresentation(shieldListId)), method: "PUT", contentType: "application/json", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Headers = headersMap, Data = SimpleJsonSerializer.Serialize(requestBody), Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
117+
return SimpleJsonSerializer.Deserialize<ShieldListV2025R0>(NullableUtils.Unwrap(response.Data));
118+
}
119+
120+
}
121+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using Box.Sdk.Gen;
2+
using System.Collections.Generic;
3+
using System.Collections.ObjectModel;
4+
using Box.Sdk.Gen.Internal;
5+
using Box.Sdk.Gen.Schemas;
6+
using Box.Sdk.Gen.Parameters;
7+
8+
namespace Box.Sdk.Gen.Managers {
9+
public class UpdateShieldListByIdV2025R0Headers {
10+
/// <summary>
11+
/// Version header
12+
/// </summary>
13+
public StringEnum<BoxVersionHeaderV2025R0> BoxVersion { get; }
14+
15+
/// <summary>
16+
/// Extra headers that will be included in the HTTP request.
17+
/// </summary>
18+
public Dictionary<string, string?> ExtraHeaders { get; }
19+
20+
public UpdateShieldListByIdV2025R0Headers(BoxVersionHeaderV2025R0 boxVersion = BoxVersionHeaderV2025R0._20250, Dictionary<string, string?>? extraHeaders = default) {
21+
BoxVersion = boxVersion;
22+
ExtraHeaders = extraHeaders ?? new Dictionary<string, string?>() { };
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)