// Copyright IBM Corp. 2020, 2026
// SPDX-License-Identifier: MPL-2.0

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.11
// 	protoc        (unknown)
// source: controller/api/resources/policies/v1/policy.proto

package policies

import (
	scopes "github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/scopes"
	_ "github.com/hashicorp/boundary/sdk/pbs/controller/protooptions"
	_ "google.golang.org/genproto/googleapis/api/visibility"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	structpb "google.golang.org/protobuf/types/known/structpb"
	timestamppb "google.golang.org/protobuf/types/known/timestamppb"
	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

type Policy struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Output only. The id of the storage policy.
	Id string `protobuf:"bytes,10,opt,name=id,proto3" json:"id,omitempty" class:"public" eventstream:"observation"` // @gotags: `class:"public" eventstream:"observation"`
	// The scope id of this policy. This must be defined for policy creation, but
	// is otherwise output only.
	ScopeId string `protobuf:"bytes,20,opt,name=scope_id,proto3" json:"scope_id,omitempty" class:"public" eventstream:"observation"` // @gotags: `class:"public" eventstream:"observation"`
	// Output only. Scope information for this resource.
	Scope *scopes.ScopeInfo `protobuf:"bytes,30,opt,name=scope,proto3" json:"scope,omitempty"`
	// Optional name for identification purposes.
	Name *wrapperspb.StringValue `protobuf:"bytes,40,opt,name=name,proto3" json:"name,omitempty" class:"public"` // @gotags: `class:"public"`
	// Optional user-set description for identification purposes.
	Description *wrapperspb.StringValue `protobuf:"bytes,50,opt,name=description,proto3" json:"description,omitempty" class:"public"` // @gotags: `class:"public"`
	// Output only. The time this resource was created.
	CreatedTime *timestamppb.Timestamp `protobuf:"bytes,60,opt,name=created_time,proto3" json:"created_time,omitempty" class:"public" eventstream:"observation"` // @gotags: `class:"public" eventstream:"observation"`
	// Output only. The time this resource was last updated.
	UpdatedTime *timestamppb.Timestamp `protobuf:"bytes,70,opt,name=updated_time,proto3" json:"updated_time,omitempty" class:"public" eventstream:"observation"` // @gotags: `class:"public" eventstream:"observation"`
	// The policy's type.
	Type string `protobuf:"bytes,80,opt,name=type,proto3" json:"type,omitempty" class:"public" eventstream:"observation"` // @gotags: `class:"public" eventstream:"observation"`
	// Version is used in mutation requests, after the initial creation, to ensure
	// this resource has not changed. The mutation will fail if the version does
	// not match the latest known good version.
	Version uint32 `protobuf:"varint,90,opt,name=version,proto3" json:"version,omitempty" class:"public"` // @gotags: `class:"public"`
	// The attributes that are applicable to each policy type.
	//
	// Types that are valid to be assigned to Attrs:
	//
	//	*Policy_Attributes
	//	*Policy_StoragePolicyAttributes
	Attrs isPolicy_Attrs `protobuf_oneof:"attrs"`
	// Output only. The available actions on this resource for this user.
	AuthorizedActions []string `protobuf:"bytes,300,rep,name=authorized_actions,proto3" json:"authorized_actions,omitempty" class:"public"` // @gotags: `class:"public"`
	unknownFields     protoimpl.UnknownFields
	sizeCache         protoimpl.SizeCache
}

func (x *Policy) Reset() {
	*x = Policy{}
	mi := &file_controller_api_resources_policies_v1_policy_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *Policy) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*Policy) ProtoMessage() {}

