// This file was autogenerated by go-to-protobuf. Do not edit it manually!

// @generated by protoc-gen-es v1.8.0 with parameter "target=ts"
// @generated from file rbac/v1alpha1/generated.proto (package github.com.akuity.kargo.api.rbac.v1alpha1, syntax proto2)
/* eslint-disable */
// @ts-nocheck

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto2 } from "@bufbuild/protobuf";
import { ObjectMeta } from "../../k8s.io/apimachinery/pkg/apis/meta/v1/generated_pb.js";
import { PolicyRule, Role as Role$1, RoleBinding } from "../../k8s.io/api/rbac/v1/generated_pb.js";
import { ServiceAccount } from "../../k8s.io/api/core/v1/generated_pb.js";

/**
 * @generated from message github.com.akuity.kargo.api.rbac.v1alpha1.Claim
 */
export class Claim extends Message<Claim> {
  /**
   * @generated from field: optional string name = 1;
   */
  name?: string;

  /**
   * @generated from field: repeated string values = 2;
   */
  values: string[] = [];

  constructor(data?: PartialMessage<Claim>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "github.com.akuity.kargo.api.rbac.v1alpha1.Claim";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
    { no: 2, name: "values", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Claim {
    return new Claim().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Claim {
    return new Claim().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Claim {
    return new Claim().fromJsonString(jsonString, options);
  }

  static equals(a: Claim | PlainMessage<Claim> | undefined, b: Claim | PlainMessage<Claim> | undefined): boolean {
    return proto2.util.equals(Claim, a, b);
  }
}

/**
 * @generated from message github.com.akuity.kargo.api.rbac.v1alpha1.ResourceDetails
 */
export class ResourceDetails extends Message<ResourceDetails> {
  /**
   * @generated from field: optional string resourceType = 1;
   */
  resourceType?: string;

  /**
   * @generated from field: optional string resourceName = 2;
   */
  resourceName?: string;

  /**
   * @generated from field: repeated string verbs = 3;
   */
  verbs: string[] = [];

  constructor(data?: PartialMessage<ResourceDetails>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "github.com.akuity.kargo.api.rbac.v1alpha1.ResourceDetails";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 1, name: "resourceType", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
    { no: 2, name: "resourceName", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
    { no: 3, name: "verbs", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ResourceDetails {
    return new ResourceDetails().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): ResourceDetails {
    return new ResourceDetails().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ResourceDetails {
    return new ResourceDetails().fromJsonString(jsonString, options);
  }

  static equals(a: ResourceDetails | PlainMessage<ResourceDetails> | undefined, b: ResourceDetails | PlainMessage<ResourceDetails> | undefined): boolean {
    return proto2.util.equals(ResourceDetails, a, b);
  }
}

/**
 * +kubebuilder:object:root=true
 *
 * @generated from message github.com.akuity.kargo.api.rbac.v1alpha1.Role
 */
export class Role extends Message<Role> {
  /**
   * @generated from field: optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
   */
  metadata?: ObjectMeta;

  /**
   * @generated from field: optional bool kargoManaged = 2;
   */
  kargoManaged?: boolean;

  /**
   * @generated from field: repeated github.com.akuity.kargo.api.rbac.v1alpha1.Claim claims = 7;
   */
  claims: Claim[] = [];

  /**
   * @generated from field: repeated k8s.io.api.rbac.v1.PolicyRule rules = 6;
   */
  rules: PolicyRule[] = [];

  constructor(data?: PartialMessage<Role>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "github.com.akuity.kargo.api.rbac.v1alpha1.Role";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 1, name: "metadata", kind: "message", T: ObjectMeta, opt: true },
    { no: 2, name: "kargoManaged", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
    { no: 7, name: "claims", kind: "message", T: Claim, repeated: true },
    { no: 6, name: "rules", kind: "message", T: PolicyRule, repeated: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Role {
    return new Role().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Role {
    return new Role().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Role {
    return new Role().fromJsonString(jsonString, options);
  }

  static equals(a: Role | PlainMessage<Role> | undefined, b: Role | PlainMessage<Role> | undefined): boolean {
    return proto2.util.equals(Role, a, b);
  }
}

/**
 * +kubebuilder:object:root=true
 *
 * @generated from message github.com.akuity.kargo.api.rbac.v1alpha1.RoleResources
 */
export class RoleResources extends Message<RoleResources> {
  /**
   * @generated from field: optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
   */
  metadata?: ObjectMeta;

  /**
   * @generated from field: optional k8s.io.api.core.v1.ServiceAccount serviceAccount = 2;
   */
  serviceAccount?: ServiceAccount;

  /**
   * @generated from field: repeated k8s.io.api.rbac.v1.Role roles = 3;
   */
  roles: Role$1[] = [];

  /**
   * @generated from field: repeated k8s.io.api.rbac.v1.RoleBinding roleBindings = 4;
   */
  roleBindings: RoleBinding[] = [];

  constructor(data?: PartialMessage<RoleResources>) {
    super();
    proto2.util.initPartial(data, this);
  }

  static readonly runtime: typeof proto2 = proto2;
  static readonly typeName = "github.com.akuity.kargo.api.rbac.v1alpha1.RoleResources";
  static readonly fields: FieldList = proto2.util.newFieldList(() => [
    { no: 1, name: "metadata", kind: "message", T: ObjectMeta, opt: true },
    { no: 2, name: "serviceAccount", kind: "message", T: ServiceAccount, opt: true },
    { no: 3, name: "roles", kind: "message", T: Role$1, repeated: true },
    { no: 4, name: "roleBindings", kind: "message", T: RoleBinding, repeated: true },
  ]);

  static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): RoleResources {
    return new RoleResources().fromBinary(bytes, options);
  }

  static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): RoleResources {
    return new RoleResources().fromJson(jsonValue, options);
  }

  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): RoleResources {
    return new RoleResources().fromJsonString(jsonString, options);
  }

  static equals(a: RoleResources | PlainMessage<RoleResources> | undefined, b: RoleResources | PlainMessage<RoleResources> | undefined): boolean {
    return proto2.util.equals(RoleResources, a, b);
  }
}

