package types

import (
	"code.tnxs.net/taxnexus/lib/api/crm/crm_models"
)

// Address address struct
type Address struct {
	City        string
	Country     string
	CountryCode string
	PostalCode  string
	State       string
	StateCode   string
	Street      string
}

func (obj *Address) marshalToCrmSwagger() *crm_models.Address {
	if obj != nil {
		return &crm_models.Address{
			City:        obj.City,
			Country:     obj.Country,
			CountryCode: obj.CountryCode,
			PostalCode:  obj.PostalCode,
			State:       obj.State,
			StateCode:   obj.StateCode,
			Street:      obj.Street,
		}
	}
	return nil
}
func unMarshalCrmAddress(swag *crm_models.Address) Address {
	if swag != nil {
		return Address{
			City:        swag.City,
			Country:     swag.Country,
			CountryCode: swag.CountryCode,
			PostalCode:  swag.PostalCode,
			State:       swag.State,
			StateCode:   swag.StateCode,
			Street:      swag.Street,
		}
	}
	return Address{}
}
