func (cli *Client) GetAddress(ctx context.Context, postalCode string) (*GetAddressResponse, error) {
	if _, err := strconv.Atoi(postalCode); err != nil || len(postalCode) != 7 {
		return nil, ErrInvalidArgument
	}
	const path = "/postalCode/"
	req, err := http.NewRequestWithContext(ctx, http.MethodGet, cli.Endpoint+path+postalCode, nil)
	if err != nil {
		return nil, fmt.Errorf("kenall: failed to generate http request: %w", err)
	}
	var res GetAddressResponse
	if err := cli.sendRequest(req, &res); err != nil {
		return nil, fmt.Errorf("kenall: failed to send request for kenall service: %w", err)
	}
	return &res, nil
}
GetAddress requests to the kenall service to get the address by postal code.
package kenall
import (
	"context"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"strconv"
	"time"
)
const (
	Endpoint = "https://api.kenall.jp/v1"
	RFC3339DateFormat = "2006-01-02"
)
var (
	ErrInvalidArgument = fmt.Errorf("kenall: invalid argument")
	ErrUnauthorized = fmt.Errorf("kenall: 401 unauthorized error")
	ErrPaymentRequired = fmt.Errorf("kenall: 402 payment required error")
	ErrForbidden = fmt.Errorf("kenall: 403 forbidden error")
	ErrNotFound = fmt.Errorf("kenall: 404 not found error")
	ErrInternalServerError = fmt.Errorf("kenall: 500 internal server error")
	ErrBadGateway = fmt.Errorf("kenall: 502 bad gateway error")
)
type (
	Client struct {
		HTTPClient *http.Client
		Endpoint   string
		token string
	}
	ClientOption interface {
		Apply(*Client)
	}
	withHTTPClient struct {
		client *http.Client
	}
	withEndpoint struct {
		endpoint string
	}
	GetAddressResponse struct {
		Version   Version    `json:"version"`
		Addresses []*Address `json:"data"`
	}
	GetCityResponse struct {
		Version Version `json:"version"`
		Cities  []*City `json:"data"`
	}
	Version time.Time
	Address struct {
		JISX0402           string `json:"jisx0402"`
		OldCode            string `json:"old_code"`
		PostalCode         string `json:"postal_code"`
		PrefectureKana     string `json:"prefecture_kana"`
		CityKana           string `json:"city_kana"`
		TownKana           string `json:"town_kana"`
		TownKanaRaw        string `json:"town_kana_raw"`
		Prefecture         string `json:"prefecture"`
		City               string `json:"city"`
		Town               string `json:"town"`
		Koaza              string `json:"koaza"`
		KyotoStreet        string `json:"kyoto_street"`
		Building           string `json:"building"`
		Floor              string `json:"floor"`
		TownPartial        bool   `json:"town_partial"`
		TownAddressedKoaza bool   `json:"town_addressed_koaza"`
		TownChome          bool   `json:"town_chome"`
		TownMulti          bool   `json:"town_multi"`
		TownRaw            string `json:"town_raw"`
		Corporation        struct {
			Name       string `json:"name"`
			NameKana   string `json:"name_kana"`
			BlockLot   string `json:"block_lot"`
			PostOffice string `json:"post_office"`
			CodeType   int    `json:"code_type"`
		} `json:"corporation"`
	}
	City struct {
		JISX0402       string `json:"jisx0402"`
		PrefectureCode string `json:"prefecture_code"`
		CityCode       string `json:"city_code"`
		PrefectureKana string `json:"prefecture_kana"`
		CityKana       string `json:"city_kana"`
		Prefecture     string `json:"prefecture"`
		City           string `json:"city"`
	}
)
func NewClient(token string, opts ...ClientOption) (*Client, error) {
	if token == "" {
		return nil, ErrInvalidArgument
	}
	cli := &Client{
		HTTPClient: http.DefaultClient,
		Endpoint:   Endpoint,
		token:      token,
	}
	for _, opt := range opts {
		opt.Apply(cli)
	}
	return cli, nil
}
func WithHTTPClient(cli *http.Client) ClientOption {
	return &withHTTPClient{client: cli}
}
func WithEndpoint(endpoint string) ClientOption {
	return &withEndpoint{endpoint: endpoint}
}