{
  "description": "PocketIDUserGroup is the Schema for the pocketidusergroups API",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "spec defines the desired state of PocketIDUserGroup",
      "properties": {
        "allowedOIDCClients": {
          "description": "AllowedOIDCClients lists PocketIDOIDCClient CRs that this group grants access to.\nThe final set of allowed clients is the union of this field and any\nOIDCClients that reference this group in their allowedUserGroups.",
          "items": {
            "description": "NamespacedOIDCClientReference references a PocketIDOIDCClient by name and namespace.",
            "properties": {
              "name": {
                "description": "Name is the name of the PocketIDOIDCClient CR",
                "type": "string"
              },
              "namespace": {
                "description": "Namespace is the namespace of the PocketIDOIDCClient CR\nDefaults to the referencing resource's namespace",
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "customClaims": {
          "description": "CustomClaims are additional claims to attach to users in this group",
          "items": {
            "description": "CustomClaim defines a custom claim key/value pair for a user group.",
            "properties": {
              "key": {
                "description": "Key is the claim key",
                "type": "string"
              },
              "value": {
                "description": "Value is the claim value",
                "type": "string"
              }
            },
            "required": [
              "key",
              "value"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "friendlyName": {
          "description": "FriendlyName is the display name for the user group",
          "maxLength": 50,
          "minLength": 2,
          "type": "string"
        },
        "instanceSelector": {
          "description": "InstanceSelector selects the PocketIDInstance to reconcile against.\nIf omitted, the controller expects exactly one instance in the cluster.",
          "properties": {
            "matchExpressions": {
              "description": "matchExpressions is a list of label selector requirements. The requirements are ANDed.",
              "items": {
                "description": "A label selector requirement is a selector that contains values, a key, and an operator that\nrelates the key and values.",
                "properties": {
                  "key": {
                    "description": "key is the label key that the selector applies to.",
                    "type": "string"
                  },
                  "operator": {
                    "description": "operator represents a key's relationship to a set of values.\nValid operators are In, NotIn, Exists and DoesNotExist.",
                    "type": "string"
                  },
                  "values": {
                    "description": "values is an array of string values. If the operator is In or NotIn,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. This array is replaced during a strategic\nmerge patch.",
                    "items": {
                      "type": "string"
                    },
                    "type": "array",
                    "x-kubernetes-list-type": "atomic"
                  }
                },
                "required": [
                  "key",
                  "operator"
                ],
                "type": "object",
                "additionalProperties": false
              },
              "type": "array",
              "x-kubernetes-list-type": "atomic"
            },
            "matchLabels": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels\nmap is equivalent to an element of matchExpressions, whose key field is \"key\", the\noperator is \"In\", and the values array contains only \"value\". The requirements are ANDed.",
              "type": "object"
            }
          },
          "type": "object",
          "x-kubernetes-map-type": "atomic",
          "additionalProperties": false
        },
        "name": {
          "description": "Name of the user group. Defaults to the metadata.name",
          "maxLength": 255,
          "minLength": 2,
          "type": "string"
        },
        "users": {
          "description": "Users defines the users to add to this group",
          "properties": {
            "userIDs": {
              "description": "UserIDs are Pocket-ID user IDs to add directly to this group.",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "userRefs": {
              "description": "UserRefs are PocketIDUser custom resources to add to this group",
              "items": {
                "description": "NamespacedUserReference references a PocketIDUser by name and namespace.",
                "properties": {
                  "name": {
                    "description": "Name is the name of the PocketIDUser CR",
                    "type": "string"
                  },
                  "namespace": {
                    "description": "Namespace is the namespace of the PocketIDUser CR\nDefaults to the referencing resource's namespace",
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            },
            "usernames": {
              "description": "Usernames are Pocket-ID usernames to add to this group.\nThe controller will look up the user ID from Pocket-ID by username.",
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "status defines the observed state of PocketIDUserGroup",
      "properties": {
        "allowedOIDCClientIDs": {
          "description": "AllowedOIDCClientIDs are the resolved OIDC client IDs assigned to this group",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "conditions": {
          "description": "Conditions represent the current state of the PocketIDUserGroup resource.",
          "items": {
            "description": "Condition contains details for one aspect of the current state of this API Resource.",
            "properties": {
              "lastTransitionTime": {
                "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "message is a human readable message indicating details about the transition.\nThis may be an empty string.",
                "maxLength": 32768,
                "type": "string"
              },
              "observedGeneration": {
                "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.",
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "reason": {
                "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty.",
                "maxLength": 1024,
                "minLength": 1,
                "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$",
                "type": "string"
              },
              "status": {
                "description": "status of the condition, one of True, False, Unknown.",
                "enum": [
                  "True",
                  "False",
                  "Unknown"
                ],
                "type": "string"
              },
              "type": {
                "description": "type of condition in CamelCase or in foo.example.com/CamelCase.",
                "maxLength": 316,
                "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$",
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "message",
              "reason",
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array",
          "x-kubernetes-list-map-keys": [
            "type"
          ],
          "x-kubernetes-list-type": "map"
        },
        "createdAt": {
          "description": "CreatedAt is the creation timestamp from Pocket-ID",
          "type": "string"
        },
        "customClaims": {
          "description": "CustomClaims are the resolved custom claims on the group",
          "items": {
            "description": "CustomClaim defines a custom claim key/value pair for a user group.",
            "properties": {
              "key": {
                "description": "Key is the claim key",
                "type": "string"
              },
              "value": {
                "description": "Value is the claim value",
                "type": "string"
              }
            },
            "required": [
              "key",
              "value"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "friendlyName": {
          "description": "FriendlyName is the resolved display name from Pocket-ID",
          "type": "string"
        },
        "groupID": {
          "description": "GroupID is the ID assigned by Pocket-ID",
          "type": "string"
        },
        "ldapID": {
          "description": "LdapID is the LDAP identifier if the group is managed via LDAP",
          "type": "string"
        },
        "managedUserIDs": {
          "description": "ManagedUserIDs are the Pocket-ID user IDs that the operator is actively managing.\nUsers not in this list are considered externally managed and won't be removed.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "name": {
          "description": "Name is the resolved group name from Pocket-ID",
          "type": "string"
        },
        "totalUserCount": {
          "description": "TotalUserCount is the total number of users in the group including externally managed",
          "type": "integer"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
