@@ -32,6 +32,7 @@ private constructor(
3232 private val pageIds: JsonField <String >,
3333 private val spaceKey: JsonField <String >,
3434 private val supportsAccessControl: JsonField <Boolean >,
35+ private val syncPermissions: JsonField <Boolean >,
3536 private val userName: JsonField <String >,
3637 private val additionalProperties: MutableMap <String , JsonValue >,
3738) {
@@ -60,6 +61,9 @@ private constructor(
6061 @JsonProperty(" supports_access_control" )
6162 @ExcludeMissing
6263 supportsAccessControl: JsonField <Boolean > = JsonMissing .of(),
64+ @JsonProperty(" sync_permissions" )
65+ @ExcludeMissing
66+ syncPermissions: JsonField <Boolean > = JsonMissing .of(),
6367 @JsonProperty(" user_name" ) @ExcludeMissing userName: JsonField <String > = JsonMissing .of(),
6468 ) : this (
6569 authenticationMechanism,
@@ -74,6 +78,7 @@ private constructor(
7478 pageIds,
7579 spaceKey,
7680 supportsAccessControl,
81+ syncPermissions,
7782 userName,
7883 mutableMapOf (),
7984 )
@@ -181,6 +186,17 @@ private constructor(
181186 fun supportsAccessControl (): Optional <Boolean > =
182187 supportsAccessControl.getOptional(" supports_access_control" )
183188
189+ /* *
190+ * Whether to fetch space-level permissions (allowed users/groups) and attach them to document
191+ * metadata for access control. Disable for Confluence Server/Data Center versions whose
192+ * permission APIs are unavailable (e.g. the JSON-RPC API removed in Data Center 9.2.6+), which
193+ * otherwise surface as 401 errors during sync.
194+ *
195+ * @throws LlamaCloudInvalidDataException if the JSON field has an unexpected type (e.g. if the
196+ * server responded with an unexpected value).
197+ */
198+ fun syncPermissions (): Optional <Boolean > = syncPermissions.getOptional(" sync_permissions" )
199+
184200 /* *
185201 * The username to use for authentication.
186202 *
@@ -287,6 +303,15 @@ private constructor(
287303 @ExcludeMissing
288304 fun _supportsAccessControl (): JsonField <Boolean > = supportsAccessControl
289305
306+ /* *
307+ * Returns the raw JSON value of [syncPermissions].
308+ *
309+ * Unlike [syncPermissions], this method doesn't throw if the JSON field has an unexpected type.
310+ */
311+ @JsonProperty(" sync_permissions" )
312+ @ExcludeMissing
313+ fun _syncPermissions (): JsonField <Boolean > = syncPermissions
314+
290315 /* *
291316 * Returns the raw JSON value of [userName].
292317 *
@@ -335,6 +360,7 @@ private constructor(
335360 private var pageIds: JsonField <String > = JsonMissing .of()
336361 private var spaceKey: JsonField <String > = JsonMissing .of()
337362 private var supportsAccessControl: JsonField <Boolean > = JsonMissing .of()
363+ private var syncPermissions: JsonField <Boolean > = JsonMissing .of()
338364 private var userName: JsonField <String > = JsonMissing .of()
339365 private var additionalProperties: MutableMap <String , JsonValue > = mutableMapOf ()
340366
@@ -352,6 +378,7 @@ private constructor(
352378 pageIds = cloudConfluenceDataSource.pageIds
353379 spaceKey = cloudConfluenceDataSource.spaceKey
354380 supportsAccessControl = cloudConfluenceDataSource.supportsAccessControl
381+ syncPermissions = cloudConfluenceDataSource.syncPermissions
355382 userName = cloudConfluenceDataSource.userName
356383 additionalProperties = cloudConfluenceDataSource.additionalProperties.toMutableMap()
357384 }
@@ -531,6 +558,26 @@ private constructor(
531558 this .supportsAccessControl = supportsAccessControl
532559 }
533560
561+ /* *
562+ * Whether to fetch space-level permissions (allowed users/groups) and attach them to
563+ * document metadata for access control. Disable for Confluence Server/Data Center versions
564+ * whose permission APIs are unavailable (e.g. the JSON-RPC API removed in Data Center
565+ * 9.2.6+), which otherwise surface as 401 errors during sync.
566+ */
567+ fun syncPermissions (syncPermissions : Boolean ) =
568+ syncPermissions(JsonField .of(syncPermissions))
569+
570+ /* *
571+ * Sets [Builder.syncPermissions] to an arbitrary JSON value.
572+ *
573+ * You should usually call [Builder.syncPermissions] with a well-typed [Boolean] value
574+ * instead. This method is primarily for setting the field to an undocumented or not yet
575+ * supported value.
576+ */
577+ fun syncPermissions (syncPermissions : JsonField <Boolean >) = apply {
578+ this .syncPermissions = syncPermissions
579+ }
580+
534581 /* * The username to use for authentication. */
535582 fun userName (userName : String? ) = userName(JsonField .ofNullable(userName))
536583
@@ -591,6 +638,7 @@ private constructor(
591638 pageIds,
592639 spaceKey,
593640 supportsAccessControl,
641+ syncPermissions,
594642 userName,
595643 additionalProperties.toMutableMap(),
596644 )
@@ -623,6 +671,7 @@ private constructor(
623671 pageIds()
624672 spaceKey()
625673 supportsAccessControl()
674+ syncPermissions()
626675 userName()
627676 validated = true
628677 }
@@ -654,6 +703,7 @@ private constructor(
654703 (if (pageIds.asKnown().isPresent) 1 else 0 ) +
655704 (if (spaceKey.asKnown().isPresent) 1 else 0 ) +
656705 (if (supportsAccessControl.asKnown().isPresent) 1 else 0 ) +
706+ (if (syncPermissions.asKnown().isPresent) 1 else 0 ) +
657707 (if (userName.asKnown().isPresent) 1 else 0 )
658708
659709 override fun equals (other : Any? ): Boolean {
@@ -674,6 +724,7 @@ private constructor(
674724 pageIds == other.pageIds &&
675725 spaceKey == other.spaceKey &&
676726 supportsAccessControl == other.supportsAccessControl &&
727+ syncPermissions == other.syncPermissions &&
677728 userName == other.userName &&
678729 additionalProperties == other.additionalProperties
679730 }
@@ -692,6 +743,7 @@ private constructor(
692743 pageIds,
693744 spaceKey,
694745 supportsAccessControl,
746+ syncPermissions,
695747 userName,
696748 additionalProperties,
697749 )
@@ -700,5 +752,5 @@ private constructor(
700752 override fun hashCode (): Int = hashCode
701753
702754 override fun toString () =
703- " CloudConfluenceDataSource{authenticationMechanism=$authenticationMechanism , serverUrl=$serverUrl , apiToken=$apiToken , className=$className , cql=$cql , failureHandling=$failureHandling , indexRestrictedPages=$indexRestrictedPages , keepMarkdownFormat=$keepMarkdownFormat , label=$label , pageIds=$pageIds , spaceKey=$spaceKey , supportsAccessControl=$supportsAccessControl , userName=$userName , additionalProperties=$additionalProperties }"
755+ " CloudConfluenceDataSource{authenticationMechanism=$authenticationMechanism , serverUrl=$serverUrl , apiToken=$apiToken , className=$className , cql=$cql , failureHandling=$failureHandling , indexRestrictedPages=$indexRestrictedPages , keepMarkdownFormat=$keepMarkdownFormat , label=$label , pageIds=$pageIds , spaceKey=$spaceKey , supportsAccessControl=$supportsAccessControl , syncPermissions= $syncPermissions , userName=$userName , additionalProperties=$additionalProperties }"
704756}
0 commit comments