func (x *Policy) ProtoReflect() protoreflect.Message {
	mi := &file_controller_api_resources_policies_v1_policy_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use Policy.ProtoReflect.Descriptor instead.
func (*Policy) Descriptor() ([]byte, []int) {
	return file_controller_api_resources_policies_v1_policy_proto_rawDescGZIP(), []int{0}
}

func (x *Policy) GetId() string {
	if x != nil {
		return x.Id
	}
	return ""
}

func (x *Policy) GetScopeId() string {
	if x != nil {
		return x.ScopeId
	}
	return ""
}

func (x *Policy) GetScope() *scopes.ScopeInfo {
	if x != nil {
		return x.Scope
	}
	return nil
}

func (x *Policy) GetName() *wrapperspb.StringValue {
	if x != nil {
		return x.Name
	}
	return nil
}

func (x *Policy) GetDescription() *wrapperspb.StringValue {
	if x != nil {
		return x.Description
	}
	return nil
}

func (x *Policy) GetCreatedTime() *timestamppb.Timestamp {
	if x != nil {
		return x.CreatedTime
	}
	return nil
}

func (x *Policy) GetUpdatedTime() *timestamppb.Timestamp {
	if x != nil {
		return x.UpdatedTime
	}
	return nil
}

func (x *Policy) GetType() string {
	if x != nil {
		return x.Type
	}
	return ""
}

func (x *Policy) GetVersion() uint32 {
	if x != nil {
		return x.Version
	}
	return 0
}

func (x *Policy) GetAttrs() isPolicy_Attrs {
	if x != nil {
		return x.Attrs
	}
	return nil
}

func (x *Policy) GetAttributes() *structpb.Struct {
	if x != nil {
		if x, ok := x.Attrs.(*Policy_Attributes); ok {
			return x.Attributes
		}
	}
	return nil
}

func (x *Policy) GetStoragePolicyAttributes() *StoragePolicyAttributes {
	if x != nil {
		if x, ok := x.Attrs.(*Policy_StoragePolicyAttributes); ok {
			return x.StoragePolicyAttributes
		}
	}
	return nil
}

func (x *Policy) GetAuthorizedActions() []string {
	if x != nil {
		return x.AuthorizedActions
	}
	return nil
}

type isPolicy_Attrs interface {
	isPolicy_Attrs()
}

type Policy_Attributes struct {
	Attributes *structpb.Struct `protobuf:"bytes,100,opt,name=attributes,proto3,oneof"`
}

type Policy_StoragePolicyAttributes struct {
	StoragePolicyAttributes *StoragePolicyAttributes `protobuf:"bytes,101,opt,name=storage_policy_attributes,json=storagePolicyAttributes,proto3,oneof"`
}

func (*Policy_Attributes) isPolicy_Attrs() {}

func (*Policy_StoragePolicyAttributes) isPolicy_Attrs() {}

type StoragePolicyAttributes struct {
	state         protoimpl.MessageState    `protogen:"open.v1"`
	RetainFor     *StoragePolicyRetainFor   `protobuf:"bytes,10,opt,name=retain_for,proto3" json:"retain_for,omitempty"`
	DeleteAfter   *StoragePolicyDeleteAfter `protobuf:"bytes,20,opt,name=delete_after,proto3" json:"delete_after,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *StoragePolicyAttributes) Reset() {
	*x = StoragePolicyAttributes{}
	mi := &file_controller_api_resources_policies_v1_policy_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *StoragePolicyAttributes) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*StoragePolicyAttributes) ProtoMessage() {}

func (x *StoragePolicyAttributes) ProtoReflect() protoreflect.Message {
	mi := &file_controller_api_resources_policies_v1_policy_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use StoragePolicyAttributes.ProtoReflect.Descriptor instead.
func (*StoragePolicyAttributes) Descriptor() ([]byte, []int) {
	return file_controller_api_resources_policies_v1_policy_proto_rawDescGZIP(), []int{1}
}

func (x *StoragePolicyAttributes) GetRetainFor() *StoragePolicyRetainFor {
	if x != nil {
		return x.RetainFor
	}
	return nil
}

func (x *StoragePolicyAttributes) GetDeleteAfter() *StoragePolicyDeleteAfter {
	if x != nil {
		return x.DeleteAfter
	}
	return nil
}

type StoragePolicyRetainFor struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// days is the number of days for which a session recording will be
	// retained. Must be provided.
	Days int32 `protobuf:"varint,10,opt,name=days,proto3" json:"days,omitempty" class:"public"` // @gotags: `class:"public"`
	// overridable signals whether this storage policy's retention duration can be
	// overridden.
	Overridable   *wrapperspb.BoolValue `protobuf:"bytes,20,opt,name=overridable,proto3" json:"overridable,omitempty" class:"public"` // @gotags: `class:"public"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *StoragePolicyRetainFor) Reset() {
	*x = StoragePolicyRetainFor{}
	mi := &file_controller_api_resources_policies_v1_policy_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *StoragePolicyRetainFor) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*StoragePolicyRetainFor) ProtoMessage() {}

