//go:build vtprotobuf
// +build vtprotobuf

// Code generated by protoc-gen-go-vtproto. DO NOT EDIT.
// source: envoy/extensions/grpc_service/call_credentials/sts_service/v3/sts_service_credentials.proto

package sts_servicev3

import (
	protohelpers "github.com/planetscale/vtprotobuf/protohelpers"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

func (m *StsServiceCredentials) MarshalVTStrict() (dAtA []byte, err error) {
	if m == nil {
		return nil, nil
	}
	size := m.SizeVT()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *StsServiceCredentials) MarshalToVTStrict(dAtA []byte) (int, error) {
	size := m.SizeVT()
	return m.MarshalToSizedBufferVTStrict(dAtA[:size])
}

func (m *StsServiceCredentials) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) {
	if m == nil {
		return 0, nil
	}
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.unknownFields != nil {
		i -= len(m.unknownFields)
		copy(dAtA[i:], m.unknownFields)
	}
	if len(m.ActorTokenType) > 0 {
		i -= len(m.ActorTokenType)
		copy(dAtA[i:], m.ActorTokenType)
		i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ActorTokenType)))
		i--
		dAtA[i] = 0x4a
	}
	if len(m.ActorTokenPath) > 0 {
		i -= len(m.ActorTokenPath)
		copy(dAtA[i:], m.ActorTokenPath)
		i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.ActorTokenPath)))
		i--
		dAtA[i] = 0x42
	}
	if len(m.SubjectTokenType) > 0 {
		i -= len(m.SubjectTokenType)
		copy(dAtA[i:], m.SubjectTokenType)
		i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SubjectTokenType)))
		i--
		dAtA[i] = 0x3a
	}
	if len(m.SubjectTokenPath) > 0 {
		i -= len(m.SubjectTokenPath)
		copy(dAtA[i:], m.SubjectTokenPath)
		i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.SubjectTokenPath)))
		i--
		dAtA[i] = 0x32
	}
	if len(m.RequestedTokenType) > 0 {
		i -= len(m.RequestedTokenType)
		copy(dAtA[i:], m.RequestedTokenType)
		i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RequestedTokenType)))
		i--
		dAtA[i] = 0x2a
	}
	if len(m.Scope) > 0 {
		i -= len(m.Scope)
		copy(dAtA[i:], m.Scope)
		i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Scope)))
		i--
		dAtA[i] = 0x22
	}
	if len(m.Audience) > 0 {
		i -= len(m.Audience)
		copy(dAtA[i:], m.Audience)
		i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Audience)))
		i--
		dAtA[i] = 0x1a
	}
	if len(m.Resource) > 0 {
		i -= len(m.Resource)
		copy(dAtA[i:], m.Resource)
		i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Resource)))
		i--
		dAtA[i] = 0x12
	}
	if len(m.TokenExchangeServiceUri) > 0 {
		i -= len(m.TokenExchangeServiceUri)
		copy(dAtA[i:], m.TokenExchangeServiceUri)
		i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.TokenExchangeServiceUri)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *StsServiceCredentials) SizeVT() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.TokenExchangeServiceUri)
	if l > 0 {
		n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
	}
	l = len(m.Resource)
	if l > 0 {
		n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
	}
	l = len(m.Audience)
	if l > 0 {
		n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
	}
	l = len(m.Scope)
	if l > 0 {
		n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
	}
	l = len(m.RequestedTokenType)
	if l > 0 {
		n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
	}
	l = len(m.SubjectTokenPath)
	if l > 0 {
		n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
	}
	l = len(m.SubjectTokenType)
	if l > 0 {
		n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
	}
	l = len(m.ActorTokenPath)
	if l > 0 {
		n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
	}
	l = len(m.ActorTokenType)
	if l > 0 {
		n += 1 + l + protohelpers.SizeOfVarint(uint64(l))
	}
	n += len(m.unknownFields)
	return n
}
