Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,17 @@ All notable changes to the AxonFlow Java SDK will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.6.0] - 2026-02-22

### Added

- Media governance configuration methods: `getMediaGovernanceConfig()`, `updateMediaGovernanceConfig()`, `getMediaGovernanceStatus()`
- Media governance types: `MediaGovernanceConfig`, `MediaGovernanceStatus`
- Media policy category constants: `CATEGORY_MEDIA_SAFETY`, `CATEGORY_MEDIA_BIOMETRIC`, `CATEGORY_MEDIA_PII`, `CATEGORY_MEDIA_DOCUMENT`
- `PolicyCategory` enum values: `MEDIA_SAFETY`, `MEDIA_BIOMETRIC`, `MEDIA_PII`, `MEDIA_DOCUMENT`

---

## [3.5.0] - 2026-02-18

### Added
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.getaxonflow</groupId>
<artifactId>axonflow-sdk</artifactId>
<version>3.5.0</version>
<version>3.6.0</version>
<packaging>jar</packaging>

<name>AxonFlow Java SDK</name>
Expand Down
89 changes: 89 additions & 0 deletions src/main/java/com/getaxonflow/sdk/AxonFlow.java
Original file line number Diff line number Diff line change
Expand Up @@ -2122,6 +2122,95 @@ public void streamExecutionStatus(
}
}

// ========================================================================
// Media Governance Config
// ========================================================================

/**
* Gets the media governance configuration for the current tenant.
*
* <p>Returns per-tenant settings controlling whether media analysis is
* enabled and which analyzers are allowed.
*
* @return the media governance configuration
* @throws AxonFlowException if the request fails
*/
public MediaGovernanceConfig getMediaGovernanceConfig() {
return retryExecutor.execute(() -> {
Request httpRequest = buildRequest("GET", "/api/v1/media-governance/config", null);
try (Response response = httpClient.newCall(httpRequest).execute()) {
return parseResponse(response, MediaGovernanceConfig.class);
}
}, "getMediaGovernanceConfig");
}

/**
* Asynchronously gets the media governance configuration for the current tenant.
*
* @return a future containing the media governance configuration
*/
public CompletableFuture<MediaGovernanceConfig> getMediaGovernanceConfigAsync() {
return CompletableFuture.supplyAsync(this::getMediaGovernanceConfig, asyncExecutor);
}

/**
* Updates the media governance configuration for the current tenant.
*
* <p>Allows enabling/disabling media analysis and controlling which
* analyzers are permitted.
*
* @param request the update request
* @return the updated media governance configuration
* @throws AxonFlowException if the request fails
*/
public MediaGovernanceConfig updateMediaGovernanceConfig(UpdateMediaGovernanceConfigRequest request) {
Objects.requireNonNull(request, "request cannot be null");

return retryExecutor.execute(() -> {
Request httpRequest = buildRequest("PUT", "/api/v1/media-governance/config", request);
try (Response response = httpClient.newCall(httpRequest).execute()) {
return parseResponse(response, MediaGovernanceConfig.class);
}
}, "updateMediaGovernanceConfig");
}

/**
* Asynchronously updates the media governance configuration for the current tenant.
*
* @param request the update request
* @return a future containing the updated media governance configuration
*/
public CompletableFuture<MediaGovernanceConfig> updateMediaGovernanceConfigAsync(UpdateMediaGovernanceConfigRequest request) {
return CompletableFuture.supplyAsync(() -> updateMediaGovernanceConfig(request), asyncExecutor);
}

/**
* Gets the platform-level media governance status.
*
* <p>Returns whether media governance is available, default enablement,
* and the required license tier.
*
* @return the media governance status
* @throws AxonFlowException if the request fails
*/
public MediaGovernanceStatus getMediaGovernanceStatus() {
return retryExecutor.execute(() -> {
Request httpRequest = buildRequest("GET", "/api/v1/media-governance/status", null);
try (Response response = httpClient.newCall(httpRequest).execute()) {
return parseResponse(response, MediaGovernanceStatus.class);
}
}, "getMediaGovernanceStatus");
}

/**
* Asynchronously gets the platform-level media governance status.
*
* @return a future containing the media governance status
*/
public CompletableFuture<MediaGovernanceStatus> getMediaGovernanceStatusAsync() {
return CompletableFuture.supplyAsync(this::getMediaGovernanceStatus, asyncExecutor);
}

// ========================================================================
// Configuration Access
// ========================================================================
Expand Down
92 changes: 92 additions & 0 deletions src/main/java/com/getaxonflow/sdk/types/MediaGovernanceConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*
* Copyright 2025 AxonFlow
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.getaxonflow.sdk.types;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;
import java.util.Objects;