func (x *StoragePolicyRetainFor) ProtoReflect() protoreflect.Message {
	mi := &file_controller_api_resources_policies_v1_policy_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use StoragePolicyRetainFor.ProtoReflect.Descriptor instead.
func (*StoragePolicyRetainFor) Descriptor() ([]byte, []int) {
	return file_controller_api_resources_policies_v1_policy_proto_rawDescGZIP(), []int{2}
}

func (x *StoragePolicyRetainFor) GetDays() int32 {
	if x != nil {
		return x.Days
	}
	return 0
}

func (x *StoragePolicyRetainFor) GetOverridable() *wrapperspb.BoolValue {
	if x != nil {
		return x.Overridable
	}
	return nil
}

type StoragePolicyDeleteAfter struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// days is the number of days after which a session recording will be
	// automatically deleted.
	Days int32 `protobuf:"varint,10,opt,name=days,proto3" json:"days,omitempty" class:"public"` // @gotags: `class:"public"`
	// overridable signals whether this storage policy's deletion policy can be
	// overridden.
	Overridable   *wrapperspb.BoolValue `protobuf:"bytes,20,opt,name=overridable,proto3" json:"overridable,omitempty" class:"public"` // @gotags: `class:"public"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *StoragePolicyDeleteAfter) Reset() {
	*x = StoragePolicyDeleteAfter{}
	mi := &file_controller_api_resources_policies_v1_policy_proto_msgTypes[3]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *StoragePolicyDeleteAfter) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*StoragePolicyDeleteAfter) ProtoMessage() {}

