/// <summary> /// See <see cref="ToApi(bool)"/> /// </summary> /// <param name="recursive">If we should recurse on <see cref="CreatedBy"/></param> /// <param name="showDetails">If rights and system identifier should be shown</param> /// <returns>A new <see cref="Api.Models.User"/></returns> Api.Models.User ToApi(bool recursive, bool showDetails) => new Api.Models.User { AdministrationRights = showDetails ? AdministrationRights : null, CreatedAt = CreatedAt, CreatedBy = recursive ? CreatedBy?.ToApi(false, false) : null, Enabled = Enabled, Id = Id, InstanceManagerRights = showDetails ? InstanceManagerRights : null, Name = Name, SystemIdentifier = showDetails ? SystemIdentifier : null };
/// <summary> /// See <see cref="ToApi(bool)"/> /// </summary> /// <param name="recursive">If we should recurse on <see cref="CreatedBy"/></param> /// <param name="showDetails">If rights and system identifier should be shown</param> /// <returns>A new <see cref="Api.Models.User"/></returns> Api.Models.User ToApi(bool recursive, bool showDetails) => new Api.Models.User { CreatedAt = showDetails ? CreatedAt : null, CreatedBy = showDetails && recursive?CreatedBy?.ToApi(false, false) : null, Enabled = showDetails ? Enabled : null, Id = Id, Name = Name, SystemIdentifier = showDetails ? SystemIdentifier : null, OAuthConnections = showDetails ? OAuthConnections ?.Select(x => x.ToApi()) .ToList() : null, Group = showDetails ? Group?.ToApi(false) : null, PermissionSet = showDetails ? PermissionSet?.ToApi() : null, };