// Copyright 2025 Google LLC
//
// 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
//
//	https://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.

// Copyright 2025 Google LLC
//
// 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
//
//	https://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 protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.11
// 	protoc        v6.33.5
// source: internal/mdx/metadata_exchange.proto

package mdx

import (
	reflect "reflect"
	unsafe "unsafe"

	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	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)
)

// Indicates the socket-level protocol used by the database client, useful for
// the MySQL caching_sha2_password, which detects the socket type as part
// of the authentication protocol.
type MetadataExchangeRequest_ClientProtocolType int32

const (
	// Client protocol type is unspecified, TCP is used as default.
	MetadataExchangeRequest_CLIENT_PROTOCOL_TYPE_UNSPECIFIED MetadataExchangeRequest_ClientProtocolType = 0
	// TCP socket connection, used for connections through the auth proxy's
	// TCP ports.
	MetadataExchangeRequest_TCP MetadataExchangeRequest_ClientProtocolType = 1
	// TLS socket over TCP, used in the connectors which pass an already
	// connected TCP socket with a complete handshake to the mysql driver.
	MetadataExchangeRequest_TLS MetadataExchangeRequest_ClientProtocolType = 2
	// Unix Domain socket connection, used for connections through the auth
	// proxy's unix sockets.
	MetadataExchangeRequest_UDS MetadataExchangeRequest_ClientProtocolType = 3
)

// Enum value maps for MetadataExchangeRequest_ClientProtocolType.
var (
	MetadataExchangeRequest_ClientProtocolType_name = map[int32]string{
		0: "CLIENT_PROTOCOL_TYPE_UNSPECIFIED",
		1: "TCP",
		2: "TLS",
		3: "UDS",
	}
	MetadataExchangeRequest_ClientProtocolType_value = map[string]int32{
		"CLIENT_PROTOCOL_TYPE_UNSPECIFIED": 0,
		"TCP":                              1,
		"TLS":                              2,
		"UDS":                              3,
	}
)

func (x MetadataExchangeRequest_ClientProtocolType) Enum() *MetadataExchangeRequest_ClientProtocolType {
	p := new(MetadataExchangeRequest_ClientProtocolType)
	*p = x
	return p
}

func (x MetadataExchangeRequest_ClientProtocolType) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (MetadataExchangeRequest_ClientProtocolType) Descriptor() protoreflect.EnumDescriptor {
	return file_internal_mdx_metadata_exchange_proto_enumTypes[0].Descriptor()
}

func (MetadataExchangeRequest_ClientProtocolType) Type() protoreflect.EnumType {
	return &file_internal_mdx_metadata_exchange_proto_enumTypes[0]
}

func (x MetadataExchangeRequest_ClientProtocolType) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// The status of the server metadata exchange.
type MetadataExchangeResponse_ResponseStatusCode int32

const (
	// Unknown response code
	MetadataExchangeResponse_RESPONSE_STATUS_CODE_UNSPECIFIED MetadataExchangeResponse_ResponseStatusCode = 0
	// Success
	MetadataExchangeResponse_OK MetadataExchangeResponse_ResponseStatusCode = 1
	// Failure
	MetadataExchangeResponse_ERROR MetadataExchangeResponse_ResponseStatusCode = 2
)

// Enum value maps for MetadataExchangeResponse_ResponseStatusCode.
var (
	MetadataExchangeResponse_ResponseStatusCode_name = map[int32]string{
		0: "RESPONSE_STATUS_CODE_UNSPECIFIED",
		1: "OK",
		2: "ERROR",
	}
	MetadataExchangeResponse_ResponseStatusCode_value = map[string]int32{
		"RESPONSE_STATUS_CODE_UNSPECIFIED": 0,
		"OK":                               1,
		"ERROR":                            2,
	}
)

func (x MetadataExchangeResponse_ResponseStatusCode) Enum() *MetadataExchangeResponse_ResponseStatusCode {
	p := new(MetadataExchangeResponse_ResponseStatusCode)
	*p = x
	return p
}