/**
* Per-tenant media governance configuration.
*
* <p>Controls whether media analysis is enabled for a tenant and which
* analyzers are allowed. Returned by the media governance config API.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class MediaGovernanceConfig {

@JsonProperty("tenant_id")
private String tenantId;

@JsonProperty("enabled")
private boolean enabled;

@JsonProperty("allowed_analyzers")
private List<String> allowedAnalyzers;

@JsonProperty("updated_at")
private String updatedAt;

@JsonProperty("updated_by")
private String updatedBy;

public MediaGovernanceConfig() {}

public String getTenantId() { return tenantId; }
public void setTenantId(String tenantId) { this.tenantId = tenantId; }

public boolean isEnabled() { return enabled; }
public void setEnabled(boolean enabled) { this.enabled = enabled; }

public List<String> getAllowedAnalyzers() { return allowedAnalyzers; }
public void setAllowedAnalyzers(List<String> allowedAnalyzers) { this.allowedAnalyzers = allowedAnalyzers; }

public String getUpdatedAt() { return updatedAt; }
public void setUpdatedAt(String updatedAt) { this.updatedAt = updatedAt; }

public String getUpdatedBy() { return updatedBy; }
public void setUpdatedBy(String updatedBy) { this.updatedBy = updatedBy; }

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MediaGovernanceConfig that = (MediaGovernanceConfig) o;
return enabled == that.enabled &&
Objects.equals(tenantId, that.tenantId) &&
Objects.equals(allowedAnalyzers, that.allowedAnalyzers) &&
Objects.equals(updatedAt, that.updatedAt) &&
Objects.equals(updatedBy, that.updatedBy);
}

@Override
public int hashCode() {
return Objects.hash(tenantId, enabled, allowedAnalyzers, updatedAt, updatedBy);
}

@Override
public String toString() {
return "MediaGovernanceConfig{" +
"tenantId='" + tenantId + '\'' +
", enabled=" + enabled +
", allowedAnalyzers=" + allowedAnalyzers +
", updatedAt='" + updatedAt + '\'' +
", updatedBy='" + updatedBy + '\'' +
'}';
}
}
83 changes: 83 additions & 0 deletions src/main/java/com/getaxonflow/sdk/types/MediaGovernanceStatus.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Copyright 2025 AxonFlow
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.getaxonflow.sdk.types;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Objects;

/**
* Platform-level media governance status.
*
* <p>Indicates whether media governance is available, the default enablement
* state, and the license tier required.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class MediaGovernanceStatus {

@JsonProperty("available")
private boolean available;

@JsonProperty("enabled_by_default")
private boolean enabledByDefault;

@JsonProperty("per_tenant_control")
private boolean perTenantControl;

@JsonProperty("tier")
private String tier;

public MediaGovernanceStatus() {}

public boolean isAvailable() { return available; }
public void setAvailable(boolean available) { this.available = available; }

public boolean isEnabledByDefault() { return enabledByDefault; }
public void setEnabledByDefault(boolean enabledByDefault) { this.enabledByDefault = enabledByDefault; }

public boolean isPerTenantControl() { return perTenantControl; }
public void setPerTenantControl(boolean perTenantControl) { this.perTenantControl = perTenantControl; }

public String getTier() { return tier; }
public void setTier(String tier) { this.tier = tier; }

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MediaGovernanceStatus that = (MediaGovernanceStatus) o;
return available == that.available &&
enabledByDefault == that.enabledByDefault &&
perTenantControl == that.perTenantControl &&
Objects.equals(tier, that.tier);
}

@Override
public int hashCode() {
return Objects.hash(available, enabledByDefault, perTenantControl, tier);
}

@Override
public String toString() {
return "MediaGovernanceStatus{" +
"available=" + available +
", enabledByDefault=" + enabledByDefault +
", perTenantControl=" + perTenantControl +
", tier='" + tier + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* Copyright 2025 AxonFlow
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.getaxonflow.sdk.types;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;
import java.util.Objects;

/**
* Request to update per-tenant media governance configuration.
*
* <p>Fields set to {@code null} are omitted from the JSON payload,
* allowing partial updates.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class UpdateMediaGovernanceConfigRequest {

@JsonProperty("enabled")
private Boolean enabled;

@JsonProperty("allowed_analyzers")
private List<String> allowedAnalyzers;

public UpdateMediaGovernanceConfigRequest() {}

public Boolean getEnabled() { return enabled; }
public void setEnabled(Boolean enabled) { this.enabled = enabled; }

public List<String> getAllowedAnalyzers() { return allowedAnalyzers; }
public void setAllowedAnalyzers(List<String> allowedAnalyzers) { this.allowedAnalyzers = allowedAnalyzers; }

public static Builder builder() { return new Builder(); }

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
UpdateMediaGovernanceConfigRequest that = (UpdateMediaGovernanceConfigRequest) o;
return Objects.equals(enabled, that.enabled) &&
Objects.equals(allowedAnalyzers, that.allowedAnalyzers);
}

@Override
public int hashCode() {
return Objects.hash(enabled, allowedAnalyzers);
}

@Override
public String toString() {
return "UpdateMediaGovernanceConfigRequest{" +
"enabled=" + enabled +
", allowedAnalyzers=" + allowedAnalyzers +
'}';
}

public static final class Builder {
private Boolean enabled;
private List<String> allowedAnalyzers;

private Builder() {}

public Builder enabled(Boolean enabled) { this.enabled = enabled; return this; }
public Builder allowedAnalyzers(List<String> allowedAnalyzers) { this.allowedAnalyzers = allowedAnalyzers; return this; }

public UpdateMediaGovernanceConfigRequest build() {
UpdateMediaGovernanceConfigRequest request = new UpdateMediaGovernanceConfigRequest();
request.enabled = this.enabled;
request.allowedAnalyzers = this.allowedAnalyzers;
return request;
}
}
}
Loading
Loading