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

package v1beta1

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"
)

// A CertificateRequest is used to request a signed certificate from one of the configured issuers.
//
//	All fields within the CertificateRequest's `spec` are immutable after creation. A CertificateRequest will either succeed or fail, as denoted by its `status.state` field.
//	A CertificateRequest is a one-shot resource, meaning it represents a single point in time request for a certificate and cannot be re-used.
type CertificateRequest struct {
	pulumi.CustomResourceState

	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
	Kind       pulumi.StringPtrOutput `pulumi:"kind"`
	Metadata   v1.ObjectMetaPtrOutput `pulumi:"metadata"`
	// Desired state of the CertificateRequest resource.
	Spec CertificateRequestSpecOutput `pulumi:"spec"`
	// Status of the CertificateRequest. This is set and managed automatically.
	Status CertificateRequestStatusPtrOutput `pulumi:"status"`
}

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

	args.ApiVersion = pulumi.StringPtr("cert-manager.io/v1beta1")
	args.Kind = pulumi.StringPtr("CertificateRequest")
	opts = internal.PkgResourceDefaultOpts(opts)
	var resource CertificateRequest
	err := ctx.RegisterResource("kubernetes:cert-manager.io/v1beta1:CertificateRequest", name, args, &resource, opts...)
	if err != nil {
		return nil, err
	}
	return &resource, nil
}

// GetCertificateRequest gets an existing CertificateRequest 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 GetCertificateRequest(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *CertificateRequestState, opts ...pulumi.ResourceOption) (*CertificateRequest, error) {
	var resource CertificateRequest
	err := ctx.ReadResource("kubernetes:cert-manager.io/v1beta1:CertificateRequest", name, id, state, &resource, opts...)
	if err != nil {
		return nil, err
	}
	return &resource, nil
}

// Input properties used for looking up and filtering CertificateRequest resources.
type certificateRequestState struct {
}

type CertificateRequestState struct {
}

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

type certificateRequestArgs struct {
	ApiVersion *string        `pulumi:"apiVersion"`
	Kind       *string        `pulumi:"kind"`
	Metadata   *v1.ObjectMeta `pulumi:"metadata"`
	// Desired state of the CertificateRequest resource.
	Spec *CertificateRequestSpec `pulumi:"spec"`
	// Status of the CertificateRequest. This is set and managed automatically.
	Status *CertificateRequestStatus `pulumi:"status"`
}

// The set of arguments for constructing a CertificateRequest resource.
type CertificateRequestArgs struct {
	ApiVersion pulumi.StringPtrInput
	Kind       pulumi.StringPtrInput
	Metadata   v1.ObjectMetaPtrInput
	// Desired state of the CertificateRequest resource.
	Spec CertificateRequestSpecPtrInput
	// Status of the CertificateRequest. This is set and managed automatically.
	Status CertificateRequestStatusPtrInput
}

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

type CertificateRequestInput interface {
	pulumi.Input

	ToCertificateRequestOutput() CertificateRequestOutput
	ToCertificateRequestOutputWithContext(ctx context.Context) CertificateRequestOutput
}

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

func (i *CertificateRequest) ToCertificateRequestOutput() CertificateRequestOutput {
	return i.ToCertificateRequestOutputWithContext(context.Background())
}

func (i *CertificateRequest) ToCertificateRequestOutputWithContext(ctx context.Context) CertificateRequestOutput {
	return pulumi.ToOutputWithContext(ctx, i).(CertificateRequestOutput)
}

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

type CertificateRequestOutput struct{ *pulumi.OutputState }

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

func (o CertificateRequestOutput) ToCertificateRequestOutput() CertificateRequestOutput {
	return o
}

func (o CertificateRequestOutput) ToCertificateRequestOutputWithContext(ctx context.Context) CertificateRequestOutput {
	return o
}

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

func (o CertificateRequestOutput) ApiVersion() pulumi.StringPtrOutput {
	return o.ApplyT(func(v *CertificateRequest) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
}

func (o CertificateRequestOutput) Kind() pulumi.StringPtrOutput {
	return o.ApplyT(func(v *CertificateRequest) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
}

func (o CertificateRequestOutput) Metadata() v1.ObjectMetaPtrOutput {
	return o.ApplyT(func(v *CertificateRequest) v1.ObjectMetaPtrOutput { return v.Metadata }).(v1.ObjectMetaPtrOutput)
}

// Desired state of the CertificateRequest resource.
func (o CertificateRequestOutput) Spec() CertificateRequestSpecOutput {
	return o.ApplyT(func(v *CertificateRequest) CertificateRequestSpecOutput { return v.Spec }).(CertificateRequestSpecOutput)
}

// Status of the CertificateRequest. This is set and managed automatically.
func (o CertificateRequestOutput) Status() CertificateRequestStatusPtrOutput {
	return o.ApplyT(func(v *CertificateRequest) CertificateRequestStatusPtrOutput { return v.Status }).(CertificateRequestStatusPtrOutput)
}

func init() {
	pulumi.RegisterInputType(reflect.TypeOf((*CertificateRequestInput)(nil)).Elem(), &CertificateRequest{})
	pulumi.RegisterOutputType(CertificateRequestOutput{})
}
