Documentation
¶
Overview ¶
A Go wrapper for the Australian Business Register
Index ¶
- Constants
- Variables
- func ValidateABN(abn string) (bool, string)
- func ValidateACN(acn string) (bool, string)
- type ABN
- type ACN
- type AddressDetails
- type BusinessEntity
- type BusinessName
- type Client
- func (c *Client) SearchByABN(abn string, hist bool) (*BusinessEntity, error)
- func (c *Client) SearchByABNv201408(abn string, hist bool) (*BusinessEntity, error)
- func (c *Client) SearchByACN(abn string, hist bool) (*BusinessEntity, error)
- func (c *Client) SearchByASIC(abn string, hist bool) (*BusinessEntity, error)
- func (c *Client) SearchByASICv201408(acn string, hist bool) (*BusinessEntity, error)
- type EntityStatus
- type EntityType
- type GSTRegisteredPeriod
- type HumanName
- type Payload
- type Response
- type ResponseABNList
- type ResponseException
- type ResponseSearchResultsList
Constants ¶
const ( BaseURL = "https://www.abn.business.gov.au/abrxmlsearch/ABRXMLSearch.asmx/" GUIDEnvName = "ABR_GUID" MissingGUIDError = "The ABR_GUID environment variable must be set" )
Variables ¶
var Version = "0.1.0"
Functions ¶
func ValidateABN ¶ added in v0.1.0
ValidateABN tests a string to see if it is a valid ABN
func ValidateACN ¶ added in v0.1.0
ValidateACN tests a string to see if it is a valid ACN
Types ¶
type ABN ¶
type ABN struct { IdentifierValue string `xml:"identifierValue,omitempty"` IsCurrentIndicator string `xml:"isCurrentIndicator,omitempty"` ReplacedIdentifierValue string `xml:"replacedIdentifierValue,omitempty"` ReplacedFrom abnDate `xml:"replacedFrom,omitempty"` }
ABN represents an actual Australian Business Number
type ACN ¶ added in v0.1.0
type ACN struct { IdentifierValue string `xml:"identifierValue,omitempty"` IsCurrentIndicator string `xml:"isCurrentIndicator,omitempty"` ReplacedIdentifierValue string `xml:"replacedIdentifierValue,omitempty"` ReplacedFrom abnDate `xml:"replacedFrom,omitempty"` }
ACN represents an actual Australian Company Number
type AddressDetails ¶
type AddressDetails struct { StateCode string `xml:"stateCode,omitempty"` Postcode string `xml:"postcode,omitempty"` EffectiveFrom abnDate `xml:"effectiveFrom,omitempty"` EffectiveTo abnDate `xml:"effectiveTo,omitempty"` }
Address details represents an address used by a BusinessEntity for a period of time
type BusinessEntity ¶
type BusinessEntity struct { RecordLastUpdatedDate abnDate `xml:"recordLastUpdatedDate,omitempty"` // So many ways of naming a business! BusinessNames []*BusinessName `xml:"businessName,omitempty"` HumanNames []*HumanName `xml:"legalName,omitempty"` MainNames []*BusinessName `xml:"mainName,omitempty"` MainTradingNames []*BusinessName `xml:"mainTradingName,omitempty"` OtherTradingNames []*BusinessName `xml:"otherTradingName,omitempty"` // Other details ABNs []*ABN `xml:"ABN,omitempty"` ASICNumber string `xml:"ASICNumber,omitempty"` EntityStatuses []*EntityStatus `xml:"entityStatus,omitempty"` EntityType *EntityType `xml:"entityType,omitempty"` GSTRegisteredPeriods []*GSTRegisteredPeriod `xml:"goodsAndServicesTax,omitempty"` PhysicalAddresses []*AddressDetails `xml:"mainBusinessPhysicalAddress,omitempty"` }
BusinessEntity represents a legal entity and encapsulates everything that the ABR knows about such an entity
func (*BusinessEntity) Name ¶
func (b *BusinessEntity) Name() string
Name returns the most relevant name that is available
type BusinessName ¶
type BusinessName struct { OrganisationName string `xml:"organisationName"` EffectiveFrom abnDate `xml:"effectiveFrom"` EffectiveTo abnDate `xml:"effectiveTo"` }
BusinessName represents some kind of name that was in use by a BusinessEntity at some point in history
type Client ¶
Client provides a client connection to the ABR
func NewWithGuid ¶ added in v0.1.0
NewClientWithGuid returns a pointer to an initalized instance of a Client, configured with a GUID
func (*Client) SearchByABN ¶ added in v0.1.0
func (c *Client) SearchByABN(abn string, hist bool) (*BusinessEntity, error)
SearchByABN is an alias for SearchByABNv201408
func (*Client) SearchByABNv201408 ¶
func (c *Client) SearchByABNv201408(abn string, hist bool) (*BusinessEntity, error)
SearchByABNv201408 wraps the API call to query an ABN
func (*Client) SearchByACN ¶ added in v0.1.0
func (c *Client) SearchByACN(abn string, hist bool) (*BusinessEntity, error)
SearchByACN is an alias for SearchByASICv201408
func (*Client) SearchByASIC ¶ added in v0.1.0
func (c *Client) SearchByASIC(abn string, hist bool) (*BusinessEntity, error)
SearchByASIC is an alias for SearchByASICv201408
func (*Client) SearchByASICv201408 ¶ added in v0.1.0
func (c *Client) SearchByASICv201408(acn string, hist bool) (*BusinessEntity, error)
SearchByASICv201408 wraps the API call to query an ACN
type EntityStatus ¶
type EntityStatus struct { EntityStatusCode string `xml:"entityStatusCode,omitempty"` EffectiveFrom abnDate `xml:"effectiveFrom,omitempty"` EffectiveTo abnDate `xml:"effectiveTo,omitempty"` }
EntityStatus represents the status of an entity (Active or Cancelled)
type EntityType ¶
type EntityType struct { EntityTypeCode string `xml:"entityTypeCode,omitempty"` EntityDescription string `xml:"entityDescription,omitempty"` }
EntityType represents the type of an entity - individal, pty ltd, etc.
type GSTRegisteredPeriod ¶
type GSTRegisteredPeriod struct { EffectiveFrom abnDate `xml:"effectiveFrom,omitempty"` EffectiveTo abnDate `xml:"effectiveTo,omitempty"` }
GSTRegisteredPeriod represents a period during which the entity was registered for GST
type HumanName ¶
type HumanName struct { GivenName string `xml:"givenName"` OtherGivenName string `xml:"otherGivenName"` FamilyName string `xml:"familyName"` EffectiveFrom abnDate `xml:"effectiveFrom"` EffectiveTo abnDate `xml:"effectiveTo"` }
HumanName represents the name of a human that was in use by a BusinessEntity at some point in history
type Payload ¶
type Payload struct {
Response *Response `xml:"response,omitempty"`
}
Payload encapsulates a Response from the API
type Response ¶
type Response struct { UsageStatement string `xml:"usageStatement,omitempty"` DateRegisterLastUpdated abnDate `xml:"dateRegisterLastUpdated,omitempty"` DateTimeRetrieved time.Time `xml:"dateTimeRetrieved,omitempty"` BusinessEntity *BusinessEntity `xml:"businessEntity,omitempty"` BusinessEntity200506 *BusinessEntity `xml:"businessEntity200506,omitempty"` BusinessEntity200709 *BusinessEntity `xml:"businessEntity200709,omitempty"` BusinessEntity201205 *BusinessEntity `xml:"businessEntity201205,omitempty"` BusinessEntity201408 *BusinessEntity `xml:"businessEntity201408,omitempty"` Exception *ResponseException `xml:"exception,omitempty"` AbnList *ResponseABNList `xml:"abnList,omitempty"` SearchResultsList *ResponseSearchResultsList `xml:"searchResultsList,omitempty"` }
Response represents the XML responses available via the ABRXMLSearch