@@ -51,14 +51,14 @@ public static CustomDriveItemItemRequestBuilder ItemWithPath(this Microsoft.Grap
5151 path = string . Format ( "/{0}" , path ) ;
5252 }
5353 }
54-
54+
5555 var requestInformation = rootRequestBuilder . ToGetRequestInformation ( ) ;
5656 // Encode the path in accordance with the one drive spec
5757 // https://docs.microsoft.com/en-us/onedrive/developer/rest-api/concepts/addressing-driveitems
5858 UriBuilder builder = new UriBuilder ( requestInformation . URI . OriginalString ) ;
5959 builder . Path += $ ":{ path } :";
60- var parameter = builder . Uri . OriginalString . Split ( new [ ] { ':' } , StringSplitOptions . RemoveEmptyEntries ) . Last ( ) ;
61- return new CustomDriveItemItemRequestBuilder ( rootRequestBuilder . GetPathParameters ( ) , rootRequestBuilder . GetRequestAdapter ( ) , rootRequestBuilder . GetUrlTemplate ( ) . Replace ( "root" , $ "root:{ parameter } :") ) ;
60+ var parameter = builder . Uri . OriginalString . Split ( new [ ] { ':' } , StringSplitOptions . RemoveEmptyEntries ) . Last ( ) ;
61+ return new CustomDriveItemItemRequestBuilder ( rootRequestBuilder . GetPathParameters ( ) , rootRequestBuilder . GetRequestAdapter ( ) , rootRequestBuilder . GetUrlTemplate ( ) . Replace ( "root" , $ "root:{ parameter } :") ) ;
6262 }
6363
6464 /// <summary>
@@ -74,47 +74,51 @@ public static CustomDriveItemItemRequestBuilder ItemWithPath(this Microsoft.Grap
7474 path = string . Format ( "/{0}" , path ) ;
7575 }
7676 }
77-
77+
7878 var requestInformation = rootRequestBuilder . ToGetRequestInformation ( ) ;
7979 // Encode the path in accordance with the one drive spec
8080 // https://docs.microsoft.com/en-us/onedrive/developer/rest-api/concepts/addressing-driveitems
8181 UriBuilder builder = new UriBuilder ( requestInformation . URI . OriginalString ) ;
8282 builder . Path += $ ":{ path } :";
83- var parameter = builder . Uri . OriginalString . Split ( new [ ] { ':' } , StringSplitOptions . RemoveEmptyEntries ) . Last ( ) ;
84- return new CustomDriveItemItemRequestBuilder ( rootRequestBuilder . GetPathParameters ( ) , rootRequestBuilder . GetRequestAdapter ( ) , rootRequestBuilder . GetUrlTemplate ( ) . Replace ( "{driveItem%2Did}" , $ "{{driveItem%2Did}}:{ parameter } :") ) ;
83+ var parameter = builder . Uri . OriginalString . Split ( new [ ] { ':' } , StringSplitOptions . RemoveEmptyEntries ) . Last ( ) ;
84+ return new CustomDriveItemItemRequestBuilder ( rootRequestBuilder . GetPathParameters ( ) , rootRequestBuilder . GetRequestAdapter ( ) , rootRequestBuilder . GetUrlTemplate ( ) . Replace ( "{driveItem%2Did}" , $ "{{driveItem%2Did}}:{ parameter } :") ) ;
8585 }
8686
87- private static IRequestAdapter GetRequestAdapter ( this object obj ) {
87+ private static IRequestAdapter GetRequestAdapter ( this object obj )
88+ {
8889 var field = obj . GetType ( )
8990 . BaseType !
9091 . GetFields ( BindingFlags . NonPublic | BindingFlags . Instance )
91- . FirstOrDefault ( field => field . FieldType == typeof ( IRequestAdapter ) ) ;
92+ . FirstOrDefault ( field => field . FieldType == typeof ( IRequestAdapter ) ) ;
9293 return ( IRequestAdapter ) field ? . GetValue ( obj ) ;
9394 }
94- private static Dictionary < string , object > GetPathParameters ( this object obj ) {
95+ private static Dictionary < string , object > GetPathParameters ( this object obj )
96+ {
9597 var field = obj . GetType ( )
9698 . BaseType !
9799 . GetFields ( BindingFlags . NonPublic | BindingFlags . Instance )
98- . FirstOrDefault ( field => field . FieldType == typeof ( Dictionary < string , object > ) ) ;
100+ . FirstOrDefault ( field => field . FieldType == typeof ( Dictionary < string , object > ) ) ;
99101 return ( Dictionary < string , object > ) field ? . GetValue ( obj ) ;
100102 }
101- private static string GetUrlTemplate ( this object obj ) {
103+ private static string GetUrlTemplate ( this object obj )
104+ {
102105 var field = obj . GetType ( )
103106 . BaseType !
104107 . GetFields ( BindingFlags . NonPublic | BindingFlags . Instance )
105- . FirstOrDefault ( field => field . FieldType == typeof ( string ) ) ;
108+ . FirstOrDefault ( field => field . FieldType == typeof ( string ) ) ;
106109 return ( string ) field ? . GetValue ( obj ) ;
107110 }
108- internal static T UpdateUrlTemplate < T > ( this T obj , string baseTemplate ) where T : BaseRequestBuilder {
111+ internal static T UpdateUrlTemplate < T > ( this T obj , string baseTemplate ) where T : BaseRequestBuilder
112+ {
109113 var field = obj . GetType ( )
110114 . BaseType !
111115 . GetFields ( BindingFlags . NonPublic | BindingFlags . Instance )
112- . FirstOrDefault ( field => field . FieldType == typeof ( string ) ) ;
116+ . FirstOrDefault ( field => field . FieldType == typeof ( string ) ) ;
113117 var currentTemplate = ( string ) field ? . GetValue ( obj ) ;
114118 var templateSuffix = currentTemplate . Substring ( currentTemplate . LastIndexOf ( '/' ) ) ;
115- var originalPrefix = baseTemplate . Substring ( 0 , baseTemplate . LastIndexOf ( ':' ) + 1 ) ;
116- var updatedTemplate = originalPrefix + templateSuffix ;
117- field ? . SetValue ( obj , updatedTemplate ) ;
119+ var originalPrefix = baseTemplate . Substring ( 0 , baseTemplate . LastIndexOf ( ':' ) + 1 ) ;
120+ var updatedTemplate = originalPrefix + templateSuffix ;
121+ field ? . SetValue ( obj , updatedTemplate ) ;
118122 return obj ;
119123 }
120124}
@@ -127,7 +131,7 @@ public class CustomDriveItemItemRequestBuilder : Microsoft.Graph.Drives.Item.Ite
127131 /// <param name="pathParameters">The path parameters to use for the request builder.</param>
128132 /// <param name="requestAdapter">The request adapter to use to execute the requests.</param>
129133 /// <param name="urlTemplate">The UrlTemplate to use to execute the requests.</param>
130- public CustomDriveItemItemRequestBuilder ( Dictionary < string , object > pathParameters , IRequestAdapter requestAdapter , string urlTemplate ) : base ( pathParameters , requestAdapter )
134+ public CustomDriveItemItemRequestBuilder ( Dictionary < string , object > pathParameters , IRequestAdapter requestAdapter , string urlTemplate ) : base ( pathParameters , requestAdapter )
131135 {
132136 _ = pathParameters ?? throw new ArgumentNullException ( nameof ( pathParameters ) ) ;
133137 _ = requestAdapter ?? throw new ArgumentNullException ( nameof ( requestAdapter ) ) ;
@@ -148,29 +152,29 @@ public CustomDriveItemItemRequestBuilder(Dictionary<string, object> pathParamete
148152 }
149153 /// <summary>Provides operations to call the checkin method.</summary>
150154 public new CheckinRequestBuilder Checkin
151- {
155+ {
152156 get => new CheckinRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
153157 }
154158 /// <summary>Provides operations to call the checkout method.</summary>
155159 public new CheckoutRequestBuilder Checkout
156- {
160+ {
157161 get => new CheckoutRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
158162 }
159163
160164 /// <summary>Provides operations to manage the children property of the microsoft.graph.driveItem entity.</summary>
161- public new ChildrenRequestBuilder Children
165+ public new ChildrenRequestBuilder Children
162166 {
163167 get => new ChildrenRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
164168 }
165169
166170 /// <summary>Provides operations to manage the media for the drive entity.</summary>
167- public new ContentRequestBuilder Content
168- {
171+ public new ContentRequestBuilder Content
172+ {
169173 get => new ContentRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
170174 }
171175 /// <summary>Provides operations to call the copy method.</summary>
172176 public new CopyRequestBuilder Copy
173- {
177+ {
174178 get => new CopyRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
175179 }
176180 /// <summary>Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity.</summary>
@@ -180,22 +184,22 @@ public CustomDriveItemItemRequestBuilder(Dictionary<string, object> pathParamete
180184 }
181185 /// <summary>Provides operations to call the createLink method.</summary>
182186 public new CreateLinkRequestBuilder CreateLink
183- {
187+ {
184188 get => new CreateLinkRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
185189 }
186190 /// <summary>Provides operations to call the createUploadSession method.</summary>
187191 public new CreateUploadSessionRequestBuilder CreateUploadSession
188192 {
189- get => new CreateUploadSessionRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
193+ get => new CreateUploadSessionRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
190194 }
191195 /// <summary>Provides operations to call the delta method.</summary>
192196 public new DeltaRequestBuilder Delta
193197 {
194- get => new DeltaRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
198+ get => new DeltaRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
195199 }
196200 /// <summary>Provides operations to call the follow method.</summary>
197201 public new FollowRequestBuilder Follow
198- {
202+ {
199203 get => new FollowRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
200204 }
201205 /// <summary>Provides operations to call the getActivitiesByInterval method.</summary>
@@ -206,7 +210,7 @@ public CustomDriveItemItemRequestBuilder(Dictionary<string, object> pathParamete
206210 }
207211 /// <summary>Provides operations to call the invite method.</summary>
208212 public new InviteRequestBuilder Invite
209- {
213+ {
210214 get => new InviteRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
211215 }
212216 /// <summary>Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity.</summary>
@@ -215,7 +219,8 @@ public CustomDriveItemItemRequestBuilder(Dictionary<string, object> pathParamete
215219 get => new LastModifiedByUserRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
216220 }
217221 /// <summary>Provides operations to manage the listItem property of the microsoft.graph.driveItem entity.</summary>
218- public new ListItemRequestBuilder ListItem {
222+ public new ListItemRequestBuilder ListItem
223+ {
219224 get => new ListItemRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
220225 }
221226 /// <summary>Provides operations to call the permanentDelete method.</summary>
@@ -224,17 +229,18 @@ public CustomDriveItemItemRequestBuilder(Dictionary<string, object> pathParamete
224229 get => new PermanentDeleteRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
225230 }
226231 /// <summary>Provides operations to manage the permissions property of the microsoft.graph.driveItem entity.</summary>
227- public new PermissionsRequestBuilder Permissions {
232+ public new PermissionsRequestBuilder Permissions
233+ {
228234 get => new PermissionsRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
229235 }
230236 /// <summary>Provides operations to call the preview method.</summary>
231237 public new PreviewRequestBuilder Preview
232- {
238+ {
233239 get => new PreviewRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
234240 }
235241 /// <summary>Provides operations to call the restore method.</summary>
236242 public new RestoreRequestBuilder Restore
237- {
243+ {
238244 get => new RestoreRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
239245 }
240246 /// <summary>Provides operations to manage the retentionLabel property of the microsoft.graph.driveItem entity.</summary>
@@ -243,33 +249,33 @@ public CustomDriveItemItemRequestBuilder(Dictionary<string, object> pathParamete
243249 get => new RetentionLabelRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
244250 }
245251 /// <summary>Provides operations to manage the subscriptions property of the microsoft.graph.driveItem entity.</summary>
246- public new SubscriptionsRequestBuilder Subscriptions
247- {
252+ public new SubscriptionsRequestBuilder Subscriptions
253+ {
248254 get => new SubscriptionsRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
249255 }
250256 /// <summary>Provides operations to manage the thumbnails property of the microsoft.graph.driveItem entity.</summary>
251- public new ThumbnailsRequestBuilder Thumbnails
252- {
257+ public new ThumbnailsRequestBuilder Thumbnails
258+ {
253259 get => new ThumbnailsRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
254260 }
255261 /// <summary>Provides operations to call the unfollow method.</summary>
256262 public new UnfollowRequestBuilder Unfollow
257- {
263+ {
258264 get => new UnfollowRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
259265 }
260266 /// <summary>Provides operations to call the validatePermission method.</summary>
261267 public new ValidatePermissionRequestBuilder ValidatePermission
262- {
268+ {
263269 get => new ValidatePermissionRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
264270 }
265271 /// <summary>Provides operations to manage the versions property of the microsoft.graph.driveItem entity.</summary>
266- public new VersionsRequestBuilder Versions
272+ public new VersionsRequestBuilder Versions
267273 {
268274 get => new VersionsRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
269275 }
270276 /// <summary>Provides operations to manage the workbook property of the microsoft.graph.driveItem entity.</summary>
271- public new WorkbookRequestBuilder Workbook
272- {
277+ public new WorkbookRequestBuilder Workbook
278+ {
273279 get => new WorkbookRequestBuilder ( PathParameters , RequestAdapter ) . UpdateUrlTemplate ( this . UrlTemplate ) ;
274280 }
275281 /// <summary>
0 commit comments