Skip to content

Commit 2cc01b4

Browse files
committed
feat: add GET enterprise configuration endpoint (box/box-openapi#559)
1 parent 1efa95e commit 2cc01b4

File tree

137 files changed

+6422
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+6422
-1
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "192deac", "specHash": "fa34496", "version": "10.1.0" }
1+
{ "engineHash": "192deac", "specHash": "cf21406", "version": "10.1.0" }

Box.Sdk.Gen.Net/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 IEnterpriseConfigurationsManager EnterpriseConfigurations { get; }
161+
160162
public IHubsManager Hubs { get; }
161163

162164
public IHubCollaborationsManager HubCollaborations { get; }
@@ -246,6 +248,7 @@ public BoxClient(IAuthentication auth, NetworkSession? networkSession = default)
246248
AiStudio = new AiStudioManager(networkSession: this.NetworkSession) { Auth = this.Auth };
247249
DocgenTemplate = new DocgenTemplateManager(networkSession: this.NetworkSession) { Auth = this.Auth };
248250
Docgen = new DocgenManager(networkSession: this.NetworkSession) { Auth = this.Auth };
251+
EnterpriseConfigurations = new EnterpriseConfigurationsManager(networkSession: this.NetworkSession) { Auth = this.Auth };
249252
Hubs = new HubsManager(networkSession: this.NetworkSession) { Auth = this.Auth };
250253
HubCollaborations = new HubCollaborationsManager(networkSession: this.NetworkSession) { Auth = this.Auth };
251254
HubItems = new HubItemsManager(networkSession: this.NetworkSession) { Auth = this.Auth };

