/*
Copyright 2020 The Flux 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 v2

import (
	context "context"

	apisixv2 "github.com/fluxcd/flagger/pkg/apis/apisix/v2"
	scheme "github.com/fluxcd/flagger/pkg/client/clientset/versioned/scheme"
	v1 "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"
)

// ApisixRoutesGetter has a method to return a ApisixRouteInterface.
// A group's client should implement this interface.
type ApisixRoutesGetter interface {
	ApisixRoutes(namespace string) ApisixRouteInterface
}

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

// apisixRoutes implements ApisixRouteInterface
type apisixRoutes struct {
	*gentype.ClientWithList[*apisixv2.ApisixRoute, *apisixv2.ApisixRouteList]
}

// newApisixRoutes returns a ApisixRoutes
func newApisixRoutes(c *ApisixV2Client, namespace string) *apisixRoutes {
	return &apisixRoutes{
		gentype.NewClientWithList[*apisixv2.ApisixRoute, *apisixv2.ApisixRouteList](
			"apisixroutes",
			c.RESTClient(),
			scheme.ParameterCodec,
			namespace,
			func() *apisixv2.ApisixRoute { return &apisixv2.ApisixRoute{} },
			func() *apisixv2.ApisixRouteList { return &apisixv2.ApisixRouteList{} },
		),
	}
}