func (x *StoragePolicyDeleteAfter) ProtoReflect() protoreflect.Message {
	mi := &file_controller_api_resources_policies_v1_policy_proto_msgTypes[3]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use StoragePolicyDeleteAfter.ProtoReflect.Descriptor instead.
func (*StoragePolicyDeleteAfter) Descriptor() ([]byte, []int) {
	return file_controller_api_resources_policies_v1_policy_proto_rawDescGZIP(), []int{3}
}

func (x *StoragePolicyDeleteAfter) GetDays() int32 {
	if x != nil {
		return x.Days
	}
	return 0
}

func (x *StoragePolicyDeleteAfter) GetOverridable() *wrapperspb.BoolValue {
	if x != nil {
		return x.Overridable
	}
	return nil
}

var File_controller_api_resources_policies_v1_policy_proto protoreflect.FileDescriptor

const file_controller_api_resources_policies_v1_policy_proto_rawDesc = "" +
	"\n" +
	"1controller/api/resources/policies/v1/policy.proto\x12$controller.api.resources.policies.v1\x1a.controller/api/resources/scopes/v1/scope.proto\x1a*controller/custom_options/v1/options.proto\x1a\x1bgoogle/api/visibility.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xf8\x05\n" +
	"\x06Policy\x12\x0e\n" +
	"\x02id\x18\n" +
	" \x01(\tR\x02id\x12\x1a\n" +
	"\bscope_id\x18\x14 \x01(\tR\bscope_id\x12C\n" +
	"\x05scope\x18\x1e \x01(\v2-.controller.api.resources.scopes.v1.ScopeInfoR\x05scope\x12F\n" +
	"\x04name\x18( \x01(\v2\x1c.google.protobuf.StringValueB\x14\xa0\xda)\x01\xc2\xdd)\f\n" +
	"\x04name\x12\x04NameR\x04name\x12b\n" +
	"\vdescription\x182 \x01(\v2\x1c.google.protobuf.StringValueB\"\xa0\xda)\x01\xc2\xdd)\x1a\n" +
	"\vdescription\x12\vDescriptionR\vdescription\x12>\n" +
	"\fcreated_time\x18< \x01(\v2\x1a.google.protobuf.TimestampR\fcreated_time\x12>\n" +
	"\fupdated_time\x18F \x01(\v2\x1a.google.protobuf.TimestampR\fupdated_time\x12\x12\n" +
	"\x04type\x18P \x01(\tR\x04type\x12\x18\n" +
	"\aversion\x18Z \x01(\rR\aversion\x12J\n" +
	"\n" +
	"attributes\x18d \x01(\v2\x17.google.protobuf.StructB\x0f\xa0\xda)\x01\x9a\xe3)\adefaultH\x00R\n" +
	"attributes\x12\x9c\x01\n" +
	"\x19storage_policy_attributes\x18e \x01(\v2=.controller.api.resources.policies.v1.StoragePolicyAttributesB\x1f\xa0\xda)\x01\x9a\xe3)\astorage\xfa\xd2\xe4\x93\x02\n" +
	"\x12\bINTERNALH\x00R\x17storagePolicyAttributes\x12/\n" +
	"\x12authorized_actions\x18\xac\x02 \x03(\tR\x12authorized_actionsB\a\n" +
	"\x05attrs\"\xdb\x01\n" +
	"\x17StoragePolicyAttributes\x12\\\n" +
	"\n" +
	"retain_for\x18\n" +
	" \x01(\v2<.controller.api.resources.policies.v1.StoragePolicyRetainForR\n" +
	"retain_for\x12b\n" +
	"\fdelete_after\x18\x14 \x01(\v2>.controller.api.resources.policies.v1.StoragePolicyDeleteAfterR\fdelete_after\"\xde\x01\n" +
	"\x16StoragePolicyRetainFor\x12C\n" +
	"\x04days\x18\n" +
	" \x01(\x05B/\xc2\xdd)+\n" +
	"\x1aattributes.retain_for.days\x12\rRetainForDaysR\x04days\x12\x7f\n" +
	"\voverridable\x18\x14 \x01(\v2\x1a.google.protobuf.BoolValueBA\xc2\xdd)=\n" +
	"!attributes.retain_for.overridable\x12\x18RetainForDaysOverridableR\voverridable\"\xe9\x01\n" +
	"\x18StoragePolicyDeleteAfter\x12G\n" +
	"\x04days\x18\n" +
	" \x01(\x05B3\xc2\xdd)/\n" +
	"\x1cattributes.delete_after.days\x12\x0fDeleteAfterDaysR\x04days\x12\x83\x01\n" +
	"\voverridable\x18\x14 \x01(\v2\x1a.google.protobuf.BoolValueBE\xc2\xdd)A\n" +
	"#attributes.delete_after.overridable\x12\x1aDeleteAfterDaysOverridableR\voverridableBRZPgithub.com/hashicorp/boundary/sdk/pbs/controller/api/resources/policies;policiesb\x06proto3"

var (
	file_controller_api_resources_policies_v1_policy_proto_rawDescOnce sync.Once
	file_controller_api_resources_policies_v1_policy_proto_rawDescData []byte
)

func file_controller_api_resources_policies_v1_policy_proto_rawDescGZIP() []byte {
	file_controller_api_resources_policies_v1_policy_proto_rawDescOnce.Do(func() {
		file_controller_api_resources_policies_v1_policy_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_controller_api_resources_policies_v1_policy_proto_rawDesc), len(file_controller_api_resources_policies_v1_policy_proto_rawDesc)))
	})
	return file_controller_api_resources_policies_v1_policy_proto_rawDescData
}

