// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// InputClientProxy represents TL type `inputClientProxy#75588b3f`.
// Info about an MTProxy¹ used to connect.
//
// Links:
//  1. https://core.telegram.org/mtproto/mtproto-transports#transport-obfuscation
//
// See https://core.telegram.org/constructor/inputClientProxy for reference.
type InputClientProxy struct {
	// Proxy address
	Address string
	// Proxy port
	Port int
}

// InputClientProxyTypeID is TL type id of InputClientProxy.
const InputClientProxyTypeID = 0x75588b3f

// Ensuring interfaces in compile-time for InputClientProxy.
var (
	_ bin.Encoder     = &InputClientProxy{}
	_ bin.Decoder     = &InputClientProxy{}
	_ bin.BareEncoder = &InputClientProxy{}
	_ bin.BareDecoder = &InputClientProxy{}
)

func ( *InputClientProxy) () bool {
	if  == nil {
		return true
	}
	if !(.Address == "") {
		return false
	}
	if !(.Port == 0) {
		return false
	}

	return true
}

// String implements fmt.Stringer.
func ( *InputClientProxy) () string {
	if  == nil {
		return "InputClientProxy(nil)"
	}
	type  InputClientProxy
	return fmt.Sprintf("InputClientProxy%+v", (*))
}

// FillFrom fills InputClientProxy from given interface.
func ( *InputClientProxy) ( interface {
	() ( string)
	() ( int)
}) {
	.Address = .()
	.Port = .()
}

// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*InputClientProxy) () uint32 {
	return InputClientProxyTypeID
}

// TypeName returns name of type in TL schema.
func (*InputClientProxy) () string {
	return "inputClientProxy"
}

// TypeInfo returns info about TL type.
func ( *InputClientProxy) () tdp.Type {
	 := tdp.Type{
		Name: "inputClientProxy",
		ID:   InputClientProxyTypeID,
	}
	if  == nil {
		.Null = true
		return 
	}
	.Fields = []tdp.Field{
		{
			Name:       "Address",
			SchemaName: "address",
		},
		{
			Name:       "Port",
			SchemaName: "port",
		},
	}
	return 
}

// Encode implements bin.Encoder.
func ( *InputClientProxy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputClientProxy#75588b3f as nil")
	}
	.PutID(InputClientProxyTypeID)
	return .EncodeBare()
}

// EncodeBare implements bin.BareEncoder.
func ( *InputClientProxy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't encode inputClientProxy#75588b3f as nil")
	}
	.PutString(.Address)
	.PutInt(.Port)
	return nil
}

// Decode implements bin.Decoder.
func ( *InputClientProxy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputClientProxy#75588b3f to nil")
	}
	if  := .ConsumeID(InputClientProxyTypeID);  != nil {
		return fmt.Errorf("unable to decode inputClientProxy#75588b3f: %w", )
	}
	return .DecodeBare()
}

// DecodeBare implements bin.BareDecoder.
func ( *InputClientProxy) ( *bin.Buffer) error {
	if  == nil {
		return fmt.Errorf("can't decode inputClientProxy#75588b3f to nil")
	}
	{
		,  := .String()
		if  != nil {
			return fmt.Errorf("unable to decode inputClientProxy#75588b3f: field address: %w", )
		}
		.Address = 
	}
	{
		,  := .Int()
		if  != nil {
			return fmt.Errorf("unable to decode inputClientProxy#75588b3f: field port: %w", )
		}
		.Port = 
	}
	return nil
}

// GetAddress returns value of Address field.
func ( *InputClientProxy) () ( string) {
	if  == nil {
		return
	}
	return .Address
}

// GetPort returns value of Port field.
func ( *InputClientProxy) () ( int) {
	if  == nil {
		return
	}
	return .Port
}