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

// IngressRoute is the CRD implementation of a Traefik HTTP Router.
type IngressRoute struct {
	pulumi.CustomResourceState

	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
	Kind       pulumi.StringPtrOutput `pulumi:"kind"`
	Metadata   v1.ObjectMetaOutput    `pulumi:"metadata"`
	// IngressRouteSpec defines the desired state of IngressRoute.
	Spec IngressRouteSpecOutput `pulumi:"spec"`
}

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

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

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

// Input properties used for looking up and filtering IngressRoute resources.
type ingressRouteState struct {
}

type IngressRouteState struct {
}

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

type ingressRouteArgs struct {
	ApiVersion *string        `pulumi:"apiVersion"`
	Kind       *string        `pulumi:"kind"`
	Metadata   *v1.ObjectMeta `pulumi:"metadata"`
	// IngressRouteSpec defines the desired state of IngressRoute.
	Spec *IngressRouteSpec `pulumi:"spec"`
}

// The set of arguments for constructing a IngressRoute resource.
type IngressRouteArgs struct {
	ApiVersion pulumi.StringPtrInput
	Kind       pulumi.StringPtrInput
	Metadata   v1.ObjectMetaPtrInput
	// IngressRouteSpec defines the desired state of IngressRoute.
	Spec IngressRouteSpecPtrInput
}

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

type IngressRouteInput interface {
	pulumi.Input

	ToIngressRouteOutput() IngressRouteOutput
	ToIngressRouteOutputWithContext(ctx context.Context) IngressRouteOutput
}

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

func (i *IngressRoute) ToIngressRouteOutput() IngressRouteOutput {
	return i.ToIngressRouteOutputWithContext(context.Background())
}

func (i *IngressRoute) ToIngressRouteOutputWithContext(ctx context.Context) IngressRouteOutput {
	return pulumi.ToOutputWithContext(ctx, i).(IngressRouteOutput)
}

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

type IngressRouteOutput struct{ *pulumi.OutputState }

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

func (o IngressRouteOutput) ToIngressRouteOutput() IngressRouteOutput {
	return o
}

func (o IngressRouteOutput) ToIngressRouteOutputWithContext(ctx context.Context) IngressRouteOutput {
	return o
}

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

func (o IngressRouteOutput) ApiVersion() pulumi.StringPtrOutput {
	return o.ApplyT(func(v *IngressRoute) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
}

func (o IngressRouteOutput) Kind() pulumi.StringPtrOutput {
	return o.ApplyT(func(v *IngressRoute) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
}

func (o IngressRouteOutput) Metadata() v1.ObjectMetaOutput {
	return o.ApplyT(func(v *IngressRoute) v1.ObjectMetaOutput { return v.Metadata }).(v1.ObjectMetaOutput)
}

// IngressRouteSpec defines the desired state of IngressRoute.
func (o IngressRouteOutput) Spec() IngressRouteSpecOutput {
	return o.ApplyT(func(v *IngressRoute) IngressRouteSpecOutput { return v.Spec }).(IngressRouteSpecOutput)
}

func init() {
	pulumi.RegisterInputType(reflect.TypeOf((*IngressRouteInput)(nil)).Elem(), &IngressRoute{})
	pulumi.RegisterOutputType(IngressRouteOutput{})
}