var file_controller_api_resources_policies_v1_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_controller_api_resources_policies_v1_policy_proto_goTypes = []any{
	(*Policy)(nil),                   // 0: controller.api.resources.policies.v1.Policy
	(*StoragePolicyAttributes)(nil),  // 1: controller.api.resources.policies.v1.StoragePolicyAttributes
	(*StoragePolicyRetainFor)(nil),   // 2: controller.api.resources.policies.v1.StoragePolicyRetainFor
	(*StoragePolicyDeleteAfter)(nil), // 3: controller.api.resources.policies.v1.StoragePolicyDeleteAfter
	(*scopes.ScopeInfo)(nil),         // 4: controller.api.resources.scopes.v1.ScopeInfo
	(*wrapperspb.StringValue)(nil),   // 5: google.protobuf.StringValue
	(*timestamppb.Timestamp)(nil),    // 6: google.protobuf.Timestamp
	(*structpb.Struct)(nil),          // 7: google.protobuf.Struct
	(*wrapperspb.BoolValue)(nil),     // 8: google.protobuf.BoolValue
}
var file_controller_api_resources_policies_v1_policy_proto_depIdxs = []int32{
	4,  // 0: controller.api.resources.policies.v1.Policy.scope:type_name -> controller.api.resources.scopes.v1.ScopeInfo
	5,  // 1: controller.api.resources.policies.v1.Policy.name:type_name -> google.protobuf.StringValue
	5,  // 2: controller.api.resources.policies.v1.Policy.description:type_name -> google.protobuf.StringValue
	6,  // 3: controller.api.resources.policies.v1.Policy.created_time:type_name -> google.protobuf.Timestamp
	6,  // 4: controller.api.resources.policies.v1.Policy.updated_time:type_name -> google.protobuf.Timestamp
	7,  // 5: controller.api.resources.policies.v1.Policy.attributes:type_name -> google.protobuf.Struct
	1,  // 6: controller.api.resources.policies.v1.Policy.storage_policy_attributes:type_name -> controller.api.resources.policies.v1.StoragePolicyAttributes
	2,  // 7: controller.api.resources.policies.v1.StoragePolicyAttributes.retain_for:type_name -> controller.api.resources.policies.v1.StoragePolicyRetainFor
	3,  // 8: controller.api.resources.policies.v1.StoragePolicyAttributes.delete_after:type_name -> controller.api.resources.policies.v1.StoragePolicyDeleteAfter
	8,  // 9: controller.api.resources.policies.v1.StoragePolicyRetainFor.overridable:type_name -> google.protobuf.BoolValue
	8,  // 10: controller.api.resources.policies.v1.StoragePolicyDeleteAfter.overridable:type_name -> google.protobuf.BoolValue
	11, // [11:11] is the sub-list for method output_type
	11, // [11:11] is the sub-list for method input_type
	11, // [11:11] is the sub-list for extension type_name
	11, // [11:11] is the sub-list for extension extendee
	0,  // [0:11] is the sub-list for field type_name
}

func init() { file_controller_api_resources_policies_v1_policy_proto_init() }
func file_controller_api_resources_policies_v1_policy_proto_init() {
	if File_controller_api_resources_policies_v1_policy_proto != nil {
		return
	}
	file_controller_api_resources_policies_v1_policy_proto_msgTypes[0].OneofWrappers = []any{
		(*Policy_Attributes)(nil),
		(*Policy_StoragePolicyAttributes)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_controller_api_resources_policies_v1_policy_proto_rawDesc), len(file_controller_api_resources_policies_v1_policy_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_controller_api_resources_policies_v1_policy_proto_goTypes,
		DependencyIndexes: file_controller_api_resources_policies_v1_policy_proto_depIdxs,
		MessageInfos:      file_controller_api_resources_policies_v1_policy_proto_msgTypes,
	}.Build()
	File_controller_api_resources_policies_v1_policy_proto = out.File
	file_controller_api_resources_policies_v1_policy_proto_goTypes = nil
	file_controller_api_resources_policies_v1_policy_proto_depIdxs = nil
}
