/*
 * Copyright 2024 CloudWeGo 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 thriftgo (0.3.15). DO NOT EDIT.

package thrift

import (
	"context"
	"fmt"
	"github.com/cloudwego/kitex/pkg/streaming"
	"strings"
)

type Request struct {
	Message string `thrift:"message,1,required" frugal:"1,required,string" json:"message"`
}

func NewRequest() *Request {
	return &Request{}
}

func (p *Request) InitDefault() {
}

func (p *Request) GetMessage() (v string) {
	return p.Message
}
func (p *Request) SetMessage(val string) {
	p.Message = val
}

func (p *Request) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Request(%+v)", *p)
}

func (p *Request) DeepEqual(ano *Request) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Message) {
		return false
	}
	return true
}

func (p *Request) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Message, src) != 0 {
		return false
	}
	return true
}

var fieldIDToName_Request = map[int16]string{
	1: "message",
}

type Response struct {
	Message string `thrift:"message,1,required" frugal:"1,required,string" json:"message"`
}

func NewResponse() *Response {
	return &Response{}
}

func (p *Response) InitDefault() {
}

func (p *Response) GetMessage() (v string) {
	return p.Message
}
func (p *Response) SetMessage(val string) {
	p.Message = val
}

func (p *Response) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("Response(%+v)", *p)
}

func (p *Response) DeepEqual(ano *Response) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Message) {
		return false
	}
	return true
}

func (p *Response) Field1DeepEqual(src string) bool {

	if strings.Compare(p.Message, src) != 0 {
		return false
	}
	return true
}

var fieldIDToName_Response = map[int16]string{
	1: "message",
}

type TestService interface {
	Echo(stream TestService_EchoServer) (err error)

	EchoClient(stream TestService_EchoClientServer) (err error)

	EchoServer(req *Request, stream TestService_EchoServerServer) (err error)

	EchoUnary(ctx context.Context, req *Request) (r *Response, err error)

	EchoBizException(stream TestService_EchoBizExceptionServer) (err error)

	EchoPingPong(ctx context.Context, req *Request) (r *Response, err error)
}

type TestServiceEchoArgs struct {
	Req *Request `thrift:"req,1" frugal:"1,default,Request" json:"req"`
}

func NewTestServiceEchoArgs() *TestServiceEchoArgs {
	return &TestServiceEchoArgs{}
}

func (p *TestServiceEchoArgs) InitDefault() {
}

var TestServiceEchoArgs_Req_DEFAULT *Request

func (p *TestServiceEchoArgs) GetReq() (v *Request) {
	if !p.IsSetReq() {
		return TestServiceEchoArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *TestServiceEchoArgs) SetReq(val *Request) {
	p.Req = val
}

func (p *TestServiceEchoArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *TestServiceEchoArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TestServiceEchoArgs(%+v)", *p)
}

func (p *TestServiceEchoArgs) DeepEqual(ano *TestServiceEchoArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *TestServiceEchoArgs) Field1DeepEqual(src *Request) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

var fieldIDToName_TestServiceEchoArgs = map[int16]string{
	1: "req",
}

type TestServiceEchoResult struct {
	Success *Response `thrift:"success,0,optional" frugal:"0,optional,Response" json:"success,omitempty"`
}

func NewTestServiceEchoResult() *TestServiceEchoResult {
	return &TestServiceEchoResult{}
}

func (p *TestServiceEchoResult) InitDefault() {
}

var TestServiceEchoResult_Success_DEFAULT *Response

func (p *TestServiceEchoResult) GetSuccess() (v *Response) {
	if !p.IsSetSuccess() {
		return TestServiceEchoResult_Success_DEFAULT
	}
	return p.Success
}
func (p *TestServiceEchoResult) SetSuccess(x interface{}) {
	p.Success = x.(*Response)
}

func (p *TestServiceEchoResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *TestServiceEchoResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TestServiceEchoResult(%+v)", *p)
}

func (p *TestServiceEchoResult) DeepEqual(ano *TestServiceEchoResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *TestServiceEchoResult) Field0DeepEqual(src *Response) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}

var fieldIDToName_TestServiceEchoResult = map[int16]string{
	0: "success",
}

type TestService_EchoServer interface {
	streaming.Stream

	Recv() (*Request, error)

	Send(*Response) error
}

type TestServiceEchoClientArgs struct {
	Req *Request `thrift:"req,1" frugal:"1,default,Request" json:"req"`
}

func NewTestServiceEchoClientArgs() *TestServiceEchoClientArgs {
	return &TestServiceEchoClientArgs{}
}

func (p *TestServiceEchoClientArgs) InitDefault() {
}

var TestServiceEchoClientArgs_Req_DEFAULT *Request

func (p *TestServiceEchoClientArgs) GetReq() (v *Request) {
	if !p.IsSetReq() {
		return TestServiceEchoClientArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *TestServiceEchoClientArgs) SetReq(val *Request) {
	p.Req = val
}

func (p *TestServiceEchoClientArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *TestServiceEchoClientArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TestServiceEchoClientArgs(%+v)", *p)
}

func (p *TestServiceEchoClientArgs) DeepEqual(ano *TestServiceEchoClientArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *TestServiceEchoClientArgs) Field1DeepEqual(src *Request) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

var fieldIDToName_TestServiceEchoClientArgs = map[int16]string{
	1: "req",
}

type TestServiceEchoClientResult struct {
	Success *Response `thrift:"success,0,optional" frugal:"0,optional,Response" json:"success,omitempty"`
}

func NewTestServiceEchoClientResult() *TestServiceEchoClientResult {
	return &TestServiceEchoClientResult{}
}

func (p *TestServiceEchoClientResult) InitDefault() {
}

var TestServiceEchoClientResult_Success_DEFAULT *Response

func (p *TestServiceEchoClientResult) GetSuccess() (v *Response) {
	if !p.IsSetSuccess() {
		return TestServiceEchoClientResult_Success_DEFAULT
	}
	return p.Success
}
func (p *TestServiceEchoClientResult) SetSuccess(x interface{}) {
	p.Success = x.(*Response)
}

func (p *TestServiceEchoClientResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *TestServiceEchoClientResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TestServiceEchoClientResult(%+v)", *p)
}

func (p *TestServiceEchoClientResult) DeepEqual(ano *TestServiceEchoClientResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *TestServiceEchoClientResult) Field0DeepEqual(src *Response) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}

var fieldIDToName_TestServiceEchoClientResult = map[int16]string{
	0: "success",
}

type TestService_EchoClientServer interface {
	streaming.Stream

	Recv() (*Request, error)

	SendAndClose(*Response) error
}

type TestServiceEchoServerArgs struct {
	Req *Request `thrift:"req,1" frugal:"1,default,Request" json:"req"`
}

func NewTestServiceEchoServerArgs() *TestServiceEchoServerArgs {
	return &TestServiceEchoServerArgs{}
}

func (p *TestServiceEchoServerArgs) InitDefault() {
}

var TestServiceEchoServerArgs_Req_DEFAULT *Request

func (p *TestServiceEchoServerArgs) GetReq() (v *Request) {
	if !p.IsSetReq() {
		return TestServiceEchoServerArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *TestServiceEchoServerArgs) SetReq(val *Request) {
	p.Req = val
}

func (p *TestServiceEchoServerArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *TestServiceEchoServerArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TestServiceEchoServerArgs(%+v)", *p)
}

func (p *TestServiceEchoServerArgs) DeepEqual(ano *TestServiceEchoServerArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *TestServiceEchoServerArgs) Field1DeepEqual(src *Request) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

var fieldIDToName_TestServiceEchoServerArgs = map[int16]string{
	1: "req",
}

type TestServiceEchoServerResult struct {
	Success *Response `thrift:"success,0,optional" frugal:"0,optional,Response" json:"success,omitempty"`
}

func NewTestServiceEchoServerResult() *TestServiceEchoServerResult {
	return &TestServiceEchoServerResult{}
}

func (p *TestServiceEchoServerResult) InitDefault() {
}

var TestServiceEchoServerResult_Success_DEFAULT *Response

func (p *TestServiceEchoServerResult) GetSuccess() (v *Response) {
	if !p.IsSetSuccess() {
		return TestServiceEchoServerResult_Success_DEFAULT
	}
	return p.Success
}
func (p *TestServiceEchoServerResult) SetSuccess(x interface{}) {
	p.Success = x.(*Response)
}

func (p *TestServiceEchoServerResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *TestServiceEchoServerResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TestServiceEchoServerResult(%+v)", *p)
}

func (p *TestServiceEchoServerResult) DeepEqual(ano *TestServiceEchoServerResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *TestServiceEchoServerResult) Field0DeepEqual(src *Response) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}

var fieldIDToName_TestServiceEchoServerResult = map[int16]string{
	0: "success",
}

type TestService_EchoServerServer interface {
	streaming.Stream

	Send(*Response) error
}

type TestServiceEchoUnaryArgs struct {
	Req *Request `thrift:"req,1" frugal:"1,default,Request" json:"req"`
}

func NewTestServiceEchoUnaryArgs() *TestServiceEchoUnaryArgs {
	return &TestServiceEchoUnaryArgs{}
}

func (p *TestServiceEchoUnaryArgs) InitDefault() {
}

var TestServiceEchoUnaryArgs_Req_DEFAULT *Request

func (p *TestServiceEchoUnaryArgs) GetReq() (v *Request) {
	if !p.IsSetReq() {
		return TestServiceEchoUnaryArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *TestServiceEchoUnaryArgs) SetReq(val *Request) {
	p.Req = val
}

func (p *TestServiceEchoUnaryArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *TestServiceEchoUnaryArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TestServiceEchoUnaryArgs(%+v)", *p)
}

func (p *TestServiceEchoUnaryArgs) DeepEqual(ano *TestServiceEchoUnaryArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *TestServiceEchoUnaryArgs) Field1DeepEqual(src *Request) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

var fieldIDToName_TestServiceEchoUnaryArgs = map[int16]string{
	1: "req",
}

type TestServiceEchoUnaryResult struct {
	Success *Response `thrift:"success,0,optional" frugal:"0,optional,Response" json:"success,omitempty"`
}

func NewTestServiceEchoUnaryResult() *TestServiceEchoUnaryResult {
	return &TestServiceEchoUnaryResult{}
}

func (p *TestServiceEchoUnaryResult) InitDefault() {
}

var TestServiceEchoUnaryResult_Success_DEFAULT *Response

func (p *TestServiceEchoUnaryResult) GetSuccess() (v *Response) {
	if !p.IsSetSuccess() {
		return TestServiceEchoUnaryResult_Success_DEFAULT
	}
	return p.Success
}
func (p *TestServiceEchoUnaryResult) SetSuccess(x interface{}) {
	p.Success = x.(*Response)
}

func (p *TestServiceEchoUnaryResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *TestServiceEchoUnaryResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TestServiceEchoUnaryResult(%+v)", *p)
}

func (p *TestServiceEchoUnaryResult) DeepEqual(ano *TestServiceEchoUnaryResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *TestServiceEchoUnaryResult) Field0DeepEqual(src *Response) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}

var fieldIDToName_TestServiceEchoUnaryResult = map[int16]string{
	0: "success",
}

type TestServiceEchoBizExceptionArgs struct {
	Req *Request `thrift:"req,1" frugal:"1,default,Request" json:"req"`
}

func NewTestServiceEchoBizExceptionArgs() *TestServiceEchoBizExceptionArgs {
	return &TestServiceEchoBizExceptionArgs{}
}

func (p *TestServiceEchoBizExceptionArgs) InitDefault() {
}

var TestServiceEchoBizExceptionArgs_Req_DEFAULT *Request

func (p *TestServiceEchoBizExceptionArgs) GetReq() (v *Request) {
	if !p.IsSetReq() {
		return TestServiceEchoBizExceptionArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *TestServiceEchoBizExceptionArgs) SetReq(val *Request) {
	p.Req = val
}

func (p *TestServiceEchoBizExceptionArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *TestServiceEchoBizExceptionArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TestServiceEchoBizExceptionArgs(%+v)", *p)
}

func (p *TestServiceEchoBizExceptionArgs) DeepEqual(ano *TestServiceEchoBizExceptionArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *TestServiceEchoBizExceptionArgs) Field1DeepEqual(src *Request) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

var fieldIDToName_TestServiceEchoBizExceptionArgs = map[int16]string{
	1: "req",
}

type TestServiceEchoBizExceptionResult struct {
	Success *Response `thrift:"success,0,optional" frugal:"0,optional,Response" json:"success,omitempty"`
}

func NewTestServiceEchoBizExceptionResult() *TestServiceEchoBizExceptionResult {
	return &TestServiceEchoBizExceptionResult{}
}

func (p *TestServiceEchoBizExceptionResult) InitDefault() {
}

var TestServiceEchoBizExceptionResult_Success_DEFAULT *Response

func (p *TestServiceEchoBizExceptionResult) GetSuccess() (v *Response) {
	if !p.IsSetSuccess() {
		return TestServiceEchoBizExceptionResult_Success_DEFAULT
	}
	return p.Success
}
func (p *TestServiceEchoBizExceptionResult) SetSuccess(x interface{}) {
	p.Success = x.(*Response)
}

func (p *TestServiceEchoBizExceptionResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *TestServiceEchoBizExceptionResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TestServiceEchoBizExceptionResult(%+v)", *p)
}

func (p *TestServiceEchoBizExceptionResult) DeepEqual(ano *TestServiceEchoBizExceptionResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *TestServiceEchoBizExceptionResult) Field0DeepEqual(src *Response) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}

var fieldIDToName_TestServiceEchoBizExceptionResult = map[int16]string{
	0: "success",
}

type TestService_EchoBizExceptionServer interface {
	streaming.Stream

	Recv() (*Request, error)

	SendAndClose(*Response) error
}

type TestServiceEchoPingPongArgs struct {
	Req *Request `thrift:"req,1" frugal:"1,default,Request" json:"req"`
}

func NewTestServiceEchoPingPongArgs() *TestServiceEchoPingPongArgs {
	return &TestServiceEchoPingPongArgs{}
}

func (p *TestServiceEchoPingPongArgs) InitDefault() {
}

var TestServiceEchoPingPongArgs_Req_DEFAULT *Request

func (p *TestServiceEchoPingPongArgs) GetReq() (v *Request) {
	if !p.IsSetReq() {
		return TestServiceEchoPingPongArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *TestServiceEchoPingPongArgs) SetReq(val *Request) {
	p.Req = val
}

func (p *TestServiceEchoPingPongArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *TestServiceEchoPingPongArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TestServiceEchoPingPongArgs(%+v)", *p)
}

func (p *TestServiceEchoPingPongArgs) DeepEqual(ano *TestServiceEchoPingPongArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *TestServiceEchoPingPongArgs) Field1DeepEqual(src *Request) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

var fieldIDToName_TestServiceEchoPingPongArgs = map[int16]string{
	1: "req",
}

type TestServiceEchoPingPongResult struct {
	Success *Response `thrift:"success,0,optional" frugal:"0,optional,Response" json:"success,omitempty"`
}

func NewTestServiceEchoPingPongResult() *TestServiceEchoPingPongResult {
	return &TestServiceEchoPingPongResult{}
}

func (p *TestServiceEchoPingPongResult) InitDefault() {
}

var TestServiceEchoPingPongResult_Success_DEFAULT *Response

func (p *TestServiceEchoPingPongResult) GetSuccess() (v *Response) {
	if !p.IsSetSuccess() {
		return TestServiceEchoPingPongResult_Success_DEFAULT
	}
	return p.Success
}
func (p *TestServiceEchoPingPongResult) SetSuccess(x interface{}) {
	p.Success = x.(*Response)
}

func (p *TestServiceEchoPingPongResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *TestServiceEchoPingPongResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("TestServiceEchoPingPongResult(%+v)", *p)
}

func (p *TestServiceEchoPingPongResult) DeepEqual(ano *TestServiceEchoPingPongResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *TestServiceEchoPingPongResult) Field0DeepEqual(src *Response) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}

var fieldIDToName_TestServiceEchoPingPongResult = map[int16]string{
	0: "success",
}