func (x MetadataExchangeResponse_ResponseStatusCode) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (MetadataExchangeResponse_ResponseStatusCode) Descriptor() protoreflect.EnumDescriptor {
	return file_internal_mdx_metadata_exchange_proto_enumTypes[1].Descriptor()
}

func (MetadataExchangeResponse_ResponseStatusCode) Type() protoreflect.EnumType {
	return &file_internal_mdx_metadata_exchange_proto_enumTypes[1]
}

func (x MetadataExchangeResponse_ResponseStatusCode) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Message used by Cloud SQL connectors, including the Cloud SQL Auth Proxy and
// the Cloud SQL Language Connectors, to exchange client and connection
// metadata.
type MetadataExchangeRequest struct {
	state                         protoimpl.MessageState                     `protogen:"opaque.v1"`
	xxx_hidden_UserAgent          *string                                    `protobuf:"bytes,1,opt,name=user_agent,json=userAgent"`
	xxx_hidden_ClientProtocolType MetadataExchangeRequest_ClientProtocolType `protobuf:"varint,2,opt,name=client_protocol_type,json=clientProtocolType,enum=mdx.MetadataExchangeRequest_ClientProtocolType"`
	XXX_raceDetectHookData        protoimpl.RaceDetectHookData
	XXX_presence                  [1]uint32
	unknownFields                 protoimpl.UnknownFields
	sizeCache                     protoimpl.SizeCache
}

func (x *MetadataExchangeRequest) Reset() {
	*x = MetadataExchangeRequest{}
	mi := &file_internal_mdx_metadata_exchange_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *MetadataExchangeRequest) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*MetadataExchangeRequest) ProtoMessage() {}

func (x *MetadataExchangeRequest) ProtoReflect() protoreflect.Message {
	mi := &file_internal_mdx_metadata_exchange_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

func (x *MetadataExchangeRequest) GetUserAgent() string {
	if x != nil {
		if x.xxx_hidden_UserAgent != nil {
			return *x.xxx_hidden_UserAgent
		}
		return ""
	}
	return ""
}

func (x *MetadataExchangeRequest) GetClientProtocolType() MetadataExchangeRequest_ClientProtocolType {
	if x != nil {
		if protoimpl.X.Present(&(x.XXX_presence[0]), 1) {
			return x.xxx_hidden_ClientProtocolType
		}
	}
	return MetadataExchangeRequest_CLIENT_PROTOCOL_TYPE_UNSPECIFIED
}

func (x *MetadataExchangeRequest) SetUserAgent(v string) {
	x.xxx_hidden_UserAgent = &v
	protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2)
}

func (x *MetadataExchangeRequest) SetClientProtocolType(v MetadataExchangeRequest_ClientProtocolType) {
	x.xxx_hidden_ClientProtocolType = v
	protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2)
}

func (x *MetadataExchangeRequest) HasUserAgent() bool {
	if x == nil {
		return false
	}
	return protoimpl.X.Present(&(x.XXX_presence[0]), 0)
}

func (x *MetadataExchangeRequest) HasClientProtocolType() bool {
	if x == nil {
		return false
	}
	return protoimpl.X.Present(&(x.XXX_presence[0]), 1)
}

func (x *MetadataExchangeRequest) ClearUserAgent() {
	protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)
	x.xxx_hidden_UserAgent = nil
}

func (x *MetadataExchangeRequest) ClearClientProtocolType() {
	protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)
	x.xxx_hidden_ClientProtocolType = MetadataExchangeRequest_CLIENT_PROTOCOL_TYPE_UNSPECIFIED
}

type MetadataExchangeRequest_builder struct {
	_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.

	// User agent from the connector sending the request.
	UserAgent *string
	// Client protocol type, the network protocol used by the database driver to
	// connect, which can affect the database login protocol as it does in MySQL.
	// The client should set this field when the
	// ConnectSettings.mdx_protocol_support field contains CLIENT_PROTOCOL_TYPE.
	ClientProtocolType *MetadataExchangeRequest_ClientProtocolType
}

