lib/api/gov-gw/gov_gw_models/coordinate.go

186 lines
4.2 KiB
Go
Raw Permalink Normal View History

2021-01-08 17:40:28 +00:00
// Code generated by go-swagger; DO NOT EDIT.
2021-01-19 16:58:40 +00:00
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
2021-01-08 17:40:28 +00:00
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package gov_gw_models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
2021-02-09 16:56:57 +00:00
"context"
2021-01-08 17:40:28 +00:00
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// Coordinate coordinate
//
// swagger:model Coordinate
type Coordinate struct {
// Geocoder Country
Country string `json:"country,omitempty"`
// Taxnexus Country ID
Countryid string `json:"countryid,omitempty"`
// Geocoder County
County string `json:"county,omitempty"`
// Taxnexus County ID
Countyid string `json:"countyid,omitempty"`
// Situs Focus for tax determination
Focus string `json:"focus,omitempty"`
// Formatted Address from Geocoder
Formattedaddress string `json:"formattedaddress,omitempty"`
// Taxnexus Coordinate Record Id
ID string `json:"id,omitempty"`
// Situs Incorporated District?
Isdistrict bool `json:"isdistrict,omitempty"`
// Latitude of coordinate
Latitude float64 `json:"latitude,omitempty"`
// Longitude of coordinate
Longitude float64 `json:"longitude,omitempty"`
// Coordinate Name from Search Text
Name string `json:"name,omitempty"`
// Geocoder Neighborhood
Neighborhood string `json:"neighborhood,omitempty"`
// Geocoder Place
Place string `json:"place,omitempty"`
// The Taxnexus Geocode for this rated location (place or county)
Placegeocode string `json:"placegeocode,omitempty"`
// Taxnexus Place ID
Placeid string `json:"placeid,omitempty"`
// Geocoder Postal Code
Postalcode string `json:"postalcode,omitempty"`
// External System reference ID
Ref string `json:"ref,omitempty"`
// Geocoder State/Province name
State string `json:"state,omitempty"`
// Taxnexus State ID
Stateid string `json:"stateid,omitempty"`
// The status of the coordinate in Taxnexus
Status string `json:"status,omitempty"`
// Geocoder Street Name (only)
Street string `json:"street,omitempty"`
// Geocoder Streen number
Streetnumber string `json:"streetnumber,omitempty"`
// taxtypes
Taxtypes []*TaxTypeID `json:"taxtypes"`
// Unique identifier assigned at creation
UUID string `json:"uuid,omitempty"`
}
// Validate validates this coordinate
func (m *Coordinate) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateTaxtypes(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Coordinate) validateTaxtypes(formats strfmt.Registry) error {
if swag.IsZero(m.Taxtypes) { // not required
return nil
}
for i := 0; i < len(m.Taxtypes); i++ {
if swag.IsZero(m.Taxtypes[i]) { // not required
continue
}
if m.Taxtypes[i] != nil {
if err := m.Taxtypes[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("taxtypes" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
2021-02-09 16:56:57 +00:00
// ContextValidate validate this coordinate based on the context it is used
func (m *Coordinate) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateTaxtypes(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Coordinate) contextValidateTaxtypes(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(m.Taxtypes); i++ {
if m.Taxtypes[i] != nil {
if err := m.Taxtypes[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("taxtypes" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
2021-01-08 17:40:28 +00:00
// MarshalBinary interface implementation
func (m *Coordinate) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Coordinate) UnmarshalBinary(b []byte) error {
var res Coordinate
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}