com.stytch.java.b2b.models.rbac.RBAC.kt Maven / Gradle / Ivy
package com.stytch.java.b2b.models.rbac
// !!!
// WARNING: This file is autogenerated
// Only modify code within MANUAL() sections
// or your changes may be overwritten later!
// !!!
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
public data class Policy
@JvmOverloads
constructor(
/**
* An array of [Role objects](https://stytch.com/docs/b2b/api/rbac-role-object).
*/
@Json(name = "roles")
val roles: List,
/**
* An array of [Resource objects](https://stytch.com/docs/b2b/api/rbac-resource-object).
*/
@Json(name = "resources")
val resources: List,
)
@JsonClass(generateAdapter = true)
public data class PolicyResource
@JvmOverloads
constructor(
/**
* A unique identifier of the RBAC Resource, provided by the developer and intended to be human-readable.
*
* A `resource_id` is not allowed to start with `stytch`, which is a special prefix used for Stytch default Resources
* with reserved `resource_id`s. These include:
*
* * `stytch.organization`
* * `stytch.member`
* * `stytch.sso`
* * `stytch.self`
*
* Check out the [guide on Stytch default Resources](https://stytch.com/docs/b2b/guides/rbac/stytch-default) for a more
* detailed explanation.
*
*
*/
@Json(name = "resource_id")
val resourceId: String,
/**
* The description of the RBAC Resource.
*/
@Json(name = "description")
val description: String,
/**
* A list of all possible actions for a provided Resource.
*
* Reserved `actions` that are predefined by Stytch include:
*
* * `*`
* * For the `stytch.organization` Resource:
* * `update.info.name`
* * `update.info.slug`
* * `update.info.untrusted_metadata`
* * `update.info.email_jit_provisioning`
* * `update.info.logo_url`
* * `update.info.email_invites`
* * `update.info.allowed_domains`
* * `update.info.default_sso_connection`
* * `update.info.sso_jit_provisioning`
* * `update.info.mfa_policy`
* * `update.info.implicit_roles`
* * `delete`
* * For the `stytch.member` Resource:
* * `create`
* * `update.info.name`
* * `update.info.untrusted_metadata`
* * `update.info.mfa-phone`
* * `update.info.delete.mfa-phone`
* * `update.settings.is-breakglass`
* * `update.settings.mfa_enrolled`
* * `update.settings.roles`
* * `search`
* * `delete`
* * For the `stytch.sso` Resource:
* * `create`
* * `update`
* * `delete`
* * For the `stytch.self` Resource:
* * `update.info.name`
* * `update.info.untrusted_metadata`
* * `update.info.mfa-phone`
* * `update.info.delete.mfa-phone`
* * `update.info.delete.password`
* * `update.settings.mfa_enrolled`
* * `delete`
*
*/
@Json(name = "actions")
val actions: List,
)
@JsonClass(generateAdapter = true)
public data class PolicyRole
@JvmOverloads
constructor(
/**
* The unique identifier of the RBAC Role, provided by the developer and intended to be human-readable.
*
* Reserved `role_id`s that are predefined by Stytch include:
*
* * `stytch_member`
* * `stytch_admin`
*
* Check out the [guide on Stytch default Roles](https://stytch.com/docs/b2b/guides/rbac/stytch-default) for a more
* detailed explanation.
*
*
*/
@Json(name = "role_id")
val roleId: String,
/**
* The description of the RBAC Role.
*/
@Json(name = "description")
val description: String,
/**
* A list of permissions that link a [Resource](https://stytch.com/docs/b2b/api/rbac-resource-object) to a list of actions.
*/
@Json(name = "permissions")
val permissions: List,
)
@JsonClass(generateAdapter = true)
public data class PolicyRolePermission
@JvmOverloads
constructor(
/**
* A unique identifier of the RBAC Resource, provided by the developer and intended to be human-readable.
*
* A `resource_id` is not allowed to start with `stytch`, which is a special prefix used for Stytch default Resources
* with reserved `resource_id`s. These include:
*
* * `stytch.organization`
* * `stytch.member`
* * `stytch.sso`
* * `stytch.self`
*
* Check out the [guide on Stytch default Resources](https://stytch.com/docs/b2b/guides/rbac/stytch-default) for a more
* detailed explanation.
*
*
*/
@Json(name = "resource_id")
val resourceId: String,
/**
* A list of permitted actions the Role is authorized to take with the provided Resource. You can use `*` as a wildcard to
* grant a Role permission to use all possible actions related to the Resource.
*/
@Json(name = "actions")
val actions: List,
)
/**
* Request type for `RBAC.policy`.
*/
@JsonClass(generateAdapter = true)
public class PolicyRequest
@JvmOverloads
constructor()
/**
* Response type for `RBAC.policy`.
*/
@JsonClass(generateAdapter = true)
public data class PolicyResponse
@JvmOverloads
constructor(
/**
* Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we
* may ask for this value to help identify a specific API call when helping you debug an issue.
*/
@Json(name = "request_id")
val requestId: String,
/**
* The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values
* equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
*/
@Json(name = "status_code")
val statusCode: Int,
/**
* The RBAC Policy document that contains all defined Roles and Resources – which are managed in the
* [Dashboard](/dashboard/rbac). Read more about these entities and how they work in our
* [RBAC overview](https://stytch.com/docs/b2b/guides/rbac/overview).
*/
@Json(name = "policy")
val policy: Policy? = null,
)