func (b0 MetadataExchangeRequest_builder) Build() *MetadataExchangeRequest {
	m0 := &MetadataExchangeRequest{}
	b, x := &b0, m0
	_, _ = b, x
	if b.UserAgent != nil {
		protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2)
		x.xxx_hidden_UserAgent = b.UserAgent
	}
	if b.ClientProtocolType != nil {
		protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2)
		x.xxx_hidden_ClientProtocolType = *b.ClientProtocolType
	}
	return m0
}

// The response from the Cloud SQL instance back to the connector
// following an MetadataExchangeRequest.
type MetadataExchangeResponse struct {
	state                         protoimpl.MessageState                      `protogen:"opaque.v1"`
	xxx_hidden_ResponseStatusCode MetadataExchangeResponse_ResponseStatusCode `protobuf:"varint,1,opt,name=response_status_code,json=responseStatusCode,enum=mdx.MetadataExchangeResponse_ResponseStatusCode"`
	xxx_hidden_ErrorMessage       *string                                     `protobuf:"bytes,2,opt,name=error_message,json=errorMessage"`
	XXX_raceDetectHookData        protoimpl.RaceDetectHookData
	XXX_presence                  [1]uint32
	unknownFields                 protoimpl.UnknownFields
	sizeCache                     protoimpl.SizeCache
}

func (x *MetadataExchangeResponse) Reset() {
	*x = MetadataExchangeResponse{}
	mi := &file_internal_mdx_metadata_exchange_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *MetadataExchangeResponse) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*MetadataExchangeResponse) ProtoMessage() {}

func (x *MetadataExchangeResponse) ProtoReflect() protoreflect.Message {
	mi := &file_internal_mdx_metadata_exchange_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

func (x *MetadataExchangeResponse) GetResponseStatusCode() MetadataExchangeResponse_ResponseStatusCode {
	if x != nil {
		if protoimpl.X.Present(&(x.XXX_presence[0]), 0) {
			return x.xxx_hidden_ResponseStatusCode
		}
	}
	return MetadataExchangeResponse_RESPONSE_STATUS_CODE_UNSPECIFIED
}

func (x *MetadataExchangeResponse) GetErrorMessage() string {
	if x != nil {
		if x.xxx_hidden_ErrorMessage != nil {
			return *x.xxx_hidden_ErrorMessage
		}
		return ""
	}
	return ""
}

func (x *MetadataExchangeResponse) SetResponseStatusCode(v MetadataExchangeResponse_ResponseStatusCode) {
	x.xxx_hidden_ResponseStatusCode = v
	protoimpl.X.SetPresent(&(x.XXX_presence[0]), 0, 2)
}

func (x *MetadataExchangeResponse) SetErrorMessage(v string) {
	x.xxx_hidden_ErrorMessage = &v
	protoimpl.X.SetPresent(&(x.XXX_presence[0]), 1, 2)
}

func (x *MetadataExchangeResponse) HasResponseStatusCode() bool {
	if x == nil {
		return false
	}
	return protoimpl.X.Present(&(x.XXX_presence[0]), 0)
}

func (x *MetadataExchangeResponse) HasErrorMessage() bool {
	if x == nil {
		return false
	}
	return protoimpl.X.Present(&(x.XXX_presence[0]), 1)
}

func (x *MetadataExchangeResponse) ClearResponseStatusCode() {
	protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 0)
	x.xxx_hidden_ResponseStatusCode = MetadataExchangeResponse_RESPONSE_STATUS_CODE_UNSPECIFIED
}

func (x *MetadataExchangeResponse) ClearErrorMessage() {
	protoimpl.X.ClearPresent(&(x.XXX_presence[0]), 1)
	x.xxx_hidden_ErrorMessage = nil
}

type MetadataExchangeResponse_builder struct {
	_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.

	// Status code.
	ResponseStatusCode *MetadataExchangeResponse_ResponseStatusCode
	// Error message.
	ErrorMessage *string
}

func (b0 MetadataExchangeResponse_builder) Build() *MetadataExchangeResponse {
	m0 := &MetadataExchangeResponse{}
	b, x := &b0, m0
	_, _ = b, x
	if b.ResponseStatusCode != nil {
		protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 0, 2)
		x.xxx_hidden_ResponseStatusCode = *b.ResponseStatusCode
	}
	if b.ErrorMessage != nil {
		protoimpl.X.SetPresentNonAtomic(&(x.XXX_presence[0]), 1, 2)
		x.xxx_hidden_ErrorMessage = b.ErrorMessage
	}
	return m0
}

