io.permit.sdk.openapi.models.ResourceCreate Maven / Gradle / Ivy
Show all versions of permit-sdk-java Show documentation
package io.permit.sdk.openapi.models;
import java.util.HashMap;
import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
/**
* ResourceCreate
*
*
*
*/
@Generated("jsonschema2pojo")
public class ResourceCreate {
/**
* Key
*
* A URL-friendly name of the resource (i.e: slug). You will be able to query later using this key instead of the id (UUID) of the resource.
* (Required)
*
*/
@SerializedName("key")
@Expose
public java.lang.String key;
/**
* Name
*
* The name of the resource
* (Required)
*
*/
@SerializedName("name")
@Expose
public java.lang.String name;
/**
* Urn
*
* The [URN](https://en.wikipedia.org/wiki/Uniform_Resource_Name) (Uniform Resource Name) of the resource
*
*/
@SerializedName("urn")
@Expose
public java.lang.String urn;
/**
* Description
*
* An optional longer description of what this resource respresents in your system
*
*/
@SerializedName("description")
@Expose
public java.lang.String description;
/**
* Actions
*
*
* A actions definition block, typically contained within a resource type definition block.
* The actions represents the ways you can interact with a protected resource.
*
* (Required)
*
*/
@SerializedName("actions")
@Expose
public HashMap actions;
/**
* Attributes
*
* Attributes that each resource of this type defines, and can be used in your ABAC policies.
*
*/
@SerializedName("attributes")
@Expose
public HashMap attributes;
/**
* Roles
*
* Roles defined on this resource. The key is the role name, and the value contains the role properties such as granted permissions, base roles, etc.
*
*/
@SerializedName("roles")
@Expose
public HashMap roles;
/**
* Relations
*
* Relations to other resources. The key is the relation key, and the value is the related resource.
*
*/
@SerializedName("relations")
@Expose
public HashMap relations;
/**
* No args constructor for use in serialization
*
*/
public ResourceCreate() {
}
/**
*
* @param name
* @param actions
* @param key
*/
public ResourceCreate(java.lang.String key, java.lang.String name, HashMap actions) {
super();
this.key = key;
this.name = name;
this.actions = actions;
}
public ResourceCreate withKey(java.lang.String key) {
this.key = key;
return this;
}
public ResourceCreate withName(java.lang.String name) {
this.name = name;
return this;
}
public ResourceCreate withUrn(java.lang.String urn) {
this.urn = urn;
return this;
}
public ResourceCreate withDescription(java.lang.String description) {
this.description = description;
return this;
}
public ResourceCreate withActions(HashMap actions) {
this.actions = actions;
return this;
}
public ResourceCreate withAttributes(HashMap attributes) {
this.attributes = attributes;
return this;
}
public ResourceCreate withRoles(HashMap roles) {
this.roles = roles;
return this;
}
public ResourceCreate withRelations(HashMap relations) {
this.relations = relations;
return this;
}
}