Box.Sdk.Gen.Net/Client/IBoxClient.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ 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 IEnterpriseConfigurationsManager EnterpriseConfigurations { get => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it."); }
159+
158160
public IHubsManager Hubs { get => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it."); }
159161

160162
public IHubCollaborationsManager HubCollaborations { get => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it."); }
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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 EnterpriseConfigurationsManager : IEnterpriseConfigurationsManager {
10+
public IAuthentication? Auth { get; init; }
11+
12+
public NetworkSession NetworkSession { get; }
13+
14+
public EnterpriseConfigurationsManager(NetworkSession? networkSession = default) {
15+
NetworkSession = networkSession ?? new NetworkSession();
16+
}
17+
/// <summary>
18+
/// Retrieves the configuration for an enterprise.
19+
/// </summary>
20+
/// <param name="enterpriseId">
21+
/// The ID of the enterprise.
22+
/// Example: "3442311"
23+
/// </param>
24+
/// <param name="queryParams">
25+
/// Query parameters of getEnterpriseConfigurationByIdV2025R0 method
26+
/// </param>
27+
/// <param name="headers">
28+
/// Headers of getEnterpriseConfigurationByIdV2025R0 method
29+
/// </param>
30+
/// <param name="cancellationToken">
31+
/// Token used for request cancellation.
32+
/// </param>
33+
public async System.Threading.Tasks.Task<EnterpriseConfigurationV2025R0> GetEnterpriseConfigurationByIdV2025R0Async(string enterpriseId, GetEnterpriseConfigurationByIdV2025R0QueryParams queryParams, GetEnterpriseConfigurationByIdV2025R0Headers? headers = default, System.Threading.CancellationToken? cancellationToken = null) {
34+
headers = headers ?? new GetEnterpriseConfigurationByIdV2025R0Headers();
35+
Dictionary<string, string> queryParamsMap = Utils.PrepareParams(map: new Dictionary<string, string?>() { { "categories", StringUtils.ToStringRepresentation(queryParams.Categories) } });
36+
Dictionary<string, string> headersMap = Utils.PrepareParams(map: DictionaryUtils.MergeDictionaries(new Dictionary<string, string?>() { { "box-version", StringUtils.ToStringRepresentation(headers.BoxVersion) } }, headers.ExtraHeaders));
37+
FetchResponse response = await this.NetworkSession.NetworkClient.FetchAsync(options: new FetchOptions(url: string.Concat(this.NetworkSession.BaseUrls.BaseUrl, "/2.0/enterprise_configurations/", StringUtils.ToStringRepresentation(enterpriseId)), method: "GET", responseFormat: Box.Sdk.Gen.ResponseFormat.Json) { Parameters = queryParamsMap, Headers = headersMap, Auth = this.Auth, NetworkSession = this.NetworkSession, CancellationToken = cancellationToken }).ConfigureAwait(false);
38+
return SimpleJsonSerializer.Deserialize<EnterpriseConfigurationV2025R0>(NullableUtils.Unwrap(response.Data));
39+
}
40+
41+
}
42+
}
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 GetEnterpriseConfigurationByIdV2025R0Headers {
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 GetEnterpriseConfigurationByIdV2025R0Headers(BoxVersionHeaderV2025R0 boxVersion = BoxVersionHeaderV2025R0._20250, Dictionary<string, string?>? extraHeaders = default) {
21+
BoxVersion = boxVersion;
22+
ExtraHeaders = extraHeaders ?? new Dictionary<string, string?>() { };
23+
}
24+
}
25+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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 GetEnterpriseConfigurationByIdV2025R0QueryParams {
10+
/// <summary>
11+
/// The comma-delimited list of the enterprise configuration categories.
12+
/// Allowed values: `security`, `content_and_sharing`, `user_settings`, `shield`.
13+
/// </summary>
14+
public string Categories { get; }
15+
16+
public GetEnterpriseConfigurationByIdV2025R0QueryParams(string categories) {
17+
Categories = categories;
18+
}
19+
}
20+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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 IEnterpriseConfigurationsManager {
10+
/// <summary>
11+
/// Retrieves the configuration for an enterprise.
12+
/// </summary>
13+
/// <param name="enterpriseId">
14+
/// The ID of the enterprise.
15+
/// Example: "3442311"
16+
/// </param>
17+
/// <param name="queryParams">
18+
/// Query parameters of getEnterpriseConfigurationByIdV2025R0 method
19+
/// </param>
20+
/// <param name="headers">
21+
/// Headers of getEnterpriseConfigurationByIdV2025R0 method
22+
/// </param>
23+
/// <param name="cancellationToken">
24+
/// Token used for request cancellation.
25+
/// </param>
26+
public System.Threading.Tasks.Task<EnterpriseConfigurationV2025R0> GetEnterpriseConfigurationByIdV2025R0Async(string enterpriseId, GetEnterpriseConfigurationByIdV2025R0QueryParams queryParams, GetEnterpriseConfigurationByIdV2025R0Headers? headers = default, System.Threading.CancellationToken? cancellationToken = null) => throw new System.NotImplementedException("This method needs to be implemented by the derived class before calling it.");
27+
28+
}
29+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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 CollaborationPermissionsV2025R0 : ISerializable {
8+
/// <summary>
9+
/// The co-owner role is enabled for collaboration.
10+
/// </summary>
11+
[JsonPropertyName("is_co_owner_role_enabled")]
12+
public bool? IsCoOwnerRoleEnabled { get; init; }
13+
14+
/// <summary>
15+
/// The editor role is enabled for collaboration.
16+
/// </summary>
17+
[JsonPropertyName("is_editor_role_enabled")]
18+
public bool? IsEditorRoleEnabled { get; init; }
19+
20+
/// <summary>
21+
/// The previewer role is enabled for collaboration.
22+
/// </summary>
23+
[JsonPropertyName("is_previewer_role_enabled")]
24+
public bool? IsPreviewerRoleEnabled { get; init; }
25+
26+
/// <summary>
27+
/// The previewer uploader role is enabled for collaboration.
28+
/// </summary>
29+
[JsonPropertyName("is_previewer_uploader_role_enabled")]
30+
public bool? IsPreviewerUploaderRoleEnabled { get; init; }
31+
32+
/// <summary>
33+
/// The uploader role is enabled for collaboration.
34+
/// </summary>
35+
[JsonPropertyName("is_uploader_role_enabled")]
36+
public bool? IsUploaderRoleEnabled { get; init; }
37+
38+
/// <summary>
39+
/// The viewer role is enabled for collaboration.
40+
/// </summary>
41+
[JsonPropertyName("is_viewer_role_enabled")]
42+
public bool? IsViewerRoleEnabled { get; init; }
43+
44+
/// <summary>
45+
/// The viewer uploader role is enabled for collaboration.
46+
/// </summary>
47+
[JsonPropertyName("is_viewer_uploader_role_enabled")]
48+
public bool? IsViewerUploaderRoleEnabled { get; init; }
49+
50+
public CollaborationPermissionsV2025R0() {
51+
52+
}
53+
internal string? RawJson { get; set; } = default;
54+
55+
void ISerializable.SetJson(string json) {
56+
RawJson = json;
57+
}
58+
59+
string? ISerializable.GetJson() {
60+
return RawJson;
61+
}
62+
63+
/// <summary>
64+
/// Returns raw json response returned from the API.
65+
/// </summary>
66+
public Dictionary<string, object?>? GetRawData() {
67+
return SimpleJsonSerializer.GetAllFields(this);
68+
}
69+
70+
}
71+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System.ComponentModel;
2+
using Box.Sdk.Gen.Internal;
3+
4+
namespace Box.Sdk.Gen.Schemas {
5+
public enum CollaborationRestrictionV2025R0 {
6+
[Description("internal")]
7+
Internal,
8+
[Description("external")]
9+
External
10+
}
11+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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 CustomSessionDurationGroupItemV2025R0 : ISerializable {
8+
/// <summary>
9+
/// Group ID (numerical).
10+
/// </summary>
11+
[JsonPropertyName("id")]
12+
public string? Id { get; init; }
13+
14+
/// <summary>
15+
/// Group Name.
16+
/// </summary>
17+
[JsonPropertyName("name")]
18+
public string? Name { get; init; }
19+
20+
public CustomSessionDurationGroupItemV2025R0() {
21+
22+
}
23+
internal string? RawJson { get; set; } = default;
24+
25+
void ISerializable.SetJson(string json) {
26+
RawJson = json;
27+
}
28+
29+
string? ISerializable.GetJson() {
30+
return RawJson;
31+
}
32+
33+
/// <summary>
34+
/// Returns raw json response returned from the API.
35+
/// </summary>
36+
public Dictionary<string, object?>? GetRawData() {
37+
return SimpleJsonSerializer.GetAllFields(this);
38+
}
39+
40+
}
41+
}

0 commit comments

Comments
 (0)