@@ -18,7 +18,7 @@ public class UpdateCollaborationByIdRequestBody: Codable, RawJSONReadable {
1818
1919
2020 /// The level of access granted.
21- public let role : UpdateCollaborationByIdRequestBodyRoleField
21+ public let role : UpdateCollaborationByIdRequestBodyRoleField ?
2222
2323 /// Set the status of a `pending` collaboration invitation,
2424 /// effectively accepting, or rejecting the invite.
@@ -86,7 +86,7 @@ public class UpdateCollaborationByIdRequestBody: Codable, RawJSONReadable {
8686 /// `true`.
8787 ///
8888 /// `can_view_path` can only be used for folder collaborations.
89- public init ( role: UpdateCollaborationByIdRequestBodyRoleField , status: UpdateCollaborationByIdRequestBodyStatusField ? = nil , expiresAt: Date ? = nil , canViewPath: Bool ? = nil ) {
89+ public init ( role: UpdateCollaborationByIdRequestBodyRoleField ? = nil , status: UpdateCollaborationByIdRequestBodyStatusField ? = nil , expiresAt: Date ? = nil , canViewPath: Bool ? = nil ) {
9090 self . role = role
9191 self . status = status
9292 self . expiresAt = expiresAt
@@ -95,15 +95,15 @@ public class UpdateCollaborationByIdRequestBody: Codable, RawJSONReadable {
9595
9696 required public init ( from decoder: Decoder ) throws {
9797 let container = try decoder. container ( keyedBy: CodingKeys . self)
98- role = try container. decode ( UpdateCollaborationByIdRequestBodyRoleField . self, forKey: . role)
98+ role = try container. decodeIfPresent ( UpdateCollaborationByIdRequestBodyRoleField . self, forKey: . role)
9999 status = try container. decodeIfPresent ( UpdateCollaborationByIdRequestBodyStatusField . self, forKey: . status)
100100 expiresAt = try container. decodeDateTimeIfPresent ( forKey: . expiresAt)
101101 canViewPath = try container. decodeIfPresent ( Bool . self, forKey: . canViewPath)
102102 }
103103
104104 public func encode( to encoder: Encoder ) throws {
105105 var container = encoder. container ( keyedBy: CodingKeys . self)
106- try container. encode ( role, forKey: . role)
106+ try container. encodeIfPresent ( role, forKey: . role)
107107 try container. encodeIfPresent ( status, forKey: . status)
108108 try container. encodeDateTimeIfPresent ( field: expiresAt, forKey: . expiresAt)
109109 try container. encodeIfPresent ( canViewPath, forKey: . canViewPath)
0 commit comments