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 HubCollaborationsManager : IHubCollaborationsManager {
10+ public IAuthentication ? Auth { get ; init ; }
11+
12+ public NetworkSession NetworkSession { get ; }
13+
14+ public HubCollaborationsManager ( NetworkSession ? networkSession = default ) {
15+ NetworkSession = networkSession ?? new NetworkSession ( ) ;
16+ }
17+ /// <summary>
18+ /// Retrieves all collaborations for a hub.
19+ /// </summary>
20+ /// <param name="queryParams">
21+ /// Query parameters of getHubCollaborationsV2025R0 method
22+ /// </param>
23+ /// <param name="headers">
24+ /// Headers of getHubCollaborationsV2025R0 method
25+ /// </param>
26+ /// <param name="cancellationToken">
27+ /// Token used for request cancellation.
28+ /// </param>
29+ public async System . Threading . Tasks . Task < HubCollaborationsV2025R0 > GetHubCollaborationsV2025R0Async ( GetHubCollaborationsV2025R0QueryParams queryParams , GetHubCollaborationsV2025R0Headers ? headers = default , System . Threading . CancellationToken ? cancellationToken = null ) {
30+ headers = headers ?? new GetHubCollaborationsV2025R0Headers ( ) ;
31+ Dictionary < string , string > queryParamsMap = Utils . PrepareParams ( map : new Dictionary < string , string ? > ( ) { { "hub_id" , StringUtils . ToStringRepresentation ( queryParams . HubId ) } , { "marker" , StringUtils . ToStringRepresentation ( queryParams . Marker ) } , { "limit" , StringUtils . ToStringRepresentation ( queryParams . Limit ) } } ) ;
32+ Dictionary < string , string > headersMap = Utils . PrepareParams ( map : DictionaryUtils . MergeDictionaries ( new Dictionary < string , string ? > ( ) { { "box-version" , StringUtils . ToStringRepresentation ( headers . BoxVersion ) } } , headers . ExtraHeaders ) ) ;
33+ FetchResponse response = await this . NetworkSession . NetworkClient . FetchAsync ( options : new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/hub_collaborations" ) , method : "GET" , responseFormat : Box . Sdk . Gen . ResponseFormat . Json ) { Parameters = queryParamsMap , Headers = headersMap , Auth = this . Auth , NetworkSession = this . NetworkSession , CancellationToken = cancellationToken } ) . ConfigureAwait ( false ) ;
34+ return SimpleJsonSerializer . Deserialize < HubCollaborationsV2025R0 > ( NullableUtils . Unwrap ( response . Data ) ) ;
35+ }
36+
37+ /// <summary>
38+ /// Adds a collaboration for a single user or a single group to a hub.
39+ ///
40+ /// Collaborations can be created using email address, user IDs, or group IDs.
41+ /// </summary>
42+ /// <param name="requestBody">
43+ /// Request body of createHubCollaborationV2025R0 method
44+ /// </param>
45+ /// <param name="headers">
46+ /// Headers of createHubCollaborationV2025R0 method
47+ /// </param>
48+ /// <param name="cancellationToken">
49+ /// Token used for request cancellation.
50+ /// </param>
51+ public async System . Threading . Tasks . Task < HubCollaborationV2025R0 > CreateHubCollaborationV2025R0Async ( HubCollaborationCreateRequestV2025R0 requestBody , CreateHubCollaborationV2025R0Headers ? headers = default , System . Threading . CancellationToken ? cancellationToken = null ) {
52+ headers = headers ?? new CreateHubCollaborationV2025R0Headers ( ) ;
53+ Dictionary < string , string > headersMap = Utils . PrepareParams ( map : DictionaryUtils . MergeDictionaries ( new Dictionary < string , string ? > ( ) { { "box-version" , StringUtils . ToStringRepresentation ( headers . BoxVersion ) } } , headers . ExtraHeaders ) ) ;
54+ FetchResponse response = await this . NetworkSession . NetworkClient . FetchAsync ( options : new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/hub_collaborations" ) , 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 ) ;
55+ return SimpleJsonSerializer . Deserialize < HubCollaborationV2025R0 > ( NullableUtils . Unwrap ( response . Data ) ) ;
56+ }
57+
58+ /// <summary>
59+ /// Retrieves details for a hub collaboration by collaboration ID.
60+ /// </summary>
61+ /// <param name="hubCollaborationId">
62+ /// The ID of the hub collaboration.
63+ /// Example: "1234"
64+ /// </param>
65+ /// <param name="headers">
66+ /// Headers of getHubCollaborationByIdV2025R0 method
67+ /// </param>
68+ /// <param name="cancellationToken">
69+ /// Token used for request cancellation.
70+ /// </param>
71+ public async System . Threading . Tasks . Task < HubCollaborationV2025R0 > GetHubCollaborationByIdV2025R0Async ( string hubCollaborationId , GetHubCollaborationByIdV2025R0Headers ? headers = default , System . Threading . CancellationToken ? cancellationToken = null ) {
72+ headers = headers ?? new GetHubCollaborationByIdV2025R0Headers ( ) ;
73+ Dictionary < string , string > headersMap = Utils . PrepareParams ( map : DictionaryUtils . MergeDictionaries ( new Dictionary < string , string ? > ( ) { { "box-version" , StringUtils . ToStringRepresentation ( headers . BoxVersion ) } } , headers . ExtraHeaders ) ) ;
74+ FetchResponse response = await this . NetworkSession . NetworkClient . FetchAsync ( options : new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/hub_collaborations/" , StringUtils . ToStringRepresentation ( hubCollaborationId ) ) , method : "GET" , responseFormat : Box . Sdk . Gen . ResponseFormat . Json ) { Headers = headersMap , Auth = this . Auth , NetworkSession = this . NetworkSession , CancellationToken = cancellationToken } ) . ConfigureAwait ( false ) ;
75+ return SimpleJsonSerializer . Deserialize < HubCollaborationV2025R0 > ( NullableUtils . Unwrap ( response . Data ) ) ;
76+ }
77+
78+ /// <summary>
79+ /// Updates a hub collaboration.
80+ /// Can be used to change the hub role.
81+ /// </summary>
82+ /// <param name="hubCollaborationId">
83+ /// The ID of the hub collaboration.
84+ /// Example: "1234"
85+ /// </param>
86+ /// <param name="requestBody">
87+ /// Request body of updateHubCollaborationByIdV2025R0 method
88+ /// </param>
89+ /// <param name="headers">
90+ /// Headers of updateHubCollaborationByIdV2025R0 method
91+ /// </param>
92+ /// <param name="cancellationToken">
93+ /// Token used for request cancellation.
94+ /// </param>
95+ public async System . Threading . Tasks . Task < HubCollaborationV2025R0 > UpdateHubCollaborationByIdV2025R0Async ( string hubCollaborationId , HubCollaborationUpdateRequestV2025R0 requestBody , UpdateHubCollaborationByIdV2025R0Headers ? headers = default , System . Threading . CancellationToken ? cancellationToken = null ) {
96+ headers = headers ?? new UpdateHubCollaborationByIdV2025R0Headers ( ) ;
97+ Dictionary < string , string > headersMap = Utils . PrepareParams ( map : DictionaryUtils . MergeDictionaries ( new Dictionary < string , string ? > ( ) { { "box-version" , StringUtils . ToStringRepresentation ( headers . BoxVersion ) } } , headers . ExtraHeaders ) ) ;
98+ FetchResponse response = await this . NetworkSession . NetworkClient . FetchAsync ( options : new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/hub_collaborations/" , StringUtils . ToStringRepresentation ( hubCollaborationId ) ) , 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 ) ;
99+ return SimpleJsonSerializer . Deserialize < HubCollaborationV2025R0 > ( NullableUtils . Unwrap ( response . Data ) ) ;
100+ }
101+
102+ /// <summary>
103+ /// Deletes a single hub collaboration.
104+ /// </summary>
105+ /// <param name="hubCollaborationId">
106+ /// The ID of the hub collaboration.
107+ /// Example: "1234"
108+ /// </param>
109+ /// <param name="headers">
110+ /// Headers of deleteHubCollaborationByIdV2025R0 method
111+ /// </param>
112+ /// <param name="cancellationToken">
113+ /// Token used for request cancellation.
114+ /// </param>
115+ public async System . Threading . Tasks . Task DeleteHubCollaborationByIdV2025R0Async ( string hubCollaborationId , DeleteHubCollaborationByIdV2025R0Headers ? headers = default , System . Threading . CancellationToken ? cancellationToken = null ) {
116+ headers = headers ?? new DeleteHubCollaborationByIdV2025R0Headers ( ) ;
117+ Dictionary < string , string > headersMap = Utils . PrepareParams ( map : DictionaryUtils . MergeDictionaries ( new Dictionary < string , string ? > ( ) { { "box-version" , StringUtils . ToStringRepresentation ( headers . BoxVersion ) } } , headers . ExtraHeaders ) ) ;
118+ FetchResponse response = await this . NetworkSession . NetworkClient . FetchAsync ( options : new FetchOptions ( url : string . Concat ( this . NetworkSession . BaseUrls . BaseUrl , "/2.0/hub_collaborations/" , StringUtils . ToStringRepresentation ( hubCollaborationId ) ) , method : "DELETE" , responseFormat : Box . Sdk . Gen . ResponseFormat . NoContent ) { Headers = headersMap , Auth = this . Auth , NetworkSession = this . NetworkSession , CancellationToken = cancellationToken } ) . ConfigureAwait ( false ) ;
119+ }
120+
121+ }
122+ }
0 commit comments