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
5 changes: 5 additions & 0 deletions src/main/java/io/permit/sdk/api/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ public class ApiClient implements IDeprecatedApis {
*/
public final ElementsApi elements;

/**
* The {@code GroupsApi} instance for accessing Permit Groups related API endpoints.
*/
public final GroupsApi groups;

/**
* Constructs a new instance of the {@code ApiClient} class with the specified configuration.
Expand Down Expand Up @@ -148,6 +152,7 @@ public ApiClient(PermitConfig config) {
this.relationshipTuples = new RelationshipTuplesApi(this.client, this.config);
this.conditionSetRules = new ConditionSetRulesApi(this.client, this.config);
this.elements = new ElementsApi(this.client, this.config);
this.groups = new GroupsApi(this.client, this.config);
}

/**
Expand Down
327 changes: 327 additions & 0 deletions src/main/java/io/permit/sdk/api/GroupsApi.java

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/main/java/io/permit/sdk/api/RelationshipTuplesApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public RelationshipTupleRead[] list(String subject, String relation, String obje
* @param object The object of the relationship (a resource instance key).
* @param page The page number of the results.
* @return An array of RelationshipTupleRead objects representing the relationship tuples.
* @throws IOException If an I/Oerror occurs during the HTTP request.
* @throws IOException If an I/O error occurs during the HTTP request.
* @throws PermitApiError If the Permit API returns a response with an error status code.
* @throws PermitContextError If the configured {@link io.permit.sdk.PermitContext} does not match the required endpoint context.
*/
Expand All @@ -129,7 +129,7 @@ public RelationshipTupleRead[] list(String subject, String relation, String obje
* @param relation The relation between the two resource instances.
* @param object The object of the relationship (a resource instance key).
* @return An array of RelationshipTupleRead objects representing the relationship tuples.
* @throws IOException If an I/Oerror occurs during the HTTP request.
* @throws IOException If an I/O error occurs during the HTTP request.
* @throws PermitApiError If the Permit API returns a response with an error status code.
* @throws PermitContextError If the configured {@link io.permit.sdk.PermitContext} does not match the required endpoint context.
*/
Expand All @@ -141,7 +141,7 @@ public RelationshipTupleRead[] list(String subject, String relation, String obje
* Lists all relationship tuples with the default pagination parameters.
*
* @return An array of RelationshipTupleRead objects representing the relationship tuples.
* @throws IOException If an I/Oerror occurs during the HTTP request.
* @throws IOException If an I/O error occurs during the HTTP request.
* @throws PermitApiError If the Permit API returns a response with an error status code.
* @throws PermitContextError If the configured {@link io.permit.sdk.PermitContext} does not match the required endpoint context.
*/
Expand Down
1 change: 1 addition & 0 deletions src/main/java/io/permit/sdk/api/ResourceInstancesApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ public ResourceInstanceRead get(String instanceKey) throws IOException, PermitAp

/**
* Retrieves a resource instance by its key.
* This is an alias for the {@link #get} method.
*
* @param instanceKey The key of the resource instance.
* @return A ResourceInstanceRead object representing the retrieved resource instance.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/permit/sdk/api/ResourceRelationsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public RelationRead getById(UUID resourceId, UUID relationId) throws IOException

/**
* Creates a new relation under the specified resource.
* Since resource respresents a type, the relation itself represents a type and not a value.
* Since resource represents a type, the relation itself represents a type and not a value.
*
* @param resourceKey The key of the resource.
* @param relationData The {@link RelationCreate} object containing the data for the new resource relation.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/permit/sdk/api/UsersApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public PaginatedResultUserRead list() throws IOException, PermitApiError, Permit
/**
* Retrieves a user by its key.
*
* @param userKey The key of theuser.
* @param userKey The key of the user.
* @return A UserRead object representing the retrieved user.
* @throws IOException If an I/O error occurs during the HTTP request.
* @throws PermitApiError If the Permit API returns a response with an error status code.
Expand Down
113 changes: 113 additions & 0 deletions src/main/java/io/permit/sdk/openapi/models/GroupAddRole.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*
* Permit.io API
* Authorization as a service
*
* The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


package io.permit.sdk.openapi.models;

import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;


/**
* GroupAddRole
* <p>
*
*
*/
@Generated("jsonschema2pojo")
public class GroupAddRole {
/**
* Role
* <p>
* The role key or id that will be assigned to the group.
* (Required)
*
*/
@SerializedName("role")
@Expose
public String role;
/**
* Resource
* <p>
* The resource key or id that the role belongs to.
* (Required)
*
*/
@SerializedName("resource")
@Expose
public String resource;
/**
* ResourceInstance
* <p>
* The resource instance key or id that the role belongs to.
* (Required)
*
*/
@SerializedName("resource_instance")
@Expose
public String resourceInstance;
/**
* Tenant
* <p>
* The tenant key or id that the role belongs to.
* (Required)
*
*/
@SerializedName("tenant")
@Expose
public String tenant;

/**
* No args constructor for use in serialization
*
*/
public GroupAddRole() {
}

/**
* Constructs a new GroupAddRole with all required identifiers.
*
* @param role the role key or id to assign to the group
* @param resourceInstance the resource instance key or id that the role belongs to
* @param resource the resource key or id that the role belongs to
* @param tenant the tenant key or id that the role belongs to
*/
public GroupAddRole(java.lang.String role, java.lang.String resourceInstance, java.lang.String resource, java.lang.String tenant) {
super();
this.role = role;
this.resourceInstance = resourceInstance;
this.resource = resource;
this.tenant = tenant;
}

public GroupAddRole withRole(java.lang.String role) {
this.role = role;
return this;
}

public GroupAddRole withResourceInstanceKey(java.lang.String resourceInstance) {
this.resourceInstance = resourceInstance;
return this;
}

public GroupAddRole withResource(java.lang.String resource) {
this.resource = resource;
return this;
}

public GroupAddRole withTenant(java.lang.String tenant) {
this.tenant = tenant;
return this;
}
}

52 changes: 52 additions & 0 deletions src/main/java/io/permit/sdk/openapi/models/GroupAssignUser.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* Permit.io API
* Authorization as a service
*
* The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


package io.permit.sdk.openapi.models;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

/**
* GroupAssignUser
* <p>
*
*
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-26T18:29:37.439030+07:00[Asia/Ho_Chi_Minh]", comments = "Generator version: 7.17.0")
public class GroupAssignUser {
/**
* Tenant
* <p>
* the tenant key or id that the user belongs to.
* (Required)
*/
@SerializedName("tenant")
@Expose
public String tenant;

/**
*

* @param tenant
*/
public GroupAssignUser(java.lang.String tenant) {
super();
this.tenant = tenant;
}

public GroupAssignUser withTenant(java.lang.String tenant) {
this.tenant = tenant;
return this;
}
}

94 changes: 94 additions & 0 deletions src/main/java/io/permit/sdk/openapi/models/GroupCreate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
* Permit.io API
* Authorization as a service
*
* The version of the OpenAPI document: 2.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


package io.permit.sdk.openapi.models;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

import javax.annotation.Generated;

/**
* GroupCreate
* <p>
*
*
*/
@Generated("jsonschema2pojo")
public class GroupCreate {
/**
* Group Resource Type Key
* <p>
* The key of the resource type that the group belongs to.
*
*/
@SerializedName("group_resource_type_key")
@Expose
public java.lang.String groupResourceTypeKey = "group";

/**
* Group Instance Key
* <p>
* Either the unique id of the resource instance that that the group belongs to, or the URL-friendly key of the <resource_key:resource_instance_key> (i.e: file:my_file)
* (Required)
*
*/
@SerializedName("group_instance_key")
@Expose
public java.lang.String groupInstanceKey;

/**
* Group Tenant
* <p>
* The tenant key or id that the group belongs to.
* (Required)
*
*/
@SerializedName("group_tenant")
@Expose
public java.lang.String groupTenant;

/**
* No args constructor for use in serialization
*
*/
public GroupCreate() {
}

/**
*
* @param groupInstanceKey
* @param groupTenant
*/
public GroupCreate(java.lang.String groupInstanceKey, java.lang.String groupTenant) {
super();
this.groupInstanceKey = groupInstanceKey;
this.groupTenant = groupTenant;
}

public GroupCreate withGroupInstanceKey(java.lang.String groupInstanceKey) {
this.groupInstanceKey = groupInstanceKey;
return this;
}

public GroupCreate withGroupTenant(java.lang.String groupTenant) {
this.groupTenant = groupTenant;
return this;
}

public GroupCreate withGroupResourceTypeKey(java.lang.String groupResourceTypeKey) {
this.groupResourceTypeKey = groupResourceTypeKey;
return this;
}
}

Loading