// Code generated by crd2pulumi DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***

package v1alpha1

import (
	"context"
	"reflect"

	"antoine-roux.tk/projects/go/pulumi-library/crds/kubernetes/internal"
	v1 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/meta/v1"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumix"
)

// TLSOption is the CRD implementation of a Traefik TLS Option, allowing to configure some parameters of the TLS connection.
// More info: https://doc.traefik.io/traefik/v3.0/https/tls/#tls-options
type TLSOption struct {
	pulumi.CustomResourceState

	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
	Kind       pulumi.StringPtrOutput `pulumi:"kind"`
	Metadata   v1.ObjectMetaOutput    `pulumi:"metadata"`
	// TLSOptionSpec defines the desired state of a TLSOption.
	Spec TLSOptionSpecOutput `pulumi:"spec"`
}

// NewTLSOption registers a new resource with the given unique name, arguments, and options.
func NewTLSOption(ctx *pulumi.Context,
	name string, args *TLSOptionArgs, opts ...pulumi.ResourceOption) (*TLSOption, error) {
	if args == nil {
		args = &TLSOptionArgs{}
	}

	args.ApiVersion = pulumi.StringPtr("traefik.io/v1alpha1")
	args.Kind = pulumi.StringPtr("TLSOption")
	opts = internal.PkgResourceDefaultOpts(opts)
	var resource TLSOption
	err := ctx.RegisterResource("kubernetes:traefik.io/v1alpha1:TLSOption", name, args, &resource, opts...)
	if err != nil {
		return nil, err
	}
	return &resource, nil
}

// GetTLSOption gets an existing TLSOption resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetTLSOption(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *TLSOptionState, opts ...pulumi.ResourceOption) (*TLSOption, error) {
	var resource TLSOption
	err := ctx.ReadResource("kubernetes:traefik.io/v1alpha1:TLSOption", name, id, state, &resource, opts...)
	if err != nil {
		return nil, err
	}
	return &resource, nil
}

// Input properties used for looking up and filtering TLSOption resources.
type tlsoptionState struct {
}

type TLSOptionState struct {
}

func (TLSOptionState) ElementType() reflect.Type {
	return reflect.TypeOf((*tlsoptionState)(nil)).Elem()
}

type tlsoptionArgs struct {
	ApiVersion *string        `pulumi:"apiVersion"`
	Kind       *string        `pulumi:"kind"`
	Metadata   *v1.ObjectMeta `pulumi:"metadata"`
	// TLSOptionSpec defines the desired state of a TLSOption.
	Spec *TLSOptionSpec `pulumi:"spec"`
}

// The set of arguments for constructing a TLSOption resource.
type TLSOptionArgs struct {
	ApiVersion pulumi.StringPtrInput
	Kind       pulumi.StringPtrInput
	Metadata   v1.ObjectMetaPtrInput
	// TLSOptionSpec defines the desired state of a TLSOption.
	Spec TLSOptionSpecPtrInput
}

func (TLSOptionArgs) ElementType() reflect.Type {
	return reflect.TypeOf((*tlsoptionArgs)(nil)).Elem()
}

type TLSOptionInput interface {
	pulumi.Input

	ToTLSOptionOutput() TLSOptionOutput
	ToTLSOptionOutputWithContext(ctx context.Context) TLSOptionOutput
}

func (*TLSOption) ElementType() reflect.Type {
	return reflect.TypeOf((**TLSOption)(nil)).Elem()
}

func (i *TLSOption) ToTLSOptionOutput() TLSOptionOutput {
	return i.ToTLSOptionOutputWithContext(context.Background())
}

func (i *TLSOption) ToTLSOptionOutputWithContext(ctx context.Context) TLSOptionOutput {
	return pulumi.ToOutputWithContext(ctx, i).(TLSOptionOutput)
}

func (i *TLSOption) ToOutput(ctx context.Context) pulumix.Output[*TLSOption] {
	return pulumix.Output[*TLSOption]{
		OutputState: i.ToTLSOptionOutputWithContext(ctx).OutputState,
	}
}

type TLSOptionOutput struct{ *pulumi.OutputState }

func (TLSOptionOutput) ElementType() reflect.Type {
	return reflect.TypeOf((**TLSOption)(nil)).Elem()
}

func (o TLSOptionOutput) ToTLSOptionOutput() TLSOptionOutput {
	return o
}

func (o TLSOptionOutput) ToTLSOptionOutputWithContext(ctx context.Context) TLSOptionOutput {
	return o
}

func (o TLSOptionOutput) ToOutput(ctx context.Context) pulumix.Output[*TLSOption] {
	return pulumix.Output[*TLSOption]{
		OutputState: o.OutputState,
	}
}

func (o TLSOptionOutput) ApiVersion() pulumi.StringPtrOutput {
	return o.ApplyT(func(v *TLSOption) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
}

func (o TLSOptionOutput) Kind() pulumi.StringPtrOutput {
	return o.ApplyT(func(v *TLSOption) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
}

func (o TLSOptionOutput) Metadata() v1.ObjectMetaOutput {
	return o.ApplyT(func(v *TLSOption) v1.ObjectMetaOutput { return v.Metadata }).(v1.ObjectMetaOutput)
}

// TLSOptionSpec defines the desired state of a TLSOption.
func (o TLSOptionOutput) Spec() TLSOptionSpecOutput {
	return o.ApplyT(func(v *TLSOption) TLSOptionSpecOutput { return v.Spec }).(TLSOptionSpecOutput)
}

func init() {
	pulumi.RegisterInputType(reflect.TypeOf((*TLSOptionInput)(nil)).Elem(), &TLSOption{})
	pulumi.RegisterOutputType(TLSOptionOutput{})
}