var File_internal_mdx_metadata_exchange_proto protoreflect.FileDescriptor

const file_internal_mdx_metadata_exchange_proto_rawDesc = "" +
	"\n" +
	"$internal/mdx/metadata_exchange.proto\x12\x03mdx\"\xf2\x01\n" +
	"\x17MetadataExchangeRequest\x12\x1d\n" +
	"\n" +
	"user_agent\x18\x01 \x01(\tR\tuserAgent\x12a\n" +
	"\x14client_protocol_type\x18\x02 \x01(\x0e2/.mdx.MetadataExchangeRequest.ClientProtocolTypeR\x12clientProtocolType\"U\n" +
	"\x12ClientProtocolType\x12$\n" +
	" CLIENT_PROTOCOL_TYPE_UNSPECIFIED\x10\x00\x12\a\n" +
	"\x03TCP\x10\x01\x12\a\n" +
	"\x03TLS\x10\x02\x12\a\n" +
	"\x03UDS\x10\x03\"\xf2\x01\n" +
	"\x18MetadataExchangeResponse\x12b\n" +
	"\x14response_status_code\x18\x01 \x01(\x0e20.mdx.MetadataExchangeResponse.ResponseStatusCodeR\x12responseStatusCode\x12#\n" +
	"\rerror_message\x18\x02 \x01(\tR\ferrorMessage\"M\n" +
	"\x12ResponseStatusCode\x12$\n" +
	" RESPONSE_STATUS_CODE_UNSPECIFIED\x10\x00\x12\x06\n" +
	"\x02OK\x10\x01\x12\t\n" +
	"\x05ERROR\x10\x02B\x0eZ\finternal/mdxb\beditionsp\xe8\a"

var file_internal_mdx_metadata_exchange_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_internal_mdx_metadata_exchange_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_internal_mdx_metadata_exchange_proto_goTypes = []any{
	(MetadataExchangeRequest_ClientProtocolType)(0),  // 0: mdx.MetadataExchangeRequest.ClientProtocolType
	(MetadataExchangeResponse_ResponseStatusCode)(0), // 1: mdx.MetadataExchangeResponse.ResponseStatusCode
	(*MetadataExchangeRequest)(nil),                  // 2: mdx.MetadataExchangeRequest
	(*MetadataExchangeResponse)(nil),                 // 3: mdx.MetadataExchangeResponse
}
var file_internal_mdx_metadata_exchange_proto_depIdxs = []int32{
	0, // 0: mdx.MetadataExchangeRequest.client_protocol_type:type_name -> mdx.MetadataExchangeRequest.ClientProtocolType
	1, // 1: mdx.MetadataExchangeResponse.response_status_code:type_name -> mdx.MetadataExchangeResponse.ResponseStatusCode
	2, // [2:2] is the sub-list for method output_type
	2, // [2:2] is the sub-list for method input_type
	2, // [2:2] is the sub-list for extension type_name
	2, // [2:2] is the sub-list for extension extendee
	0, // [0:2] is the sub-list for field type_name
}

func init() { file_internal_mdx_metadata_exchange_proto_init() }
func file_internal_mdx_metadata_exchange_proto_init() {
	if File_internal_mdx_metadata_exchange_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_internal_mdx_metadata_exchange_proto_rawDesc), len(file_internal_mdx_metadata_exchange_proto_rawDesc)),
			NumEnums:      2,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_internal_mdx_metadata_exchange_proto_goTypes,
		DependencyIndexes: file_internal_mdx_metadata_exchange_proto_depIdxs,
		EnumInfos:         file_internal_mdx_metadata_exchange_proto_enumTypes,
		MessageInfos:      file_internal_mdx_metadata_exchange_proto_msgTypes,
	}.Build()
	File_internal_mdx_metadata_exchange_proto = out.File
	file_internal_mdx_metadata_exchange_proto_goTypes = nil
	file_internal_mdx_metadata_exchange_proto_depIdxs = nil
}
