/*
Copyright 2022 The Knative Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Code generated by client-gen. DO NOT EDIT.

package v1

import (
	context "context"

	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	types "k8s.io/apimachinery/pkg/types"
	watch "k8s.io/apimachinery/pkg/watch"
	gentype "k8s.io/client-go/gentype"
	servingv1 "knative.dev/serving/pkg/apis/serving/v1"
	scheme "knative.dev/serving/pkg/client/clientset/versioned/scheme"
)

// RoutesGetter has a method to return a RouteInterface.
// A group's client should implement this interface.
type RoutesGetter interface {
	Routes(namespace string) RouteInterface
}

// RouteInterface has methods to work with Route resources.
type RouteInterface interface {
	Create(ctx context.Context, route *servingv1.Route, opts metav1.CreateOptions) (*servingv1.Route, error)
	Update(ctx context.Context, route *servingv1.Route, opts metav1.UpdateOptions) (*servingv1.Route, error)
	// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
	UpdateStatus(ctx context.Context, route *servingv1.Route, opts metav1.UpdateOptions) (*servingv1.Route, error)
	Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
	DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
	Get(ctx context.Context, name string, opts metav1.GetOptions) (*servingv1.Route, error)
	List(ctx context.Context, opts metav1.ListOptions) (*servingv1.RouteList, error)
	Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
	Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *servingv1.Route, err error)
	RouteExpansion
}

// routes implements RouteInterface
type routes struct {
	*gentype.ClientWithList[*servingv1.Route, *servingv1.RouteList]
}

// newRoutes returns a Routes
func newRoutes(c *ServingV1Client, namespace string) *routes {
	return &routes{
		gentype.NewClientWithList[*servingv1.Route, *servingv1.RouteList](
			"routes",
			c.RESTClient(),
			scheme.ParameterCodec,
			namespace,
			func() *servingv1.Route { return &servingv1.Route{} },
			func() *servingv1.RouteList { return &servingv1.RouteList{} },
		),
	}
}
