// Code generated by gotdgen, DO NOT EDIT.package tgimport ()// 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{})// MaskCoords represents TL type `maskCoords#aed6dbb2`.// Position on a photo where a mask should be placed when attaching stickers to media// »¹// The n position indicates where the mask should be placed://// Links:// 1. https://core.telegram.org/api/stickers#attached-stickers//// See https://core.telegram.org/constructor/maskCoords for reference.typeMaskCoordsstruct {// Part of the face, relative to which the mask should be placedNint// Shift by X-axis measured in widths of the mask scaled to the face size, from left to // right. (For example, -1.0 will place the mask just to the left of the default mask // position)Xfloat64// Shift by Y-axis measured in widths of the mask scaled to the face size, from left to // right. (For example, -1.0 will place the mask just below the default mask position)Yfloat64// Mask scaling coefficient. (For example, 2.0 means a doubled size)Zoomfloat64}// MaskCoordsTypeID is TL type id of MaskCoords.constMaskCoordsTypeID = 0xaed6dbb2// Ensuring interfaces in compile-time for MaskCoords.var ( _ bin.Encoder = &MaskCoords{} _ bin.Decoder = &MaskCoords{} _ bin.BareEncoder = &MaskCoords{} _ bin.BareDecoder = &MaskCoords{})func ( *MaskCoords) () bool {if == nil {returntrue }if !(.N == 0) {returnfalse }if !(.X == 0) {returnfalse }if !(.Y == 0) {returnfalse }if !(.Zoom == 0) {returnfalse }returntrue}// String implements fmt.Stringer.func ( *MaskCoords) () string {if == nil {return"MaskCoords(nil)" }typeMaskCoordsreturnfmt.Sprintf("MaskCoords%+v", (*))}// FillFrom fills MaskCoords from given interface.func ( *MaskCoords) ( interface { () ( int) () ( float64) () ( float64) () ( float64)}) { .N = .() .X = .() .Y = .() .Zoom = .()}// TypeID returns type id in TL schema.//// See https://core.telegram.org/mtproto/TL-tl#remarks.func (*MaskCoords) () uint32 {returnMaskCoordsTypeID}// TypeName returns name of type in TL schema.func (*MaskCoords) () string {return"maskCoords"}// TypeInfo returns info about TL type.func ( *MaskCoords) () tdp.Type { := tdp.Type{Name: "maskCoords",ID: MaskCoordsTypeID, }if == nil { .Null = truereturn } .Fields = []tdp.Field{ {Name: "N",SchemaName: "n", }, {Name: "X",SchemaName: "x", }, {Name: "Y",SchemaName: "y", }, {Name: "Zoom",SchemaName: "zoom", }, }return}// Encode implements bin.Encoder.func ( *MaskCoords) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't encode maskCoords#aed6dbb2 as nil") } .PutID(MaskCoordsTypeID)return .EncodeBare()}// EncodeBare implements bin.BareEncoder.func ( *MaskCoords) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't encode maskCoords#aed6dbb2 as nil") } .PutInt(.N) .PutDouble(.X) .PutDouble(.Y) .PutDouble(.Zoom)returnnil}// Decode implements bin.Decoder.func ( *MaskCoords) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't decode maskCoords#aed6dbb2 to nil") }if := .ConsumeID(MaskCoordsTypeID); != nil {returnfmt.Errorf("unable to decode maskCoords#aed6dbb2: %w", ) }return .DecodeBare()}// DecodeBare implements bin.BareDecoder.func ( *MaskCoords) ( *bin.Buffer) error {if == nil {returnfmt.Errorf("can't decode maskCoords#aed6dbb2 to nil") } { , := .Int()if != nil {returnfmt.Errorf("unable to decode maskCoords#aed6dbb2: field n: %w", ) } .N = } { , := .Double()if != nil {returnfmt.Errorf("unable to decode maskCoords#aed6dbb2: field x: %w", ) } .X = } { , := .Double()if != nil {returnfmt.Errorf("unable to decode maskCoords#aed6dbb2: field y: %w", ) } .Y = } { , := .Double()if != nil {returnfmt.Errorf("unable to decode maskCoords#aed6dbb2: field zoom: %w", ) } .Zoom = }returnnil}// GetN returns value of N field.func ( *MaskCoords) () ( int) {if == nil {return }return .N}// GetX returns value of X field.func ( *MaskCoords) () ( float64) {if == nil {return }return .X}// GetY returns value of Y field.func ( *MaskCoords) () ( float64) {if == nil {return }return .Y}// GetZoom returns value of Zoom field.func ( *MaskCoords) () ( float64) {if == nil {return }return .Zoom}
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.