// Copyright 2020-2022 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

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

package v1alpha1

import (
	v1alpha1 "go.pinniped.dev/generated/1.17/apis/concierge/login/v1alpha1"
	rest "k8s.io/client-go/rest"
)

// TokenCredentialRequestsGetter has a method to return a TokenCredentialRequestInterface.
// A group's client should implement this interface.
type TokenCredentialRequestsGetter interface {
	TokenCredentialRequests() TokenCredentialRequestInterface
}

// TokenCredentialRequestInterface has methods to work with TokenCredentialRequest resources.
type TokenCredentialRequestInterface interface {
	Create(*v1alpha1.TokenCredentialRequest) (*v1alpha1.TokenCredentialRequest, error)
	TokenCredentialRequestExpansion
}

// tokenCredentialRequests implements TokenCredentialRequestInterface
type tokenCredentialRequests struct {
	client rest.Interface
}

// newTokenCredentialRequests returns a TokenCredentialRequests
func newTokenCredentialRequests(c *LoginV1alpha1Client) *tokenCredentialRequests {
	return &tokenCredentialRequests{
		client: c.RESTClient(),
	}
}

// Create takes the representation of a tokenCredentialRequest and creates it.  Returns the server's representation of the tokenCredentialRequest, and an error, if there is any.
func (c *tokenCredentialRequests) Create(tokenCredentialRequest *v1alpha1.TokenCredentialRequest) (result *v1alpha1.TokenCredentialRequest, err error) {
	result = &v1alpha1.TokenCredentialRequest{}
	err = c.client.Post().
		Resource("tokencredentialrequests").
		Body(tokenCredentialRequest).
		Do().
		Into(result)
	return
}
