From 6f5f0440959fbd5a655e85ce084d62b6d39deb2f Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Thu, 8 Aug 2024 10:52:19 +0100 Subject: [PATCH] Adam/cxpla 6 kill remaining kit code in core (#59) * compiles with relevant deletions * Test fixes * fix type loading * type load for tests * speckle objects renamespace * rename Core to Sdk * Fix test references * tests renaming * rename logging * fmt * start of adding an attribute to all base types * convert all types and do basic test * Fix most tests * fix more tests * fmt * Build fix * add changes and more tests * Fix tests * Fix integration tests --- Speckle.Sdk.sln | 24 +- src/Speckle.Core/Api/Operations/Operations.cs | 60 -- .../Kits/ConverterInterfaces/IFinalizable.cs | 6 - src/Speckle.Core/Kits/HostApplications.cs | 2 +- src/Speckle.Core/Kits/ISpeckleConverter.cs | 151 ---- src/Speckle.Core/Kits/ISpeckleKit.cs | 45 -- src/Speckle.Core/Kits/KitDeclaration.cs | 27 - src/Speckle.Core/Kits/KitManager.cs | 336 -------- .../Models/GraphTraversal/DefaultTraversal.cs | 209 ----- .../Serialisation/BaseObjectSerializer.cs | 716 ------------------ .../BaseObjectSerializationUtilities.cs | 366 --------- .../BuiltElements/AdvanceSteel/AsteelBeam.cs | 11 +- .../BuiltElements/AdvanceSteel/AsteelBolt.cs | 9 +- .../AdvanceSteel/AsteelGrating.cs | 8 +- .../BuiltElements/AdvanceSteel/AsteelPlate.cs | 12 +- .../AdvanceSteel/AsteelPolyBeam.cs | 5 +- .../AdvanceSteel/AsteelSectionProfile.cs | 5 +- .../AdvanceSteel/AsteelSectionProfileDB.cs | 5 +- .../BuiltElements/AdvanceSteel/AsteelSlab.cs | 12 +- .../AdvanceSteel/AsteelSpecialPart.cs | 8 +- .../AdvanceSteel/AsteelStraightBeam.cs | 5 +- .../BuiltElements/AdvanceSteel/Enums.cs | 2 +- .../AdvanceSteel/IAsteelObject.cs | 4 +- .../BuiltElements/Alignment.cs | 9 +- .../BuiltElements/Archicad/ArchicadBeam.cs | 12 +- .../BuiltElements/Archicad/ArchicadColumn.cs | 12 +- .../BuiltElements/Archicad/ArchicadFloor.cs | 8 +- .../BuiltElements/Archicad/ArchicadLevel.cs | 5 +- .../BuiltElements/Archicad/ArchicadOpening.cs | 10 +- .../BuiltElements/Archicad/ArchicadRoof.cs | 28 +- .../BuiltElements/Archicad/ArchicadRoom.cs | 6 +- .../BuiltElements/Archicad/ArchicadWall.cs | 11 +- .../BuiltElements/Archicad/AssemblySegment.cs | 8 +- .../BuiltElements/Archicad/Classification.cs | 7 +- .../Archicad/ComponentProperties.cs | 8 +- .../BuiltElements/Archicad/DirectShape.cs | 8 +- .../BuiltElements/Archicad/ElementShape.cs | 16 +- .../BuiltElements/Archicad/Fenestration.cs | 8 +- .../BuiltElements/Archicad/Property.cs | 8 +- .../BuiltElements/Archicad/PropertyGroup.cs | 8 +- src/Speckle.Objects/BuiltElements/Area.cs | 10 +- src/Speckle.Objects/BuiltElements/Baseline.cs | 4 +- src/Speckle.Objects/BuiltElements/Beam.cs | 10 +- src/Speckle.Objects/BuiltElements/Brace.cs | 10 +- .../BuiltElements/CableTray.cs | 8 +- src/Speckle.Objects/BuiltElements/Ceiling.cs | 10 +- .../BuiltElements/Civil/CivilAlignment.cs | 5 +- .../Civil/CivilAppliedAssembly.cs | 6 +- .../Civil/CivilAppliedSubassembly.cs | 10 +- .../BuiltElements/Civil/CivilBaseline.cs | 5 +- .../Civil/CivilBaselineRegion.cs | 6 +- .../Civil/CivilCalculatedLink.cs | 6 +- .../Civil/CivilCalculatedPoint.cs | 8 +- .../Civil/CivilCalculatedShape.cs | 6 +- .../BuiltElements/Civil/CivilProfile.cs | 7 +- src/Speckle.Objects/BuiltElements/Column.cs | 11 +- src/Speckle.Objects/BuiltElements/Conduit.cs | 8 +- src/Speckle.Objects/BuiltElements/Duct.cs | 11 +- .../BuiltElements/Featureline.cs | 8 +- src/Speckle.Objects/BuiltElements/Floor.cs | 10 +- src/Speckle.Objects/BuiltElements/GridLine.cs | 8 +- src/Speckle.Objects/BuiltElements/Level.cs | 7 +- src/Speckle.Objects/BuiltElements/Network.cs | 10 +- src/Speckle.Objects/BuiltElements/Opening.cs | 7 +- src/Speckle.Objects/BuiltElements/Pipe.cs | 10 +- src/Speckle.Objects/BuiltElements/Profile.cs | 8 +- src/Speckle.Objects/BuiltElements/Rebar.cs | 13 +- .../BuiltElements/Revit/AdaptiveComponent.cs | 12 +- .../BuiltElements/Revit/BuildingPad.cs | 8 +- .../BuiltElements/Revit/Curve/ModelCurves.cs | 13 +- .../BuiltElements/Revit/DirectShape.cs | 12 +- .../BuiltElements/Revit/Enums.cs | 2 +- .../BuiltElements/Revit/FamilyInstance.cs | 12 +- .../BuiltElements/Revit/FreeformElement.cs | 14 +- .../Revit/Interfaces/IHasMEPConnectors.cs | 4 +- .../BuiltElements/Revit/MEPFamilyInstance.cs | 10 +- .../BuiltElements/Revit/Parameter.cs | 7 +- .../BuiltElements/Revit/ParameterUpdater.cs | 10 +- .../BuiltElements/Revit/ProjectInfo.cs | 6 +- .../BuiltElements/Revit/RevitBeam.cs | 12 +- .../BuiltElements/Revit/RevitBrace.cs | 12 +- .../BuiltElements/Revit/RevitCableTray.cs | 8 +- .../BuiltElements/Revit/RevitCeiling.cs | 11 +- .../BuiltElements/Revit/RevitColumn.cs | 13 +- .../BuiltElements/Revit/RevitConduit.cs | 8 +- .../Revit/RevitCurtainWallPanel.cs | 5 +- .../BuiltElements/Revit/RevitDuct.cs | 15 +- .../BuiltElements/Revit/RevitElement.cs | 8 +- .../BuiltElements/Revit/RevitElementType.cs | 10 +- .../BuiltElements/Revit/RevitFloor.cs | 12 +- .../BuiltElements/Revit/RevitLevel.cs | 10 +- .../BuiltElements/Revit/RevitMEPConnector.cs | 8 +- .../BuiltElements/Revit/RevitNetwork.cs | 8 +- .../BuiltElements/Revit/RevitOpening.cs | 19 +- .../BuiltElements/Revit/RevitPipe.cs | 15 +- .../BuiltElements/Revit/RevitRailing.cs | 11 +- .../BuiltElements/Revit/RevitRebar.cs | 12 +- .../Revit/RevitRoof/RevitRoof.cs | 14 +- .../BuiltElements/Revit/RevitStair.cs | 11 +- .../BuiltElements/Revit/RevitTopography.cs | 12 +- .../BuiltElements/Revit/RevitToposolid.cs | 12 +- .../BuiltElements/Revit/RevitWall.cs | 15 +- .../BuiltElements/Revit/RevitWire.cs | 12 +- .../BuiltElements/Revit/RevitZone.cs | 5 +- .../Revit/StructuralConnectionHandler.cs | 8 +- src/Speckle.Objects/BuiltElements/Roof.cs | 10 +- src/Speckle.Objects/BuiltElements/Room.cs | 14 +- src/Speckle.Objects/BuiltElements/Space.cs | 13 +- src/Speckle.Objects/BuiltElements/Station.cs | 7 +- .../BuiltElements/Structure.cs | 8 +- .../TeklaStructures/BeamPosition.cs | 5 +- .../BuiltElements/TeklaStructures/Bolts.cs | 11 +- .../BuiltElements/TeklaStructures/Enums.cs | 2 +- .../BuiltElements/TeklaStructures/Fitting.cs | 6 +- .../TeklaStructures/TeklaBeam.cs | 14 +- .../TeklaStructures/TeklaContourPlate.cs | 15 +- .../TeklaStructures/TeklaModel.cs | 6 +- .../TeklaStructures/TeklaOpening.cs | 7 +- .../TeklaStructures/TeklaRebar.cs | 9 +- .../BuiltElements/TeklaStructures/Welds.cs | 9 +- .../BuiltElements/Topography.cs | 10 +- src/Speckle.Objects/BuiltElements/View.cs | 9 +- src/Speckle.Objects/BuiltElements/Wall.cs | 10 +- src/Speckle.Objects/BuiltElements/Wire.cs | 8 +- src/Speckle.Objects/BuiltElements/Zone.cs | 6 +- src/Speckle.Objects/EncodingOptimisations.cs | 6 +- src/Speckle.Objects/GIS/CRS.cs | 5 +- src/Speckle.Objects/GIS/GisFeature.cs | 6 +- .../GIS/GisMultipatchGeometry.cs | 6 +- src/Speckle.Objects/GIS/GisPolygonGeometry.cs | 8 +- .../GIS/GisPolygonGeometry3d.cs | 5 +- src/Speckle.Objects/GIS/GisTopography.cs | 5 +- src/Speckle.Objects/GIS/NonGeometryElement.cs | 6 +- src/Speckle.Objects/GIS/PolygonElement.cs | 7 +- src/Speckle.Objects/GIS/RasterElement.cs | 8 +- src/Speckle.Objects/GIS/RasterLayer.cs | 7 +- src/Speckle.Objects/GIS/VectorLayer.cs | 8 +- src/Speckle.Objects/Geometry/Arc.cs | 16 +- .../Geometry/Autocad/AutocadPolycurve.cs | 5 +- src/Speckle.Objects/Geometry/Box.cs | 11 +- src/Speckle.Objects/Geometry/Brep.cs | 17 +- src/Speckle.Objects/Geometry/BrepEdge.cs | 9 +- src/Speckle.Objects/Geometry/BrepFace.cs | 7 +- src/Speckle.Objects/Geometry/BrepLoop.cs | 7 +- src/Speckle.Objects/Geometry/BrepTrim.cs | 7 +- src/Speckle.Objects/Geometry/Circle.cs | 10 +- src/Speckle.Objects/Geometry/ControlPoint.cs | 8 +- src/Speckle.Objects/Geometry/Curve.cs | 17 +- src/Speckle.Objects/Geometry/Ellipse.cs | 10 +- src/Speckle.Objects/Geometry/Extrusion.cs | 9 +- src/Speckle.Objects/Geometry/Line.cs | 17 +- src/Speckle.Objects/Geometry/Mesh.cs | 17 +- src/Speckle.Objects/Geometry/Plane.cs | 12 +- src/Speckle.Objects/Geometry/Point.cs | 14 +- src/Speckle.Objects/Geometry/Pointcloud.cs | 17 +- src/Speckle.Objects/Geometry/Polycurve.cs | 15 +- src/Speckle.Objects/Geometry/Polyline.cs | 19 +- .../Geometry/PolylineExtensions.cs | 4 +- src/Speckle.Objects/Geometry/Spiral.cs | 7 +- src/Speckle.Objects/Geometry/Surface.cs | 14 +- src/Speckle.Objects/Geometry/Vector.cs | 13 +- src/Speckle.Objects/Interfaces.cs | 15 +- src/Speckle.Objects/ObjectsKit.cs | 156 ---- src/Speckle.Objects/Organization/DataTable.cs | 8 +- .../Organization/Deprecated/Collection.cs | 11 - src/Speckle.Objects/Organization/Model.cs | 8 +- src/Speckle.Objects/Other/Block.cs | 11 +- .../Other/Civil/CivilDataField.cs | 5 +- src/Speckle.Objects/Other/DataField.cs | 5 +- src/Speckle.Objects/Other/Dimension.cs | 11 +- src/Speckle.Objects/Other/DisplayStyle.cs | 5 +- src/Speckle.Objects/Other/Hatch.cs | 8 +- src/Speckle.Objects/Other/Instance.cs | 14 +- .../Other/MappedBlockWrapper.cs | 7 +- src/Speckle.Objects/Other/Material.cs | 7 +- src/Speckle.Objects/Other/MaterialQuantity.cs | 7 +- src/Speckle.Objects/Other/RenderMaterial.cs | 10 +- .../Other/Revit/RevitInstance.cs | 15 +- .../Other/Revit/RevitMaterial.cs | 12 +- src/Speckle.Objects/Other/Text.cs | 8 +- src/Speckle.Objects/Other/Transform.cs | 16 +- src/Speckle.Objects/Primitive/Chunk.cs | 9 - src/Speckle.Objects/Primitive/Interval.cs | 6 +- src/Speckle.Objects/Primitive/Interval2d.cs | 5 +- src/Speckle.Objects/Speckle.Objects.csproj | 2 +- .../Structural/Analysis/Model.cs | 8 +- .../Structural/Analysis/ModelInfo.cs | 7 +- .../Structural/Analysis/ModelSettings.cs | 7 +- .../Structural/Analysis/ModelUnits.cs | 7 +- .../Structural/Analysis/UnitTypes.cs | 2 +- src/Speckle.Objects/Structural/Axis.cs | 2 +- .../Structural/CSI/Analysis/CSIStories.cs | 9 +- .../Structural/CSI/Analysis/ETABSAnalysis.cs | 10 +- .../Structural/CSI/Analysis/ETABSAreaType.cs | 2 +- .../CSI/Analysis/ETABSLoadingType.cs | 2 +- .../Structural/CSI/Geometry/CSIElement1D.cs | 17 +- .../Structural/CSI/Geometry/CSIElement2D.cs | 16 +- .../Structural/CSI/Geometry/CSIGridLines.cs | 8 +- .../Structural/CSI/Geometry/CSINode.cs | 17 +- .../Structural/CSI/Geometry/CSIPier.cs | 5 +- .../Structural/CSI/Geometry/CSISpandrel.cs | 5 +- .../Structural/CSI/Geometry/CSITendon.cs | 9 +- .../Structural/CSI/Loading/CSIWindLoading.cs | 8 +- .../Structural/CSI/Materials/CSIConcrete.cs | 6 +- .../Structural/CSI/Materials/CSIRebar.cs | 6 +- .../Structural/CSI/Materials/CSISteel.cs | 6 +- .../Structural/CSI/Properties/CSIDiaphragm.cs | 7 +- .../CSI/Properties/CSILinkProperty.cs | 8 +- .../CSI/Properties/CSIProperty2D.cs | 13 +- .../CSI/Properties/CSISpringProperty.cs | 10 +- .../CSI/Properties/CSITendonProperty.cs | 6 +- .../CSI/Properties/ETABSProperty.cs | 2 +- .../GSA/Analysis/GSAAnalysisCase.cs | 11 +- .../Structural/GSA/Analysis/GSAStage.cs | 8 +- .../Structural/GSA/Analysis/GSATask.cs | 7 +- .../Structural/GSA/Bridge/GSAAlignment.cs | 10 +- .../Structural/GSA/Bridge/GSAInfluence.cs | 7 +- .../Structural/GSA/Bridge/GSAInfluenceBeam.cs | 11 +- .../Structural/GSA/Bridge/GSAInfluenceNode.cs | 11 +- .../Structural/GSA/Bridge/GSAPath.cs | 7 +- .../Structural/GSA/Bridge/GSAUserVehicle.cs | 8 +- .../Structural/GSA/Geometry/GSAAssembly.cs | 8 +- .../Structural/GSA/Geometry/GSAElement1D.cs | 12 +- .../Structural/GSA/Geometry/GSAElement2D.cs | 11 +- .../Structural/GSA/Geometry/GSAElement3D.cs | 12 +- .../GSA/Geometry/GSAGeneralisedRestraint.cs | 12 +- .../Structural/GSA/Geometry/GSAGridLine.cs | 8 +- .../Structural/GSA/Geometry/GSAGridPlane.cs | 9 +- .../Structural/GSA/Geometry/GSAGridSurface.cs | 8 +- .../Structural/GSA/Geometry/GSAMember1D.cs | 12 +- .../Structural/GSA/Geometry/GSAMember2D.cs | 11 +- .../Structural/GSA/Geometry/GSANode.cs | 12 +- .../GSA/Geometry/GSARigidConstraint.cs | 12 +- .../Structural/GSA/Geometry/GSAStorey.cs | 9 +- .../Structural/GSA/Loading/GSALoadBeam.cs | 12 +- .../Structural/GSA/Loading/GSALoadCase.cs | 8 +- .../GSA/Loading/GSALoadCombination.cs | 11 +- .../Structural/GSA/Loading/GSALoadFace.cs | 10 +- .../Structural/GSA/Loading/GSALoadGravity.cs | 12 +- .../Structural/GSA/Loading/GSALoadGrid.cs | 10 +- .../Structural/GSA/Loading/GSALoadGridArea.cs | 12 +- .../Structural/GSA/Loading/GSALoadGridLine.cs | 13 +- .../GSA/Loading/GSALoadGridPoint.cs | 12 +- .../Structural/GSA/Loading/GSALoadNode.cs | 13 +- .../GSA/Loading/GSALoadThermal2d.cs | 10 +- .../Structural/GSA/Loading/GSAPolyline.cs | 13 +- .../Structural/GSA/Materials/GSAConcrete.cs | 8 +- .../Structural/GSA/Materials/GSAMaterial.cs | 8 +- .../Structural/GSA/Materials/GSASteel.cs | 8 +- .../GSA/Properties/GSAProperty1D.cs | 13 +- .../GSA/Properties/GSAProperty2D.cs | 11 +- .../Structural/Geometry/Axis.cs | 9 +- .../Structural/Geometry/Element1D.cs | 12 +- .../Structural/Geometry/Element2D.cs | 12 +- .../Structural/Geometry/Element3D.cs | 12 +- .../Structural/Geometry/ElementType.cs | 2 +- .../Structural/Geometry/MemberType.cs | 2 +- .../Structural/Geometry/MemberType1D.cs | 2 +- .../Structural/Geometry/Node.cs | 12 +- .../Structural/Geometry/Restraint.cs | 7 +- .../Structural/Geometry/RestraintType.cs | 2 +- .../Structural/Geometry/Storey.cs | 8 +- .../Structural/Loading/Load.cs | 5 +- .../Structural/Loading/LoadBeam.cs | 10 +- .../Structural/Loading/LoadCase.cs | 7 +- .../Structural/Loading/LoadCombination.cs | 9 +- .../Structural/Loading/LoadFace.cs | 10 +- .../Structural/Loading/LoadGravity.cs | 10 +- .../Structural/Loading/LoadNode.cs | 10 +- .../Structural/Loading/Loads.cs | 2 +- .../Structural/MaterialType.cs | 2 +- .../Structural/Materials/Concrete.cs | 6 +- .../Structural/Materials/Steel.cs | 6 +- .../Materials/StructuralMaterial.cs | 7 +- .../Structural/Materials/Timber.cs | 6 +- .../Properties/Profiles/SectionProfile.cs | 8 +- .../Structural/Properties/Property.cs | 7 +- .../Structural/Properties/Property1D.cs | 13 +- .../Structural/Properties/Property2D.cs | 11 +- .../Structural/Properties/Property3D.cs | 11 +- .../Structural/Properties/PropertyDamper.cs | 6 +- .../Structural/Properties/PropertyMass.cs | 6 +- .../Structural/Properties/PropertySpring.cs | 6 +- .../Structural/PropertyType.cs | 2 +- .../Structural/Results/AnalyticalResults.cs | 6 +- .../Structural/Results/Result.cs | 7 +- .../Structural/Results/Result1D.cs | 13 +- .../Structural/Results/Result2D.cs | 13 +- .../Structural/Results/Result3D.cs | 13 +- .../Structural/Results/ResultAll.cs | 7 +- .../Structural/Results/ResultGlobal.cs | 11 +- .../Structural/Results/ResultNode.cs | 13 +- .../Utils/MeshTriangulationHelper.cs | 6 +- src/Speckle.Objects/Utils/Parameters.cs | 7 +- src/Speckle.Objects/packages.lock.json | 6 +- .../Consts.cs | 2 +- .../ISpeckleActivity.cs | 2 +- .../ISpeckleLogger.cs | 2 +- .../LogBuilder.cs | 3 +- .../LogExtensions.cs | 2 +- .../Path.cs | 3 +- .../Speckle.Sdk.Logging.csproj} | 0 .../SpeckleActivity.cs | 2 +- .../SpeckleActivityFactory.cs | 4 +- .../SpeckleLog.cs | 2 +- .../SpeckleLogConfiguration.cs | 8 +- .../SpeckleLogLevel.cs | 2 +- .../SpeckleLogger.cs | 2 +- .../TraceBuilder.cs | 6 +- .../packages.lock.json | 0 .../Api/Exceptions.cs | 4 +- .../Api/GraphQL/.editorconfig | 0 .../Api/GraphQL/Client.cs | 17 +- .../Enums/FileUploadConversionStatus.cs | 2 +- .../ProjectCommentsUpdatedMessageType.cs | 2 +- .../ProjectFileImportUpdatedMessageType.cs | 2 +- .../Enums/ProjectModelsUpdatedMessageType.cs | 2 +- .../ProjectPendingModelsUpdatedMessageType.cs | 2 +- .../Enums/ProjectUpdatedMessageType.cs | 2 +- .../ProjectVersionsUpdatedMessageType.cs | 2 +- .../Api/GraphQL/Enums/ProjectVisibility.cs | 2 +- .../Api/GraphQL/Enums/ResourceType.cs | 2 +- .../Enums/UserProjectsUpdatedMessageType.cs | 2 +- .../GraphQL/GraphQLHttpClientExtensions.cs | 4 +- .../Api/GraphQL/ISpeckleGraphQLClient.cs | 2 +- .../Api/GraphQL/Inputs/CommentInputs.cs | 2 +- .../Api/GraphQL/Inputs/ModelInputs.cs | 2 +- .../Api/GraphQL/Inputs/ProjectInputs.cs | 4 +- .../Api/GraphQL/Inputs/SubscriptionInputs.cs | 2 +- .../Api/GraphQL/Inputs/VersionInputs.cs | 2 +- .../Client.ActivityOperations.cs | 2 +- .../Client.BranchOperations.cs | 4 +- .../Client.CommentOperations.cs | 4 +- .../Client.CommitOperations.cs | 4 +- .../Client.ObjectOperations.cs | 2 +- .../Client.ServerOperations.cs | 8 +- .../Client.StreamOperations.cs | 10 +- .../Client.UserOperations.cs | 6 +- .../Client.Subscriptions.Branch.cs | 3 +- .../Client.Subscriptions.Commit.cs | 3 +- .../Client.Subscriptions.Stream.cs | 3 +- .../Api/GraphQL/Legacy/LegacyGraphQLModels.cs | 6 +- .../Api/GraphQL/Legacy/Manager.cs | 2 +- .../Api/GraphQL/Legacy/SubscriptionModels.cs | 2 +- .../Api/GraphQL/Models/Collections.cs | 2 +- .../Api/GraphQL/Models/Comment.cs | 2 +- .../Api/GraphQL/Models/FileUpload.cs | 4 +- .../Api/GraphQL/Models/Model.cs | 2 +- .../Api/GraphQL/Models/ModelsTreeItem.cs | 2 +- .../Models/PendingStreamCollaborator.cs | 3 +- .../Api/GraphQL/Models/Project.cs | 4 +- .../Api/GraphQL/Models/ProjectCollaborator.cs | 2 +- .../Api/GraphQL/Models/ResourceIdentifier.cs | 4 +- .../Models/Responses/MutationResponses.cs | 2 +- .../Api/GraphQL/Models/Responses/Responses.cs | 2 +- .../Api/GraphQL/Models/ServerInfo.cs | 6 +- .../GraphQL/Models/SubscriptionMessages.cs | 6 +- .../Api/GraphQL/Models/User.cs | 3 +- .../Api/GraphQL/Models/Version.cs | 2 +- .../Api/GraphQL/Models/ViewerResourceGroup.cs | 2 +- .../Api/GraphQL/Models/ViewerResourceItem.cs | 2 +- .../GraphQL/Resources/ActiveUserResource.cs | 8 +- .../Api/GraphQL/Resources/CommentResource.cs | 8 +- .../Api/GraphQL/Resources/ModelResource.cs | 8 +- .../GraphQL/Resources/OtherUserResource.cs | 6 +- .../Resources/ProjectInviteResource.cs | 8 +- .../Api/GraphQL/Resources/ProjectResource.cs | 8 +- .../GraphQL/Resources/SubscriptionResource.cs | 8 +- .../Api/GraphQL/Resources/VersionResource.cs | 10 +- .../Api/GraphQL/Resources/graphql.config.yml | 0 .../Serializer/ConstantCaseEnumConverter.cs | 2 +- .../Api/GraphQL/Serializer/MapConverter.cs | 2 +- .../Serializer/NewtonsoftJsonSerializer.cs | 2 +- .../Api/GraphQL/StreamRoles.cs | 2 +- .../Api/Helpers.cs | 20 +- .../Api/Operations/Operations.Receive.cs | 10 +- .../Api/Operations/Operations.Send.cs | 13 +- .../Api/Operations/Operations.Serialize.cs | 15 +- src/Speckle.Sdk/Api/Operations/Operations.cs | 38 + .../Api/ServerLimits.cs | 2 +- .../Kits => Speckle.Sdk/Common}/Exceptions.cs | 33 +- .../Common/HashCode.cs | 2 +- .../Common/NotNullExtensions.cs | 2 +- .../Kits => Speckle.Sdk/Common}/Units.cs | 3 +- .../Credentials/Account.cs | 8 +- .../Credentials/AccountManager.cs | 21 +- .../Credentials/Exceptions.cs | 4 +- .../Credentials/Responses.cs | 6 +- .../Credentials/StreamWrapper.cs | 15 +- .../Credentials/graphql.config.yml | 0 .../ExceptionHelpers.cs | 2 +- .../Helpers/Constants.cs | 2 +- .../Helpers/Crypt.cs | 2 +- .../Helpers/Http.cs | 9 +- .../Helpers/State.cs | 2 +- .../Kits => Speckle.Sdk/Host}/Attributes.cs | 2 +- src/Speckle.Sdk/Host/HostAppVersion.cs | 21 + src/Speckle.Sdk/Host/HostApplication.cs | 13 + src/Speckle.Sdk/Host/HostApplications.cs | 220 ++++++ src/Speckle.Sdk/Host/TypeLoader.cs | 137 ++++ .../Logging/Analytics.cs | 7 +- .../Logging/CumulativeTimer.cs | 2 +- .../Logging/LoggingHelpers.cs | 2 +- .../Models/ApplicationObject.cs | 2 +- .../Models/Attributes.cs | 2 +- .../Models/Base.cs | 38 +- .../Models/Blob.cs | 3 +- .../Models/Collections/Collection.cs | 4 +- .../Models/Collections/Layer.cs | 3 +- .../Models/CommitObjectBuilder.cs | 9 +- .../Models/DeprecatedSpeckleTypeAttribute.cs | 8 + .../Models/DynamicBase.cs | 7 +- .../Models/DynamicBaseMemberType.cs | 10 +- .../Models/Extensions/BaseExtensions.cs | 4 +- .../Models/Extras.cs | 7 +- .../Models/GraphTraversal/DefaultTraversal.cs | 110 +++ .../Models/GraphTraversal/GraphTraversal.cs | 2 +- .../Models/GraphTraversal/ITraversalRule.cs | 2 +- .../Models/GraphTraversal/RuleBuilder.cs | 4 +- .../TraversalContextExtensions.cs | 2 +- .../GraphTraversal/TraversalContexts.cs | 2 +- .../Models/Instances/IInstanceComponent.cs | 2 +- .../Instances/InstanceDefinitionProxy.cs | 5 +- .../Models/Instances/InstanceProxy.cs | 6 +- .../Models/InvalidPropNameException.cs | 4 +- .../Models/NestingInstructions.cs | 2 +- .../Models/Proxies/ColorProxy.cs | 6 +- .../Models/Proxies/GroupProxy.cs | 4 +- .../Models/Proxies/IProxyCollection.cs | 2 +- .../Models/SpeckleTypeAttribute.cs | 8 + .../Models/Utilities.cs | 9 +- .../Serialisation/BaseObjectDeserializerV2.cs | 16 +- .../Serialisation/BaseObjectSerializerV2.cs | 17 +- .../BaseObjectSerializationUtilities.cs | 80 ++ .../SerializationUtilities/CallsiteCache.cs | 2 +- .../DeserializationWorkerThreads.cs | 4 +- .../SerializationUtilities/OperationTask.cs | 2 +- .../SerializationUtilities/ValueConverter.cs | 4 +- .../SpeckleSerializerException.cs | 4 +- .../Logging => Speckle.Sdk}/Setup.cs | 10 +- .../Speckle.Sdk.csproj} | 19 +- .../SpeckleConfiguration.cs | 6 +- .../SpeckleException.cs | 2 +- .../SpeckleNonUserFacingException.cs | 2 +- .../Transports}/DiskTransport.cs | 9 +- .../Transports/Exceptions.cs | 4 +- .../Transports/IServerTransport.cs | 2 +- .../Transports/ITransport.cs | 4 +- .../Transports/Memory.cs | 4 +- .../Transports/SQLite.cs | 7 +- .../Transports/ServerTransportFactory.cs | 4 +- .../Transports/ServerUtils/GzipContent.cs | 2 +- .../Transports/ServerUtils/IServerApi.cs | 2 +- .../ServerUtils/ParallelServerAPI.cs | 8 +- .../Transports/ServerUtils/ServerAPI.cs | 8 +- .../Transports/ServerV2.cs | 12 +- .../Transports/TransportHelpers.cs | 4 +- .../Transports/Utilities.cs | 4 +- .../packages.lock.json | 2 +- .../Speckle.Transports.Disk.csproj | 18 - .../packages.lock.json | 292 ------- src/Speckle.Transports.MongoDB/MongoDB.cs | 263 ------- .../Speckle.Transports.MongoDB.csproj | 19 - .../packages.lock.json | 423 ----------- .../TestKit.cs | 16 - .../Kits/KitManagerTests.cs | 19 - .../ObjectModelDeprecationTests.cs | 35 - .../GenericTests.cs | 55 -- .../Geometry/ArcTests.cs | 2 +- .../Geometry/MeshTests.cs | 2 +- .../Geometry/PointTests.cs | 2 +- .../Geometry/TransformTests.cs | 4 +- .../ModelPropertySupportedTypes.cs | 49 +- .../ObjectBaseValidityTests.cs | 16 + .../Utils/MeshTriangulationHelperTests.cs | 4 +- .../Utils/ShallowCopyTests.cs | 7 +- .../packages.lock.json | 18 +- .../RevitObject.json | 0 .../SerializationTests.cs | 22 +- .../Speckle.Sdk.Serialization.Tests.csproj} | 3 +- .../TestTransport.cs | 4 +- .../packages.lock.json | 18 +- .../Api/GraphQL/Legacy/LegacyAPITests.cs | 26 +- .../GraphQL/Legacy/Subscriptions/Branches.cs | 19 +- .../GraphQL/Legacy/Subscriptions/Commits.cs | 23 +- .../GraphQL/Legacy/Subscriptions/Streams.cs | 19 +- .../Resources/ActiveUserResourceTests.cs | 8 +- .../GraphQL/Resources/CommentResourceTests.cs | 10 +- .../ModelResourceExceptionalTests.cs | 12 +- .../GraphQL/Resources/ModelResourceTests.cs | 10 +- .../Resources/OtherUserResourceTests.cs | 8 +- .../ProjectInviteResourceExceptionalTests.cs | 10 +- .../Resources/ProjectInviteResourceTests.cs | 12 +- .../ProjectResourceExceptionalTests.cs | 16 +- .../GraphQL/Resources/ProjectResourceTests.cs | 12 +- .../Resources/SubscriptionResourceTests.cs | 10 +- .../GraphQL/Resources/VersionResourceTests.cs | 12 +- .../Credentials/UserServerInfoTests.cs | 6 +- .../Fixtures.cs | 18 +- .../GraphQLCLient.cs | 6 +- .../ServerTransportTests.cs | 16 +- .../Speckle.Sdk.Tests.Integration.csproj} | 4 +- .../Usings.cs | 0 .../packages.lock.json | 21 +- .../Api/GraphQLClient.cs | 9 +- .../Api/HelpersTests.cs | 6 +- .../Api/Operations/ClosureTests.cs | 24 +- .../OperationsReceiveTests.Exceptional.cs | 10 +- .../Api/Operations/OperationsReceiveTests.cs | 27 +- .../Api/Operations/SendReceiveLocal.cs | 64 +- .../Api/Operations/SerializationTests.cs | 80 +- .../Common/NotNullTests.cs | 4 +- .../AccountServerMigrationTests.cs | 6 +- .../Credentials/Accounts.cs | 6 +- .../Credentials/FE2WrapperTests.cs | 6 +- .../Credentials/StreamWrapperTests.cs | 4 +- .../Fixtures.cs | 10 +- .../Helpers/Path.cs | 4 +- .../Host}/HostApplicationTests.cs | 4 +- .../Host}/TestKit.cs | 39 +- .../Models/BaseTests.cs | 17 +- .../Models/Extensions/BaseExtensionsTests.cs | 21 +- .../Models/Extensions/DisplayValueTests.cs | 8 +- .../Models/Extensions/ExceptionTests.cs | 4 +- .../GraphTraversal/GraphTraversalTests.cs | 19 +- .../TraversalContextExtensionsTests.cs | 10 +- .../GraphTraversal/TraversalMockObjects.cs | 5 +- .../Models/Hashing.cs | 14 +- .../Models/SpeckleType.cs | 15 +- .../Models/TraversalTests.cs | 6 +- .../Models/UtilitiesTests.cs | 13 +- .../ObjectModelDeprecationTests.cs | 49 ++ .../SerializerBreakingChanges.cs | 4 +- .../SerializerNonBreakingChanges.cs | 32 +- .../Speckle.Sdk.Tests.Unit.csproj} | 3 +- .../Transports/DiskTransportTests.cs | 6 +- .../Transports/MemoryTransportTests.cs | 6 +- .../Transports/SQLiteTransportTests.cs | 6 +- .../Transports/TransportTests.cs | 7 +- .../packages.lock.json | 12 +- 540 files changed, 2953 insertions(+), 5244 deletions(-) delete mode 100644 src/Speckle.Core/Api/Operations/Operations.cs delete mode 100644 src/Speckle.Core/Kits/ConverterInterfaces/IFinalizable.cs delete mode 100644 src/Speckle.Core/Kits/ISpeckleConverter.cs delete mode 100644 src/Speckle.Core/Kits/ISpeckleKit.cs delete mode 100644 src/Speckle.Core/Kits/KitDeclaration.cs delete mode 100644 src/Speckle.Core/Kits/KitManager.cs delete mode 100644 src/Speckle.Core/Models/GraphTraversal/DefaultTraversal.cs delete mode 100644 src/Speckle.Core/Serialisation/BaseObjectSerializer.cs delete mode 100644 src/Speckle.Core/Serialisation/SerializationUtilities/BaseObjectSerializationUtilities.cs delete mode 100644 src/Speckle.Objects/ObjectsKit.cs delete mode 100644 src/Speckle.Objects/Organization/Deprecated/Collection.cs delete mode 100644 src/Speckle.Objects/Primitive/Chunk.cs rename src/{Speckle.Logging => Speckle.Sdk.Logging}/Consts.cs (81%) rename src/{Speckle.Logging => Speckle.Sdk.Logging}/ISpeckleActivity.cs (75%) rename src/{Speckle.Logging => Speckle.Sdk.Logging}/ISpeckleLogger.cs (96%) rename src/{Speckle.Logging => Speckle.Sdk.Logging}/LogBuilder.cs (98%) rename src/{Speckle.Logging => Speckle.Sdk.Logging}/LogExtensions.cs (98%) rename src/{Speckle.Logging => Speckle.Sdk.Logging}/Path.cs (99%) rename src/{Speckle.Logging/Speckle.Logging.csproj => Speckle.Sdk.Logging/Speckle.Sdk.Logging.csproj} (100%) rename src/{Speckle.Logging => Speckle.Sdk.Logging}/SpeckleActivity.cs (88%) rename src/{Speckle.Logging => Speckle.Sdk.Logging}/SpeckleActivityFactory.cs (81%) rename src/{Speckle.Logging => Speckle.Sdk.Logging}/SpeckleLog.cs (90%) rename src/{Speckle.Logging => Speckle.Sdk.Logging}/SpeckleLogConfiguration.cs (77%) rename src/{Speckle.Logging => Speckle.Sdk.Logging}/SpeckleLogLevel.cs (95%) rename src/{Speckle.Logging => Speckle.Sdk.Logging}/SpeckleLogger.cs (98%) rename src/{Speckle.Logging => Speckle.Sdk.Logging}/TraceBuilder.cs (92%) rename src/{Speckle.Logging => Speckle.Sdk.Logging}/packages.lock.json (100%) rename src/{Speckle.Core => Speckle.Sdk}/Api/Exceptions.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/.editorconfig (100%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Client.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Enums/FileUploadConversionStatus.cs (82%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Enums/ProjectCommentsUpdatedMessageType.cs (65%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Enums/ProjectFileImportUpdatedMessageType.cs (62%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Enums/ProjectModelsUpdatedMessageType.cs (64%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Enums/ProjectPendingModelsUpdatedMessageType.cs (63%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Enums/ProjectUpdatedMessageType.cs (59%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Enums/ProjectVersionsUpdatedMessageType.cs (65%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Enums/ProjectVisibility.cs (59%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Enums/ResourceType.cs (61%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Enums/UserProjectsUpdatedMessageType.cs (60%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/GraphQLHttpClientExtensions.cs (95%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/ISpeckleGraphQLClient.cs (96%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Inputs/CommentInputs.cs (90%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Inputs/ModelInputs.cs (88%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Inputs/ProjectInputs.cs (93%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Inputs/SubscriptionInputs.cs (74%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Inputs/VersionInputs.cs (93%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ActivityOperations.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.BranchOperations.cs (99%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommentOperations.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommitOperations.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ObjectOperations.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ServerOperations.cs (82%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.StreamOperations.cs (99%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.UserOperations.cs (93%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Branch.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Commit.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Stream.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/LegacyGraphQLModels.cs (99%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/Manager.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Legacy/SubscriptionModels.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/Collections.cs (89%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/Comment.cs (94%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/FileUpload.cs (91%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/Model.cs (93%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/ModelsTreeItem.cs (88%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/PendingStreamCollaborator.cs (93%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/Project.cs (92%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/ProjectCollaborator.cs (77%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/ResourceIdentifier.cs (66%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/Responses/MutationResponses.cs (94%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/Responses/Responses.cs (96%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/ServerInfo.cs (86%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/SubscriptionMessages.cs (93%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/User.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/Version.cs (91%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/ViewerResourceGroup.cs (78%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Models/ViewerResourceItem.cs (80%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Resources/ActiveUserResource.cs (95%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Resources/CommentResource.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Resources/ModelResource.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Resources/OtherUserResource.cs (95%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Resources/ProjectInviteResource.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Resources/ProjectResource.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Resources/SubscriptionResource.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Resources/VersionResource.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Resources/graphql.config.yml (100%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Serializer/ConstantCaseEnumConverter.cs (95%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Serializer/MapConverter.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/Serializer/NewtonsoftJsonSerializer.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Api/GraphQL/StreamRoles.cs (89%) rename src/{Speckle.Core => Speckle.Sdk}/Api/Helpers.cs (96%) rename src/{Speckle.Core => Speckle.Sdk}/Api/Operations/Operations.Receive.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Api/Operations/Operations.Send.cs (96%) rename src/{Speckle.Core => Speckle.Sdk}/Api/Operations/Operations.Serialize.cs (69%) create mode 100644 src/Speckle.Sdk/Api/Operations/Operations.cs rename src/{Speckle.Core => Speckle.Sdk}/Api/ServerLimits.cs (94%) rename src/{Speckle.Core/Kits => Speckle.Sdk/Common}/Exceptions.cs (81%) rename src/{Speckle.Core => Speckle.Sdk}/Common/HashCode.cs (99%) rename src/{Speckle.Core => Speckle.Sdk}/Common/NotNullExtensions.cs (97%) rename src/{Speckle.Core/Kits => Speckle.Sdk/Common}/Units.cs (99%) rename src/{Speckle.Core => Speckle.Sdk}/Credentials/Account.cs (96%) rename src/{Speckle.Core => Speckle.Sdk}/Credentials/AccountManager.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Credentials/Exceptions.cs (90%) rename src/{Speckle.Core => Speckle.Sdk}/Credentials/Responses.cs (92%) rename src/{Speckle.Core => Speckle.Sdk}/Credentials/StreamWrapper.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Credentials/graphql.config.yml (100%) rename src/{Speckle.Core/Logging => Speckle.Sdk}/ExceptionHelpers.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Helpers/Constants.cs (96%) rename src/{Speckle.Core => Speckle.Sdk}/Helpers/Crypt.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Helpers/Http.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Helpers/State.cs (97%) rename src/{Speckle.Core/Kits => Speckle.Sdk/Host}/Attributes.cs (98%) create mode 100644 src/Speckle.Sdk/Host/HostAppVersion.cs create mode 100644 src/Speckle.Sdk/Host/HostApplication.cs create mode 100644 src/Speckle.Sdk/Host/HostApplications.cs create mode 100644 src/Speckle.Sdk/Host/TypeLoader.cs rename src/{Speckle.Core => Speckle.Sdk}/Logging/Analytics.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Logging/CumulativeTimer.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Logging/LoggingHelpers.cs (93%) rename src/{Speckle.Core => Speckle.Sdk}/Models/ApplicationObject.cs (99%) rename src/{Speckle.Core => Speckle.Sdk}/Models/Attributes.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Models/Base.cs (91%) rename src/{Speckle.Core => Speckle.Sdk}/Models/Blob.cs (95%) rename src/{Speckle.Core => Speckle.Sdk}/Models/Collections/Collection.cs (92%) rename src/{Speckle.Core => Speckle.Sdk}/Models/Collections/Layer.cs (83%) rename src/{Speckle.Core => Speckle.Sdk}/Models/CommitObjectBuilder.cs (97%) create mode 100644 src/Speckle.Sdk/Models/DeprecatedSpeckleTypeAttribute.cs rename src/{Speckle.Core => Speckle.Sdk}/Models/DynamicBase.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Models/DynamicBaseMemberType.cs (75%) rename src/{Speckle.Core => Speckle.Sdk}/Models/Extensions/BaseExtensions.cs (99%) rename src/{Speckle.Core => Speckle.Sdk}/Models/Extras.cs (97%) create mode 100644 src/Speckle.Sdk/Models/GraphTraversal/DefaultTraversal.cs rename src/{Speckle.Core => Speckle.Sdk}/Models/GraphTraversal/GraphTraversal.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Models/GraphTraversal/ITraversalRule.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Models/GraphTraversal/RuleBuilder.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Models/GraphTraversal/TraversalContextExtensions.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Models/GraphTraversal/TraversalContexts.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Models/Instances/IInstanceComponent.cs (93%) rename src/{Speckle.Core => Speckle.Sdk}/Models/Instances/InstanceDefinitionProxy.cs (82%) rename src/{Speckle.Core => Speckle.Sdk}/Models/Instances/InstanceProxy.cs (78%) rename src/{Speckle.Core => Speckle.Sdk}/Models/InvalidPropNameException.cs (88%) rename src/{Speckle.Core => Speckle.Sdk}/Models/NestingInstructions.cs (94%) rename src/{Speckle.Core => Speckle.Sdk}/Models/Proxies/ColorProxy.cs (86%) rename src/{Speckle.Core => Speckle.Sdk}/Models/Proxies/GroupProxy.cs (75%) rename src/{Speckle.Core => Speckle.Sdk}/Models/Proxies/IProxyCollection.cs (91%) create mode 100644 src/Speckle.Sdk/Models/SpeckleTypeAttribute.cs rename src/{Speckle.Core => Speckle.Sdk}/Models/Utilities.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Serialisation/BaseObjectDeserializerV2.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Serialisation/BaseObjectSerializerV2.cs (98%) create mode 100644 src/Speckle.Sdk/Serialisation/SerializationUtilities/BaseObjectSerializationUtilities.cs rename src/{Speckle.Core => Speckle.Sdk}/Serialisation/SerializationUtilities/CallsiteCache.cs (95%) rename src/{Speckle.Core => Speckle.Sdk}/Serialisation/SerializationUtilities/DeserializationWorkerThreads.cs (96%) rename src/{Speckle.Core => Speckle.Sdk}/Serialisation/SerializationUtilities/OperationTask.cs (96%) rename src/{Speckle.Core => Speckle.Sdk}/Serialisation/SerializationUtilities/ValueConverter.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Serialisation/SpeckleSerializerException.cs (89%) rename src/{Speckle.Core/Logging => Speckle.Sdk}/Setup.cs (95%) rename src/{Speckle.Core/Speckle.Core.csproj => Speckle.Sdk/Speckle.Sdk.csproj} (64%) rename src/{Speckle.Core/Logging => Speckle.Sdk}/SpeckleConfiguration.cs (66%) rename src/{Speckle.Core/Logging => Speckle.Sdk}/SpeckleException.cs (88%) rename src/{Speckle.Core/Logging => Speckle.Sdk}/SpeckleNonUserFacingException.cs (92%) rename src/{Speckle.Transports.Disk => Speckle.Sdk/Transports}/DiskTransport.cs (95%) rename src/{Speckle.Core => Speckle.Sdk}/Transports/Exceptions.cs (88%) rename src/{Speckle.Core => Speckle.Sdk}/Transports/IServerTransport.cs (87%) rename src/{Speckle.Core => Speckle.Sdk}/Transports/ITransport.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Transports/Memory.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Transports/SQLite.cs (99%) rename src/{Speckle.Core => Speckle.Sdk}/Transports/ServerTransportFactory.cs (86%) rename src/{Speckle.Core => Speckle.Sdk}/Transports/ServerUtils/GzipContent.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Transports/ServerUtils/IServerApi.cs (94%) rename src/{Speckle.Core => Speckle.Sdk}/Transports/ServerUtils/ParallelServerAPI.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Transports/ServerUtils/ServerAPI.cs (99%) rename src/{Speckle.Core => Speckle.Sdk}/Transports/ServerV2.cs (98%) rename src/{Speckle.Core => Speckle.Sdk}/Transports/TransportHelpers.cs (97%) rename src/{Speckle.Core => Speckle.Sdk}/Transports/Utilities.cs (86%) rename src/{Speckle.Core => Speckle.Sdk}/packages.lock.json (99%) delete mode 100644 src/Speckle.Transports.Disk/Speckle.Transports.Disk.csproj delete mode 100644 src/Speckle.Transports.Disk/packages.lock.json delete mode 100644 src/Speckle.Transports.MongoDB/MongoDB.cs delete mode 100644 src/Speckle.Transports.MongoDB/Speckle.Transports.MongoDB.csproj delete mode 100644 src/Speckle.Transports.MongoDB/packages.lock.json delete mode 100644 tests/Speckle.Core.Serialization.Tests/TestKit.cs delete mode 100644 tests/Speckle.Core.Tests.Unit/Kits/KitManagerTests.cs delete mode 100644 tests/Speckle.Core.Tests.Unit/Serialisation/ObjectModelDeprecationTests.cs delete mode 100644 tests/Speckle.Objects.Tests.Unit/GenericTests.cs create mode 100644 tests/Speckle.Objects.Tests.Unit/ObjectBaseValidityTests.cs rename tests/{Speckle.Core.Serialization.Tests => Speckle.Sdk.Serialization.Tests}/RevitObject.json (100%) rename tests/{Speckle.Core.Serialization.Tests => Speckle.Sdk.Serialization.Tests}/SerializationTests.cs (80%) rename tests/{Speckle.Core.Serialization.Tests/Speckle.Core.Serialization.Tests.csproj => Speckle.Sdk.Serialization.Tests/Speckle.Sdk.Serialization.Tests.csproj} (85%) rename tests/{Speckle.Core.Serialization.Tests => Speckle.Sdk.Serialization.Tests}/TestTransport.cs (94%) rename tests/{Speckle.Core.Serialization.Tests => Speckle.Sdk.Serialization.Tests}/packages.lock.json (98%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Legacy/LegacyAPITests.cs (95%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Legacy/Subscriptions/Branches.cs (88%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Legacy/Subscriptions/Commits.cs (90%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Legacy/Subscriptions/Streams.cs (86%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Resources/ActiveUserResourceTests.cs (88%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Resources/CommentResourceTests.cs (93%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Resources/ModelResourceExceptionalTests.cs (90%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Resources/ModelResourceTests.cs (93%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Resources/OtherUserResourceTests.cs (87%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Resources/ProjectInviteResourceExceptionalTests.cs (79%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Resources/ProjectInviteResourceTests.cs (93%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs (92%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Resources/ProjectResourceTests.cs (90%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Resources/SubscriptionResourceTests.cs (95%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Api/GraphQL/Resources/VersionResourceTests.cs (93%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Credentials/UserServerInfoTests.cs (95%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Fixtures.cs (94%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/GraphQLCLient.cs (92%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/ServerTransportTests.cs (94%) rename tests/{Speckle.Core.Tests.Integration/Speckle.Core.Tests.Integration.csproj => Speckle.Sdk.Tests.Integration/Speckle.Sdk.Tests.Integration.csproj} (77%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/Usings.cs (100%) rename tests/{Speckle.Core.Tests.Integration => Speckle.Sdk.Tests.Integration}/packages.lock.json (96%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Api/GraphQLClient.cs (95%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Api/HelpersTests.cs (87%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Api/Operations/ClosureTests.cs (86%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Api/Operations/OperationsReceiveTests.Exceptional.cs (72%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Api/Operations/OperationsReceiveTests.cs (71%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Api/Operations/SendReceiveLocal.cs (80%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Api/Operations/SerializationTests.cs (70%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Common/NotNullTests.cs (95%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Credentials/AccountServerMigrationTests.cs (95%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Credentials/Accounts.cs (96%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Credentials/FE2WrapperTests.cs (95%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Credentials/StreamWrapperTests.cs (97%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Fixtures.cs (83%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Helpers/Path.cs (97%) rename tests/{Speckle.Core.Tests.Unit/Kits => Speckle.Sdk.Tests.Unit/Host}/HostApplicationTests.cs (87%) rename tests/{Speckle.Core.Tests.Unit/Kits => Speckle.Sdk.Tests.Unit/Host}/TestKit.cs (82%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Models/BaseTests.cs (94%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Models/Extensions/BaseExtensionsTests.cs (80%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Models/Extensions/DisplayValueTests.cs (81%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Models/Extensions/ExceptionTests.cs (86%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Models/GraphTraversal/GraphTraversalTests.cs (90%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Models/GraphTraversal/TraversalContextExtensionsTests.cs (90%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Models/GraphTraversal/TraversalMockObjects.cs (66%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Models/Hashing.cs (89%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Models/SpeckleType.cs (68%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Models/TraversalTests.cs (96%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Models/UtilitiesTests.cs (79%) create mode 100644 tests/Speckle.Sdk.Tests.Unit/Serialisation/ObjectModelDeprecationTests.cs rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Serialisation/SerializerBreakingChanges.cs (94%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Serialisation/SerializerNonBreakingChanges.cs (87%) rename tests/{Speckle.Core.Tests.Unit/Speckle.Core.Tests.Unit.csproj => Speckle.Sdk.Tests.Unit/Speckle.Sdk.Tests.Unit.csproj} (80%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Transports/DiskTransportTests.cs (88%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Transports/MemoryTransportTests.cs (79%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Transports/SQLiteTransportTests.cs (97%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/Transports/TransportTests.cs (97%) rename tests/{Speckle.Core.Tests.Unit => Speckle.Sdk.Tests.Unit}/packages.lock.json (97%) diff --git a/Speckle.Sdk.sln b/Speckle.Sdk.sln index 4b1861b9..cf8d5692 100644 --- a/Speckle.Sdk.sln +++ b/Speckle.Sdk.sln @@ -1,10 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Core", "src\Speckle.Core\Speckle.Core.csproj", "{A413E196-3696-4F48-B635-04B5F76BF9C9}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Sdk", "src\Speckle.Sdk\Speckle.Sdk.csproj", "{A413E196-3696-4F48-B635-04B5F76BF9C9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Core.Tests.Unit", "tests\Speckle.Core.Tests.Unit\Speckle.Core.Tests.Unit.csproj", "{99AE2273-12C5-4A9D-9FDD-19F8B394B5E2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Transports.Disk", "src\Speckle.Transports.Disk\Speckle.Transports.Disk.csproj", "{6845F190-036C-4AEF-B267-23EE84DBD2A6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Sdk.Tests.Unit", "tests\Speckle.Sdk.Tests.Unit\Speckle.Sdk.Tests.Unit.csproj", "{99AE2273-12C5-4A9D-9FDD-19F8B394B5E2}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Objects", "src\Speckle.Objects\Speckle.Objects.csproj", "{181F50AA-DD2A-4541-98EF-B868E2D06B9A}" EndProject @@ -30,11 +28,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{58D37DA9 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "build", "build\build.csproj", "{9B8DDEB5-37C7-49B5-984D-C65DE5FCB7B7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Transports.MongoDB", "src\Speckle.Transports.MongoDB\Speckle.Transports.MongoDB.csproj", "{68078752-7C54-471A-9CB6-E8AEF34A9EFF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Core.Serialization.Tests", "tests\Speckle.Core.Serialization.Tests\Speckle.Core.Serialization.Tests.csproj", "{AA1E1E51-49AE-4F71-84B1-938E19695BE0}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Sdk.Serialization.Tests", "tests\Speckle.Sdk.Serialization.Tests\Speckle.Sdk.Serialization.Tests.csproj", "{AA1E1E51-49AE-4F71-84B1-938E19695BE0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Core.Tests.Integration", "tests\Speckle.Core.Tests.Integration\Speckle.Core.Tests.Integration.csproj", "{4FB41A6D-D139-4111-8115-E3F9F6BEAF24}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Sdk.Tests.Integration", "tests\Speckle.Sdk.Tests.Integration\Speckle.Sdk.Tests.Integration.csproj", "{4FB41A6D-D139-4111-8115-E3F9F6BEAF24}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{B623BD21-5CAA-43F9-A539-1835276C220E}" ProjectSection(SolutionItems) = preProject @@ -42,7 +38,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{ .github\workflows\ci.yml = .github\workflows\ci.yml EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Logging", "src\Speckle.Logging\Speckle.Logging.csproj", "{156313B4-B588-4363-A0ED-5AB3A55AA4E8}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Speckle.Sdk.Logging", "src\Speckle.Sdk.Logging\Speckle.Sdk.Logging.csproj", "{156313B4-B588-4363-A0ED-5AB3A55AA4E8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -62,10 +58,6 @@ Global {99AE2273-12C5-4A9D-9FDD-19F8B394B5E2}.Debug|Any CPU.Build.0 = Debug|Any CPU {99AE2273-12C5-4A9D-9FDD-19F8B394B5E2}.Release|Any CPU.ActiveCfg = Release|Any CPU {99AE2273-12C5-4A9D-9FDD-19F8B394B5E2}.Release|Any CPU.Build.0 = Release|Any CPU - {6845F190-036C-4AEF-B267-23EE84DBD2A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6845F190-036C-4AEF-B267-23EE84DBD2A6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6845F190-036C-4AEF-B267-23EE84DBD2A6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6845F190-036C-4AEF-B267-23EE84DBD2A6}.Release|Any CPU.Build.0 = Release|Any CPU {181F50AA-DD2A-4541-98EF-B868E2D06B9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {181F50AA-DD2A-4541-98EF-B868E2D06B9A}.Debug|Any CPU.Build.0 = Debug|Any CPU {181F50AA-DD2A-4541-98EF-B868E2D06B9A}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -78,10 +70,6 @@ Global {9B8DDEB5-37C7-49B5-984D-C65DE5FCB7B7}.Debug|Any CPU.Build.0 = Debug|Any CPU {9B8DDEB5-37C7-49B5-984D-C65DE5FCB7B7}.Release|Any CPU.ActiveCfg = Release|Any CPU {9B8DDEB5-37C7-49B5-984D-C65DE5FCB7B7}.Release|Any CPU.Build.0 = Release|Any CPU - {68078752-7C54-471A-9CB6-E8AEF34A9EFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {68078752-7C54-471A-9CB6-E8AEF34A9EFF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {68078752-7C54-471A-9CB6-E8AEF34A9EFF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {68078752-7C54-471A-9CB6-E8AEF34A9EFF}.Release|Any CPU.Build.0 = Release|Any CPU {AA1E1E51-49AE-4F71-84B1-938E19695BE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AA1E1E51-49AE-4F71-84B1-938E19695BE0}.Debug|Any CPU.Build.0 = Debug|Any CPU {AA1E1E51-49AE-4F71-84B1-938E19695BE0}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -97,12 +85,10 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {A413E196-3696-4F48-B635-04B5F76BF9C9} = {5CB96C27-FC5B-4A41-86B6-951AF99B8116} - {6845F190-036C-4AEF-B267-23EE84DBD2A6} = {5CB96C27-FC5B-4A41-86B6-951AF99B8116} {181F50AA-DD2A-4541-98EF-B868E2D06B9A} = {5CB96C27-FC5B-4A41-86B6-951AF99B8116} {99AE2273-12C5-4A9D-9FDD-19F8B394B5E2} = {35047EE7-AD1D-4741-80A7-8F0E874718E9} {A0338FC0-3011-498F-AD09-01230FABD3ED} = {35047EE7-AD1D-4741-80A7-8F0E874718E9} {9B8DDEB5-37C7-49B5-984D-C65DE5FCB7B7} = {58D37DA9-F948-48CA-9A73-F5BBBD533DBF} - {68078752-7C54-471A-9CB6-E8AEF34A9EFF} = {5CB96C27-FC5B-4A41-86B6-951AF99B8116} {AA1E1E51-49AE-4F71-84B1-938E19695BE0} = {35047EE7-AD1D-4741-80A7-8F0E874718E9} {4FB41A6D-D139-4111-8115-E3F9F6BEAF24} = {35047EE7-AD1D-4741-80A7-8F0E874718E9} {B623BD21-5CAA-43F9-A539-1835276C220E} = {DA2AED52-58F9-471E-8AD8-102FD36129E3} diff --git a/src/Speckle.Core/Api/Operations/Operations.cs b/src/Speckle.Core/Api/Operations/Operations.cs deleted file mode 100644 index 3d4982f8..00000000 --- a/src/Speckle.Core/Api/Operations/Operations.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System.Collections.Concurrent; -using Speckle.Core.Serialisation; -using Speckle.Newtonsoft.Json; -using Speckle.Newtonsoft.Json.Serialization; - -namespace Speckle.Core.Api; - -/// -/// Exposes several key methods for interacting with Speckle.Core. -/// Serialize/Deserialize -/// Push/Pull (methods to serialize and send data to one or more servers) -/// -public static partial class Operations -{ - /// - /// Convenience method to instantiate an instance of the default object serializer and settings pre-populated with it. - /// - [Obsolete("V1 Serializer is deprecated. Use " + nameof(BaseObjectSerializerV2))] - public static (BaseObjectSerializer, JsonSerializerSettings) GetSerializerInstance() - { - var serializer = new BaseObjectSerializer(); - var settings = new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore, - ContractResolver = new CamelCasePropertyNamesContractResolver(), - Formatting = Formatting.None, - ReferenceLoopHandling = ReferenceLoopHandling.Ignore, - Converters = new List { serializer } - }; - - return (serializer, settings); - } - - /// - /// Factory for progress actions used internally inside send and receive methods. - /// - /// - /// - private static Action? GetInternalProgressAction( - Action>? onProgressAction - ) - { - if (onProgressAction is null) - { - return null; - } - - var localProgressDict = new ConcurrentDictionary(); - - return (name, processed) => - { - if (!localProgressDict.TryAdd(name, processed)) - { - localProgressDict[name] += processed; - } - - onProgressAction.Invoke(localProgressDict); - }; - } -} diff --git a/src/Speckle.Core/Kits/ConverterInterfaces/IFinalizable.cs b/src/Speckle.Core/Kits/ConverterInterfaces/IFinalizable.cs deleted file mode 100644 index 7f10c2fc..00000000 --- a/src/Speckle.Core/Kits/ConverterInterfaces/IFinalizable.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Speckle.Core.Kits.ConverterInterfaces; - -public interface IFinalizable -{ - void FinalizeConversion(); -} diff --git a/src/Speckle.Core/Kits/HostApplications.cs b/src/Speckle.Core/Kits/HostApplications.cs index 66c1aaf9..fc38d763 100644 --- a/src/Speckle.Core/Kits/HostApplications.cs +++ b/src/Speckle.Core/Kits/HostApplications.cs @@ -1,6 +1,6 @@ using System.Diagnostics.Contracts; -namespace Speckle.Core.Kits; +namespace Speckle.Sdk.Host; /// /// List of Host Applications - their slugs should match our ghost tags and ci/cd slugs diff --git a/src/Speckle.Core/Kits/ISpeckleConverter.cs b/src/Speckle.Core/Kits/ISpeckleConverter.cs deleted file mode 100644 index a3abbbe1..00000000 --- a/src/Speckle.Core/Kits/ISpeckleConverter.cs +++ /dev/null @@ -1,151 +0,0 @@ -#nullable disable -using Speckle.Core.Models; - -namespace Speckle.Core.Kits; - -public interface ISpeckleConverter -{ - string Description { get; } - string Name { get; } - string Author { get; } - string WebsiteOrEmail { get; } - - /// - /// Keeps track of the conversion process - /// - public ProgressReport Report { get; } - - /// - /// Decides what to do when an element being received already exists - /// - public ReceiveMode ReceiveMode { get; set; } - - /// - /// Converts a native object to a Speckle one - /// - /// Native object to convert - /// - /// - public Base ConvertToSpeckle(object value); - - /// - /// Converts a list of objects to Speckle. - /// - /// - /// - /// - public List ConvertToSpeckle(List values); - - /// - /// Checks if it can convert a native object to a Speckle one - /// - /// Native object to convert - /// - public bool CanConvertToSpeckle(object value); - - /// - /// Converts a Speckle object to a native one - /// - /// Speckle object to convert - /// - /// - public object ConvertToNative(Base value); - - /// - /// Converts a list of Speckle objects to a native ones. - /// - /// - /// - /// - public List ConvertToNative(List values); - - /// - /// Converts a given speckle objects as a generic native object. - /// This should assume has been called and returned True, - /// or call it within this method's implementation to ensure non-displayable objects are gracefully handled. - /// - /// - /// This method should not try to convert an object to it's native representation (i.e Speckle Wall -> Wall), - /// but rather use the 'displayValue' of that wall to create a geometrically correct representation of that object - /// in the native application. - /// An object may be able to be converted both with and . - /// In this case, deciding which to use is dependent on each connector developer. - /// Preferably, should be used as a fallback to the logic. - /// - /// Speckle object to convert - /// The native object that resulted after converting the input - public object ConvertToNativeDisplayable(Base value); - - /// - /// Checks if it can convert a Speckle object to a native one - /// - /// Speckle object to convert - /// - public bool CanConvertToNative(Base value); - - /// - /// Checks to verify if a given object is: 1) displayable and 2) can be supported for conversion to the native application. - /// An object is considered "displayable" if it has a 'displayValue' property (defined in its class or dynamically attached to it, detached or not). - /// - /// - /// An object may return "True" for both and - /// In this case, deciding which to use is dependent on each connector developer. - /// Preferably, should be used as a fallback to the logic. - /// Objects found in the 'displayValue' property are assumed to be universally convertible by all converters and the viewer, but are not guaranteed to be so. - /// - /// Speckle object to convert - /// True if the object is "displayable" and the converter supports native conversion of the given speckle object in particular. - public bool CanConvertToNativeDisplayable(Base value); - - /// - /// Returns a list of applications serviced by this converter - /// - /// - public IEnumerable GetServicedApplications(); - - /// - /// Sets the application document that the converter is targeting - /// - /// The current application document - public void SetContextDocument(object doc); - - /// - /// Some converters need to know which other objects are being converted, in order to sort relationships between them (ie, Revit). Use this method to set them. - /// - /// - public void SetContextObjects(List objects); - - /// - /// Some converters need to know which objects have been converted before in order to update them (ie, Revit). Use this method to set them. - /// - /// - public void SetPreviousContextObjects(List objects); - - /// - /// Some converters need to be able to receive some settings to modify their internal behaviour (i.e. Rhino's Brep Meshing options). Use this method to set them. - /// - /// The object representing the settings for your converter. - public void SetConverterSettings(object settings); -} - -// NOTE: Do not change the order of the existing ones -/// -/// Receive modes indicate what to do and not do when receiving objects -/// -public enum ReceiveMode -{ - /// - /// Attemts updating previously received objects by ID, deletes previously received objects that do not exist anymore and creates new ones - /// - Update, - - /// - /// Always creates new objects - /// - Create, - - /// - /// Ignores updating previously received objects and does not attempt updating or deleting them, creates new objects - /// - Ignore -} diff --git a/src/Speckle.Core/Kits/ISpeckleKit.cs b/src/Speckle.Core/Kits/ISpeckleKit.cs deleted file mode 100644 index 90f52067..00000000 --- a/src/Speckle.Core/Kits/ISpeckleKit.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace Speckle.Core.Kits; - -/// -/// Defines the basic interface for creating a "Speckle Kit" -/// -public interface ISpeckleKit -{ - /// - /// Gets all the object types (the object model) provided by this kit. - /// - IEnumerable Types { get; } - - /// - /// Gets all available converters for this Kit. - /// - IEnumerable Converters { get; } - - /// - /// Gets this Kit's description. - /// - string Description { get; } - - /// - /// Gets this Kit's name. - /// - string Name { get; } - - /// - /// Gets this Kit's author. - /// - string Author { get; } - - /// - /// Gets the website (or email) to contact the Kit's author. - /// - string WebsiteOrEmail { get; } - - /// - /// Tries to load a converter for a specific . - /// - /// The host app string for which a is desired. see - /// The converter for the specific - /// Thrown if the requested converter failed to load - public ISpeckleConverter LoadConverter(string app); -} diff --git a/src/Speckle.Core/Kits/KitDeclaration.cs b/src/Speckle.Core/Kits/KitDeclaration.cs deleted file mode 100644 index 38999464..00000000 --- a/src/Speckle.Core/Kits/KitDeclaration.cs +++ /dev/null @@ -1,27 +0,0 @@ -#nullable disable -using Speckle.Core.Models; - -namespace Speckle.Core.Kits; - -/// -/// Needed so we can properly deserialize all the Base-derived objects from Speckle.Core itself. -/// -public sealed class CoreKit : ISpeckleKit -{ - public IEnumerable Types => GetType().Assembly.GetTypes().Where(type => type.IsSubclassOf(typeof(Base))); - - public string Description => "Base Speckle models for revisions, streams, etc."; - - public string Name => nameof(CoreKit); - - public string Author => "Dimitrie"; - - public string WebsiteOrEmail => "hello@speckle.systems"; - - public IEnumerable Converters => new List(); - - public ISpeckleConverter LoadConverter(string app) - { - return null; - } -} diff --git a/src/Speckle.Core/Kits/KitManager.cs b/src/Speckle.Core/Kits/KitManager.cs deleted file mode 100644 index 697e6a2c..00000000 --- a/src/Speckle.Core/Kits/KitManager.cs +++ /dev/null @@ -1,336 +0,0 @@ -using System.Reflection; -using Speckle.Core.Helpers; -using Speckle.Core.Logging; -using Speckle.Core.Models; -using Speckle.Logging; - -namespace Speckle.Core.Kits; - -public static class KitManager -{ - private static string? s_kitsFolder; - - public static readonly AssemblyName SpeckleAssemblyName = typeof(Base).GetTypeInfo().Assembly.GetName(); - - private static readonly Dictionary s_speckleKits = new(); - - private static List s_availableTypes = new(); - - private static bool s_initialized; - - /// - /// Local installations store kits in C:\Users\USERNAME\AppData\Roaming\Speckle\Kits - /// Admin/System-wide installations in C:\ProgramData\Speckle\Kits - /// - public static string KitsFolder - { - get => s_kitsFolder ??= SpecklePathProvider.KitsFolderPath; - set => s_kitsFolder = value; - } - - /// - /// Returns a list of all the kits found on this user's device. - /// - public static IEnumerable Kits - { - get - { - Initialize(); - return s_speckleKits.Values.Where(v => v != null); //NOTE: null check here should be unnecessary - } - } - - /// - /// Returns a list of all the types found in all the kits on this user's device. - /// - public static IEnumerable Types - { - get - { - Initialize(); - return s_availableTypes; - } - } - - /// - /// Checks whether a specific kit exists. - /// - /// - /// - public static bool HasKit(string assemblyFullName) - { - Initialize(); - return s_speckleKits.ContainsKey(assemblyFullName); - } - - /// - /// Gets a specific kit. - /// - /// - /// - public static ISpeckleKit GetKit(string assemblyFullName) - { - Initialize(); - return s_speckleKits[assemblyFullName]; - } - - /// - /// Gets the default Speckle provided kit, "Objects". - /// - /// - public static ISpeckleKit GetDefaultKit() - { - Initialize(); - return s_speckleKits.First(kvp => kvp.Value.Name == "Objects").Value; - } - - /// - /// Returns all the kits with potential converters for the software app. - /// - /// - /// - public static IEnumerable GetKitsWithConvertersForApp(string app) - { - foreach (var kit in Kits) - { - if (kit.Converters.Contains(app)) - { - yield return kit; - } - } - } - - /// - /// Tells the kit manager to initialise from a specific location. - /// - /// - public static void Initialize(string kitFolderLocation) - { - if (s_initialized) - { - SpeckleLog.Logger.Error("{objectType} is already initialised", typeof(KitManager)); - throw new SpeckleException( - "The kit manager has already been initialised. Make sure you call this method earlier in your code!" - ); - } - - KitsFolder = kitFolderLocation; - Load(); - s_initialized = true; - } - - #region Private Methods - - private static void Initialize() - { - if (!s_initialized) - { - Load(); - s_initialized = true; - } - } - - private static void Load() - { - SpeckleLog.Logger.Information("Initializing Kit Manager in {KitsFolder}", SpecklePathProvider.KitsFolderPath); - - GetLoadedSpeckleReferencingAssemblies(); - LoadSpeckleReferencingAssemblies(); - - s_availableTypes = s_speckleKits - .Where(kit => kit.Value != null) //Null check should be unnecessary - .SelectMany(kit => kit.Value.Types) - .ToList(); - } - - // recursive search for referenced assemblies - public static List GetReferencedAssemblies() - { - var returnAssemblies = new List(); - var loadedAssemblies = new HashSet(); - var assembliesToCheck = new Queue(); - - assembliesToCheck.Enqueue(Assembly.GetEntryAssembly()); - - while (assembliesToCheck.Count > 0) - { - var assemblyToCheck = assembliesToCheck.Dequeue(); - - if (assemblyToCheck == null) - { - continue; - } - - foreach (var reference in assemblyToCheck.GetReferencedAssemblies()) - { - // filtering out system dlls - if (reference.FullName.StartsWith("System.")) - { - continue; - } - - if (reference.FullName.StartsWith("Microsoft.")) - { - continue; - } - - if (loadedAssemblies.Contains(reference.FullName)) - { - continue; - } - - Assembly assembly; - try - { - assembly = Assembly.Load(reference); - } - catch (SystemException ex) when (ex is IOException or BadImageFormatException) - { - continue; - } - - assembliesToCheck.Enqueue(assembly); - loadedAssemblies.Add(reference.FullName); - returnAssemblies.Add(assembly); - } - } - - return returnAssemblies; - } - - private static void GetLoadedSpeckleReferencingAssemblies() - { - List assemblies = AppDomain.CurrentDomain.GetAssemblies().ToList(); - assemblies.AddRange(GetReferencedAssemblies()); - - foreach (var assembly in assemblies) - { - if (assembly.IsDynamic || assembly.ReflectionOnly) - { - continue; - } - - if (!assembly.IsReferencing(SpeckleAssemblyName)) - { - continue; - } - - if (s_speckleKits.ContainsKey(assembly.FullName)) - { - continue; - } - - var kitClass = GetKitClass(assembly); - if (kitClass == null) - { - continue; - } - - if (Activator.CreateInstance(kitClass) is ISpeckleKit speckleKit) - { - s_speckleKits.Add(assembly.FullName, speckleKit); - } - } - } - - private static void LoadSpeckleReferencingAssemblies() - { - if (!Directory.Exists(KitsFolder)) - { - return; - } - - var directories = Directory.GetDirectories(KitsFolder); - - foreach (var directory in directories) - { - foreach (var assemblyPath in Directory.EnumerateFiles(directory, "*.dll")) - { - var unloadedAssemblyName = SafeGetAssemblyName(assemblyPath); - - if (unloadedAssemblyName == null) - { - continue; - } - - try - { - var assembly = Assembly.LoadFrom(assemblyPath); - var kitClass = GetKitClass(assembly); - if (assembly.IsReferencing(SpeckleAssemblyName) && kitClass != null) - { - if (!s_speckleKits.ContainsKey(assembly.FullName)) - { - if (Activator.CreateInstance(kitClass) is ISpeckleKit speckleKit) - { - s_speckleKits.Add(assembly.FullName, speckleKit); - } - } - } - } - catch (FileLoadException) { } - catch (BadImageFormatException) { } - } - } - } - - private static Type? GetKitClass(Assembly assembly) - { - try - { - var kitClass = assembly - .GetTypes() - .FirstOrDefault(type => - { - return type.GetInterfaces().Any(iface => iface.Name == nameof(ISpeckleKit)); - }); - - return kitClass; - } - catch (ReflectionTypeLoadException) - { - return null; - } - } - - private static AssemblyName? SafeGetAssemblyName(string? assemblyPath) - { - try - { - return AssemblyName.GetAssemblyName(assemblyPath); - } - catch (Exception ex) when (ex is ArgumentException or IOException or BadImageFormatException) - { - return null; - } - } - - #endregion -} - -internal static class AssemblyExtensions -{ - /// - /// Indicates if a given assembly references another which is identified by its name. - /// - /// The assembly which will be probed. - /// The reference assembly name. - /// A boolean value indicating if there is a reference. - public static bool IsReferencing(this Assembly assembly, AssemblyName referenceName) - { - if (AssemblyName.ReferenceMatchesDefinition(assembly.GetName(), referenceName)) - { - return true; - } - - foreach (var referencedAssemblyName in assembly.GetReferencedAssemblies()) - { - if (AssemblyName.ReferenceMatchesDefinition(referencedAssemblyName, referenceName)) - { - return true; - } - } - - return false; - } -} diff --git a/src/Speckle.Core/Models/GraphTraversal/DefaultTraversal.cs b/src/Speckle.Core/Models/GraphTraversal/DefaultTraversal.cs deleted file mode 100644 index 5e965298..00000000 --- a/src/Speckle.Core/Models/GraphTraversal/DefaultTraversal.cs +++ /dev/null @@ -1,209 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using System.Diagnostics.Contracts; -using Speckle.Core.Kits; - -namespace Speckle.Core.Models.GraphTraversal; - -[SuppressMessage( - "Naming", - "CA1708:Identifiers should differ by more than case", - Justification = "Class contains obsolete members that are kept for backwards compatiblity" -)] -public static class DefaultTraversal -{ - public static GraphTraversal CreateTraversalFunc() - { - var convertableRule = TraversalRule - .NewTraversalRule() - .When(b => b.GetType() != typeof(Base)) - .When(HasDisplayValue) - .ContinueTraversing(_ => ElementsPropAliases); - - return new GraphTraversal(convertableRule, s_ignoreResultsRule, DefaultRule.ShouldReturnToOutput(false)); - } - - //These functions are just meant to make the syntax of defining rules less verbose, they are likely to change frequently/be restructured - #region Helper Functions - - //WORKAROUND: ideally, traversal rules would not have Objects specific rules. - private static readonly ITraversalRule s_ignoreResultsRule = TraversalRule - .NewTraversalRule() - .When(o => o.speckle_type.Contains("Objects.Structural.Results")) - .ContinueTraversing(None); - - public static ITraversalBuilderReturn DefaultRule => - TraversalRule.NewTraversalRule().When(_ => true).ContinueTraversing(Members()); - - public static readonly IReadOnlyList ElementsPropAliases = new[] { "elements", "@elements" }; - - [Pure] - public static IEnumerable ElementsAliases(Base _) - { - return ElementsPropAliases; - } - - public static bool HasElements(Base x) - { - return ElementsPropAliases.Any(m => x[m] != null); - } - - public static readonly IReadOnlyList DefinitionPropAliases = new[] { "definition", "@definition" }; - - [Pure] - public static IEnumerable DefinitionAliases(Base _) - { - return DefinitionPropAliases; - } - - public static bool HasDefinition(Base x) - { - return DefinitionPropAliases.Any(m => x[m] != null); - } - - public static readonly IReadOnlyList DisplayValuePropAliases = new[] { "displayValue", "@displayValue" }; - - [Pure] - public static IEnumerable DisplayValueAliases(Base _) - { - return DisplayValuePropAliases; - } - - public static bool HasDisplayValue(Base x) - { - return DisplayValuePropAliases.Any(m => x[m] != null); - } - - public static readonly IReadOnlyList GeometryPropAliases = new[] { "geometry", "@geometry" }; - - [Pure] - public static IEnumerable GeometryAliases(Base _) - { - return GeometryPropAliases; - } - - public static bool HasGeometry(Base x) - { - return GeometryPropAliases.Any(m => x[m] != null); - } - - [Pure] - public static IEnumerable None(Base _) - { - return Enumerable.Empty(); - } - - internal static SelectMembers Members(DynamicBaseMemberType includeMembers = DynamicBase.DEFAULT_INCLUDE_MEMBERS) - { - return x => x.GetMembers(includeMembers).Keys; - } - - public static readonly string[] DisplayValueAndElementsPropAliases = DisplayValuePropAliases - .Concat(ElementsPropAliases) - .ToArray(); - - [Pure] - public static IEnumerable DisplayValueAndElementsAliases(Base _) - { - return DisplayValueAndElementsPropAliases; - } - - #endregion - - #region Legacy function varients - - [Obsolete("Renamed to " + nameof(ElementsPropAliases))] - [SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Obsolete")] - public static IReadOnlyList elementsPropAliases => ElementsPropAliases; - - [Obsolete("Renamed to " + nameof(DisplayValuePropAliases))] - [SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Obsolete")] - public static IReadOnlyList displayValuePropAliases => DisplayValuePropAliases; - - [Obsolete("Renamed to " + nameof(DefinitionPropAliases))] - [SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Obsolete")] - public static IReadOnlyList definitionPropAliases => DefinitionPropAliases; - - [Obsolete("Renamed to " + nameof(GeometryPropAliases))] - [SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Obsolete")] - public static IReadOnlyList geometryPropAliases => GeometryPropAliases; - - [Obsolete("Renamed to " + nameof(DisplayValueAndElementsPropAliases))] - [SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Obsolete")] - [SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "Obsolete")] - public static string[] displayValueAndElementsPropAliases => DisplayValueAndElementsPropAliases; - - /// - /// - /// - /// - [Obsolete($"Consider using {nameof(CreateTraversalFunc)}")] - public static GraphTraversal CreateTraverseFunc(ISpeckleConverter converter) - { - return CreateLegacyTraverseFunc(converter.CanConvertToNative); - } - - /// - /// Legacy traversal rule that was dependent on the converter - /// - /// - /// Treats convertable objects and objects with displayValues as "convertable" such that only elements and dynamic props will be traversed - /// New code should use instead. - /// - /// - /// - [Obsolete($"Consider using {nameof(CreateTraversalFunc)}")] - public static GraphTraversal CreateLegacyTraverseFunc(Func canConvertToNative) - { - var convertableRule = TraversalRule - .NewTraversalRule() - .When(b => canConvertToNative(b)) - .When(HasDisplayValue) - .ContinueTraversing(_ => ElementsPropAliases); - - return new GraphTraversal(convertableRule, s_ignoreResultsRule, DefaultRule); - } - - /// - /// Traverses until finds a convertable object then HALTS deeper traversal - /// - /// - /// The DUI2 Revit connector does traversal, - /// so this traversal is a shallow traversal for directly convertable objects, - /// and a deep traversal for all other types - /// New code should use instead. - /// - /// - /// - [Obsolete($"Consider using {nameof(CreateTraversalFunc)}")] - public static GraphTraversal CreateRevitTraversalFunc(ISpeckleConverter converter) - { - var convertableRule = TraversalRule - .NewTraversalRule() - .When(converter.CanConvertToNative) - .When(HasDisplayValue) - .ContinueTraversing(None); - - return new GraphTraversal(convertableRule, s_ignoreResultsRule, DefaultRule); - } - - /// - /// Traverses until finds a convertable object (or fallback) then traverses members - /// - /// - /// New code should use instead. - /// - /// - /// - [Obsolete($"Consider using {nameof(CreateTraversalFunc)}")] - public static GraphTraversal CreateBIMTraverseFunc(ISpeckleConverter converter) - { - var bimElementRule = TraversalRule - .NewTraversalRule() - .When(converter.CanConvertToNative) - .ContinueTraversing(ElementsAliases); - - return new GraphTraversal(bimElementRule, s_ignoreResultsRule, DefaultRule); - } - - #endregion -} diff --git a/src/Speckle.Core/Serialisation/BaseObjectSerializer.cs b/src/Speckle.Core/Serialisation/BaseObjectSerializer.cs deleted file mode 100644 index ed7fac07..00000000 --- a/src/Speckle.Core/Serialisation/BaseObjectSerializer.cs +++ /dev/null @@ -1,716 +0,0 @@ -#nullable disable -using System.Collections; -using System.Runtime.Serialization; -using Speckle.Core.Helpers; -using Speckle.Core.Logging; -using Speckle.Core.Models; -using Speckle.Core.Serialisation.SerializationUtilities; -using Speckle.Core.Transports; -using Speckle.Newtonsoft.Json; -using Speckle.Newtonsoft.Json.Linq; -using Speckle.Newtonsoft.Json.Serialization; -using Utilities = Speckle.Core.Models.Utilities; - -// ReSharper disable InconsistentNaming -// ReSharper disable UseNegatedPatternInIsExpression -#pragma warning disable IDE0075, IDE1006, IDE0083, CA1051, CA1502, CA1854 - -namespace Speckle.Core.Serialisation; - -/// -/// Json converter that handles base speckle objects. Enables detachment and -/// simultaneous transport (persistence) of objects. -/// -[Obsolete("Use " + nameof(BaseObjectSerializerV2))] -public class BaseObjectSerializer : JsonConverter -{ - /// - /// Property that describes the type of the object. - /// - public string TypeDiscriminator = "speckle_type"; - - public BaseObjectSerializer() - { - ResetAndInitialize(); - } - - public CancellationToken CancellationToken { get; set; } - - /// - /// The sync transport. This transport will be used synchronously. - /// - public ITransport ReadTransport { get; set; } - - /// - /// List of transports to write to. - /// - public List WriteTransports { get; set; } = new(); - - public override bool CanWrite => true; - - public override bool CanRead => true; - - public Action OnProgressAction { get; set; } - - public Action OnErrorAction { get; set; } - - /// - /// Reinitializes the lineage, and other variables that get used during the - /// json writing process. - /// - public void ResetAndInitialize() - { - DetachLineage = new List(); - Lineage = new List(); - RefMinDepthTracker = new Dictionary>(); - OnProgressAction = null; - TotalProcessedCount = 0; - } - - public override bool CanConvert(Type objectType) - { - return true; - } - - #region Read Json - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - if (CancellationToken.IsCancellationRequested) - { - return null; // Check for cancellation - } - - if (reader.TokenType == JsonToken.Null) - { - return null; - } - - // Check if we passed in an array, rather than an object. - // TODO: Test the following branch. It's not used anywhere at the moment, and the default serializer prevents it from - // ever being used (only allows single object serialization) - if (reader.TokenType == JsonToken.StartArray) - { - var list = new List(); - var jarr = JArray.Load(reader); - - foreach (var val in jarr) - { - if (CancellationToken.IsCancellationRequested) - { - return null; // Check for cancellation - } - - var whatever = BaseObjectSerializationUtilities.HandleValue(val, serializer, CancellationToken); - list.Add(whatever as Base); - } - return list; - } - - if (CancellationToken.IsCancellationRequested) - { - return null; // Check for cancellation - } - - var jObject = JObject.Load(reader); - - if (jObject == null) - { - return null; - } - - var objType = jObject.GetValue(TypeDiscriminator); - - // Assume dictionary! - if (objType == null) - { - var dict = new Dictionary(); - - foreach (var val in jObject) - { - if (CancellationToken.IsCancellationRequested) - { - return null; // Check for cancellation - } - - dict[val.Key] = BaseObjectSerializationUtilities.HandleValue(val.Value, serializer, CancellationToken); - } - return dict; - } - - if (CancellationToken.IsCancellationRequested) - { - return null; // Check for cancellation - } - - var discriminator = objType.Value(); - - // Check for references. - if (discriminator == "reference") - { - var id = jObject.GetValue("referencedId").Value(); - - string str = - ReadTransport != null - ? ReadTransport.GetObject(id) - : throw new SpeckleException("Cannot resolve reference, no transport is defined."); - - if (str != null && !string.IsNullOrEmpty(str)) - { - jObject = JObject.Parse(str); - discriminator = jObject.GetValue(TypeDiscriminator).Value(); - } - else - { - throw new SpeckleException("Cannot resolve reference. The provided transport could not find it."); - } - } - - var type = BaseObjectSerializationUtilities.GetType(discriminator); - var obj = existingValue ?? Activator.CreateInstance(type); - - var contract = (JsonDynamicContract)serializer.ContractResolver.ResolveContract(type); - var used = new HashSet(); - - // remove unsettable properties - jObject.Remove(TypeDiscriminator); - jObject.Remove("__closure"); - - if (CancellationToken.IsCancellationRequested) - { - return null; // Check for cancellation - } - - foreach (var jProperty in jObject.Properties()) - { - if (CancellationToken.IsCancellationRequested) - { - return null; // Check for cancellation - } - - if (used.Contains(jProperty.Name)) - { - continue; - } - - used.Add(jProperty.Name); - - // first attempt to find a settable property, otherwise fall back to a dynamic set without type - JsonProperty property = contract.Properties.GetClosestMatchProperty(jProperty.Name); - - if (property != null && property.Writable) - { - if (type == typeof(Abstract) && property.PropertyName == "base") - { - var propertyValue = BaseObjectSerializationUtilities.HandleAbstractOriginalValue( - jProperty.Value, - ((JValue)jObject.GetValue("assemblyQualifiedName")).Value as string - ); - property.ValueProvider.SetValue(obj, propertyValue); - } - else - { - var val = BaseObjectSerializationUtilities.HandleValue( - jProperty.Value, - serializer, - CancellationToken, - property - ); - property.ValueProvider.SetValue(obj, val); - } - } - else - { - // dynamic properties - CallSiteCache.SetValue( - jProperty.Name, - obj, - BaseObjectSerializationUtilities.HandleValue(jProperty.Value, serializer, CancellationToken) - ); - } - } - - if (CancellationToken.IsCancellationRequested) - { - return null; // Check for cancellation - } - - TotalProcessedCount++; - OnProgressAction?.Invoke("DS", 1); - - foreach (var callback in contract.OnDeserializedCallbacks) - { - callback(obj, serializer.Context); - } - - return obj; - } - - #endregion - - #region Write Json Helper Properties - - /// - /// Keeps track of wether current property pointer is marked for detachment. - /// - private List DetachLineage { get; set; } - - /// - /// Keeps track of the hash chain through the object tree. - /// - private List Lineage { get; set; } - - /// - /// Dictionary of object if and its subsequent closure table (a dictionary of hashes and min depth at which they are found). - /// - private Dictionary> RefMinDepthTracker { get; set; } - - public int TotalProcessedCount; - - #endregion - - #region Write Json - - // Keeps track of the actual tree structure of the objects being serialised. - // These tree references will thereafter be stored in the __tree prop. - private void TrackReferenceInTree(string refId) - { - // Help with creating closure table entries. - for (int i = 0; i < Lineage.Count; i++) - { - var parent = Lineage[i]; - - if (!RefMinDepthTracker.ContainsKey(parent)) - { - RefMinDepthTracker[parent] = new Dictionary(); - } - - if (!RefMinDepthTracker[parent].ContainsKey(refId)) - { - RefMinDepthTracker[parent][refId] = Lineage.Count - i; - } - else if (RefMinDepthTracker[parent][refId] > Lineage.Count - i) - { - RefMinDepthTracker[parent][refId] = Lineage.Count - i; - } - } - } - - private bool FirstEntry = true, - FirstEntryWasListOrDict; - - // While this function looks complicated, it's actually quite smooth: - // The important things to remember is that serialization goes depth first: - // The first object to get fully serialised is the first nested one, with - // the parent object being last. - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - writer.Formatting = serializer.Formatting; - if (CancellationToken.IsCancellationRequested) - { - return; // Check for cancellation - } - - ///////////////////////////////////// - // Path one: nulls - ///////////////////////////////////// - - if (value == null) - { - return; - } - - ///////////////////////////////////// - // Path two: primitives (string, bool, int, etc) - ///////////////////////////////////// - - if (value.GetType().IsPrimitive || value is string) - { - FirstEntry = false; - writer.WriteValue(value); - //var t = JToken.FromObject(value); // bypasses this converter as we do not pass in the serializer - //t.WriteTo(writer); - return; - } - - ///////////////////////////////////// - // Path three: Bases - ///////////////////////////////////// - - if (value is Base && !(value is ObjectReference)) - { - if (CancellationToken.IsCancellationRequested) - { - return; // Check for cancellation - } - - var obj = value as Base; - - FirstEntry = false; - //TotalProcessedCount++; - - // Append to lineage tracker - Lineage.Add(Guid.NewGuid().ToString()); - - var jo = new JObject(); - var propertyNames = obj.GetDynamicMemberNames(); - - var contract = (JsonDynamicContract)serializer.ContractResolver.ResolveContract(value.GetType()); - - // Iterate through the object's properties, one by one, checking for ignored ones - foreach (var prop in propertyNames) - { - if (CancellationToken.IsCancellationRequested) - { - return; // Check for cancellation - } - // Ignore properties starting with a double underscore. - if (prop.StartsWith("__")) - { - continue; - } - - if (prop == "id") - { - continue; - } - - var property = contract.Properties.GetClosestMatchProperty(prop); - - // Ignore properties decorated with [JsonIgnore]. - if (property != null && property.Ignored) - { - continue; - } - - // Ignore nulls - object propValue = obj[prop]; - if (propValue == null) - { - continue; - } - - // Check if this property is marked for detachment: either by the presence of "@" at the beginning of the name, or by the presence of a DetachProperty attribute on a typed property. - if (property != null) - { - var detachableAttributes = property.AttributeProvider.GetAttributes(typeof(DetachProperty), true); - if (detachableAttributes.Count > 0) - { - DetachLineage.Add(((DetachProperty)detachableAttributes[0]).Detachable); - } - else - { - DetachLineage.Add(false); - } - - var chunkableAttributes = property.AttributeProvider.GetAttributes(typeof(Chunkable), true); - if (chunkableAttributes.Count > 0) - { - //DetachLineage.Add(true); // NOOPE - serializer.Context = new StreamingContext(StreamingContextStates.Other, chunkableAttributes[0]); - } - else - { - //DetachLineage.Add(false); - serializer.Context = new StreamingContext(); - } - } - else if (prop.StartsWith("@")) // Convention check for dynamically added properties. - { - DetachLineage.Add(true); - - var chunkSyntax = Constants.ChunkPropertyNameRegex; - - if (chunkSyntax.IsMatch(prop)) - { - var match = chunkSyntax.Match(prop); - _ = int.TryParse(match.Groups[match.Groups.Count - 1].Value, out int chunkSize); - serializer.Context = new StreamingContext( - StreamingContextStates.Other, - chunkSize > 0 ? new Chunkable(chunkSize) : new Chunkable() - ); - } - else - { - serializer.Context = new StreamingContext(); - } - } - else - { - DetachLineage.Add(false); - } - - // Set and store a reference, if it is marked as detachable and the transport is not null. - if ( - WriteTransports != null - && WriteTransports.Count != 0 - && propValue is Base - && DetachLineage[DetachLineage.Count - 1] - ) - { - var what = JToken.FromObject(propValue, serializer); // Trigger next. - - if (CancellationToken.IsCancellationRequested) - { - return; // Check for cancellation - } - - if (what == null) - { - return; // HACK: Prevent nulls from borking our serialization on nested schema object refs. (i.e. Line has @SchemaObject, that has ref to line) - } - - var refHash = ((JObject)what).GetValue("id").ToString(); - - var reference = new ObjectReference { referencedId = refHash }; - TrackReferenceInTree(refHash); - jo.Add(prop, JToken.FromObject(reference)); - } - else - { - jo.Add(prop, JToken.FromObject(propValue, serializer)); // Default route - } - - // Pop detach lineage. If you don't get this, remember this thing moves ONLY FORWARD, DEPTH FIRST - DetachLineage.RemoveAt(DetachLineage.Count - 1); - // Refresh the streaming context to remove chunking flag - serializer.Context = new StreamingContext(); - } - - // Check if we actually have any transports present that would warrant a - if ( - WriteTransports != null - && WriteTransports.Count != 0 - && RefMinDepthTracker.ContainsKey(Lineage[Lineage.Count - 1]) - ) - { - jo.Add("__closure", JToken.FromObject(RefMinDepthTracker[Lineage[Lineage.Count - 1]])); - } - - var hash = Utilities.HashString(jo.ToString()); - if (!jo.ContainsKey("id")) - { - jo.Add("id", JToken.FromObject(hash)); - } - - jo.WriteTo(writer); - - if ( - (DetachLineage.Count == 0 || DetachLineage[DetachLineage.Count - 1]) - && WriteTransports != null - && WriteTransports.Count != 0 - ) - { - var objString = jo.ToString(writer.Formatting); - var objId = jo["id"].Value(); - - OnProgressAction?.Invoke("S", 1); - - foreach (var transport in WriteTransports) - { - if (CancellationToken.IsCancellationRequested) - { - continue; // Check for cancellation - } - - transport.SaveObject(objId, objString); - } - } - - // Pop lineage tracker - Lineage.RemoveAt(Lineage.Count - 1); - return; - } - - ///////////////////////////////////// - // Path four: lists/arrays & dicts - ///////////////////////////////////// - - if (CancellationToken.IsCancellationRequested) - { - return; // Check for cancellation - } - - var type = value.GetType(); - - // TODO: List handling and dictionary serialisation handling can be sped up significantly if we first check by their inner type. - // This handles a broader case in which we are, essentially, checking only for object[] or List / Dictionary cases. - // A much faster approach is to check for List, where primitive = string, number, etc. and directly serialize it in full. - // Same goes for dictionaries. - if ( - typeof(IEnumerable).IsAssignableFrom(type) - && !typeof(IDictionary).IsAssignableFrom(type) - && type != typeof(string) - ) - { - if (TotalProcessedCount == 0 && FirstEntry) - { - FirstEntry = false; - FirstEntryWasListOrDict = true; - TotalProcessedCount += 1; - DetachLineage.Add(WriteTransports != null && WriteTransports.Count != 0 ? true : false); - } - - JArray arr = new(); - - // Chunking large lists into manageable parts. - if (DetachLineage[DetachLineage.Count - 1] && serializer.Context.Context is Chunkable chunkInfo) - { - var maxCount = chunkInfo.MaxObjCountPerChunk; - var i = 0; - var chunkList = new List(); - var currChunk = new DataChunk(); - - foreach (var arrValue in (IEnumerable)value) - { - if (i == maxCount) - { - if (currChunk.data.Count != 0) - { - chunkList.Add(currChunk); - } - - currChunk = new DataChunk(); - i = 0; - } - currChunk.data.Add(arrValue); - i++; - } - - if (currChunk.data.Count != 0) - { - chunkList.Add(currChunk); - } - - value = chunkList; - } - - foreach (var arrValue in (IEnumerable)value) - { - if (CancellationToken.IsCancellationRequested) - { - return; // Check for cancellation - } - - if (arrValue == null) - { - continue; - } - - if ( - WriteTransports != null - && WriteTransports.Count != 0 - && arrValue is Base - && DetachLineage[DetachLineage.Count - 1] - ) - { - var what = JToken.FromObject(arrValue, serializer); // Trigger next - - var refHash = ((JObject)what).GetValue("id").ToString(); - - var reference = new ObjectReference { referencedId = refHash }; - TrackReferenceInTree(refHash); - arr.Add(JToken.FromObject(reference)); - } - else - { - arr.Add(JToken.FromObject(arrValue, serializer)); // Default route - } - } - - if (CancellationToken.IsCancellationRequested) - { - return; // Check for cancellation - } - - arr.WriteTo(writer); - - if (DetachLineage.Count == 1 && FirstEntryWasListOrDict) // are we in a list entry point case? - { - DetachLineage.RemoveAt(0); - } - - return; - } - - if (CancellationToken.IsCancellationRequested) - { - return; // Check for cancellation - } - - if (typeof(IDictionary).IsAssignableFrom(type)) - { - if (TotalProcessedCount == 0 && FirstEntry) - { - FirstEntry = false; - FirstEntryWasListOrDict = true; - TotalProcessedCount += 1; - DetachLineage.Add(WriteTransports != null && WriteTransports.Count != 0 ? true : false); - } - var dict = value as IDictionary; - var dictJo = new JObject(); - foreach (DictionaryEntry kvp in dict) - { - if (CancellationToken.IsCancellationRequested) - { - return; // Check for cancellation - } - - if (kvp.Value == null) - { - continue; - } - - JToken jToken; - if ( - WriteTransports != null - && WriteTransports.Count != 0 - && kvp.Value is Base - && DetachLineage[DetachLineage.Count - 1] - ) - { - var what = JToken.FromObject(kvp.Value, serializer); // Trigger next - var refHash = ((JObject)what).GetValue("id").ToString(); - - var reference = new ObjectReference { referencedId = refHash }; - TrackReferenceInTree(refHash); - jToken = JToken.FromObject(reference); - } - else - { - jToken = JToken.FromObject(kvp.Value, serializer); // Default route - } - dictJo.Add(kvp.Key.ToString(), jToken); - } - dictJo.WriteTo(writer); - - if (CancellationToken.IsCancellationRequested) - { - return; // Check for cancellation - } - - if (DetachLineage.Count == 1 && FirstEntryWasListOrDict) // are we in a dictionary entry point case? - { - DetachLineage.RemoveAt(0); - } - - return; - } - - ///////////////////////////////////// - // Path five: everything else (enums?) - ///////////////////////////////////// - - if (CancellationToken.IsCancellationRequested) - { - return; // Check for cancellation - } - - FirstEntry = false; - var lastCall = JToken.FromObject(value); // bypasses this converter as we do not pass in the serializer - lastCall.WriteTo(writer); - } - - #endregion -} -#pragma warning restore IDE0075, IDE1006, IDE0083, CA1051, CA1502, CA1854 diff --git a/src/Speckle.Core/Serialisation/SerializationUtilities/BaseObjectSerializationUtilities.cs b/src/Speckle.Core/Serialisation/SerializationUtilities/BaseObjectSerializationUtilities.cs deleted file mode 100644 index 9b26d7ad..00000000 --- a/src/Speckle.Core/Serialisation/SerializationUtilities/BaseObjectSerializationUtilities.cs +++ /dev/null @@ -1,366 +0,0 @@ -using System.Collections; -using System.Reflection; -using System.Runtime.Serialization; -using Speckle.Core.Kits; -using Speckle.Core.Logging; -using Speckle.Core.Models; -using Speckle.Newtonsoft.Json; -using Speckle.Newtonsoft.Json.Linq; -using Speckle.Newtonsoft.Json.Serialization; - -namespace Speckle.Core.Serialisation.SerializationUtilities; - -internal static class BaseObjectSerializationUtilities -{ - #region Getting Types - - private static Dictionary s_cachedTypes = new(); - - private static readonly Dictionary> s_typeProperties = new(); - - private static readonly Dictionary> s_onDeserializedCallbacks = new(); - - internal static Type GetType(string objFullType) - { - lock (s_cachedTypes) - { - if (s_cachedTypes.TryGetValue(objFullType, out Type? type1)) - { - return type1; - } - - var type = GetAtomicType(objFullType); - s_cachedTypes[objFullType] = type; - return type; - } - } - - internal static Type GetAtomicType(string objFullType) - { - var objectTypes = objFullType.Split(':').Reverse(); - foreach (var typeName in objectTypes) - { - //TODO: rather than getting the type from the first loaded kit that has it, maybe - //we get it from a specific Kit - var type = KitManager.Types.FirstOrDefault(tp => tp.FullName == typeName); - if (type != null) - { - return type; - } - - //To allow for backwards compatibility saving deserialization target types. - //We also check a ".Deprecated" prefixed namespace - string deprecatedTypeName = GetDeprecatedTypeName(typeName); - - var deprecatedType = KitManager.Types.FirstOrDefault(tp => tp.FullName == deprecatedTypeName); - if (deprecatedType != null) - { - return deprecatedType; - } - } - - return typeof(Base); - } - - internal static string GetDeprecatedTypeName(string typeName, string deprecatedSubstring = "Deprecated.") - { - int lastDotIndex = typeName.LastIndexOf('.'); - return typeName.Insert(lastDotIndex + 1, deprecatedSubstring); - } - - internal static Dictionary GetTypeProperties(string objFullType) - { - lock (s_typeProperties) - { - if (s_typeProperties.TryGetValue(objFullType, out Dictionary? value)) - { - return value; - } - - Dictionary ret = new(); - Type type = GetType(objFullType); - PropertyInfo[] properties = type.GetProperties(); - foreach (PropertyInfo prop in properties) - { - ret[prop.Name.ToLower()] = prop; - } - - value = ret; - s_typeProperties[objFullType] = value; - return value; - } - } - - internal static List GetOnDeserializedCallbacks(string objFullType) - { - // return new List(); - lock (s_onDeserializedCallbacks) - { - // System.Runtime.Serialization.Ca - if (s_onDeserializedCallbacks.TryGetValue(objFullType, out List? value)) - { - return value; - } - - List ret = new(); - Type type = GetType(objFullType); - MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); - foreach (MethodInfo method in methods) - { - List onDeserializedAttributes = method - .GetCustomAttributes(true) - .ToList(); - if (onDeserializedAttributes.Count > 0) - { - ret.Add(method); - } - } - - value = ret; - s_onDeserializedCallbacks[objFullType] = value; - return value; - } - } - - internal static Type GetSystemOrSpeckleType(string typeName) - { - var systemType = Type.GetType(typeName); - if (systemType != null) - { - return systemType; - } - - return GetAtomicType(typeName); - } - - /// - /// Flushes kit's (discriminator, type) cache. Useful if you're dynamically loading more kits at runtime, that provide better coverage of what you're deserialising, and it's now somehow poisoned because the higher level types were not originally available. - /// - public static void FlushCachedTypes() - { - lock (s_cachedTypes) - { - s_cachedTypes = new Dictionary(); - } - } - - #endregion - - #region Obsolete -#pragma warning disable CS8602, CA1502 - - private static readonly Dictionary s_cachedAbstractTypes = new(); - - [Obsolete("Only Used by Serializer V1")] - internal static object? HandleAbstractOriginalValue(JToken jToken, string assemblyQualifiedName) - { - if (s_cachedAbstractTypes.TryGetValue(assemblyQualifiedName, out Type? type)) - { - return jToken.ToObject(type); - } - - var pieces = assemblyQualifiedName.Split(',').Select(s => s.Trim()).ToArray(); - - var myAssembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(ass => ass.GetName().Name == pieces[1]); - if (myAssembly == null) - { - throw new SpeckleException("Could not load abstract object's assembly."); - } - - var myType = myAssembly.GetType(pieces[0]); - if (myType == null) - { - throw new SpeckleException("Could not load abstract object's assembly."); - } - - s_cachedAbstractTypes[assemblyQualifiedName] = myType; - - return jToken.ToObject(myType); - } - - [Obsolete("Only used by serializer v1")] - internal static object? HandleValue( - JToken? value, - JsonSerializer serializer, - CancellationToken cancellationToken, - JsonProperty? jsonProperty = null, - string typeDiscriminator = "speckle_type" - ) - { - cancellationToken.ThrowIfCancellationRequested(); - - if (jsonProperty is { PropertyType: null }) - { - throw new ArgumentException($"Expected {nameof(JsonProperty.PropertyType)} to be non-null", nameof(jsonProperty)); - } - - switch (value) - { - case JValue jValue when jsonProperty != null: - return jValue.ToObject(jsonProperty.PropertyType); - case JValue jValue: - return jValue.Value; - // Lists - case JArray array when jsonProperty != null && jsonProperty.PropertyType.GetConstructor(Type.EmptyTypes) != null: - { - var arr = Activator.CreateInstance(jsonProperty.PropertyType); - - var addMethod = arr.GetType().GetMethod(nameof(IList.Add))!; - var hasGenericType = jsonProperty.PropertyType.GenericTypeArguments.Length != 0; - - foreach (var val in array) - { - cancellationToken.ThrowIfCancellationRequested(); - - if (val == null) - { - continue; - } - - var item = HandleValue(val, serializer, cancellationToken); - - if (item is DataChunk chunk) - { - foreach (var dataItem in chunk.data) - { - if (hasGenericType && !jsonProperty.PropertyType.GenericTypeArguments[0].IsInterface) - { - if (jsonProperty.PropertyType.GenericTypeArguments[0].IsAssignableFrom(dataItem.GetType())) - { - addMethod.Invoke(arr, new[] { dataItem }); - } - else - { - addMethod.Invoke( - arr, - new[] { Convert.ChangeType(dataItem, jsonProperty.PropertyType.GenericTypeArguments[0]) } - ); - } - } - else - { - addMethod.Invoke(arr, new[] { dataItem }); - } - } - } - else if (hasGenericType && !jsonProperty.PropertyType.GenericTypeArguments[0].IsInterface) - { - if (jsonProperty.PropertyType.GenericTypeArguments[0].IsAssignableFrom(item.GetType())) - { - addMethod.Invoke(arr, new[] { item }); - } - else - { - addMethod.Invoke( - arr, - new[] { Convert.ChangeType(item, jsonProperty.PropertyType.GenericTypeArguments[0]) } - ); - } - } - else - { - addMethod.Invoke(arr, new[] { item }); - } - } - return arr; - } - case JArray array when jsonProperty != null: - { - var arr = (IList) - Activator.CreateInstance(typeof(List<>).MakeGenericType(jsonProperty.PropertyType.GetElementType())); - - foreach (var val in array) - { - cancellationToken.ThrowIfCancellationRequested(); - - if (val == null) - { - continue; - } - - var item = HandleValue(val, serializer, cancellationToken); - if (item is DataChunk chunk) - { - foreach (var dataItem in chunk.data) - { - if (!jsonProperty.PropertyType.GetElementType()!.IsInterface) - { - arr.Add(Convert.ChangeType(dataItem, jsonProperty.PropertyType.GetElementType()!)); - } - else - { - arr.Add(dataItem); - } - } - } - else - { - if (!jsonProperty.PropertyType.GetElementType()!.IsInterface) - { - arr.Add(Convert.ChangeType(item, jsonProperty.PropertyType.GetElementType()!)); - } - else - { - arr.Add(item); - } - } - } - var actualArr = Array.CreateInstance(jsonProperty.PropertyType.GetElementType()!, arr.Count); - arr.CopyTo(actualArr, 0); - return actualArr; - } - case JArray array: - { - var arr = new List(); - foreach (var val in array) - { - cancellationToken.ThrowIfCancellationRequested(); - - if (val == null) - { - continue; - } - - var item = HandleValue(val, serializer, cancellationToken); - - if (item is DataChunk chunk) - { - arr.AddRange(chunk.data); - } - else - { - arr.Add(item); - } - } - return arr; - } - case JObject jObject when jObject.Property(typeDiscriminator) != null: - return jObject.ToObject(serializer); - case JObject jObject: - { - var dict = - jsonProperty != null - ? Activator.CreateInstance(jsonProperty.PropertyType) as IDictionary - : new Dictionary(); - foreach (var prop in jObject) - { - cancellationToken.ThrowIfCancellationRequested(); - - object key = prop.Key; - if (jsonProperty != null) - { - key = Convert.ChangeType(prop.Key, jsonProperty.PropertyType.GetGenericArguments()[0]); - } - - dict[key] = HandleValue(prop.Value, serializer, cancellationToken); - } - return dict; - } - default: - return null; - } - } -#pragma warning restore CS8602, CA1502 // Dereference of a possibly null reference. - - #endregion -} diff --git a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelBeam.cs b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelBeam.cs index af9fde1b..c6b9a092 100644 --- a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelBeam.cs +++ b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelBeam.cs @@ -1,10 +1,11 @@ -using Objects.Structural.Materials; -using Objects.Structural.Properties.Profiles; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Materials; +using Speckle.Objects.Structural.Properties.Profiles; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.AdvanceSteel; +namespace Speckle.Objects.BuiltElements.AdvanceSteel; +[SpeckleType("Objects.BuiltElements.AdvanceSteel.AsteelBeam")] public class AsteelBeam : Beam, IHasVolume, IHasArea, IAsteelObject { [DetachProperty] diff --git a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelBolt.cs b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelBolt.cs index e474b51a..f5dbe850 100644 --- a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelBolt.cs +++ b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelBolt.cs @@ -1,8 +1,7 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.AdvanceSteel; +namespace Speckle.Objects.BuiltElements.AdvanceSteel; public abstract class AsteelBolt : Base, IAsteelObject { @@ -14,12 +13,14 @@ public abstract class AsteelBolt : Base, IAsteelObject public Base asteelProperties { get; set; } } +[SpeckleType("Objects.BuiltElements.AdvanceSteel.AsteelCircularBolt")] public class AsteelCircularBolt : AsteelBolt { //[SchemaInfo("AsteelCircularBolt", "Creates a Advance Steel circular bolt.", "Advance Steel", "Structure")] public AsteelCircularBolt() { } } +[SpeckleType("Objects.BuiltElements.AdvanceSteel.AsteelRectangularBolt")] public class AsteelRectangularBolt : AsteelBolt { //[SchemaInfo("AsteelRectangularBolt", "Creates a Advance Steel rectangular bolt.", "Advance Steel", "Structure")] diff --git a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelGrating.cs b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelGrating.cs index d0b94c46..32071373 100644 --- a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelGrating.cs +++ b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelGrating.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.AdvanceSteel; +namespace Speckle.Objects.BuiltElements.AdvanceSteel; +[SpeckleType("Objects.BuiltElements.AdvanceSteel.AsteelGrating")] public class AsteelGrating : Base, IAsteelObject { [DetachProperty] diff --git a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelPlate.cs b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelPlate.cs index a8335933..c6c66293 100644 --- a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelPlate.cs +++ b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelPlate.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Structural.Materials; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Materials; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.AdvanceSteel; +namespace Speckle.Objects.BuiltElements.AdvanceSteel; +[SpeckleType("Objects.BuiltElements.AdvanceSteel.AsteelPlate")] public class AsteelPlate : Area, IDisplayValue>, IHasArea, IHasVolume, IAsteelObject { [DetachProperty] diff --git a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelPolyBeam.cs b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelPolyBeam.cs index 8ba194b0..16b62f99 100644 --- a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelPolyBeam.cs +++ b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelPolyBeam.cs @@ -1,5 +1,8 @@ -namespace Objects.BuiltElements.AdvanceSteel; +using Speckle.Sdk.Models; +namespace Speckle.Objects.BuiltElements.AdvanceSteel; + +[SpeckleType("Objects.BuiltElements.AdvanceSteel.AsteelPolyBeam")] public class AsteelPolyBeam : AsteelBeam { //[SchemaInfo("AsteelPolyBeam", "Creates a Advance Steel polybeam.", "Advance Steel", "Structure")] diff --git a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSectionProfile.cs b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSectionProfile.cs index 069a0d30..5ad3ae71 100644 --- a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSectionProfile.cs +++ b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSectionProfile.cs @@ -1,7 +1,8 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.AdvanceSteel; +namespace Speckle.Objects.BuiltElements.AdvanceSteel; +[SpeckleType("Objects.BuiltElements.AdvanceSteel.AsteelSectionProfile")] public class AsteelSectionProfile : Base { public string ProfSectionType { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSectionProfileDB.cs b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSectionProfileDB.cs index cdbf61e7..6603ee60 100644 --- a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSectionProfileDB.cs +++ b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSectionProfileDB.cs @@ -1,5 +1,6 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.AdvanceSteel; +namespace Speckle.Objects.BuiltElements.AdvanceSteel; +[SpeckleType("Objects.BuiltElements.AdvanceSteel.AsteelSectionProfileDB")] public class AsteelSectionProfileDB : Base { } diff --git a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSlab.cs b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSlab.cs index bed8a7c8..2022db80 100644 --- a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSlab.cs +++ b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSlab.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Structural.Materials; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Materials; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.AdvanceSteel; +namespace Speckle.Objects.BuiltElements.AdvanceSteel; +[SpeckleType("Objects.BuiltElements.AdvanceSteel.AsteelSlab")] public class AsteelSlab : Area, IDisplayValue>, IHasArea, IHasVolume, IAsteelObject { [DetachProperty] diff --git a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSpecialPart.cs b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSpecialPart.cs index f05b8155..0fe582c6 100644 --- a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSpecialPart.cs +++ b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelSpecialPart.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.AdvanceSteel; +namespace Speckle.Objects.BuiltElements.AdvanceSteel; +[SpeckleType("Objects.BuiltElements.AdvanceSteel.AsteelSpecialPart")] public class AsteelSpecialPart : Base, IAsteelObject { [DetachProperty] diff --git a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelStraightBeam.cs b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelStraightBeam.cs index 0e548aae..bf337de2 100644 --- a/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelStraightBeam.cs +++ b/src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelStraightBeam.cs @@ -1,5 +1,8 @@ -namespace Objects.BuiltElements.AdvanceSteel; +using Speckle.Sdk.Models; +namespace Speckle.Objects.BuiltElements.AdvanceSteel; + +[SpeckleType("Objects.BuiltElements.AdvanceSteel.AsteelStraightBeam")] public class AsteelStraightBeam : AsteelBeam { //[SchemaInfo("AsteelStraightBeam", "Creates a Advance Steel straightBeam.", "Advance Steel", "Structure")] diff --git a/src/Speckle.Objects/BuiltElements/AdvanceSteel/Enums.cs b/src/Speckle.Objects/BuiltElements/AdvanceSteel/Enums.cs index 42200752..297fb2f6 100644 --- a/src/Speckle.Objects/BuiltElements/AdvanceSteel/Enums.cs +++ b/src/Speckle.Objects/BuiltElements/AdvanceSteel/Enums.cs @@ -1 +1 @@ -namespace Objects.BuiltElements.AdvanceSteel; +namespace Speckle.Objects.BuiltElements.AdvanceSteel; diff --git a/src/Speckle.Objects/BuiltElements/AdvanceSteel/IAsteelObject.cs b/src/Speckle.Objects/BuiltElements/AdvanceSteel/IAsteelObject.cs index c648867c..8cb274d5 100644 --- a/src/Speckle.Objects/BuiltElements/AdvanceSteel/IAsteelObject.cs +++ b/src/Speckle.Objects/BuiltElements/AdvanceSteel/IAsteelObject.cs @@ -1,6 +1,6 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.AdvanceSteel; +namespace Speckle.Objects.BuiltElements.AdvanceSteel; public interface IAsteelObject { diff --git a/src/Speckle.Objects/BuiltElements/Alignment.cs b/src/Speckle.Objects/BuiltElements/Alignment.cs index 476ee520..7bf95c07 100644 --- a/src/Speckle.Objects/BuiltElements/Alignment.cs +++ b/src/Speckle.Objects/BuiltElements/Alignment.cs @@ -1,11 +1,10 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Alignment")] public class Alignment : Base, IDisplayValue { [JsonIgnore, Obsolete("Use curves property")] diff --git a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadBeam.cs b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadBeam.cs index 4964a78b..f65ecf30 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadBeam.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadBeam.cs @@ -1,16 +1,15 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; /* For further informations about given the variables, visit: https://archicadapi.graphisoft.com/documentation/api_beamtype */ +[SpeckleType("Objects.BuiltElements.Archicad.ArchicadBeam")] public class ArchicadBeam : Beam { [SchemaInfo("ArchicadBeam", "Creates an Archicad beam by curve.", "Archicad", "Structure")] @@ -117,6 +116,7 @@ internal set public double? coverFillTransformationYAxisX { get; set; } public double? coverFillTransformationYAxisY { get; set; } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadBeam+BeamSegment")] public class BeamSegment : Base { // Segment override materials diff --git a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadColumn.cs b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadColumn.cs index 59693a90..2d5e91e9 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadColumn.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadColumn.cs @@ -1,16 +1,15 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; /* For further informations about given the variables, visit: https://archicadapi.graphisoft.com/documentation/api_columntype */ +[SpeckleType("Objects.BuiltElements.Archicad.ArchicadColumn")] public class ArchicadColumn : Column { [SchemaInfo("ArchicadColumn", "Creates an Archicad Column by curve.", "Archicad", "Structure")] @@ -123,6 +122,7 @@ internal set public double? coverFillTransformationYAxisX { get; set; } public double? coverFillTransformationYAxisY { get; set; } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadColumn+ColumnSegment")] public class ColumnSegment : Base { // Segment - Veneer attributes diff --git a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadFloor.cs b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadFloor.cs index 734ad06d..e733b5b5 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadFloor.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadFloor.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; /* For further informations about given the variables, visit: https://archicadapi.graphisoft.com/documentation/api_slabtype */ +[SpeckleType("Objects.BuiltElements.Archicad.ArchicadFloor")] public sealed class ArchicadFloor : Floor { // Element base @@ -88,6 +87,7 @@ internal set public string? botMat { get; set; } public bool? materialsChained { get; set; } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadFloor+Visibility")] public class Visibility : Base { public bool? showOnHome { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadLevel.cs b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadLevel.cs index 92f33df8..5b2d4467 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadLevel.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadLevel.cs @@ -1,9 +1,12 @@ -namespace Objects.BuiltElements.Archicad; +using Speckle.Sdk.Models; + +namespace Speckle.Objects.BuiltElements.Archicad; /* For further informations about given the variables, visit: https://archicadapi.graphisoft.com/documentation/api_storytype */ +[SpeckleType("Objects.BuiltElements.Archicad.ArchicadLevel")] public class ArchicadLevel : Level { public short index { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadOpening.cs b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadOpening.cs index 117b072e..91394788 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadOpening.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadOpening.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; +[SpeckleType("Objects.BuiltElements.Archicad.ArchicadOpening")] public class ArchicadOpening : Opening { [SchemaInfo("ArchicadOpening", "Creates an Archicad opening.", "Archicad", "Structure")] diff --git a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadRoof.cs b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadRoof.cs index 6cf965b9..fa9f2b60 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadRoof.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadRoof.cs @@ -1,18 +1,18 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Other; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Geometry; +using Speckle.Objects.Other; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; /* For further informations about given the variables, visit: https://archicadapi.graphisoft.com/documentation/api_shellbasetype */ +[SpeckleType("Objects.BuiltElements.Archicad.ArchicadShellBase")] public class ArchicadShellBase : BuiltElements.Roof { + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadShellBase+Visibility")] public class Visibility : Base { public bool? showOnHome { get; set; } @@ -107,20 +107,24 @@ internal set For further informations about given the variables, visit: https://archicadapi.graphisoft.com/documentation/api_rooftype */ +[SpeckleType("Objects.BuiltElements.Archicad.ArchicadRoof")] public sealed class ArchicadRoof : ArchicadShellBase { + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadRoof+BaseLine")] public class BaseLine : Base { public Point begC { get; set; } public Point endC { get; set; } } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadRoof+RoofLevel")] public class RoofLevel : Base { public double? levelHeight { get; set; } public double? levelAngle { get; set; } } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadRoof+LevelEdge")] public class LevelEdge : Base { public double? edgeLevelAngle { get; set; } @@ -131,6 +135,7 @@ public class LevelEdge : Base public string? angleType { get; set; } } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadRoof+PivotPolyEdge")] public class PivotPolyEdge : Base { public int? nLevelEdgeData { get; set; } @@ -153,8 +158,10 @@ public class PivotPolyEdge : Base For further informations about given the variables, visit: https://archicadapi.graphisoft.com/documentation/api_shelltype */ +[SpeckleType("Objects.BuiltElements.Archicad.ArchicadShell")] public sealed class ArchicadShell : ArchicadShellBase { + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadShell+ShellContourEdgeData")] public class ShellContourEdgeData : Base { public string? sideTypeName { get; set; } @@ -163,6 +170,7 @@ public class ShellContourEdgeData : Base public string? edgeSideMaterial { get; set; } } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadShell+ShellContourData")] public class ShellContourData : Base { public ElementShape? shellContourPoly { get; set; } @@ -202,6 +210,7 @@ public class ShellContourData : Base public string? morphingRuleName { get; set; } // Model + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadShell+BegShapeEdge")] public class BegShapeEdge : Base { public string? begShapeEdgeTrimSideType { get; set; } @@ -210,6 +219,7 @@ public class BegShapeEdge : Base public string? begShapeEdgeType { get; set; } } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadShell+EndShapeEdge")] public class EndShapeEdge : Base { public string? endShapeEdgeTrimSideType { get; set; } @@ -218,6 +228,7 @@ public class EndShapeEdge : Base public string? endShapeEdgeType { get; set; } } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadShell+ExtrudedEdge1")] public class ExtrudedEdge1 : Base { public string? extrudedEdgeTrimSideType1 { get; set; } @@ -226,6 +237,7 @@ public class ExtrudedEdge1 : Base public string? extrudedEdgeType1 { get; set; } } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadShell+ExtrudedEdge2")] public class ExtrudedEdge2 : Base { public string? extrudedEdgeTrimSideType2 { get; set; } @@ -234,6 +246,7 @@ public class ExtrudedEdge2 : Base public string? extrudedEdgeType2 { get; set; } } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadShell+RevolvedEdge1")] public class RevolvedEdge1 : Base { public string? revolvedEdgeTrimSideType1 { get; set; } @@ -242,6 +255,7 @@ public class RevolvedEdge1 : Base public string? revolvedEdgeType1 { get; set; } } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadShell+RevolvedEdge2")] public class RevolvedEdge2 : Base { public string? revolvedEdgeTrimSideType2 { get; set; } @@ -250,6 +264,7 @@ public class RevolvedEdge2 : Base public string? revolvedEdgeType2 { get; set; } } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadShell+RuledEdge1")] public class RuledEdge1 : Base { public string? ruledEdgeTrimSideType1 { get; set; } @@ -258,6 +273,7 @@ public class RuledEdge1 : Base public string? ruledEdgeType1 { get; set; } } + [SpeckleType("Objects.BuiltElements.Archicad.ArchicadShell+RuledEdge2")] public class RuledEdge2 : Base { public string? ruledEdgeTrimSideType2 { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadRoom.cs b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadRoom.cs index 993ba553..c7b865db 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadRoom.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadRoom.cs @@ -1,13 +1,13 @@ -using System.Collections.Generic; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; /* For further informations about given the variables, visit: https://archicadapi.graphisoft.com/documentation/api_zonetype */ +[SpeckleType("Objects.BuiltElements.Archicad.ArchicadRoom")] public class ArchicadRoom : Room { // Element base diff --git a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadWall.cs b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadWall.cs index 30471504..83e81cfb 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/ArchicadWall.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/ArchicadWall.cs @@ -1,16 +1,15 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; /* For further informations about given the variables, visit: https://archicadapi.graphisoft.com/documentation/api_walltype */ +[SpeckleType("Objects.BuiltElements.Archicad.ArchicadWall")] public class ArchicadWall : Wall { [SchemaInfo("ArchicadWall", "Creates an Archicad wall.", "Archicad", "Structure")] diff --git a/src/Speckle.Objects/BuiltElements/Archicad/AssemblySegment.cs b/src/Speckle.Objects/BuiltElements/Archicad/AssemblySegment.cs index b3224562..172c23c2 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/AssemblySegment.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/AssemblySegment.cs @@ -1,7 +1,8 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; +[SpeckleType("Objects.BuiltElements.Archicad.AssemblySegment")] public class AssemblySegment : Base { public bool circleBased { get; set; } @@ -27,6 +28,7 @@ public class AssemblySegment : Base public string buildingMaterial { get; set; } } +[SpeckleType("Objects.BuiltElements.Archicad.AssemblySegmentScheme")] public class AssemblySegmentScheme : Base { public string lengthType { get; set; } @@ -36,6 +38,7 @@ public class AssemblySegmentScheme : Base public double lengthProportion { get; set; } } +[SpeckleType("Objects.BuiltElements.Archicad.AssemblySegmentCut")] public class AssemblySegmentCut : Base { public string cutType { get; set; } @@ -43,6 +46,7 @@ public class AssemblySegmentCut : Base public double customAngle { get; set; } } +[SpeckleType("Objects.BuiltElements.Archicad.Hole")] public class Hole : Base { public string holeType { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Archicad/Classification.cs b/src/Speckle.Objects/BuiltElements/Archicad/Classification.cs index ef78cd14..b4fff6cf 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/Classification.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/Classification.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; +[SpeckleType("Objects.BuiltElements.Archicad.Classification")] public class Classification : Base { public Classification() { } diff --git a/src/Speckle.Objects/BuiltElements/Archicad/ComponentProperties.cs b/src/Speckle.Objects/BuiltElements/Archicad/ComponentProperties.cs index 8183626f..be0f99ae 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/ComponentProperties.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/ComponentProperties.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; +[SpeckleType("Objects.BuiltElements.Archicad.ComponentProperties")] public class ComponentProperties : Base { public ComponentProperties() { } diff --git a/src/Speckle.Objects/BuiltElements/Archicad/DirectShape.cs b/src/Speckle.Objects/BuiltElements/Archicad/DirectShape.cs index 8ae08ece..8806440e 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/DirectShape.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/DirectShape.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; +[SpeckleType("Objects.BuiltElements.Archicad.DirectShape")] public class DirectShape : Base { public DirectShape() { } diff --git a/src/Speckle.Objects/BuiltElements/Archicad/ElementShape.cs b/src/Speckle.Objects/BuiltElements/Archicad/ElementShape.cs index cd78ab47..257b27e4 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/ElementShape.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/ElementShape.cs @@ -1,12 +1,12 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Primitive; -using Speckle.Core.Kits; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Geometry; +using Speckle.Objects.Primitive; +using Speckle.Sdk.Common; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; +[SpeckleType("Objects.BuiltElements.Archicad.ElementShape")] public sealed class ElementShape : Base { public ElementShape() { } @@ -24,6 +24,7 @@ public ElementShape(Polyline contourPolyline, List? holePolylines = nu /// /// This class is only used for Archicad interop /// + [SpeckleType("Objects.BuiltElements.Archicad.ElementShape+PolylineSegment")] public sealed class PolylineSegment : Base, ICurve { public PolylineSegment() { } @@ -49,7 +50,8 @@ public PolylineSegment(Point startPoint, Point endPoint, double? arcAngle = null /// /// This class is only used for Archicad interop - /// + /// > + [SpeckleType("Objects.BuiltElements.Archicad.ElementShape+Polyline")] public sealed class Polyline : Base, ICurve { public Polyline() { } diff --git a/src/Speckle.Objects/BuiltElements/Archicad/Fenestration.cs b/src/Speckle.Objects/BuiltElements/Archicad/Fenestration.cs index ce262f92..8be46959 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/Fenestration.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/Fenestration.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; +[SpeckleType("Objects.BuiltElements.Archicad.ArchicadFenestration")] public class ArchicadFenestration : Base, IDisplayValue> { public string parentApplicationId { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Archicad/Property.cs b/src/Speckle.Objects/BuiltElements/Archicad/Property.cs index d7682bce..387d35cb 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/Property.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/Property.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; +[SpeckleType("Objects.BuiltElements.Archicad.Property")] public class Property : Base { public Property() { } diff --git a/src/Speckle.Objects/BuiltElements/Archicad/PropertyGroup.cs b/src/Speckle.Objects/BuiltElements/Archicad/PropertyGroup.cs index 4eb949cf..66d0023f 100644 --- a/src/Speckle.Objects/BuiltElements/Archicad/PropertyGroup.cs +++ b/src/Speckle.Objects/BuiltElements/Archicad/PropertyGroup.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Archicad; +namespace Speckle.Objects.BuiltElements.Archicad; +[SpeckleType("Objects.BuiltElements.Archicad.PropertyGroup")] public class PropertyGroup : Base { public PropertyGroup() { } diff --git a/src/Speckle.Objects/BuiltElements/Area.cs b/src/Speckle.Objects/BuiltElements/Area.cs index 9305f873..85689abb 100644 --- a/src/Speckle.Objects/BuiltElements/Area.cs +++ b/src/Speckle.Objects/BuiltElements/Area.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Area")] public class Area : Base, IHasArea, IHasVolume, IDisplayValue> { public Area() { } diff --git a/src/Speckle.Objects/BuiltElements/Baseline.cs b/src/Speckle.Objects/BuiltElements/Baseline.cs index a78fc9b0..3a97c8f9 100644 --- a/src/Speckle.Objects/BuiltElements/Baseline.cs +++ b/src/Speckle.Objects/BuiltElements/Baseline.cs @@ -1,7 +1,7 @@ -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; public abstract class Baseline : Base { diff --git a/src/Speckle.Objects/BuiltElements/Beam.cs b/src/Speckle.Objects/BuiltElements/Beam.cs index d8689216..fe825203 100644 --- a/src/Speckle.Objects/BuiltElements/Beam.cs +++ b/src/Speckle.Objects/BuiltElements/Beam.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Beam")] public class Beam : Base, IDisplayValue> { public Beam() { } diff --git a/src/Speckle.Objects/BuiltElements/Brace.cs b/src/Speckle.Objects/BuiltElements/Brace.cs index c8a90447..c3f48f56 100644 --- a/src/Speckle.Objects/BuiltElements/Brace.cs +++ b/src/Speckle.Objects/BuiltElements/Brace.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Brace")] public class Brace : Base, IDisplayValue> { public Brace() { } diff --git a/src/Speckle.Objects/BuiltElements/CableTray.cs b/src/Speckle.Objects/BuiltElements/CableTray.cs index f567fc18..e9da6957 100644 --- a/src/Speckle.Objects/BuiltElements/CableTray.cs +++ b/src/Speckle.Objects/BuiltElements/CableTray.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.CableTray")] public class CableTray : Base, IDisplayValue> { public ICurve baseCurve { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Ceiling.cs b/src/Speckle.Objects/BuiltElements/Ceiling.cs index b88c9264..6d2232a8 100644 --- a/src/Speckle.Objects/BuiltElements/Ceiling.cs +++ b/src/Speckle.Objects/BuiltElements/Ceiling.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Ceiling")] public class Ceiling : Base, IDisplayValue> { public Ceiling() { } diff --git a/src/Speckle.Objects/BuiltElements/Civil/CivilAlignment.cs b/src/Speckle.Objects/BuiltElements/Civil/CivilAlignment.cs index c0be779e..d3f5a76b 100644 --- a/src/Speckle.Objects/BuiltElements/Civil/CivilAlignment.cs +++ b/src/Speckle.Objects/BuiltElements/Civil/CivilAlignment.cs @@ -1,5 +1,8 @@ -namespace Objects.BuiltElements.Civil; +using Speckle.Sdk.Models; +namespace Speckle.Objects.BuiltElements.Civil; + +[SpeckleType("Objects.BuiltElements.Civil.CivilAlignment")] public class CivilAlignment : Alignment { public string type { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Civil/CivilAppliedAssembly.cs b/src/Speckle.Objects/BuiltElements/Civil/CivilAppliedAssembly.cs index f490c643..3a86da7f 100644 --- a/src/Speckle.Objects/BuiltElements/Civil/CivilAppliedAssembly.cs +++ b/src/Speckle.Objects/BuiltElements/Civil/CivilAppliedAssembly.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Civil; +namespace Speckle.Objects.BuiltElements.Civil; +[SpeckleType("Objects.BuiltElements.Civil.CivilAppliedAssembly")] public class CivilAppliedAssembly : Base { public CivilAppliedAssembly() { } diff --git a/src/Speckle.Objects/BuiltElements/Civil/CivilAppliedSubassembly.cs b/src/Speckle.Objects/BuiltElements/Civil/CivilAppliedSubassembly.cs index f4beb7a3..e15771fa 100644 --- a/src/Speckle.Objects/BuiltElements/Civil/CivilAppliedSubassembly.cs +++ b/src/Speckle.Objects/BuiltElements/Civil/CivilAppliedSubassembly.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Other.Civil; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Other.Civil; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Civil; +namespace Speckle.Objects.BuiltElements.Civil; +[SpeckleType("Objects.BuiltElements.Civil.CivilAppliedSubassembly")] public class CivilAppliedSubassembly : Base { public CivilAppliedSubassembly() { } diff --git a/src/Speckle.Objects/BuiltElements/Civil/CivilBaseline.cs b/src/Speckle.Objects/BuiltElements/Civil/CivilBaseline.cs index 826ef8df..5e6f2220 100644 --- a/src/Speckle.Objects/BuiltElements/Civil/CivilBaseline.cs +++ b/src/Speckle.Objects/BuiltElements/Civil/CivilBaseline.cs @@ -1,7 +1,8 @@ -using System.Collections.Generic; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Civil; +namespace Speckle.Objects.BuiltElements.Civil; +[SpeckleType("Objects.BuiltElements.Civil.CivilBaseline")] public class CivilBaseline : Baseline { public CivilBaseline() { } diff --git a/src/Speckle.Objects/BuiltElements/Civil/CivilBaselineRegion.cs b/src/Speckle.Objects/BuiltElements/Civil/CivilBaselineRegion.cs index 5aabffd3..c163ba7a 100644 --- a/src/Speckle.Objects/BuiltElements/Civil/CivilBaselineRegion.cs +++ b/src/Speckle.Objects/BuiltElements/Civil/CivilBaselineRegion.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Civil; +namespace Speckle.Objects.BuiltElements.Civil; +[SpeckleType("Objects.BuiltElements.Civil.CivilBaselineRegion")] public class CivilBaselineRegion : Base { public CivilBaselineRegion() { } diff --git a/src/Speckle.Objects/BuiltElements/Civil/CivilCalculatedLink.cs b/src/Speckle.Objects/BuiltElements/Civil/CivilCalculatedLink.cs index aa0bc949..7b937b78 100644 --- a/src/Speckle.Objects/BuiltElements/Civil/CivilCalculatedLink.cs +++ b/src/Speckle.Objects/BuiltElements/Civil/CivilCalculatedLink.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Civil; +namespace Speckle.Objects.BuiltElements.Civil; +[SpeckleType("Objects.BuiltElements.Civil.CivilCalculatedLink")] public class CivilCalculatedLink : Base, ICivilCalculatedObject { public CivilCalculatedLink() { } diff --git a/src/Speckle.Objects/BuiltElements/Civil/CivilCalculatedPoint.cs b/src/Speckle.Objects/BuiltElements/Civil/CivilCalculatedPoint.cs index c6ed147b..97f875d8 100644 --- a/src/Speckle.Objects/BuiltElements/Civil/CivilCalculatedPoint.cs +++ b/src/Speckle.Objects/BuiltElements/Civil/CivilCalculatedPoint.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Civil; +namespace Speckle.Objects.BuiltElements.Civil; +[SpeckleType("Objects.BuiltElements.Civil.CivilCalculatedPoint")] public class CivilCalculatedPoint : Base, ICivilCalculatedObject { public CivilCalculatedPoint() { } diff --git a/src/Speckle.Objects/BuiltElements/Civil/CivilCalculatedShape.cs b/src/Speckle.Objects/BuiltElements/Civil/CivilCalculatedShape.cs index 1e6a3fb7..8ad907fe 100644 --- a/src/Speckle.Objects/BuiltElements/Civil/CivilCalculatedShape.cs +++ b/src/Speckle.Objects/BuiltElements/Civil/CivilCalculatedShape.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Civil; +namespace Speckle.Objects.BuiltElements.Civil; +[SpeckleType("Objects.BuiltElements.Civil.CivilCalculatedShape")] public class CivilCalculatedShape : Base, ICivilCalculatedObject { public CivilCalculatedShape() { } diff --git a/src/Speckle.Objects/BuiltElements/Civil/CivilProfile.cs b/src/Speckle.Objects/BuiltElements/Civil/CivilProfile.cs index 53ff30c2..44f0cb7f 100644 --- a/src/Speckle.Objects/BuiltElements/Civil/CivilProfile.cs +++ b/src/Speckle.Objects/BuiltElements/Civil/CivilProfile.cs @@ -1,8 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Civil; +namespace Speckle.Objects.BuiltElements.Civil; +[SpeckleType("Objects.BuiltElements.Civil.CivilProfile")] public class CivilProfile : Profile { public string type { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Column.cs b/src/Speckle.Objects/BuiltElements/Column.cs index 3b4d4055..0408b020 100644 --- a/src/Speckle.Objects/BuiltElements/Column.cs +++ b/src/Speckle.Objects/BuiltElements/Column.cs @@ -1,11 +1,10 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Column")] public class Column : Base, IDisplayValue> { public Column() { } diff --git a/src/Speckle.Objects/BuiltElements/Conduit.cs b/src/Speckle.Objects/BuiltElements/Conduit.cs index aaa908e2..338d8c85 100644 --- a/src/Speckle.Objects/BuiltElements/Conduit.cs +++ b/src/Speckle.Objects/BuiltElements/Conduit.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Conduit")] public class Conduit : Base, IDisplayValue> { public ICurve baseCurve { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Duct.cs b/src/Speckle.Objects/BuiltElements/Duct.cs index 6ef56bbc..ec6885ff 100644 --- a/src/Speckle.Objects/BuiltElements/Duct.cs +++ b/src/Speckle.Objects/BuiltElements/Duct.cs @@ -1,12 +1,11 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Duct")] public class Duct : Base, IDisplayValue> { public Duct() { } diff --git a/src/Speckle.Objects/BuiltElements/Featureline.cs b/src/Speckle.Objects/BuiltElements/Featureline.cs index 3033d75e..026e97f2 100644 --- a/src/Speckle.Objects/BuiltElements/Featureline.cs +++ b/src/Speckle.Objects/BuiltElements/Featureline.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Featureline")] public class Featureline : Base, IDisplayValue> { /// diff --git a/src/Speckle.Objects/BuiltElements/Floor.cs b/src/Speckle.Objects/BuiltElements/Floor.cs index 80ae0dde..f03af878 100644 --- a/src/Speckle.Objects/BuiltElements/Floor.cs +++ b/src/Speckle.Objects/BuiltElements/Floor.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Floor")] public class Floor : Base, IDisplayValue> { public Floor() { } diff --git a/src/Speckle.Objects/BuiltElements/GridLine.cs b/src/Speckle.Objects/BuiltElements/GridLine.cs index c6fb7e01..62f50263 100644 --- a/src/Speckle.Objects/BuiltElements/GridLine.cs +++ b/src/Speckle.Objects/BuiltElements/GridLine.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.GridLine")] public class GridLine : Base, IDisplayValue> { public GridLine() { } diff --git a/src/Speckle.Objects/BuiltElements/Level.cs b/src/Speckle.Objects/BuiltElements/Level.cs index 1eb13621..6d066cec 100644 --- a/src/Speckle.Objects/BuiltElements/Level.cs +++ b/src/Speckle.Objects/BuiltElements/Level.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Level")] public class Level : Base { //public List elements { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Network.cs b/src/Speckle.Objects/BuiltElements/Network.cs index d20d6412..6c1a7af1 100644 --- a/src/Speckle.Objects/BuiltElements/Network.cs +++ b/src/Speckle.Objects/BuiltElements/Network.cs @@ -1,10 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; /// /// Represents graph connections between built elements objects @@ -13,6 +10,7 @@ namespace Objects.BuiltElements; /// Network may need to be created first in native applications before they are linked. /// [Obsolete("Networks are no longer used in any connector to assemble MEP systems.")] +[SpeckleType("Objects.BuiltElements.Network")] public class Network : Base { public Network() { } @@ -31,6 +29,7 @@ public Network() { } } [Obsolete("Networks are no longer used in any connector to assemble MEP systems.")] +[SpeckleType("Objects.BuiltElements.NetworkElement")] public class NetworkElement : Base { public NetworkElement() { } @@ -64,6 +63,7 @@ public NetworkElement() { } } [Obsolete("Networks are no longer used in any connector to assemble MEP systems.")] +[SpeckleType("Objects.BuiltElements.NetworkLink")] public class NetworkLink : Base { public NetworkLink() { } diff --git a/src/Speckle.Objects/BuiltElements/Opening.cs b/src/Speckle.Objects/BuiltElements/Opening.cs index 85985a33..ae7cda43 100644 --- a/src/Speckle.Objects/BuiltElements/Opening.cs +++ b/src/Speckle.Objects/BuiltElements/Opening.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Opening")] public class Opening : Base { public Opening() { } diff --git a/src/Speckle.Objects/BuiltElements/Pipe.cs b/src/Speckle.Objects/BuiltElements/Pipe.cs index 7c6bf1d8..d4cf7b11 100644 --- a/src/Speckle.Objects/BuiltElements/Pipe.cs +++ b/src/Speckle.Objects/BuiltElements/Pipe.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Pipe")] public class Pipe : Base, IDisplayValue> { public Pipe() { } diff --git a/src/Speckle.Objects/BuiltElements/Profile.cs b/src/Speckle.Objects/BuiltElements/Profile.cs index 3f4be956..18ea60b5 100644 --- a/src/Speckle.Objects/BuiltElements/Profile.cs +++ b/src/Speckle.Objects/BuiltElements/Profile.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Profile")] public class Profile : Base, IDisplayValue { public List curves { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Rebar.cs b/src/Speckle.Objects/BuiltElements/Rebar.cs index 40348472..94d54603 100644 --- a/src/Speckle.Objects/BuiltElements/Rebar.cs +++ b/src/Speckle.Objects/BuiltElements/Rebar.cs @@ -1,9 +1,7 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; /// /// A reinforcement bar group comprised of reinforcing bars of the same type and shape. @@ -11,7 +9,7 @@ namespace Objects.BuiltElements; /// /// This class is not suitable for freeform rebar, which can have multiple shapes. /// -public class RebarGroup : Base, IHasVolume, IDisplayValue> +public abstract class RebarGroup : Base, IHasVolume, IDisplayValue> where T : RebarShape { public RebarGroup() { } @@ -81,6 +79,7 @@ public RebarGroup() { } /// /// The shape describing the geometry and geometry parameters of a reinforcing bar /// +[SpeckleType("Objects.BuiltElements.RebarShape")] public class RebarShape : Base { public RebarShape() { } @@ -111,6 +110,7 @@ public RebarShape() { } public string units { get; set; } } +[SpeckleType("Objects.BuiltElements.RebarHook")] public class RebarHook : Base { public RebarHook() { } @@ -144,6 +144,7 @@ public enum RebarType #region Obsolete [Obsolete("Deprecated in 2.17: Use the RebarGroup class instead")] +[SpeckleType("Objects.BuiltElements.Rebar")] public class Rebar : Base, IHasVolume, IDisplayValue> { public List curves { get; set; } = new(); diff --git a/src/Speckle.Objects/BuiltElements/Revit/AdaptiveComponent.cs b/src/Speckle.Objects/BuiltElements/Revit/AdaptiveComponent.cs index e06fb4ad..bf2ad3ba 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/AdaptiveComponent.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/AdaptiveComponent.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.AdaptiveComponent")] public class AdaptiveComponent : Base, IDisplayValue> { public AdaptiveComponent() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/BuildingPad.cs b/src/Speckle.Objects/BuiltElements/Revit/BuildingPad.cs index 364a92b4..90854a2d 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/BuildingPad.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/BuildingPad.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.BuildingPad")] public class BuildingPad : Base, IDisplayValue> { public ICurve outline { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Revit/Curve/ModelCurves.cs b/src/Speckle.Objects/BuiltElements/Revit/Curve/ModelCurves.cs index b0f45848..5e56d80c 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/Curve/ModelCurves.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/Curve/ModelCurves.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit.Curve; +namespace Speckle.Objects.BuiltElements.Revit.Curve; +[SpeckleType("Objects.BuiltElements.Revit.Curve.ModelCurve")] public class ModelCurve : Base { public ModelCurve() { } @@ -25,6 +25,7 @@ public ModelCurve([SchemaMainParam] ICurve baseCurve, string lineStyle, List? par public string units { get; set; } } +[SpeckleType("Objects.BuiltElements.Revit.Curve.SpaceSeparationLine")] public class SpaceSeparationLine : Base { public SpaceSeparationLine() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/DirectShape.cs b/src/Speckle.Objects/BuiltElements/Revit/DirectShape.cs index aa103100..1f386520 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/DirectShape.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/DirectShape.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.DirectShape")] public class DirectShape : Base, IDisplayValue> { public DirectShape() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/Enums.cs b/src/Speckle.Objects/BuiltElements/Revit/Enums.cs index 38fa8c06..6be06571 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/Enums.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/Enums.cs @@ -1,4 +1,4 @@ -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; //This is an enum so that we can easily create a dropdown in GH for schema builder //NOTE: if edited the list in Objects.Converter.Revit.Categories should be updated too diff --git a/src/Speckle.Objects/BuiltElements/Revit/FamilyInstance.cs b/src/Speckle.Objects/BuiltElements/Revit/FamilyInstance.cs index 62a2242b..cb4035bd 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/FamilyInstance.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/FamilyInstance.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.FamilyInstance")] public class FamilyInstance : Base, IDisplayValue> { public FamilyInstance() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/FreeformElement.cs b/src/Speckle.Objects/BuiltElements/Revit/FreeformElement.cs index a94eb7f9..6ba44237 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/FreeformElement.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/FreeformElement.cs @@ -1,14 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.FreeformElement")] public class FreeformElement : Base, IDisplayValue> { public FreeformElement() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/Interfaces/IHasMEPConnectors.cs b/src/Speckle.Objects/BuiltElements/Revit/Interfaces/IHasMEPConnectors.cs index 664aba86..5d12fe07 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/Interfaces/IHasMEPConnectors.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/Interfaces/IHasMEPConnectors.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; - -namespace Objects.BuiltElements.Revit.Interfaces; +namespace Speckle.Objects.BuiltElements.Revit.Interfaces; public interface IHasMEPConnectors { diff --git a/src/Speckle.Objects/BuiltElements/Revit/MEPFamilyInstance.cs b/src/Speckle.Objects/BuiltElements/Revit/MEPFamilyInstance.cs index f90538ec..0e522f1b 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/MEPFamilyInstance.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/MEPFamilyInstance.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.BuiltElements.Revit.Interfaces; -using Objects.Other.Revit; -using Speckle.Core.Models; +using Speckle.Objects.BuiltElements.Revit.Interfaces; +using Speckle.Objects.Other.Revit; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitMEPFamilyInstance")] public class RevitMEPFamilyInstance : RevitInstance, IHasMEPConnectors { public string RevitPartType { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Revit/Parameter.cs b/src/Speckle.Objects/BuiltElements/Revit/Parameter.cs index 864ac646..0f71131d 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/Parameter.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/Parameter.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.Parameter")] public class Parameter : Base { public Parameter() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/ParameterUpdater.cs b/src/Speckle.Objects/BuiltElements/Revit/ParameterUpdater.cs index 7c50e1b1..0f7e86b8 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/ParameterUpdater.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/ParameterUpdater.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.ParameterUpdater")] public class ParameterUpdater : Base { [SchemaInfo("ParameterUpdater", "Updates parameters on a Revit element by id", "Revit", "Families")] diff --git a/src/Speckle.Objects/BuiltElements/Revit/ProjectInfo.cs b/src/Speckle.Objects/BuiltElements/Revit/ProjectInfo.cs index 3beef64e..815239b0 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/ProjectInfo.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/ProjectInfo.cs @@ -1,7 +1,9 @@ -using Objects.Organization; +using Speckle.Objects.Organization; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.ProjectInfo")] public class ProjectInfo : BIMModelInfo { public string author { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitBeam.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitBeam.cs index 6d7859e3..aac5875e 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitBeam.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitBeam.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitBeam")] public class RevitBeam : Beam { public RevitBeam() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitBrace.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitBrace.cs index ce5966af..d4b0a9e8 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitBrace.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitBrace.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitBrace")] public class RevitBrace : Brace { public RevitBrace() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitCableTray.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitCableTray.cs index 0b7b4852..b217d24e 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitCableTray.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitCableTray.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.BuiltElements.Revit.Interfaces; -using Speckle.Core.Models; +using Speckle.Objects.BuiltElements.Revit.Interfaces; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitCableTray")] public class RevitCableTray : CableTray, IHasMEPConnectors { public string family { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitCeiling.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitCeiling.cs index 874ca2ef..9e9fce06 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitCeiling.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitCeiling.cs @@ -1,11 +1,10 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitCeiling")] public class RevitCeiling : Ceiling { public RevitCeiling() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitColumn.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitColumn.cs index d374425c..24a9c5a1 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitColumn.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitColumn.cs @@ -1,12 +1,11 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitColumn")] public class RevitColumn : Column { public RevitColumn() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitConduit.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitConduit.cs index 6b4acfab..3e488c1e 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitConduit.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitConduit.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.BuiltElements.Revit.Interfaces; -using Speckle.Core.Models; +using Speckle.Objects.BuiltElements.Revit.Interfaces; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitConduit")] public class RevitConduit : Conduit, IHasMEPConnectors { public string family { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitCurtainWallPanel.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitCurtainWallPanel.cs index 71fbefcd..56813834 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitCurtainWallPanel.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitCurtainWallPanel.cs @@ -1,3 +1,6 @@ -namespace Objects.BuiltElements.Revit; +using Speckle.Sdk.Models; +namespace Speckle.Objects.BuiltElements.Revit; + +[SpeckleType("Objects.BuiltElements.Revit.RevitCurtainWallPanel")] public class RevitCurtainWallPanel : RevitElement { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitDuct.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitDuct.cs index 15014664..de81f74f 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitDuct.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitDuct.cs @@ -1,13 +1,12 @@ -using System; -using System.Collections.Generic; -using Objects.BuiltElements.Revit.Interfaces; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.BuiltElements.Revit.Interfaces; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitDuct")] public class RevitDuct : Duct, IHasMEPConnectors { public RevitDuct() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitElement.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitElement.cs index 502428fd..fd498ffb 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitElement.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitElement.cs @@ -1,12 +1,12 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; /// /// A generic Revit element for which we don't have direct conversions /// +[SpeckleType("Objects.BuiltElements.Revit.RevitElement")] public class RevitElement : Base, IDisplayValue> { public string family { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitElementType.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitElementType.cs index 2912b02e..42e97636 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitElementType.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitElementType.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitElementType")] public class RevitElementType : Base { public string family { get; set; } @@ -13,6 +13,7 @@ public class RevitElementType : Base public string category { get; set; } } +[SpeckleType("Objects.BuiltElements.Revit.RevitMepElementType")] public class RevitMepElementType : RevitElementType { public string shape { get; set; } @@ -21,6 +22,7 @@ public class RevitMepElementType : RevitElementType /// /// Represents the FamilySymbol subclass of ElementType in Revit /// +[SpeckleType("Objects.BuiltElements.Revit.RevitSymbolElementType")] public class RevitSymbolElementType : RevitElementType, IDisplayValue> { /// diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitFloor.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitFloor.cs index 35baa3d8..842d9e0d 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitFloor.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitFloor.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitFloor")] public class RevitFloor : Floor { public RevitFloor() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitLevel.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitLevel.cs index a3c8c7ce..d04e2113 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitLevel.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitLevel.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitLevel")] public class RevitLevel : Level { public RevitLevel() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitMEPConnector.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitMEPConnector.cs index 8032ef22..cdeab8ce 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitMEPConnector.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitMEPConnector.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitMEPConnector")] public class RevitMEPConnector : Base { public double angle { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitNetwork.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitNetwork.cs index 16cfdadb..4394faa4 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitNetwork.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitNetwork.cs @@ -1,11 +1,12 @@ -using System; -using Objects.Geometry; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; [Obsolete( "Networks are no longer used to assemble MEP systems in Revit. See the RevitCommitBuilder for MEP systems conversion." )] +[SpeckleType("Objects.BuiltElements.Revit.RevitNetworkElement")] public class RevitNetworkElement : NetworkElement { public RevitNetworkElement() { } @@ -27,6 +28,7 @@ public RevitNetworkElement() { } [Obsolete( "Networks are no longer used to assemble MEP systems in Revit. See the RevitCommitBuilder for MEP systems conversion." )] +[SpeckleType("Objects.BuiltElements.Revit.RevitNetworkLink")] public class RevitNetworkLink : NetworkLink { public double height { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitOpening.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitOpening.cs index 5a38276e..94f617a5 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitOpening.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitOpening.cs @@ -1,21 +1,23 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Logging; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk; +using Speckle.Sdk.Host; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitOpening")] public class RevitOpening : Opening { public Base? parameters { get; set; } public string elementId { get; set; } } +[SpeckleType("Objects.BuiltElements.Revit.RevitVerticalOpening")] public class RevitVerticalOpening : RevitOpening { } +[SpeckleType("Objects.BuiltElements.Revit.RevitWallOpening")] public class RevitWallOpening : RevitOpening { public RevitWallOpening() { } @@ -56,6 +58,7 @@ public RevitWallOpening(Polyline outline, RevitWall? host = null) public RevitWall? host { get; set; } } +[SpeckleType("Objects.BuiltElements.Revit.RevitShaft")] public class RevitShaft : RevitOpening { public RevitShaft() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitPipe.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitPipe.cs index 6084bd61..393a4551 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitPipe.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitPipe.cs @@ -1,12 +1,12 @@ -using System.Collections.Generic; -using Objects.BuiltElements.Revit.Interfaces; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.BuiltElements.Revit.Interfaces; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitPipe")] public class RevitPipe : Pipe, IHasMEPConnectors { public RevitPipe() { } @@ -43,6 +43,7 @@ public RevitPipe( public List Connectors { get; set; } = new(); } +[SpeckleType("Objects.BuiltElements.Revit.RevitFlexPipe")] public class RevitFlexPipe : RevitPipe { public RevitFlexPipe() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitRailing.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitRailing.cs index 8a221fba..997205f5 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitRailing.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitRailing.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitRailing")] public class RevitRailing : Base, IDisplayValue> { public RevitRailing() { } @@ -35,6 +35,7 @@ public RevitRailing(string type, [SchemaMainParam] Polycurve baseCurve, Level le // Used only to transfer parameters of the top railing // its display mesh will live in the main railing element +[SpeckleType("Objects.BuiltElements.Revit.RevitTopRail")] public class RevitTopRail : Base { //public string family { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitRebar.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitRebar.cs index 801f2abd..f542496c 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitRebar.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitRebar.cs @@ -1,11 +1,10 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitRebarGroup")] public class RevitRebarGroup : RebarGroup { public RevitRebarGroup() { } @@ -51,6 +50,7 @@ public override RebarHook? endHook public string elementId { get; set; } } +[SpeckleType("Objects.BuiltElements.Revit.RevitRebarShape")] public class RevitRebarShape : RebarShape { public RevitRebarShape() { } @@ -59,6 +59,7 @@ public RevitRebarShape() { } public string elementId { get; set; } } +[SpeckleType("Objects.BuiltElements.Revit.RevitRebarHook")] public class RevitRebarHook : RebarHook { public RevitRebarHook() { } @@ -71,6 +72,7 @@ public RevitRebarHook() { } #region Obsolete [Obsolete("Deprecated in 2.17: Use RevitRebarGroup class instead")] +[SpeckleType("Objects.BuiltElements.Revit.RevitRebar")] public class RevitRebar : Rebar { public string family { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitRoof/RevitRoof.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitRoof/RevitRoof.cs index 3f13b8eb..967bbb64 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitRoof/RevitRoof.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitRoof/RevitRoof.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit.RevitRoof; +namespace Speckle.Objects.BuiltElements.Revit.RevitRoof; +[SpeckleType("Objects.BuiltElements.Revit.RevitRoof.RevitRoof")] public class RevitRoof : Roof { public string family { get; set; } @@ -20,6 +20,7 @@ public class RevitRoof : Roof } } +[SpeckleType("Objects.BuiltElements.Revit.RevitRoof.RevitExtrusionRoof")] public class RevitExtrusionRoof : RevitRoof { public RevitExtrusionRoof() { } @@ -63,6 +64,7 @@ public RevitExtrusionRoof( public Line referenceLine { get; set; } } +[SpeckleType("Objects.BuiltElements.Revit.RevitRoof.RevitFootprintRoof")] public class RevitFootprintRoof : RevitRoof { public RevitFootprintRoof() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitStair.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitStair.cs index 26ff77d5..09e5ebfa 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitStair.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitStair.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitStair")] public class RevitStair : Base, IDisplayValue> { public string family { get; set; } @@ -31,6 +31,7 @@ public class RevitStair : Base, IDisplayValue> public List displayValue { get; set; } } +[SpeckleType("Objects.BuiltElements.Revit.RevitStairRun")] public class RevitStairRun : Base { public string family { get; set; } @@ -54,6 +55,7 @@ public class RevitStairRun : Base public string units { get; set; } } +[SpeckleType("Objects.BuiltElements.Revit.RevitStairLanding")] public class RevitStairLanding : Base { public string family { get; set; } @@ -68,6 +70,7 @@ public class RevitStairLanding : Base public string units { get; set; } } +[SpeckleType("Objects.BuiltElements.Revit.RevitStairSupport")] public class RevitStairSupport : Base { public string family { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitTopography.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitTopography.cs index f7205a94..81faa748 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitTopography.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitTopography.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitTopography")] public class RevitTopography : Topography { public RevitTopography() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitToposolid.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitToposolid.cs index 096b201b..94061125 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitToposolid.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitToposolid.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitToposolid")] public class RevitToposolid : Base, IDisplayValue> { public RevitToposolid() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitWall.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitWall.cs index 0907cf42..741fb82e 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitWall.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitWall.cs @@ -1,12 +1,11 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitWall")] public class RevitWall : Wall { public RevitWall() { } @@ -128,6 +127,7 @@ public RevitWall( #endregion } +[SpeckleType("Objects.BuiltElements.Revit.RevitFaceWall")] public class RevitFaceWall : Wall { public RevitFaceWall() { } @@ -180,6 +180,7 @@ public RevitFaceWall( public string elementId { get; set; } } +[SpeckleType("Objects.BuiltElements.Revit.RevitProfileWall")] public class RevitProfileWall : Wall { public RevitProfileWall() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitWire.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitWire.cs index 02e532f4..6c09ec74 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitWire.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitWire.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.BuiltElements.Revit.Interfaces; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.BuiltElements.Revit.Interfaces; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitWire")] public class RevitWire : Wire, IHasMEPConnectors { public RevitWire() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/RevitZone.cs b/src/Speckle.Objects/BuiltElements/Revit/RevitZone.cs index 3dac0466..ddadf1a9 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/RevitZone.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/RevitZone.cs @@ -1,7 +1,8 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.RevitZone")] public class RevitZone : Zone { public RevitZone() { } diff --git a/src/Speckle.Objects/BuiltElements/Revit/StructuralConnectionHandler.cs b/src/Speckle.Objects/BuiltElements/Revit/StructuralConnectionHandler.cs index c0cba6dd..28a0e369 100644 --- a/src/Speckle.Objects/BuiltElements/Revit/StructuralConnectionHandler.cs +++ b/src/Speckle.Objects/BuiltElements/Revit/StructuralConnectionHandler.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.Revit; +namespace Speckle.Objects.BuiltElements.Revit; +[SpeckleType("Objects.BuiltElements.Revit.StructuralConnectionHandler")] public class StructuralConnectionHandler : Base, IDisplayValue> { public string family { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Roof.cs b/src/Speckle.Objects/BuiltElements/Roof.cs index fd076aeb..751cc233 100644 --- a/src/Speckle.Objects/BuiltElements/Roof.cs +++ b/src/Speckle.Objects/BuiltElements/Roof.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Roof")] public class Roof : Base, IDisplayValue> { public Roof() { } diff --git a/src/Speckle.Objects/BuiltElements/Room.cs b/src/Speckle.Objects/BuiltElements/Room.cs index e0975d33..6fdca529 100644 --- a/src/Speckle.Objects/BuiltElements/Room.cs +++ b/src/Speckle.Objects/BuiltElements/Room.cs @@ -1,12 +1,12 @@ -using System.Collections.Generic; -using Objects.BuiltElements.Revit; -using Objects.Geometry; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.BuiltElements.Revit; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Room")] public class Room : Base, IHasArea, IHasVolume, IDisplayValue> { public Room() { } diff --git a/src/Speckle.Objects/BuiltElements/Space.cs b/src/Speckle.Objects/BuiltElements/Space.cs index 076d146b..5334b0cc 100644 --- a/src/Speckle.Objects/BuiltElements/Space.cs +++ b/src/Speckle.Objects/BuiltElements/Space.cs @@ -1,12 +1,11 @@ -using System; -using System.Collections.Generic; -using Objects.BuiltElements.Revit; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.BuiltElements.Revit; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Space")] public class Space : Base, IHasArea, IHasVolume, IDisplayValue> { public Space() { } diff --git a/src/Speckle.Objects/BuiltElements/Station.cs b/src/Speckle.Objects/BuiltElements/Station.cs index f872b69d..2ec00632 100644 --- a/src/Speckle.Objects/BuiltElements/Station.cs +++ b/src/Speckle.Objects/BuiltElements/Station.cs @@ -1,8 +1,9 @@ -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Station")] public class Station : Base { public double number { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Structure.cs b/src/Speckle.Objects/BuiltElements/Structure.cs index b6339463..54626a0f 100644 --- a/src/Speckle.Objects/BuiltElements/Structure.cs +++ b/src/Speckle.Objects/BuiltElements/Structure.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Structure")] public class Structure : Base, IDisplayValue> { public Point location { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/TeklaStructures/BeamPosition.cs b/src/Speckle.Objects/BuiltElements/TeklaStructures/BeamPosition.cs index a21da43f..cf93afa9 100644 --- a/src/Speckle.Objects/BuiltElements/TeklaStructures/BeamPosition.cs +++ b/src/Speckle.Objects/BuiltElements/TeklaStructures/BeamPosition.cs @@ -1,7 +1,8 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.TeklaStructures; +namespace Speckle.Objects.BuiltElements.TeklaStructures; +[SpeckleType("Objects.BuiltElements.TeklaStructures.TeklaPosition")] public class TeklaPosition : Base { public TeklaDepthEnum Depth { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/TeklaStructures/Bolts.cs b/src/Speckle.Objects/BuiltElements/TeklaStructures/Bolts.cs index 380fb452..264ea0b9 100644 --- a/src/Speckle.Objects/BuiltElements/TeklaStructures/Bolts.cs +++ b/src/Speckle.Objects/BuiltElements/TeklaStructures/Bolts.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.TeklaStructures; +namespace Speckle.Objects.BuiltElements.TeklaStructures; +[SpeckleType("Objects.BuiltElements.TeklaStructures.Bolts")] public class Bolts : Base { [DetachProperty] @@ -22,6 +22,7 @@ public class Bolts : Base public List boltedPartsIds { get; set; } = new(); // First guid is PartToBeBolted, second guid is PartToBoltTo, any others are OtherPartsToBolt } +[SpeckleType("Objects.BuiltElements.TeklaStructures.BoltsXY")] public class BoltsXY : Bolts { // Lists of XY positions of bolts for Tekla @@ -29,6 +30,7 @@ public class BoltsXY : Bolts public List yPosition { get; set; } } +[SpeckleType("Objects.BuiltElements.TeklaStructures.BoltsArray")] public class BoltsArray : Bolts { // Lists of XY distances between bolts for Tekla @@ -36,6 +38,7 @@ public class BoltsArray : Bolts public List yDistance { get; set; } } +[SpeckleType("Objects.BuiltElements.TeklaStructures.BoltsCircle")] public class BoltsCircle : Bolts { public int boltCount { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/TeklaStructures/Enums.cs b/src/Speckle.Objects/BuiltElements/TeklaStructures/Enums.cs index 69c61e88..73c28fea 100644 --- a/src/Speckle.Objects/BuiltElements/TeklaStructures/Enums.cs +++ b/src/Speckle.Objects/BuiltElements/TeklaStructures/Enums.cs @@ -1,4 +1,4 @@ -namespace Objects.BuiltElements.TeklaStructures; +namespace Speckle.Objects.BuiltElements.TeklaStructures; public enum TeklaBeamType { diff --git a/src/Speckle.Objects/BuiltElements/TeklaStructures/Fitting.cs b/src/Speckle.Objects/BuiltElements/TeklaStructures/Fitting.cs index daeb7d12..0f634bb1 100644 --- a/src/Speckle.Objects/BuiltElements/TeklaStructures/Fitting.cs +++ b/src/Speckle.Objects/BuiltElements/TeklaStructures/Fitting.cs @@ -1,7 +1,9 @@ -using Objects.Geometry; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.TeklaStructures; +namespace Speckle.Objects.BuiltElements.TeklaStructures; +[SpeckleType("Objects.BuiltElements.TeklaStructures.Fitting")] public class Fitting : Plane { public string hostID { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaBeam.cs b/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaBeam.cs index 7d2805f2..e43d85fd 100644 --- a/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaBeam.cs +++ b/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaBeam.cs @@ -1,11 +1,12 @@ -using Objects.Geometry; -using Objects.Structural.Materials; -using Objects.Structural.Properties.Profiles; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Materials; +using Speckle.Objects.Structural.Properties.Profiles; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.TeklaStructures; +namespace Speckle.Objects.BuiltElements.TeklaStructures; +[SpeckleType("Objects.BuiltElements.TeklaStructures.TeklaBeam")] public class TeklaBeam : Beam, IHasVolume, IHasArea { public TeklaBeam() { } @@ -47,6 +48,7 @@ public TeklaBeam([SchemaMainParam] ICurve baseLine, SectionProfile profile, Stru public double volume { get; set; } } +[SpeckleType("Objects.BuiltElements.TeklaStructures.SpiralBeam")] public class SpiralBeam : TeklaBeam { public Point startPoint { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaContourPlate.cs b/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaContourPlate.cs index 7fcdcd22..ff2bd6e7 100644 --- a/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaContourPlate.cs +++ b/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaContourPlate.cs @@ -1,12 +1,12 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Structural.Materials; -using Objects.Structural.Properties.Profiles; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Materials; +using Speckle.Objects.Structural.Properties.Profiles; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.TeklaStructures; +namespace Speckle.Objects.BuiltElements.TeklaStructures; +[SpeckleType("Objects.BuiltElements.TeklaStructures.TeklaContourPlate")] public class TeklaContourPlate : Area { [SchemaInfo("ContourPlate", "Creates a TeklaStructures contour plate.", "Tekla", "Structure")] @@ -54,6 +54,7 @@ public TeklaContourPlate() { } public List contour { get; set; } // Use for ToNative to Tekla. Other programs can use Area.outline. } +[SpeckleType("Objects.BuiltElements.TeklaStructures.TeklaContourPoint")] public class TeklaContourPoint : Point { public TeklaContourPoint() { } diff --git a/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaModel.cs b/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaModel.cs index 47d0cdc1..8368621c 100644 --- a/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaModel.cs +++ b/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaModel.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.TeklaStructures; +namespace Speckle.Objects.BuiltElements.TeklaStructures; +[SpeckleType("Objects.BuiltElements.TeklaStructures.TeklaModel")] public class TeklaModel : Base { [DetachProperty] diff --git a/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaOpening.cs b/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaOpening.cs index 8ab6fae3..11799199 100644 --- a/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaOpening.cs +++ b/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaOpening.cs @@ -1,17 +1,22 @@ -namespace Objects.BuiltElements.TeklaStructures; +using Speckle.Sdk.Models; +namespace Speckle.Objects.BuiltElements.TeklaStructures; + +[SpeckleType("Objects.BuiltElements.TeklaStructures.TeklaOpening")] public class TeklaOpening : Opening { public string openingHostId { get; set; } public TeklaOpeningTypeEnum openingType { get; set; } } +[SpeckleType("Objects.BuiltElements.TeklaStructures.TeklaContourOpening")] public class TeklaContourOpening : TeklaOpening { public TeklaContourPlate cuttingPlate { get; set; } public double thickness { get; set; } } +[SpeckleType("Objects.BuiltElements.TeklaStructures.TeklaBeamOpening")] public class TeklaBeamOpening : TeklaOpening { public TeklaBeam cuttingBeam { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaRebar.cs b/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaRebar.cs index 9908f5e2..35fa8845 100644 --- a/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaRebar.cs +++ b/src/Speckle.Objects/BuiltElements/TeklaStructures/TeklaRebar.cs @@ -1,11 +1,11 @@ -using System; -using Objects.Structural.Materials; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Materials; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.TeklaStructures; +namespace Speckle.Objects.BuiltElements.TeklaStructures; #region Obsolete [Obsolete("Deprecated in 2.17: Create a TeklaRebarGroup class instead")] +[SpeckleType("Objects.BuiltElements.TeklaStructures.TeklaRebar")] public class TeklaRebar : Rebar { public string name { get; set; } @@ -24,6 +24,7 @@ public class TeklaRebar : Rebar } [Obsolete("Deprecated in 2.17: Use a RebarHook class instead")] +[SpeckleType("Objects.BuiltElements.TeklaStructures.Hook")] public class Hook : Base { public double angle { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/TeklaStructures/Welds.cs b/src/Speckle.Objects/BuiltElements/TeklaStructures/Welds.cs index da2c7698..41555e34 100644 --- a/src/Speckle.Objects/BuiltElements/TeklaStructures/Welds.cs +++ b/src/Speckle.Objects/BuiltElements/TeklaStructures/Welds.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements.TeklaStructures; +namespace Speckle.Objects.BuiltElements.TeklaStructures; +[SpeckleType("Objects.BuiltElements.TeklaStructures.Welds")] public class Welds : Base { [DetachProperty] @@ -24,6 +24,7 @@ public class Welds : Base public TeklaWeldIntermittentType intermittentType { get; set; } } +[SpeckleType("Objects.BuiltElements.TeklaStructures.PolygonWelds")] public class PolygonWelds : Welds { public Polyline polyline { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Topography.cs b/src/Speckle.Objects/BuiltElements/Topography.cs index bf629c50..3cd9b7d8 100644 --- a/src/Speckle.Objects/BuiltElements/Topography.cs +++ b/src/Speckle.Objects/BuiltElements/Topography.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Topography")] public class Topography : Base, IDisplayValue> { public Topography() diff --git a/src/Speckle.Objects/BuiltElements/View.cs b/src/Speckle.Objects/BuiltElements/View.cs index d518f101..9c729ba5 100644 --- a/src/Speckle.Objects/BuiltElements/View.cs +++ b/src/Speckle.Objects/BuiltElements/View.cs @@ -1,13 +1,15 @@ -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.View")] public class View : Base { public string name { get; set; } } +[SpeckleType("Objects.BuiltElements.View3D")] public class View3D : View { public Point origin { get; set; } @@ -20,6 +22,7 @@ public class View3D : View public string units { get; set; } } +[SpeckleType("Objects.BuiltElements.View2D")] public class View2D : View { //public Point topLeft { get; set; } diff --git a/src/Speckle.Objects/BuiltElements/Wall.cs b/src/Speckle.Objects/BuiltElements/Wall.cs index 46b86843..28963cf5 100644 --- a/src/Speckle.Objects/BuiltElements/Wall.cs +++ b/src/Speckle.Objects/BuiltElements/Wall.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Wall")] public class Wall : Base, IDisplayValue> { public Wall() { } diff --git a/src/Speckle.Objects/BuiltElements/Wire.cs b/src/Speckle.Objects/BuiltElements/Wire.cs index cc4aa324..8800def1 100644 --- a/src/Speckle.Objects/BuiltElements/Wire.cs +++ b/src/Speckle.Objects/BuiltElements/Wire.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Wire")] public class Wire : Base { public Wire() { } diff --git a/src/Speckle.Objects/BuiltElements/Zone.cs b/src/Speckle.Objects/BuiltElements/Zone.cs index 30d53643..160697bf 100644 --- a/src/Speckle.Objects/BuiltElements/Zone.cs +++ b/src/Speckle.Objects/BuiltElements/Zone.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.BuiltElements; +namespace Speckle.Objects.BuiltElements; +[SpeckleType("Objects.BuiltElements.Zone")] public class Zone : Base, IHasArea, IHasVolume { public Zone() { } diff --git a/src/Speckle.Objects/EncodingOptimisations.cs b/src/Speckle.Objects/EncodingOptimisations.cs index 0e43ff70..c6203993 100644 --- a/src/Speckle.Objects/EncodingOptimisations.cs +++ b/src/Speckle.Objects/EncodingOptimisations.cs @@ -1,8 +1,6 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; +using Speckle.Objects.Geometry; -namespace Objects; +namespace Speckle.Objects; public static class CurveTypeEncoding { diff --git a/src/Speckle.Objects/GIS/CRS.cs b/src/Speckle.Objects/GIS/CRS.cs index 39f9e0b3..ae4f04dc 100644 --- a/src/Speckle.Objects/GIS/CRS.cs +++ b/src/Speckle.Objects/GIS/CRS.cs @@ -1,7 +1,8 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.GIS; +namespace Speckle.Objects.GIS; +[SpeckleType("Objects.GIS.CRS")] public class CRS : Base { public string? name { get; set; } diff --git a/src/Speckle.Objects/GIS/GisFeature.cs b/src/Speckle.Objects/GIS/GisFeature.cs index 1a5f4dc5..df4e9490 100644 --- a/src/Speckle.Objects/GIS/GisFeature.cs +++ b/src/Speckle.Objects/GIS/GisFeature.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.GIS; +namespace Speckle.Objects.GIS; +[SpeckleType("Objects.GIS.GisFeature")] public class GisFeature : Base { public GisFeature() diff --git a/src/Speckle.Objects/GIS/GisMultipatchGeometry.cs b/src/Speckle.Objects/GIS/GisMultipatchGeometry.cs index 3833785e..f4bc67db 100644 --- a/src/Speckle.Objects/GIS/GisMultipatchGeometry.cs +++ b/src/Speckle.Objects/GIS/GisMultipatchGeometry.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.GIS; +namespace Speckle.Objects.GIS; +[SpeckleType("Objects.GIS.GisMultipatchGeometry")] public class GisMultipatchGeometry : Base { public string units { get; set; } diff --git a/src/Speckle.Objects/GIS/GisPolygonGeometry.cs b/src/Speckle.Objects/GIS/GisPolygonGeometry.cs index 3937f1a6..2a3a3cdb 100644 --- a/src/Speckle.Objects/GIS/GisPolygonGeometry.cs +++ b/src/Speckle.Objects/GIS/GisPolygonGeometry.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.GIS; +namespace Speckle.Objects.GIS; +[SpeckleType("Objects.GIS.PolygonGeometry")] public class PolygonGeometry : Base { public string units { get; set; } diff --git a/src/Speckle.Objects/GIS/GisPolygonGeometry3d.cs b/src/Speckle.Objects/GIS/GisPolygonGeometry3d.cs index 93613c89..6a2ee318 100644 --- a/src/Speckle.Objects/GIS/GisPolygonGeometry3d.cs +++ b/src/Speckle.Objects/GIS/GisPolygonGeometry3d.cs @@ -1,3 +1,6 @@ -namespace Objects.GIS; +using Speckle.Sdk.Models; +namespace Speckle.Objects.GIS; + +[SpeckleType("Objects.GIS.PolygonGeometry3d")] public class PolygonGeometry3d : PolygonGeometry { } diff --git a/src/Speckle.Objects/GIS/GisTopography.cs b/src/Speckle.Objects/GIS/GisTopography.cs index 8a34ac70..d111264b 100644 --- a/src/Speckle.Objects/GIS/GisTopography.cs +++ b/src/Speckle.Objects/GIS/GisTopography.cs @@ -1,3 +1,6 @@ -namespace Objects.GIS; +using Speckle.Sdk.Models; +namespace Speckle.Objects.GIS; + +[SpeckleType("Objects.GIS.GisTopography")] public class GisTopography : RasterElement { } diff --git a/src/Speckle.Objects/GIS/NonGeometryElement.cs b/src/Speckle.Objects/GIS/NonGeometryElement.cs index c5e0dc57..346fc0ae 100644 --- a/src/Speckle.Objects/GIS/NonGeometryElement.cs +++ b/src/Speckle.Objects/GIS/NonGeometryElement.cs @@ -1,9 +1,9 @@ -using System; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.GIS; +namespace Speckle.Objects.GIS; [Obsolete("NonGeometryElement was replaced by a more generic class, \"GisFeature\", which contains more information")] +[SpeckleType("Objects.GIS.NonGeometryElement")] public class NonGeometryElement : Base { public Base? attributes { get; set; } diff --git a/src/Speckle.Objects/GIS/PolygonElement.cs b/src/Speckle.Objects/GIS/PolygonElement.cs index 8905a7cf..08ebed2d 100644 --- a/src/Speckle.Objects/GIS/PolygonElement.cs +++ b/src/Speckle.Objects/GIS/PolygonElement.cs @@ -1,10 +1,9 @@ -using System; -using System.Collections.Generic; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.GIS; +namespace Speckle.Objects.GIS; [Obsolete("PolygonElement was replaced by a more generic class, \"GisFeature\", which contains more information")] +[SpeckleType("Objects.GIS.PolygonElement")] public class PolygonElement : Base { [DetachProperty] diff --git a/src/Speckle.Objects/GIS/RasterElement.cs b/src/Speckle.Objects/GIS/RasterElement.cs index 63befed1..cb1b78fb 100644 --- a/src/Speckle.Objects/GIS/RasterElement.cs +++ b/src/Speckle.Objects/GIS/RasterElement.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.GIS; +namespace Speckle.Objects.GIS; +[SpeckleType("Objects.GIS.RasterElement")] public class RasterElement : Base { public int band_count { get; set; } diff --git a/src/Speckle.Objects/GIS/RasterLayer.cs b/src/Speckle.Objects/GIS/RasterLayer.cs index 1b489a48..71ef4b71 100644 --- a/src/Speckle.Objects/GIS/RasterLayer.cs +++ b/src/Speckle.Objects/GIS/RasterLayer.cs @@ -1,8 +1,9 @@ -using System.Collections.Generic; -using Speckle.Core.Models.Collections; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Collections; -namespace Objects.GIS; +namespace Speckle.Objects.GIS; +[SpeckleType("Objects.GIS.RasterLayer")] public class RasterLayer : Collection { public CRS? crs { get; set; } diff --git a/src/Speckle.Objects/GIS/VectorLayer.cs b/src/Speckle.Objects/GIS/VectorLayer.cs index 522f9cdf..dee18f19 100644 --- a/src/Speckle.Objects/GIS/VectorLayer.cs +++ b/src/Speckle.Objects/GIS/VectorLayer.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Speckle.Core.Models; -using Speckle.Core.Models.Collections; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Collections; -namespace Objects.GIS; +namespace Speckle.Objects.GIS; +[SpeckleType("Objects.GIS.VectorLayer")] public class VectorLayer : Collection { public CRS? crs { get; set; } diff --git a/src/Speckle.Objects/Geometry/Arc.cs b/src/Speckle.Objects/Geometry/Arc.cs index 9ca35b90..54b10e9a 100644 --- a/src/Speckle.Objects/Geometry/Arc.cs +++ b/src/Speckle.Objects/Geometry/Arc.cs @@ -1,16 +1,16 @@ -using System; -using System.Collections.Generic; -using Objects.Other; -using Objects.Primitive; -using Speckle.Core.Kits; -using Speckle.Core.Logging; -using Speckle.Core.Models; +using Speckle.Objects.Other; +using Speckle.Objects.Primitive; +using Speckle.Sdk; +using Speckle.Sdk.Common; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// Represents a sub-curve of a three-dimensional circle. /// +[SpeckleType("Objects.Geometry.Arc")] public class Arc : Base, IHasBoundingBox, ICurve, IHasArea, ITransformable { /// diff --git a/src/Speckle.Objects/Geometry/Autocad/AutocadPolycurve.cs b/src/Speckle.Objects/Geometry/Autocad/AutocadPolycurve.cs index a88c5147..3f8c333a 100644 --- a/src/Speckle.Objects/Geometry/Autocad/AutocadPolycurve.cs +++ b/src/Speckle.Objects/Geometry/Autocad/AutocadPolycurve.cs @@ -1,7 +1,6 @@ -using System.Collections.Generic; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.Geometry.Autocad; +namespace Speckle.Objects.Geometry.Autocad; /// /// A curve that is comprised of line, arc and/or curve segments, representing the Autocad Polyline, Polyline2d, and Polyline3d classes. diff --git a/src/Speckle.Objects/Geometry/Box.cs b/src/Speckle.Objects/Geometry/Box.cs index f4bdab9f..db27ad45 100644 --- a/src/Speckle.Objects/Geometry/Box.cs +++ b/src/Speckle.Objects/Geometry/Box.cs @@ -1,12 +1,13 @@ -using Objects.Primitive; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Primitive; +using Speckle.Sdk.Common; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// Represents a 3-dimensional box oriented on a plane. /// +[SpeckleType("Objects.Geometry.Box")] public class Box : Base, IHasVolume, IHasArea, IHasBoundingBox { /// @@ -62,7 +63,7 @@ public Box( /// The units this object's coordinates are in. /// /// - /// This should be one of + /// This should be one of /// public string units { get; set; } diff --git a/src/Speckle.Objects/Geometry/Brep.cs b/src/Speckle.Objects/Geometry/Brep.cs index 43403c49..f0ca3c0c 100644 --- a/src/Speckle.Objects/Geometry/Brep.cs +++ b/src/Speckle.Objects/Geometry/Brep.cs @@ -1,18 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.Serialization; -using Objects.Other; -using Objects.Primitive; -using Speckle.Core.Kits; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Other; +using Speckle.Objects.Primitive; +using Speckle.Sdk.Common; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// Represents a "Boundary Representation" Solid /// +[SpeckleType("Objects.Geometry.Brep")] public class Brep : Base, IHasArea, IHasVolume, IHasBoundingBox, ITransformable, IDisplayValue> { /// @@ -52,7 +51,7 @@ public Brep(string provenance, List displayValues, string units = Units.Me /// The unit's this object's coordinates are in. /// /// - /// This should be one of + /// This should be one of /// public string units { get; set; } diff --git a/src/Speckle.Objects/Geometry/BrepEdge.cs b/src/Speckle.Objects/Geometry/BrepEdge.cs index faffb323..81caa908 100644 --- a/src/Speckle.Objects/Geometry/BrepEdge.cs +++ b/src/Speckle.Objects/Geometry/BrepEdge.cs @@ -1,14 +1,13 @@ -using System.Collections.Generic; -using System.Linq; -using Objects.Primitive; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Primitive; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// Represents an edge of the . /// +[SpeckleType("Objects.Geometry.BrepEdge")] public class BrepEdge : Base { public BrepEdge() { } diff --git a/src/Speckle.Objects/Geometry/BrepFace.cs b/src/Speckle.Objects/Geometry/BrepFace.cs index 6f9d52a7..73295a7b 100644 --- a/src/Speckle.Objects/Geometry/BrepFace.cs +++ b/src/Speckle.Objects/Geometry/BrepFace.cs @@ -1,13 +1,12 @@ -using System.Collections.Generic; -using System.Linq; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// Represents a face on a /// +[SpeckleType("Objects.Geometry.BrepFace")] public class BrepFace : Base { public BrepFace() { } diff --git a/src/Speckle.Objects/Geometry/BrepLoop.cs b/src/Speckle.Objects/Geometry/BrepLoop.cs index b84246ed..9fc1e4c6 100644 --- a/src/Speckle.Objects/Geometry/BrepLoop.cs +++ b/src/Speckle.Objects/Geometry/BrepLoop.cs @@ -1,13 +1,12 @@ -using System.Collections.Generic; -using System.Linq; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// Represents a UV Trim Closed Loop on one of the 's surfaces. /// +[SpeckleType("Objects.Geometry.BrepLoop")] public class BrepLoop : Base { public BrepLoop() { } diff --git a/src/Speckle.Objects/Geometry/BrepTrim.cs b/src/Speckle.Objects/Geometry/BrepTrim.cs index cadc268f..0542e559 100644 --- a/src/Speckle.Objects/Geometry/BrepTrim.cs +++ b/src/Speckle.Objects/Geometry/BrepTrim.cs @@ -1,12 +1,13 @@ -using Objects.Primitive; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Primitive; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// Represents a UV Trim curve for one of the 's surfaces. /// +[SpeckleType("Objects.Geometry.BrepTrim")] public class BrepTrim : Base { public BrepTrim() { } diff --git a/src/Speckle.Objects/Geometry/Circle.cs b/src/Speckle.Objects/Geometry/Circle.cs index 56fd4b16..283f8407 100644 --- a/src/Speckle.Objects/Geometry/Circle.cs +++ b/src/Speckle.Objects/Geometry/Circle.cs @@ -1,13 +1,13 @@ -using System.Collections.Generic; -using Objects.Primitive; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Primitive; +using Speckle.Sdk.Common; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// Represents a circular curve based on a base and a as radius. /// +[SpeckleType("Objects.Geometry.Circle")] public class Circle : Base, ICurve, IHasArea, IHasBoundingBox { /// diff --git a/src/Speckle.Objects/Geometry/ControlPoint.cs b/src/Speckle.Objects/Geometry/ControlPoint.cs index 82f02471..4ea9fe96 100644 --- a/src/Speckle.Objects/Geometry/ControlPoint.cs +++ b/src/Speckle.Objects/Geometry/ControlPoint.cs @@ -1,10 +1,10 @@ -using System; -using System.Collections.Generic; -using Objects.Other; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Other; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; +[SpeckleType("Objects.Geometry.ControlPoint")] public class ControlPoint : Point, ITransformable { public ControlPoint() { } diff --git a/src/Speckle.Objects/Geometry/Curve.cs b/src/Speckle.Objects/Geometry/Curve.cs index 4700aab7..3e597c6b 100644 --- a/src/Speckle.Objects/Geometry/Curve.cs +++ b/src/Speckle.Objects/Geometry/Curve.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Objects.Other; -using Objects.Primitive; -using Speckle.Core.Kits; -using Speckle.Core.Logging; -using Speckle.Core.Models; +using Speckle.Objects.Other; +using Speckle.Objects.Primitive; +using Speckle.Sdk; +using Speckle.Sdk.Common; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; +[SpeckleType("Objects.Geometry.Curve")] public class Curve : Base, ICurve, IHasBoundingBox, IHasArea, ITransformable, IDisplayValue { /// diff --git a/src/Speckle.Objects/Geometry/Ellipse.cs b/src/Speckle.Objects/Geometry/Ellipse.cs index b248e145..16e0c340 100644 --- a/src/Speckle.Objects/Geometry/Ellipse.cs +++ b/src/Speckle.Objects/Geometry/Ellipse.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Primitive; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Primitive; +using Speckle.Sdk.Common; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; +[SpeckleType("Objects.Geometry.Ellipse")] public class Ellipse : Base, ICurve, IHasArea { /// diff --git a/src/Speckle.Objects/Geometry/Extrusion.cs b/src/Speckle.Objects/Geometry/Extrusion.cs index aaa382f1..5425ed7c 100644 --- a/src/Speckle.Objects/Geometry/Extrusion.cs +++ b/src/Speckle.Objects/Geometry/Extrusion.cs @@ -1,12 +1,11 @@ -using System; -using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Common; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; [Obsolete("Unused")] +[SpeckleType("Objects.Geometry.Extrusion")] [SuppressMessage("Design", "CA1051:Do not declare visible instance fields", Justification = "Obsolete")] public class Extrusion : Base, IHasVolume, IHasArea, IHasBoundingBox { diff --git a/src/Speckle.Objects/Geometry/Line.cs b/src/Speckle.Objects/Geometry/Line.cs index 310085e3..1b62db57 100644 --- a/src/Speckle.Objects/Geometry/Line.cs +++ b/src/Speckle.Objects/Geometry/Line.cs @@ -1,15 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Objects.Other; -using Objects.Primitive; -using Speckle.Core.Kits; -using Speckle.Core.Logging; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Other; +using Speckle.Objects.Primitive; +using Speckle.Sdk; +using Speckle.Sdk.Common; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; +[SpeckleType("Objects.Geometry.Line")] public class Line : Base, ICurve, IHasBoundingBox, ITransformable { public Line() { } diff --git a/src/Speckle.Objects/Geometry/Mesh.cs b/src/Speckle.Objects/Geometry/Mesh.cs index 1c2409f4..26c9cd95 100644 --- a/src/Speckle.Objects/Geometry/Mesh.cs +++ b/src/Speckle.Objects/Geometry/Mesh.cs @@ -1,14 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Objects.Other; -using Speckle.Core.Kits; -using Speckle.Core.Logging; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Other; +using Speckle.Sdk; +using Speckle.Sdk.Common; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; +[SpeckleType("Objects.Geometry.Mesh")] public class Mesh : Base, IHasBoundingBox, IHasVolume, IHasArea, ITransformable { public Mesh() { } @@ -72,7 +71,7 @@ public Mesh( /// /// The unit's this is in. - /// This should be one of + /// This should be one of /// public string units { get; set; } = Units.None; diff --git a/src/Speckle.Objects/Geometry/Plane.cs b/src/Speckle.Objects/Geometry/Plane.cs index c636ab06..635ed64b 100644 --- a/src/Speckle.Objects/Geometry/Plane.cs +++ b/src/Speckle.Objects/Geometry/Plane.cs @@ -1,13 +1,13 @@ -using System.Collections.Generic; -using Objects.Other; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Other; +using Speckle.Sdk.Common; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// A 3-dimensional Plane consisting of an origin , and 3 as it's X, Y and Z axis. /// +[SpeckleType("Objects.Geometry.Plane")] public class Plane : Base, ITransformable { /// @@ -63,7 +63,7 @@ public Plane( /// /// The unit's this is in. - /// This should be one of + /// This should be one of /// public string units { get; set; } diff --git a/src/Speckle.Objects/Geometry/Point.cs b/src/Speckle.Objects/Geometry/Point.cs index 000ce698..e310113b 100644 --- a/src/Speckle.Objects/Geometry/Point.cs +++ b/src/Speckle.Objects/Geometry/Point.cs @@ -1,12 +1,9 @@ -using System; -using System.Collections.Generic; -using Objects.Other; -using Speckle.Core.Common; -using Speckle.Core.Kits; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Other; +using Speckle.Sdk.Common; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// A 3-dimensional point @@ -14,6 +11,7 @@ namespace Objects.Geometry; /// /// TODO: The Point class does not override the Equality operator, which means that there may be cases where `Equals` is used instead of `==`, as the comparison will be done by reference, not value. /// +[SpeckleType("Objects.Geometry.Point")] public class Point : Base, ITransformable { /// @@ -75,7 +73,7 @@ public List value /// /// The units this is in. - /// This should be one of the units specified in + /// This should be one of the units specified in /// public string units { get; set; } = Units.None; diff --git a/src/Speckle.Objects/Geometry/Pointcloud.cs b/src/Speckle.Objects/Geometry/Pointcloud.cs index 9b894c0f..2b6de5ec 100644 --- a/src/Speckle.Objects/Geometry/Pointcloud.cs +++ b/src/Speckle.Objects/Geometry/Pointcloud.cs @@ -1,15 +1,16 @@ -using System.Collections.Generic; -using System.Linq; -using Objects.Other; -using Speckle.Core.Kits; -using Speckle.Core.Logging; -using Speckle.Core.Models; +using Speckle.Objects.Other; +using Speckle.Sdk; +using Speckle.Sdk.Common; +using Speckle.Sdk.Host; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// A collection of points, with color and size support. /// +[SpeckleType("Objects.Geometry.Pointcloud")] public class Pointcloud : Base, IHasBoundingBox, ITransformable { /// @@ -48,7 +49,7 @@ public Pointcloud(List points, List? colors = null, List? s /// /// The unit's this is in. - /// This should be one of + /// This should be one of /// public string units { get; set; } diff --git a/src/Speckle.Objects/Geometry/Polycurve.cs b/src/Speckle.Objects/Geometry/Polycurve.cs index 21305c29..8157ec97 100644 --- a/src/Speckle.Objects/Geometry/Polycurve.cs +++ b/src/Speckle.Objects/Geometry/Polycurve.cs @@ -1,15 +1,14 @@ -using System; -using System.Collections.Generic; -using Objects.Other; -using Objects.Primitive; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Other; +using Speckle.Objects.Primitive; +using Speckle.Sdk.Common; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// A curve that is comprised of multiple curves connected. /// +[SpeckleType("Objects.Geometry.Polycurve")] public class Polycurve : Base, ICurve, IHasArea, IHasBoundingBox, ITransformable { /// @@ -41,7 +40,7 @@ public Polycurve(string units = Units.Meters, string? applicationId = null) /// /// The unit's this is in. - /// This should be one of + /// This should be one of /// public string units { get; set; } diff --git a/src/Speckle.Objects/Geometry/Polyline.cs b/src/Speckle.Objects/Geometry/Polyline.cs index 6716fa14..2ab12a92 100644 --- a/src/Speckle.Objects/Geometry/Polyline.cs +++ b/src/Speckle.Objects/Geometry/Polyline.cs @@ -1,18 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Objects.Other; -using Objects.Primitive; -using Speckle.Core.Kits; -using Speckle.Core.Logging; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Other; +using Speckle.Objects.Primitive; +using Speckle.Sdk; +using Speckle.Sdk.Common; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// A polyline curve, defined by a set of vertices. /// +[SpeckleType("Objects.Geometry.Polyline")] public class Polyline : Base, ICurve, IHasArea, IHasBoundingBox, IConvertible, ITransformable { /// @@ -56,7 +55,7 @@ public Polyline(List coordinates, string units = Units.Meters, string? a /// /// The unit's this is in. - /// This should be one of + /// This should be one of /// public string units { get; set; } diff --git a/src/Speckle.Objects/Geometry/PolylineExtensions.cs b/src/Speckle.Objects/Geometry/PolylineExtensions.cs index 49d5677e..c4ba0c34 100644 --- a/src/Speckle.Objects/Geometry/PolylineExtensions.cs +++ b/src/Speckle.Objects/Geometry/PolylineExtensions.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; - -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; public static class PolylineExtensions { diff --git a/src/Speckle.Objects/Geometry/Spiral.cs b/src/Speckle.Objects/Geometry/Spiral.cs index 89ef8aea..a918858a 100644 --- a/src/Speckle.Objects/Geometry/Spiral.cs +++ b/src/Speckle.Objects/Geometry/Spiral.cs @@ -1,7 +1,7 @@ -using Objects.Primitive; -using Speckle.Core.Models; +using Speckle.Objects.Primitive; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; public enum SpiralType { @@ -17,6 +17,7 @@ public enum SpiralType Unknown } +[SpeckleType("Objects.Geometry.Spiral")] public class Spiral : Base, ICurve, IHasBoundingBox, IDisplayValue { public Point startPoint { get; set; } diff --git a/src/Speckle.Objects/Geometry/Surface.cs b/src/Speckle.Objects/Geometry/Surface.cs index dcad0d6b..71f05f3f 100644 --- a/src/Speckle.Objects/Geometry/Surface.cs +++ b/src/Speckle.Objects/Geometry/Surface.cs @@ -1,14 +1,14 @@ -using System.Collections.Generic; -using Objects.Other; -using Objects.Primitive; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Other; +using Speckle.Objects.Primitive; +using Speckle.Sdk.Common; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// A Surface in NURBS form. /// +[SpeckleType("Objects.Geometry.Surface")] public class Surface : Base, IHasBoundingBox, IHasArea, ITransformable { /// @@ -93,7 +93,7 @@ public Surface(string units = Units.Meters, string? applicationId = null) /// /// The unit's this is in. - /// This should be one of + /// This should be one of /// public string units { get; set; } diff --git a/src/Speckle.Objects/Geometry/Vector.cs b/src/Speckle.Objects/Geometry/Vector.cs index ea3271eb..9f352d9f 100644 --- a/src/Speckle.Objects/Geometry/Vector.cs +++ b/src/Speckle.Objects/Geometry/Vector.cs @@ -1,15 +1,14 @@ -using System; -using System.Collections.Generic; -using Objects.Other; -using Speckle.Core.Kits; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Other; +using Speckle.Sdk.Common; +using Speckle.Sdk.Models; -namespace Objects.Geometry; +namespace Speckle.Objects.Geometry; /// /// A 3-dimensional vector /// +[SpeckleType("Objects.Geometry.Vector")] public class Vector : Base, IHasBoundingBox, ITransformable { /// @@ -78,7 +77,7 @@ public List value /// /// The unit's this is in. - /// This should be one of + /// This should be one of /// public string units { get; set; } = Units.None; diff --git a/src/Speckle.Objects/Interfaces.cs b/src/Speckle.Objects/Interfaces.cs index 373e129d..b397a38b 100644 --- a/src/Speckle.Objects/Interfaces.cs +++ b/src/Speckle.Objects/Interfaces.cs @@ -1,11 +1,10 @@ -using System.Collections.Generic; -using Objects.BuiltElements; -using Objects.Geometry; -using Objects.Other; -using Objects.Primitive; -using Speckle.Core.Models; - -namespace Objects; +using Speckle.Objects.BuiltElements; +using Speckle.Objects.Geometry; +using Speckle.Objects.Other; +using Speckle.Objects.Primitive; +using Speckle.Sdk.Models; + +namespace Speckle.Objects; #region Generic interfaces. diff --git a/src/Speckle.Objects/ObjectsKit.cs b/src/Speckle.Objects/ObjectsKit.cs deleted file mode 100644 index b1f78e8a..00000000 --- a/src/Speckle.Objects/ObjectsKit.cs +++ /dev/null @@ -1,156 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using Speckle.Core.Common; -using Speckle.Core.Helpers; -using Speckle.Core.Kits; -using Speckle.Core.Logging; -using Speckle.Core.Models; -using Speckle.Logging; - -namespace Objects; - -/// -/// The default Speckle Kit -/// -public class ObjectsKit : ISpeckleKit -{ - private static string? s_objectsFolder; - - private readonly Dictionary _loadedConverters = new(); - - private List? _converters; - - /// - /// Local installations store objects in C:\Users\USERNAME\AppData\Roaming\Speckle\Kits\Objects - /// Admin/System-wide installations in C:\ProgramData\Speckle\Kits\Objects - /// - public static string ObjectsFolder - { - get => s_objectsFolder ??= SpecklePathProvider.ObjectsFolderPath; - [Obsolete("Use " + nameof(SpecklePathProvider.OverrideObjectsFolderName), true)] - set => s_objectsFolder = value; - } - - /// - public string Description => "The default Speckle Kit."; - - /// - public string Name => "Objects"; - - /// - public string Author => "Speckle"; - - /// - public string WebsiteOrEmail => "https://speckle.systems"; - - /// - public IEnumerable Types => - Assembly.GetExecutingAssembly().GetTypes().Where(t => t.IsSubclassOf(typeof(Base)) && !t.IsAbstract); - - /// - public IEnumerable Converters => _converters ??= GetAvailableConverters(); - - /// - public ISpeckleConverter LoadConverter(string app) - { - try - { - _converters = GetAvailableConverters(); - if (_loadedConverters.TryGetValue(app, out Type t)) - { - return (ISpeckleConverter)Activator.CreateInstance(t); - } - - var converterInstance = LoadConverterFromDisk(app); - _loadedConverters[app] = converterInstance.GetType(); - - return converterInstance; - } - catch (Exception ex) - { - SpeckleLog.Logger.Fatal(ex, "Failed to load converter for app {app}", app); - throw new KitException($"Failed to load converter for app {app}:\n\n{ex.Message}", this, ex); - } - } - - private static ISpeckleConverter LoadConverterFromDisk(string app) - { - var basePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).NotNull(); - - var path = Path.Combine(basePath, $"Objects.Converter.{app}.dll"); - - //fallback to the default folder, in case the Objects.dll was loaded in the app domain for other reasons - if (!File.Exists(path)) - { - path = Path.Combine(ObjectsFolder, $"Objects.Converter.{app}.dll"); - } - - if (!File.Exists(path)) - { - throw new FileNotFoundException($"Converter for {app} was not found in kit {basePath}", path); - } - - AssemblyName assemblyToLoad = AssemblyName.GetAssemblyName(path); - var objects = Assembly.GetExecutingAssembly().GetName(); - - //only get assemblies matching the Major and Minor version of Objects - if (assemblyToLoad.Version.Major != objects.Version.Major || assemblyToLoad.Version.Minor != objects.Version.Minor) - { - throw new SpeckleException( - $"Mismatch between Objects library v{objects.Version} Converter v{assemblyToLoad.Version}.\nEnsure the same 2.x version of Speckle connectors is installed." - ); - } - - var assembly = Assembly.LoadFrom(path); - - var converterInstance = assembly - .GetTypes() - .Where(type => typeof(ISpeckleConverter).IsAssignableFrom(type)) - .Select(type => (ISpeckleConverter)Activator.CreateInstance(type)) - .FirstOrDefault(converter => converter.GetServicedApplications().Contains(app)); - - if (converterInstance == null) - { - throw new SpeckleException($"No suitable converter instance found for {app}"); - } - - SpeckleLog.Logger.Information( - "Converter {converterName} successfully loaded from {path} with {app} and {basePath}", - converterInstance.Name, - path, - app, - basePath - ); - - return converterInstance; - } - - public List GetAvailableConverters() - { - var basePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location).NotNull(); - var allConverters = Directory.EnumerateFiles(basePath, "Objects.Converter.*.dll").ToArray(); - - //fallback to the default folder, in case the Objects.dll was loaded in the app domain for other reasons - if (allConverters.Length == 0) - { - allConverters = Directory.EnumerateFiles(ObjectsFolder, "Objects.Converter.*.dll").ToArray(); - } - - //only get assemblies matching the Major and Minor version of Objects - var objects = Assembly.GetExecutingAssembly().GetName(); - var availableConverters = new List(); - foreach (var converter in allConverters) - { - AssemblyName assemblyName = AssemblyName.GetAssemblyName(converter); - if (assemblyName.Version.Major == objects.Version.Major && assemblyName.Version.Minor == objects.Version.Minor) - { - availableConverters.Add(converter); - } - } - - return availableConverters.Select(dllPath => dllPath.Split('.').Reverse().ElementAt(1)).ToList(); - } -} diff --git a/src/Speckle.Objects/Organization/DataTable.cs b/src/Speckle.Objects/Organization/DataTable.cs index 81721e90..e79a6d92 100644 --- a/src/Speckle.Objects/Organization/DataTable.cs +++ b/src/Speckle.Objects/Organization/DataTable.cs @@ -1,10 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.Organization; +namespace Speckle.Objects.Organization; +[SpeckleType("Objects.Organization.DataTable")] public class DataTable : Base { public DataTable() { } diff --git a/src/Speckle.Objects/Organization/Deprecated/Collection.cs b/src/Speckle.Objects/Organization/Deprecated/Collection.cs deleted file mode 100644 index 142dd214..00000000 --- a/src/Speckle.Objects/Organization/Deprecated/Collection.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace Objects.Organization.Deprecated; - -[Obsolete("Replaced by " + nameof(Speckle.Core.Models.Collections.Collection))] -public class Collection : Speckle.Core.Models.Collections.Collection -{ - //Deserializer target for 2.13 Collection objects in the `Objects.Orgainzation` namespace - - //Objects.Organization.Deprecated.Collection:Speckle.Core.Models.Collection -} diff --git a/src/Speckle.Objects/Organization/Model.cs b/src/Speckle.Objects/Organization/Model.cs index 0461f844..73dddd8f 100644 --- a/src/Speckle.Objects/Organization/Model.cs +++ b/src/Speckle.Objects/Organization/Model.cs @@ -1,14 +1,14 @@ -using System.Collections.Generic; -using Objects.Other; -using Speckle.Core.Models; +using Speckle.Objects.Other; +using Speckle.Sdk.Models; -namespace Objects.Organization; +namespace Speckle.Objects.Organization; /// /// Basic model info class /// It contains general information about the model and can be extended or subclassed to include more application-specific /// information. /// +[SpeckleType("Objects.Organization.ModelInfo")] public class ModelInfo : Base { /// diff --git a/src/Speckle.Objects/Other/Block.cs b/src/Speckle.Objects/Other/Block.cs index fd455dd9..db1f2061 100644 --- a/src/Speckle.Objects/Other/Block.cs +++ b/src/Speckle.Objects/Other/Block.cs @@ -1,13 +1,14 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Common; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Other; +namespace Speckle.Objects.Other; /// /// Block definition class /// +[SpeckleType("Objects.Other.BlockDefinition")] public class BlockDefinition : Base { public BlockDefinition() { } diff --git a/src/Speckle.Objects/Other/Civil/CivilDataField.cs b/src/Speckle.Objects/Other/Civil/CivilDataField.cs index 6919669d..706b79df 100644 --- a/src/Speckle.Objects/Other/Civil/CivilDataField.cs +++ b/src/Speckle.Objects/Other/Civil/CivilDataField.cs @@ -1,5 +1,8 @@ -namespace Objects.Other.Civil; +using Speckle.Sdk.Models; +namespace Speckle.Objects.Other.Civil; + +[SpeckleType("Objects.Other.Civil.CivilDataField")] public class CivilDataField : DataField { public CivilDataField() { } diff --git a/src/Speckle.Objects/Other/DataField.cs b/src/Speckle.Objects/Other/DataField.cs index 4d3fd5a1..ed55d821 100644 --- a/src/Speckle.Objects/Other/DataField.cs +++ b/src/Speckle.Objects/Other/DataField.cs @@ -1,10 +1,11 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.Other; +namespace Speckle.Objects.Other; /// /// Generic class for a data field /// +[SpeckleType("Objects.Other.DataField")] public class DataField : Base { public DataField() { } diff --git a/src/Speckle.Objects/Other/Dimension.cs b/src/Speckle.Objects/Other/Dimension.cs index 693e648e..b5b2f5e3 100644 --- a/src/Speckle.Objects/Other/Dimension.cs +++ b/src/Speckle.Objects/Other/Dimension.cs @@ -1,12 +1,12 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.Other; +namespace Speckle.Objects.Other; /// /// Dimension class /// +[SpeckleType("Objects.Other.Dimension")] public class Dimension : Base, IDisplayValue> { /// @@ -45,6 +45,7 @@ public class Dimension : Base, IDisplayValue> /// /// Dimension class measuring a distance /// +[SpeckleType("Objects.Other.DistanceDimension")] public class DistanceDimension : Dimension { /// @@ -71,6 +72,7 @@ public class DistanceDimension : Dimension /// /// Dimension class measuring a length /// +[SpeckleType("Objects.Other.LengthDimension")] public class LengthDimension : Dimension { /// @@ -85,6 +87,7 @@ public class LengthDimension : Dimension /// /// Dimension class measuring an angle /// +[SpeckleType("Objects.Other.AngleDimension")] public class AngleDimension : Dimension { /// diff --git a/src/Speckle.Objects/Other/DisplayStyle.cs b/src/Speckle.Objects/Other/DisplayStyle.cs index 92a6c103..c285b683 100644 --- a/src/Speckle.Objects/Other/DisplayStyle.cs +++ b/src/Speckle.Objects/Other/DisplayStyle.cs @@ -1,12 +1,13 @@ using System.Drawing; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.Other; +namespace Speckle.Objects.Other; /// /// Minimal display style class. Developed primarily for display styles in Rhino and AutoCAD. /// Rhino object attributes uses OpenNURBS definition for linetypes and lineweights /// +[SpeckleType("Objects.Other.DisplayStyle")] public class DisplayStyle : Base { public string name { get; set; } diff --git a/src/Speckle.Objects/Other/Hatch.cs b/src/Speckle.Objects/Other/Hatch.cs index c18b66f9..ca48ff24 100644 --- a/src/Speckle.Objects/Other/Hatch.cs +++ b/src/Speckle.Objects/Other/Hatch.cs @@ -1,9 +1,8 @@ -using System; -using System.Collections.Generic; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.Other; +namespace Speckle.Objects.Other; +[SpeckleType("Objects.Other.Hatch")] public class Hatch : Base { [Obsolete("Use Loops instead")] @@ -18,6 +17,7 @@ public class Hatch : Base /// /// Represents a Hatch Loop from a 's curve. /// +[SpeckleType("Objects.Other.HatchLoop")] public class HatchLoop : Base { public HatchLoop() { } diff --git a/src/Speckle.Objects/Other/Instance.cs b/src/Speckle.Objects/Other/Instance.cs index 34d5bdd4..3bd03201 100644 --- a/src/Speckle.Objects/Other/Instance.cs +++ b/src/Speckle.Objects/Other/Instance.cs @@ -1,13 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; -using Speckle.Core.Models.GraphTraversal; using Speckle.Newtonsoft.Json; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.GraphTraversal; -namespace Objects.Other; +namespace Speckle.Objects.Other; public abstract class Instance : Base { @@ -116,6 +113,7 @@ internal set /// /// Block instance class /// +[SpeckleType("Objects.Other.BlockInstance")] public class BlockInstance : Instance { public BlockInstance() { } diff --git a/src/Speckle.Objects/Other/MappedBlockWrapper.cs b/src/Speckle.Objects/Other/MappedBlockWrapper.cs index 28daba64..26a47d21 100644 --- a/src/Speckle.Objects/Other/MappedBlockWrapper.cs +++ b/src/Speckle.Objects/Other/MappedBlockWrapper.cs @@ -1,8 +1,9 @@ -using Objects.BuiltElements.Revit; -using Speckle.Core.Models; +using Speckle.Objects.BuiltElements.Revit; +using Speckle.Sdk.Models; -namespace Objects.Other; +namespace Speckle.Objects.Other; +[SpeckleType("Objects.Other.MappedBlockWrapper")] public class MappedBlockWrapper : Base { public string category { get; set; } = RevitCategory.GenericModel.ToString(); diff --git a/src/Speckle.Objects/Other/Material.cs b/src/Speckle.Objects/Other/Material.cs index 83a0e2e8..de98844a 100644 --- a/src/Speckle.Objects/Other/Material.cs +++ b/src/Speckle.Objects/Other/Material.cs @@ -1,11 +1,12 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Other; +namespace Speckle.Objects.Other; /// /// Generic class for materials containing generic parameters /// +[SpeckleType("Objects.Other.Material")] public class Material : Base { public Material() { } diff --git a/src/Speckle.Objects/Other/MaterialQuantity.cs b/src/Speckle.Objects/Other/MaterialQuantity.cs index 790690a1..900468f7 100644 --- a/src/Speckle.Objects/Other/MaterialQuantity.cs +++ b/src/Speckle.Objects/Other/MaterialQuantity.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Other; +namespace Speckle.Objects.Other; +[SpeckleType("Objects.Other.MaterialQuantity")] public class MaterialQuantity : Base { public MaterialQuantity() { } diff --git a/src/Speckle.Objects/Other/RenderMaterial.cs b/src/Speckle.Objects/Other/RenderMaterial.cs index 8a385e5c..a9b49af9 100644 --- a/src/Speckle.Objects/Other/RenderMaterial.cs +++ b/src/Speckle.Objects/Other/RenderMaterial.cs @@ -1,10 +1,10 @@ using System.Drawing; -using Speckle.Core.Kits; -using Speckle.Core.Models; -using Speckle.Core.Models.Proxies; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Proxies; -namespace Objects.Other; +namespace Speckle.Objects.Other; /// /// Minimal physically based material DTO class. Based on references from @@ -14,6 +14,7 @@ namespace Objects.Other; /// See: https://docs.unrealengine.com/en-US/RenderingAndGraphics/Materials/PhysicallyBased/index.html /// And: https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/ /// +[SpeckleType("Objects.Other.RenderMaterial")] public class RenderMaterial : Base { public RenderMaterial() { } @@ -63,6 +64,7 @@ public Color emissiveColor /// /// Used to store render material to object relationships in root collections /// +[SpeckleType("Objects.Other.RenderMaterialProxy")] public class RenderMaterialProxy : Base, IProxyCollection { public RenderMaterialProxy() { } diff --git a/src/Speckle.Objects/Other/Revit/RevitInstance.cs b/src/Speckle.Objects/Other/Revit/RevitInstance.cs index 967eb338..d4eabcf7 100644 --- a/src/Speckle.Objects/Other/Revit/RevitInstance.cs +++ b/src/Speckle.Objects/Other/Revit/RevitInstance.cs @@ -1,13 +1,12 @@ -using System.Collections.Generic; -using System.Linq; -using Objects.BuiltElements; -using Objects.BuiltElements.Revit; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.BuiltElements; +using Speckle.Objects.BuiltElements.Revit; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Other.Revit; +namespace Speckle.Objects.Other.Revit; +[SpeckleType("Objects.Other.Revit.RevitInstance")] public class RevitInstance : Instance { public Level level { get; set; } diff --git a/src/Speckle.Objects/Other/Revit/RevitMaterial.cs b/src/Speckle.Objects/Other/Revit/RevitMaterial.cs index 943950fd..e8d120b8 100644 --- a/src/Speckle.Objects/Other/Revit/RevitMaterial.cs +++ b/src/Speckle.Objects/Other/Revit/RevitMaterial.cs @@ -1,14 +1,14 @@ -using System.Collections.Generic; -using Objects.BuiltElements.Revit; -using Objects.Utils; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.BuiltElements.Revit; +using Speckle.Objects.Utils; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Other.Revit; +namespace Speckle.Objects.Other.Revit; /// /// Material in Revit defininf all revit properties from Autodesk.Revit.DB.Material /// +[SpeckleType("Objects.Other.Revit.RevitMaterial")] public class RevitMaterial : Material { public RevitMaterial() { } diff --git a/src/Speckle.Objects/Other/Text.cs b/src/Speckle.Objects/Other/Text.cs index 22802b19..ccf21b19 100644 --- a/src/Speckle.Objects/Other/Text.cs +++ b/src/Speckle.Objects/Other/Text.cs @@ -1,12 +1,12 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Models; -namespace Objects.Other; +namespace Speckle.Objects.Other; /// /// Text class for Rhino and AutoCAD /// +[SpeckleType("Objects.Other.Text")] public class Text : Base, IDisplayValue> { public Plane plane { get; set; } // origin should be center diff --git a/src/Speckle.Objects/Other/Transform.cs b/src/Speckle.Objects/Other/Transform.cs index 74d38e0b..5f6f75fd 100644 --- a/src/Speckle.Objects/Other/Transform.cs +++ b/src/Speckle.Objects/Other/Transform.cs @@ -1,18 +1,18 @@ -using System; -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Logging; -using Speckle.Core.Models; using Speckle.DoubleNumerics; using Speckle.Newtonsoft.Json; -using Vector = Objects.Geometry.Vector; +using Speckle.Objects.Geometry; +using Speckle.Sdk; +using Speckle.Sdk.Common; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; +using Vector = Speckle.Objects.Geometry.Vector; -namespace Objects.Other; +namespace Speckle.Objects.Other; /// /// Generic transform class /// +[SpeckleType("Objects.Other.Transform")] public class Transform : Base { public Transform() { } diff --git a/src/Speckle.Objects/Primitive/Chunk.cs b/src/Speckle.Objects/Primitive/Chunk.cs deleted file mode 100644 index 96e58c7e..00000000 --- a/src/Speckle.Objects/Primitive/Chunk.cs +++ /dev/null @@ -1,9 +0,0 @@ -//namespace Objects.Primitive -//{ -// [SchemaIgnore] -// public class Chunk : Base -// { -// public List data { get; set; } = new List(); -// public Chunk() { } -// } -//} diff --git a/src/Speckle.Objects/Primitive/Interval.cs b/src/Speckle.Objects/Primitive/Interval.cs index b393db5f..b1d03016 100644 --- a/src/Speckle.Objects/Primitive/Interval.cs +++ b/src/Speckle.Objects/Primitive/Interval.cs @@ -1,9 +1,9 @@ -using System; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Models; -namespace Objects.Primitive; +namespace Speckle.Objects.Primitive; +[SpeckleType("Objects.Primitive.Interval")] public class Interval : Base { public Interval() { } diff --git a/src/Speckle.Objects/Primitive/Interval2d.cs b/src/Speckle.Objects/Primitive/Interval2d.cs index fc2cd985..528f4a99 100644 --- a/src/Speckle.Objects/Primitive/Interval2d.cs +++ b/src/Speckle.Objects/Primitive/Interval2d.cs @@ -1,7 +1,8 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.Primitive; +namespace Speckle.Objects.Primitive; +[SpeckleType("Objects.Primitive.Interval2d")] public class Interval2d : Base { public Interval2d() { } diff --git a/src/Speckle.Objects/Speckle.Objects.csproj b/src/Speckle.Objects/Speckle.Objects.csproj index 984e6f86..4972f4d5 100644 --- a/src/Speckle.Objects/Speckle.Objects.csproj +++ b/src/Speckle.Objects/Speckle.Objects.csproj @@ -17,6 +17,6 @@ - + diff --git a/src/Speckle.Objects/Structural/Analysis/Model.cs b/src/Speckle.Objects/Structural/Analysis/Model.cs index 4092ec7c..89a4d80f 100644 --- a/src/Speckle.Objects/Structural/Analysis/Model.cs +++ b/src/Speckle.Objects/Structural/Analysis/Model.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Analysis; +namespace Speckle.Objects.Structural.Analysis; +[SpeckleType("Objects.Structural.Analysis.Model")] public class Model : Base { public Model() { } diff --git a/src/Speckle.Objects/Structural/Analysis/ModelInfo.cs b/src/Speckle.Objects/Structural/Analysis/ModelInfo.cs index 9acd4ee6..efe2990a 100644 --- a/src/Speckle.Objects/Structural/Analysis/ModelInfo.cs +++ b/src/Speckle.Objects/Structural/Analysis/ModelInfo.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Analysis; +namespace Speckle.Objects.Structural.Analysis; +[SpeckleType("Objects.Structural.Analysis.ModelInfo")] public class ModelInfo : Base //titles { public ModelInfo() { } diff --git a/src/Speckle.Objects/Structural/Analysis/ModelSettings.cs b/src/Speckle.Objects/Structural/Analysis/ModelSettings.cs index 3ec1a2c0..af18344a 100644 --- a/src/Speckle.Objects/Structural/Analysis/ModelSettings.cs +++ b/src/Speckle.Objects/Structural/Analysis/ModelSettings.cs @@ -1,11 +1,12 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Analysis; +namespace Speckle.Objects.Structural.Analysis; /// /// Codes and standards references, model units, design settings, analysis settings, precision and tolerances /// +[SpeckleType("Objects.Structural.Analysis.ModelSettings")] public class ModelSettings : Base { public ModelSettings() { } diff --git a/src/Speckle.Objects/Structural/Analysis/ModelUnits.cs b/src/Speckle.Objects/Structural/Analysis/ModelUnits.cs index 9413fb76..05c24b8d 100644 --- a/src/Speckle.Objects/Structural/Analysis/ModelUnits.cs +++ b/src/Speckle.Objects/Structural/Analysis/ModelUnits.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Analysis; +namespace Speckle.Objects.Structural.Analysis; +[SpeckleType("Objects.Structural.Analysis.ModelUnits")] public class ModelUnits : Base { public ModelUnits() { } diff --git a/src/Speckle.Objects/Structural/Analysis/UnitTypes.cs b/src/Speckle.Objects/Structural/Analysis/UnitTypes.cs index 07bca554..c7ad5596 100644 --- a/src/Speckle.Objects/Structural/Analysis/UnitTypes.cs +++ b/src/Speckle.Objects/Structural/Analysis/UnitTypes.cs @@ -1,4 +1,4 @@ -namespace Objects.Structural.Analysis; +namespace Speckle.Objects.Structural.Analysis; public enum UnitsType { diff --git a/src/Speckle.Objects/Structural/Axis.cs b/src/Speckle.Objects/Structural/Axis.cs index 5b9c47f5..25d32c87 100644 --- a/src/Speckle.Objects/Structural/Axis.cs +++ b/src/Speckle.Objects/Structural/Axis.cs @@ -1,4 +1,4 @@ -namespace Objects.Structural; +namespace Speckle.Objects.Structural; public enum AxisType { diff --git a/src/Speckle.Objects/Structural/CSI/Analysis/CSIStories.cs b/src/Speckle.Objects/Structural/CSI/Analysis/CSIStories.cs index e6fafb11..6ef3a7d0 100644 --- a/src/Speckle.Objects/Structural/CSI/Analysis/CSIStories.cs +++ b/src/Speckle.Objects/Structural/CSI/Analysis/CSIStories.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Analysis; +namespace Speckle.Objects.Structural.CSI.Analysis; +[SpeckleType("Objects.Structural.CSI.Analysis.CSIStories")] public class CSIStories : Base { public double BaseElevation { get; set; } @@ -13,6 +13,7 @@ public class CSIStories : Base public List CSIStory { get; set; } } +[SpeckleType("Objects.Structural.CSI.Analysis.CSIStorey")] public class CSIStorey : Storey { public CSIStorey( diff --git a/src/Speckle.Objects/Structural/CSI/Analysis/ETABSAnalysis.cs b/src/Speckle.Objects/Structural/CSI/Analysis/ETABSAnalysis.cs index ff502125..0d54d69e 100644 --- a/src/Speckle.Objects/Structural/CSI/Analysis/ETABSAnalysis.cs +++ b/src/Speckle.Objects/Structural/CSI/Analysis/ETABSAnalysis.cs @@ -1,13 +1,15 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Analysis; +namespace Speckle.Objects.Structural.CSI.Analysis; +[SpeckleType("Objects.Structural.CSI.Analysis.CSIAnalysis")] public class CSIAnalysis : Base { public ActiveDOFs activeDOFs { get; set; } public FloorMeshSettings floorMeshSettings { get; set; } } +[SpeckleType("Objects.Structural.CSI.Analysis.ActiveDOFs")] public class ActiveDOFs : Base { public ActiveDOFs() { } @@ -30,6 +32,7 @@ public ActiveDOFs(bool UX, bool UY, bool UZ, bool RX, bool RY, bool RZ) public bool RZ { get; set; } } +[SpeckleType("Objects.Structural.CSI.Analysis.FloorMeshSettings")] public class FloorMeshSettings : Base { public FloorMeshSettings() { } @@ -44,6 +47,7 @@ public FloorMeshSettings(MeshOption meshOption, double maximumMeshSize) public double maximumMeshSize { get; set; } } +[SpeckleType("Objects.Structural.CSI.Analysis.WallMeshSettings")] public class WallMeshSettings : Base { public WallMeshSettings() { } @@ -56,6 +60,7 @@ public WallMeshSettings(double maximumMeshSize) public double maximumMeshSize { get; set; } } +[SpeckleType("Objects.Structural.CSI.Analysis.CrackingAnalysisOptions")] public class CrackingAnalysisOptions : Base { public CrackingAnalysisOptions() { } @@ -72,6 +77,7 @@ public CrackingAnalysisOptions(string reinforcementSource, double minTensionRati public double minCompressionRatio { get; set; } } +[SpeckleType("Objects.Structural.CSI.Analysis.SAPFireOptions")] public class SAPFireOptions : Base { public SAPFireOptions() { } diff --git a/src/Speckle.Objects/Structural/CSI/Analysis/ETABSAreaType.cs b/src/Speckle.Objects/Structural/CSI/Analysis/ETABSAreaType.cs index 23fdcd1f..4baed6f3 100644 --- a/src/Speckle.Objects/Structural/CSI/Analysis/ETABSAreaType.cs +++ b/src/Speckle.Objects/Structural/CSI/Analysis/ETABSAreaType.cs @@ -1,4 +1,4 @@ -namespace Objects.Structural.CSI.Analysis; +namespace Speckle.Objects.Structural.CSI.Analysis; public enum CSIPropertyType2D { diff --git a/src/Speckle.Objects/Structural/CSI/Analysis/ETABSLoadingType.cs b/src/Speckle.Objects/Structural/CSI/Analysis/ETABSLoadingType.cs index abb38360..7da15361 100644 --- a/src/Speckle.Objects/Structural/CSI/Analysis/ETABSLoadingType.cs +++ b/src/Speckle.Objects/Structural/CSI/Analysis/ETABSLoadingType.cs @@ -1,4 +1,4 @@ -namespace Objects.Structural.CSI.Analysis; +namespace Speckle.Objects.Structural.CSI.Analysis; public enum WindPressureType { diff --git a/src/Speckle.Objects/Structural/CSI/Geometry/CSIElement1D.cs b/src/Speckle.Objects/Structural/CSI/Geometry/CSIElement1D.cs index 44d682b4..fad1cb9a 100644 --- a/src/Speckle.Objects/Structural/CSI/Geometry/CSIElement1D.cs +++ b/src/Speckle.Objects/Structural/CSI/Geometry/CSIElement1D.cs @@ -1,13 +1,14 @@ -using Objects.Geometry; -using Objects.Structural.CSI.Properties; -using Objects.Structural.Geometry; -using Objects.Structural.Properties; -using Objects.Structural.Results; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.CSI.Properties; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Properties; +using Speckle.Objects.Structural.Results; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Geometry; +namespace Speckle.Objects.Structural.CSI.Geometry; +[SpeckleType("Objects.Structural.CSI.Geometry.CSIElement1D")] public class CSIElement1D : Element1D { /// diff --git a/src/Speckle.Objects/Structural/CSI/Geometry/CSIElement2D.cs b/src/Speckle.Objects/Structural/CSI/Geometry/CSIElement2D.cs index cdf6a586..8cf5dcc0 100644 --- a/src/Speckle.Objects/Structural/CSI/Geometry/CSIElement2D.cs +++ b/src/Speckle.Objects/Structural/CSI/Geometry/CSIElement2D.cs @@ -1,13 +1,13 @@ -using System.Collections.Generic; -using Objects.Structural.CSI.Properties; -using Objects.Structural.Geometry; -using Objects.Structural.Properties; -using Objects.Structural.Results; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.CSI.Properties; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Properties; +using Speckle.Objects.Structural.Results; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Geometry; +namespace Speckle.Objects.Structural.CSI.Geometry; +[SpeckleType("Objects.Structural.CSI.Geometry.CSIElement2D")] public class CSIElement2D : Element2D { [SchemaInfo( diff --git a/src/Speckle.Objects/Structural/CSI/Geometry/CSIGridLines.cs b/src/Speckle.Objects/Structural/CSI/Geometry/CSIGridLines.cs index 77b4b153..fb480d44 100644 --- a/src/Speckle.Objects/Structural/CSI/Geometry/CSIGridLines.cs +++ b/src/Speckle.Objects/Structural/CSI/Geometry/CSIGridLines.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Objects.BuiltElements; -using Speckle.Core.Models; +using Speckle.Objects.BuiltElements; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Geometry; +namespace Speckle.Objects.Structural.CSI.Geometry; +[SpeckleType("Objects.Structural.CSI.Geometry.CSIGridLines")] public class CSIGridLines : Base { public double Xo { get; set; } diff --git a/src/Speckle.Objects/Structural/CSI/Geometry/CSINode.cs b/src/Speckle.Objects/Structural/CSI/Geometry/CSINode.cs index 95bff5b5..43657985 100644 --- a/src/Speckle.Objects/Structural/CSI/Geometry/CSINode.cs +++ b/src/Speckle.Objects/Structural/CSI/Geometry/CSINode.cs @@ -1,13 +1,14 @@ -using Objects.Geometry; -using Objects.Structural.CSI.Properties; -using Objects.Structural.Geometry; -using Objects.Structural.Properties; -using Objects.Structural.Results; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.CSI.Properties; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Properties; +using Speckle.Objects.Structural.Results; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Geometry; +namespace Speckle.Objects.Structural.CSI.Geometry; +[SpeckleType("Objects.Structural.CSI.Geometry.CSINode")] public class CSINode : Node { [SchemaInfo( diff --git a/src/Speckle.Objects/Structural/CSI/Geometry/CSIPier.cs b/src/Speckle.Objects/Structural/CSI/Geometry/CSIPier.cs index 6e727ada..4a5f9def 100644 --- a/src/Speckle.Objects/Structural/CSI/Geometry/CSIPier.cs +++ b/src/Speckle.Objects/Structural/CSI/Geometry/CSIPier.cs @@ -1,7 +1,8 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Geometry; +namespace Speckle.Objects.Structural.CSI.Geometry; +[SpeckleType("Objects.Structural.CSI.Geometry.CSIPier")] public class CSIPier : Base { public CSIPier( diff --git a/src/Speckle.Objects/Structural/CSI/Geometry/CSISpandrel.cs b/src/Speckle.Objects/Structural/CSI/Geometry/CSISpandrel.cs index bc7b3819..55b00b50 100644 --- a/src/Speckle.Objects/Structural/CSI/Geometry/CSISpandrel.cs +++ b/src/Speckle.Objects/Structural/CSI/Geometry/CSISpandrel.cs @@ -1,7 +1,8 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Geometry; +namespace Speckle.Objects.Structural.CSI.Geometry; +[SpeckleType("Objects.Structural.CSI.Geometry.CSISpandrel")] public class CSISpandrel : Base { public CSISpandrel( diff --git a/src/Speckle.Objects/Structural/CSI/Geometry/CSITendon.cs b/src/Speckle.Objects/Structural/CSI/Geometry/CSITendon.cs index ad7c1a08..82eb3a04 100644 --- a/src/Speckle.Objects/Structural/CSI/Geometry/CSITendon.cs +++ b/src/Speckle.Objects/Structural/CSI/Geometry/CSITendon.cs @@ -1,9 +1,10 @@ -using Objects.Geometry; -using Objects.Structural.CSI.Properties; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.CSI.Properties; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Geometry; +namespace Speckle.Objects.Structural.CSI.Geometry; +[SpeckleType("Objects.Structural.CSI.Geometry.CSITendon")] public class CSITendon : CSIElement1D { public CSITendon(string name, Polycurve polycurve, CSITendonProperty CSITendonProperty) diff --git a/src/Speckle.Objects/Structural/CSI/Loading/CSIWindLoading.cs b/src/Speckle.Objects/Structural/CSI/Loading/CSIWindLoading.cs index c1143183..4091ea0e 100644 --- a/src/Speckle.Objects/Structural/CSI/Loading/CSIWindLoading.cs +++ b/src/Speckle.Objects/Structural/CSI/Loading/CSIWindLoading.cs @@ -1,8 +1,10 @@ -using Objects.Structural.CSI.Analysis; -using Objects.Structural.Loading; +using Speckle.Objects.Structural.CSI.Analysis; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Loading; +namespace Speckle.Objects.Structural.CSI.Loading; +[SpeckleType("Objects.Structural.CSI.Loading.CSIWindLoadingFace")] public class CSIWindLoadingFace : LoadFace { public double Cp { get; set; } diff --git a/src/Speckle.Objects/Structural/CSI/Materials/CSIConcrete.cs b/src/Speckle.Objects/Structural/CSI/Materials/CSIConcrete.cs index 9c7c2073..3501e9d1 100644 --- a/src/Speckle.Objects/Structural/CSI/Materials/CSIConcrete.cs +++ b/src/Speckle.Objects/Structural/CSI/Materials/CSIConcrete.cs @@ -1,7 +1,9 @@ -using Objects.Structural.Materials; +using Speckle.Objects.Structural.Materials; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Materials; +namespace Speckle.Objects.Structural.CSI.Materials; +[SpeckleType("Objects.Structural.CSI.Materials.CSIConcrete")] public class CSIConcrete : Concrete { public int SSHysType { get; set; } diff --git a/src/Speckle.Objects/Structural/CSI/Materials/CSIRebar.cs b/src/Speckle.Objects/Structural/CSI/Materials/CSIRebar.cs index 960494ea..622b53bd 100644 --- a/src/Speckle.Objects/Structural/CSI/Materials/CSIRebar.cs +++ b/src/Speckle.Objects/Structural/CSI/Materials/CSIRebar.cs @@ -1,5 +1,7 @@ -using Objects.Structural.Materials; +using Speckle.Objects.Structural.Materials; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Materials; +namespace Speckle.Objects.Structural.CSI.Materials; +[SpeckleType("Objects.Structural.CSI.Materials.CSIRebar")] public class CSIRebar : StructuralMaterial { } diff --git a/src/Speckle.Objects/Structural/CSI/Materials/CSISteel.cs b/src/Speckle.Objects/Structural/CSI/Materials/CSISteel.cs index da707278..a915c36b 100644 --- a/src/Speckle.Objects/Structural/CSI/Materials/CSISteel.cs +++ b/src/Speckle.Objects/Structural/CSI/Materials/CSISteel.cs @@ -1,7 +1,9 @@ -using Objects.Structural.Materials; +using Speckle.Objects.Structural.Materials; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Materials; +namespace Speckle.Objects.Structural.CSI.Materials; +[SpeckleType("Objects.Structural.CSI.Materials.CSISteel")] public class CSISteel : Steel { public int SSHysType { get; set; } diff --git a/src/Speckle.Objects/Structural/CSI/Properties/CSIDiaphragm.cs b/src/Speckle.Objects/Structural/CSI/Properties/CSIDiaphragm.cs index 8326fcba..13abbff5 100644 --- a/src/Speckle.Objects/Structural/CSI/Properties/CSIDiaphragm.cs +++ b/src/Speckle.Objects/Structural/CSI/Properties/CSIDiaphragm.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Properties; +namespace Speckle.Objects.Structural.CSI.Properties; +[SpeckleType("Objects.Structural.CSI.Properties.CSIDiaphragm")] public class CSIDiaphragm : Base { [SchemaInfo("CSI Diaphragm", "Create an CSI Diaphragm", "CSI", "Properties")] diff --git a/src/Speckle.Objects/Structural/CSI/Properties/CSILinkProperty.cs b/src/Speckle.Objects/Structural/CSI/Properties/CSILinkProperty.cs index 25f03032..e53848ee 100644 --- a/src/Speckle.Objects/Structural/CSI/Properties/CSILinkProperty.cs +++ b/src/Speckle.Objects/Structural/CSI/Properties/CSILinkProperty.cs @@ -1,8 +1,10 @@ -using Objects.Structural.Properties; -using Speckle.Core.Kits; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Properties; +namespace Speckle.Objects.Structural.CSI.Properties; +[SpeckleType("Objects.Structural.CSI.Properties.CSILinkProperty")] public class CSILinkProperty : Property1D { [SchemaInfo("CSILink", "Create an CSI Link Property", "CSI", "Properties")] diff --git a/src/Speckle.Objects/Structural/CSI/Properties/CSIProperty2D.cs b/src/Speckle.Objects/Structural/CSI/Properties/CSIProperty2D.cs index 92eac668..cc22d9c1 100644 --- a/src/Speckle.Objects/Structural/CSI/Properties/CSIProperty2D.cs +++ b/src/Speckle.Objects/Structural/CSI/Properties/CSIProperty2D.cs @@ -1,10 +1,12 @@ -using Objects.Structural.CSI.Analysis; -using Objects.Structural.Materials; -using Objects.Structural.Properties; -using Speckle.Core.Kits; +using Speckle.Objects.Structural.CSI.Analysis; +using Speckle.Objects.Structural.Materials; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Properties; +namespace Speckle.Objects.Structural.CSI.Properties; +[SpeckleType("Objects.Structural.CSI.Properties.CSIOpening")] public class CSIOpening : Property2D { [SchemaInfo("Opening", "Create an CSI Opening", "CSI", "Properties")] @@ -18,6 +20,7 @@ public CSIOpening() { } public bool isOpening { get; set; } } +[SpeckleType("Objects.Structural.CSI.Properties.CSIProperty2D")] public class CSIProperty2D : Property2D { public CSIPropertyType2D type2D { get; set; } diff --git a/src/Speckle.Objects/Structural/CSI/Properties/CSISpringProperty.cs b/src/Speckle.Objects/Structural/CSI/Properties/CSISpringProperty.cs index eb2bd17c..184896c1 100644 --- a/src/Speckle.Objects/Structural/CSI/Properties/CSISpringProperty.cs +++ b/src/Speckle.Objects/Structural/CSI/Properties/CSISpringProperty.cs @@ -1,8 +1,10 @@ -using Objects.Structural.Properties; -using Speckle.Core.Kits; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Properties; +namespace Speckle.Objects.Structural.CSI.Properties; +[SpeckleType("Objects.Structural.CSI.Properties.CSISpringProperty")] public class CSISpringProperty : PropertySpring { public CSISpringProperty() { } @@ -47,6 +49,7 @@ public CSISpringProperty(string name, string soilProfile, string footing, double public double period { get; set; } } +[SpeckleType("Objects.Structural.CSI.Properties.CSILinearSpring")] public class CSILinearSpring : PropertySpring { public CSILinearSpring() { } @@ -77,6 +80,7 @@ public CSILinearSpring( public NonLinearOptions LinearOption2 { get; set; } } +[SpeckleType("Objects.Structural.CSI.Properties.CSIAreaSpring")] public class CSIAreaSpring : PropertySpring { public CSIAreaSpring() { } diff --git a/src/Speckle.Objects/Structural/CSI/Properties/CSITendonProperty.cs b/src/Speckle.Objects/Structural/CSI/Properties/CSITendonProperty.cs index 7ecccfd4..0fd0fee7 100644 --- a/src/Speckle.Objects/Structural/CSI/Properties/CSITendonProperty.cs +++ b/src/Speckle.Objects/Structural/CSI/Properties/CSITendonProperty.cs @@ -1,7 +1,9 @@ -using Objects.Structural.Properties; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Models; -namespace Objects.Structural.CSI.Properties; +namespace Speckle.Objects.Structural.CSI.Properties; +[SpeckleType("Objects.Structural.CSI.Properties.CSITendonProperty")] public class CSITendonProperty : Property1D { public ModelingOption modelingOption { get; set; } diff --git a/src/Speckle.Objects/Structural/CSI/Properties/ETABSProperty.cs b/src/Speckle.Objects/Structural/CSI/Properties/ETABSProperty.cs index a5f2cb39..76290979 100644 --- a/src/Speckle.Objects/Structural/CSI/Properties/ETABSProperty.cs +++ b/src/Speckle.Objects/Structural/CSI/Properties/ETABSProperty.cs @@ -1,4 +1,4 @@ -namespace Objects.Structural.CSI.Properties; +namespace Speckle.Objects.Structural.CSI.Properties; public enum DiaphragmOption { diff --git a/src/Speckle.Objects/Structural/GSA/Analysis/GSAAnalysisCase.cs b/src/Speckle.Objects/Structural/GSA/Analysis/GSAAnalysisCase.cs index 09390a02..46fc3041 100644 --- a/src/Speckle.Objects/Structural/GSA/Analysis/GSAAnalysisCase.cs +++ b/src/Speckle.Objects/Structural/GSA/Analysis/GSAAnalysisCase.cs @@ -1,11 +1,10 @@ -using System; -using System.Collections.Generic; -using Objects.Structural.Loading; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Analysis; +namespace Speckle.Objects.Structural.GSA.Analysis; +[SpeckleType("Objects.Structural.GSA.Analysis.GSAAnalysisCase")] public class GSAAnalysisCase : Base { public GSAAnalysisCase() { } diff --git a/src/Speckle.Objects/Structural/GSA/Analysis/GSAStage.cs b/src/Speckle.Objects/Structural/GSA/Analysis/GSAStage.cs index d158d459..38cc2b29 100644 --- a/src/Speckle.Objects/Structural/GSA/Analysis/GSAStage.cs +++ b/src/Speckle.Objects/Structural/GSA/Analysis/GSAStage.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Analysis; +namespace Speckle.Objects.Structural.GSA.Analysis; +[SpeckleType("Objects.Structural.GSA.Analysis.GSAStage")] public class GSAStage : Base { public GSAStage() { } diff --git a/src/Speckle.Objects/Structural/GSA/Analysis/GSATask.cs b/src/Speckle.Objects/Structural/GSA/Analysis/GSATask.cs index 8aaf3def..002ba506 100644 --- a/src/Speckle.Objects/Structural/GSA/Analysis/GSATask.cs +++ b/src/Speckle.Objects/Structural/GSA/Analysis/GSATask.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Analysis; +namespace Speckle.Objects.Structural.GSA.Analysis; +[SpeckleType("Objects.Structural.GSA.Analysis.GSATask")] public class GSATask : Base { public GSATask() { } diff --git a/src/Speckle.Objects/Structural/GSA/Bridge/GSAAlignment.cs b/src/Speckle.Objects/Structural/GSA/Bridge/GSAAlignment.cs index 75301910..96d6e3be 100644 --- a/src/Speckle.Objects/Structural/GSA/Bridge/GSAAlignment.cs +++ b/src/Speckle.Objects/Structural/GSA/Bridge/GSAAlignment.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Structural.GSA.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.GSA.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Bridge; +namespace Speckle.Objects.Structural.GSA.Bridge; +[SpeckleType("Objects.Structural.GSA.Bridge.GSAAlignment")] public class GSAAlignment : Base { public GSAAlignment() { } diff --git a/src/Speckle.Objects/Structural/GSA/Bridge/GSAInfluence.cs b/src/Speckle.Objects/Structural/GSA/Bridge/GSAInfluence.cs index 6440d9ad..fe4faf93 100644 --- a/src/Speckle.Objects/Structural/GSA/Bridge/GSAInfluence.cs +++ b/src/Speckle.Objects/Structural/GSA/Bridge/GSAInfluence.cs @@ -1,8 +1,9 @@ -using Objects.Structural.Loading; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Bridge; +namespace Speckle.Objects.Structural.GSA.Bridge; +[SpeckleType("Objects.Structural.GSA.Bridge.GSAInfluence")] public class GSAInfluence : Base { public GSAInfluence() { } diff --git a/src/Speckle.Objects/Structural/GSA/Bridge/GSAInfluenceBeam.cs b/src/Speckle.Objects/Structural/GSA/Bridge/GSAInfluenceBeam.cs index 3457977b..f0bbf2a3 100644 --- a/src/Speckle.Objects/Structural/GSA/Bridge/GSAInfluenceBeam.cs +++ b/src/Speckle.Objects/Structural/GSA/Bridge/GSAInfluenceBeam.cs @@ -1,10 +1,11 @@ -using Objects.Structural.GSA.Geometry; -using Objects.Structural.Loading; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.GSA.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Bridge; +namespace Speckle.Objects.Structural.GSA.Bridge; +[SpeckleType("Objects.Structural.GSA.Bridge.GSAInfluenceBeam")] public class GSAInfluenceBeam : GSAInfluence { public GSAInfluenceBeam() { } diff --git a/src/Speckle.Objects/Structural/GSA/Bridge/GSAInfluenceNode.cs b/src/Speckle.Objects/Structural/GSA/Bridge/GSAInfluenceNode.cs index 7794fc96..2b79964b 100644 --- a/src/Speckle.Objects/Structural/GSA/Bridge/GSAInfluenceNode.cs +++ b/src/Speckle.Objects/Structural/GSA/Bridge/GSAInfluenceNode.cs @@ -1,10 +1,11 @@ -using Objects.Structural.Geometry; -using Objects.Structural.Loading; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Bridge; +namespace Speckle.Objects.Structural.GSA.Bridge; +[SpeckleType("Objects.Structural.GSA.Bridge.GSAInfluenceNode")] public class GSAInfluenceNode : GSAInfluence { public GSAInfluenceNode() { } diff --git a/src/Speckle.Objects/Structural/GSA/Bridge/GSAPath.cs b/src/Speckle.Objects/Structural/GSA/Bridge/GSAPath.cs index d2b6254c..d24f8d8e 100644 --- a/src/Speckle.Objects/Structural/GSA/Bridge/GSAPath.cs +++ b/src/Speckle.Objects/Structural/GSA/Bridge/GSAPath.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Bridge; +namespace Speckle.Objects.Structural.GSA.Bridge; +[SpeckleType("Objects.Structural.GSA.Bridge.GSAPath")] public class GSAPath : Base { public GSAPath() { } diff --git a/src/Speckle.Objects/Structural/GSA/Bridge/GSAUserVehicle.cs b/src/Speckle.Objects/Structural/GSA/Bridge/GSAUserVehicle.cs index 9a49cba8..59fa1ef2 100644 --- a/src/Speckle.Objects/Structural/GSA/Bridge/GSAUserVehicle.cs +++ b/src/Speckle.Objects/Structural/GSA/Bridge/GSAUserVehicle.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Bridge; +namespace Speckle.Objects.Structural.GSA.Bridge; +[SpeckleType("Objects.Structural.GSA.Bridge.GSAUserVehicle")] public class GSAUserVehicle : Base { public GSAUserVehicle() { } diff --git a/src/Speckle.Objects/Structural/GSA/Geometry/GSAAssembly.cs b/src/Speckle.Objects/Structural/GSA/Geometry/GSAAssembly.cs index ca4e54d9..a0f57570 100644 --- a/src/Speckle.Objects/Structural/GSA/Geometry/GSAAssembly.cs +++ b/src/Speckle.Objects/Structural/GSA/Geometry/GSAAssembly.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Geometry; +namespace Speckle.Objects.Structural.GSA.Geometry; +[SpeckleType("Objects.Structural.GSA.Geometry.GSAAssembly")] public class GSAAssembly : Base { public GSAAssembly() { } diff --git a/src/Speckle.Objects/Structural/GSA/Geometry/GSAElement1D.cs b/src/Speckle.Objects/Structural/GSA/Geometry/GSAElement1D.cs index e59c1113..48e8b43f 100644 --- a/src/Speckle.Objects/Structural/GSA/Geometry/GSAElement1D.cs +++ b/src/Speckle.Objects/Structural/GSA/Geometry/GSAElement1D.cs @@ -1,10 +1,12 @@ -using Objects.Geometry; -using Objects.Structural.Geometry; -using Objects.Structural.Properties; -using Speckle.Core.Kits; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Geometry; +namespace Speckle.Objects.Structural.GSA.Geometry; +[SpeckleType("Objects.Structural.GSA.Geometry.GSAElement1D")] public class GSAElement1D : Element1D { public GSAElement1D() { } diff --git a/src/Speckle.Objects/Structural/GSA/Geometry/GSAElement2D.cs b/src/Speckle.Objects/Structural/GSA/Geometry/GSAElement2D.cs index 06a921dd..5797e2f1 100644 --- a/src/Speckle.Objects/Structural/GSA/Geometry/GSAElement2D.cs +++ b/src/Speckle.Objects/Structural/GSA/Geometry/GSAElement2D.cs @@ -1,10 +1,11 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Objects.Structural.Properties; -using Speckle.Core.Kits; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Geometry; +namespace Speckle.Objects.Structural.GSA.Geometry; +[SpeckleType("Objects.Structural.GSA.Geometry.GSAElement2D")] public class GSAElement2D : Element2D { public GSAElement2D() { } diff --git a/src/Speckle.Objects/Structural/GSA/Geometry/GSAElement3D.cs b/src/Speckle.Objects/Structural/GSA/Geometry/GSAElement3D.cs index ab9c97ad..b01e225e 100644 --- a/src/Speckle.Objects/Structural/GSA/Geometry/GSAElement3D.cs +++ b/src/Speckle.Objects/Structural/GSA/Geometry/GSAElement3D.cs @@ -1,10 +1,12 @@ -using Objects.Geometry; -using Objects.Structural.Geometry; -using Objects.Structural.Properties; -using Speckle.Core.Kits; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Geometry; +namespace Speckle.Objects.Structural.GSA.Geometry; +[SpeckleType("Objects.Structural.GSA.Geometry.GSAElement3D")] public class GSAElement3D : Element3D { public GSAElement3D() { } diff --git a/src/Speckle.Objects/Structural/GSA/Geometry/GSAGeneralisedRestraint.cs b/src/Speckle.Objects/Structural/GSA/Geometry/GSAGeneralisedRestraint.cs index 54ee9384..e862d3e7 100644 --- a/src/Speckle.Objects/Structural/GSA/Geometry/GSAGeneralisedRestraint.cs +++ b/src/Speckle.Objects/Structural/GSA/Geometry/GSAGeneralisedRestraint.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Objects.Structural.GSA.Analysis; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.GSA.Analysis; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Geometry; +namespace Speckle.Objects.Structural.GSA.Geometry; +[SpeckleType("Objects.Structural.GSA.Geometry.GSAGeneralisedRestraint")] public class GSAGeneralisedRestraint : Base { public GSAGeneralisedRestraint() { } diff --git a/src/Speckle.Objects/Structural/GSA/Geometry/GSAGridLine.cs b/src/Speckle.Objects/Structural/GSA/Geometry/GSAGridLine.cs index 6a878cfb..38b08c41 100644 --- a/src/Speckle.Objects/Structural/GSA/Geometry/GSAGridLine.cs +++ b/src/Speckle.Objects/Structural/GSA/Geometry/GSAGridLine.cs @@ -1,8 +1,10 @@ -using Objects.BuiltElements; -using Speckle.Core.Kits; +using Speckle.Objects.BuiltElements; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Geometry; +namespace Speckle.Objects.Structural.GSA.Geometry; +[SpeckleType("Objects.Structural.GSA.Geometry.GSAGridLine")] public class GSAGridLine : GridLine { public GSAGridLine() { } diff --git a/src/Speckle.Objects/Structural/GSA/Geometry/GSAGridPlane.cs b/src/Speckle.Objects/Structural/GSA/Geometry/GSAGridPlane.cs index e2b80a89..96b485c3 100644 --- a/src/Speckle.Objects/Structural/GSA/Geometry/GSAGridPlane.cs +++ b/src/Speckle.Objects/Structural/GSA/Geometry/GSAGridPlane.cs @@ -1,9 +1,10 @@ -using Objects.Structural.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Geometry; +namespace Speckle.Objects.Structural.GSA.Geometry; +[SpeckleType("Objects.Structural.GSA.Geometry.GSAGridPlane")] public class GSAGridPlane : Storey { public GSAGridPlane() { } diff --git a/src/Speckle.Objects/Structural/GSA/Geometry/GSAGridSurface.cs b/src/Speckle.Objects/Structural/GSA/Geometry/GSAGridSurface.cs index efe0f39d..ec45949c 100644 --- a/src/Speckle.Objects/Structural/GSA/Geometry/GSAGridSurface.cs +++ b/src/Speckle.Objects/Structural/GSA/Geometry/GSAGridSurface.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Geometry; +namespace Speckle.Objects.Structural.GSA.Geometry; +[SpeckleType("Objects.Structural.GSA.Geometry.GSAGridSurface")] public class GSAGridSurface : Base { public GSAGridSurface() { } diff --git a/src/Speckle.Objects/Structural/GSA/Geometry/GSAMember1D.cs b/src/Speckle.Objects/Structural/GSA/Geometry/GSAMember1D.cs index 0503a7a8..2dbd15e6 100644 --- a/src/Speckle.Objects/Structural/GSA/Geometry/GSAMember1D.cs +++ b/src/Speckle.Objects/Structural/GSA/Geometry/GSAMember1D.cs @@ -1,10 +1,12 @@ -using Objects.Geometry; -using Objects.Structural.Geometry; -using Objects.Structural.Properties; -using Speckle.Core.Kits; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Geometry; +namespace Speckle.Objects.Structural.GSA.Geometry; +[SpeckleType("Objects.Structural.GSA.Geometry.GSAMember1D")] public class GSAMember1D : Element1D { public GSAMember1D() { } diff --git a/src/Speckle.Objects/Structural/GSA/Geometry/GSAMember2D.cs b/src/Speckle.Objects/Structural/GSA/Geometry/GSAMember2D.cs index 2e1eccd8..8027d8c1 100644 --- a/src/Speckle.Objects/Structural/GSA/Geometry/GSAMember2D.cs +++ b/src/Speckle.Objects/Structural/GSA/Geometry/GSAMember2D.cs @@ -1,10 +1,11 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Objects.Structural.Properties; -using Speckle.Core.Kits; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Geometry; +namespace Speckle.Objects.Structural.GSA.Geometry; +[SpeckleType("Objects.Structural.GSA.Geometry.GSAMember2D")] public class GSAMember2D : Element2D { public GSAMember2D() { } diff --git a/src/Speckle.Objects/Structural/GSA/Geometry/GSANode.cs b/src/Speckle.Objects/Structural/GSA/Geometry/GSANode.cs index 4d864476..fe71cc29 100644 --- a/src/Speckle.Objects/Structural/GSA/Geometry/GSANode.cs +++ b/src/Speckle.Objects/Structural/GSA/Geometry/GSANode.cs @@ -1,10 +1,12 @@ -using Objects.Geometry; -using Objects.Structural.Geometry; -using Objects.Structural.Properties; -using Speckle.Core.Kits; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Geometry; +namespace Speckle.Objects.Structural.GSA.Geometry; +[SpeckleType("Objects.Structural.GSA.Geometry.GSANode")] public class GSANode : Node { public GSANode() { } diff --git a/src/Speckle.Objects/Structural/GSA/Geometry/GSARigidConstraint.cs b/src/Speckle.Objects/Structural/GSA/Geometry/GSARigidConstraint.cs index 2dbea840..2eb3cbfd 100644 --- a/src/Speckle.Objects/Structural/GSA/Geometry/GSARigidConstraint.cs +++ b/src/Speckle.Objects/Structural/GSA/Geometry/GSARigidConstraint.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Objects.Structural.GSA.Analysis; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.GSA.Analysis; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Geometry; +namespace Speckle.Objects.Structural.GSA.Geometry; +[SpeckleType("Objects.Structural.GSA.Geometry.GSARigidConstraint")] public class GSARigidConstraint : Base { public GSARigidConstraint() { } diff --git a/src/Speckle.Objects/Structural/GSA/Geometry/GSAStorey.cs b/src/Speckle.Objects/Structural/GSA/Geometry/GSAStorey.cs index 8cda0be4..0369673c 100644 --- a/src/Speckle.Objects/Structural/GSA/Geometry/GSAStorey.cs +++ b/src/Speckle.Objects/Structural/GSA/Geometry/GSAStorey.cs @@ -1,9 +1,10 @@ -using Objects.Structural.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Geometry; +namespace Speckle.Objects.Structural.GSA.Geometry; +[SpeckleType("Objects.Structural.GSA.Geometry.GSAStorey")] public class GSAStorey : Storey { public GSAStorey() { } diff --git a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadBeam.cs b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadBeam.cs index 1efc98da..8b1f229c 100644 --- a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadBeam.cs +++ b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadBeam.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Objects.Structural.Loading; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Loading; +namespace Speckle.Objects.Structural.GSA.Loading; +[SpeckleType("Objects.Structural.GSA.Loading.GSALoadBeam")] public class GSALoadBeam : LoadBeam { public GSALoadBeam() { } diff --git a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadCase.cs b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadCase.cs index 7afb86c8..e41f03bb 100644 --- a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadCase.cs +++ b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadCase.cs @@ -1,8 +1,10 @@ -using Objects.Structural.Loading; -using Speckle.Core.Kits; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Loading; +namespace Speckle.Objects.Structural.GSA.Loading; +[SpeckleType("Objects.Structural.GSA.Loading.GSALoadCase")] public class GSALoadCase : LoadCase { public GSALoadCase() { } diff --git a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadCombination.cs b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadCombination.cs index 7adedb02..a9897e91 100644 --- a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadCombination.cs +++ b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadCombination.cs @@ -1,11 +1,10 @@ -using System; -using System.Collections.Generic; -using Objects.Structural.Loading; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Loading; +namespace Speckle.Objects.Structural.GSA.Loading; +[SpeckleType("Objects.Structural.GSA.Loading.GSALoadCombination")] public class GSALoadCombination : LoadCombination { public GSALoadCombination() { } diff --git a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadFace.cs b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadFace.cs index 28b49439..c5be4878 100644 --- a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadFace.cs +++ b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadFace.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Structural.Loading; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Loading; +namespace Speckle.Objects.Structural.GSA.Loading; +[SpeckleType("Objects.Structural.GSA.Loading.GSALoadFace")] public class GSALoadFace : LoadFace { public GSALoadFace() { } diff --git a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGravity.cs b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGravity.cs index f820fa27..c2ebbac6 100644 --- a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGravity.cs +++ b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGravity.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Structural.Loading; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Loading; +namespace Speckle.Objects.Structural.GSA.Loading; +[SpeckleType("Objects.Structural.GSA.Loading.GSALoadGravity")] public class GSALoadGravity : LoadGravity { public GSALoadGravity() { } diff --git a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGrid.cs b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGrid.cs index d908b01c..c886d45a 100644 --- a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGrid.cs +++ b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGrid.cs @@ -1,9 +1,11 @@ -using Objects.Structural.Geometry; -using Objects.Structural.GSA.Geometry; -using Objects.Structural.Loading; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.GSA.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Loading; +namespace Speckle.Objects.Structural.GSA.Loading; +[SpeckleType("Objects.Structural.GSA.Loading.GSALoadGrid")] public abstract class GSALoadGrid : Load { protected GSALoadGrid() { } diff --git a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGridArea.cs b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGridArea.cs index 420c7646..0a7f0ff6 100644 --- a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGridArea.cs +++ b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGridArea.cs @@ -1,10 +1,12 @@ -using Objects.Geometry; -using Objects.Structural.Geometry; -using Objects.Structural.GSA.Geometry; -using Objects.Structural.Loading; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.GSA.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Loading; +namespace Speckle.Objects.Structural.GSA.Loading; +[SpeckleType("Objects.Structural.GSA.Loading.GSALoadGridArea")] public class GSALoadGridArea : GSALoadGrid { public GSALoadGridArea() { } diff --git a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGridLine.cs b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGridLine.cs index 3e5590c7..9157b4e1 100644 --- a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGridLine.cs +++ b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGridLine.cs @@ -1,11 +1,12 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Structural.Geometry; -using Objects.Structural.GSA.Geometry; -using Objects.Structural.Loading; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.GSA.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Loading; +namespace Speckle.Objects.Structural.GSA.Loading; +[SpeckleType("Objects.Structural.GSA.Loading.GSALoadGridLine")] public class GSALoadGridLine : GSALoadGrid { public GSALoadGridLine() { } diff --git a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGridPoint.cs b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGridPoint.cs index 077322c2..623fe839 100644 --- a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGridPoint.cs +++ b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadGridPoint.cs @@ -1,10 +1,12 @@ -using Objects.Geometry; -using Objects.Structural.Geometry; -using Objects.Structural.GSA.Geometry; -using Objects.Structural.Loading; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.GSA.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Loading; +namespace Speckle.Objects.Structural.GSA.Loading; +[SpeckleType("Objects.Structural.GSA.Loading.GSALoadGridPoint")] public class GSALoadGridPoint : GSALoadGrid { public GSALoadGridPoint() { } diff --git a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadNode.cs b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadNode.cs index cbd483ec..a2efb316 100644 --- a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadNode.cs +++ b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadNode.cs @@ -1,11 +1,12 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Objects.Structural.GSA.Geometry; -using Objects.Structural.Loading; -using Speckle.Core.Kits; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.GSA.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Loading; +namespace Speckle.Objects.Structural.GSA.Loading; +[SpeckleType("Objects.Structural.GSA.Loading.GSALoadNode")] public class GSALoadNode : LoadNode { public GSALoadNode() { } diff --git a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadThermal2d.cs b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadThermal2d.cs index 1b25a028..7097485c 100644 --- a/src/Speckle.Objects/Structural/GSA/Loading/GSALoadThermal2d.cs +++ b/src/Speckle.Objects/Structural/GSA/Loading/GSALoadThermal2d.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Objects.Structural.Loading; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Loading; +namespace Speckle.Objects.Structural.GSA.Loading; +[SpeckleType("Objects.Structural.GSA.Loading.GSALoadThermal2d")] public class GSALoadThermal2d : Load { public GSALoadThermal2d() { } diff --git a/src/Speckle.Objects/Structural/GSA/Loading/GSAPolyline.cs b/src/Speckle.Objects/Structural/GSA/Loading/GSAPolyline.cs index ab8281a5..3a10c1b6 100644 --- a/src/Speckle.Objects/Structural/GSA/Loading/GSAPolyline.cs +++ b/src/Speckle.Objects/Structural/GSA/Loading/GSAPolyline.cs @@ -1,12 +1,11 @@ -using System.Collections.Generic; -using System.Linq; -using Objects.Geometry; -using Objects.Structural.GSA.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.GSA.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Loading; +namespace Speckle.Objects.Structural.GSA.Loading; +[SpeckleType("Objects.Structural.GSA.Loading.GSAPolyline")] public class GSAPolyline : Polyline { public GSAPolyline() { } diff --git a/src/Speckle.Objects/Structural/GSA/Materials/GSAConcrete.cs b/src/Speckle.Objects/Structural/GSA/Materials/GSAConcrete.cs index 4773361d..edfc08a5 100644 --- a/src/Speckle.Objects/Structural/GSA/Materials/GSAConcrete.cs +++ b/src/Speckle.Objects/Structural/GSA/Materials/GSAConcrete.cs @@ -1,8 +1,10 @@ -using Objects.Structural.Materials; -using Speckle.Core.Kits; +using Speckle.Objects.Structural.Materials; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Materials; +namespace Speckle.Objects.Structural.GSA.Materials; +[SpeckleType("Objects.Structural.GSA.Materials.GSAConcrete")] public class GSAConcrete : Concrete { public GSAConcrete() { } diff --git a/src/Speckle.Objects/Structural/GSA/Materials/GSAMaterial.cs b/src/Speckle.Objects/Structural/GSA/Materials/GSAMaterial.cs index 66d0a0c2..e5ff5399 100644 --- a/src/Speckle.Objects/Structural/GSA/Materials/GSAMaterial.cs +++ b/src/Speckle.Objects/Structural/GSA/Materials/GSAMaterial.cs @@ -1,8 +1,10 @@ -using Objects.Structural.Materials; -using Speckle.Core.Kits; +using Speckle.Objects.Structural.Materials; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Materials; +namespace Speckle.Objects.Structural.GSA.Materials; +[SpeckleType("Objects.Structural.GSA.Materials.GSAMaterial")] public class GSAMaterial : StructuralMaterial { public GSAMaterial() { } diff --git a/src/Speckle.Objects/Structural/GSA/Materials/GSASteel.cs b/src/Speckle.Objects/Structural/GSA/Materials/GSASteel.cs index b87a91c7..5e487338 100644 --- a/src/Speckle.Objects/Structural/GSA/Materials/GSASteel.cs +++ b/src/Speckle.Objects/Structural/GSA/Materials/GSASteel.cs @@ -1,8 +1,10 @@ -using Objects.Structural.Materials; -using Speckle.Core.Kits; +using Speckle.Objects.Structural.Materials; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Materials; +namespace Speckle.Objects.Structural.GSA.Materials; +[SpeckleType("Objects.Structural.GSA.Materials.GSASteel")] public class GSASteel : Steel { public GSASteel() { } diff --git a/src/Speckle.Objects/Structural/GSA/Properties/GSAProperty1D.cs b/src/Speckle.Objects/Structural/GSA/Properties/GSAProperty1D.cs index cd3986f3..6271376b 100644 --- a/src/Speckle.Objects/Structural/GSA/Properties/GSAProperty1D.cs +++ b/src/Speckle.Objects/Structural/GSA/Properties/GSAProperty1D.cs @@ -1,11 +1,12 @@ -using Objects.Structural.Materials; -using Objects.Structural.Properties; -using Objects.Structural.Properties.Profiles; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Materials; +using Speckle.Objects.Structural.Properties; +using Speckle.Objects.Structural.Properties.Profiles; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Properties; +namespace Speckle.Objects.Structural.GSA.Properties; +[SpeckleType("Objects.Structural.GSA.Properties.GSAProperty1D")] public class GSAProperty1D : Property1D { public GSAProperty1D() { } diff --git a/src/Speckle.Objects/Structural/GSA/Properties/GSAProperty2D.cs b/src/Speckle.Objects/Structural/GSA/Properties/GSAProperty2D.cs index ad0f081a..6d8612ee 100644 --- a/src/Speckle.Objects/Structural/GSA/Properties/GSAProperty2D.cs +++ b/src/Speckle.Objects/Structural/GSA/Properties/GSAProperty2D.cs @@ -1,10 +1,11 @@ -using Objects.Structural.Materials; -using Objects.Structural.Properties; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Materials; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.GSA.Properties; +namespace Speckle.Objects.Structural.GSA.Properties; +[SpeckleType("Objects.Structural.GSA.Properties.Property2D")] public class GSAProperty2D : Property2D { public GSAProperty2D() { } diff --git a/src/Speckle.Objects/Structural/Geometry/Axis.cs b/src/Speckle.Objects/Structural/Geometry/Axis.cs index aaf7df8b..bfffd86d 100644 --- a/src/Speckle.Objects/Structural/Geometry/Axis.cs +++ b/src/Speckle.Objects/Structural/Geometry/Axis.cs @@ -1,9 +1,10 @@ -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Geometry; +namespace Speckle.Objects.Structural.Geometry; +[SpeckleType("Objects.Structural.Geometry.Axis")] public class Axis : Base { public Axis() { } diff --git a/src/Speckle.Objects/Structural/Geometry/Element1D.cs b/src/Speckle.Objects/Structural/Geometry/Element1D.cs index abce21d7..cc7abe9a 100644 --- a/src/Speckle.Objects/Structural/Geometry/Element1D.cs +++ b/src/Speckle.Objects/Structural/Geometry/Element1D.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Structural.Properties; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Geometry; +namespace Speckle.Objects.Structural.Geometry; +[SpeckleType("Objects.Structural.Geometry.Element1D")] public class Element1D : Base, IDisplayValue> { public Element1D() { } diff --git a/src/Speckle.Objects/Structural/Geometry/Element2D.cs b/src/Speckle.Objects/Structural/Geometry/Element2D.cs index abbf973e..467097a1 100644 --- a/src/Speckle.Objects/Structural/Geometry/Element2D.cs +++ b/src/Speckle.Objects/Structural/Geometry/Element2D.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Structural.Properties; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Geometry; +namespace Speckle.Objects.Structural.Geometry; +[SpeckleType("Objects.Structural.Geometry.Element2D")] public class Element2D : Base, IDisplayValue> { public Element2D() { } diff --git a/src/Speckle.Objects/Structural/Geometry/Element3D.cs b/src/Speckle.Objects/Structural/Geometry/Element3D.cs index 9b52f57b..4e82dcd7 100644 --- a/src/Speckle.Objects/Structural/Geometry/Element3D.cs +++ b/src/Speckle.Objects/Structural/Geometry/Element3D.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Objects.Structural.Properties; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Geometry; +namespace Speckle.Objects.Structural.Geometry; +[SpeckleType("Objects.Structural.Geometry.Element3D")] public class Element3D : Base { public Element3D() { } diff --git a/src/Speckle.Objects/Structural/Geometry/ElementType.cs b/src/Speckle.Objects/Structural/Geometry/ElementType.cs index e8f87ca7..398ca288 100644 --- a/src/Speckle.Objects/Structural/Geometry/ElementType.cs +++ b/src/Speckle.Objects/Structural/Geometry/ElementType.cs @@ -1,4 +1,4 @@ -namespace Objects.Structural.Geometry; +namespace Speckle.Objects.Structural.Geometry; public enum ElementType1D { diff --git a/src/Speckle.Objects/Structural/Geometry/MemberType.cs b/src/Speckle.Objects/Structural/Geometry/MemberType.cs index d7c64ad7..67898a06 100644 --- a/src/Speckle.Objects/Structural/Geometry/MemberType.cs +++ b/src/Speckle.Objects/Structural/Geometry/MemberType.cs @@ -1,4 +1,4 @@ -namespace Objects.Structural.Geometry; +namespace Speckle.Objects.Structural.Geometry; public enum MemberType { diff --git a/src/Speckle.Objects/Structural/Geometry/MemberType1D.cs b/src/Speckle.Objects/Structural/Geometry/MemberType1D.cs index fba712d1..2b824375 100644 --- a/src/Speckle.Objects/Structural/Geometry/MemberType1D.cs +++ b/src/Speckle.Objects/Structural/Geometry/MemberType1D.cs @@ -1,4 +1,4 @@ -namespace Objects.Structural.Geometry; +namespace Speckle.Objects.Structural.Geometry; public enum MemberType1D { diff --git a/src/Speckle.Objects/Structural/Geometry/Node.cs b/src/Speckle.Objects/Structural/Geometry/Node.cs index b1f4893f..0ba5559a 100644 --- a/src/Speckle.Objects/Structural/Geometry/Node.cs +++ b/src/Speckle.Objects/Structural/Geometry/Node.cs @@ -1,10 +1,12 @@ -using Objects.Geometry; -using Objects.Structural.Properties; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Objects.Structural.Properties; +using Speckle.Sdk.Common; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Geometry; +namespace Speckle.Objects.Structural.Geometry; +[SpeckleType("Objects.Structural.Geometry.Node")] public class Node : Base { public Node() { } diff --git a/src/Speckle.Objects/Structural/Geometry/Restraint.cs b/src/Speckle.Objects/Structural/Geometry/Restraint.cs index a8038324..580b2734 100644 --- a/src/Speckle.Objects/Structural/Geometry/Restraint.cs +++ b/src/Speckle.Objects/Structural/Geometry/Restraint.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Geometry; +namespace Speckle.Objects.Structural.Geometry; +[SpeckleType("Objects.Structural.Geometry.Restraint")] public class Restraint : Base { public Restraint() { } diff --git a/src/Speckle.Objects/Structural/Geometry/RestraintType.cs b/src/Speckle.Objects/Structural/Geometry/RestraintType.cs index cf428a6c..9c7896d4 100644 --- a/src/Speckle.Objects/Structural/Geometry/RestraintType.cs +++ b/src/Speckle.Objects/Structural/Geometry/RestraintType.cs @@ -1,4 +1,4 @@ -namespace Objects.Structural.Geometry; +namespace Speckle.Objects.Structural.Geometry; public enum RestraintType { diff --git a/src/Speckle.Objects/Structural/Geometry/Storey.cs b/src/Speckle.Objects/Structural/Geometry/Storey.cs index 62cb377e..67c1796b 100644 --- a/src/Speckle.Objects/Structural/Geometry/Storey.cs +++ b/src/Speckle.Objects/Structural/Geometry/Storey.cs @@ -1,8 +1,10 @@ -using Objects.BuiltElements; -using Speckle.Core.Kits; +using Speckle.Objects.BuiltElements; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Geometry; +namespace Speckle.Objects.Structural.Geometry; +[SpeckleType("Objects.Structural.Geometry.Storey")] public class Storey : Level // or inherit from Base? { public Storey() { } diff --git a/src/Speckle.Objects/Structural/Loading/Load.cs b/src/Speckle.Objects/Structural/Loading/Load.cs index 9da845cc..93f2e78d 100644 --- a/src/Speckle.Objects/Structural/Loading/Load.cs +++ b/src/Speckle.Objects/Structural/Loading/Load.cs @@ -1,7 +1,8 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.Structural.Loading; +namespace Speckle.Objects.Structural.Loading; +[SpeckleType("Objects.Structural.Loading.Load")] public class Load : Base { public Load() { } diff --git a/src/Speckle.Objects/Structural/Loading/LoadBeam.cs b/src/Speckle.Objects/Structural/Loading/LoadBeam.cs index c47462e7..30ce7f87 100644 --- a/src/Speckle.Objects/Structural/Loading/LoadBeam.cs +++ b/src/Speckle.Objects/Structural/Loading/LoadBeam.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Loading; +namespace Speckle.Objects.Structural.Loading; +[SpeckleType("Objects.Structural.Loading.LoadBeam")] public class LoadBeam : Load { public LoadBeam() { } diff --git a/src/Speckle.Objects/Structural/Loading/LoadCase.cs b/src/Speckle.Objects/Structural/Loading/LoadCase.cs index 8aa17e43..26bea424 100644 --- a/src/Speckle.Objects/Structural/Loading/LoadCase.cs +++ b/src/Speckle.Objects/Structural/Loading/LoadCase.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Loading; +namespace Speckle.Objects.Structural.Loading; +[SpeckleType("Objects.Structural.Loading.LoadCase")] public class LoadCase : Base // or LoadPattern? (per CSI) { public LoadCase() { } diff --git a/src/Speckle.Objects/Structural/Loading/LoadCombination.cs b/src/Speckle.Objects/Structural/Loading/LoadCombination.cs index cd3e8108..fcd927b6 100644 --- a/src/Speckle.Objects/Structural/Loading/LoadCombination.cs +++ b/src/Speckle.Objects/Structural/Loading/LoadCombination.cs @@ -1,10 +1,9 @@ -using System; -using System.Collections.Generic; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Loading; +namespace Speckle.Objects.Structural.Loading; +[SpeckleType("Objects.Structural.Loading.LoadCombination")] public class LoadCombination : Base //combination case { public LoadCombination() { } diff --git a/src/Speckle.Objects/Structural/Loading/LoadFace.cs b/src/Speckle.Objects/Structural/Loading/LoadFace.cs index 85c5f664..469648f9 100644 --- a/src/Speckle.Objects/Structural/Loading/LoadFace.cs +++ b/src/Speckle.Objects/Structural/Loading/LoadFace.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Loading; +namespace Speckle.Objects.Structural.Loading; +[SpeckleType("Objects.Structural.Loading.LoadFace")] public class LoadFace : Load { public LoadFace() { } diff --git a/src/Speckle.Objects/Structural/Loading/LoadGravity.cs b/src/Speckle.Objects/Structural/Loading/LoadGravity.cs index 0fd0c63d..17b7ed0a 100644 --- a/src/Speckle.Objects/Structural/Loading/LoadGravity.cs +++ b/src/Speckle.Objects/Structural/Loading/LoadGravity.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Loading; +namespace Speckle.Objects.Structural.Loading; +[SpeckleType("Objects.Structural.Loading.LoadGravity")] public class LoadGravity : Load { public LoadGravity() { } diff --git a/src/Speckle.Objects/Structural/Loading/LoadNode.cs b/src/Speckle.Objects/Structural/Loading/LoadNode.cs index d0bb9bb9..8169ff8c 100644 --- a/src/Speckle.Objects/Structural/Loading/LoadNode.cs +++ b/src/Speckle.Objects/Structural/Loading/LoadNode.cs @@ -1,10 +1,10 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Loading; +namespace Speckle.Objects.Structural.Loading; +[SpeckleType("Objects.Structural.Loading.LoadNode")] public class LoadNode : Load { public LoadNode() { } diff --git a/src/Speckle.Objects/Structural/Loading/Loads.cs b/src/Speckle.Objects/Structural/Loading/Loads.cs index c376cd47..718e1966 100644 --- a/src/Speckle.Objects/Structural/Loading/Loads.cs +++ b/src/Speckle.Objects/Structural/Loading/Loads.cs @@ -1,4 +1,4 @@ -namespace Objects.Structural.Loading; +namespace Speckle.Objects.Structural.Loading; public enum LoadType { diff --git a/src/Speckle.Objects/Structural/MaterialType.cs b/src/Speckle.Objects/Structural/MaterialType.cs index 74fe1a0f..82dcf457 100644 --- a/src/Speckle.Objects/Structural/MaterialType.cs +++ b/src/Speckle.Objects/Structural/MaterialType.cs @@ -1,4 +1,4 @@ -namespace Objects.Structural; +namespace Speckle.Objects.Structural; public enum MaterialType { diff --git a/src/Speckle.Objects/Structural/Materials/Concrete.cs b/src/Speckle.Objects/Structural/Materials/Concrete.cs index 8266b780..99dcc323 100644 --- a/src/Speckle.Objects/Structural/Materials/Concrete.cs +++ b/src/Speckle.Objects/Structural/Materials/Concrete.cs @@ -1,7 +1,9 @@ -using Speckle.Core.Kits; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Materials; +namespace Speckle.Objects.Structural.Materials; +[SpeckleType("Objects.Structural.Materials.Concrete")] public class Concrete : StructuralMaterial { public Concrete() { } diff --git a/src/Speckle.Objects/Structural/Materials/Steel.cs b/src/Speckle.Objects/Structural/Materials/Steel.cs index 4523da1f..687a7398 100644 --- a/src/Speckle.Objects/Structural/Materials/Steel.cs +++ b/src/Speckle.Objects/Structural/Materials/Steel.cs @@ -1,7 +1,9 @@ -using Speckle.Core.Kits; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Materials; +namespace Speckle.Objects.Structural.Materials; +[SpeckleType("Objects.Structural.Materials.Steel")] public class Steel : StructuralMaterial { public Steel() { } diff --git a/src/Speckle.Objects/Structural/Materials/StructuralMaterial.cs b/src/Speckle.Objects/Structural/Materials/StructuralMaterial.cs index 78eb813c..4d5eed39 100644 --- a/src/Speckle.Objects/Structural/Materials/StructuralMaterial.cs +++ b/src/Speckle.Objects/Structural/Materials/StructuralMaterial.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Materials; +namespace Speckle.Objects.Structural.Materials; +[SpeckleType("Objects.Structural.Materials.StructuralMaterial")] public class StructuralMaterial : Base { // add carbon/environmental parameters? diff --git a/src/Speckle.Objects/Structural/Materials/Timber.cs b/src/Speckle.Objects/Structural/Materials/Timber.cs index d608ce03..b2c8160e 100644 --- a/src/Speckle.Objects/Structural/Materials/Timber.cs +++ b/src/Speckle.Objects/Structural/Materials/Timber.cs @@ -1,7 +1,9 @@ -using Speckle.Core.Kits; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Materials; +namespace Speckle.Objects.Structural.Materials; +[SpeckleType("Objects.Structural.Materials.Timber")] public class Timber : StructuralMaterial { public Timber() { } diff --git a/src/Speckle.Objects/Structural/Properties/Profiles/SectionProfile.cs b/src/Speckle.Objects/Structural/Properties/Profiles/SectionProfile.cs index cf933679..d203f678 100644 --- a/src/Speckle.Objects/Structural/Properties/Profiles/SectionProfile.cs +++ b/src/Speckle.Objects/Structural/Properties/Profiles/SectionProfile.cs @@ -1,9 +1,9 @@ -using System.Collections.Generic; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Properties.Profiles; +namespace Speckle.Objects.Structural.Properties.Profiles; +[SpeckleType("Objects.Structural.Properties.Profiles.SectionProfile")] public class SectionProfile : Base //section profile description { public SectionProfile() { } diff --git a/src/Speckle.Objects/Structural/Properties/Property.cs b/src/Speckle.Objects/Structural/Properties/Property.cs index 1a82a512..4e56f0e9 100644 --- a/src/Speckle.Objects/Structural/Properties/Property.cs +++ b/src/Speckle.Objects/Structural/Properties/Property.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Properties; +namespace Speckle.Objects.Structural.Properties; +[SpeckleType("Objects.Structural.Properties.Property")] public class Property : Base { public Property() { } diff --git a/src/Speckle.Objects/Structural/Properties/Property1D.cs b/src/Speckle.Objects/Structural/Properties/Property1D.cs index e289fce1..29bf1455 100644 --- a/src/Speckle.Objects/Structural/Properties/Property1D.cs +++ b/src/Speckle.Objects/Structural/Properties/Property1D.cs @@ -1,11 +1,12 @@ -using Objects.Structural.Geometry; -using Objects.Structural.Materials; -using Objects.Structural.Properties.Profiles; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Materials; +using Speckle.Objects.Structural.Properties.Profiles; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Properties; +namespace Speckle.Objects.Structural.Properties; +[SpeckleType("Objects.Structural.Properties.Property1D")] public class Property1D : Property //SectionProperty as alt class name { public Property1D() { } diff --git a/src/Speckle.Objects/Structural/Properties/Property2D.cs b/src/Speckle.Objects/Structural/Properties/Property2D.cs index 157f692a..5c6e96e7 100644 --- a/src/Speckle.Objects/Structural/Properties/Property2D.cs +++ b/src/Speckle.Objects/Structural/Properties/Property2D.cs @@ -1,10 +1,11 @@ -using Objects.Structural.Geometry; -using Objects.Structural.Materials; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Materials; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Properties; +namespace Speckle.Objects.Structural.Properties; +[SpeckleType("Objects.Structural.Properties.Property2D")] public class Property2D : Property { public Property2D() { } diff --git a/src/Speckle.Objects/Structural/Properties/Property3D.cs b/src/Speckle.Objects/Structural/Properties/Property3D.cs index 638d5fa0..53534989 100644 --- a/src/Speckle.Objects/Structural/Properties/Property3D.cs +++ b/src/Speckle.Objects/Structural/Properties/Property3D.cs @@ -1,10 +1,11 @@ -using Objects.Structural.Geometry; -using Objects.Structural.Materials; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Materials; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Properties; +namespace Speckle.Objects.Structural.Properties; +[SpeckleType("Objects.Structural.Properties.Property3D")] public class Property3D : Property { public Property3D() { } diff --git a/src/Speckle.Objects/Structural/Properties/PropertyDamper.cs b/src/Speckle.Objects/Structural/Properties/PropertyDamper.cs index 5232b279..41bee3b5 100644 --- a/src/Speckle.Objects/Structural/Properties/PropertyDamper.cs +++ b/src/Speckle.Objects/Structural/Properties/PropertyDamper.cs @@ -1,7 +1,9 @@ -using Speckle.Core.Kits; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Properties; +namespace Speckle.Objects.Structural.Properties; +[SpeckleType("Objects.Structural.Properties.PropertyDamper")] public class PropertyDamper : Property { public PropertyDamper() { } diff --git a/src/Speckle.Objects/Structural/Properties/PropertyMass.cs b/src/Speckle.Objects/Structural/Properties/PropertyMass.cs index 5b85f0b7..fa617837 100644 --- a/src/Speckle.Objects/Structural/Properties/PropertyMass.cs +++ b/src/Speckle.Objects/Structural/Properties/PropertyMass.cs @@ -1,7 +1,9 @@ -using Speckle.Core.Kits; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Properties; +namespace Speckle.Objects.Structural.Properties; +[SpeckleType("Objects.Structural.Properties.PropertyMass")] public class PropertyMass : Property // nodal constraint axis of the node assumed to be mass property axis { public PropertyMass() { } diff --git a/src/Speckle.Objects/Structural/Properties/PropertySpring.cs b/src/Speckle.Objects/Structural/Properties/PropertySpring.cs index 8ec35a12..dae13533 100644 --- a/src/Speckle.Objects/Structural/Properties/PropertySpring.cs +++ b/src/Speckle.Objects/Structural/Properties/PropertySpring.cs @@ -1,7 +1,9 @@ -using Speckle.Core.Kits; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Properties; +namespace Speckle.Objects.Structural.Properties; +[SpeckleType("Objects.Structural.Properties.PropertySpring")] public class PropertySpring : Property { public PropertySpring() { } diff --git a/src/Speckle.Objects/Structural/PropertyType.cs b/src/Speckle.Objects/Structural/PropertyType.cs index b17f28a3..ea3717d7 100644 --- a/src/Speckle.Objects/Structural/PropertyType.cs +++ b/src/Speckle.Objects/Structural/PropertyType.cs @@ -1,4 +1,4 @@ -namespace Objects.Structural; +namespace Speckle.Objects.Structural; public enum PropertyType2D { diff --git a/src/Speckle.Objects/Structural/Results/AnalyticalResults.cs b/src/Speckle.Objects/Structural/Results/AnalyticalResults.cs index 9c39b6fb..de667a46 100644 --- a/src/Speckle.Objects/Structural/Results/AnalyticalResults.cs +++ b/src/Speckle.Objects/Structural/Results/AnalyticalResults.cs @@ -1,8 +1,8 @@ -using System.Collections.Generic; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Objects.Structural.Results; +namespace Speckle.Objects.Structural.Results; +[SpeckleType("Objects.Structural.Results.AnalyticalResults")] public class AnalyticalResults : Base { public string? lengthUnits { get; set; } diff --git a/src/Speckle.Objects/Structural/Results/Result.cs b/src/Speckle.Objects/Structural/Results/Result.cs index a117db54..258f26d7 100644 --- a/src/Speckle.Objects/Structural/Results/Result.cs +++ b/src/Speckle.Objects/Structural/Results/Result.cs @@ -1,8 +1,9 @@ -using Objects.Structural.Loading; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Models; -namespace Objects.Structural.Results; +namespace Speckle.Objects.Structural.Results; +[SpeckleType("Objects.Structural.Results.Result")] public class Result : Base { public Result() { } diff --git a/src/Speckle.Objects/Structural/Results/Result1D.cs b/src/Speckle.Objects/Structural/Results/Result1D.cs index f6f75b92..3534010e 100644 --- a/src/Speckle.Objects/Structural/Results/Result1D.cs +++ b/src/Speckle.Objects/Structural/Results/Result1D.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Objects.Structural.Loading; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Results; +namespace Speckle.Objects.Structural.Results; +[SpeckleType("Objects.Structural.Results.ResultSet1D")] public class ResultSet1D : Result { public ResultSet1D() { } @@ -20,6 +20,7 @@ public ResultSet1D(List results1D) public List results1D { get; set; } } +[SpeckleType("Objects.Structural.Results.Result1D")] public class Result1D : Result //result at a single position along a 1D element, ie. 1D element contains multiple Result1D objects to describe result at end 1, mid-span, end 2 { public Result1D() { } diff --git a/src/Speckle.Objects/Structural/Results/Result2D.cs b/src/Speckle.Objects/Structural/Results/Result2D.cs index 89487759..da2e4657 100644 --- a/src/Speckle.Objects/Structural/Results/Result2D.cs +++ b/src/Speckle.Objects/Structural/Results/Result2D.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Objects.Structural.Loading; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Results; +namespace Speckle.Objects.Structural.Results; +[SpeckleType("Objects.Structural.Results.ResultSet2D")] public class ResultSet2D : Result { public ResultSet2D() { } @@ -20,6 +20,7 @@ public ResultSet2D(List results2D) public List results2D { get; set; } } +[SpeckleType("Objects.Structural.Results.Result2D")] public class Result2D : Result //result at a single position within a 2D element, ie. 2D element contains multiple Result2D objects to describe result at node 1, node 2, node 3, node4 and centre of 4-node quad element { public Result2D() { } diff --git a/src/Speckle.Objects/Structural/Results/Result3D.cs b/src/Speckle.Objects/Structural/Results/Result3D.cs index 0fac7109..8e91193c 100644 --- a/src/Speckle.Objects/Structural/Results/Result3D.cs +++ b/src/Speckle.Objects/Structural/Results/Result3D.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Objects.Structural.Loading; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Results; +namespace Speckle.Objects.Structural.Results; +[SpeckleType("Objects.Structural.Results.ResultSet3D")] public class ResultSet3D : Result { public ResultSet3D() { } @@ -20,6 +20,7 @@ public ResultSet3D(List results3D) public List results3D { get; set; } } +[SpeckleType("Objects.Structural.Results.Result3D")] public class Result3D : Result { public Result3D() { } diff --git a/src/Speckle.Objects/Structural/Results/ResultAll.cs b/src/Speckle.Objects/Structural/Results/ResultAll.cs index a44eb577..3dce49bc 100644 --- a/src/Speckle.Objects/Structural/Results/ResultAll.cs +++ b/src/Speckle.Objects/Structural/Results/ResultAll.cs @@ -1,8 +1,9 @@ -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Results; +namespace Speckle.Objects.Structural.Results; +[SpeckleType("Objects.Structural.Results.ResultSetAll")] public class ResultSetAll : Base { public ResultSetAll() { } diff --git a/src/Speckle.Objects/Structural/Results/ResultGlobal.cs b/src/Speckle.Objects/Structural/Results/ResultGlobal.cs index 787a31cd..7008c83d 100644 --- a/src/Speckle.Objects/Structural/Results/ResultGlobal.cs +++ b/src/Speckle.Objects/Structural/Results/ResultGlobal.cs @@ -1,10 +1,11 @@ -using Objects.Structural.Analysis; -using Objects.Structural.Loading; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Analysis; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Results; +namespace Speckle.Objects.Structural.Results; +[SpeckleType("Objects.Structural.Results.ResultGlobal")] public class ResultGlobal : Result { public ResultGlobal() { } diff --git a/src/Speckle.Objects/Structural/Results/ResultNode.cs b/src/Speckle.Objects/Structural/Results/ResultNode.cs index 305cc923..555666f3 100644 --- a/src/Speckle.Objects/Structural/Results/ResultNode.cs +++ b/src/Speckle.Objects/Structural/Results/ResultNode.cs @@ -1,10 +1,9 @@ -using System.Collections.Generic; -using Objects.Structural.Geometry; -using Objects.Structural.Loading; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Objects.Structural.Geometry; +using Speckle.Objects.Structural.Loading; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Objects.Structural.Results; +namespace Speckle.Objects.Structural.Results; public enum CaseType { @@ -12,6 +11,7 @@ public enum CaseType Combination } +[SpeckleType("Objects.Structural.Results.ResultSetNode")] public class ResultSetNode : Result { public ResultSetNode() { } @@ -26,6 +26,7 @@ public ResultSetNode(List resultsNode) public List resultsNode { get; set; } } +[SpeckleType("Objects.Structural.Results.ResultNode")] public class ResultNode : Result { public ResultNode() { } diff --git a/src/Speckle.Objects/Utils/MeshTriangulationHelper.cs b/src/Speckle.Objects/Utils/MeshTriangulationHelper.cs index b553dc88..8e76ec30 100644 --- a/src/Speckle.Objects/Utils/MeshTriangulationHelper.cs +++ b/src/Speckle.Objects/Utils/MeshTriangulationHelper.cs @@ -1,9 +1,7 @@ -using System; -using System.Collections.Generic; using System.Runtime.CompilerServices; -using Objects.Geometry; +using Speckle.Objects.Geometry; -namespace Objects.Utils; +namespace Speckle.Objects.Utils; /// /// Set of functions to triangulate n-gon faces (i.e. polygon faces with an arbitrary (n) number of vertices) in es. diff --git a/src/Speckle.Objects/Utils/Parameters.cs b/src/Speckle.Objects/Utils/Parameters.cs index 153bbbea..47ade2df 100644 --- a/src/Speckle.Objects/Utils/Parameters.cs +++ b/src/Speckle.Objects/Utils/Parameters.cs @@ -1,8 +1,7 @@ -using System.Collections.Generic; -using Objects.BuiltElements.Revit; -using Speckle.Core.Models; +using Speckle.Objects.BuiltElements.Revit; +using Speckle.Sdk.Models; -namespace Objects.Utils; +namespace Speckle.Objects.Utils; public static class Parameters { diff --git a/src/Speckle.Objects/packages.lock.json b/src/Speckle.Objects/packages.lock.json index f08421c2..fecf7c61 100644 --- a/src/Speckle.Objects/packages.lock.json +++ b/src/Speckle.Objects/packages.lock.json @@ -194,7 +194,7 @@ "System.Runtime.CompilerServices.Unsafe": "4.5.3" } }, - "speckle.core": { + "speckle.sdk": { "type": "Project", "dependencies": { "GraphQL.Client": "[6.0.0, )", @@ -204,12 +204,12 @@ "Polly.Contrib.WaitAndRetry": "[1.1.1, )", "Polly.Extensions.Http": "[3.0.0, )", "Speckle.DoubleNumerics": "[4.0.1, )", - "Speckle.Logging": "[1.0.0, )", "Speckle.Newtonsoft.Json": "[13.0.2, )", + "Speckle.Sdk.Logging": "[1.0.0, )", "System.Text.Json": "[5.0.2, )" } }, - "speckle.logging": { + "speckle.sdk.logging": { "type": "Project" }, "GraphQL.Client": { diff --git a/src/Speckle.Logging/Consts.cs b/src/Speckle.Sdk.Logging/Consts.cs similarity index 81% rename from src/Speckle.Logging/Consts.cs rename to src/Speckle.Sdk.Logging/Consts.cs index e2b8db7d..7c23676b 100644 --- a/src/Speckle.Logging/Consts.cs +++ b/src/Speckle.Sdk.Logging/Consts.cs @@ -1,4 +1,4 @@ -namespace Speckle.Logging; +namespace Speckle.Sdk.Logging; public static class Consts { diff --git a/src/Speckle.Logging/ISpeckleActivity.cs b/src/Speckle.Sdk.Logging/ISpeckleActivity.cs similarity index 75% rename from src/Speckle.Logging/ISpeckleActivity.cs rename to src/Speckle.Sdk.Logging/ISpeckleActivity.cs index e5502cb5..ba15b1b0 100644 --- a/src/Speckle.Logging/ISpeckleActivity.cs +++ b/src/Speckle.Sdk.Logging/ISpeckleActivity.cs @@ -1,4 +1,4 @@ -namespace Speckle.Logging; +namespace Speckle.Sdk.Logging; public interface ISpeckleActivity : IDisposable { diff --git a/src/Speckle.Logging/ISpeckleLogger.cs b/src/Speckle.Sdk.Logging/ISpeckleLogger.cs similarity index 96% rename from src/Speckle.Logging/ISpeckleLogger.cs rename to src/Speckle.Sdk.Logging/ISpeckleLogger.cs index d6dd4825..6df70b7a 100644 --- a/src/Speckle.Logging/ISpeckleLogger.cs +++ b/src/Speckle.Sdk.Logging/ISpeckleLogger.cs @@ -1,4 +1,4 @@ -namespace Speckle.Logging; +namespace Speckle.Sdk.Logging; public interface ISpeckleLogger { diff --git a/src/Speckle.Logging/LogBuilder.cs b/src/Speckle.Sdk.Logging/LogBuilder.cs similarity index 98% rename from src/Speckle.Logging/LogBuilder.cs rename to src/Speckle.Sdk.Logging/LogBuilder.cs index 2c330169..09cb3ab1 100644 --- a/src/Speckle.Logging/LogBuilder.cs +++ b/src/Speckle.Sdk.Logging/LogBuilder.cs @@ -4,9 +4,8 @@ using Serilog; using Serilog.Exceptions; using Serilog.Sinks.OpenTelemetry; -using Speckle.Core.Helpers; -namespace Speckle.Logging; +namespace Speckle.Sdk.Logging; public static class LogBuilder { diff --git a/src/Speckle.Logging/LogExtensions.cs b/src/Speckle.Sdk.Logging/LogExtensions.cs similarity index 98% rename from src/Speckle.Logging/LogExtensions.cs rename to src/Speckle.Sdk.Logging/LogExtensions.cs index 658601bf..71ce99e2 100644 --- a/src/Speckle.Logging/LogExtensions.cs +++ b/src/Speckle.Sdk.Logging/LogExtensions.cs @@ -1,6 +1,6 @@ using Microsoft.Extensions.Logging; -namespace Speckle.Logging; +namespace Speckle.Sdk.Logging; public static class LogExtensions { diff --git a/src/Speckle.Logging/Path.cs b/src/Speckle.Sdk.Logging/Path.cs similarity index 99% rename from src/Speckle.Logging/Path.cs rename to src/Speckle.Sdk.Logging/Path.cs index 250ed329..b60a59fa 100644 --- a/src/Speckle.Logging/Path.cs +++ b/src/Speckle.Sdk.Logging/Path.cs @@ -1,7 +1,6 @@ using System.Reflection; -using Speckle.Logging; -namespace Speckle.Core.Helpers; +namespace Speckle.Sdk.Logging; /// /// Helper class dedicated for Speckle specific Path operations. diff --git a/src/Speckle.Logging/Speckle.Logging.csproj b/src/Speckle.Sdk.Logging/Speckle.Sdk.Logging.csproj similarity index 100% rename from src/Speckle.Logging/Speckle.Logging.csproj rename to src/Speckle.Sdk.Logging/Speckle.Sdk.Logging.csproj diff --git a/src/Speckle.Logging/SpeckleActivity.cs b/src/Speckle.Sdk.Logging/SpeckleActivity.cs similarity index 88% rename from src/Speckle.Logging/SpeckleActivity.cs rename to src/Speckle.Sdk.Logging/SpeckleActivity.cs index 593fe0c6..b27c675c 100644 --- a/src/Speckle.Logging/SpeckleActivity.cs +++ b/src/Speckle.Sdk.Logging/SpeckleActivity.cs @@ -1,6 +1,6 @@ using System.Diagnostics; -namespace Speckle.Logging; +namespace Speckle.Sdk.Logging; public class SpeckleActivity(Activity activity) : ISpeckleActivity { diff --git a/src/Speckle.Logging/SpeckleActivityFactory.cs b/src/Speckle.Sdk.Logging/SpeckleActivityFactory.cs similarity index 81% rename from src/Speckle.Logging/SpeckleActivityFactory.cs rename to src/Speckle.Sdk.Logging/SpeckleActivityFactory.cs index 6856caef..1ced76d9 100644 --- a/src/Speckle.Logging/SpeckleActivityFactory.cs +++ b/src/Speckle.Sdk.Logging/SpeckleActivityFactory.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using System.Runtime.CompilerServices; -namespace Speckle.Logging; +namespace Speckle.Sdk.Logging; public static class SpeckleActivityFactory { @@ -11,7 +11,7 @@ public static class SpeckleActivityFactory public static ISpeckleActivity? Start([CallerMemberName] string name = "SpeckleActivityFactory") { - var activity = s_activitySource?.StartActivity(name); + var activity = s_activitySource?.StartActivity(name, ActivityKind.Client); if (activity is null) { return null; diff --git a/src/Speckle.Logging/SpeckleLog.cs b/src/Speckle.Sdk.Logging/SpeckleLog.cs similarity index 90% rename from src/Speckle.Logging/SpeckleLog.cs rename to src/Speckle.Sdk.Logging/SpeckleLog.cs index 8a68808e..48b465db 100644 --- a/src/Speckle.Logging/SpeckleLog.cs +++ b/src/Speckle.Sdk.Logging/SpeckleLog.cs @@ -1,7 +1,7 @@ using Serilog; using Serilog.Core; -namespace Speckle.Logging; +namespace Speckle.Sdk.Logging; public static class SpeckleLog { diff --git a/src/Speckle.Logging/SpeckleLogConfiguration.cs b/src/Speckle.Sdk.Logging/SpeckleLogConfiguration.cs similarity index 77% rename from src/Speckle.Logging/SpeckleLogConfiguration.cs rename to src/Speckle.Sdk.Logging/SpeckleLogConfiguration.cs index 02efd5d0..9f2d6561 100644 --- a/src/Speckle.Logging/SpeckleLogConfiguration.cs +++ b/src/Speckle.Sdk.Logging/SpeckleLogConfiguration.cs @@ -1,4 +1,4 @@ -namespace Speckle.Logging; +namespace Speckle.Sdk.Logging; /// /// Configuration object for the Speckle logging system. @@ -17,4 +17,8 @@ public record SpeckleOtelLogging(string Endpoint, bool Enabled = true, Dictionar public record SpeckleTracing(bool Console = false, SpeckleOtelTracing? Otel = null); -public record SpeckleOtelTracing(string Endpoint, bool Enabled = true, Dictionary? Headers = null); +public record SpeckleOtelTracing( + string? Endpoint = null, + bool Enabled = true, + Dictionary? Headers = null +); diff --git a/src/Speckle.Logging/SpeckleLogLevel.cs b/src/Speckle.Sdk.Logging/SpeckleLogLevel.cs similarity index 95% rename from src/Speckle.Logging/SpeckleLogLevel.cs rename to src/Speckle.Sdk.Logging/SpeckleLogLevel.cs index e2fe24e7..e84ca64e 100644 --- a/src/Speckle.Logging/SpeckleLogLevel.cs +++ b/src/Speckle.Sdk.Logging/SpeckleLogLevel.cs @@ -1,4 +1,4 @@ -namespace Speckle.Logging; +namespace Speckle.Sdk.Logging; public enum SpeckleLogLevel { diff --git a/src/Speckle.Logging/SpeckleLogger.cs b/src/Speckle.Sdk.Logging/SpeckleLogger.cs similarity index 98% rename from src/Speckle.Logging/SpeckleLogger.cs rename to src/Speckle.Sdk.Logging/SpeckleLogger.cs index 6a4cf8b6..5b83eff2 100644 --- a/src/Speckle.Logging/SpeckleLogger.cs +++ b/src/Speckle.Sdk.Logging/SpeckleLogger.cs @@ -1,7 +1,7 @@ using Serilog; using Serilog.Events; -namespace Speckle.Logging; +namespace Speckle.Sdk.Logging; internal class SpeckleLogger : ISpeckleLogger { diff --git a/src/Speckle.Logging/TraceBuilder.cs b/src/Speckle.Sdk.Logging/TraceBuilder.cs similarity index 92% rename from src/Speckle.Logging/TraceBuilder.cs rename to src/Speckle.Sdk.Logging/TraceBuilder.cs index 767a5827..f82469d8 100644 --- a/src/Speckle.Logging/TraceBuilder.cs +++ b/src/Speckle.Sdk.Logging/TraceBuilder.cs @@ -1,9 +1,8 @@ -using OpenTelemetry; using OpenTelemetry.Exporter; using OpenTelemetry.Resources; using OpenTelemetry.Trace; -namespace Speckle.Logging; +namespace Speckle.Sdk.Logging; public class TraceBuilder(IDisposable? traceProvider) : IDisposable { @@ -16,7 +15,8 @@ public class TraceBuilder(IDisposable? traceProvider) : IDisposable return null; } - var tracerProviderBuilder = Sdk.CreateTracerProviderBuilder() + var tracerProviderBuilder = OpenTelemetry + .Sdk.CreateTracerProviderBuilder() .AddSource(slug) .ConfigureResource(r => { diff --git a/src/Speckle.Logging/packages.lock.json b/src/Speckle.Sdk.Logging/packages.lock.json similarity index 100% rename from src/Speckle.Logging/packages.lock.json rename to src/Speckle.Sdk.Logging/packages.lock.json diff --git a/src/Speckle.Core/Api/Exceptions.cs b/src/Speckle.Sdk/Api/Exceptions.cs similarity index 98% rename from src/Speckle.Core/Api/Exceptions.cs rename to src/Speckle.Sdk/Api/Exceptions.cs index da5c15f9..165a086b 100644 --- a/src/Speckle.Core/Api/Exceptions.cs +++ b/src/Speckle.Sdk/Api/Exceptions.cs @@ -1,7 +1,7 @@ using GraphQL; -using Speckle.Core.Logging; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; /// /// Base class for GraphQL API exceptions diff --git a/src/Speckle.Core/Api/GraphQL/.editorconfig b/src/Speckle.Sdk/Api/GraphQL/.editorconfig similarity index 100% rename from src/Speckle.Core/Api/GraphQL/.editorconfig rename to src/Speckle.Sdk/Api/GraphQL/.editorconfig diff --git a/src/Speckle.Core/Api/GraphQL/Client.cs b/src/Speckle.Sdk/Api/GraphQL/Client.cs similarity index 97% rename from src/Speckle.Core/Api/GraphQL/Client.cs rename to src/Speckle.Sdk/Api/GraphQL/Client.cs index aedbadb3..f7a16add 100644 --- a/src/Speckle.Core/Api/GraphQL/Client.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Client.cs @@ -6,16 +6,15 @@ using GraphQL.Client.Http; using Polly; using Polly.Contrib.WaitAndRetry; -using Speckle.Core.Api.GraphQL; -using Speckle.Core.Api.GraphQL.Resources; -using Speckle.Core.Api.GraphQL.Serializer; -using Speckle.Core.Credentials; -using Speckle.Core.Helpers; -using Speckle.Core.Logging; -using Speckle.Logging; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Api.GraphQL; +using Speckle.Sdk.Api.GraphQL.Resources; +using Speckle.Sdk.Api.GraphQL.Serializer; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Helpers; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public sealed partial class Client : ISpeckleGraphQLClient, IDisposable { @@ -266,7 +265,7 @@ internal IDisposable SubscribeTo(GraphQLRequest request, Action ca // anything else related to graphql gets logged catch (SpeckleGraphQLException gqlException) { - /* Speckle.Core.Logging..ForContext("graphqlResponse", gqlException.Response) + /* Speckle.Sdk.Logging..ForContext("graphqlResponse", gqlException.Response) .ForContext("graphqlExtensions", gqlException.Extensions) .ForContext("graphqlErrorMessages", gqlException.ErrorMessages.ToList())*/ SpeckleLog.Logger.Warning( diff --git a/src/Speckle.Core/Api/GraphQL/Enums/FileUploadConversionStatus.cs b/src/Speckle.Sdk/Api/GraphQL/Enums/FileUploadConversionStatus.cs similarity index 82% rename from src/Speckle.Core/Api/GraphQL/Enums/FileUploadConversionStatus.cs rename to src/Speckle.Sdk/Api/GraphQL/Enums/FileUploadConversionStatus.cs index 4ab9e751..327f947e 100644 --- a/src/Speckle.Core/Api/GraphQL/Enums/FileUploadConversionStatus.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Enums/FileUploadConversionStatus.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Enums; +namespace Speckle.Sdk.Api.GraphQL.Enums; //This enum isn't explicitly defined in the schema, instead its usages are int typed (But represent an enum) public enum FileUploadConversionStatus diff --git a/src/Speckle.Core/Api/GraphQL/Enums/ProjectCommentsUpdatedMessageType.cs b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectCommentsUpdatedMessageType.cs similarity index 65% rename from src/Speckle.Core/Api/GraphQL/Enums/ProjectCommentsUpdatedMessageType.cs rename to src/Speckle.Sdk/Api/GraphQL/Enums/ProjectCommentsUpdatedMessageType.cs index 2f11301d..2500425d 100644 --- a/src/Speckle.Core/Api/GraphQL/Enums/ProjectCommentsUpdatedMessageType.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectCommentsUpdatedMessageType.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Enums; +namespace Speckle.Sdk.Api.GraphQL.Enums; public enum ProjectCommentsUpdatedMessageType { diff --git a/src/Speckle.Core/Api/GraphQL/Enums/ProjectFileImportUpdatedMessageType.cs b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectFileImportUpdatedMessageType.cs similarity index 62% rename from src/Speckle.Core/Api/GraphQL/Enums/ProjectFileImportUpdatedMessageType.cs rename to src/Speckle.Sdk/Api/GraphQL/Enums/ProjectFileImportUpdatedMessageType.cs index 7cb7d933..b1947272 100644 --- a/src/Speckle.Core/Api/GraphQL/Enums/ProjectFileImportUpdatedMessageType.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectFileImportUpdatedMessageType.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Enums; +namespace Speckle.Sdk.Api.GraphQL.Enums; public enum ProjectFileImportUpdatedMessageType { diff --git a/src/Speckle.Core/Api/GraphQL/Enums/ProjectModelsUpdatedMessageType.cs b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectModelsUpdatedMessageType.cs similarity index 64% rename from src/Speckle.Core/Api/GraphQL/Enums/ProjectModelsUpdatedMessageType.cs rename to src/Speckle.Sdk/Api/GraphQL/Enums/ProjectModelsUpdatedMessageType.cs index 1416691f..b6316fb0 100644 --- a/src/Speckle.Core/Api/GraphQL/Enums/ProjectModelsUpdatedMessageType.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectModelsUpdatedMessageType.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Enums; +namespace Speckle.Sdk.Api.GraphQL.Enums; public enum ProjectModelsUpdatedMessageType { diff --git a/src/Speckle.Core/Api/GraphQL/Enums/ProjectPendingModelsUpdatedMessageType.cs b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectPendingModelsUpdatedMessageType.cs similarity index 63% rename from src/Speckle.Core/Api/GraphQL/Enums/ProjectPendingModelsUpdatedMessageType.cs rename to src/Speckle.Sdk/Api/GraphQL/Enums/ProjectPendingModelsUpdatedMessageType.cs index 42ac2beb..8e24a9c8 100644 --- a/src/Speckle.Core/Api/GraphQL/Enums/ProjectPendingModelsUpdatedMessageType.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectPendingModelsUpdatedMessageType.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Enums; +namespace Speckle.Sdk.Api.GraphQL.Enums; public enum ProjectPendingModelsUpdatedMessageType { diff --git a/src/Speckle.Core/Api/GraphQL/Enums/ProjectUpdatedMessageType.cs b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectUpdatedMessageType.cs similarity index 59% rename from src/Speckle.Core/Api/GraphQL/Enums/ProjectUpdatedMessageType.cs rename to src/Speckle.Sdk/Api/GraphQL/Enums/ProjectUpdatedMessageType.cs index 3eccdd5a..a056708c 100644 --- a/src/Speckle.Core/Api/GraphQL/Enums/ProjectUpdatedMessageType.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectUpdatedMessageType.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Enums; +namespace Speckle.Sdk.Api.GraphQL.Enums; public enum ProjectUpdatedMessageType { diff --git a/src/Speckle.Core/Api/GraphQL/Enums/ProjectVersionsUpdatedMessageType.cs b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectVersionsUpdatedMessageType.cs similarity index 65% rename from src/Speckle.Core/Api/GraphQL/Enums/ProjectVersionsUpdatedMessageType.cs rename to src/Speckle.Sdk/Api/GraphQL/Enums/ProjectVersionsUpdatedMessageType.cs index 14e1f700..977c93f8 100644 --- a/src/Speckle.Core/Api/GraphQL/Enums/ProjectVersionsUpdatedMessageType.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectVersionsUpdatedMessageType.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Enums; +namespace Speckle.Sdk.Api.GraphQL.Enums; public enum ProjectVersionsUpdatedMessageType { diff --git a/src/Speckle.Core/Api/GraphQL/Enums/ProjectVisibility.cs b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectVisibility.cs similarity index 59% rename from src/Speckle.Core/Api/GraphQL/Enums/ProjectVisibility.cs rename to src/Speckle.Sdk/Api/GraphQL/Enums/ProjectVisibility.cs index 9a62fff9..3f2fdb11 100644 --- a/src/Speckle.Core/Api/GraphQL/Enums/ProjectVisibility.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Enums/ProjectVisibility.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Enums; +namespace Speckle.Sdk.Api.GraphQL.Enums; public enum ProjectVisibility { diff --git a/src/Speckle.Core/Api/GraphQL/Enums/ResourceType.cs b/src/Speckle.Sdk/Api/GraphQL/Enums/ResourceType.cs similarity index 61% rename from src/Speckle.Core/Api/GraphQL/Enums/ResourceType.cs rename to src/Speckle.Sdk/Api/GraphQL/Enums/ResourceType.cs index 2fa31c46..4358f927 100644 --- a/src/Speckle.Core/Api/GraphQL/Enums/ResourceType.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Enums/ResourceType.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Enums; +namespace Speckle.Sdk.Api.GraphQL.Enums; public enum ResourceType { diff --git a/src/Speckle.Core/Api/GraphQL/Enums/UserProjectsUpdatedMessageType.cs b/src/Speckle.Sdk/Api/GraphQL/Enums/UserProjectsUpdatedMessageType.cs similarity index 60% rename from src/Speckle.Core/Api/GraphQL/Enums/UserProjectsUpdatedMessageType.cs rename to src/Speckle.Sdk/Api/GraphQL/Enums/UserProjectsUpdatedMessageType.cs index 5225929a..1ad08ce3 100644 --- a/src/Speckle.Core/Api/GraphQL/Enums/UserProjectsUpdatedMessageType.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Enums/UserProjectsUpdatedMessageType.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Enums; +namespace Speckle.Sdk.Api.GraphQL.Enums; public enum UserProjectsUpdatedMessageType { diff --git a/src/Speckle.Core/Api/GraphQL/GraphQLHttpClientExtensions.cs b/src/Speckle.Sdk/Api/GraphQL/GraphQLHttpClientExtensions.cs similarity index 95% rename from src/Speckle.Core/Api/GraphQL/GraphQLHttpClientExtensions.cs rename to src/Speckle.Sdk/Api/GraphQL/GraphQLHttpClientExtensions.cs index 6cf30414..7e24cc96 100644 --- a/src/Speckle.Core/Api/GraphQL/GraphQLHttpClientExtensions.cs +++ b/src/Speckle.Sdk/Api/GraphQL/GraphQLHttpClientExtensions.cs @@ -1,8 +1,8 @@ using GraphQL; using GraphQL.Client.Http; -using Speckle.Core.Api.GraphQL.Models.Responses; +using Speckle.Sdk.Api.GraphQL.Models.Responses; -namespace Speckle.Core.Api.GraphQL; +namespace Speckle.Sdk.Api.GraphQL; public static class GraphQLHttpClientExtensions { diff --git a/src/Speckle.Core/Api/GraphQL/ISpeckleGraphQLClient.cs b/src/Speckle.Sdk/Api/GraphQL/ISpeckleGraphQLClient.cs similarity index 96% rename from src/Speckle.Core/Api/GraphQL/ISpeckleGraphQLClient.cs rename to src/Speckle.Sdk/Api/GraphQL/ISpeckleGraphQLClient.cs index 29998fbd..8d0d99ec 100644 --- a/src/Speckle.Core/Api/GraphQL/ISpeckleGraphQLClient.cs +++ b/src/Speckle.Sdk/Api/GraphQL/ISpeckleGraphQLClient.cs @@ -1,6 +1,6 @@ using GraphQL; -namespace Speckle.Core.Api.GraphQL; +namespace Speckle.Sdk.Api.GraphQL; internal interface ISpeckleGraphQLClient { diff --git a/src/Speckle.Core/Api/GraphQL/Inputs/CommentInputs.cs b/src/Speckle.Sdk/Api/GraphQL/Inputs/CommentInputs.cs similarity index 90% rename from src/Speckle.Core/Api/GraphQL/Inputs/CommentInputs.cs rename to src/Speckle.Sdk/Api/GraphQL/Inputs/CommentInputs.cs index 2c59ea30..ea217354 100644 --- a/src/Speckle.Core/Api/GraphQL/Inputs/CommentInputs.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Inputs/CommentInputs.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Inputs; +namespace Speckle.Sdk.Api.GraphQL.Inputs; public sealed record CreateCommentInput( CommentContentInput content, diff --git a/src/Speckle.Core/Api/GraphQL/Inputs/ModelInputs.cs b/src/Speckle.Sdk/Api/GraphQL/Inputs/ModelInputs.cs similarity index 88% rename from src/Speckle.Core/Api/GraphQL/Inputs/ModelInputs.cs rename to src/Speckle.Sdk/Api/GraphQL/Inputs/ModelInputs.cs index f1dd3e4f..134300e3 100644 --- a/src/Speckle.Core/Api/GraphQL/Inputs/ModelInputs.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Inputs/ModelInputs.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Inputs; +namespace Speckle.Sdk.Api.GraphQL.Inputs; public sealed record CreateModelInput(string name, string? description, string projectId); diff --git a/src/Speckle.Core/Api/GraphQL/Inputs/ProjectInputs.cs b/src/Speckle.Sdk/Api/GraphQL/Inputs/ProjectInputs.cs similarity index 93% rename from src/Speckle.Core/Api/GraphQL/Inputs/ProjectInputs.cs rename to src/Speckle.Sdk/Api/GraphQL/Inputs/ProjectInputs.cs index 4c5911bb..00e6a8d1 100644 --- a/src/Speckle.Core/Api/GraphQL/Inputs/ProjectInputs.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Inputs/ProjectInputs.cs @@ -1,6 +1,6 @@ -using Speckle.Core.Api.GraphQL.Enums; +using Speckle.Sdk.Api.GraphQL.Enums; -namespace Speckle.Core.Api.GraphQL.Inputs; +namespace Speckle.Sdk.Api.GraphQL.Inputs; public sealed record ProjectCommentsFilter(bool? includeArchived, bool? loadedVersionsOnly, string? resourceIdString); diff --git a/src/Speckle.Core/Api/GraphQL/Inputs/SubscriptionInputs.cs b/src/Speckle.Sdk/Api/GraphQL/Inputs/SubscriptionInputs.cs similarity index 74% rename from src/Speckle.Core/Api/GraphQL/Inputs/SubscriptionInputs.cs rename to src/Speckle.Sdk/Api/GraphQL/Inputs/SubscriptionInputs.cs index 86688a28..4736a640 100644 --- a/src/Speckle.Core/Api/GraphQL/Inputs/SubscriptionInputs.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Inputs/SubscriptionInputs.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Inputs; +namespace Speckle.Sdk.Api.GraphQL.Inputs; public sealed record ViewerUpdateTrackingTarget( string projectId, diff --git a/src/Speckle.Core/Api/GraphQL/Inputs/VersionInputs.cs b/src/Speckle.Sdk/Api/GraphQL/Inputs/VersionInputs.cs similarity index 93% rename from src/Speckle.Core/Api/GraphQL/Inputs/VersionInputs.cs rename to src/Speckle.Sdk/Api/GraphQL/Inputs/VersionInputs.cs index 4ce9dac4..a9690796 100644 --- a/src/Speckle.Core/Api/GraphQL/Inputs/VersionInputs.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Inputs/VersionInputs.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Inputs; +namespace Speckle.Sdk.Api.GraphQL.Inputs; public sealed record UpdateVersionInput(string versionId, string? message); diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ActivityOperations.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ActivityOperations.cs similarity index 98% rename from src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ActivityOperations.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ActivityOperations.cs index 899ed851..daa3130b 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ActivityOperations.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ActivityOperations.cs @@ -1,6 +1,6 @@ using GraphQL; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public partial class Client { diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.BranchOperations.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.BranchOperations.cs similarity index 99% rename from src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.BranchOperations.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.BranchOperations.cs index 088149d1..ff1921b1 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.BranchOperations.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.BranchOperations.cs @@ -1,7 +1,7 @@ using GraphQL; -using Speckle.Core.Api.GraphQL.Resources; +using Speckle.Sdk.Api.GraphQL.Resources; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public partial class Client { diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommentOperations.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommentOperations.cs similarity index 98% rename from src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommentOperations.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommentOperations.cs index 0de4451a..e71ee87e 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommentOperations.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommentOperations.cs @@ -1,7 +1,7 @@ using GraphQL; -using Speckle.Core.Api.GraphQL.Resources; +using Speckle.Sdk.Api.GraphQL.Resources; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public partial class Client { diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommitOperations.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommitOperations.cs similarity index 98% rename from src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommitOperations.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommitOperations.cs index 55ebf759..4d91be15 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommitOperations.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.CommitOperations.cs @@ -1,7 +1,7 @@ using GraphQL; -using Speckle.Core.Api.GraphQL.Resources; +using Speckle.Sdk.Api.GraphQL.Resources; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public partial class Client { diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ObjectOperations.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ObjectOperations.cs similarity index 98% rename from src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ObjectOperations.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ObjectOperations.cs index 83bef6af..2e900988 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ObjectOperations.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ObjectOperations.cs @@ -1,6 +1,6 @@ using GraphQL; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public partial class Client { diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ServerOperations.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ServerOperations.cs similarity index 82% rename from src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ServerOperations.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ServerOperations.cs index d2bb1c2d..702353bf 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ServerOperations.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.ServerOperations.cs @@ -1,9 +1,9 @@ using System.Text.RegularExpressions; using GraphQL; -using Speckle.Core.Api.GraphQL.Models.Responses; -using Speckle.Core.Logging; +using Speckle.Sdk.Api.GraphQL.Models.Responses; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public partial class Client { @@ -11,7 +11,7 @@ public partial class Client /// Gets the version of the current server. Useful for guarding against unsupported api calls on newer or older servers. /// /// [Optional] defaults to an empty cancellation token - /// object excluding any strings (eg "2.7.2-alpha.6995" becomes "2.7.2.6995") + /// object excluding any strings (eg "2.7.2-alpha.6995" becomes "2.7.2.6995") /// [Obsolete("Use GraphQLHttpClient.GetServerVersion instead")] public async Task GetServerVersion(CancellationToken cancellationToken = default) diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.StreamOperations.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.StreamOperations.cs similarity index 99% rename from src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.StreamOperations.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.StreamOperations.cs index c73b8bd6..aaeaec32 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.StreamOperations.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.StreamOperations.cs @@ -1,11 +1,11 @@ #nullable disable using GraphQL; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Models.Responses; -using Speckle.Core.Api.GraphQL.Resources; -using Speckle.Core.Logging; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Models.Responses; +using Speckle.Sdk.Api.GraphQL.Resources; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public partial class Client { diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.UserOperations.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.UserOperations.cs similarity index 93% rename from src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.UserOperations.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.UserOperations.cs index 24554fae..42a41f6f 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.UserOperations.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.GraphqlCleintOperations/Client.UserOperations.cs @@ -1,7 +1,7 @@ -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Resources; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Resources; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public partial class Client { diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Branch.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Branch.cs similarity index 97% rename from src/Speckle.Core/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Branch.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Branch.cs index 1daaca7d..64510c81 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Branch.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Branch.cs @@ -1,8 +1,7 @@ #nullable disable using GraphQL; -using Speckle.Core.Api.SubscriptionModels; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public partial class Client { diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Commit.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Commit.cs similarity index 97% rename from src/Speckle.Core/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Commit.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Commit.cs index 436184d4..02b4817f 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Commit.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Commit.cs @@ -1,8 +1,7 @@ #nullable disable using GraphQL; -using Speckle.Core.Api.SubscriptionModels; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public partial class Client { diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Stream.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Stream.cs similarity index 97% rename from src/Speckle.Core/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Stream.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Stream.cs index 1a176ae0..a969fc4d 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Stream.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/Client.Subscriptions/Client.Subscriptions.Stream.cs @@ -1,8 +1,7 @@ #nullable disable using GraphQL; -using Speckle.Core.Api.SubscriptionModels; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public partial class Client { diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/LegacyGraphQLModels.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/LegacyGraphQLModels.cs similarity index 99% rename from src/Speckle.Core/Api/GraphQL/Legacy/LegacyGraphQLModels.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/LegacyGraphQLModels.cs index 7c3a31ac..431943ce 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/LegacyGraphQLModels.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/LegacyGraphQLModels.cs @@ -1,8 +1,8 @@ #nullable disable -using Speckle.Core.Api.GraphQL.Enums; -using Speckle.Core.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Enums; +using Speckle.Sdk.Api.GraphQL.Models; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; #region inputs diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/Manager.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/Manager.cs similarity index 98% rename from src/Speckle.Core/Api/GraphQL/Legacy/Manager.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/Manager.cs index d46c018d..fe46ab7c 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/Manager.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/Manager.cs @@ -1,7 +1,7 @@ #nullable disable using System.Text.Json.Serialization; -namespace Speckle.Core.Api.GraphQL; +namespace Speckle.Sdk.Api; #region manager api diff --git a/src/Speckle.Core/Api/GraphQL/Legacy/SubscriptionModels.cs b/src/Speckle.Sdk/Api/GraphQL/Legacy/SubscriptionModels.cs similarity index 98% rename from src/Speckle.Core/Api/GraphQL/Legacy/SubscriptionModels.cs rename to src/Speckle.Sdk/Api/GraphQL/Legacy/SubscriptionModels.cs index 335c52bf..454eba57 100644 --- a/src/Speckle.Core/Api/GraphQL/Legacy/SubscriptionModels.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Legacy/SubscriptionModels.cs @@ -1,5 +1,5 @@ #nullable disable -namespace Speckle.Core.Api.SubscriptionModels; +namespace Speckle.Sdk.Api; #region streams [Obsolete(DeprecationMessages.FE1_DEPRECATION_MESSAGE)] diff --git a/src/Speckle.Core/Api/GraphQL/Models/Collections.cs b/src/Speckle.Sdk/Api/GraphQL/Models/Collections.cs similarity index 89% rename from src/Speckle.Core/Api/GraphQL/Models/Collections.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/Collections.cs index efdb36ba..663ef7a4 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/Collections.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/Collections.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Models; +namespace Speckle.Sdk.Api.GraphQL.Models; public class ResourceCollection { diff --git a/src/Speckle.Core/Api/GraphQL/Models/Comment.cs b/src/Speckle.Sdk/Api/GraphQL/Models/Comment.cs similarity index 94% rename from src/Speckle.Core/Api/GraphQL/Models/Comment.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/Comment.cs index a9d10c1e..3ca53e81 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/Comment.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/Comment.cs @@ -1,6 +1,6 @@ #nullable disable -namespace Speckle.Core.Api.GraphQL.Models; +namespace Speckle.Sdk.Api.GraphQL.Models; public sealed class Comment { diff --git a/src/Speckle.Core/Api/GraphQL/Models/FileUpload.cs b/src/Speckle.Sdk/Api/GraphQL/Models/FileUpload.cs similarity index 91% rename from src/Speckle.Core/Api/GraphQL/Models/FileUpload.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/FileUpload.cs index d259195e..4a6f3b53 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/FileUpload.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/FileUpload.cs @@ -1,8 +1,8 @@ #nullable disable -using Speckle.Core.Api.GraphQL.Enums; +using Speckle.Sdk.Api.GraphQL.Enums; -namespace Speckle.Core.Api.GraphQL.Models; +namespace Speckle.Sdk.Api.GraphQL.Models; public sealed class FileUpload { diff --git a/src/Speckle.Core/Api/GraphQL/Models/Model.cs b/src/Speckle.Sdk/Api/GraphQL/Models/Model.cs similarity index 93% rename from src/Speckle.Core/Api/GraphQL/Models/Model.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/Model.cs index f48ee18f..4d7acb20 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/Model.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/Model.cs @@ -1,5 +1,5 @@ #nullable disable -namespace Speckle.Core.Api.GraphQL.Models; +namespace Speckle.Sdk.Api.GraphQL.Models; public sealed class Model { diff --git a/src/Speckle.Core/Api/GraphQL/Models/ModelsTreeItem.cs b/src/Speckle.Sdk/Api/GraphQL/Models/ModelsTreeItem.cs similarity index 88% rename from src/Speckle.Core/Api/GraphQL/Models/ModelsTreeItem.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/ModelsTreeItem.cs index 8269e790..2b93e210 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/ModelsTreeItem.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/ModelsTreeItem.cs @@ -1,6 +1,6 @@ #nullable disable -namespace Speckle.Core.Api.GraphQL.Models; +namespace Speckle.Sdk.Api.GraphQL.Models; public sealed class ModelsTreeItem { diff --git a/src/Speckle.Core/Api/GraphQL/Models/PendingStreamCollaborator.cs b/src/Speckle.Sdk/Api/GraphQL/Models/PendingStreamCollaborator.cs similarity index 93% rename from src/Speckle.Core/Api/GraphQL/Models/PendingStreamCollaborator.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/PendingStreamCollaborator.cs index 275552fc..57de53f2 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/PendingStreamCollaborator.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/PendingStreamCollaborator.cs @@ -1,5 +1,6 @@ #nullable disable -namespace Speckle.Core.Api.GraphQL.Models; + +namespace Speckle.Sdk.Api.GraphQL.Models; public sealed class PendingStreamCollaborator { diff --git a/src/Speckle.Core/Api/GraphQL/Models/Project.cs b/src/Speckle.Sdk/Api/GraphQL/Models/Project.cs similarity index 92% rename from src/Speckle.Core/Api/GraphQL/Models/Project.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/Project.cs index 1261c948..18b4eb9d 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/Project.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/Project.cs @@ -1,7 +1,7 @@ #nullable disable -using Speckle.Core.Api.GraphQL.Enums; +using Speckle.Sdk.Api.GraphQL.Enums; -namespace Speckle.Core.Api.GraphQL.Models; +namespace Speckle.Sdk.Api.GraphQL.Models; public sealed class Project { diff --git a/src/Speckle.Core/Api/GraphQL/Models/ProjectCollaborator.cs b/src/Speckle.Sdk/Api/GraphQL/Models/ProjectCollaborator.cs similarity index 77% rename from src/Speckle.Core/Api/GraphQL/Models/ProjectCollaborator.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/ProjectCollaborator.cs index ea062831..232eb82e 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/ProjectCollaborator.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/ProjectCollaborator.cs @@ -1,6 +1,6 @@ #nullable disable -namespace Speckle.Core.Api.GraphQL.Models; +namespace Speckle.Sdk.Api.GraphQL.Models; public sealed class ProjectCollaborator { diff --git a/src/Speckle.Core/Api/GraphQL/Models/ResourceIdentifier.cs b/src/Speckle.Sdk/Api/GraphQL/Models/ResourceIdentifier.cs similarity index 66% rename from src/Speckle.Core/Api/GraphQL/Models/ResourceIdentifier.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/ResourceIdentifier.cs index 670111ca..adeb2252 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/ResourceIdentifier.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/ResourceIdentifier.cs @@ -1,7 +1,7 @@ #nullable disable -using Speckle.Core.Api.GraphQL.Enums; +using Speckle.Sdk.Api.GraphQL.Enums; -namespace Speckle.Core.Api.GraphQL.Models; +namespace Speckle.Sdk.Api.GraphQL.Models; public sealed class ResourceIdentifier { diff --git a/src/Speckle.Core/Api/GraphQL/Models/Responses/MutationResponses.cs b/src/Speckle.Sdk/Api/GraphQL/Models/Responses/MutationResponses.cs similarity index 94% rename from src/Speckle.Core/Api/GraphQL/Models/Responses/MutationResponses.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/Responses/MutationResponses.cs index 55af5413..d5096444 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/Responses/MutationResponses.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/Responses/MutationResponses.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL.Models.Responses; +namespace Speckle.Sdk.Api.GraphQL.Models.Responses; #nullable disable internal sealed class ProjectMutation diff --git a/src/Speckle.Core/Api/GraphQL/Models/Responses/Responses.cs b/src/Speckle.Sdk/Api/GraphQL/Models/Responses/Responses.cs similarity index 96% rename from src/Speckle.Core/Api/GraphQL/Models/Responses/Responses.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/Responses/Responses.cs index e731f311..e84ffd70 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/Responses/Responses.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/Responses/Responses.cs @@ -1,6 +1,6 @@ using Speckle.Newtonsoft.Json; -namespace Speckle.Core.Api.GraphQL.Models.Responses; +namespace Speckle.Sdk.Api.GraphQL.Models.Responses; // This file holds simple records that represent the root GraphQL response data // For this reason, we're keeping them internal, allowing us to be flexible without the concern for breaking. diff --git a/src/Speckle.Core/Api/GraphQL/Models/ServerInfo.cs b/src/Speckle.Sdk/Api/GraphQL/Models/ServerInfo.cs similarity index 86% rename from src/Speckle.Core/Api/GraphQL/Models/ServerInfo.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/ServerInfo.cs index a63a5349..707a0dce 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/ServerInfo.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/ServerInfo.cs @@ -1,7 +1,7 @@ #nullable disable using System.Runtime.InteropServices; -namespace Speckle.Core.Api.GraphQL.Models; +namespace Speckle.Sdk.Api.GraphQL.Models; [ClassInterface(ClassInterfaceType.AutoDual)] [ComVisible(true)] @@ -16,14 +16,14 @@ public sealed class ServerInfo /// /// This field is not returned from the GQL API, /// it should be populated after construction from the response headers. - /// see + /// see /// public bool frontend2 { get; set; } /// /// This field is not returned from the GQL API, /// it should be populated after construction. - /// see + /// see /// public string url { get; set; } diff --git a/src/Speckle.Core/Api/GraphQL/Models/SubscriptionMessages.cs b/src/Speckle.Sdk/Api/GraphQL/Models/SubscriptionMessages.cs similarity index 93% rename from src/Speckle.Core/Api/GraphQL/Models/SubscriptionMessages.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/SubscriptionMessages.cs index e435ce3f..9d4fe88a 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/SubscriptionMessages.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/SubscriptionMessages.cs @@ -1,7 +1,7 @@ -using Speckle.Core.Api.GraphQL.Enums; -using Speckle.Newtonsoft.Json; +using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Api.GraphQL.Enums; -namespace Speckle.Core.Api.GraphQL.Models; +namespace Speckle.Sdk.Api.GraphQL.Models; public sealed class UserProjectsUpdatedMessage : EventArgs { diff --git a/src/Speckle.Core/Api/GraphQL/Models/User.cs b/src/Speckle.Sdk/Api/GraphQL/Models/User.cs similarity index 97% rename from src/Speckle.Core/Api/GraphQL/Models/User.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/User.cs index 3c8f1086..7bc1d3da 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/User.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/User.cs @@ -1,5 +1,6 @@ #nullable disable -namespace Speckle.Core.Api.GraphQL.Models; + +namespace Speckle.Sdk.Api.GraphQL.Models; public abstract class UserBase { diff --git a/src/Speckle.Core/Api/GraphQL/Models/Version.cs b/src/Speckle.Sdk/Api/GraphQL/Models/Version.cs similarity index 91% rename from src/Speckle.Core/Api/GraphQL/Models/Version.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/Version.cs index 7f1b1af8..b0ec7854 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/Version.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/Version.cs @@ -1,6 +1,6 @@ #nullable disable -namespace Speckle.Core.Api.GraphQL.Models; +namespace Speckle.Sdk.Api.GraphQL.Models; public sealed class Version { diff --git a/src/Speckle.Core/Api/GraphQL/Models/ViewerResourceGroup.cs b/src/Speckle.Sdk/Api/GraphQL/Models/ViewerResourceGroup.cs similarity index 78% rename from src/Speckle.Core/Api/GraphQL/Models/ViewerResourceGroup.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/ViewerResourceGroup.cs index f242c534..7dbd6533 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/ViewerResourceGroup.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/ViewerResourceGroup.cs @@ -1,6 +1,6 @@ #nullable disable -namespace Speckle.Core.Api.GraphQL.Models; +namespace Speckle.Sdk.Api.GraphQL.Models; public class ViewerResourceGroup { diff --git a/src/Speckle.Core/Api/GraphQL/Models/ViewerResourceItem.cs b/src/Speckle.Sdk/Api/GraphQL/Models/ViewerResourceItem.cs similarity index 80% rename from src/Speckle.Core/Api/GraphQL/Models/ViewerResourceItem.cs rename to src/Speckle.Sdk/Api/GraphQL/Models/ViewerResourceItem.cs index 12fc34e2..d87d8af5 100644 --- a/src/Speckle.Core/Api/GraphQL/Models/ViewerResourceItem.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Models/ViewerResourceItem.cs @@ -1,6 +1,6 @@ #nullable disable -namespace Speckle.Core.Api.GraphQL.Models; +namespace Speckle.Sdk.Api.GraphQL.Models; public class ViewerResourceItem { diff --git a/src/Speckle.Core/Api/GraphQL/Resources/ActiveUserResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/ActiveUserResource.cs similarity index 95% rename from src/Speckle.Core/Api/GraphQL/Resources/ActiveUserResource.cs rename to src/Speckle.Sdk/Api/GraphQL/Resources/ActiveUserResource.cs index 6efacca5..a9748e82 100644 --- a/src/Speckle.Core/Api/GraphQL/Resources/ActiveUserResource.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Resources/ActiveUserResource.cs @@ -1,9 +1,9 @@ using GraphQL; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Models.Responses; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Models.Responses; -namespace Speckle.Core.Api.GraphQL.Resources; +namespace Speckle.Sdk.Api.GraphQL.Resources; public sealed class ActiveUserResource { diff --git a/src/Speckle.Core/Api/GraphQL/Resources/CommentResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/CommentResource.cs similarity index 97% rename from src/Speckle.Core/Api/GraphQL/Resources/CommentResource.cs rename to src/Speckle.Sdk/Api/GraphQL/Resources/CommentResource.cs index 7b1350cb..bcb3c8ba 100644 --- a/src/Speckle.Core/Api/GraphQL/Resources/CommentResource.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Resources/CommentResource.cs @@ -1,9 +1,9 @@ using GraphQL; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Models.Responses; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Models.Responses; -namespace Speckle.Core.Api.GraphQL.Resources; +namespace Speckle.Sdk.Api.GraphQL.Resources; public sealed class CommentResource { diff --git a/src/Speckle.Core/Api/GraphQL/Resources/ModelResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/ModelResource.cs similarity index 97% rename from src/Speckle.Core/Api/GraphQL/Resources/ModelResource.cs rename to src/Speckle.Sdk/Api/GraphQL/Resources/ModelResource.cs index 9d5005ee..1d297bd3 100644 --- a/src/Speckle.Core/Api/GraphQL/Resources/ModelResource.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Resources/ModelResource.cs @@ -1,9 +1,9 @@ using GraphQL; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Models.Responses; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Models.Responses; -namespace Speckle.Core.Api.GraphQL.Resources; +namespace Speckle.Sdk.Api.GraphQL.Resources; public sealed class ModelResource { diff --git a/src/Speckle.Core/Api/GraphQL/Resources/OtherUserResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/OtherUserResource.cs similarity index 95% rename from src/Speckle.Core/Api/GraphQL/Resources/OtherUserResource.cs rename to src/Speckle.Sdk/Api/GraphQL/Resources/OtherUserResource.cs index a2ca73f9..47ed1c34 100644 --- a/src/Speckle.Core/Api/GraphQL/Resources/OtherUserResource.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Resources/OtherUserResource.cs @@ -1,8 +1,8 @@ using GraphQL; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Models.Responses; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Models.Responses; -namespace Speckle.Core.Api.GraphQL.Resources; +namespace Speckle.Sdk.Api.GraphQL.Resources; public sealed class OtherUserResource { diff --git a/src/Speckle.Core/Api/GraphQL/Resources/ProjectInviteResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/ProjectInviteResource.cs similarity index 97% rename from src/Speckle.Core/Api/GraphQL/Resources/ProjectInviteResource.cs rename to src/Speckle.Sdk/Api/GraphQL/Resources/ProjectInviteResource.cs index 6e22a76f..cd122a59 100644 --- a/src/Speckle.Core/Api/GraphQL/Resources/ProjectInviteResource.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Resources/ProjectInviteResource.cs @@ -1,9 +1,9 @@ using GraphQL; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Models.Responses; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Models.Responses; -namespace Speckle.Core.Api.GraphQL.Resources; +namespace Speckle.Sdk.Api.GraphQL.Resources; public sealed class ProjectInviteResource { diff --git a/src/Speckle.Core/Api/GraphQL/Resources/ProjectResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/ProjectResource.cs similarity index 98% rename from src/Speckle.Core/Api/GraphQL/Resources/ProjectResource.cs rename to src/Speckle.Sdk/Api/GraphQL/Resources/ProjectResource.cs index e2cfcb46..ddf05398 100644 --- a/src/Speckle.Core/Api/GraphQL/Resources/ProjectResource.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Resources/ProjectResource.cs @@ -1,9 +1,9 @@ using GraphQL; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Models.Responses; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Models.Responses; -namespace Speckle.Core.Api.GraphQL.Resources; +namespace Speckle.Sdk.Api.GraphQL.Resources; public sealed class ProjectResource { diff --git a/src/Speckle.Core/Api/GraphQL/Resources/SubscriptionResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/SubscriptionResource.cs similarity index 97% rename from src/Speckle.Core/Api/GraphQL/Resources/SubscriptionResource.cs rename to src/Speckle.Sdk/Api/GraphQL/Resources/SubscriptionResource.cs index a35fcbd7..916768f7 100644 --- a/src/Speckle.Core/Api/GraphQL/Resources/SubscriptionResource.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Resources/SubscriptionResource.cs @@ -1,9 +1,9 @@ using GraphQL; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Models.Responses; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Models.Responses; -namespace Speckle.Core.Api.GraphQL.Resources; +namespace Speckle.Sdk.Api.GraphQL.Resources; public sealed class Subscription : IDisposable where TEventArgs : EventArgs diff --git a/src/Speckle.Core/Api/GraphQL/Resources/VersionResource.cs b/src/Speckle.Sdk/Api/GraphQL/Resources/VersionResource.cs similarity index 97% rename from src/Speckle.Core/Api/GraphQL/Resources/VersionResource.cs rename to src/Speckle.Sdk/Api/GraphQL/Resources/VersionResource.cs index 4e808b2d..8e5b851e 100644 --- a/src/Speckle.Core/Api/GraphQL/Resources/VersionResource.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Resources/VersionResource.cs @@ -1,10 +1,10 @@ using GraphQL; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Models.Responses; -using Version = Speckle.Core.Api.GraphQL.Models.Version; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Models.Responses; +using Version = Speckle.Sdk.Api.GraphQL.Models.Version; -namespace Speckle.Core.Api.GraphQL.Resources; +namespace Speckle.Sdk.Api.GraphQL.Resources; public sealed class VersionResource { diff --git a/src/Speckle.Core/Api/GraphQL/Resources/graphql.config.yml b/src/Speckle.Sdk/Api/GraphQL/Resources/graphql.config.yml similarity index 100% rename from src/Speckle.Core/Api/GraphQL/Resources/graphql.config.yml rename to src/Speckle.Sdk/Api/GraphQL/Resources/graphql.config.yml diff --git a/src/Speckle.Core/Api/GraphQL/Serializer/ConstantCaseEnumConverter.cs b/src/Speckle.Sdk/Api/GraphQL/Serializer/ConstantCaseEnumConverter.cs similarity index 95% rename from src/Speckle.Core/Api/GraphQL/Serializer/ConstantCaseEnumConverter.cs rename to src/Speckle.Sdk/Api/GraphQL/Serializer/ConstantCaseEnumConverter.cs index e0f438c3..0abc3614 100644 --- a/src/Speckle.Core/Api/GraphQL/Serializer/ConstantCaseEnumConverter.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Serializer/ConstantCaseEnumConverter.cs @@ -5,7 +5,7 @@ using Speckle.Newtonsoft.Json; using Speckle.Newtonsoft.Json.Converters; -namespace Speckle.Core.Api.GraphQL.Serializer; +namespace Speckle.Sdk.Api.GraphQL.Serializer; internal class ConstantCaseEnumConverter : StringEnumConverter { diff --git a/src/Speckle.Core/Api/GraphQL/Serializer/MapConverter.cs b/src/Speckle.Sdk/Api/GraphQL/Serializer/MapConverter.cs similarity index 98% rename from src/Speckle.Core/Api/GraphQL/Serializer/MapConverter.cs rename to src/Speckle.Sdk/Api/GraphQL/Serializer/MapConverter.cs index 2e7eb363..919ff1d7 100644 --- a/src/Speckle.Core/Api/GraphQL/Serializer/MapConverter.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Serializer/MapConverter.cs @@ -4,7 +4,7 @@ using Speckle.Newtonsoft.Json; using Speckle.Newtonsoft.Json.Linq; -namespace Speckle.Core.Api.GraphQL.Serializer; +namespace Speckle.Sdk.Api.GraphQL.Serializer; internal sealed class MapConverter : JsonConverter { diff --git a/src/Speckle.Core/Api/GraphQL/Serializer/NewtonsoftJsonSerializer.cs b/src/Speckle.Sdk/Api/GraphQL/Serializer/NewtonsoftJsonSerializer.cs similarity index 98% rename from src/Speckle.Core/Api/GraphQL/Serializer/NewtonsoftJsonSerializer.cs rename to src/Speckle.Sdk/Api/GraphQL/Serializer/NewtonsoftJsonSerializer.cs index 236fccf6..ce82b9a2 100644 --- a/src/Speckle.Core/Api/GraphQL/Serializer/NewtonsoftJsonSerializer.cs +++ b/src/Speckle.Sdk/Api/GraphQL/Serializer/NewtonsoftJsonSerializer.cs @@ -6,7 +6,7 @@ using Speckle.Newtonsoft.Json; using Speckle.Newtonsoft.Json.Serialization; -namespace Speckle.Core.Api.GraphQL.Serializer; +namespace Speckle.Sdk.Api.GraphQL.Serializer; internal sealed class NewtonsoftJsonSerializer : IGraphQLWebsocketJsonSerializer { diff --git a/src/Speckle.Core/Api/GraphQL/StreamRoles.cs b/src/Speckle.Sdk/Api/GraphQL/StreamRoles.cs similarity index 89% rename from src/Speckle.Core/Api/GraphQL/StreamRoles.cs rename to src/Speckle.Sdk/Api/GraphQL/StreamRoles.cs index 963fd2dd..2988f21b 100644 --- a/src/Speckle.Core/Api/GraphQL/StreamRoles.cs +++ b/src/Speckle.Sdk/Api/GraphQL/StreamRoles.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api.GraphQL; +namespace Speckle.Sdk.Api.GraphQL; /// /// These are the default roles used by the server diff --git a/src/Speckle.Core/Api/Helpers.cs b/src/Speckle.Sdk/Api/Helpers.cs similarity index 96% rename from src/Speckle.Core/Api/Helpers.cs rename to src/Speckle.Sdk/Api/Helpers.cs index c75a8263..a8eb4297 100644 --- a/src/Speckle.Core/Api/Helpers.cs +++ b/src/Speckle.Sdk/Api/Helpers.cs @@ -4,18 +4,16 @@ using System.Diagnostics.Contracts; using System.Reflection; using System.Runtime.InteropServices; -using Speckle.Core.Api.GraphQL; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Credentials; -using Speckle.Core.Helpers; -using Speckle.Core.Kits; -using Speckle.Core.Logging; -using Speckle.Core.Models; -using Speckle.Core.Transports; -using Speckle.Logging; using Speckle.Newtonsoft.Json; - -namespace Speckle.Core.Api; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Helpers; +using Speckle.Sdk.Host; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; +using Speckle.Sdk.Transports; + +namespace Speckle.Sdk.Api; public static class Helpers { diff --git a/src/Speckle.Core/Api/Operations/Operations.Receive.cs b/src/Speckle.Sdk/Api/Operations/Operations.Receive.cs similarity index 98% rename from src/Speckle.Core/Api/Operations/Operations.Receive.cs rename to src/Speckle.Sdk/Api/Operations/Operations.Receive.cs index dffad1b6..acf36744 100644 --- a/src/Speckle.Core/Api/Operations/Operations.Receive.cs +++ b/src/Speckle.Sdk/Api/Operations/Operations.Receive.cs @@ -1,11 +1,11 @@ using System.Collections.Concurrent; using System.Diagnostics; -using Speckle.Core.Models; -using Speckle.Core.Serialisation; -using Speckle.Core.Transports; -using Speckle.Logging; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; +using Speckle.Sdk.Serialisation; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public static partial class Operations { diff --git a/src/Speckle.Core/Api/Operations/Operations.Send.cs b/src/Speckle.Sdk/Api/Operations/Operations.Send.cs similarity index 96% rename from src/Speckle.Core/Api/Operations/Operations.Send.cs rename to src/Speckle.Sdk/Api/Operations/Operations.Send.cs index 62ff9d8c..ddc32638 100644 --- a/src/Speckle.Core/Api/Operations/Operations.Send.cs +++ b/src/Speckle.Sdk/Api/Operations/Operations.Send.cs @@ -1,13 +1,12 @@ using System.Collections.Concurrent; using System.Diagnostics; -using Speckle.Core.Logging; -using Speckle.Core.Models; -using Speckle.Core.Serialisation; -using Speckle.Core.Transports; -using Speckle.Logging; using Speckle.Newtonsoft.Json.Linq; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; +using Speckle.Sdk.Serialisation; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public static partial class Operations { @@ -15,7 +14,7 @@ public static partial class Operations /// Sends a Speckle Object to the provided and (optionally) the default local cache /// /// - /// + /// /// When , an additional will be included /// The or was /// diff --git a/src/Speckle.Core/Api/Operations/Operations.Serialize.cs b/src/Speckle.Sdk/Api/Operations/Operations.Serialize.cs similarity index 69% rename from src/Speckle.Core/Api/Operations/Operations.Serialize.cs rename to src/Speckle.Sdk/Api/Operations/Operations.Serialize.cs index 8af88007..b88adf48 100644 --- a/src/Speckle.Core/Api/Operations/Operations.Serialize.cs +++ b/src/Speckle.Sdk/Api/Operations/Operations.Serialize.cs @@ -1,10 +1,9 @@ -using System.Diagnostics.CodeAnalysis; -using Speckle.Core.Logging; -using Speckle.Core.Models; -using Speckle.Core.Serialisation; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; +using Speckle.Sdk.Serialisation; -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; public static partial class Operations { @@ -14,7 +13,7 @@ public static partial class Operations /// /// If you want to save and persist an object to Speckle Transport or Server, /// please use any of the "Send" methods. - /// + /// /// /// The object to serialise /// @@ -28,7 +27,7 @@ public static string Serialize(Base value, CancellationToken cancellationToken = /// /// Note: if you want to pull an object from a Speckle Transport or Server, /// please use - /// + /// /// /// The json string representation of a speckle object that you want to deserialize /// @@ -36,7 +35,7 @@ public static string Serialize(Base value, CancellationToken cancellationToken = /// was null /// was not valid JSON /// cannot be deserialised to type - /// contains closure references (see Remarks) + /// contains closure references (see Remarks) public static Base Deserialize(string value, CancellationToken cancellationToken = default) { var deserializer = new BaseObjectDeserializerV2 { CancellationToken = cancellationToken }; diff --git a/src/Speckle.Sdk/Api/Operations/Operations.cs b/src/Speckle.Sdk/Api/Operations/Operations.cs new file mode 100644 index 00000000..88684658 --- /dev/null +++ b/src/Speckle.Sdk/Api/Operations/Operations.cs @@ -0,0 +1,38 @@ +using System.Collections.Concurrent; + +namespace Speckle.Sdk.Api; + +/// +/// Exposes several key methods for interacting with Speckle.Sdk. +/// Serialize/Deserialize +/// Push/Pull (methods to serialize and send data to one or more servers) +/// +public static partial class Operations +{ + /// + /// Factory for progress actions used internally inside send and receive methods. + /// + /// + /// + private static Action? GetInternalProgressAction( + Action>? onProgressAction + ) + { + if (onProgressAction is null) + { + return null; + } + + var localProgressDict = new ConcurrentDictionary(); + + return (name, processed) => + { + if (!localProgressDict.TryAdd(name, processed)) + { + localProgressDict[name] += processed; + } + + onProgressAction.Invoke(localProgressDict); + }; + } +} diff --git a/src/Speckle.Core/Api/ServerLimits.cs b/src/Speckle.Sdk/Api/ServerLimits.cs similarity index 94% rename from src/Speckle.Core/Api/ServerLimits.cs rename to src/Speckle.Sdk/Api/ServerLimits.cs index 262d1a63..1464ef6c 100644 --- a/src/Speckle.Core/Api/ServerLimits.cs +++ b/src/Speckle.Sdk/Api/ServerLimits.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Api; +namespace Speckle.Sdk.Api; /// /// Defines the limits for specific API calls on the Speckle Server. diff --git a/src/Speckle.Core/Kits/Exceptions.cs b/src/Speckle.Sdk/Common/Exceptions.cs similarity index 81% rename from src/Speckle.Core/Kits/Exceptions.cs rename to src/Speckle.Sdk/Common/Exceptions.cs index 92fe130d..b008e8c1 100644 --- a/src/Speckle.Core/Kits/Exceptions.cs +++ b/src/Speckle.Sdk/Common/Exceptions.cs @@ -1,35 +1,6 @@ -using Speckle.Core.Logging; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Kits; - -/// -/// Exception thrown when an fails to load/initialise -/// -/// -/// Does NOT inherit from , because this usage of this exception is not dependent on Speckle Data (user data) -/// Ideally, this exception should contain a meaningful message, and a reference to the -/// -public class KitException : Exception -{ - /// - /// A reference to the that failed to perform - /// - public ISpeckleKit? Kit { get; } - - public KitException(string? message, ISpeckleKit? kit, Exception? innerException = null) - : base(message, innerException) - { - Kit = kit; - } - - public KitException() { } - - public KitException(string? message) - : base(message) { } - - public KitException(string? message, Exception? innerException) - : base(message, innerException) { } -} +namespace Speckle.Sdk.Common; /// /// Exception thrown when conversion of an object was not successful diff --git a/src/Speckle.Core/Common/HashCode.cs b/src/Speckle.Sdk/Common/HashCode.cs similarity index 99% rename from src/Speckle.Core/Common/HashCode.cs rename to src/Speckle.Sdk/Common/HashCode.cs index d246c807..b1a43d24 100644 --- a/src/Speckle.Core/Common/HashCode.cs +++ b/src/Speckle.Sdk/Common/HashCode.cs @@ -1,6 +1,6 @@ using System.ComponentModel; -namespace Speckle.Core.Common; +namespace Speckle.Sdk.Common; /// /// A hash code used to help with implementing . diff --git a/src/Speckle.Core/Common/NotNullExtensions.cs b/src/Speckle.Sdk/Common/NotNullExtensions.cs similarity index 97% rename from src/Speckle.Core/Common/NotNullExtensions.cs rename to src/Speckle.Sdk/Common/NotNullExtensions.cs index 73081bc9..b3540309 100644 --- a/src/Speckle.Core/Common/NotNullExtensions.cs +++ b/src/Speckle.Sdk/Common/NotNullExtensions.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -namespace Speckle.Core.Common; +namespace Speckle.Sdk.Common; public static class NotNullExtensions { diff --git a/src/Speckle.Core/Kits/Units.cs b/src/Speckle.Sdk/Common/Units.cs similarity index 99% rename from src/Speckle.Core/Kits/Units.cs rename to src/Speckle.Sdk/Common/Units.cs index b939b53f..27709b50 100644 --- a/src/Speckle.Core/Kits/Units.cs +++ b/src/Speckle.Sdk/Common/Units.cs @@ -1,7 +1,6 @@ using System.Diagnostics.Contracts; -using Speckle.Core.Common; -namespace Speckle.Core.Kits; +namespace Speckle.Sdk.Common; public static class Units { diff --git a/src/Speckle.Core/Credentials/Account.cs b/src/Speckle.Sdk/Credentials/Account.cs similarity index 96% rename from src/Speckle.Core/Credentials/Account.cs rename to src/Speckle.Sdk/Credentials/Account.cs index 42d608a3..99fd42c1 100644 --- a/src/Speckle.Core/Credentials/Account.cs +++ b/src/Speckle.Sdk/Credentials/Account.cs @@ -1,10 +1,10 @@ #nullable disable using System.Runtime.InteropServices; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Common; -using Speckle.Core.Helpers; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Common; +using Speckle.Sdk.Helpers; -namespace Speckle.Core.Credentials; +namespace Speckle.Sdk.Credentials; [ClassInterface(ClassInterfaceType.AutoDual)] [ComVisible(true)] diff --git a/src/Speckle.Core/Credentials/AccountManager.cs b/src/Speckle.Sdk/Credentials/AccountManager.cs similarity index 98% rename from src/Speckle.Core/Credentials/AccountManager.cs rename to src/Speckle.Sdk/Credentials/AccountManager.cs index fa927359..a8163669 100644 --- a/src/Speckle.Core/Credentials/AccountManager.cs +++ b/src/Speckle.Sdk/Credentials/AccountManager.cs @@ -6,20 +6,19 @@ using System.Text.RegularExpressions; using GraphQL; using GraphQL.Client.Http; -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Models.Responses; -using Speckle.Core.Api.GraphQL.Serializer; -using Speckle.Core.Common; -using Speckle.Core.Helpers; -using Speckle.Core.Logging; -using Speckle.Core.Transports; -using Speckle.Logging; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Models.Responses; +using Speckle.Sdk.Api.GraphQL.Serializer; +using Speckle.Sdk.Common; +using Speckle.Sdk.Helpers; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Transports; using Stream = System.IO.Stream; -namespace Speckle.Core.Credentials; +namespace Speckle.Sdk.Credentials; /// /// Manage accounts locally for desktop applications. diff --git a/src/Speckle.Core/Credentials/Exceptions.cs b/src/Speckle.Sdk/Credentials/Exceptions.cs similarity index 90% rename from src/Speckle.Core/Credentials/Exceptions.cs rename to src/Speckle.Sdk/Credentials/Exceptions.cs index c9766109..fbf29439 100644 --- a/src/Speckle.Core/Credentials/Exceptions.cs +++ b/src/Speckle.Sdk/Credentials/Exceptions.cs @@ -1,6 +1,6 @@ -using Speckle.Core.Logging; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Credentials; +namespace Speckle.Sdk.Credentials; public class SpeckleAccountManagerException : SpeckleException { diff --git a/src/Speckle.Core/Credentials/Responses.cs b/src/Speckle.Sdk/Credentials/Responses.cs similarity index 92% rename from src/Speckle.Core/Credentials/Responses.cs rename to src/Speckle.Sdk/Credentials/Responses.cs index a92a4cba..65574da0 100644 --- a/src/Speckle.Core/Credentials/Responses.cs +++ b/src/Speckle.Sdk/Credentials/Responses.cs @@ -1,8 +1,8 @@ using System.Runtime.InteropServices; -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL.Models; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL.Models; -namespace Speckle.Core.Credentials; +namespace Speckle.Sdk.Credentials; internal sealed class ActiveUserServerInfoResponse { diff --git a/src/Speckle.Core/Credentials/StreamWrapper.cs b/src/Speckle.Sdk/Credentials/StreamWrapper.cs similarity index 97% rename from src/Speckle.Core/Credentials/StreamWrapper.cs rename to src/Speckle.Sdk/Credentials/StreamWrapper.cs index f2a29282..95248c82 100644 --- a/src/Speckle.Core/Credentials/StreamWrapper.cs +++ b/src/Speckle.Sdk/Credentials/StreamWrapper.cs @@ -1,11 +1,12 @@ using System.Text.RegularExpressions; using System.Web; -using Speckle.Core.Api; -using Speckle.Core.Common; -using Speckle.Core.Helpers; -using Speckle.Core.Logging; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL; +using Speckle.Sdk.Common; +using Speckle.Sdk.Helpers; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Credentials; +namespace Speckle.Sdk.Credentials; public class StreamWrapper { @@ -192,7 +193,7 @@ private void StreamWrapperFromUrl(string streamUrl) } // Note: this is a hack. It's because new Uri() is parsed escaped in .net framework; wheareas in .netstandard it's not. - // Tests pass in Speckle.Core without this hack. + // Tests pass in Speckle.Sdk without this hack. if (uri.Segments.Length >= 4 && uri.Segments[3]?.ToLowerInvariant() == "branches/") { StreamId = uri.Segments[2].Replace("/", ""); @@ -367,7 +368,7 @@ public bool Equals(StreamWrapper? wrapper) /// Verifies that the state of the stream wrapper represents a valid Speckle resource e.g. points to a valid stream/branch etc. /// /// The account to use to verify the current state of the stream wrapper - /// The of the provided is invalid or does not match the 's + /// The of the provided is invalid or does not match the 's /// You are not connected to the internet /// Verification of the current state of the stream wrapper with provided was unsuccessful. The could be invalid, or lack permissions for the , or the or are invalid public async Task ValidateWithAccount(Account acc) diff --git a/src/Speckle.Core/Credentials/graphql.config.yml b/src/Speckle.Sdk/Credentials/graphql.config.yml similarity index 100% rename from src/Speckle.Core/Credentials/graphql.config.yml rename to src/Speckle.Sdk/Credentials/graphql.config.yml diff --git a/src/Speckle.Core/Logging/ExceptionHelpers.cs b/src/Speckle.Sdk/ExceptionHelpers.cs similarity index 97% rename from src/Speckle.Core/Logging/ExceptionHelpers.cs rename to src/Speckle.Sdk/ExceptionHelpers.cs index 0d9d8e14..7e2b077f 100644 --- a/src/Speckle.Core/Logging/ExceptionHelpers.cs +++ b/src/Speckle.Sdk/ExceptionHelpers.cs @@ -1,6 +1,6 @@ using System.Diagnostics.Contracts; -namespace Speckle.Core.Logging; +namespace Speckle.Sdk; public static class ExceptionHelpers { diff --git a/src/Speckle.Core/Helpers/Constants.cs b/src/Speckle.Sdk/Helpers/Constants.cs similarity index 96% rename from src/Speckle.Core/Helpers/Constants.cs rename to src/Speckle.Sdk/Helpers/Constants.cs index 0d9c0afe..3f90ecef 100644 --- a/src/Speckle.Core/Helpers/Constants.cs +++ b/src/Speckle.Sdk/Helpers/Constants.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; using System.Text.RegularExpressions; -namespace Speckle.Core.Helpers; +namespace Speckle.Sdk.Helpers; public static class Constants { diff --git a/src/Speckle.Core/Helpers/Crypt.cs b/src/Speckle.Sdk/Helpers/Crypt.cs similarity index 98% rename from src/Speckle.Core/Helpers/Crypt.cs rename to src/Speckle.Sdk/Helpers/Crypt.cs index 83f89a2e..e86380b4 100644 --- a/src/Speckle.Core/Helpers/Crypt.cs +++ b/src/Speckle.Sdk/Helpers/Crypt.cs @@ -3,7 +3,7 @@ using System.Security.Cryptography; using System.Text; -namespace Speckle.Core.Helpers; +namespace Speckle.Sdk.Helpers; public static class Crypt { diff --git a/src/Speckle.Core/Helpers/Http.cs b/src/Speckle.Sdk/Helpers/Http.cs similarity index 98% rename from src/Speckle.Core/Helpers/Http.cs rename to src/Speckle.Sdk/Helpers/Http.cs index bc6e6f64..141b036c 100644 --- a/src/Speckle.Core/Helpers/Http.cs +++ b/src/Speckle.Sdk/Helpers/Http.cs @@ -6,12 +6,11 @@ using Polly.Contrib.WaitAndRetry; using Polly.Extensions.Http; using Polly.Retry; -using Speckle.Core.Common; -using Speckle.Core.Credentials; -using Speckle.Core.Logging; -using Speckle.Logging; +using Speckle.Sdk.Common; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Helpers; +namespace Speckle.Sdk.Helpers; public static class Http { diff --git a/src/Speckle.Core/Helpers/State.cs b/src/Speckle.Sdk/Helpers/State.cs similarity index 97% rename from src/Speckle.Core/Helpers/State.cs rename to src/Speckle.Sdk/Helpers/State.cs index 5719b1c4..657b7225 100644 --- a/src/Speckle.Core/Helpers/State.cs +++ b/src/Speckle.Sdk/Helpers/State.cs @@ -1,5 +1,5 @@ #nullable disable -namespace Speckle.Core.Helpers; +namespace Speckle.Sdk.Helpers; public class State : IDisposable where T : State, new() diff --git a/src/Speckle.Core/Kits/Attributes.cs b/src/Speckle.Sdk/Host/Attributes.cs similarity index 98% rename from src/Speckle.Core/Kits/Attributes.cs rename to src/Speckle.Sdk/Host/Attributes.cs index b46a6e1e..26273628 100644 --- a/src/Speckle.Core/Kits/Attributes.cs +++ b/src/Speckle.Sdk/Host/Attributes.cs @@ -1,5 +1,5 @@ #nullable disable -namespace Speckle.Core.Kits; +namespace Speckle.Sdk.Host; [AttributeUsage(AttributeTargets.Constructor)] public sealed class SchemaInfo : Attribute diff --git a/src/Speckle.Sdk/Host/HostAppVersion.cs b/src/Speckle.Sdk/Host/HostAppVersion.cs new file mode 100644 index 00000000..cd6c41ba --- /dev/null +++ b/src/Speckle.Sdk/Host/HostAppVersion.cs @@ -0,0 +1,21 @@ +namespace Speckle.Sdk.Host; + +public enum HostAppVersion +{ + v3, + v6, + v7, + v8, + v2019, + v2020, + v2021, + v2022, + v2023, + v2024, + v2025, + v25, + v26, + v715, + v716, + v717 +} diff --git a/src/Speckle.Sdk/Host/HostApplication.cs b/src/Speckle.Sdk/Host/HostApplication.cs new file mode 100644 index 00000000..3037f8a8 --- /dev/null +++ b/src/Speckle.Sdk/Host/HostApplication.cs @@ -0,0 +1,13 @@ +namespace Speckle.Sdk.Host; + +public readonly struct HostApplication +{ + public string Name { get; } + public string Slug { get; } + + public HostApplication(string name, string slug) + { + Name = name; + Slug = slug; + } +} diff --git a/src/Speckle.Sdk/Host/HostApplications.cs b/src/Speckle.Sdk/Host/HostApplications.cs new file mode 100644 index 00000000..fc38d763 --- /dev/null +++ b/src/Speckle.Sdk/Host/HostApplications.cs @@ -0,0 +1,220 @@ +using System.Diagnostics.Contracts; + +namespace Speckle.Sdk.Host; + +/// +/// List of Host Applications - their slugs should match our ghost tags and ci/cd slugs +/// +public static class HostApplications +{ + public static string GetVersion(HostAppVersion version) => version.ToString().TrimStart('v'); + + public static readonly HostApplication Rhino = new("Rhino", "rhino"), + Grasshopper = new("Grasshopper", "grasshopper"), + Revit = new("Revit", "revit"), + Dynamo = new("Dynamo", "dynamo"), + Unity = new("Unity", "unity"), + GSA = new("GSA", "gsa"), + Civil = new("Civil 3D", "civil3d"), + Civil3D = new("Civil 3D", "civil3d"), + AutoCAD = new("AutoCAD", "autocad"), + MicroStation = new("MicroStation", "microstation"), + OpenRoads = new("OpenRoads", "openroads"), + OpenRail = new("OpenRail", "openrail"), + OpenBuildings = new("OpenBuildings", "openbuildings"), + ETABS = new("ETABS", "etabs"), + SAP2000 = new("SAP2000", "sap2000"), + CSiBridge = new("CSiBridge", "csibridge"), + SAFE = new("SAFE", "safe"), + TeklaStructures = new("Tekla Structures", "teklastructures"), + Dxf = new("DXF Converter", "dxf"), + Excel = new("Excel", "excel"), + Unreal = new("Unreal", "unreal"), + PowerBI = new("Power BI", "powerbi"), + Blender = new("Blender", "blender"), + QGIS = new("QGIS", "qgis"), + ArcGIS = new("ArcGIS", "arcgis"), + SketchUp = new("SketchUp", "sketchup"), + Archicad = new("Archicad", "archicad"), + TopSolid = new("TopSolid", "topsolid"), + Python = new("Python", "python"), + NET = new(".NET", "net"), + Navisworks = new("Navisworks", "navisworks"), + AdvanceSteel = new("Advance Steel", "advancesteel"), + Other = new("Other", "other"); + + /// + /// Gets a HostApplication form a string. It could be the versioned name or a string coming from a process running. + /// + /// String with the name of the app + /// + [Pure] + public static HostApplication GetHostAppFromString(string? appname) + { + if (appname == null) + { + return Other; + } + + appname = appname.ToLowerInvariant().Replace(" ", ""); + if (appname.Contains("dynamo")) + { + return Dynamo; + } + + if (appname.Contains("revit")) + { + return Revit; + } + + if (appname.Contains("autocad")) + { + return AutoCAD; + } + if (appname.Contains("civil3d")) + { + return Civil3D; + } + if (appname.Contains("civil")) + { + return Civil; + } + + if (appname.Contains("rhino")) + { + return Rhino; + } + + if (appname.Contains("grasshopper")) + { + return Grasshopper; + } + + if (appname.Contains("unity")) + { + return Unity; + } + + if (appname.Contains("gsa")) + { + return GSA; + } + + if (appname.Contains("microstation")) + { + return MicroStation; + } + + if (appname.Contains("openroads")) + { + return OpenRoads; + } + + if (appname.Contains("openrail")) + { + return OpenRail; + } + + if (appname.Contains("openbuildings")) + { + return OpenBuildings; + } + + if (appname.Contains("etabs")) + { + return ETABS; + } + + if (appname.Contains("sap")) + { + return SAP2000; + } + + if (appname.Contains("csibridge")) + { + return CSiBridge; + } + + if (appname.Contains("safe")) + { + return SAFE; + } + + if (appname.Contains("teklastructures")) + { + return TeklaStructures; + } + + if (appname.Contains("dxf")) + { + return Dxf; + } + + if (appname.Contains("excel")) + { + return Excel; + } + + if (appname.Contains("unreal")) + { + return Unreal; + } + + if (appname.Contains("powerbi")) + { + return PowerBI; + } + + if (appname.Contains("blender")) + { + return Blender; + } + + if (appname.Contains("qgis")) + { + return QGIS; + } + + if (appname.Contains("arcgis")) + { + return ArcGIS; + } + + if (appname.Contains("sketchup")) + { + return SketchUp; + } + + if (appname.Contains("archicad")) + { + return Archicad; + } + + if (appname.Contains("topsolid")) + { + return TopSolid; + } + + if (appname.Contains("python")) + { + return Python; + } + + if (appname.Contains("net")) + { + return NET; + } + + if (appname.Contains("navisworks")) + { + return Navisworks; + } + + if (appname.Contains("advancesteel")) + { + return AdvanceSteel; + } + + return new HostApplication(appname, appname); + } +} diff --git a/src/Speckle.Sdk/Host/TypeLoader.cs b/src/Speckle.Sdk/Host/TypeLoader.cs new file mode 100644 index 00000000..b6e8fc4c --- /dev/null +++ b/src/Speckle.Sdk/Host/TypeLoader.cs @@ -0,0 +1,137 @@ +using System.Collections.Concurrent; +using System.Reflection; +using Speckle.Sdk.Models; + +namespace Speckle.Sdk.Host; + +public record LoadedType(string Name, Type Type, List DeprecatedNames); + +public static class TypeLoader +{ + private static bool s_initialized; + private static List s_availableTypes = new(); + + private static ConcurrentDictionary s_cachedTypes = new(); + private static ConcurrentDictionary s_fullTypeStrings = new(); + + public static IEnumerable Types => s_availableTypes; + + public static void Initialize(params Assembly[] assemblies) + { + if (!s_initialized) + { + lock (s_availableTypes) + { + if (!s_initialized) + { + Load(assemblies); + s_initialized = true; + } + } + } + } + + public static Type GetType(string fullTypeString) => + s_cachedTypes.GetOrAdd( + fullTypeString, + typeString => + { + var type = GetAtomicType(typeString); + s_cachedTypes[typeString] = type; + return type; + } + ); + + public static string GetFullTypeString(Type type) => + s_fullTypeStrings.GetOrAdd( + type, + t => + { + Stack bases = new(); + if (t == typeof(Base)) + { + return nameof(Base); + } + Type? myType = t; + + do + { + if (!myType.IsAbstract) + { + var typeString = GetTypeString(myType); + if (typeString is null) + { + throw new InvalidOperationException($"Type {t} is not registered with TypeLoader"); + } + bases.Push(typeString); + } + + myType = myType.BaseType; + } while (myType is not null && myType.Name != nameof(Base)); + return string.Join(":", bases); + } + ); + + public static string? GetTypeString(Type type) + { + var typeInfo = s_availableTypes.FirstOrDefault(tp => tp.Type == type); + if (typeInfo != null) + { + return typeInfo.Name; + } + return null; + } + + public static Type GetAtomicType(string objFullType) + { + var objectTypes = objFullType.Split(':').Reverse(); + foreach (var typeName in objectTypes) + { + var type = s_availableTypes.FirstOrDefault(tp => + tp.Name == typeName || tp.DeprecatedNames.Any(x => x == typeName) + ); + if (type != null) + { + return type.Type; + } + } + + return typeof(Base); + } + + //Don't use unless you're testing + public static void Reset() + { + s_availableTypes = new(); + s_cachedTypes = new(); + s_fullTypeStrings = new(); + s_initialized = false; + } + + private static void Load(Assembly[] assemblies) + { + foreach (var assembly in assemblies.Distinct()) + { + if (assembly.IsDynamic || assembly.ReflectionOnly) + { + continue; + } + + foreach (var type in assembly.GetTypes().Where(t => t.IsSubclassOf(typeof(Base)) && !t.IsAbstract)) + { + s_availableTypes.Add(ParseType(type)); + } + } + } + + public static LoadedType ParseType(Type type) + { + var speckleType = type.GetCustomAttribute(); + if (speckleType is null) + { + throw new InvalidOperationException($"{type.FullName} inherits from Base has no SpeckleTypeAttribute"); + } + var deprecatedSpeckleTypes = type.GetCustomAttributes(); + return new LoadedType(speckleType.Name, type, deprecatedSpeckleTypes.Select(x => x.Name).ToList()); + } +} diff --git a/src/Speckle.Core/Logging/Analytics.cs b/src/Speckle.Sdk/Logging/Analytics.cs similarity index 98% rename from src/Speckle.Core/Logging/Analytics.cs rename to src/Speckle.Sdk/Logging/Analytics.cs index 85c2f909..7e35564c 100644 --- a/src/Speckle.Core/Logging/Analytics.cs +++ b/src/Speckle.Sdk/Logging/Analytics.cs @@ -6,12 +6,11 @@ using System.Runtime.InteropServices; using System.Text; using System.Web; -using Speckle.Core.Credentials; -using Speckle.Core.Helpers; -using Speckle.Logging; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Helpers; -namespace Speckle.Core.Logging; +namespace Speckle.Sdk.Logging; /// /// Anonymous telemetry to help us understand how to make a better Speckle. diff --git a/src/Speckle.Core/Logging/CumulativeTimer.cs b/src/Speckle.Sdk/Logging/CumulativeTimer.cs similarity index 97% rename from src/Speckle.Core/Logging/CumulativeTimer.cs rename to src/Speckle.Sdk/Logging/CumulativeTimer.cs index e43e719a..6b6bc3d9 100644 --- a/src/Speckle.Core/Logging/CumulativeTimer.cs +++ b/src/Speckle.Sdk/Logging/CumulativeTimer.cs @@ -1,6 +1,6 @@ using System.Diagnostics; -namespace Speckle.Core.Logging; +namespace Speckle.Sdk.Logging; public class CumulativeTimer { diff --git a/src/Speckle.Core/Logging/LoggingHelpers.cs b/src/Speckle.Sdk/Logging/LoggingHelpers.cs similarity index 93% rename from src/Speckle.Core/Logging/LoggingHelpers.cs rename to src/Speckle.Sdk/Logging/LoggingHelpers.cs index 2d729f3f..dde7cc0c 100644 --- a/src/Speckle.Core/Logging/LoggingHelpers.cs +++ b/src/Speckle.Sdk/Logging/LoggingHelpers.cs @@ -1,6 +1,6 @@ using System.Diagnostics; -namespace Speckle.Core.Logging; +namespace Speckle.Sdk.Logging; internal static class LoggingHelpers { diff --git a/src/Speckle.Core/Models/ApplicationObject.cs b/src/Speckle.Sdk/Models/ApplicationObject.cs similarity index 99% rename from src/Speckle.Core/Models/ApplicationObject.cs rename to src/Speckle.Sdk/Models/ApplicationObject.cs index c373d82b..e8b4827c 100644 --- a/src/Speckle.Core/Models/ApplicationObject.cs +++ b/src/Speckle.Sdk/Models/ApplicationObject.cs @@ -1,7 +1,7 @@ #nullable disable using Speckle.Newtonsoft.Json; -namespace Speckle.Core.Models; +namespace Speckle.Sdk.Models; /// /// A simple wrapper to keep track of the relationship between speckle objects and their host-application siblings in cases where the diff --git a/src/Speckle.Core/Models/Attributes.cs b/src/Speckle.Sdk/Models/Attributes.cs similarity index 98% rename from src/Speckle.Core/Models/Attributes.cs rename to src/Speckle.Sdk/Models/Attributes.cs index 7090791f..a8720216 100644 --- a/src/Speckle.Core/Models/Attributes.cs +++ b/src/Speckle.Sdk/Models/Attributes.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Models; +namespace Speckle.Sdk.Models; /// /// Flags an object's property as being detachable. diff --git a/src/Speckle.Core/Models/Base.cs b/src/Speckle.Sdk/Models/Base.cs similarity index 91% rename from src/Speckle.Core/Models/Base.cs rename to src/Speckle.Sdk/Models/Base.cs index d9f99cd0..22ac076b 100644 --- a/src/Speckle.Core/Models/Base.cs +++ b/src/Speckle.Sdk/Models/Base.cs @@ -3,17 +3,15 @@ using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Text.RegularExpressions; -using Speckle.Core.Common; -using Speckle.Core.Helpers; -using Speckle.Core.Kits; -using Speckle.Core.Logging; -using Speckle.Core.Serialisation; -using Speckle.Core.Transports; -using Speckle.Logging; using Speckle.Newtonsoft.Json; using Speckle.Newtonsoft.Json.Linq; +using Speckle.Sdk.Helpers; +using Speckle.Sdk.Host; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Serialisation; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Models; +namespace Speckle.Sdk.Models; /// /// Base class for all Speckle object definitions. Provides unified hashing, type extraction and serialisation. @@ -56,30 +54,8 @@ public virtual string speckle_type { if (_type == null) { - List bases = new(); - var myType = GetType().NotNull(); - - while (myType.Name != nameof(Base)) - { - if (!myType.IsAbstract) - { - bases.Add(myType.FullName); - } - - myType = myType.BaseType; - } - - if (bases.Count == 0) - { - _type = nameof(Base); - } - else - { - bases.Reverse(); - _type = string.Join(":", bases); - } + _type = TypeLoader.GetFullTypeString(GetType()); } - return _type; } } diff --git a/src/Speckle.Core/Models/Blob.cs b/src/Speckle.Sdk/Models/Blob.cs similarity index 95% rename from src/Speckle.Core/Models/Blob.cs rename to src/Speckle.Sdk/Models/Blob.cs index c5ec7ab1..67889ad3 100644 --- a/src/Speckle.Core/Models/Blob.cs +++ b/src/Speckle.Sdk/Models/Blob.cs @@ -3,8 +3,9 @@ using System.Runtime.Serialization; using Speckle.Newtonsoft.Json; -namespace Speckle.Core.Models; +namespace Speckle.Sdk.Models; +[SpeckleType("Speckle.Core.Models.Blob")] public class Blob : Base { [JsonIgnore] diff --git a/src/Speckle.Core/Models/Collections/Collection.cs b/src/Speckle.Sdk/Models/Collections/Collection.cs similarity index 92% rename from src/Speckle.Core/Models/Collections/Collection.cs rename to src/Speckle.Sdk/Models/Collections/Collection.cs index f0cedd39..300bda8d 100644 --- a/src/Speckle.Core/Models/Collections/Collection.cs +++ b/src/Speckle.Sdk/Models/Collections/Collection.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Models.Collections; +namespace Speckle.Sdk.Models.Collections; /// /// A simple container for organising objects within a model and preserving object hierarchy. @@ -9,6 +9,8 @@ namespace Speckle.Core.Models.Collections; /// A can be for example a Layer in Rhino/AutoCad, a collection in Blender, or a Category in Revit. /// The location of each collection in the hierarchy of collections in a commit will be retrieved through commit traversal. /// +[SpeckleType("Speckle.Core.Models.Collection")] +[DeprecatedSpeckleType("Objects.Organization.Collection")] public class Collection : Base { public Collection() { } diff --git a/src/Speckle.Core/Models/Collections/Layer.cs b/src/Speckle.Sdk/Models/Collections/Layer.cs similarity index 83% rename from src/Speckle.Core/Models/Collections/Layer.cs rename to src/Speckle.Sdk/Models/Collections/Layer.cs index 027a0eca..b1207589 100644 --- a/src/Speckle.Core/Models/Collections/Layer.cs +++ b/src/Speckle.Sdk/Models/Collections/Layer.cs @@ -1,8 +1,9 @@ -namespace Speckle.Core.Models.Collections; +namespace Speckle.Sdk.Models.Collections; /// /// A specialized collection that represents a CAD-app layer. We expect this to grow in the future with possibly other shared props. /// +[SpeckleType("Speckle.Core.Models.Layer")] public class Layer : Collection { public Layer() { } diff --git a/src/Speckle.Core/Models/CommitObjectBuilder.cs b/src/Speckle.Sdk/Models/CommitObjectBuilder.cs similarity index 97% rename from src/Speckle.Core/Models/CommitObjectBuilder.cs rename to src/Speckle.Sdk/Models/CommitObjectBuilder.cs index d636f4f4..049d6678 100644 --- a/src/Speckle.Core/Models/CommitObjectBuilder.cs +++ b/src/Speckle.Sdk/Models/CommitObjectBuilder.cs @@ -1,11 +1,10 @@ using System.Collections; using System.Diagnostics.CodeAnalysis; -using Speckle.Core.Logging; -using Speckle.Core.Models.Collections; -using Speckle.Core.Models.Extensions; -using Speckle.Logging; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models.Collections; +using Speckle.Sdk.Models.Extensions; -namespace Speckle.Core.Models; +namespace Speckle.Sdk.Models; /// /// Abstract Builder class for a root commit object. diff --git a/src/Speckle.Sdk/Models/DeprecatedSpeckleTypeAttribute.cs b/src/Speckle.Sdk/Models/DeprecatedSpeckleTypeAttribute.cs new file mode 100644 index 00000000..46087c3f --- /dev/null +++ b/src/Speckle.Sdk/Models/DeprecatedSpeckleTypeAttribute.cs @@ -0,0 +1,8 @@ +#nullable disable +namespace Speckle.Sdk.Models; + +[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)] +public class DeprecatedSpeckleTypeAttribute(string speckleTypeName) : Attribute +{ + public string Name => speckleTypeName; +} diff --git a/src/Speckle.Core/Models/DynamicBase.cs b/src/Speckle.Sdk/Models/DynamicBase.cs similarity index 98% rename from src/Speckle.Core/Models/DynamicBase.cs rename to src/Speckle.Sdk/Models/DynamicBase.cs index 1245b2d8..79db2567 100644 --- a/src/Speckle.Core/Models/DynamicBase.cs +++ b/src/Speckle.Sdk/Models/DynamicBase.cs @@ -1,11 +1,10 @@ using System.Diagnostics.CodeAnalysis; using System.Dynamic; using System.Reflection; -using Speckle.Core.Kits; -using Speckle.Core.Logging; -using Speckle.Logging; +using Speckle.Sdk.Host; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Models; +namespace Speckle.Sdk.Models; /// /// Base class implementing a bunch of nice dynamic object methods, like adding and removing props dynamically. Makes c# feel like json. diff --git a/src/Speckle.Core/Models/DynamicBaseMemberType.cs b/src/Speckle.Sdk/Models/DynamicBaseMemberType.cs similarity index 75% rename from src/Speckle.Core/Models/DynamicBaseMemberType.cs rename to src/Speckle.Sdk/Models/DynamicBaseMemberType.cs index 091fc266..ba9d60b2 100644 --- a/src/Speckle.Core/Models/DynamicBaseMemberType.cs +++ b/src/Speckle.Sdk/Models/DynamicBaseMemberType.cs @@ -1,4 +1,6 @@ -namespace Speckle.Core.Models; +using Speckle.Sdk.Host; + +namespace Speckle.Sdk.Models; /// /// Represents all different types of members that can be returned by @@ -22,7 +24,7 @@ public enum DynamicBaseMemberType Obsolete = 4, /// - /// The typed members flagged with attribute. + /// The typed members flagged with attribute. /// SchemaIgnored = 8, @@ -32,12 +34,12 @@ public enum DynamicBaseMemberType SchemaComputed = 16, /// - /// All the typed members, including ones with or attributes. + /// All the typed members, including ones with or attributes. /// InstanceAll = Instance + Obsolete + SchemaIgnored, /// - /// All the members, including dynamic and instance members flagged with or attributes + /// All the members, including dynamic and instance members flagged with or attributes /// All = InstanceAll + Dynamic } diff --git a/src/Speckle.Core/Models/Extensions/BaseExtensions.cs b/src/Speckle.Sdk/Models/Extensions/BaseExtensions.cs similarity index 99% rename from src/Speckle.Core/Models/Extensions/BaseExtensions.cs rename to src/Speckle.Sdk/Models/Extensions/BaseExtensions.cs index 744e7a69..fd2ac7c6 100644 --- a/src/Speckle.Core/Models/Extensions/BaseExtensions.cs +++ b/src/Speckle.Sdk/Models/Extensions/BaseExtensions.cs @@ -1,7 +1,7 @@ using System.Collections; -using Speckle.Core.Models.Collections; +using Speckle.Sdk.Models.Collections; -namespace Speckle.Core.Models.Extensions; +namespace Speckle.Sdk.Models.Extensions; public static class BaseExtensions { diff --git a/src/Speckle.Core/Models/Extras.cs b/src/Speckle.Sdk/Models/Extras.cs similarity index 97% rename from src/Speckle.Core/Models/Extras.cs rename to src/Speckle.Sdk/Models/Extras.cs index 56cc24e6..34a9df4f 100644 --- a/src/Speckle.Core/Models/Extras.cs +++ b/src/Speckle.Sdk/Models/Extras.cs @@ -1,7 +1,7 @@ #nullable disable -using Speckle.Core.Models.Extensions; +using Speckle.Sdk.Models.Extensions; -namespace Speckle.Core.Models; +namespace Speckle.Sdk.Models; /// /// Wrapper around other, third party, classes that are not coming from a speckle kit. @@ -12,6 +12,7 @@ namespace Speckle.Core.Models; /// - Your class needs to have a void constructor. /// - Probably more. File a bug! /// +[SpeckleType("Speckle.Core.Models.Abstract")] public class Abstract : Base { private object _base; @@ -51,11 +52,13 @@ public object @base /// In short, this helps you chunk big things into smaller things. /// See the following reference. /// +[SpeckleType("Speckle.Core.Models.DataChunk")] public class DataChunk : Base { public List data { get; set; } = new(); } +[SpeckleType("Speckle.Core.Models.ObjectReference")] public class ObjectReference : Base { public new string speckle_type = "reference"; diff --git a/src/Speckle.Sdk/Models/GraphTraversal/DefaultTraversal.cs b/src/Speckle.Sdk/Models/GraphTraversal/DefaultTraversal.cs new file mode 100644 index 00000000..b5ca8b4d --- /dev/null +++ b/src/Speckle.Sdk/Models/GraphTraversal/DefaultTraversal.cs @@ -0,0 +1,110 @@ +using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.Contracts; + +namespace Speckle.Sdk.Models.GraphTraversal; + +[SuppressMessage( + "Naming", + "CA1708:Identifiers should differ by more than case", + Justification = "Class contains obsolete members that are kept for backwards compatiblity" +)] +public static class DefaultTraversal +{ + public static GraphTraversal CreateTraversalFunc() + { + var convertableRule = TraversalRule + .NewTraversalRule() + .When(b => b.GetType() != typeof(Base)) + .When(HasDisplayValue) + .ContinueTraversing(_ => ElementsPropAliases); + + return new GraphTraversal(convertableRule, s_ignoreResultsRule, DefaultRule.ShouldReturnToOutput(false)); + } + + //These functions are just meant to make the syntax of defining rules less verbose, they are likely to change frequently/be restructured + #region Helper Functions + + //WORKAROUND: ideally, traversal rules would not have Objects specific rules. + private static readonly ITraversalRule s_ignoreResultsRule = TraversalRule + .NewTraversalRule() + .When(o => o.speckle_type.Contains("Objects.Structural.Results")) + .ContinueTraversing(None); + + public static ITraversalBuilderReturn DefaultRule => + TraversalRule.NewTraversalRule().When(_ => true).ContinueTraversing(Members()); + + public static readonly IReadOnlyList ElementsPropAliases = new[] { "elements", "@elements" }; + + [Pure] + public static IEnumerable ElementsAliases(Base _) + { + return ElementsPropAliases; + } + + public static bool HasElements(Base x) + { + return ElementsPropAliases.Any(m => x[m] != null); + } + + public static readonly IReadOnlyList DefinitionPropAliases = new[] { "definition", "@definition" }; + + [Pure] + public static IEnumerable DefinitionAliases(Base _) + { + return DefinitionPropAliases; + } + + public static bool HasDefinition(Base x) + { + return DefinitionPropAliases.Any(m => x[m] != null); + } + + public static readonly IReadOnlyList DisplayValuePropAliases = new[] { "displayValue", "@displayValue" }; + + [Pure] + public static IEnumerable DisplayValueAliases(Base _) + { + return DisplayValuePropAliases; + } + + public static bool HasDisplayValue(Base x) + { + return DisplayValuePropAliases.Any(m => x[m] != null); + } + + public static readonly IReadOnlyList GeometryPropAliases = new[] { "geometry", "@geometry" }; + + [Pure] + public static IEnumerable GeometryAliases(Base _) + { + return GeometryPropAliases; + } + + public static bool HasGeometry(Base x) + { + return GeometryPropAliases.Any(m => x[m] != null); + } + + [Pure] + public static IEnumerable None(Base _) + { + return Enumerable.Empty(); + } + + internal static SelectMembers Members(DynamicBaseMemberType includeMembers = DynamicBase.DEFAULT_INCLUDE_MEMBERS) + { + return x => x.GetMembers(includeMembers).Keys; + } + + public static readonly string[] DisplayValueAndElementsPropAliases = DisplayValuePropAliases + .Concat(ElementsPropAliases) + .ToArray(); + + [Pure] + public static IEnumerable DisplayValueAndElementsAliases(Base _) + { + return DisplayValueAndElementsPropAliases; + } + + #endregion +} diff --git a/src/Speckle.Core/Models/GraphTraversal/GraphTraversal.cs b/src/Speckle.Sdk/Models/GraphTraversal/GraphTraversal.cs similarity index 98% rename from src/Speckle.Core/Models/GraphTraversal/GraphTraversal.cs rename to src/Speckle.Sdk/Models/GraphTraversal/GraphTraversal.cs index 1fb52980..16962b31 100644 --- a/src/Speckle.Core/Models/GraphTraversal/GraphTraversal.cs +++ b/src/Speckle.Sdk/Models/GraphTraversal/GraphTraversal.cs @@ -1,6 +1,6 @@ using System.Collections; -namespace Speckle.Core.Models.GraphTraversal; +namespace Speckle.Sdk.Models.GraphTraversal; public class GraphTraversal : GraphTraversal { diff --git a/src/Speckle.Core/Models/GraphTraversal/ITraversalRule.cs b/src/Speckle.Sdk/Models/GraphTraversal/ITraversalRule.cs similarity index 97% rename from src/Speckle.Core/Models/GraphTraversal/ITraversalRule.cs rename to src/Speckle.Sdk/Models/GraphTraversal/ITraversalRule.cs index 5951c265..f02626cd 100644 --- a/src/Speckle.Core/Models/GraphTraversal/ITraversalRule.cs +++ b/src/Speckle.Sdk/Models/GraphTraversal/ITraversalRule.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Models.GraphTraversal; +namespace Speckle.Sdk.Models.GraphTraversal; /// /// Interface for a definition of conditional traversal of objects. diff --git a/src/Speckle.Core/Models/GraphTraversal/RuleBuilder.cs b/src/Speckle.Sdk/Models/GraphTraversal/RuleBuilder.cs similarity index 97% rename from src/Speckle.Core/Models/GraphTraversal/RuleBuilder.cs rename to src/Speckle.Sdk/Models/GraphTraversal/RuleBuilder.cs index ce37bc34..e5f175b5 100644 --- a/src/Speckle.Core/Models/GraphTraversal/RuleBuilder.cs +++ b/src/Speckle.Sdk/Models/GraphTraversal/RuleBuilder.cs @@ -1,6 +1,6 @@ -using Speckle.Core.Common; +using Speckle.Sdk.Common; -namespace Speckle.Core.Models.GraphTraversal; +namespace Speckle.Sdk.Models.GraphTraversal; /// /// A traversal rule defines the conditional traversal behaviour when traversing a given objects. diff --git a/src/Speckle.Core/Models/GraphTraversal/TraversalContextExtensions.cs b/src/Speckle.Sdk/Models/GraphTraversal/TraversalContextExtensions.cs similarity index 97% rename from src/Speckle.Core/Models/GraphTraversal/TraversalContextExtensions.cs rename to src/Speckle.Sdk/Models/GraphTraversal/TraversalContextExtensions.cs index 552b3e1b..28ff630f 100644 --- a/src/Speckle.Core/Models/GraphTraversal/TraversalContextExtensions.cs +++ b/src/Speckle.Sdk/Models/GraphTraversal/TraversalContextExtensions.cs @@ -1,6 +1,6 @@ using System.Diagnostics.Contracts; -namespace Speckle.Core.Models.GraphTraversal; +namespace Speckle.Sdk.Models.GraphTraversal; public static class TraversalContextExtensions { diff --git a/src/Speckle.Core/Models/GraphTraversal/TraversalContexts.cs b/src/Speckle.Sdk/Models/GraphTraversal/TraversalContexts.cs similarity index 97% rename from src/Speckle.Core/Models/GraphTraversal/TraversalContexts.cs rename to src/Speckle.Sdk/Models/GraphTraversal/TraversalContexts.cs index ddc9627b..91c95fc2 100644 --- a/src/Speckle.Core/Models/GraphTraversal/TraversalContexts.cs +++ b/src/Speckle.Sdk/Models/GraphTraversal/TraversalContexts.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace Speckle.Core.Models.GraphTraversal; +namespace Speckle.Sdk.Models.GraphTraversal; [SuppressMessage( "Naming", diff --git a/src/Speckle.Core/Models/Instances/IInstanceComponent.cs b/src/Speckle.Sdk/Models/Instances/IInstanceComponent.cs similarity index 93% rename from src/Speckle.Core/Models/Instances/IInstanceComponent.cs rename to src/Speckle.Sdk/Models/Instances/IInstanceComponent.cs index 0fe5d086..62768265 100644 --- a/src/Speckle.Core/Models/Instances/IInstanceComponent.cs +++ b/src/Speckle.Sdk/Models/Instances/IInstanceComponent.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Models.Instances; +namespace Speckle.Sdk.Models.Instances; /// /// Abstracts over and for sorting and grouping in receive operations. diff --git a/src/Speckle.Core/Models/Instances/InstanceDefinitionProxy.cs b/src/Speckle.Sdk/Models/Instances/InstanceDefinitionProxy.cs similarity index 82% rename from src/Speckle.Core/Models/Instances/InstanceDefinitionProxy.cs rename to src/Speckle.Sdk/Models/Instances/InstanceDefinitionProxy.cs index a8d4c8ea..616c99e9 100644 --- a/src/Speckle.Core/Models/Instances/InstanceDefinitionProxy.cs +++ b/src/Speckle.Sdk/Models/Instances/InstanceDefinitionProxy.cs @@ -1,10 +1,11 @@ -using Speckle.Core.Models.Proxies; +using Speckle.Sdk.Models.Proxies; -namespace Speckle.Core.Models.Instances; +namespace Speckle.Sdk.Models.Instances; /// /// A proxy class for an instance definition. /// +[SpeckleType("Speckle.Core.Models.Instances.InstanceDefinitionProxy")] public class InstanceDefinitionProxy : Base, IInstanceComponent, IProxyCollection { /// diff --git a/src/Speckle.Core/Models/Instances/InstanceProxy.cs b/src/Speckle.Sdk/Models/Instances/InstanceProxy.cs similarity index 78% rename from src/Speckle.Core/Models/Instances/InstanceProxy.cs rename to src/Speckle.Sdk/Models/Instances/InstanceProxy.cs index ee217d5a..e45628b4 100644 --- a/src/Speckle.Core/Models/Instances/InstanceProxy.cs +++ b/src/Speckle.Sdk/Models/Instances/InstanceProxy.cs @@ -1,10 +1,12 @@ using Speckle.DoubleNumerics; +using Speckle.Sdk.Common; -namespace Speckle.Core.Models.Instances; +namespace Speckle.Sdk.Models.Instances; /// /// A proxy class for an instance (e.g, a rhino block, or an autocad block reference). /// +[SpeckleType("Speckle.Core.Models.Instances.InstanceProxy")] public class InstanceProxy : Base, IInstanceComponent { /// @@ -20,7 +22,7 @@ public class InstanceProxy : Base, IInstanceComponent /// /// The units of the host application file. /// - public string units { get; set; } = Kits.Units.Meters; + public string units { get; set; } = Units.Meters; public int maxDepth { get; set; } } diff --git a/src/Speckle.Core/Models/InvalidPropNameException.cs b/src/Speckle.Sdk/Models/InvalidPropNameException.cs similarity index 88% rename from src/Speckle.Core/Models/InvalidPropNameException.cs rename to src/Speckle.Sdk/Models/InvalidPropNameException.cs index 2c3d3cee..486dbab0 100644 --- a/src/Speckle.Core/Models/InvalidPropNameException.cs +++ b/src/Speckle.Sdk/Models/InvalidPropNameException.cs @@ -1,6 +1,6 @@ -using Speckle.Core.Logging; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Models; +namespace Speckle.Sdk.Models; public class InvalidPropNameException : SpeckleException { diff --git a/src/Speckle.Core/Models/NestingInstructions.cs b/src/Speckle.Sdk/Models/NestingInstructions.cs similarity index 94% rename from src/Speckle.Core/Models/NestingInstructions.cs rename to src/Speckle.Sdk/Models/NestingInstructions.cs index 0c8d38c4..18c39e48 100644 --- a/src/Speckle.Core/Models/NestingInstructions.cs +++ b/src/Speckle.Sdk/Models/NestingInstructions.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Models; +namespace Speckle.Sdk.Models; /// /// Container for a reference to a parent's applicationId and an Action to diff --git a/src/Speckle.Core/Models/Proxies/ColorProxy.cs b/src/Speckle.Sdk/Models/Proxies/ColorProxy.cs similarity index 86% rename from src/Speckle.Core/Models/Proxies/ColorProxy.cs rename to src/Speckle.Sdk/Models/Proxies/ColorProxy.cs index f647d041..d6b691b1 100644 --- a/src/Speckle.Core/Models/Proxies/ColorProxy.cs +++ b/src/Speckle.Sdk/Models/Proxies/ColorProxy.cs @@ -1,11 +1,9 @@ -using System.Drawing; -using Speckle.Core.Models.Proxies; - -namespace Speckle.Core.Models.Proxies; +namespace Speckle.Sdk.Models.Proxies; /// /// Represents a color that is found on objects and collections in a root collection /// +[SpeckleType("Speckle.Core.Models.Proxies.ColorProxy")] public class ColorProxy : Base, IProxyCollection { public ColorProxy() { } diff --git a/src/Speckle.Core/Models/Proxies/GroupProxy.cs b/src/Speckle.Sdk/Models/Proxies/GroupProxy.cs similarity index 75% rename from src/Speckle.Core/Models/Proxies/GroupProxy.cs rename to src/Speckle.Sdk/Models/Proxies/GroupProxy.cs index 03139fb0..939e58e1 100644 --- a/src/Speckle.Core/Models/Proxies/GroupProxy.cs +++ b/src/Speckle.Sdk/Models/Proxies/GroupProxy.cs @@ -1,9 +1,11 @@ -namespace Speckle.Core.Models.Proxies; +namespace Speckle.Sdk.Models.Proxies; /// /// Grouped objects with a meaningful way for host application so use this proxy if you want to group object references for any purpose. /// i.e. in rhino -> creating group make objects selectable/moveable/editable together. /// +[SpeckleType("Speckle.Core.Models.Proxies.GroupProxy")] +[DeprecatedSpeckleType("Speckle.Core.Models.Instances.GroupProxy")] public class GroupProxy : Base, IProxyCollection { public List objects { get; set; } diff --git a/src/Speckle.Core/Models/Proxies/IProxyCollection.cs b/src/Speckle.Sdk/Models/Proxies/IProxyCollection.cs similarity index 91% rename from src/Speckle.Core/Models/Proxies/IProxyCollection.cs rename to src/Speckle.Sdk/Models/Proxies/IProxyCollection.cs index 8f40fb5a..702fa7a4 100644 --- a/src/Speckle.Core/Models/Proxies/IProxyCollection.cs +++ b/src/Speckle.Sdk/Models/Proxies/IProxyCollection.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Models.Proxies; +namespace Speckle.Sdk.Models.Proxies; /// /// Collection to proxy objects that lies in definitions, groups or whatever logic in the host app. diff --git a/src/Speckle.Sdk/Models/SpeckleTypeAttribute.cs b/src/Speckle.Sdk/Models/SpeckleTypeAttribute.cs new file mode 100644 index 00000000..7f1de575 --- /dev/null +++ b/src/Speckle.Sdk/Models/SpeckleTypeAttribute.cs @@ -0,0 +1,8 @@ +#nullable disable +namespace Speckle.Sdk.Models; + +[AttributeUsage(AttributeTargets.Class)] +public class SpeckleTypeAttribute(string speckleTypeName) : Attribute +{ + public string Name => speckleTypeName; +} diff --git a/src/Speckle.Core/Models/Utilities.cs b/src/Speckle.Sdk/Models/Utilities.cs similarity index 97% rename from src/Speckle.Core/Models/Utilities.cs rename to src/Speckle.Sdk/Models/Utilities.cs index 46e4d83f..1657f8db 100644 --- a/src/Speckle.Core/Models/Utilities.cs +++ b/src/Speckle.Sdk/Models/Utilities.cs @@ -3,12 +3,11 @@ using System.Diagnostics.Contracts; using System.Reflection; using System.Security.Cryptography; -using Speckle.Core.Common; -using Speckle.Core.Helpers; -using Speckle.Core.Logging; -using Speckle.Logging; +using Speckle.Sdk.Common; +using Speckle.Sdk.Helpers; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Models; +namespace Speckle.Sdk.Models; public static class Utilities { diff --git a/src/Speckle.Core/Serialisation/BaseObjectDeserializerV2.cs b/src/Speckle.Sdk/Serialisation/BaseObjectDeserializerV2.cs similarity index 97% rename from src/Speckle.Core/Serialisation/BaseObjectDeserializerV2.cs rename to src/Speckle.Sdk/Serialisation/BaseObjectDeserializerV2.cs index 9f747dd6..80a09a8c 100644 --- a/src/Speckle.Core/Serialisation/BaseObjectDeserializerV2.cs +++ b/src/Speckle.Sdk/Serialisation/BaseObjectDeserializerV2.cs @@ -1,15 +1,15 @@ using System.Diagnostics; using System.Reflection; -using Speckle.Core.Common; -using Speckle.Core.Logging; -using Speckle.Core.Models; -using Speckle.Core.Serialisation.SerializationUtilities; -using Speckle.Core.Transports; -using Speckle.Logging; using Speckle.Newtonsoft.Json; using Speckle.Newtonsoft.Json.Linq; +using Speckle.Sdk.Common; +using Speckle.Sdk.Host; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; +using Speckle.Sdk.Serialisation.SerializationUtilities; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Serialisation; +namespace Speckle.Sdk.Serialisation; public sealed class BaseObjectDeserializerV2 { @@ -338,7 +338,7 @@ public Base Deserialize(string rootObjectJson) private Base Dict2Base(Dictionary dictObj) { string typeName = (string)dictObj[TYPE_DISCRIMINATOR].NotNull(); - Type type = BaseObjectSerializationUtilities.GetType(typeName); + Type type = TypeLoader.GetType(typeName); Base baseObj = (Base)Activator.CreateInstance(type); dictObj.Remove(TYPE_DISCRIMINATOR); diff --git a/src/Speckle.Core/Serialisation/BaseObjectSerializerV2.cs b/src/Speckle.Sdk/Serialisation/BaseObjectSerializerV2.cs similarity index 98% rename from src/Speckle.Core/Serialisation/BaseObjectSerializerV2.cs rename to src/Speckle.Sdk/Serialisation/BaseObjectSerializerV2.cs index 284534ca..eb098d85 100644 --- a/src/Speckle.Core/Serialisation/BaseObjectSerializerV2.cs +++ b/src/Speckle.Sdk/Serialisation/BaseObjectSerializerV2.cs @@ -3,17 +3,16 @@ using System.Drawing; using System.Globalization; using System.Reflection; -using Speckle.Core.Common; -using Speckle.Core.Logging; -using Speckle.Core.Models; -using Speckle.Core.Transports; using Speckle.DoubleNumerics; -using Speckle.Logging; using Speckle.Newtonsoft.Json; -using Constants = Speckle.Core.Helpers.Constants; -using Utilities = Speckle.Core.Models.Utilities; - -namespace Speckle.Core.Serialisation; +using Speckle.Sdk.Common; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; +using Speckle.Sdk.Transports; +using Constants = Speckle.Sdk.Helpers.Constants; +using Utilities = Speckle.Sdk.Models.Utilities; + +namespace Speckle.Sdk.Serialisation; public class BaseObjectSerializerV2 { diff --git a/src/Speckle.Sdk/Serialisation/SerializationUtilities/BaseObjectSerializationUtilities.cs b/src/Speckle.Sdk/Serialisation/SerializationUtilities/BaseObjectSerializationUtilities.cs new file mode 100644 index 00000000..c64bd149 --- /dev/null +++ b/src/Speckle.Sdk/Serialisation/SerializationUtilities/BaseObjectSerializationUtilities.cs @@ -0,0 +1,80 @@ +using System.Reflection; +using System.Runtime.Serialization; +using Speckle.Sdk.Host; + +namespace Speckle.Sdk.Serialisation.SerializationUtilities; + +internal static class BaseObjectSerializationUtilities +{ + #region Getting Types + private static Dictionary> s_typeProperties = new(); + private static Dictionary> s_onDeserializedCallbacks = new(); + + internal static Dictionary GetTypeProperties(string objFullType) + { + lock (s_typeProperties) + { + if (s_typeProperties.TryGetValue(objFullType, out Dictionary? value)) + { + return value; + } + + Dictionary ret = new(); + Type type = TypeLoader.GetType(objFullType); + PropertyInfo[] properties = type.GetProperties(); + foreach (PropertyInfo prop in properties) + { + ret[prop.Name.ToLower()] = prop; + } + + value = ret; + s_typeProperties[objFullType] = value; + return value; + } + } + + internal static List GetOnDeserializedCallbacks(string objFullType) + { + // return new List(); + lock (s_onDeserializedCallbacks) + { + // System.Runtime.Serialization.Ca + if (s_onDeserializedCallbacks.TryGetValue(objFullType, out List? value)) + { + return value; + } + + List ret = new(); + Type type = TypeLoader.GetType(objFullType); + MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); + foreach (MethodInfo method in methods) + { + List onDeserializedAttributes = method + .GetCustomAttributes(true) + .ToList(); + if (onDeserializedAttributes.Count > 0) + { + ret.Add(method); + } + } + + value = ret; + s_onDeserializedCallbacks[objFullType] = value; + return value; + } + } + + /// + /// Flushes kit's (discriminator, type) cache. Useful if you're dynamically loading more kits at runtime, that provide better coverage of what you're deserialising, and it's now somehow poisoned because the higher level types were not originally available. + /// + public static void FlushCachedTypes() + { + lock (s_typeProperties) + { + s_typeProperties = new(); + s_onDeserializedCallbacks = new(); + } + } + + #endregion +} diff --git a/src/Speckle.Core/Serialisation/SerializationUtilities/CallsiteCache.cs b/src/Speckle.Sdk/Serialisation/SerializationUtilities/CallsiteCache.cs similarity index 95% rename from src/Speckle.Core/Serialisation/SerializationUtilities/CallsiteCache.cs rename to src/Speckle.Sdk/Serialisation/SerializationUtilities/CallsiteCache.cs index f8abf7a7..37023478 100644 --- a/src/Speckle.Core/Serialisation/SerializationUtilities/CallsiteCache.cs +++ b/src/Speckle.Sdk/Serialisation/SerializationUtilities/CallsiteCache.cs @@ -1,7 +1,7 @@ using System.Runtime.CompilerServices; using Microsoft.CSharp.RuntimeBinder; -namespace Speckle.Core.Serialisation.SerializationUtilities; +namespace Speckle.Sdk.Serialisation.SerializationUtilities; internal static class CallSiteCache { diff --git a/src/Speckle.Core/Serialisation/SerializationUtilities/DeserializationWorkerThreads.cs b/src/Speckle.Sdk/Serialisation/SerializationUtilities/DeserializationWorkerThreads.cs similarity index 96% rename from src/Speckle.Core/Serialisation/SerializationUtilities/DeserializationWorkerThreads.cs rename to src/Speckle.Sdk/Serialisation/SerializationUtilities/DeserializationWorkerThreads.cs index 917687ed..6e995412 100644 --- a/src/Speckle.Core/Serialisation/SerializationUtilities/DeserializationWorkerThreads.cs +++ b/src/Speckle.Sdk/Serialisation/SerializationUtilities/DeserializationWorkerThreads.cs @@ -1,6 +1,6 @@ -using Speckle.Core.Logging; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Serialisation.SerializationUtilities; +namespace Speckle.Sdk.Serialisation.SerializationUtilities; internal enum WorkerThreadTaskType { diff --git a/src/Speckle.Core/Serialisation/SerializationUtilities/OperationTask.cs b/src/Speckle.Sdk/Serialisation/SerializationUtilities/OperationTask.cs similarity index 96% rename from src/Speckle.Core/Serialisation/SerializationUtilities/OperationTask.cs rename to src/Speckle.Sdk/Serialisation/SerializationUtilities/OperationTask.cs index 25eb85d9..9cc373e7 100644 --- a/src/Speckle.Core/Serialisation/SerializationUtilities/OperationTask.cs +++ b/src/Speckle.Sdk/Serialisation/SerializationUtilities/OperationTask.cs @@ -1,6 +1,6 @@ using System.Collections.Concurrent; -namespace Speckle.Core.Serialisation.SerializationUtilities; +namespace Speckle.Sdk.Serialisation.SerializationUtilities; internal readonly struct OperationTask where T : struct diff --git a/src/Speckle.Core/Serialisation/SerializationUtilities/ValueConverter.cs b/src/Speckle.Sdk/Serialisation/SerializationUtilities/ValueConverter.cs similarity index 98% rename from src/Speckle.Core/Serialisation/SerializationUtilities/ValueConverter.cs rename to src/Speckle.Sdk/Serialisation/SerializationUtilities/ValueConverter.cs index 569405a2..87cb9d8e 100644 --- a/src/Speckle.Core/Serialisation/SerializationUtilities/ValueConverter.cs +++ b/src/Speckle.Sdk/Serialisation/SerializationUtilities/ValueConverter.cs @@ -3,9 +3,9 @@ using System.Drawing; using System.Globalization; using Speckle.DoubleNumerics; -using Speckle.Logging; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Serialisation.SerializationUtilities; +namespace Speckle.Sdk.Serialisation.SerializationUtilities; internal static class ValueConverter { diff --git a/src/Speckle.Core/Serialisation/SpeckleSerializerException.cs b/src/Speckle.Sdk/Serialisation/SpeckleSerializerException.cs similarity index 89% rename from src/Speckle.Core/Serialisation/SpeckleSerializerException.cs rename to src/Speckle.Sdk/Serialisation/SpeckleSerializerException.cs index f84e0f81..b6fec905 100644 --- a/src/Speckle.Core/Serialisation/SpeckleSerializerException.cs +++ b/src/Speckle.Sdk/Serialisation/SpeckleSerializerException.cs @@ -1,6 +1,6 @@ -using Speckle.Core.Logging; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Serialisation; +namespace Speckle.Sdk.Serialisation; public class SpeckleSerializeException : SpeckleException { diff --git a/src/Speckle.Core/Logging/Setup.cs b/src/Speckle.Sdk/Setup.cs similarity index 95% rename from src/Speckle.Core/Logging/Setup.cs rename to src/Speckle.Sdk/Setup.cs index 3d803137..e9bb680f 100644 --- a/src/Speckle.Core/Logging/Setup.cs +++ b/src/Speckle.Sdk/Setup.cs @@ -1,11 +1,11 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using Speckle.Core.Credentials; -using Speckle.Core.Helpers; -using Speckle.Core.Kits; -using Speckle.Logging; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Helpers; +using Speckle.Sdk.Host; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Logging; +namespace Speckle.Sdk; /// /// Anonymous telemetry to help us understand how to make a better Speckle. diff --git a/src/Speckle.Core/Speckle.Core.csproj b/src/Speckle.Sdk/Speckle.Sdk.csproj similarity index 64% rename from src/Speckle.Core/Speckle.Core.csproj rename to src/Speckle.Sdk/Speckle.Sdk.csproj index 1e6e1e30..843068af 100644 --- a/src/Speckle.Core/Speckle.Core.csproj +++ b/src/Speckle.Sdk/Speckle.Sdk.csproj @@ -2,12 +2,11 @@ netstandard2.0 - Speckle.Core - Speckle.Core - Speckle.Core - Speckle.Core - Core is the .NET SDK for Speckle - $(PackageTags) core + Speckle.Sdk + Speckle.Sdk + Speckle.Sdk + The .NET SDK for Speckle + $(PackageTags) core sdk true System.Runtime.CompilerServices.RequiresLocationAttribute Debug;Release;Local @@ -15,9 +14,9 @@ - - - + + + @@ -33,7 +32,7 @@ - + diff --git a/src/Speckle.Core/Logging/SpeckleConfiguration.cs b/src/Speckle.Sdk/SpeckleConfiguration.cs similarity index 66% rename from src/Speckle.Core/Logging/SpeckleConfiguration.cs rename to src/Speckle.Sdk/SpeckleConfiguration.cs index 11631c04..2b711a05 100644 --- a/src/Speckle.Core/Logging/SpeckleConfiguration.cs +++ b/src/Speckle.Sdk/SpeckleConfiguration.cs @@ -1,7 +1,7 @@ -using Speckle.Core.Kits; -using Speckle.Logging; +using Speckle.Sdk.Host; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Logging; +namespace Speckle.Sdk; public record SpeckleConfiguration( HostApplication Application, diff --git a/src/Speckle.Core/Logging/SpeckleException.cs b/src/Speckle.Sdk/SpeckleException.cs similarity index 88% rename from src/Speckle.Core/Logging/SpeckleException.cs rename to src/Speckle.Sdk/SpeckleException.cs index c2f2a154..77a61eb9 100644 --- a/src/Speckle.Core/Logging/SpeckleException.cs +++ b/src/Speckle.Sdk/SpeckleException.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Logging; +namespace Speckle.Sdk; public class SpeckleException : Exception { diff --git a/src/Speckle.Core/Logging/SpeckleNonUserFacingException.cs b/src/Speckle.Sdk/SpeckleNonUserFacingException.cs similarity index 92% rename from src/Speckle.Core/Logging/SpeckleNonUserFacingException.cs rename to src/Speckle.Sdk/SpeckleNonUserFacingException.cs index 4b19d41f..c17f3abd 100644 --- a/src/Speckle.Core/Logging/SpeckleNonUserFacingException.cs +++ b/src/Speckle.Sdk/SpeckleNonUserFacingException.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Logging; +namespace Speckle.Sdk; /// /// These are exceptions who's message is not user friendly diff --git a/src/Speckle.Transports.Disk/DiskTransport.cs b/src/Speckle.Sdk/Transports/DiskTransport.cs similarity index 95% rename from src/Speckle.Transports.Disk/DiskTransport.cs rename to src/Speckle.Sdk/Transports/DiskTransport.cs index a780eef9..ec00cfe4 100644 --- a/src/Speckle.Transports.Disk/DiskTransport.cs +++ b/src/Speckle.Sdk/Transports/DiskTransport.cs @@ -1,13 +1,8 @@ -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.IO; using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Speckle.Core.Helpers; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Transports; +namespace Speckle.Sdk.Transports; /// /// Writes speckle objects to disk. diff --git a/src/Speckle.Core/Transports/Exceptions.cs b/src/Speckle.Sdk/Transports/Exceptions.cs similarity index 88% rename from src/Speckle.Core/Transports/Exceptions.cs rename to src/Speckle.Sdk/Transports/Exceptions.cs index 35a4a95f..2a9d6183 100644 --- a/src/Speckle.Core/Transports/Exceptions.cs +++ b/src/Speckle.Sdk/Transports/Exceptions.cs @@ -1,6 +1,6 @@ -using Speckle.Core.Logging; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Transports; +namespace Speckle.Sdk.Transports; public class TransportException : SpeckleException { diff --git a/src/Speckle.Core/Transports/IServerTransport.cs b/src/Speckle.Sdk/Transports/IServerTransport.cs similarity index 87% rename from src/Speckle.Core/Transports/IServerTransport.cs rename to src/Speckle.Sdk/Transports/IServerTransport.cs index 0c9fcd51..92b91398 100644 --- a/src/Speckle.Core/Transports/IServerTransport.cs +++ b/src/Speckle.Sdk/Transports/IServerTransport.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Transports; +namespace Speckle.Sdk.Transports; public interface IServerTransport : IDisposable, ITransport, IBlobCapableTransport, ICloneable { diff --git a/src/Speckle.Core/Transports/ITransport.cs b/src/Speckle.Sdk/Transports/ITransport.cs similarity index 98% rename from src/Speckle.Core/Transports/ITransport.cs rename to src/Speckle.Sdk/Transports/ITransport.cs index 79b021fe..2e024fa8 100644 --- a/src/Speckle.Core/Transports/ITransport.cs +++ b/src/Speckle.Sdk/Transports/ITransport.cs @@ -1,6 +1,6 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Speckle.Core.Transports; +namespace Speckle.Sdk.Transports; /// /// Interface defining the contract for transport implementations. diff --git a/src/Speckle.Core/Transports/Memory.cs b/src/Speckle.Sdk/Transports/Memory.cs similarity index 98% rename from src/Speckle.Core/Transports/Memory.cs rename to src/Speckle.Sdk/Transports/Memory.cs index 327a68c5..81fe8bd9 100644 --- a/src/Speckle.Core/Transports/Memory.cs +++ b/src/Speckle.Sdk/Transports/Memory.cs @@ -1,8 +1,8 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using Speckle.Logging; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Transports; +namespace Speckle.Sdk.Transports; /// /// An in memory storage of speckle objects. diff --git a/src/Speckle.Core/Transports/SQLite.cs b/src/Speckle.Sdk/Transports/SQLite.cs similarity index 99% rename from src/Speckle.Core/Transports/SQLite.cs rename to src/Speckle.Sdk/Transports/SQLite.cs index fcc2ae25..97beb43b 100644 --- a/src/Speckle.Core/Transports/SQLite.cs +++ b/src/Speckle.Sdk/Transports/SQLite.cs @@ -4,12 +4,11 @@ using System.Text; using System.Timers; using Microsoft.Data.Sqlite; -using Speckle.Core.Helpers; -using Speckle.Core.Logging; -using Speckle.Core.Models; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; using Timer = System.Timers.Timer; -namespace Speckle.Core.Transports; +namespace Speckle.Sdk.Transports; public sealed class SQLiteTransport : IDisposable, ICloneable, ITransport, IBlobCapableTransport { diff --git a/src/Speckle.Core/Transports/ServerTransportFactory.cs b/src/Speckle.Sdk/Transports/ServerTransportFactory.cs similarity index 86% rename from src/Speckle.Core/Transports/ServerTransportFactory.cs rename to src/Speckle.Sdk/Transports/ServerTransportFactory.cs index afa5ee50..d67da531 100644 --- a/src/Speckle.Core/Transports/ServerTransportFactory.cs +++ b/src/Speckle.Sdk/Transports/ServerTransportFactory.cs @@ -1,8 +1,8 @@ using System.Diagnostics.CodeAnalysis; -using Speckle.Core.Credentials; using Speckle.InterfaceGenerator; +using Speckle.Sdk.Credentials; -namespace Speckle.Core.Transports; +namespace Speckle.Sdk.Transports; [GenerateAutoInterface] [ExcludeFromCodeCoverage] //factories don't need coverage diff --git a/src/Speckle.Core/Transports/ServerUtils/GzipContent.cs b/src/Speckle.Sdk/Transports/ServerUtils/GzipContent.cs similarity index 97% rename from src/Speckle.Core/Transports/ServerUtils/GzipContent.cs rename to src/Speckle.Sdk/Transports/ServerUtils/GzipContent.cs index 76416424..af1f7004 100644 --- a/src/Speckle.Core/Transports/ServerUtils/GzipContent.cs +++ b/src/Speckle.Sdk/Transports/ServerUtils/GzipContent.cs @@ -1,7 +1,7 @@ using System.IO.Compression; using System.Net; -namespace Speckle.Core.Transports.ServerUtils; +namespace Speckle.Sdk.Transports.ServerUtils; /// /// https://cymbeline.ch/2014/03/16/gzip-encoding-an-http-post-request-body/ diff --git a/src/Speckle.Core/Transports/ServerUtils/IServerApi.cs b/src/Speckle.Sdk/Transports/ServerUtils/IServerApi.cs similarity index 94% rename from src/Speckle.Core/Transports/ServerUtils/IServerApi.cs rename to src/Speckle.Sdk/Transports/ServerUtils/IServerApi.cs index 75603c41..c6afe823 100644 --- a/src/Speckle.Core/Transports/ServerUtils/IServerApi.cs +++ b/src/Speckle.Sdk/Transports/ServerUtils/IServerApi.cs @@ -1,4 +1,4 @@ -namespace Speckle.Core.Transports.ServerUtils; +namespace Speckle.Sdk.Transports.ServerUtils; public delegate void CbObjectDownloaded(string id, string json); public delegate void CbBlobdDownloaded(); diff --git a/src/Speckle.Core/Transports/ServerUtils/ParallelServerAPI.cs b/src/Speckle.Sdk/Transports/ServerUtils/ParallelServerAPI.cs similarity index 98% rename from src/Speckle.Core/Transports/ServerUtils/ParallelServerAPI.cs rename to src/Speckle.Sdk/Transports/ServerUtils/ParallelServerAPI.cs index fe13f3c5..12de5a1a 100644 --- a/src/Speckle.Core/Transports/ServerUtils/ParallelServerAPI.cs +++ b/src/Speckle.Sdk/Transports/ServerUtils/ParallelServerAPI.cs @@ -1,10 +1,10 @@ using System.Collections.Concurrent; using System.Diagnostics; -using Speckle.Core.Common; -using Speckle.Core.Logging; -using Speckle.Core.Serialisation.SerializationUtilities; +using Speckle.Sdk.Common; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Serialisation.SerializationUtilities; -namespace Speckle.Core.Transports.ServerUtils; +namespace Speckle.Sdk.Transports.ServerUtils; internal enum ServerApiOperation { diff --git a/src/Speckle.Core/Transports/ServerUtils/ServerAPI.cs b/src/Speckle.Sdk/Transports/ServerUtils/ServerAPI.cs similarity index 99% rename from src/Speckle.Core/Transports/ServerUtils/ServerAPI.cs rename to src/Speckle.Sdk/Transports/ServerUtils/ServerAPI.cs index 450ef264..b8e9b12c 100644 --- a/src/Speckle.Core/Transports/ServerUtils/ServerAPI.cs +++ b/src/Speckle.Sdk/Transports/ServerUtils/ServerAPI.cs @@ -1,13 +1,13 @@ using System.Net; using System.Net.Http.Headers; using System.Text; -using Speckle.Core.Helpers; -using Speckle.Core.Logging; -using Speckle.Core.Models; using Speckle.Newtonsoft.Json; using Speckle.Newtonsoft.Json.Linq; +using Speckle.Sdk.Helpers; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; -namespace Speckle.Core.Transports.ServerUtils; +namespace Speckle.Sdk.Transports.ServerUtils; public sealed class ServerApi : IDisposable, IServerApi { diff --git a/src/Speckle.Core/Transports/ServerV2.cs b/src/Speckle.Sdk/Transports/ServerV2.cs similarity index 98% rename from src/Speckle.Core/Transports/ServerV2.cs rename to src/Speckle.Sdk/Transports/ServerV2.cs index cc3b83aa..1f04e1ce 100644 --- a/src/Speckle.Core/Transports/ServerV2.cs +++ b/src/Speckle.Sdk/Transports/ServerV2.cs @@ -1,13 +1,11 @@ using System.Diagnostics; -using Speckle.Core.Credentials; -using Speckle.Core.Helpers; -using Speckle.Core.Logging; -using Speckle.Core.Models; -using Speckle.Core.Transports.ServerUtils; -using Speckle.Logging; using Speckle.Newtonsoft.Json.Linq; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; +using Speckle.Sdk.Transports.ServerUtils; -namespace Speckle.Core.Transports; +namespace Speckle.Sdk.Transports; public sealed class ServerTransport : IServerTransport { diff --git a/src/Speckle.Core/Transports/TransportHelpers.cs b/src/Speckle.Sdk/Transports/TransportHelpers.cs similarity index 97% rename from src/Speckle.Core/Transports/TransportHelpers.cs rename to src/Speckle.Sdk/Transports/TransportHelpers.cs index a3621370..e4f5746e 100644 --- a/src/Speckle.Core/Transports/TransportHelpers.cs +++ b/src/Speckle.Sdk/Transports/TransportHelpers.cs @@ -1,8 +1,8 @@ using System.Diagnostics.CodeAnalysis; -using Speckle.Core.Serialisation; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Serialisation; -namespace Speckle.Core.Transports; +namespace Speckle.Sdk.Transports; public static class TransportHelpers { diff --git a/src/Speckle.Core/Transports/Utilities.cs b/src/Speckle.Sdk/Transports/Utilities.cs similarity index 86% rename from src/Speckle.Core/Transports/Utilities.cs rename to src/Speckle.Sdk/Transports/Utilities.cs index 42c953a8..3fe06faf 100644 --- a/src/Speckle.Core/Transports/Utilities.cs +++ b/src/Speckle.Sdk/Transports/Utilities.cs @@ -1,6 +1,4 @@ -using Speckle.Core.Logging; - -namespace Speckle.Core.Transports; +namespace Speckle.Sdk.Transports; public static class Utilities { diff --git a/src/Speckle.Core/packages.lock.json b/src/Speckle.Sdk/packages.lock.json similarity index 99% rename from src/Speckle.Core/packages.lock.json rename to src/Speckle.Sdk/packages.lock.json index 20640894..7c9cef4d 100644 --- a/src/Speckle.Core/packages.lock.json +++ b/src/Speckle.Sdk/packages.lock.json @@ -269,7 +269,7 @@ "System.Runtime.CompilerServices.Unsafe": "4.5.3" } }, - "speckle.logging": { + "speckle.sdk.logging": { "type": "Project" } } diff --git a/src/Speckle.Transports.Disk/Speckle.Transports.Disk.csproj b/src/Speckle.Transports.Disk/Speckle.Transports.Disk.csproj deleted file mode 100644 index 52ef1ac2..00000000 --- a/src/Speckle.Transports.Disk/Speckle.Transports.Disk.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - netstandard2.0 - Speckle.Transports.Disk - DiskTransport - A Disk transport for Speckle - $(PackageTags) disk transport - Debug;Release - true - enable - Speckle.Core.Transports - - - - - - diff --git a/src/Speckle.Transports.Disk/packages.lock.json b/src/Speckle.Transports.Disk/packages.lock.json deleted file mode 100644 index f08421c2..00000000 --- a/src/Speckle.Transports.Disk/packages.lock.json +++ /dev/null @@ -1,292 +0,0 @@ -{ - "version": 2, - "dependencies": { - ".NETStandard,Version=v2.0": { - "GitVersion.MsBuild": { - "type": "Direct", - "requested": "[5.12.0, )", - "resolved": "5.12.0", - "contentHash": "dJuigXycpJNOiLT9or7mkHSkGFHgGW3/p6cNNYEKZBa7Hhp1FdX/cvqYWWYhRLpfoZOedeA7aRbYiOB3vW/dvA==" - }, - "Microsoft.SourceLink.GitHub": { - "type": "Direct", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", - "dependencies": { - "Microsoft.Build.Tasks.Git": "8.0.0", - "Microsoft.SourceLink.Common": "8.0.0" - } - }, - "NETStandard.Library": { - "type": "Direct", - "requested": "[2.0.3, )", - "resolved": "2.0.3", - "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" - } - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.14.1, )", - "resolved": "1.14.1", - "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" - }, - "Speckle.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "GraphQL.Client.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "h7uzWFORHZ+CCjwr/ThAyXMr0DPpzEANDa4Uo54wqCQ+j7qUKwqYTgOrb1W40sqbvNaZm9v/X7It31SUw0maHA==", - "dependencies": { - "GraphQL.Primitives": "6.0.0" - } - }, - "GraphQL.Client.Abstractions.Websocket": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "Nr9bPf8gIOvLuXpqEpqr9z9jslYFJOvd0feHth3/kPqeR3uMbjF5pjiwh4jxyMcxHdr8Pb6QiXkV3hsSyt0v7A==", - "dependencies": { - "GraphQL.Client.Abstractions": "6.0.0" - } - }, - "GraphQL.Primitives": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "yg72rrYDapfsIUrul7aF6wwNnTJBOFvuA9VdDTQpPa8AlAriHbufeXYLBcodKjfUdkCnaiggX1U/nEP08Zb5GA==" - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "W8DPQjkMScOMTtJbPwmPyj9c3zYSFGawDW3jwlBOOsnY+EzZFLgNQ/UMkK35JmkNOVPdCyPr2Tw7Vv9N+KA3ZQ==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.Build.Tasks.Git": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "dependencies": { - "SQLitePCLRaw.core": "2.1.4" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" - }, - "Microsoft.NETCore.Targets": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" - }, - "Microsoft.SourceLink.Common": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" - }, - "SQLitePCLRaw.bundle_e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "EWI1olKDjFEBMJu0+3wuxwziIAdWDVMYLhuZ3Qs84rrz+DHwD00RzWPZCa+bLnHCf3oJwuFZIRsHT5p236QXww==", - "dependencies": { - "SQLitePCLRaw.lib.e_sqlite3": "2.1.4", - "SQLitePCLRaw.provider.e_sqlite3": "2.1.4" - } - }, - "SQLitePCLRaw.core": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "inBjvSHo9UDKneGNzfUfDjK08JzlcIhn1+SP5Y3m6cgXpCxXKCJDy6Mka7LpgSV+UZmKSnC8rTwB0SQ0xKu5pA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "SQLitePCLRaw.lib.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" - }, - "SQLitePCLRaw.provider.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "CSlb5dUp1FMIkez9Iv5EXzpeq7rHryVNqwJMWnpq87j9zWZexaEMdisDktMsnnrzKM6ahNrsTkjqNodTBPBxtQ==", - "dependencies": { - "SQLitePCLRaw.core": "2.1.4" - } - }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.4.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "System.Numerics.Vectors": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" - }, - "System.Reactive": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==", - "dependencies": { - "System.Runtime.InteropServices.WindowsRuntime": "4.3.0", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "System.Runtime": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "System.Runtime.InteropServices.WindowsRuntime": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "J4GUi3xZQLUBasNwZnjrffN8i5wpHrBtZoLG+OhRyGo/+YunMRWWtwoMDlUAIdmX0uRfpHIBDSV6zyr3yf00TA==", - "dependencies": { - "System.Runtime": "4.3.0" - } - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "5.0.1", - "contentHash": "KmJ+CJXizDofbq6mpqDoRRLcxgOd2z9X3XoFNULSbvbqVRZkFX3istvr+MUjL6Zw1RT+RNdoI4GYidIINtgvqQ==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4" - } - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "speckle.core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.7, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Speckle.DoubleNumerics": "[4.0.1, )", - "Speckle.Logging": "[1.0.0, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.Text.Json": "[5.0.2, )" - } - }, - "speckle.logging": { - "type": "Project" - }, - "GraphQL.Client": { - "type": "CentralTransitive", - "requested": "[6.0.0, )", - "resolved": "6.0.0", - "contentHash": "8yPNBbuVBpTptivyAlak4GZvbwbUcjeQTL4vN1HKHRuOykZ4r7l5fcLS6vpyPyLn0x8FsL31xbOIKyxbmR9rbA==", - "dependencies": { - "GraphQL.Client.Abstractions": "6.0.0", - "GraphQL.Client.Abstractions.Websocket": "6.0.0", - "System.Reactive": "5.0.0" - } - }, - "Microsoft.CSharp": { - "type": "CentralTransitive", - "requested": "[4.7.0, )", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "CentralTransitive", - "requested": "[7.0.7, )", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Polly": { - "type": "CentralTransitive", - "requested": "[7.2.3, )", - "resolved": "7.2.3", - "contentHash": "DeCY0OFbNdNxsjntr1gTXHJ5pKUwYzp04Er2LLeN3g6pWhffsGuKVfMBLe1lw7x76HrPkLxKEFxBlpRxS2nDEQ==" - }, - "Polly.Contrib.WaitAndRetry": { - "type": "CentralTransitive", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "1MUQLiSo4KDkQe6nzQRhIU05lm9jlexX5BVsbuw0SL82ynZ+GzAHQxJVDPVBboxV37Po3SG077aX8DuSy8TkaA==" - }, - "Polly.Extensions.Http": { - "type": "CentralTransitive", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "drrG+hB3pYFY7w1c3BD+lSGYvH2oIclH8GRSehgfyP5kjnFnHKQuuBhuHLv+PWyFuaTDyk/vfRpnxOzd11+J8g==", - "dependencies": { - "Polly": "7.1.0" - } - }, - "Speckle.DoubleNumerics": { - "type": "CentralTransitive", - "requested": "[4.0.1, )", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "CentralTransitive", - "requested": "[13.0.2, )", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "System.Text.Json": { - "type": "CentralTransitive", - "requested": "[5.0.2, )", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "5.0.0", - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "5.0.0", - "System.Text.Encodings.Web": "5.0.1", - "System.Threading.Tasks.Extensions": "4.5.4" - } - } - } - } -} \ No newline at end of file diff --git a/src/Speckle.Transports.MongoDB/MongoDB.cs b/src/Speckle.Transports.MongoDB/MongoDB.cs deleted file mode 100644 index 52a1b7f7..00000000 --- a/src/Speckle.Transports.MongoDB/MongoDB.cs +++ /dev/null @@ -1,263 +0,0 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using System.Timers; -using MongoDB.Bson; -using MongoDB.Driver; -using Speckle.Core.Common; -using Speckle.Core.Logging; -using Speckle.Logging; -using Timer = System.Timers.Timer; - -namespace Speckle.Core.Transports; - -// If data storage accessed by transports will always use the hash and content field names, move this enum to ITransport instead. -public enum Field -{ - hash, - content -} - -// Question: the benefit of noSQL is the use of unstructured collections of variable documents. -// Explore storing partially serialized Speckle objects with dynamically generated fields instead of just a content string? -[Obsolete("This Transport is no longer maintained or routinely tested, use with caution")] -public class MongoDBTransport : IDisposable, ITransport -{ - private bool IS_WRITING; - private int MAX_TRANSACTION_SIZE = 1000; - private int PollInterval = 500; - - private ConcurrentQueue<(string, string, int)> Queue = new(); - - /// - /// Timer that ensures queue is consumed if less than MAX_TRANSACTION_SIZE objects are being sent. - /// - /// Is this to prevent requests to read an object before it is written, or to handle read/write locks? - /// If this is can differ per transport, better to use Database.currentOp() to determine if write operations are waiting for a lock. - private Timer WriteTimer; - - public MongoDBTransport( - string connectionString = "mongodb://localhost:27017", - string applicationName = "Speckle", - string scope = "Objects" - ) - { - SpeckleLog.Logger.Information("Creating new MongoDB Transport"); - - ConnectionString = connectionString; - Client = new MongoClient(ConnectionString); - Database = (MongoDatabaseBase)Client.GetDatabase(applicationName); - Collection = Database.GetCollection(scope); - - Initialize(); - - WriteTimer = new Timer - { - AutoReset = true, - Enabled = false, - Interval = PollInterval - }; - WriteTimer.Elapsed += WriteTimerElapsed; - } - - public string ConnectionString { get; set; } - - private MongoClient Client { get; set; } - private IMongoDatabase Database { get; set; } - private IMongoCollection Collection { get; set; } - - public void Dispose() - { - // MongoDB collection connection should dispose automatically - - // Time out locking could be added if an expected use case is multiple clients writing to the same server - } - - public string TransportName { get; set; } = "MongoTransport"; - - public Dictionary TransportContext => new() { { "name", TransportName }, { "type", GetType().Name } }; - - public CancellationToken CancellationToken { get; set; } - - public Action? OnProgressAction { get; set; } - - public Action? OnErrorAction { get; set; } - public int SavedObjectCount { get; private set; } - - // not implementing this properly - public TimeSpan Elapsed => TimeSpan.Zero; - - public void BeginWrite() - { - SavedObjectCount = 0; - } - - public void EndWrite() { } - - public Task> HasObjects(IReadOnlyList objectIds) - { - throw new NotImplementedException(); - } - - private void Initialize() - { - // Assumes mongoDB server is running - // Mongo database and collection should be created automatically if it doesn't already exist - - // Check if the connection is successful - bool isMongoLive = Database.RunCommandAsync((Command)"{ping:1}").Wait(1000); - if (!isMongoLive) - { - OnErrorAction?.Invoke(TransportName, new Exception("The Mongo database could not be reached.")); - } - } - - /// - /// Returns all the objects in the store. - /// - /// - internal IEnumerable GetAllObjects() - { - var documents = Collection.Find(new BsonDocument()).ToList(); - List documentContents = new(); - foreach (BsonDocument document in documents) - { - documentContents.Add(document[Field.content.ToString()].AsString); - } - - return documentContents; - } - - /// - /// Deletes an object. Note: do not use for any speckle object transport, as it will corrupt the database. - /// - /// - internal void DeleteObject(string hash) - { - var filter = Builders.Filter.Eq(Field.hash.ToString(), hash); - Collection.DeleteOne(filter); - } - - #region Writes - - /// - /// Awaits until write completion (ie, the current queue is fully consumed). - /// - /// - public async Task WriteComplete() => await Utilities.WaitUntil(GetWriteCompletionStatus, 500).ConfigureAwait(false); - - /// - /// Returns true if the current write queue is empty and committed. - /// - /// - /// - /// Mongo has intent shared and intent exclusive client operations. - /// Each category shares a lock, with intent exclusive operations prioritized. - /// Would change to Database.currentOp() to determine if write operations are waiting for a lock, if the WriteTimer is deprecated - /// - public bool GetWriteCompletionStatus() - { - Console.WriteLine($"write completion {Queue.Count == 0 && !IS_WRITING}"); - return Queue.Count == 0 && !IS_WRITING; - } - - private void WriteTimerElapsed(object sender, ElapsedEventArgs e) - { - WriteTimer.Enabled = false; - if (!IS_WRITING && Queue.Count != 0) - { - ConsumeQueue(); - } - } - - private void ConsumeQueue() - { - IS_WRITING = true; - var i = 0; - ValueTuple result; - - while (i < MAX_TRANSACTION_SIZE && Queue.TryPeek(out result)) - { - Queue.TryDequeue(out result); - var document = new BsonDocument - { - { Field.hash.ToString(), result.Item1 }, - { Field.content.ToString(), result.Item2 } - }; - Collection.InsertOne(document); - } - - if (Queue.Count > 0) - { - ConsumeQueue(); - } - - IS_WRITING = false; - } - - /// - /// Adds an object to the saving queue. - /// - /// - /// - public void SaveObject(string hash, string serializedObject) - { - Queue.Enqueue((hash, serializedObject, Encoding.UTF8.GetByteCount(serializedObject))); - - WriteTimer.Enabled = true; - WriteTimer.Start(); - } - - public void SaveObject(string hash, ITransport sourceTransport) - { - var serializedObject = sourceTransport.GetObject(hash).NotNull(); - Queue.Enqueue((hash, serializedObject, Encoding.UTF8.GetByteCount(serializedObject))); - } - - /// - /// Directly saves the object in the db. - /// - /// - /// - public void SaveObjectSync(string hash, string serializedObject) - { - var document = new BsonDocument { { Field.hash.ToString(), hash }, { Field.content.ToString(), serializedObject } }; - Collection.InsertOne(document); - } - - #endregion - - #region Reads - - /// - /// Gets an object. - /// - /// - /// - public string? GetObject(string hash) - { - var filter = Builders.Filter.Eq(Field.hash.ToString(), hash); - BsonDocument objectDocument = Collection.Find(filter).FirstOrDefault(); - if (objectDocument != null) - { - return objectDocument[Field.content.ToString()].AsString; - } - - // pass on the duty of null checks to consumers - return null; - } - - public Task CopyObjectAndChildren( - string hash, - ITransport targetTransport, - Action? onTotalChildrenCountKnown = null - ) - { - throw new NotImplementedException(); - } - - #endregion -} diff --git a/src/Speckle.Transports.MongoDB/Speckle.Transports.MongoDB.csproj b/src/Speckle.Transports.MongoDB/Speckle.Transports.MongoDB.csproj deleted file mode 100644 index 6088daca..00000000 --- a/src/Speckle.Transports.MongoDB/Speckle.Transports.MongoDB.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - netstandard2.0 - Speckle.Transports.MongoDB - MongoDBTransport - A MongoDB transport for Speckle - $(PackageTags) mongodb transport - true - Speckle.Core.Transports - - - - - - - - - - diff --git a/src/Speckle.Transports.MongoDB/packages.lock.json b/src/Speckle.Transports.MongoDB/packages.lock.json deleted file mode 100644 index d192ed49..00000000 --- a/src/Speckle.Transports.MongoDB/packages.lock.json +++ /dev/null @@ -1,423 +0,0 @@ -{ - "version": 2, - "dependencies": { - ".NETStandard,Version=v2.0": { - "GitVersion.MsBuild": { - "type": "Direct", - "requested": "[5.12.0, )", - "resolved": "5.12.0", - "contentHash": "dJuigXycpJNOiLT9or7mkHSkGFHgGW3/p6cNNYEKZBa7Hhp1FdX/cvqYWWYhRLpfoZOedeA7aRbYiOB3vW/dvA==" - }, - "Microsoft.SourceLink.GitHub": { - "type": "Direct", - "requested": "[8.0.0, )", - "resolved": "8.0.0", - "contentHash": "G5q7OqtwIyGTkeIOAc3u2ZuV/kicQaec5EaRnc0pIeSnh9LUjj+PYQrJYBURvDt7twGl2PKA7nSN0kz1Zw5bnQ==", - "dependencies": { - "Microsoft.Build.Tasks.Git": "8.0.0", - "Microsoft.SourceLink.Common": "8.0.0" - } - }, - "MongoDB.Driver": { - "type": "Direct", - "requested": "[2.19.2, )", - "resolved": "2.19.2", - "contentHash": "xT2VA1KmjzxXQYuA8VbnM3r+DVVjja6ntD7YjesxkODAX3GkQLSgLLH+tS7R0uy/zZzA7YWEF1AKIJyxC7jfmA==", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "2.0.0", - "MongoDB.Bson": "2.19.2", - "MongoDB.Driver.Core": "2.19.2", - "MongoDB.Libmongocrypt": "1.7.0" - } - }, - "NETStandard.Library": { - "type": "Direct", - "requested": "[2.0.3, )", - "resolved": "2.0.3", - "contentHash": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" - } - }, - "PolySharp": { - "type": "Direct", - "requested": "[1.14.1, )", - "resolved": "1.14.1", - "contentHash": "mOOmFYwad3MIOL14VCjj02LljyF1GNw1wP0YVlxtcPvqdxjGGMNdNJJxHptlry3MOd8b40Flm8RPOM8JOlN2sQ==" - }, - "Speckle.InterfaceGenerator": { - "type": "Direct", - "requested": "[0.9.6, )", - "resolved": "0.9.6", - "contentHash": "HKH7tYrYYlCK1ct483hgxERAdVdMtl7gUKW9ijWXxA1UsYR4Z+TrRHYmzZ9qmpu1NnTycSrp005NYM78GDKV1w==" - }, - "AWSSDK.Core": { - "type": "Transitive", - "resolved": "3.7.100.14", - "contentHash": "gnEgxBlk4PFEfdPE8Lkf4+D16MZFYSaW7/o6Wwe5e035QWUkTJX0Dn4LfTCdV5QSEL/fOFxu+yCAm55eIIBgog==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "1.1.0" - } - }, - "AWSSDK.SecurityToken": { - "type": "Transitive", - "resolved": "3.7.100.14", - "contentHash": "dGCVuVo0CFUKWW85W8YENO+aREf8sCBDjvGbnNvxJuNW4Ss+brEU9ltHhq2KfZze2VUNK1/wygbPG1bmbpyXEw==", - "dependencies": { - "AWSSDK.Core": "[3.7.100.14, 4.0.0)" - } - }, - "DnsClient": { - "type": "Transitive", - "resolved": "1.6.1", - "contentHash": "4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", - "dependencies": { - "Microsoft.Win32.Registry": "5.0.0", - "System.Buffers": "4.5.1" - } - }, - "GraphQL.Client.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "h7uzWFORHZ+CCjwr/ThAyXMr0DPpzEANDa4Uo54wqCQ+j7qUKwqYTgOrb1W40sqbvNaZm9v/X7It31SUw0maHA==", - "dependencies": { - "GraphQL.Primitives": "6.0.0" - } - }, - "GraphQL.Client.Abstractions.Websocket": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "Nr9bPf8gIOvLuXpqEpqr9z9jslYFJOvd0feHth3/kPqeR3uMbjF5pjiwh4jxyMcxHdr8Pb6QiXkV3hsSyt0v7A==", - "dependencies": { - "GraphQL.Client.Abstractions": "6.0.0" - } - }, - "GraphQL.Primitives": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "yg72rrYDapfsIUrul7aF6wwNnTJBOFvuA9VdDTQpPa8AlAriHbufeXYLBcodKjfUdkCnaiggX1U/nEP08Zb5GA==" - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "W8DPQjkMScOMTtJbPwmPyj9c3zYSFGawDW3jwlBOOsnY+EzZFLgNQ/UMkK35JmkNOVPdCyPr2Tw7Vv9N+KA3ZQ==", - "dependencies": { - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "Microsoft.Build.Tasks.Git": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "bZKfSIKJRXLTuSzLudMFte/8CempWjVamNUR5eHJizsy+iuOuO/k2gnh7W0dHJmYY0tBf+gUErfluCv5mySAOQ==" - }, - "Microsoft.Data.Sqlite.Core": { - "type": "Transitive", - "resolved": "7.0.7", - "contentHash": "21FRzcJhaTrlv7kTrqr/ltFcSQM2TyuTTPhUcjO8H73od7Bb3QraNW90c7lUucNI/245XPkKZG4fp7/7OsKCSg==", - "dependencies": { - "SQLitePCLRaw.core": "2.1.4" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "2.0.0", - "contentHash": "6ZCllUYGFukkymSTx3Yr0G/ajRxoNJp7/FqSxSB4fGISST54ifBhgu4Nc0ItGi3i6DqwuNd8SUyObmiC++AO2Q==" - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==" - }, - "Microsoft.NETCore.Targets": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" - }, - "Microsoft.SourceLink.Common": { - "type": "Transitive", - "resolved": "8.0.0", - "contentHash": "dk9JPxTCIevS75HyEQ0E4OVAFhB2N+V9ShCXf8Q6FkUQZDkgLI12y679Nym1YqsiSysuQskT7Z+6nUf3yab6Vw==" - }, - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4", - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "MongoDB.Bson": { - "type": "Transitive", - "resolved": "2.19.2", - "contentHash": "YpwSLKillPRj+BYEZU0dFgVHdCuj7uGIkLcyEc5a9zwJQYMbZkAc2CRVzobnDY9HMSCtyefXnkrz9CQ6C91KQA==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "5.0.0" - } - }, - "MongoDB.Driver.Core": { - "type": "Transitive", - "resolved": "2.19.2", - "contentHash": "MjZmAZLNCV+d/eW+X1YPNztEtEBosIX8qMFCoQAhJOoHotuJfTePt+Lp8sjxTDTCyaOtLhClIgefy3P9JaxUHw==", - "dependencies": { - "AWSSDK.SecurityToken": "3.7.100.14", - "DnsClient": "1.6.1", - "Microsoft.Extensions.Logging.Abstractions": "2.0.0", - "MongoDB.Bson": "2.19.2", - "MongoDB.Libmongocrypt": "1.7.0", - "SharpCompress": "0.30.1", - "Snappier": "1.0.0", - "System.Buffers": "4.5.1", - "ZstdSharp.Port": "0.6.2" - } - }, - "MongoDB.Libmongocrypt": { - "type": "Transitive", - "resolved": "1.7.0", - "contentHash": "p9+peTZX63nGHskOLhvhfBtrknxNg1RzXepE07rPozuCGz27bMjCcQyvn2YByg0L3YEcNWdTmI4BlnG/5RF+5Q==" - }, - "SharpCompress": { - "type": "Transitive", - "resolved": "0.30.1", - "contentHash": "XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==", - "dependencies": { - "System.Memory": "4.5.4", - "System.Text.Encoding.CodePages": "5.0.0" - } - }, - "Snappier": { - "type": "Transitive", - "resolved": "1.0.0", - "contentHash": "rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==", - "dependencies": { - "System.Memory": "4.5.4", - "System.Runtime.CompilerServices.Unsafe": "4.7.1", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "SQLitePCLRaw.bundle_e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "EWI1olKDjFEBMJu0+3wuxwziIAdWDVMYLhuZ3Qs84rrz+DHwD00RzWPZCa+bLnHCf3oJwuFZIRsHT5p236QXww==", - "dependencies": { - "SQLitePCLRaw.lib.e_sqlite3": "2.1.4", - "SQLitePCLRaw.provider.e_sqlite3": "2.1.4" - } - }, - "SQLitePCLRaw.core": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "inBjvSHo9UDKneGNzfUfDjK08JzlcIhn1+SP5Y3m6cgXpCxXKCJDy6Mka7LpgSV+UZmKSnC8rTwB0SQ0xKu5pA==", - "dependencies": { - "System.Memory": "4.5.3" - } - }, - "SQLitePCLRaw.lib.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "2C9Q9eX7CPLveJA0rIhf9RXAvu+7nWZu1A2MdG6SD/NOu26TakGgL1nsbc0JAspGijFOo3HoN79xrx8a368fBg==" - }, - "SQLitePCLRaw.provider.e_sqlite3": { - "type": "Transitive", - "resolved": "2.1.4", - "contentHash": "CSlb5dUp1FMIkez9Iv5EXzpeq7rHryVNqwJMWnpq87j9zWZexaEMdisDktMsnnrzKM6ahNrsTkjqNodTBPBxtQ==", - "dependencies": { - "SQLitePCLRaw.core": "2.1.4" - } - }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Numerics.Vectors": "4.4.0", - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "System.Numerics.Vectors": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==" - }, - "System.Reactive": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "erBZjkQHWL9jpasCE/0qKAryzVBJFxGHVBAvgRN1bzM0q2s1S4oYREEEL0Vb+1kA/6BKb5FjUZMp5VXmy+gzkQ==", - "dependencies": { - "System.Runtime.InteropServices.WindowsRuntime": "4.3.0", - "System.Threading.Tasks.Extensions": "4.5.4" - } - }, - "System.Runtime": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "ZD9TMpsmYJLrxbbmdvhwt9YEgG5WntEnZ/d1eH8JBX9LBp+Ju8BSBhUGbZMNVHHomWo2KVImJhTDl2hIgw/6MA==" - }, - "System.Runtime.InteropServices.WindowsRuntime": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "J4GUi3xZQLUBasNwZnjrffN8i5wpHrBtZoLG+OhRyGo/+YunMRWWtwoMDlUAIdmX0uRfpHIBDSV6zyr3yf00TA==", - "dependencies": { - "System.Runtime": "4.3.0" - } - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - }, - "System.Text.Encoding.CodePages": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "NyscU59xX6Uo91qvhOs2Ccho3AR2TnZPomo1Z0K6YpyztBPM/A5VbkzOO19sy3A3i1TtEnTxA7bCe3Us+r5MWg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "5.0.0" - } - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "5.0.1", - "contentHash": "KmJ+CJXizDofbq6mpqDoRRLcxgOd2z9X3XoFNULSbvbqVRZkFX3istvr+MUjL6Zw1RT+RNdoI4GYidIINtgvqQ==", - "dependencies": { - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4" - } - }, - "System.Threading.Tasks.Extensions": { - "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "4.5.3" - } - }, - "ZstdSharp.Port": { - "type": "Transitive", - "resolved": "0.6.2", - "contentHash": "jPao/LdUNLUz8rn3H1D8W7wQbZsRZM0iayvWI4xGejJg3XJHT56gcmYdgmCGPdJF1UEBqUjucCRrFB+4HbJsbw==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "5.0.0", - "System.Memory": "4.5.4" - } - }, - "speckle.core": { - "type": "Project", - "dependencies": { - "GraphQL.Client": "[6.0.0, )", - "Microsoft.CSharp": "[4.7.0, )", - "Microsoft.Data.Sqlite": "[7.0.7, )", - "Polly": "[7.2.3, )", - "Polly.Contrib.WaitAndRetry": "[1.1.1, )", - "Polly.Extensions.Http": "[3.0.0, )", - "Speckle.DoubleNumerics": "[4.0.1, )", - "Speckle.Logging": "[1.0.0, )", - "Speckle.Newtonsoft.Json": "[13.0.2, )", - "System.Text.Json": "[5.0.2, )" - } - }, - "speckle.logging": { - "type": "Project" - }, - "GraphQL.Client": { - "type": "CentralTransitive", - "requested": "[6.0.0, )", - "resolved": "6.0.0", - "contentHash": "8yPNBbuVBpTptivyAlak4GZvbwbUcjeQTL4vN1HKHRuOykZ4r7l5fcLS6vpyPyLn0x8FsL31xbOIKyxbmR9rbA==", - "dependencies": { - "GraphQL.Client.Abstractions": "6.0.0", - "GraphQL.Client.Abstractions.Websocket": "6.0.0", - "System.Reactive": "5.0.0" - } - }, - "Microsoft.CSharp": { - "type": "CentralTransitive", - "requested": "[4.7.0, )", - "resolved": "4.7.0", - "contentHash": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==" - }, - "Microsoft.Data.Sqlite": { - "type": "CentralTransitive", - "requested": "[7.0.7, )", - "resolved": "7.0.7", - "contentHash": "tiNmV1oPy+Z2R7Wd0bPB/FxCr8B+/5q11OpDMG751GA/YuOL7MZrBFfzv5oFRlFe08K6sjrnbrauzzGIeNrzLQ==", - "dependencies": { - "Microsoft.Data.Sqlite.Core": "7.0.7", - "SQLitePCLRaw.bundle_e_sqlite3": "2.1.4" - } - }, - "Polly": { - "type": "CentralTransitive", - "requested": "[7.2.3, )", - "resolved": "7.2.3", - "contentHash": "DeCY0OFbNdNxsjntr1gTXHJ5pKUwYzp04Er2LLeN3g6pWhffsGuKVfMBLe1lw7x76HrPkLxKEFxBlpRxS2nDEQ==" - }, - "Polly.Contrib.WaitAndRetry": { - "type": "CentralTransitive", - "requested": "[1.1.1, )", - "resolved": "1.1.1", - "contentHash": "1MUQLiSo4KDkQe6nzQRhIU05lm9jlexX5BVsbuw0SL82ynZ+GzAHQxJVDPVBboxV37Po3SG077aX8DuSy8TkaA==" - }, - "Polly.Extensions.Http": { - "type": "CentralTransitive", - "requested": "[3.0.0, )", - "resolved": "3.0.0", - "contentHash": "drrG+hB3pYFY7w1c3BD+lSGYvH2oIclH8GRSehgfyP5kjnFnHKQuuBhuHLv+PWyFuaTDyk/vfRpnxOzd11+J8g==", - "dependencies": { - "Polly": "7.1.0" - } - }, - "Speckle.DoubleNumerics": { - "type": "CentralTransitive", - "requested": "[4.0.1, )", - "resolved": "4.0.1", - "contentHash": "MzEQ1Im0zTja+tEsdRIk/WlPiKqb22NmTOJcR1ZKm/mz46pezyyID3/wRz6vJUELMpSLnG7LhsxBL+nxbr7V0w==" - }, - "Speckle.Newtonsoft.Json": { - "type": "CentralTransitive", - "requested": "[13.0.2, )", - "resolved": "13.0.2", - "contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA==" - }, - "System.Text.Json": { - "type": "CentralTransitive", - "requested": "[5.0.2, )", - "resolved": "5.0.2", - "contentHash": "I47dVIGiV6SfAyppphxqupertT/5oZkYLDCX6vC3HpOI4ZLjyoKAreUoem2ie6G0RbRuFrlqz/PcTQjfb2DOfQ==", - "dependencies": { - "Microsoft.Bcl.AsyncInterfaces": "5.0.0", - "System.Buffers": "4.5.1", - "System.Memory": "4.5.4", - "System.Numerics.Vectors": "4.5.0", - "System.Runtime.CompilerServices.Unsafe": "5.0.0", - "System.Text.Encodings.Web": "5.0.1", - "System.Threading.Tasks.Extensions": "4.5.4" - } - } - } - } -} \ No newline at end of file diff --git a/tests/Speckle.Core.Serialization.Tests/TestKit.cs b/tests/Speckle.Core.Serialization.Tests/TestKit.cs deleted file mode 100644 index 5ca1339d..00000000 --- a/tests/Speckle.Core.Serialization.Tests/TestKit.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Objects.BuiltElements.Revit; -using Speckle.Core.Kits; - -namespace Speckle.Core.Serialization.Tests; - -public class TestKit : ISpeckleKit -{ - public IEnumerable Types => typeof(RevitWall).Assembly.ExportedTypes; - public IEnumerable Converters { get; } - public string Description { get; } - public string Name { get; } - public string Author { get; } - public string WebsiteOrEmail { get; } - - public ISpeckleConverter LoadConverter(string app) => throw new NotImplementedException(); -} diff --git a/tests/Speckle.Core.Tests.Unit/Kits/KitManagerTests.cs b/tests/Speckle.Core.Tests.Unit/Kits/KitManagerTests.cs deleted file mode 100644 index 96a5313d..00000000 --- a/tests/Speckle.Core.Tests.Unit/Kits/KitManagerTests.cs +++ /dev/null @@ -1,19 +0,0 @@ -using NUnit.Framework; -using Speckle.Core.Kits; - -namespace Speckle.Core.Tests.Unit.Kits; - -[TestFixture] -[TestOf(typeof(KitManager))] -public class KitManagerTests -{ - [Test] - public void KitsExist() - { - var kits = KitManager.Kits.ToArray(); - Assert.That(kits, Has.Length.GreaterThan(0)); - - var types = KitManager.Types.ToArray(); - Assert.That(types, Has.Length.GreaterThan(0)); - } -} diff --git a/tests/Speckle.Core.Tests.Unit/Serialisation/ObjectModelDeprecationTests.cs b/tests/Speckle.Core.Tests.Unit/Serialisation/ObjectModelDeprecationTests.cs deleted file mode 100644 index a9cba9de..00000000 --- a/tests/Speckle.Core.Tests.Unit/Serialisation/ObjectModelDeprecationTests.cs +++ /dev/null @@ -1,35 +0,0 @@ -using NUnit.Framework; -using Speckle.Core.Models; -using Speckle.Core.Serialisation.Deprecated; -using Speckle.Core.Serialisation.SerializationUtilities; - -namespace Speckle.Core.Tests.Unit.Serialisation -{ - [TestFixture] - [TestOf(typeof(BaseObjectSerializationUtilities))] - public class ObjectModelDeprecationTests - { - [Test] - public void GetDeprecatedAtomicType() - { - string destinationType = $"Speckle.Core.Serialisation.{nameof(MySpeckleBase)}"; - - var result = BaseObjectSerializationUtilities.GetAtomicType(destinationType); - Assert.That(result, Is.EqualTo(typeof(MySpeckleBase))); - } - - [Test] - [TestCase("Objects.Geometry.Mesh", "Objects.Geometry.Deprecated.Mesh")] - [TestCase("Objects.Mesh", "Objects.Deprecated.Mesh")] - public void GetDeprecatedTypeName(string input, string expected) - { - var actual = BaseObjectSerializationUtilities.GetDeprecatedTypeName(input); - Assert.That(actual, Is.EqualTo(expected)); - } - } -} - -namespace Speckle.Core.Serialisation.Deprecated -{ - public class MySpeckleBase : Base { } -} diff --git a/tests/Speckle.Objects.Tests.Unit/GenericTests.cs b/tests/Speckle.Objects.Tests.Unit/GenericTests.cs deleted file mode 100644 index bfe4a9ae..00000000 --- a/tests/Speckle.Objects.Tests.Unit/GenericTests.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using NUnit.Framework; -using Speckle.Core.Common; -using Speckle.Core.Kits; -using Speckle.Core.Models; - -namespace Objects.Tests.Unit; - -[TestFixture] -public class GenericTests -{ - public static IEnumerable AvailableTypesInKit() - { - // Get all types in the Objects assembly that inherit from Base - return Assembly.GetAssembly(typeof(ObjectsKit)).NotNull().GetTypes().Where(t => typeof(Base).IsAssignableFrom(t)); - } - - public static IEnumerable NonAbstractTypesInKit() - { - return AvailableTypesInKit().Where(t => !t.IsAbstract); - } - - [ - Test(Description = "Checks that all objects inside the Default Kit have empty constructors."), - TestCaseSource(nameof(NonAbstractTypesInKit)) - ] - public void ObjectHasEmptyConstructor(Type t) - { - var constructor = t.GetConstructor(Type.EmptyTypes); - Assert.That(constructor, Is.Not.Null); - } - - [ - Test( - Description = "Checks that all methods with the 'SchemaComputed' attribute inside the Default Kit have no parameters." - ), - TestCaseSource(nameof(AvailableTypesInKit)) - ] - public void SchemaComputedMethod_CanBeCalledWithNoParameters(Type t) - { - t.GetMethods() - .Where(m => m.IsDefined(typeof(SchemaComputedAttribute))) - .ToList() - .ForEach(m => - { - // Check if all parameters are optional. - // This allows for other methods to be used as long as they can be called empty. - // But also covers the basic case of having no parameters in the first place. - Assert.That(m.GetParameters().All(p => p.IsOptional), Is.True); - }); - } -} diff --git a/tests/Speckle.Objects.Tests.Unit/Geometry/ArcTests.cs b/tests/Speckle.Objects.Tests.Unit/Geometry/ArcTests.cs index d5343edc..f7839178 100644 --- a/tests/Speckle.Objects.Tests.Unit/Geometry/ArcTests.cs +++ b/tests/Speckle.Objects.Tests.Unit/Geometry/ArcTests.cs @@ -1,6 +1,6 @@ using System; using NUnit.Framework; -using Objects.Geometry; +using Speckle.Objects.Geometry; namespace Objects.Tests.Unit.Geometry; diff --git a/tests/Speckle.Objects.Tests.Unit/Geometry/MeshTests.cs b/tests/Speckle.Objects.Tests.Unit/Geometry/MeshTests.cs index f17f729b..25f18338 100644 --- a/tests/Speckle.Objects.Tests.Unit/Geometry/MeshTests.cs +++ b/tests/Speckle.Objects.Tests.Unit/Geometry/MeshTests.cs @@ -1,5 +1,5 @@ using NUnit.Framework; -using Objects.Geometry; +using Speckle.Objects.Geometry; namespace Objects.Tests.Unit.Geometry; diff --git a/tests/Speckle.Objects.Tests.Unit/Geometry/PointTests.cs b/tests/Speckle.Objects.Tests.Unit/Geometry/PointTests.cs index 0cebd631..0a556558 100644 --- a/tests/Speckle.Objects.Tests.Unit/Geometry/PointTests.cs +++ b/tests/Speckle.Objects.Tests.Unit/Geometry/PointTests.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; using NUnit.Framework; -using Objects.Geometry; +using Speckle.Objects.Geometry; namespace Objects.Tests.Unit.Geometry; diff --git a/tests/Speckle.Objects.Tests.Unit/Geometry/TransformTests.cs b/tests/Speckle.Objects.Tests.Unit/Geometry/TransformTests.cs index faaebb49..d9f1932d 100644 --- a/tests/Speckle.Objects.Tests.Unit/Geometry/TransformTests.cs +++ b/tests/Speckle.Objects.Tests.Unit/Geometry/TransformTests.cs @@ -1,8 +1,8 @@ using System.Collections; using NUnit.Framework; -using Objects.Other; -using Speckle.Core.Kits; using Speckle.DoubleNumerics; +using Speckle.Objects.Other; +using Speckle.Sdk.Common; namespace Objects.Tests.Unit.Geometry; diff --git a/tests/Speckle.Objects.Tests.Unit/ModelPropertySupportedTypes.cs b/tests/Speckle.Objects.Tests.Unit/ModelPropertySupportedTypes.cs index d326ee4b..c647daf5 100644 --- a/tests/Speckle.Objects.Tests.Unit/ModelPropertySupportedTypes.cs +++ b/tests/Speckle.Objects.Tests.Unit/ModelPropertySupportedTypes.cs @@ -2,11 +2,15 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; +using System.Reflection; using NUnit.Framework; -using Speckle.Core.Models; -using Speckle.Core.Serialisation; using Speckle.DoubleNumerics; using Speckle.Newtonsoft.Json; +using Speckle.Objects; +using Speckle.Sdk.Common; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Serialisation; namespace Objects.Tests.Unit; @@ -17,18 +21,25 @@ namespace Objects.Tests.Unit; /// public class ModelPropertySupportedTypes { + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(Speckle.Objects.Geometry.Arc).Assembly); + } + /// /// Set of types that we support in Base objects /// If it's not in the list, or is commented out, it's not supported by our serializer! /// /// /// If you're tempted to add to this list, please ensure both our serializer and deserializer support properties of this type - /// Check the + /// Check the /// Check the /// (or is an interface where all concrete types are supported) /// You should also consider adding a test in SerializerNonBreakingChanges /// - private readonly HashSet _allowedTypes = + private static readonly HashSet _allowedTypes = new() { typeof(Boolean), @@ -59,23 +70,25 @@ public class ModelPropertySupportedTypes }; [Test] - [TestCaseSource(typeof(GenericTests), nameof(GenericTests.AvailableTypesInKit))] - public void TestObjects(Type t) + public void TestObjects() { - var members = DynamicBase.GetInstanceMembers(t).Where(p => !p.IsDefined(typeof(JsonIgnoreAttribute), true)); - - foreach (var prop in members) + foreach ((string _, Type type, List _) in TypeLoader.Types) { - if (prop.PropertyType.IsAssignableTo(typeof(Base))) - continue; - if (prop.PropertyType.IsEnum) - continue; - if (prop.PropertyType.IsSZArray) - continue; + var members = DynamicBase.GetInstanceMembers(type).Where(p => !p.IsDefined(typeof(JsonIgnoreAttribute), true)); + + foreach (var prop in members) + { + if (prop.PropertyType.IsAssignableTo(typeof(Base))) + continue; + if (prop.PropertyType.IsEnum) + continue; + if (prop.PropertyType.IsSZArray) + continue; - Type propType = prop.PropertyType; - Type typeDef = propType.IsGenericType ? propType.GetGenericTypeDefinition() : propType; - Assert.That(_allowedTypes, Does.Contain(typeDef), $"{typeDef} was not in allowedTypes"); + Type propType = prop.PropertyType; + Type typeDef = propType.IsGenericType ? propType.GetGenericTypeDefinition() : propType; + Assert.That(_allowedTypes, Does.Contain(typeDef), $"{typeDef} was not in allowedTypes"); + } } } } diff --git a/tests/Speckle.Objects.Tests.Unit/ObjectBaseValidityTests.cs b/tests/Speckle.Objects.Tests.Unit/ObjectBaseValidityTests.cs new file mode 100644 index 00000000..99704758 --- /dev/null +++ b/tests/Speckle.Objects.Tests.Unit/ObjectBaseValidityTests.cs @@ -0,0 +1,16 @@ +using NUnit.Framework; +using Speckle.Objects.Structural.GSA.Geometry; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; + +namespace Objects.Tests.Unit; + +public class ObjectBaseValidityTests +{ + [Test] + public void TestThatTypeWithoutAttributeFails() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(GSAAssembly).Assembly); + } +} diff --git a/tests/Speckle.Objects.Tests.Unit/Utils/MeshTriangulationHelperTests.cs b/tests/Speckle.Objects.Tests.Unit/Utils/MeshTriangulationHelperTests.cs index 0a47c077..43fe3842 100644 --- a/tests/Speckle.Objects.Tests.Unit/Utils/MeshTriangulationHelperTests.cs +++ b/tests/Speckle.Objects.Tests.Unit/Utils/MeshTriangulationHelperTests.cs @@ -2,8 +2,8 @@ using System.Collections.Generic; using System.Linq; using NUnit.Framework; -using Objects.Geometry; -using Objects.Utils; +using Speckle.Objects.Geometry; +using Speckle.Objects.Utils; namespace Objects.Tests.Unit.Utils; diff --git a/tests/Speckle.Objects.Tests.Unit/Utils/ShallowCopyTests.cs b/tests/Speckle.Objects.Tests.Unit/Utils/ShallowCopyTests.cs index c8ed33a9..da88569e 100644 --- a/tests/Speckle.Objects.Tests.Unit/Utils/ShallowCopyTests.cs +++ b/tests/Speckle.Objects.Tests.Unit/Utils/ShallowCopyTests.cs @@ -1,10 +1,9 @@ using System.Collections; using System.Collections.Generic; using NUnit.Framework; -using Objects.BuiltElements; -using Objects.Geometry; -using Speckle.Core.Common; -using Speckle.Core.Kits; +using Speckle.Objects.BuiltElements; +using Speckle.Objects.Geometry; +using Speckle.Sdk.Common; namespace Objects.Tests.Unit.Utils; diff --git a/tests/Speckle.Objects.Tests.Unit/packages.lock.json b/tests/Speckle.Objects.Tests.Unit/packages.lock.json index f60d7793..f0a6584a 100644 --- a/tests/Speckle.Objects.Tests.Unit/packages.lock.json +++ b/tests/Speckle.Objects.Tests.Unit/packages.lock.json @@ -169,7 +169,13 @@ "resolved": "1.6.0", "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, - "speckle.core": { + "speckle.objects": { + "type": "Project", + "dependencies": { + "Speckle.Sdk": "[1.0.0, )" + } + }, + "speckle.sdk": { "type": "Project", "dependencies": { "GraphQL.Client": "[6.0.0, )", @@ -179,20 +185,14 @@ "Polly.Contrib.WaitAndRetry": "[1.1.1, )", "Polly.Extensions.Http": "[3.0.0, )", "Speckle.DoubleNumerics": "[4.0.1, )", - "Speckle.Logging": "[1.0.0, )", "Speckle.Newtonsoft.Json": "[13.0.2, )", + "Speckle.Sdk.Logging": "[1.0.0, )", "System.Text.Json": "[5.0.2, )" } }, - "speckle.logging": { + "speckle.sdk.logging": { "type": "Project" }, - "speckle.objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[1.0.0, )" - } - }, "GraphQL.Client": { "type": "CentralTransitive", "requested": "[6.0.0, )", diff --git a/tests/Speckle.Core.Serialization.Tests/RevitObject.json b/tests/Speckle.Sdk.Serialization.Tests/RevitObject.json similarity index 100% rename from tests/Speckle.Core.Serialization.Tests/RevitObject.json rename to tests/Speckle.Sdk.Serialization.Tests/RevitObject.json diff --git a/tests/Speckle.Core.Serialization.Tests/SerializationTests.cs b/tests/Speckle.Sdk.Serialization.Tests/SerializationTests.cs similarity index 80% rename from tests/Speckle.Core.Serialization.Tests/SerializationTests.cs rename to tests/Speckle.Sdk.Serialization.Tests/SerializationTests.cs index 5e20d8d6..d89ab2b3 100644 --- a/tests/Speckle.Core.Serialization.Tests/SerializationTests.cs +++ b/tests/Speckle.Sdk.Serialization.Tests/SerializationTests.cs @@ -1,12 +1,15 @@ using System.Reflection; using NUnit.Framework; using Shouldly; -using Speckle.Core.Common; -using Speckle.Core.Serialisation; -using Speckle.Core.Serialisation.SerializationUtilities; using Speckle.Newtonsoft.Json.Linq; +using Speckle.Objects.BuiltElements; +using Speckle.Sdk.Common; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Serialisation; +using Speckle.Sdk.Serialisation.SerializationUtilities; -namespace Speckle.Core.Serialization.Tests; +namespace Speckle.Sdk.Serialization.Tests; [TestFixture] [Description("For certain types, changing property from one type to another should be implicitly backwards compatible")] @@ -14,6 +17,13 @@ public class SerializationTests { private readonly Assembly _assembly = Assembly.GetExecutingAssembly(); + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(Wall).Assembly, _assembly); + } + private async Task ReadJson(string fullName) { await using var stream = _assembly.GetManifestResourceStream(fullName).NotNull(); @@ -60,9 +70,9 @@ public async Task Basic_Namespace_Validation(string fileName) starts = baseType.speckle_type.StartsWith("Speckle.Core.") || baseType.speckle_type.StartsWith("Objects."); starts.ShouldBeTrue($"{baseType.speckle_type} isn't expected"); - var type = BaseObjectSerializationUtilities.GetAtomicType(baseType.speckle_type); + var type = TypeLoader.GetAtomicType(baseType.speckle_type); type.ShouldNotBeNull(); - var name = type.FullName.NotNull(); + var name = TypeLoader.GetTypeString(type) ?? throw new ArgumentNullException(); starts = name.StartsWith("Speckle.Core") || name.StartsWith("Objects"); starts.ShouldBeTrue($"{name} isn't expected"); } diff --git a/tests/Speckle.Core.Serialization.Tests/Speckle.Core.Serialization.Tests.csproj b/tests/Speckle.Sdk.Serialization.Tests/Speckle.Sdk.Serialization.Tests.csproj similarity index 85% rename from tests/Speckle.Core.Serialization.Tests/Speckle.Core.Serialization.Tests.csproj rename to tests/Speckle.Sdk.Serialization.Tests/Speckle.Sdk.Serialization.Tests.csproj index a143d645..2950a290 100644 --- a/tests/Speckle.Core.Serialization.Tests/Speckle.Core.Serialization.Tests.csproj +++ b/tests/Speckle.Sdk.Serialization.Tests/Speckle.Sdk.Serialization.Tests.csproj @@ -4,6 +4,7 @@ net8.0 true System.Runtime.CompilerServices.IsExternalInit;System.Runtime.CompilerServices.RequiresLocationAttribute + Speckle.Sdk.Serialization.Tests @@ -15,7 +16,7 @@ - + diff --git a/tests/Speckle.Core.Serialization.Tests/TestTransport.cs b/tests/Speckle.Sdk.Serialization.Tests/TestTransport.cs similarity index 94% rename from tests/Speckle.Core.Serialization.Tests/TestTransport.cs rename to tests/Speckle.Sdk.Serialization.Tests/TestTransport.cs index 6761bd25..5ebe1239 100644 --- a/tests/Speckle.Core.Serialization.Tests/TestTransport.cs +++ b/tests/Speckle.Sdk.Serialization.Tests/TestTransport.cs @@ -1,6 +1,6 @@ -using Speckle.Core.Transports; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Serialization.Tests; +namespace Speckle.Sdk.Serialization.Tests; public class TestTransport : ITransport { diff --git a/tests/Speckle.Core.Serialization.Tests/packages.lock.json b/tests/Speckle.Sdk.Serialization.Tests/packages.lock.json similarity index 98% rename from tests/Speckle.Core.Serialization.Tests/packages.lock.json rename to tests/Speckle.Sdk.Serialization.Tests/packages.lock.json index 8d69e096..6b3de7b8 100644 --- a/tests/Speckle.Core.Serialization.Tests/packages.lock.json +++ b/tests/Speckle.Sdk.Serialization.Tests/packages.lock.json @@ -206,7 +206,13 @@ "resolved": "1.6.0", "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, - "speckle.core": { + "speckle.objects": { + "type": "Project", + "dependencies": { + "Speckle.Sdk": "[1.0.0, )" + } + }, + "speckle.sdk": { "type": "Project", "dependencies": { "GraphQL.Client": "[6.0.0, )", @@ -216,20 +222,14 @@ "Polly.Contrib.WaitAndRetry": "[1.1.1, )", "Polly.Extensions.Http": "[3.0.0, )", "Speckle.DoubleNumerics": "[4.0.1, )", - "Speckle.Logging": "[1.0.0, )", "Speckle.Newtonsoft.Json": "[13.0.2, )", + "Speckle.Sdk.Logging": "[1.0.0, )", "System.Text.Json": "[5.0.2, )" } }, - "speckle.logging": { + "speckle.sdk.logging": { "type": "Project" }, - "speckle.objects": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[1.0.0, )" - } - }, "GraphQL.Client": { "type": "CentralTransitive", "requested": "[6.0.0, )", diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Legacy/LegacyAPITests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Legacy/LegacyAPITests.cs similarity index 95% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Legacy/LegacyAPITests.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Legacy/LegacyAPITests.cs index fa2755b7..91a71776 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Legacy/LegacyAPITests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Legacy/LegacyAPITests.cs @@ -1,15 +1,23 @@ using Shouldly; -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL; -using Speckle.Core.Credentials; -using Speckle.Core.Models; -using Speckle.Core.Tests.Unit.Kits; -using Speckle.Core.Transports; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Tests.Unit.Host; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Tests.Integration.Api.GraphQL.Legacy; +namespace Speckle.Sdk.Tests.Integration.Api.GraphQL.Legacy; public class LegacyAPITests : IDisposable { + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(Point).Assembly); + } + private string _branchId = ""; private string _branchName = ""; private string _commitId = ""; @@ -28,8 +36,10 @@ public class LegacyAPITests : IDisposable private string _streamId = ""; [OneTimeSetUp] - public async Task Setup() + public async Task OneTimeSetup() { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly); _firstUserAccount = await Fixtures.SeedUser(); _secondUserAccount = await Fixtures.SeedUser(); diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Branches.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Branches.cs similarity index 88% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Branches.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Branches.cs index 2833a279..00fd0c68 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Branches.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Branches.cs @@ -1,8 +1,10 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.SubscriptionModels; -using Speckle.Core.Credentials; +using Speckle.Sdk.Api; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Tests.Unit.Host; -namespace Speckle.Core.Tests.Integration.Api.GraphQL.Legacy.Subscriptions; +namespace Speckle.Sdk.Tests.Integration.Api.GraphQL.Legacy.Subscriptions; public class Branches : IDisposable { @@ -14,8 +16,15 @@ public class Branches : IDisposable private string _streamId; private Account _testUserAccount; + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(Point).Assembly); + } + [OneTimeSetUp] - public async Task Setup() + public async Task OneTimeSetUp() { _testUserAccount = await Fixtures.SeedUser(); _client = new Client(_testUserAccount); diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Commits.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Commits.cs similarity index 90% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Commits.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Commits.cs index 7e25fad6..b2c7f1cc 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Commits.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Commits.cs @@ -1,11 +1,11 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.SubscriptionModels; -using Speckle.Core.Credentials; -using Speckle.Core.Models; -using Speckle.Core.Tests.Unit.Kits; -using Speckle.Core.Transports; +using Speckle.Sdk.Api; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Tests.Unit.Host; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Tests.Integration.Api.GraphQL.Legacy.Subscriptions; +namespace Speckle.Sdk.Tests.Integration.Api.GraphQL.Legacy.Subscriptions; public class Commits : IDisposable { @@ -18,8 +18,15 @@ public class Commits : IDisposable private string _streamId; private Account _testUserAccount; + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(Point).Assembly); + } + [OneTimeSetUp] - public async Task Setup() + public async Task OneTimeSetUp() { _testUserAccount = await Fixtures.SeedUser(); _client = new Client(_testUserAccount); diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Streams.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Streams.cs similarity index 86% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Streams.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Streams.cs index 457c2d6b..bec4bbee 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Streams.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Legacy/Subscriptions/Streams.cs @@ -1,8 +1,10 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.SubscriptionModels; -using Speckle.Core.Credentials; +using Speckle.Sdk.Api; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Tests.Unit.Host; -namespace Speckle.Core.Tests.Integration.Api.GraphQL.Legacy.Subscriptions; +namespace Speckle.Sdk.Tests.Integration.Api.GraphQL.Legacy.Subscriptions; public class Streams : IDisposable { @@ -14,8 +16,15 @@ public class Streams : IDisposable private StreamInfo _streamUpdatedInfo; private Account _testUserAccount; + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(Point).Assembly); + } + [OneTimeSetUp] - public async Task Setup() + public async Task OneTimeSetUp() { _testUserAccount = await Fixtures.SeedUser(); _client = new Client(_testUserAccount); diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ActiveUserResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ActiveUserResourceTests.cs similarity index 88% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ActiveUserResourceTests.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ActiveUserResourceTests.cs index 6615ac8e..4ae7c597 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ActiveUserResourceTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ActiveUserResourceTests.cs @@ -1,8 +1,8 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Resources; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Resources; -namespace Speckle.Core.Tests.Integration.API.GraphQL.Resources; +namespace Speckle.Sdk.Tests.Integration.API.GraphQL.Resources; [TestOf(typeof(ActiveUserResource))] public class ActiveUserResourceTests diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/CommentResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/CommentResourceTests.cs similarity index 93% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/CommentResourceTests.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/CommentResourceTests.cs index 2149bd8b..8399fb99 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/CommentResourceTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/CommentResourceTests.cs @@ -1,9 +1,9 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Resources; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Resources; -namespace Speckle.Core.Tests.Integration.API.GraphQL.Resources; +namespace Speckle.Sdk.Tests.Integration.API.GraphQL.Resources; [TestOf(typeof(CommentResource))] public class CommentResourceTests diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ModelResourceExceptionalTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceExceptionalTests.cs similarity index 90% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ModelResourceExceptionalTests.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceExceptionalTests.cs index 8fe43ba1..4025845e 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ModelResourceExceptionalTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceExceptionalTests.cs @@ -1,10 +1,10 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL.Enums; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Resources; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL.Enums; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Resources; -namespace Speckle.Core.Tests.Integration.API.GraphQL.Resources; +namespace Speckle.Sdk.Tests.Integration.API.GraphQL.Resources; [TestOf(typeof(ModelResource))] public class ModelResourceExceptionalTests diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ModelResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceTests.cs similarity index 93% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ModelResourceTests.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceTests.cs index e2995acf..814e4bd8 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ModelResourceTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ModelResourceTests.cs @@ -1,9 +1,9 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Resources; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Resources; -namespace Speckle.Core.Tests.Integration.API.GraphQL.Resources; +namespace Speckle.Sdk.Tests.Integration.API.GraphQL.Resources; [TestOf(typeof(ModelResource))] public class ModelResourceTests diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/OtherUserResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/OtherUserResourceTests.cs similarity index 87% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/OtherUserResourceTests.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/OtherUserResourceTests.cs index 3ba71a3c..6ac9818e 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/OtherUserResourceTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/OtherUserResourceTests.cs @@ -1,8 +1,8 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL.Resources; -using Speckle.Core.Credentials; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL.Resources; +using Speckle.Sdk.Credentials; -namespace Speckle.Core.Tests.Integration.API.GraphQL.Resources; +namespace Speckle.Sdk.Tests.Integration.API.GraphQL.Resources; [TestOf(typeof(OtherUserResource))] public class OtherUserResourceTests diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceExceptionalTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceExceptionalTests.cs similarity index 79% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceExceptionalTests.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceExceptionalTests.cs index b2cee38c..b74b0d45 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceExceptionalTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceExceptionalTests.cs @@ -1,9 +1,9 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Resources; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Resources; -namespace Speckle.Core.Tests.Integration.API.GraphQL.Resources; +namespace Speckle.Sdk.Tests.Integration.API.GraphQL.Resources; [TestOf(typeof(ProjectInviteResource))] public class ProjectInviteResourceExceptionalTests diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceTests.cs similarity index 93% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceTests.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceTests.cs index 4d2ff9b1..0a618d91 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectInviteResourceTests.cs @@ -1,10 +1,10 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Resources; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Resources; -namespace Speckle.Core.Tests.Integration.API.GraphQL.Resources; +namespace Speckle.Sdk.Tests.Integration.API.GraphQL.Resources; [TestOf(typeof(ProjectInviteResource))] public class ProjectInviteResourceTests diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs similarity index 92% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs index 47222b76..c616626c 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceExceptionalTests.cs @@ -1,11 +1,11 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL; -using Speckle.Core.Api.GraphQL.Enums; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Resources; - -namespace Speckle.Core.Tests.Integration.API.GraphQL.Resources; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL; +using Speckle.Sdk.Api.GraphQL.Enums; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Resources; + +namespace Speckle.Sdk.Tests.Integration.API.GraphQL.Resources; [TestOf(typeof(ProjectResource))] public class ProjectResourceExceptionalTests diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ProjectResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceTests.cs similarity index 90% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ProjectResourceTests.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceTests.cs index 66dcba0a..17755aa6 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/ProjectResourceTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/ProjectResourceTests.cs @@ -1,10 +1,10 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL.Enums; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Resources; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL.Enums; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Resources; -namespace Speckle.Core.Tests.Integration.API.GraphQL.Resources; +namespace Speckle.Sdk.Tests.Integration.API.GraphQL.Resources; [TestOf(typeof(ProjectResource))] public class ProjectResourceTests diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs similarity index 95% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs index d5ee196b..784f9ee6 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/SubscriptionResourceTests.cs @@ -1,9 +1,9 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Resources; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Resources; -namespace Speckle.Core.Tests.Integration.API.GraphQL.Resources; +namespace Speckle.Sdk.Tests.Integration.API.GraphQL.Resources; [TestOf(typeof(SubscriptionResource))] public class SubscriptionResourceTests diff --git a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/VersionResourceTests.cs b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/VersionResourceTests.cs similarity index 93% rename from tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/VersionResourceTests.cs rename to tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/VersionResourceTests.cs index 3afb0a0a..34c2b530 100644 --- a/tests/Speckle.Core.Tests.Integration/Api/GraphQL/Resources/VersionResourceTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Api/GraphQL/Resources/VersionResourceTests.cs @@ -1,10 +1,10 @@ -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Api.GraphQL.Resources; -using Version = Speckle.Core.Api.GraphQL.Models.Version; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Api.GraphQL.Resources; +using Version = Speckle.Sdk.Api.GraphQL.Models.Version; -namespace Speckle.Core.Tests.Integration.API.GraphQL.Resources; +namespace Speckle.Sdk.Tests.Integration.API.GraphQL.Resources; [TestOf(typeof(VersionResource))] public class VersionResourceTests diff --git a/tests/Speckle.Core.Tests.Integration/Credentials/UserServerInfoTests.cs b/tests/Speckle.Sdk.Tests.Integration/Credentials/UserServerInfoTests.cs similarity index 95% rename from tests/Speckle.Core.Tests.Integration/Credentials/UserServerInfoTests.cs rename to tests/Speckle.Sdk.Tests.Integration/Credentials/UserServerInfoTests.cs index 69095973..58aca532 100644 --- a/tests/Speckle.Core.Tests.Integration/Credentials/UserServerInfoTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Credentials/UserServerInfoTests.cs @@ -1,8 +1,8 @@ using GraphQL.Client.Http; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Credentials; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Credentials; -namespace Speckle.Core.Tests.Integration.Credentials; +namespace Speckle.Sdk.Tests.Integration.Credentials; public class UserServerInfoTests { diff --git a/tests/Speckle.Core.Tests.Integration/Fixtures.cs b/tests/Speckle.Sdk.Tests.Integration/Fixtures.cs similarity index 94% rename from tests/Speckle.Core.Tests.Integration/Fixtures.cs rename to tests/Speckle.Sdk.Tests.Integration/Fixtures.cs index c826946b..bbf02bed 100644 --- a/tests/Speckle.Core.Tests.Integration/Fixtures.cs +++ b/tests/Speckle.Sdk.Tests.Integration/Fixtures.cs @@ -3,15 +3,15 @@ using System.Text; using System.Web; using Newtonsoft.Json; -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL.Inputs; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Common; -using Speckle.Core.Credentials; -using Speckle.Core.Models; -using Speckle.Core.Transports; - -namespace Speckle.Core.Tests.Integration; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL.Inputs; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Common; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Models; +using Speckle.Sdk.Transports; + +namespace Speckle.Sdk.Tests.Integration; public static class Fixtures { diff --git a/tests/Speckle.Core.Tests.Integration/GraphQLCLient.cs b/tests/Speckle.Sdk.Tests.Integration/GraphQLCLient.cs similarity index 92% rename from tests/Speckle.Core.Tests.Integration/GraphQLCLient.cs rename to tests/Speckle.Sdk.Tests.Integration/GraphQLCLient.cs index 985aae17..1503c129 100644 --- a/tests/Speckle.Core.Tests.Integration/GraphQLCLient.cs +++ b/tests/Speckle.Sdk.Tests.Integration/GraphQLCLient.cs @@ -1,8 +1,8 @@ using GraphQL; -using Speckle.Core.Api; -using Speckle.Core.Credentials; +using Speckle.Sdk.Api; +using Speckle.Sdk.Credentials; -namespace Speckle.Core.Tests.Integration; +namespace Speckle.Sdk.Tests.Integration; public class GraphQLClientTests : IDisposable { diff --git a/tests/Speckle.Core.Tests.Integration/ServerTransportTests.cs b/tests/Speckle.Sdk.Tests.Integration/ServerTransportTests.cs similarity index 94% rename from tests/Speckle.Core.Tests.Integration/ServerTransportTests.cs rename to tests/Speckle.Sdk.Tests.Integration/ServerTransportTests.cs index 7254ab30..664e29d9 100644 --- a/tests/Speckle.Core.Tests.Integration/ServerTransportTests.cs +++ b/tests/Speckle.Sdk.Tests.Integration/ServerTransportTests.cs @@ -1,11 +1,13 @@ +using System.Reflection; using Shouldly; -using Speckle.Core.Api; -using Speckle.Core.Credentials; -using Speckle.Core.Helpers; -using Speckle.Core.Models; -using Speckle.Core.Transports; +using Speckle.Sdk.Api; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Host; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Models; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Tests.Integration; +namespace Speckle.Sdk.Tests.Integration; public class ServerTransportTests : IDisposable { @@ -36,6 +38,8 @@ public void Setup() // need to recreate the server transport object for each test // to make sure all folders are properly initialized _transport = new ServerTransport(_account, _streamId); + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, Assembly.GetExecutingAssembly()); } [TearDown] diff --git a/tests/Speckle.Core.Tests.Integration/Speckle.Core.Tests.Integration.csproj b/tests/Speckle.Sdk.Tests.Integration/Speckle.Sdk.Tests.Integration.csproj similarity index 77% rename from tests/Speckle.Core.Tests.Integration/Speckle.Core.Tests.Integration.csproj rename to tests/Speckle.Sdk.Tests.Integration/Speckle.Sdk.Tests.Integration.csproj index 770dec6d..5eb43529 100644 --- a/tests/Speckle.Core.Tests.Integration/Speckle.Core.Tests.Integration.csproj +++ b/tests/Speckle.Sdk.Tests.Integration/Speckle.Sdk.Tests.Integration.csproj @@ -15,8 +15,8 @@ - - + + diff --git a/tests/Speckle.Core.Tests.Integration/Usings.cs b/tests/Speckle.Sdk.Tests.Integration/Usings.cs similarity index 100% rename from tests/Speckle.Core.Tests.Integration/Usings.cs rename to tests/Speckle.Sdk.Tests.Integration/Usings.cs diff --git a/tests/Speckle.Core.Tests.Integration/packages.lock.json b/tests/Speckle.Sdk.Tests.Integration/packages.lock.json similarity index 96% rename from tests/Speckle.Core.Tests.Integration/packages.lock.json rename to tests/Speckle.Sdk.Tests.Integration/packages.lock.json index 6037c881..ce249d81 100644 --- a/tests/Speckle.Core.Tests.Integration/packages.lock.json +++ b/tests/Speckle.Sdk.Tests.Integration/packages.lock.json @@ -206,7 +206,7 @@ "resolved": "1.6.0", "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, - "speckle.core": { + "speckle.sdk": { "type": "Project", "dependencies": { "GraphQL.Client": "[6.0.0, )", @@ -216,33 +216,26 @@ "Polly.Contrib.WaitAndRetry": "[1.1.1, )", "Polly.Extensions.Http": "[3.0.0, )", "Speckle.DoubleNumerics": "[4.0.1, )", - "Speckle.Logging": "[1.0.0, )", "Speckle.Newtonsoft.Json": "[13.0.2, )", + "Speckle.Sdk.Logging": "[1.0.0, )", "System.Text.Json": "[5.0.2, )" } }, - "speckle.core.tests.unit": { + "speckle.sdk.logging": { + "type": "Project" + }, + "speckle.sdk.tests.unit": { "type": "Project", "dependencies": { "Microsoft.NET.Test.Sdk": "[17.10.0, )", "NUnit": "[4.1.0, )", "NUnit3TestAdapter": "[4.5.0, )", "Shouldly": "[4.2.1, )", - "Speckle.Core": "[1.0.0, )", "Speckle.DoubleNumerics": "[4.0.1, )", - "Speckle.Transports.Disk": "[1.0.0, )", + "Speckle.Sdk": "[1.0.0, )", "altcover": "[8.8.74, )" } }, - "speckle.logging": { - "type": "Project" - }, - "speckle.transports.disk": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[1.0.0, )" - } - }, "GraphQL.Client": { "type": "CentralTransitive", "requested": "[6.0.0, )", diff --git a/tests/Speckle.Core.Tests.Unit/Api/GraphQLClient.cs b/tests/Speckle.Sdk.Tests.Unit/Api/GraphQLClient.cs similarity index 95% rename from tests/Speckle.Core.Tests.Unit/Api/GraphQLClient.cs rename to tests/Speckle.Sdk.Tests.Unit/Api/GraphQLClient.cs index 9baadcac..535608a8 100644 --- a/tests/Speckle.Core.Tests.Unit/Api/GraphQLClient.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Api/GraphQLClient.cs @@ -1,11 +1,12 @@ using System.Diagnostics; using GraphQL; using NUnit.Framework; -using Speckle.Core.Api; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Credentials; +using Speckle.Sdk.Api; +using Speckle.Sdk.Api.GraphQL; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Credentials; -namespace Speckle.Core.Tests.Unit.Api; +namespace Speckle.Sdk.Tests.Unit.Api; [TestOf(typeof(Client))] public sealed class GraphQLClientTests : IDisposable diff --git a/tests/Speckle.Core.Tests.Unit/Api/HelpersTests.cs b/tests/Speckle.Sdk.Tests.Unit/Api/HelpersTests.cs similarity index 87% rename from tests/Speckle.Core.Tests.Unit/Api/HelpersTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Api/HelpersTests.cs index 78c44cda..2ae8fa95 100644 --- a/tests/Speckle.Core.Tests.Unit/Api/HelpersTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Api/HelpersTests.cs @@ -1,9 +1,9 @@ using NUnit.Framework; -namespace Speckle.Core.Tests.Unit.Api; +namespace Speckle.Sdk.Tests.Unit.Api; [TestFixture] -[TestOf(typeof(Speckle.Core.Api.Helpers))] +[TestOf(typeof(Sdk.Api.Helpers))] public class HelpersTests { [Test] @@ -28,7 +28,7 @@ public void TimeAgo_DisplaysTextCorrectly(int secondsAgo, string expectedText) dateTime = dateTime.Subtract(new TimeSpan(0, 0, secondsAgo)); // Get the timeAgo text representation - var actual = Speckle.Core.Api.Helpers.TimeAgo(dateTime); + var actual = Sdk.Api.Helpers.TimeAgo(dateTime); Assert.That(actual, Is.EqualTo(expectedText)); } diff --git a/tests/Speckle.Core.Tests.Unit/Api/Operations/ClosureTests.cs b/tests/Speckle.Sdk.Tests.Unit/Api/Operations/ClosureTests.cs similarity index 86% rename from tests/Speckle.Core.Tests.Unit/Api/Operations/ClosureTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Api/Operations/ClosureTests.cs index 74e42a42..11d8f282 100644 --- a/tests/Speckle.Core.Tests.Unit/Api/Operations/ClosureTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Api/Operations/ClosureTests.cs @@ -1,16 +1,24 @@ using Newtonsoft.Json; using NUnit.Framework; -using Speckle.Core.Common; -using Speckle.Core.Models; -using Speckle.Core.Tests.Unit.Kits; -using Speckle.Core.Transports; +using Speckle.Sdk.Common; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Tests.Unit.Host; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Tests.Unit.Api.Operations; +namespace Speckle.Sdk.Tests.Unit.Api.Operations; [TestFixture] -[TestOf(typeof(Core.Api.Operations))] +[TestOf(typeof(Sdk.Api.Operations))] public class Closures { + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(TableLegFixture).Assembly); + } + [Test(Description = "Checks whether closures are generated correctly by the serialiser.")] public void CorrectDecompositionTracking() { @@ -37,9 +45,9 @@ public void CorrectDecompositionTracking() var transport = new MemoryTransport(); - var result = Core.Api.Operations.Send(d1, transport, false).Result; + var result = Sdk.Api.Operations.Send(d1, transport, false).Result; - var test = Core.Api.Operations.Receive(result, localTransport: transport).Result; + var test = Sdk.Api.Operations.Receive(result, localTransport: transport).Result; test.id.NotNull(); Assert.That(d1.GetId(true), Is.EqualTo(test.id)); diff --git a/tests/Speckle.Core.Tests.Unit/Api/Operations/OperationsReceiveTests.Exceptional.cs b/tests/Speckle.Sdk.Tests.Unit/Api/Operations/OperationsReceiveTests.Exceptional.cs similarity index 72% rename from tests/Speckle.Core.Tests.Unit/Api/Operations/OperationsReceiveTests.Exceptional.cs rename to tests/Speckle.Sdk.Tests.Unit/Api/Operations/OperationsReceiveTests.Exceptional.cs index 844d20c2..3acafdd7 100644 --- a/tests/Speckle.Core.Tests.Unit/Api/Operations/OperationsReceiveTests.Exceptional.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Api/Operations/OperationsReceiveTests.Exceptional.cs @@ -1,7 +1,7 @@ using NUnit.Framework; -using Speckle.Core.Transports; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Tests.Unit.Api.Operations; +namespace Speckle.Sdk.Tests.Unit.Api.Operations; public partial class OperationsReceiveTests { @@ -12,7 +12,7 @@ public void Receive_ObjectsDontExist_ExceptionThrown(string id) MemoryTransport emptyTransport2 = new(); Assert.ThrowsAsync(async () => { - await Core.Api.Operations.Receive(id, emptyTransport1, emptyTransport2); + await Sdk.Api.Operations.Receive(id, emptyTransport1, emptyTransport2); }); } @@ -22,7 +22,7 @@ public void Receive_ObjectsDontExistNullRemote_ExceptionThrown(string id) MemoryTransport emptyTransport = new(); Assert.ThrowsAsync(async () => { - await Core.Api.Operations.Receive(id, null, emptyTransport); + await Sdk.Api.Operations.Receive(id, null, emptyTransport); }); } @@ -35,7 +35,7 @@ public void Receive_OperationCanceled_ExceptionThrown(string id) MemoryTransport emptyTransport2 = new(); Assert.CatchAsync(async () => { - await Core.Api.Operations.Receive(id, _testCaseTransport, emptyTransport2, cancellationToken: ctc.Token); + await Sdk.Api.Operations.Receive(id, _testCaseTransport, emptyTransport2, cancellationToken: ctc.Token); }); } } diff --git a/tests/Speckle.Core.Tests.Unit/Api/Operations/OperationsReceiveTests.cs b/tests/Speckle.Sdk.Tests.Unit/Api/Operations/OperationsReceiveTests.cs similarity index 71% rename from tests/Speckle.Core.Tests.Unit/Api/Operations/OperationsReceiveTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Api/Operations/OperationsReceiveTests.cs index 858a8cca..973a5667 100644 --- a/tests/Speckle.Core.Tests.Unit/Api/Operations/OperationsReceiveTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Api/Operations/OperationsReceiveTests.cs @@ -1,12 +1,19 @@ using NUnit.Framework; -using Speckle.Core.Models; -using Speckle.Core.Transports; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Tests.Unit.Api.Operations; +namespace Speckle.Sdk.Tests.Unit.Api.Operations; -[TestFixture, TestOf(nameof(Core.Api.Operations.Receive))] +[TestFixture, TestOf(nameof(Sdk.Api.Operations.Receive))] public sealed partial class OperationsReceiveTests { + static OperationsReceiveTests() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly); + } + public static IEnumerable TestCases => s_testObjects.Select(x => x.GetId(true)); private static readonly Base[] s_testObjects = @@ -25,17 +32,19 @@ public sealed partial class OperationsReceiveTests [OneTimeSetUp] public async Task GlobalSetup() { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly); _testCaseTransport = new MemoryTransport(); foreach (var b in s_testObjects) { - await Core.Api.Operations.Send(b, _testCaseTransport, false); + await Sdk.Api.Operations.Send(b, _testCaseTransport, false); } } [Test, TestCaseSource(nameof(TestCases))] public async Task Receive_FromLocal_ExistingObjects(string id) { - Base result = await Core.Api.Operations.Receive(id, null, _testCaseTransport); + Base result = await Sdk.Api.Operations.Receive(id, null, _testCaseTransport); Assert.That(result.id, Is.EqualTo(id)); } @@ -44,7 +53,7 @@ public async Task Receive_FromLocal_ExistingObjects(string id) public async Task Receive_FromRemote_ExistingObjects(string id) { MemoryTransport localTransport = new(); - Base result = await Core.Api.Operations.Receive(id, _testCaseTransport, localTransport); + Base result = await Sdk.Api.Operations.Receive(id, _testCaseTransport, localTransport); Assert.That(result.id, Is.EqualTo(id)); } @@ -53,7 +62,7 @@ public async Task Receive_FromRemote_ExistingObjects(string id) public async Task Receive_FromLocal_OnProgressActionCalled(string id) { bool wasCalled = false; - _ = await Core.Api.Operations.Receive(id, null, _testCaseTransport, onProgressAction: _ => wasCalled = true); + _ = await Sdk.Api.Operations.Receive(id, null, _testCaseTransport, onProgressAction: _ => wasCalled = true); Assert.That(wasCalled, Is.True); } @@ -63,7 +72,7 @@ public async Task Receive_FromLocal_OnTotalChildrenCountKnownCalled(string id) { bool wasCalled = false; int children = 0; - var result = await Core.Api.Operations.Receive( + var result = await Sdk.Api.Operations.Receive( id, null, _testCaseTransport, diff --git a/tests/Speckle.Core.Tests.Unit/Api/Operations/SendReceiveLocal.cs b/tests/Speckle.Sdk.Tests.Unit/Api/Operations/SendReceiveLocal.cs similarity index 80% rename from tests/Speckle.Core.Tests.Unit/Api/Operations/SendReceiveLocal.cs rename to tests/Speckle.Sdk.Tests.Unit/Api/Operations/SendReceiveLocal.cs index 64ca09ac..eaa074ef 100644 --- a/tests/Speckle.Core.Tests.Unit/Api/Operations/SendReceiveLocal.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Api/Operations/SendReceiveLocal.cs @@ -1,24 +1,32 @@ using System.Collections.Concurrent; using NUnit.Framework; -using Speckle.Core.Common; -using Speckle.Core.Models; -using Speckle.Core.Tests.Unit.Kits; -using Speckle.Core.Transports; +using Speckle.Sdk.Common; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Tests.Unit.Host; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Tests.Unit.Api.Operations; +namespace Speckle.Sdk.Tests.Unit.Api.Operations; [TestFixture] public sealed class SendReceiveLocal : IDisposable { - private string _objId01, - _commitId02; + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(Point).Assembly); + } + + private string? _objId01; + private string? _commitId02; private const int NUM_OBJECTS = 3001; private readonly SQLiteTransport _sut = new(); [Test(Description = "Pushing a commit locally"), Order(1)] - public void LocalUpload() + public async Task LocalUpload() { var myObject = new Base(); var rand = new Random(); @@ -33,23 +41,23 @@ public void LocalUpload() } using SQLiteTransport localTransport = new(); - _objId01 = Core.Api.Operations.Send(myObject, localTransport, false).Result; + _objId01 = await Sdk.Api.Operations.Send(myObject, localTransport, false); Assert.That(_objId01, Is.Not.Null); TestContext.Out.WriteLine($"Written {NUM_OBJECTS + 1} objects. Commit id is {_objId01}"); } [Test(Description = "Pulling a commit locally"), Order(2)] - public void LocalDownload() + public async Task LocalDownload() { - var commitPulled = Core.Api.Operations.Receive(_objId01).Result; + var commitPulled = await Sdk.Api.Operations.Receive(_objId01!); Assert.That(((List)commitPulled["@items"].NotNull())[0], Is.TypeOf()); Assert.That(((List)commitPulled["@items"].NotNull()), Has.Count.EqualTo(NUM_OBJECTS)); } [Test(Description = "Pushing and Pulling a commit locally")] - public void LocalUploadDownload() + public async Task LocalUploadDownload() { var myObject = new Base(); myObject["@items"] = new List(); @@ -63,9 +71,9 @@ public void LocalUploadDownload() ); } - _objId01 = Core.Api.Operations.Send(myObject, _sut, false).Result; + _objId01 = await Sdk.Api.Operations.Send(myObject, _sut, false); - var commitPulled = Core.Api.Operations.Receive(_objId01).Result; + var commitPulled = await Sdk.Api.Operations.Receive(_objId01); List items = (List)commitPulled["@items"].NotNull(); Assert.That(items, Has.All.TypeOf()); @@ -87,12 +95,12 @@ public async Task LocalUploadDownloadSmall() ); } - _objId01 = await Core.Api.Operations.Send(myObject, _sut, false); + _objId01 = await Sdk.Api.Operations.Send(myObject, _sut, false); Assert.That(_objId01, Is.Not.Null); TestContext.Out.WriteLine($"Written {NUM_OBJECTS + 1} objects. Commit id is {_objId01}"); - var objsPulled = await Core.Api.Operations.Receive(_objId01); + var objsPulled = await Sdk.Api.Operations.Receive(_objId01); Assert.That(((List)objsPulled["@items"].NotNull()), Has.Count.EqualTo(30)); } @@ -111,11 +119,11 @@ public async Task LocalUploadDownloadListDic() myObject["@dictionary"] = myDic; myObject["@list"] = myList; - _objId01 = await Core.Api.Operations.Send(myObject, _sut, false); + _objId01 = await Sdk.Api.Operations.Send(myObject, _sut, false); Assert.That(_objId01, Is.Not.Null); - var objsPulled = await Core.Api.Operations.Receive(_objId01); + var objsPulled = await Sdk.Api.Operations.Receive(_objId01); Assert.That( ((List)((Dictionary)objsPulled["@dictionary"].NotNull())["a"]).First(), Is.EqualTo(1) @@ -149,12 +157,12 @@ public async Task UploadDownloadNonCommitObject() ((List)((dynamic)obj)["@LayerC"]).Add(new Point(i, i, i + rand.NextDouble()) { applicationId = i + "baz" }); } - _objId01 = await Core.Api.Operations.Send(obj, _sut, false); + _objId01 = await Sdk.Api.Operations.Send(obj, _sut, false); Assert.That(_objId01, Is.Not.Null); TestContext.Out.WriteLine($"Written {NUM_OBJECTS + 1} objects. Commit id is {_objId01}"); - var objPulled = await Core.Api.Operations.Receive(_objId01); + var objPulled = await Sdk.Api.Operations.Receive(_objId01); Assert.That(objPulled, Is.TypeOf()); @@ -187,7 +195,7 @@ public async Task UploadProgressReports() } ConcurrentDictionary? progress = null; - _commitId02 = await Core.Api.Operations.Send( + _commitId02 = await Sdk.Api.Operations.Send( myObject, _sut, false, @@ -204,8 +212,8 @@ public async Task UploadProgressReports() public async Task DownloadProgressReports() { ConcurrentDictionary? progress = null; - var pulledCommit = await Core.Api.Operations.Receive( - _commitId02, + var pulledCommit = await Sdk.Api.Operations.Receive( + _commitId02!, onProgressAction: dict => { progress = dict; @@ -222,11 +230,11 @@ public async Task ShouldNotDisposeTransports() @base["test"] = "the best"; SQLiteTransport myLocalTransport = new(); - var id = await Core.Api.Operations.Send(@base, myLocalTransport, false); - await Core.Api.Operations.Send(@base, myLocalTransport, false); + var id = await Sdk.Api.Operations.Send(@base, myLocalTransport, false); + await Sdk.Api.Operations.Send(@base, myLocalTransport, false); - _ = await Core.Api.Operations.Receive(id, null, myLocalTransport); - await Core.Api.Operations.Receive(id, null, myLocalTransport); + _ = await Sdk.Api.Operations.Receive(id, null, myLocalTransport); + await Sdk.Api.Operations.Receive(id, null, myLocalTransport); } //[Test] @@ -243,7 +251,7 @@ public async Task ShouldNotDisposeTransports() // ((List)myObject["@items"]).Add(new Point(i, i, i) { applicationId = i + "-___/---" }); // } - // var dt = new Speckle.Core.Transports.Speckle.Speckle.Core.Transports(); + // var dt = new Speckle.Sdk.Transports.Speckle.Speckle.Sdk.Transports(); // var id = await Operations.Send(myObject, new List() { dt }, false); // Assert.IsNotNull(id); diff --git a/tests/Speckle.Core.Tests.Unit/Api/Operations/SerializationTests.cs b/tests/Speckle.Sdk.Tests.Unit/Api/Operations/SerializationTests.cs similarity index 70% rename from tests/Speckle.Core.Tests.Unit/Api/Operations/SerializationTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Api/Operations/SerializationTests.cs index 5c29d76e..ff0a50ab 100644 --- a/tests/Speckle.Core.Tests.Unit/Api/Operations/SerializationTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Api/Operations/SerializationTests.cs @@ -1,23 +1,31 @@ using System.Drawing; using NUnit.Framework; -using Speckle.Core.Models; -using Speckle.Core.Tests.Unit.Kits; -using Point = Speckle.Core.Tests.Unit.Kits.Point; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Tests.Unit.Host; +using Point = Speckle.Sdk.Tests.Unit.Host.Point; -namespace Speckle.Core.Tests.Unit.Api.Operations; +namespace Speckle.Sdk.Tests.Unit.Api.Operations; [TestFixture] -[TestOf(typeof(Core.Api.Operations))] +[TestOf(typeof(Sdk.Api.Operations))] public class ObjectSerialization { + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(DataChunk).Assembly, typeof(ColorMock).Assembly); + } + [Test] public void SimpleSerialization() { var table = new DiningTable(); ((dynamic)table)["@strangeVariable_NAme3"] = new TableLegFixture(); - var result = Core.Api.Operations.Serialize(table); - var test = Core.Api.Operations.Deserialize(result); + var result = Sdk.Api.Operations.Serialize(table); + var test = Sdk.Api.Operations.Deserialize(result); Assert.That(table.GetId(), Is.EqualTo(test.GetId())); @@ -27,8 +35,8 @@ public void SimpleSerialization() polyline.Points.Add(new Point { X = i * 2, Y = i % 2 }); } - var strPoly = Core.Api.Operations.Serialize(polyline); - var dePoly = Core.Api.Operations.Deserialize(strPoly); + var strPoly = Sdk.Api.Operations.Serialize(polyline); + var dePoly = Sdk.Api.Operations.Deserialize(strPoly); Assert.That(dePoly.GetId(), Is.EqualTo(polyline.GetId())); } @@ -39,9 +47,9 @@ public void IgnoreCircularReferences() var pt = new Point(1, 2, 3); pt["circle"] = pt; - var test = Core.Api.Operations.Serialize(pt); + var test = Sdk.Api.Operations.Serialize(pt); - var result = Core.Api.Operations.Deserialize(test); + var result = Sdk.Api.Operations.Deserialize(test); var circle = result["circle"]; Assert.That(circle, Is.Null); } @@ -78,9 +86,9 @@ public void InterfacePropHandling() cat.Fur[i] = new Line { Start = new Point(i, i, i), End = new Point(i + 3.14, i + 3.14, i + 3.14) }; } - var result = Core.Api.Operations.Serialize(cat); + var result = Sdk.Api.Operations.Serialize(cat); - var deserialisedFeline = Core.Api.Operations.Deserialize(result); + var deserialisedFeline = Sdk.Api.Operations.Deserialize(result); Assert.That(deserialisedFeline.GetId(), Is.EqualTo(cat.GetId())); // If we're getting the same hash... we're probably fine! } @@ -96,8 +104,8 @@ public void InheritanceTests() W = 42 }; - var str = Core.Api.Operations.Serialize(superPoint); - var sstr = Core.Api.Operations.Deserialize(str); + var str = Sdk.Api.Operations.Serialize(superPoint); + var sstr = Sdk.Api.Operations.Deserialize(str); Assert.That(sstr.speckle_type, Is.EqualTo(superPoint.speckle_type)); } @@ -115,8 +123,8 @@ public void ListDynamicProp() point["test"] = test; - var str = Core.Api.Operations.Serialize(point); - var dsrls = Core.Api.Operations.Deserialize(str); + var str = Sdk.Api.Operations.Serialize(point); + var dsrls = Sdk.Api.Operations.Deserialize(str); var list = dsrls["test"] as List; // NOTE: on dynamically added lists, we cannot infer the inner type and we always fall back to a generic list. Assert.That(list, Has.Count.EqualTo(100)); @@ -143,13 +151,13 @@ public void ChunkSerialisation() doubleBasedChunk.data.Add(i + 0.33); } - var baseChunkString = Core.Api.Operations.Serialize(baseBasedChunk); - var stringChunkString = Core.Api.Operations.Serialize(stringBasedChunk); - var doubleChunkString = Core.Api.Operations.Serialize(doubleBasedChunk); + var baseChunkString = Sdk.Api.Operations.Serialize(baseBasedChunk); + var stringChunkString = Sdk.Api.Operations.Serialize(stringBasedChunk); + var doubleChunkString = Sdk.Api.Operations.Serialize(doubleBasedChunk); - var baseChunkDeserialised = (DataChunk)Core.Api.Operations.Deserialize(baseChunkString); - var stringChunkDeserialised = (DataChunk)Core.Api.Operations.Deserialize(stringChunkString); - var doubleChunkDeserialised = (DataChunk)Core.Api.Operations.Deserialize(doubleChunkString); + var baseChunkDeserialised = (DataChunk)Sdk.Api.Operations.Deserialize(baseChunkString); + var stringChunkDeserialised = (DataChunk)Sdk.Api.Operations.Deserialize(stringChunkString); + var doubleChunkDeserialised = (DataChunk)Sdk.Api.Operations.Deserialize(doubleChunkString); Assert.That(baseChunkDeserialised.data, Has.Count.EqualTo(baseBasedChunk.data.Count)); Assert.That(stringChunkDeserialised.data, Has.Count.EqualTo(stringBasedChunk.data.Count)); @@ -178,8 +186,8 @@ public void ObjectWithChunksSerialisation() mesh["@(800)CustomChunk"] = customChunk; mesh["@()DefaultChunk"] = defaultChunk; - var serialised = Core.Api.Operations.Serialize(mesh); - var deserialised = Core.Api.Operations.Deserialize(serialised); + var serialised = Sdk.Api.Operations.Serialize(mesh); + var deserialised = Sdk.Api.Operations.Deserialize(serialised); Assert.That(mesh.GetId(), Is.EqualTo(deserialised.GetId())); } @@ -199,7 +207,7 @@ public void EmptyListSerialisationTests() test["nestedList"] = new List { new List { new List() } }; test["@nestedDetachableList"] = new List { new List { new List() } }; - var serialised = Core.Api.Operations.Serialize(test); + var serialised = Sdk.Api.Operations.Serialize(test); var isCorrect = serialised.Contains("\"@(5)emptyChunks\":[]") && serialised.Contains("\"emptyList\":[]") @@ -210,6 +218,7 @@ public void EmptyListSerialisationTests() Assert.That(isCorrect, Is.EqualTo(true)); } + [SpeckleType("Speckle.Core.Tests.Unit.Api.Operations.ObjectSerialization+DateMock")] private class DateMock : Base { public DateTime TestField { get; set; } @@ -221,12 +230,13 @@ public void DateSerialisation() var date = new DateTime(2020, 1, 14); var mockBase = new DateMock { TestField = date }; - var result = Core.Api.Operations.Serialize(mockBase); - var test = (DateMock)Core.Api.Operations.Deserialize(result); + var result = Sdk.Api.Operations.Serialize(mockBase); + var test = (DateMock)Sdk.Api.Operations.Deserialize(result); Assert.That(test.TestField, Is.EqualTo(date)); } + [SpeckleType("Speckle.Core.Tests.Unit.Api.Operations.ObjectSerialization+GUIDMock")] private class GUIDMock : Base { public Guid TestField { get; set; } @@ -238,12 +248,13 @@ public void GuidSerialisation() var guid = Guid.NewGuid(); var mockBase = new GUIDMock { TestField = guid }; - var result = Core.Api.Operations.Serialize(mockBase); - var test = (GUIDMock)Core.Api.Operations.Deserialize(result); + var result = Sdk.Api.Operations.Serialize(mockBase); + var test = (GUIDMock)Sdk.Api.Operations.Deserialize(result); Assert.That(test.TestField, Is.EqualTo(guid)); } + [SpeckleType("Speckle.Core.Tests.Unit.Api.Operations.ObjectSerialization+ColorMock")] private class ColorMock : Base { public Color TestField { get; set; } @@ -255,12 +266,13 @@ public void ColorSerialisation() var color = Color.FromArgb(255, 4, 126, 251); var mockBase = new ColorMock { TestField = color }; - var result = Core.Api.Operations.Serialize(mockBase); - var test = (ColorMock)Core.Api.Operations.Deserialize(result); + var result = Sdk.Api.Operations.Serialize(mockBase); + var test = (ColorMock)Sdk.Api.Operations.Deserialize(result); Assert.That(test.TestField, Is.EqualTo(color)); } + [SpeckleType("Speckle.Core.Tests.Unit.Api.Operations.ObjectSerialization+StringDateTimeRegressionMock")] private class StringDateTimeRegressionMock : Base { public string TestField { get; set; } @@ -271,8 +283,8 @@ public void StringDateTimeRegression() { var mockBase = new StringDateTimeRegressionMock { TestField = "2021-11-12T11:32:01" }; - var result = Core.Api.Operations.Serialize(mockBase); - var test = (StringDateTimeRegressionMock)Core.Api.Operations.Deserialize(result); + var result = Sdk.Api.Operations.Serialize(mockBase); + var test = (StringDateTimeRegressionMock)Sdk.Api.Operations.Deserialize(result); Assert.That(test.TestField, Is.EqualTo(mockBase.TestField)); } diff --git a/tests/Speckle.Core.Tests.Unit/Common/NotNullTests.cs b/tests/Speckle.Sdk.Tests.Unit/Common/NotNullTests.cs similarity index 95% rename from tests/Speckle.Core.Tests.Unit/Common/NotNullTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Common/NotNullTests.cs index 925a4eac..680cf666 100644 --- a/tests/Speckle.Core.Tests.Unit/Common/NotNullTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Common/NotNullTests.cs @@ -1,8 +1,8 @@ using NUnit.Framework; using Shouldly; -using Speckle.Core.Common; +using Speckle.Sdk.Common; -namespace Speckle.Core.Tests.Unit.Common; +namespace Speckle.Sdk.Tests.Unit.Common; public class NotNullTests { diff --git a/tests/Speckle.Core.Tests.Unit/Credentials/AccountServerMigrationTests.cs b/tests/Speckle.Sdk.Tests.Unit/Credentials/AccountServerMigrationTests.cs similarity index 95% rename from tests/Speckle.Core.Tests.Unit/Credentials/AccountServerMigrationTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Credentials/AccountServerMigrationTests.cs index 4ef401ad..6f153240 100644 --- a/tests/Speckle.Core.Tests.Unit/Credentials/AccountServerMigrationTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Credentials/AccountServerMigrationTests.cs @@ -1,8 +1,8 @@ using NUnit.Framework; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Credentials; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Credentials; -namespace Speckle.Core.Tests.Unit.Credentials; +namespace Speckle.Sdk.Tests.Unit.Credentials; public class AccountServerMigrationTests { diff --git a/tests/Speckle.Core.Tests.Unit/Credentials/Accounts.cs b/tests/Speckle.Sdk.Tests.Unit/Credentials/Accounts.cs similarity index 96% rename from tests/Speckle.Core.Tests.Unit/Credentials/Accounts.cs rename to tests/Speckle.Sdk.Tests.Unit/Credentials/Accounts.cs index 4ac91d47..fafa8808 100644 --- a/tests/Speckle.Core.Tests.Unit/Credentials/Accounts.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Credentials/Accounts.cs @@ -1,8 +1,8 @@ using NUnit.Framework; -using Speckle.Core.Api.GraphQL.Models; -using Speckle.Core.Credentials; +using Speckle.Sdk.Api.GraphQL.Models; +using Speckle.Sdk.Credentials; -namespace Speckle.Core.Tests.Unit.Credentials; +namespace Speckle.Sdk.Tests.Unit.Credentials; [TestFixture] public class CredentialInfrastructure diff --git a/tests/Speckle.Core.Tests.Unit/Credentials/FE2WrapperTests.cs b/tests/Speckle.Sdk.Tests.Unit/Credentials/FE2WrapperTests.cs similarity index 95% rename from tests/Speckle.Core.Tests.Unit/Credentials/FE2WrapperTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Credentials/FE2WrapperTests.cs index d09c9fa3..cd7bba65 100644 --- a/tests/Speckle.Core.Tests.Unit/Credentials/FE2WrapperTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Credentials/FE2WrapperTests.cs @@ -1,8 +1,8 @@ using NUnit.Framework; -using Speckle.Core.Credentials; -using Speckle.Core.Logging; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Tests.Unit.Credentials; +namespace Speckle.Sdk.Tests.Unit.Credentials; [TestFixture] [TestOf(typeof(StreamWrapper))] diff --git a/tests/Speckle.Core.Tests.Unit/Credentials/StreamWrapperTests.cs b/tests/Speckle.Sdk.Tests.Unit/Credentials/StreamWrapperTests.cs similarity index 97% rename from tests/Speckle.Core.Tests.Unit/Credentials/StreamWrapperTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Credentials/StreamWrapperTests.cs index e2f5f232..c16784c7 100644 --- a/tests/Speckle.Core.Tests.Unit/Credentials/StreamWrapperTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Credentials/StreamWrapperTests.cs @@ -1,7 +1,7 @@ using NUnit.Framework; -using Speckle.Core.Credentials; +using Speckle.Sdk.Credentials; -namespace Speckle.Core.Tests.Unit.Credentials; +namespace Speckle.Sdk.Tests.Unit.Credentials; [TestFixture] [TestOf(typeof(StreamWrapper))] diff --git a/tests/Speckle.Core.Tests.Unit/Fixtures.cs b/tests/Speckle.Sdk.Tests.Unit/Fixtures.cs similarity index 83% rename from tests/Speckle.Core.Tests.Unit/Fixtures.cs rename to tests/Speckle.Sdk.Tests.Unit/Fixtures.cs index 3e209688..d5a018fe 100644 --- a/tests/Speckle.Core.Tests.Unit/Fixtures.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Fixtures.cs @@ -1,11 +1,9 @@ using Newtonsoft.Json; -using NUnit.Framework; -using Speckle.Core.Credentials; -using Speckle.Core.Helpers; -using Speckle.Core.Logging; -using Speckle.Core.Transports; +using Speckle.Sdk.Credentials; +using Speckle.Sdk.Logging; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Tests.Unit; +namespace Speckle.Sdk.Tests.Unit; public abstract class Fixtures { diff --git a/tests/Speckle.Core.Tests.Unit/Helpers/Path.cs b/tests/Speckle.Sdk.Tests.Unit/Helpers/Path.cs similarity index 97% rename from tests/Speckle.Core.Tests.Unit/Helpers/Path.cs rename to tests/Speckle.Sdk.Tests.Unit/Helpers/Path.cs index 7878ab51..f3e9bd2b 100644 --- a/tests/Speckle.Core.Tests.Unit/Helpers/Path.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Helpers/Path.cs @@ -1,8 +1,8 @@ using System.Runtime.InteropServices; using NUnit.Framework; -using Speckle.Core.Helpers; +using Speckle.Sdk.Logging; -namespace Speckle.Core.Tests.Unit.Helpers; +namespace Speckle.Sdk.Tests.Unit.Helpers; [TestFixture] [TestOf(nameof(SpecklePathProvider))] diff --git a/tests/Speckle.Core.Tests.Unit/Kits/HostApplicationTests.cs b/tests/Speckle.Sdk.Tests.Unit/Host/HostApplicationTests.cs similarity index 87% rename from tests/Speckle.Core.Tests.Unit/Kits/HostApplicationTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Host/HostApplicationTests.cs index 9387c3b6..18379b05 100644 --- a/tests/Speckle.Core.Tests.Unit/Kits/HostApplicationTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Host/HostApplicationTests.cs @@ -1,8 +1,8 @@ using NUnit.Framework; using Shouldly; -using Speckle.Core.Kits; +using Speckle.Sdk.Host; -namespace Speckle.Core.Tests.Unit.Kits; +namespace Speckle.Sdk.Tests.Unit.Host; public class HostApplicationTests { diff --git a/tests/Speckle.Core.Tests.Unit/Kits/TestKit.cs b/tests/Speckle.Sdk.Tests.Unit/Host/TestKit.cs similarity index 82% rename from tests/Speckle.Core.Tests.Unit/Kits/TestKit.cs rename to tests/Speckle.Sdk.Tests.Unit/Host/TestKit.cs index 1f54f7dd..4bdf2e89 100644 --- a/tests/Speckle.Core.Tests.Unit/Kits/TestKit.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Host/TestKit.cs @@ -1,32 +1,9 @@ using Newtonsoft.Json; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Speckle.Core.Tests.Unit.Kits; - -/// -/// Simple speckle kit (no conversions) used in tests. -/// -public class TestKit : ISpeckleKit -{ - public IEnumerable Types => GetType().Assembly.GetTypes().Where(type => type.IsSubclassOf(typeof(Base))); - - public string Description => "Simple object model for with some types for tests."; - - public string Name => nameof(TestKit); - - public string Author => "Dimitrie"; - - public string WebsiteOrEmail => "hello@Speckle.Core.works"; - - public IEnumerable Converters => new List(); - - public ISpeckleConverter LoadConverter(string app) - { - throw new KitException("This is the test kit"); - } -} +namespace Speckle.Sdk.Tests.Unit.Host; +[SpeckleType("Speckle.Core.Tests.Unit.Kits.FakeMesh")] public class FakeMesh : Base { [DetachProperty, Chunkable] @@ -42,6 +19,7 @@ public class FakeMesh : Base public List Tables { get; set; } = new(); } +[SpeckleType("Speckle.Core.Tests.Unit.Kits.DiningTable")] public class DiningTable : Base { public DiningTable() @@ -75,6 +53,7 @@ public DiningTable() public string TableModel { get; set; } = "Sample Table"; } +[SpeckleType("Speckle.Core.Tests.Unit.Kits.Tabletop")] public class Tabletop : Base { public double length { get; set; } @@ -82,6 +61,7 @@ public class Tabletop : Base public double thickness { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Kits.TableLeg")] public class TableLeg : Base { public double height { get; set; } @@ -91,11 +71,13 @@ public class TableLeg : Base public TableLegFixture fixture { get; set; } = new(); } +[SpeckleType("Speckle.Core.Tests.Unit.Kits.TableLegFixture")] public class TableLegFixture : Base { public string nails { get; set; } = "MANY NAILS WOW "; } +[SpeckleType("Speckle.Core.Tests.Unit.Kits.Point")] public class Point : Base { public Point() { } @@ -112,11 +94,13 @@ public Point(double x, double y, double z) public double Z { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Kits.SuperPoint")] public class SuperPoint : Point { public double W { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Kits.Mesh")] public class Mesh : Base { public List Faces = new(); @@ -145,6 +129,7 @@ public interface ICurve /// /// Store individual points in a list structure for developer ergonomics. Nevertheless, for performance reasons (hashing, serialisation and storage) expose the same list of points as a typed array. /// +[SpeckleType("Speckle.Core.Tests.Unit.Kits.Polyline")] public class Polyline : Base, ICurve { [JsonIgnore] @@ -163,6 +148,7 @@ public List Vertices } } +[SpeckleType("Speckle.Core.Tests.Unit.Kits.Line")] public class Line : Base, ICurve { public Point Start { get; set; } @@ -172,6 +158,7 @@ public class Line : Base, ICurve /// /// This class exists to purely test some weird cases in which Intefaces might trash serialisation. /// +[SpeckleType("Speckle.Core.Tests.Unit.Kits.PolygonalFeline")] public class PolygonalFeline : Base { public List Whiskers { get; set; } = new(); diff --git a/tests/Speckle.Core.Tests.Unit/Models/BaseTests.cs b/tests/Speckle.Sdk.Tests.Unit/Models/BaseTests.cs similarity index 94% rename from tests/Speckle.Core.Tests.Unit/Models/BaseTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Models/BaseTests.cs index d5a1e014..5eed8698 100644 --- a/tests/Speckle.Core.Tests.Unit/Models/BaseTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Models/BaseTests.cs @@ -1,15 +1,22 @@ using NUnit.Framework; -using Speckle.Core.Common; -using Speckle.Core.Kits; -using Speckle.Core.Models; +using Speckle.Sdk.Common; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Speckle.Core.Tests.Unit.Models; +namespace Speckle.Sdk.Tests.Unit.Models; [TestFixture] [TestOf(typeof(Base))] [TestOf(typeof(DynamicBase))] public class BaseTests { + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(BaseTests).Assembly); + } + [Test] public void CanGetSetDynamicItemProp() { @@ -205,6 +212,7 @@ public void CanShallowCopy() Assert.That(copyMembers.Values, Is.EquivalentTo(sampleMembers.Values)); } + [SpeckleType("Speckle.Core.Tests.Unit.Models.BaseTests+SampleObject")] public class SampleObject : Base { [Chunkable, DetachProperty] @@ -232,6 +240,7 @@ public class SampleProp public string name { get; set; } } + [SpeckleType("Speckle.Core.Tests.Unit.Models.BaseTests+ObjectWithItemProp")] public class ObjectWithItemProp : Base { public string Item { get; set; } = "Item"; diff --git a/tests/Speckle.Core.Tests.Unit/Models/Extensions/BaseExtensionsTests.cs b/tests/Speckle.Sdk.Tests.Unit/Models/Extensions/BaseExtensionsTests.cs similarity index 80% rename from tests/Speckle.Core.Tests.Unit/Models/Extensions/BaseExtensionsTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Models/Extensions/BaseExtensionsTests.cs index 738e01ab..5d8a8ade 100644 --- a/tests/Speckle.Core.Tests.Unit/Models/Extensions/BaseExtensionsTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Models/Extensions/BaseExtensionsTests.cs @@ -1,14 +1,22 @@ using NUnit.Framework; -using Speckle.Core.Models; -using Speckle.Core.Models.Collections; -using Speckle.Core.Models.Extensions; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Collections; +using Speckle.Sdk.Models.Extensions; -namespace Speckle.Core.Tests.Unit.Models.Extensions; +namespace Speckle.Sdk.Tests.Unit.Models.Extensions; [TestFixture] [TestOf(nameof(BaseExtensions))] public class BaseExtensionsTests { + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly); + } + [Test] [TestCase("myDynamicProp")] [TestCase("elements")] @@ -44,11 +52,11 @@ public void TraverseWithPath() var basePaths = collection.TraverseWithPath((obj => obj is not Collection)).ToList(); Assert.That(basePaths.Count, Is.EqualTo(3)); - Assert.That(basePaths[0].Item2.speckle_type, Is.EqualTo("Speckle.Core.Models.Collections.Collection")); + Assert.That(basePaths[0].Item2.speckle_type, Is.EqualTo("Speckle.Core.Models.Collection")); Assert.That(basePaths[0].Item2["name"], Is.EqualTo("collection")); Assert.That(basePaths[0].Item1, Is.EqualTo(new List())); - Assert.That(basePaths[1].Item2.speckle_type, Is.EqualTo("Speckle.Core.Models.Collections.Collection")); + Assert.That(basePaths[1].Item2.speckle_type, Is.EqualTo("Speckle.Core.Models.Collection")); Assert.That(basePaths[1].Item2["name"], Is.EqualTo("subCollection")); Assert.That(basePaths[1].Item1, Is.EqualTo(new List() { "collection" })); @@ -56,6 +64,7 @@ public void TraverseWithPath() Assert.That(basePaths[2].Item1, Is.EqualTo(new List() { "collection", "subCollection" })); } + [SpeckleType("Speckle.Core.Tests.Unit.Models.Extensions.BaseExtensionsTests+TestBase")] public class TestBase : Base { public string myProperty { get; set; } diff --git a/tests/Speckle.Core.Tests.Unit/Models/Extensions/DisplayValueTests.cs b/tests/Speckle.Sdk.Tests.Unit/Models/Extensions/DisplayValueTests.cs similarity index 81% rename from tests/Speckle.Core.Tests.Unit/Models/Extensions/DisplayValueTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Models/Extensions/DisplayValueTests.cs index 35e6a652..f831a875 100644 --- a/tests/Speckle.Core.Tests.Unit/Models/Extensions/DisplayValueTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Models/Extensions/DisplayValueTests.cs @@ -1,8 +1,8 @@ using NUnit.Framework; -using Speckle.Core.Models; -using Speckle.Core.Models.Extensions; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Extensions; -namespace Speckle.Core.Tests.Unit.Models.Extensions; +namespace Speckle.Sdk.Tests.Unit.Models.Extensions; [TestOf(typeof(BaseExtensions))] public class DisplayValueTests @@ -31,11 +31,13 @@ public static IEnumerable TestCases() yield return new TypedDisplayValueList { displayValue = listOfMesh }; } + [SpeckleType("Speckle.Core.Tests.Unit.Models.Extensions.DisplayValueTests+TypedDisplayValue")] private class TypedDisplayValue : Base { public Base displayValue { get; set; } } + [SpeckleType("Speckle.Core.Tests.Unit.Models.Extensions.DisplayValueTests+TypedDisplayValueList")] private class TypedDisplayValueList : Base { public List displayValue { get; set; } diff --git a/tests/Speckle.Core.Tests.Unit/Models/Extensions/ExceptionTests.cs b/tests/Speckle.Sdk.Tests.Unit/Models/Extensions/ExceptionTests.cs similarity index 86% rename from tests/Speckle.Core.Tests.Unit/Models/Extensions/ExceptionTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Models/Extensions/ExceptionTests.cs index 305d733e..bf6640bd 100644 --- a/tests/Speckle.Core.Tests.Unit/Models/Extensions/ExceptionTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Models/Extensions/ExceptionTests.cs @@ -1,7 +1,7 @@ using NUnit.Framework; -using Speckle.Core.Models.Extensions; +using Speckle.Sdk.Models.Extensions; -namespace Speckle.Core.Tests.Unit.Models.Extensions; +namespace Speckle.Sdk.Tests.Unit.Models.Extensions; [TestFixture] [TestOf(typeof(BaseExtensions))] diff --git a/tests/Speckle.Core.Tests.Unit/Models/GraphTraversal/GraphTraversalTests.cs b/tests/Speckle.Sdk.Tests.Unit/Models/GraphTraversal/GraphTraversalTests.cs similarity index 90% rename from tests/Speckle.Core.Tests.Unit/Models/GraphTraversal/GraphTraversalTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Models/GraphTraversal/GraphTraversalTests.cs index 110041d1..a31680f4 100644 --- a/tests/Speckle.Core.Tests.Unit/Models/GraphTraversal/GraphTraversalTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Models/GraphTraversal/GraphTraversalTests.cs @@ -1,16 +1,25 @@ using System.Collections; using NUnit.Framework; -using Speckle.Core.Models; -using Speckle.Core.Models.GraphTraversal; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.GraphTraversal; +using Speckle.Sdk.Tests.Unit.Host; -namespace Speckle.Core.Tests.Unit.Models.GraphTraversal; +namespace Speckle.Sdk.Tests.Unit.Models.GraphTraversal; -[TestFixture, TestOf(typeof(Core.Models.GraphTraversal.GraphTraversal))] +[TestFixture, TestOf(typeof(Sdk.Models.GraphTraversal.GraphTraversal))] public class GraphTraversalTests { + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(TraversalMock).Assembly); + } + private static IEnumerable Traverse(Base testCase, params ITraversalRule[] rules) { - var sut = new Core.Models.GraphTraversal.GraphTraversal(rules); + var sut = new Sdk.Models.GraphTraversal.GraphTraversal(rules); return sut.Traverse(testCase); } diff --git a/tests/Speckle.Core.Tests.Unit/Models/GraphTraversal/TraversalContextExtensionsTests.cs b/tests/Speckle.Sdk.Tests.Unit/Models/GraphTraversal/TraversalContextExtensionsTests.cs similarity index 90% rename from tests/Speckle.Core.Tests.Unit/Models/GraphTraversal/TraversalContextExtensionsTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Models/GraphTraversal/TraversalContextExtensionsTests.cs index 33420076..a386ca14 100644 --- a/tests/Speckle.Core.Tests.Unit/Models/GraphTraversal/TraversalContextExtensionsTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Models/GraphTraversal/TraversalContextExtensionsTests.cs @@ -1,10 +1,10 @@ using NUnit.Framework; -using Speckle.Core.Common; -using Speckle.Core.Models; -using Speckle.Core.Models.Collections; -using Speckle.Core.Models.GraphTraversal; +using Speckle.Sdk.Common; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Collections; +using Speckle.Sdk.Models.GraphTraversal; -namespace Speckle.Core.Tests.Unit.Models.GraphTraversal; +namespace Speckle.Sdk.Tests.Unit.Models.GraphTraversal; [TestOf(typeof(TraversalContextExtensions))] public class TraversalContextExtensionsTests diff --git a/tests/Speckle.Core.Tests.Unit/Models/GraphTraversal/TraversalMockObjects.cs b/tests/Speckle.Sdk.Tests.Unit/Models/GraphTraversal/TraversalMockObjects.cs similarity index 66% rename from tests/Speckle.Core.Tests.Unit/Models/GraphTraversal/TraversalMockObjects.cs rename to tests/Speckle.Sdk.Tests.Unit/Models/GraphTraversal/TraversalMockObjects.cs index 799fd249..f3106425 100644 --- a/tests/Speckle.Core.Tests.Unit/Models/GraphTraversal/TraversalMockObjects.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Models/GraphTraversal/TraversalMockObjects.cs @@ -1,7 +1,8 @@ -using Speckle.Core.Models; +using Speckle.Sdk.Models; -namespace Speckle.Core.Tests.Unit.Models.GraphTraversal; +namespace Speckle.Sdk.Tests.Unit.Models.GraphTraversal; +[SpeckleType("Speckle.Core.Tests.Unit.Models.GraphTraversal.TraversalMock")] public class TraversalMock : Base { public Base Child { get; set; } diff --git a/tests/Speckle.Core.Tests.Unit/Models/Hashing.cs b/tests/Speckle.Sdk.Tests.Unit/Models/Hashing.cs similarity index 89% rename from tests/Speckle.Core.Tests.Unit/Models/Hashing.cs rename to tests/Speckle.Sdk.Tests.Unit/Models/Hashing.cs index 05fa1b6e..e57b3bf5 100644 --- a/tests/Speckle.Core.Tests.Unit/Models/Hashing.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Models/Hashing.cs @@ -1,14 +1,22 @@ using System.Diagnostics; using NUnit.Framework; -using Speckle.Core.Models; -using Speckle.Core.Tests.Unit.Kits; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Tests.Unit.Host; -namespace Speckle.Core.Tests.Unit.Models; +namespace Speckle.Sdk.Tests.Unit.Models; [TestFixture] [TestOf(typeof(Base))] public class Hashing { + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(DiningTable).Assembly); + } + [Test(Description = "Checks that hashing (as represented by object ids) actually works.")] public void HashChangeCheck() { diff --git a/tests/Speckle.Core.Tests.Unit/Models/SpeckleType.cs b/tests/Speckle.Sdk.Tests.Unit/Models/SpeckleType.cs similarity index 68% rename from tests/Speckle.Core.Tests.Unit/Models/SpeckleType.cs rename to tests/Speckle.Sdk.Tests.Unit/Models/SpeckleType.cs index 8e0b5994..8d404779 100644 --- a/tests/Speckle.Core.Tests.Unit/Models/SpeckleType.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Models/SpeckleType.cs @@ -1,13 +1,21 @@ using NUnit.Framework; -using Speckle.Core.Models; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; using TestModels; -namespace Speckle.Core.Tests.Unit.Models +namespace Speckle.Sdk.Tests.Unit.Models { [TestFixture] [TestOf(typeof(Base))] public class SpeckleTypeTests { + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(Foo).Assembly); + } + [Test, TestCaseSource(nameof(s_cases))] public void SpeckleTypeIsProperlyBuilt(Base foo, string expectedType) { @@ -26,9 +34,12 @@ public void SpeckleTypeIsProperlyBuilt(Base foo, string expectedType) namespace TestModels { + [SpeckleType("TestModels.Foo")] public class Foo : Base { } + [SpeckleType("TestModels.Bar")] public class Bar : Foo { } + [SpeckleType("TestModels.Baz")] public class Baz : Bar { } } diff --git a/tests/Speckle.Core.Tests.Unit/Models/TraversalTests.cs b/tests/Speckle.Sdk.Tests.Unit/Models/TraversalTests.cs similarity index 96% rename from tests/Speckle.Core.Tests.Unit/Models/TraversalTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Models/TraversalTests.cs index 723aff75..3e4aaea2 100644 --- a/tests/Speckle.Core.Tests.Unit/Models/TraversalTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Models/TraversalTests.cs @@ -1,8 +1,8 @@ using NUnit.Framework; -using Speckle.Core.Models; -using Speckle.Core.Models.Extensions; +using Speckle.Sdk.Models; +using Speckle.Sdk.Models.Extensions; -namespace Speckle.Core.Tests.Unit.Models; +namespace Speckle.Sdk.Tests.Unit.Models; [TestFixture, TestOf(typeof(BaseExtensions))] public class TraversalTests diff --git a/tests/Speckle.Core.Tests.Unit/Models/UtilitiesTests.cs b/tests/Speckle.Sdk.Tests.Unit/Models/UtilitiesTests.cs similarity index 79% rename from tests/Speckle.Core.Tests.Unit/Models/UtilitiesTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Models/UtilitiesTests.cs index 07176d1b..12ca7787 100644 --- a/tests/Speckle.Core.Tests.Unit/Models/UtilitiesTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Models/UtilitiesTests.cs @@ -1,7 +1,8 @@ using NUnit.Framework; -using Speckle.Core.Helpers; +using Speckle.Sdk.Helpers; +using Speckle.Sdk.Models; -namespace Speckle.Core.Tests.Unit.Models; +namespace Speckle.Sdk.Tests.Unit.Models; [TestFixture(TestOf = typeof(Crypt))] public sealed class UtilitiesTests @@ -56,10 +57,10 @@ public void FlattenToNativeConversion() new() // obj 4 }; - var parentTestEnumFlattened = Core.Models.Utilities.FlattenToHostConversionResult(testEnum); - var singleObjectFlattened = Core.Models.Utilities.FlattenToHostConversionResult(singleObject); - var nestedObjectsFlattened = Core.Models.Utilities.FlattenToHostConversionResult(nestedObjects); - var nestedObjectsWithEnumerableInheritedFlattened = Core.Models.Utilities.FlattenToHostConversionResult( + var parentTestEnumFlattened = Utilities.FlattenToHostConversionResult(testEnum); + var singleObjectFlattened = Utilities.FlattenToHostConversionResult(singleObject); + var nestedObjectsFlattened = Utilities.FlattenToHostConversionResult(nestedObjects); + var nestedObjectsWithEnumerableInheritedFlattened = Utilities.FlattenToHostConversionResult( nestedObjectsWithEnumerableInherited ); diff --git a/tests/Speckle.Sdk.Tests.Unit/Serialisation/ObjectModelDeprecationTests.cs b/tests/Speckle.Sdk.Tests.Unit/Serialisation/ObjectModelDeprecationTests.cs new file mode 100644 index 00000000..70b4e016 --- /dev/null +++ b/tests/Speckle.Sdk.Tests.Unit/Serialisation/ObjectModelDeprecationTests.cs @@ -0,0 +1,49 @@ +using NUnit.Framework; +using Shouldly; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; +using Speckle.Sdk.Serialisation.Deprecated; +using Speckle.Sdk.Serialisation.SerializationUtilities; + +namespace Speckle.Sdk.Tests.Unit.Serialisation +{ + [TestFixture] + [TestOf(typeof(BaseObjectSerializationUtilities))] + public class ObjectModelDeprecationTests + { + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(Base).Assembly, typeof(MySpeckleBase).Assembly); + } + + [Test] + public void TestThatTypeWithoutAttributeFails() + { + var e = Assert.Throws(() => TypeLoader.ParseType(typeof(string))); + e.ShouldNotBeNull(); + } + + [Test] + public void TestThatTypeWithoutMultipleAttributes() + { + string destinationType = $"Speckle.Core.Serialisation.{nameof(MySpeckleBase)}"; + + var result = TypeLoader.GetAtomicType(destinationType); + Assert.That(result, Is.EqualTo(typeof(MySpeckleBase))); + + destinationType = $"Speckle.Core.Serialisation.Deprecated.{nameof(MySpeckleBase)}"; + + result = TypeLoader.GetAtomicType(destinationType); + Assert.That(result, Is.EqualTo(typeof(MySpeckleBase))); + } + } +} + +namespace Speckle.Sdk.Serialisation.Deprecated +{ + [SpeckleType("Speckle.Core.Serialisation.MySpeckleBase")] + [DeprecatedSpeckleType("Speckle.Core.Serialisation.Deprecated.MySpeckleBase")] + public class MySpeckleBase : Base { } +} diff --git a/tests/Speckle.Core.Tests.Unit/Serialisation/SerializerBreakingChanges.cs b/tests/Speckle.Sdk.Tests.Unit/Serialisation/SerializerBreakingChanges.cs similarity index 94% rename from tests/Speckle.Core.Tests.Unit/Serialisation/SerializerBreakingChanges.cs rename to tests/Speckle.Sdk.Tests.Unit/Serialisation/SerializerBreakingChanges.cs index 0fc9549f..934b2cd5 100644 --- a/tests/Speckle.Core.Tests.Unit/Serialisation/SerializerBreakingChanges.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Serialisation/SerializerBreakingChanges.cs @@ -1,7 +1,7 @@ using NUnit.Framework; -using Speckle.Core.Serialisation; +using Speckle.Sdk.Serialisation; -namespace Speckle.Core.Tests.Unit.Serialisation; +namespace Speckle.Sdk.Tests.Unit.Serialisation; /// /// Test fixture that documents what property typing changes break backwards/cross/forwards compatibility, and are "breaking" changes. diff --git a/tests/Speckle.Core.Tests.Unit/Serialisation/SerializerNonBreakingChanges.cs b/tests/Speckle.Sdk.Tests.Unit/Serialisation/SerializerNonBreakingChanges.cs similarity index 87% rename from tests/Speckle.Core.Tests.Unit/Serialisation/SerializerNonBreakingChanges.cs rename to tests/Speckle.Sdk.Tests.Unit/Serialisation/SerializerNonBreakingChanges.cs index c6a18fbc..4e9481b7 100644 --- a/tests/Speckle.Core.Tests.Unit/Serialisation/SerializerNonBreakingChanges.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Serialisation/SerializerNonBreakingChanges.cs @@ -1,11 +1,12 @@ using System.Drawing; using NUnit.Framework; -using Speckle.Core.Api; -using Speckle.Core.Helpers; -using Speckle.Core.Models; using Speckle.DoubleNumerics; +using Speckle.Sdk.Api; +using Speckle.Sdk.Helpers; +using Speckle.Sdk.Host; +using Speckle.Sdk.Models; -namespace Speckle.Core.Tests.Unit.Serialisation; +namespace Speckle.Sdk.Tests.Unit.Serialisation; /// /// Test fixture that documents what property typing changes maintain backwards/cross/forwards compatibility, and are "non-breaking" changes. @@ -16,6 +17,13 @@ namespace Speckle.Core.Tests.Unit.Serialisation; [Description("For certain types, changing property from one type to another should be implicitly backwards compatible")] public class SerializerNonBreakingChanges : PrimitiveTestFixture { + [SetUp] + public void Setup() + { + TypeLoader.Reset(); + TypeLoader.Initialize(typeof(StringValueMock).Assembly); + } + [Test, TestCaseSource(nameof(Int8TestCases)), TestCaseSource(nameof(Int32TestCases))] public void IntToColor(int argb) { @@ -166,7 +174,7 @@ public void ListToMatrix64(int seed, double scalar) //Test List -> Matrix var res = from.SerializeAsTAndDeserialize(); Assert.That(res.value.M11, Is.EqualTo(testCase[0])); - Assert.That(res.value.M44, Is.EqualTo(testCase[^1])); + Assert.That(res.value.M44, Is.EqualTo(testCase[testCase.Count - 1])); //Test Matrix -> List var backAgain = res.SerializeAsTAndDeserialize(); @@ -188,7 +196,7 @@ public void Matrix32ToMatrix64(int seed, float scalar) //Test List -> Matrix var res = from.SerializeAsTAndDeserialize(); Assert.That(res.value.M11, Is.EqualTo(testCase[0])); - Assert.That(res.value.M44, Is.EqualTo(testCase[^1])); + Assert.That(res.value.M44, Is.EqualTo(testCase[testCase.Count - 1])); //Test Matrix -> List var backAgain = res.SerializeAsTAndDeserialize(); @@ -197,61 +205,73 @@ public void Matrix32ToMatrix64(int seed, float scalar) } } +[SpeckleType("Speckle.Core.Tests.Unit.Serialisation.TValueMock")] public class TValueMock : SerializerMock { public T value { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Serialisation.ListDoubleValueMock")] public class ListDoubleValueMock : SerializerMock { public List value { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Serialisation.IListDoubleValueMock")] public class IListDoubleValueMock : SerializerMock { public IList value { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Serialisation.IReadOnlyListDoubleValueMock")] public class IReadOnlyListDoubleValueMock : SerializerMock { public IReadOnlyList value { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Serialisation.ArrayDoubleValueMock")] public class ArrayDoubleValueMock : SerializerMock { public double[] value { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Serialisation.IntValueMock")] public class IntValueMock : SerializerMock { public long value { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Serialisation.StringValueMock")] public class StringValueMock : SerializerMock { public string value { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Serialisation.DoubleValueMock")] public class DoubleValueMock : SerializerMock { public double value { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Serialisation.Matrix64ValueMock")] public class Matrix64ValueMock : SerializerMock { public Matrix4x4 value { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Serialisation.Matrix32ValueMock")] public class Matrix32ValueMock : SerializerMock { public System.Numerics.Matrix4x4 value { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Serialisation.ColorValueMock")] public class ColorValueMock : SerializerMock { public Color value { get; set; } } +[SpeckleType("Speckle.Core.Tests.Unit.Serialisation.EnumValueMock")] public class EnumValueMock : SerializerMock { public MyEnum value { get; set; } diff --git a/tests/Speckle.Core.Tests.Unit/Speckle.Core.Tests.Unit.csproj b/tests/Speckle.Sdk.Tests.Unit/Speckle.Sdk.Tests.Unit.csproj similarity index 80% rename from tests/Speckle.Core.Tests.Unit/Speckle.Core.Tests.Unit.csproj rename to tests/Speckle.Sdk.Tests.Unit/Speckle.Sdk.Tests.Unit.csproj index 4db02b94..39d114b2 100644 --- a/tests/Speckle.Core.Tests.Unit/Speckle.Core.Tests.Unit.csproj +++ b/tests/Speckle.Sdk.Tests.Unit/Speckle.Sdk.Tests.Unit.csproj @@ -16,8 +16,7 @@ - - + diff --git a/tests/Speckle.Core.Tests.Unit/Transports/DiskTransportTests.cs b/tests/Speckle.Sdk.Tests.Unit/Transports/DiskTransportTests.cs similarity index 88% rename from tests/Speckle.Core.Tests.Unit/Transports/DiskTransportTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Transports/DiskTransportTests.cs index 5659e989..36aaf999 100644 --- a/tests/Speckle.Core.Tests.Unit/Transports/DiskTransportTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Transports/DiskTransportTests.cs @@ -1,8 +1,8 @@ using NUnit.Framework; -using Speckle.Core.Common; -using Speckle.Core.Transports; +using Speckle.Sdk.Common; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Tests.Unit.Transports; +namespace Speckle.Sdk.Tests.Unit.Transports; [TestFixture] [TestOf(nameof(DiskTransport))] diff --git a/tests/Speckle.Core.Tests.Unit/Transports/MemoryTransportTests.cs b/tests/Speckle.Sdk.Tests.Unit/Transports/MemoryTransportTests.cs similarity index 79% rename from tests/Speckle.Core.Tests.Unit/Transports/MemoryTransportTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Transports/MemoryTransportTests.cs index 30a53a5f..55182760 100644 --- a/tests/Speckle.Core.Tests.Unit/Transports/MemoryTransportTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Transports/MemoryTransportTests.cs @@ -1,9 +1,9 @@ using System.Collections.Concurrent; using NUnit.Framework; -using Speckle.Core.Common; -using Speckle.Core.Transports; +using Speckle.Sdk.Common; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Tests.Unit.Transports; +namespace Speckle.Sdk.Tests.Unit.Transports; [TestFixture] [TestOf(nameof(MemoryTransport))] diff --git a/tests/Speckle.Core.Tests.Unit/Transports/SQLiteTransportTests.cs b/tests/Speckle.Sdk.Tests.Unit/Transports/SQLiteTransportTests.cs similarity index 97% rename from tests/Speckle.Core.Tests.Unit/Transports/SQLiteTransportTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Transports/SQLiteTransportTests.cs index 096ef43f..2ce88c8d 100644 --- a/tests/Speckle.Core.Tests.Unit/Transports/SQLiteTransportTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Transports/SQLiteTransportTests.cs @@ -1,9 +1,9 @@ using Microsoft.Data.Sqlite; using NUnit.Framework; -using Speckle.Core.Common; -using Speckle.Core.Transports; +using Speckle.Sdk.Common; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Tests.Unit.Transports; +namespace Speckle.Sdk.Tests.Unit.Transports; [TestFixture] [TestOf(nameof(SQLiteTransport))] diff --git a/tests/Speckle.Core.Tests.Unit/Transports/TransportTests.cs b/tests/Speckle.Sdk.Tests.Unit/Transports/TransportTests.cs similarity index 97% rename from tests/Speckle.Core.Tests.Unit/Transports/TransportTests.cs rename to tests/Speckle.Sdk.Tests.Unit/Transports/TransportTests.cs index dab55f0f..df42d2bc 100644 --- a/tests/Speckle.Core.Tests.Unit/Transports/TransportTests.cs +++ b/tests/Speckle.Sdk.Tests.Unit/Transports/TransportTests.cs @@ -1,10 +1,9 @@ -#nullable enable using NUnit.Framework; -using Speckle.Core.Common; -using Speckle.Core.Transports; using Speckle.Newtonsoft.Json; +using Speckle.Sdk.Common; +using Speckle.Sdk.Transports; -namespace Speckle.Core.Tests.Unit.Transports; +namespace Speckle.Sdk.Tests.Unit.Transports; [TestFixture] public abstract class TransportTests diff --git a/tests/Speckle.Core.Tests.Unit/packages.lock.json b/tests/Speckle.Sdk.Tests.Unit/packages.lock.json similarity index 97% rename from tests/Speckle.Core.Tests.Unit/packages.lock.json rename to tests/Speckle.Sdk.Tests.Unit/packages.lock.json index 2514e800..2dd713eb 100644 --- a/tests/Speckle.Core.Tests.Unit/packages.lock.json +++ b/tests/Speckle.Sdk.Tests.Unit/packages.lock.json @@ -212,7 +212,7 @@ "resolved": "1.6.0", "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" }, - "speckle.core": { + "speckle.sdk": { "type": "Project", "dependencies": { "GraphQL.Client": "[6.0.0, )", @@ -222,20 +222,14 @@ "Polly.Contrib.WaitAndRetry": "[1.1.1, )", "Polly.Extensions.Http": "[3.0.0, )", "Speckle.DoubleNumerics": "[4.0.1, )", - "Speckle.Logging": "[1.0.0, )", "Speckle.Newtonsoft.Json": "[13.0.2, )", + "Speckle.Sdk.Logging": "[1.0.0, )", "System.Text.Json": "[5.0.2, )" } }, - "speckle.logging": { + "speckle.sdk.logging": { "type": "Project" }, - "speckle.transports.disk": { - "type": "Project", - "dependencies": { - "Speckle.Core": "[1.0.0, )" - } - }, "GraphQL.Client": { "type": "CentralTransitive", "requested": "[6.0.0, )",