func ToApplicationID(uid string) (id ttnpb.ApplicationIdentifiers, err error) {
	id.ApplicationId = uid
	if err := id.ValidateFields("application_id"); err != nil {
		return ttnpb.ApplicationIdentifiers{}, errUniqueIdentifier.WithCause(err).WithAttributes("uid", uid)
	}
	return id, nil
}
ToApplicationID returns the application identifier of the specified unique ID.
package unique
import (
	"context"
	"fmt"
	"strings"
	"go.thethings.network/lorawan-stack/v3/pkg/errors"
	"go.thethings.network/lorawan-stack/v3/pkg/ttnpb"
)
var (
	errUniqueIdentifier = errors.DefineInvalidArgument("unique_identifier", "invalid unique identifier `{uid}`")
	errFormat           = errors.DefineInvalidArgument("format", "invalid format in value `{value}`")
)
func ID(ctx context.Context, id ttnpb.IDStringer) (res string) {
	res = id.IDString()
	if res == "" || strings.HasPrefix(res, ".") || strings.HasSuffix(res, ".") {
		panic(fmt.Errorf("failed to determine unique ID: the primary identifier is invalid"))
	}
	return res
}
func GenericID(ctx context.Context, uidPattern string) (res string) {
	return uidPattern
}
func WithContext(ctx context.Context, uid string) (context.Context, error) {
	return ctx, nil
}