Skip to content

Commit

Permalink
Added "draftMutability" to the UI config
Browse files Browse the repository at this point in the history
  • Loading branch information
EricWittmann committed Oct 29, 2024
1 parent 3eeed84 commit c383bf2
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public UserInterfaceConfig getUIConfig() {
.deleteGroup(restConfig.isGroupDeletionEnabled())
.deleteArtifact(restConfig.isArtifactDeletionEnabled())
.deleteVersion(restConfig.isArtifactVersionDeletionEnabled())
.draftMutability(restConfig.isArtifactVersionMutabilityEnabled())
.settings("true".equals(uiConfig.featureSettings)).build())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.apicurio.registry.rest.client.models.CreateVersion;
import io.apicurio.registry.rest.client.models.ProblemDetails;
import io.apicurio.registry.rest.client.models.RuleType;
import io.apicurio.registry.rest.client.models.UserInterfaceConfig;
import io.apicurio.registry.rest.client.models.VersionContent;
import io.apicurio.registry.rest.client.models.VersionMetaData;
import io.apicurio.registry.rest.client.models.VersionSearchResults;
Expand Down Expand Up @@ -460,4 +461,12 @@ public void testDraftVersionsInCoreV2() throws Exception {
.get("/registry/v2/groups/{groupId}/artifacts/{artifactId}/versions/latest").then()
.statusCode(200);
}

@Test
public void testUiConfig() throws Exception {
UserInterfaceConfig config = clientV3.system().uiConfig().get();
Assertions.assertNotNull(config);
Assertions.assertTrue(config.getFeatures().getDraftMutability());
}

}
4 changes: 4 additions & 0 deletions common/src/main/resources/META-INF/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4821,6 +4821,10 @@
"deleteVersion": {
"description": "",
"type": "boolean"
},
"draftMutability": {
"description": "",
"type": "boolean"
}
},
"example": {
Expand Down
2 changes: 1 addition & 1 deletion go-sdk/pkg/registryclient-v3/kiota-lock.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"descriptionHash": "6D428EDE13C8C05F3E9350ADBED7F44A1E6FFE2930A5F0EF8AF63340F89684254673F58AD88E237A968713F30D33CF09EB59BC3D3F08969CB79C3C4444A972C8",
"descriptionHash": "760E2C412DC1229895C64DE9E5C64E93739B4734CB2A4444323019D1A22B4C081479F739A9C7372E3E87D335E577DDE222B8DF9D48DF05ED285DEA1D2C7F2729",
"descriptionLocation": "../../v3.json",
"lockFileVersion": "1.0.0",
"kiotaVersion": "1.19.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type UserInterfaceConfigFeatures struct {
deleteGroup *bool
// The deleteVersion property
deleteVersion *bool
// The draftMutability property
draftMutability *bool
// The readOnly property
readOnly *bool
// The roleManagement property
Expand Down Expand Up @@ -66,6 +68,12 @@ func (m *UserInterfaceConfigFeatures) GetDeleteVersion() *bool {
return m.deleteVersion
}

// GetDraftMutability gets the draftMutability property value. The draftMutability property
// returns a *bool when successful
func (m *UserInterfaceConfigFeatures) GetDraftMutability() *bool {
return m.draftMutability
}

// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *UserInterfaceConfigFeatures) GetFieldDeserializers() map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
Expand Down Expand Up @@ -110,6 +118,16 @@ func (m *UserInterfaceConfigFeatures) GetFieldDeserializers() map[string]func(i8
}
return nil
}
res["draftMutability"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetDraftMutability(val)
}
return nil
}
res["readOnly"] = func(n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
Expand Down Expand Up @@ -187,6 +205,12 @@ func (m *UserInterfaceConfigFeatures) Serialize(writer i878a80d2330e89d26896388a
return err
}
}
{
err := writer.WriteBoolValue("draftMutability", m.GetDraftMutability())
if err != nil {
return err
}
}
{
err := writer.WriteBoolValue("readOnly", m.GetReadOnly())
if err != nil {
Expand Down Expand Up @@ -239,6 +263,11 @@ func (m *UserInterfaceConfigFeatures) SetDeleteVersion(value *bool) {
m.deleteVersion = value
}

// SetDraftMutability sets the draftMutability property value. The draftMutability property
func (m *UserInterfaceConfigFeatures) SetDraftMutability(value *bool) {
m.draftMutability = value
}

// SetReadOnly sets the readOnly property value. The readOnly property
func (m *UserInterfaceConfigFeatures) SetReadOnly(value *bool) {
m.readOnly = value
Expand All @@ -261,13 +290,15 @@ type UserInterfaceConfigFeaturesable interface {
GetDeleteArtifact() *bool
GetDeleteGroup() *bool
GetDeleteVersion() *bool
GetDraftMutability() *bool
GetReadOnly() *bool
GetRoleManagement() *bool
GetSettings() *bool
SetBreadcrumbs(value *bool)
SetDeleteArtifact(value *bool)
SetDeleteGroup(value *bool)
SetDeleteVersion(value *bool)
SetDraftMutability(value *bool)
SetReadOnly(value *bool)
SetRoleManagement(value *bool)
SetSettings(value *bool)
Expand Down

0 comments on commit c383bf2

Please sign in to comment.