githubcombluehivehealthbluehivesdkgo

package module
v0.1.0-alpha.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

README

BlueHive Go API Library

Go Reference

The BlueHive Go library provides convenient access to the BlueHive REST API from applications written in Go.

It is generated with Stainless.

Installation

import (
	"github.com/bluehive-health/bluehive-sdk-go" // imported as githubcombluehivehealthbluehivesdkgo
)

Or to pin the version:

go get -u 'github.com/bluehive-health/bluehive-sdk-go@v0.1.0-alpha.14'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/bluehive-health/bluehive-sdk-go"
	"github.com/bluehive-health/bluehive-sdk-go/option"
)

func main() {
	client := githubcombluehivehealthbluehivesdkgo.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("BLUEHIVE_API_KEY")
	)
	response, err := client.Health.Check(context.TODO())
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response.Status)
}

Request fields

The githubcombluehivehealthbluehivesdkgo library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `json:"...,required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, githubcombluehivehealthbluehivesdkgo.String(string), githubcombluehivehealthbluehivesdkgo.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := githubcombluehivehealthbluehivesdkgo.ExampleParams{
	ID:   "id_xxx",                                           // required property
	Name: githubcombluehivehealthbluehivesdkgo.String("..."), // optional property

	Point: githubcombluehivehealthbluehivesdkgo.Point{
		X: 0,                                           // required field will serialize as 0
		Y: githubcombluehivehealthbluehivesdkgo.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: githubcombluehivehealthbluehivesdkgo.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[githubcombluehivehealthbluehivesdkgo.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of it's variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := githubcombluehivehealthbluehivesdkgo.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Health.Check(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

Errors

When the API returns a non-success status code, we return an error with type *githubcombluehivehealthbluehivesdkgo.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Health.Check(context.TODO())
if err != nil {
	var apierr *githubcombluehivehealthbluehivesdkgo.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/v1/health": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Health.Check(
	ctx,
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper githubcombluehivehealthbluehivesdkgo.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := githubcombluehivehealthbluehivesdkgo.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Health.Check(context.TODO(), option.WithMaxRetries(5))
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
response, err := client.Health.Check(context.TODO(), option.WithResponseInto(&response))
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", response)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: githubcombluehivehealthbluehivesdkgo.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := githubcombluehivehealthbluehivesdkgo.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (BLUEHIVE_API_KEY, BLUE_HIVE_BASE_URL). This should be used to initialize new clients.

func File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

type Client

type Client struct {
	Options      []option.RequestOption
	Health       HealthService
	Version      VersionService
	Providers    ProviderService
	Database     DatabaseService
	Fax          FaxService
	Employers    EmployerService
	Hl7          Hl7Service
	Orders       OrderService
	Employees    EmployeeService
	Integrations IntegrationService
}

Client creates a struct with services and top level methods that help with interacting with the bluehive API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r Client)

NewClient generates a new client with the default option read from the environment (BLUEHIVE_API_KEY, BLUE_HIVE_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type DatabaseCheckHealthResponse

type DatabaseCheckHealthResponse struct {
	// Database health status
	//
	// Any of "ok", "error".
	Status DatabaseCheckHealthResponseStatus `json:"status,required"`
	// Health check timestamp
	Timestamp string `json:"timestamp,required"`
	// Database name (hidden in production)
	Database string `json:"database"`
	// Error message if status is error
	Error string `json:"error"`
	// Database statistics (not available in production)
	Stats DatabaseCheckHealthResponseStats `json:"stats"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		Timestamp   respjson.Field
		Database    respjson.Field
		Error       respjson.Field
		Stats       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DatabaseCheckHealthResponse) RawJSON

func (r DatabaseCheckHealthResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*DatabaseCheckHealthResponse) UnmarshalJSON

func (r *DatabaseCheckHealthResponse) UnmarshalJSON(data []byte) error

type DatabaseCheckHealthResponseStats

type DatabaseCheckHealthResponseStats struct {
	// Number of collections
	Collections float64 `json:"collections"`
	// Total data size in bytes
	DataSize float64 `json:"dataSize"`
	// Total number of documents
	Documents float64 `json:"documents"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Collections respjson.Field
		DataSize    respjson.Field
		Documents   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Database statistics (not available in production)

func (DatabaseCheckHealthResponseStats) RawJSON

Returns the unmodified JSON received from the API

func (*DatabaseCheckHealthResponseStats) UnmarshalJSON

func (r *DatabaseCheckHealthResponseStats) UnmarshalJSON(data []byte) error

type DatabaseCheckHealthResponseStatus

type DatabaseCheckHealthResponseStatus string

Database health status

const (
	DatabaseCheckHealthResponseStatusOk    DatabaseCheckHealthResponseStatus = "ok"
	DatabaseCheckHealthResponseStatusError DatabaseCheckHealthResponseStatus = "error"
)

type DatabaseService

type DatabaseService struct {
	Options []option.RequestOption
}

DatabaseService contains methods and other services that help with interacting with the bluehive API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDatabaseService method instead.

func NewDatabaseService

func NewDatabaseService(opts ...option.RequestOption) (r DatabaseService)

NewDatabaseService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*DatabaseService) CheckHealth

func (r *DatabaseService) CheckHealth(ctx context.Context, opts ...option.RequestOption) (res *DatabaseCheckHealthResponse, err error)

Check MongoDB database connectivity and retrieve health statistics.

type EmployeeDeleteResponse

type EmployeeDeleteResponse struct {
	Message string `json:"message,required"`
	Success bool   `json:"success,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Employee deleted successfully

func (EmployeeDeleteResponse) RawJSON

func (r EmployeeDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmployeeDeleteResponse) UnmarshalJSON

func (r *EmployeeDeleteResponse) UnmarshalJSON(data []byte) error

type EmployeeGetResponse

type EmployeeGetResponse struct {
	// Employee details
	Employee EmployeeGetResponseEmployee `json:"employee,required"`
	Message  string                      `json:"message,required"`
	Success  bool                        `json:"success,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Employee    respjson.Field
		Message     respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Employee found successfully

func (EmployeeGetResponse) RawJSON

func (r EmployeeGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmployeeGetResponse) UnmarshalJSON

func (r *EmployeeGetResponse) UnmarshalJSON(data []byte) error

type EmployeeGetResponseEmployee

type EmployeeGetResponseEmployee struct {
	// Unique identifier
	ID string `json:"_id,required"`
	// Email address
	Email string `json:"email,required"`
	// ID of associated employer
	EmployerID string `json:"employer_id,required"`
	// First name
	FirstName string `json:"firstName,required"`
	// Last name
	LastName string `json:"lastName,required"`
	// Account status
	//
	// Any of "Active", "Inactive".
	ActiveAccount string `json:"activeAccount"`
	// Employee address
	Address EmployeeGetResponseEmployeeAddress `json:"address"`
	// Brief description or bio
	Blurb string `json:"blurb"`
	// Creation timestamp
	CreatedAt time.Time `json:"createdAt" format:"date-time"`
	// ID of user who created the employee
	CreatedBy string `json:"createdBy"`
	// List of department names
	Departments []string `json:"departments"`
	// Date of birth
	Dob string `json:"dob"`
	// Additional custom fields
	ExtendedFields []EmployeeGetResponseEmployeeExtendedField `json:"extendedFields"`
	// Contact phone numbers
	Phone []EmployeeGetResponseEmployeePhone `json:"phone"`
	// Job title
	Title string `json:"title"`
	// Last update timestamp
	UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
	// ID of user who last updated the employee
	UpdatedBy string `json:"updatedBy"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Email          respjson.Field
		EmployerID     respjson.Field
		FirstName      respjson.Field
		LastName       respjson.Field
		ActiveAccount  respjson.Field
		Address        respjson.Field
		Blurb          respjson.Field
		CreatedAt      respjson.Field
		CreatedBy      respjson.Field
		Departments    respjson.Field
		Dob            respjson.Field
		ExtendedFields respjson.Field
		Phone          respjson.Field
		Title          respjson.Field
		UpdatedAt      respjson.Field
		UpdatedBy      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Employee details

func (EmployeeGetResponseEmployee) RawJSON

func (r EmployeeGetResponseEmployee) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmployeeGetResponseEmployee) UnmarshalJSON

func (r *EmployeeGetResponseEmployee) UnmarshalJSON(data []byte) error

type EmployeeGetResponseEmployeeAddress

type EmployeeGetResponseEmployeeAddress struct {
	// City
	City string `json:"city,required"`
	// Postal code
	PostalCode string `json:"postalCode,required"`
	// State
	State string `json:"state,required"`
	// Street address line 1
	Street1 string `json:"street1,required"`
	// Country
	Country string `json:"country"`
	// County
	County string `json:"county"`
	// Street address line 2
	Street2 string `json:"street2"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		City        respjson.Field
		PostalCode  respjson.Field
		State       respjson.Field
		Street1     respjson.Field
		Country     respjson.Field
		County      respjson.Field
		Street2     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Employee address

func (EmployeeGetResponseEmployeeAddress) RawJSON

Returns the unmodified JSON received from the API

func (*EmployeeGetResponseEmployeeAddress) UnmarshalJSON

func (r *EmployeeGetResponseEmployeeAddress) UnmarshalJSON(data []byte) error

type EmployeeGetResponseEmployeeExtendedField

type EmployeeGetResponseEmployeeExtendedField struct {
	// Field name
	Name string `json:"name,required"`
	// Field value
	Value string `json:"value,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EmployeeGetResponseEmployeeExtendedField) RawJSON

Returns the unmodified JSON received from the API

func (*EmployeeGetResponseEmployeeExtendedField) UnmarshalJSON

func (r *EmployeeGetResponseEmployeeExtendedField) UnmarshalJSON(data []byte) error

type EmployeeGetResponseEmployeePhone

type EmployeeGetResponseEmployeePhone struct {
	// Phone number
	Number string `json:"number,required"`
	// Type of phone number
	//
	// Any of "Cell", "Home", "Work", "Other".
	Type string `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Number      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EmployeeGetResponseEmployeePhone) RawJSON

Returns the unmodified JSON received from the API

func (*EmployeeGetResponseEmployeePhone) UnmarshalJSON

func (r *EmployeeGetResponseEmployeePhone) UnmarshalJSON(data []byte) error

type EmployeeLinkUserParams

type EmployeeLinkUserParams struct {
	EmployeeID string   `json:"employeeId,required"`
	UserID     string   `json:"userId,required"`
	Role       []string `json:"role,omitzero"`
	// contains filtered or unexported fields
}

func (EmployeeLinkUserParams) MarshalJSON

func (r EmployeeLinkUserParams) MarshalJSON() (data []byte, err error)

func (*EmployeeLinkUserParams) UnmarshalJSON

func (r *EmployeeLinkUserParams) UnmarshalJSON(data []byte) error

type EmployeeLinkUserResponse

type EmployeeLinkUserResponse struct {
	// ID of the created link
	LinkID  string `json:"linkId,required"`
	Message string `json:"message,required"`
	Success bool   `json:"success,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LinkID      respjson.Field
		Message     respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Employee linked successfully

func (EmployeeLinkUserResponse) RawJSON

func (r EmployeeLinkUserResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmployeeLinkUserResponse) UnmarshalJSON

func (r *EmployeeLinkUserResponse) UnmarshalJSON(data []byte) error

type EmployeeListParams

type EmployeeListParams struct {
	// ID of the employer to list employees for
	EmployerID string `query:"employerId,required" json:"-"`
	// Maximum number of employees to return (default: 50)
	Limit param.Opt[string] `query:"limit,omitzero" json:"-"`
	// Number of employees to skip (default: 0)
	Offset param.Opt[string] `query:"offset,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EmployeeListParams) URLQuery

func (r EmployeeListParams) URLQuery() (v url.Values, err error)

URLQuery serializes EmployeeListParams's query parameters as `url.Values`.

type EmployeeListResponse

type EmployeeListResponse struct {
	// List of employees
	Employees []EmployeeListResponseEmployee `json:"employees,required"`
	Message   string                         `json:"message,required"`
	Success   bool                           `json:"success,required"`
	// Total number of employees returned
	Total float64 `json:"total,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Employees   respjson.Field
		Message     respjson.Field
		Success     respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Employees retrieved successfully

func (EmployeeListResponse) RawJSON

func (r EmployeeListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmployeeListResponse) UnmarshalJSON

func (r *EmployeeListResponse) UnmarshalJSON(data []byte) error

type EmployeeListResponseEmployee

type EmployeeListResponseEmployee struct {
	// Unique identifier
	ID string `json:"_id,required"`
	// Email address
	Email string `json:"email,required"`
	// ID of associated employer
	EmployerID string `json:"employer_id,required"`
	// First name
	FirstName string `json:"firstName,required"`
	// Last name
	LastName string `json:"lastName,required"`
	// Account status
	//
	// Any of "Active", "Inactive".
	ActiveAccount string `json:"activeAccount"`
	// Employee address
	Address EmployeeListResponseEmployeeAddress `json:"address"`
	// Brief description or bio
	Blurb string `json:"blurb"`
	// Creation timestamp
	CreatedAt time.Time `json:"createdAt" format:"date-time"`
	// ID of user who created the employee
	CreatedBy string `json:"createdBy"`
	// List of department names
	Departments []string `json:"departments"`
	// Date of birth
	Dob string `json:"dob"`
	// Additional custom fields
	ExtendedFields []EmployeeListResponseEmployeeExtendedField `json:"extendedFields"`
	// Contact phone numbers
	Phone []EmployeeListResponseEmployeePhone `json:"phone"`
	// Job title
	Title string `json:"title"`
	// Last update timestamp
	UpdatedAt time.Time `json:"updatedAt" format:"date-time"`
	// ID of user who last updated the employee
	UpdatedBy string `json:"updatedBy"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Email          respjson.Field
		EmployerID     respjson.Field
		FirstName      respjson.Field
		LastName       respjson.Field
		ActiveAccount  respjson.Field
		Address        respjson.Field
		Blurb          respjson.Field
		CreatedAt      respjson.Field
		CreatedBy      respjson.Field
		Departments    respjson.Field
		Dob            respjson.Field
		ExtendedFields respjson.Field
		Phone          respjson.Field
		Title          respjson.Field
		UpdatedAt      respjson.Field
		UpdatedBy      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Employee details

func (EmployeeListResponseEmployee) RawJSON

Returns the unmodified JSON received from the API

func (*EmployeeListResponseEmployee) UnmarshalJSON

func (r *EmployeeListResponseEmployee) UnmarshalJSON(data []byte) error

type EmployeeListResponseEmployeeAddress

type EmployeeListResponseEmployeeAddress struct {
	// City
	City string `json:"city,required"`
	// Postal code
	PostalCode string `json:"postalCode,required"`
	// State
	State string `json:"state,required"`
	// Street address line 1
	Street1 string `json:"street1,required"`
	// Country
	Country string `json:"country"`
	// County
	County string `json:"county"`
	// Street address line 2
	Street2 string `json:"street2"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		City        respjson.Field
		PostalCode  respjson.Field
		State       respjson.Field
		Street1     respjson.Field
		Country     respjson.Field
		County      respjson.Field
		Street2     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Employee address

func (EmployeeListResponseEmployeeAddress) RawJSON

Returns the unmodified JSON received from the API

func (*EmployeeListResponseEmployeeAddress) UnmarshalJSON

func (r *EmployeeListResponseEmployeeAddress) UnmarshalJSON(data []byte) error

type EmployeeListResponseEmployeeExtendedField

type EmployeeListResponseEmployeeExtendedField struct {
	// Field name
	Name string `json:"name,required"`
	// Field value
	Value string `json:"value,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EmployeeListResponseEmployeeExtendedField) RawJSON

Returns the unmodified JSON received from the API

func (*EmployeeListResponseEmployeeExtendedField) UnmarshalJSON

func (r *EmployeeListResponseEmployeeExtendedField) UnmarshalJSON(data []byte) error

type EmployeeListResponseEmployeePhone

type EmployeeListResponseEmployeePhone struct {
	// Phone number
	Number string `json:"number,required"`
	// Type of phone number
	//
	// Any of "Cell", "Home", "Work", "Other".
	Type string `json:"type,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Number      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EmployeeListResponseEmployeePhone) RawJSON

Returns the unmodified JSON received from the API

func (*EmployeeListResponseEmployeePhone) UnmarshalJSON

func (r *EmployeeListResponseEmployeePhone) UnmarshalJSON(data []byte) error

type EmployeeNewParams

type EmployeeNewParams struct {
	Email      string            `json:"email,required" format:"email"`
	FirstName  string            `json:"firstName,required"`
	LastName   string            `json:"lastName,required"`
	Blurb      param.Opt[string] `json:"blurb,omitzero"`
	Dob        param.Opt[string] `json:"dob,omitzero"`
	EmployerID param.Opt[string] `json:"employer_id,omitzero"`
	Title      param.Opt[string] `json:"title,omitzero"`
	// Any of "Active", "Inactive".
	ActiveAccount  EmployeeNewParamsActiveAccount   `json:"activeAccount,omitzero"`
	Address        EmployeeNewParamsAddress         `json:"address,omitzero"`
	Departments    []string                         `json:"departments,omitzero"`
	ExtendedFields []EmployeeNewParamsExtendedField `json:"extendedFields,omitzero"`
	Phone          []EmployeeNewParamsPhone         `json:"phone,omitzero"`
	// contains filtered or unexported fields
}

func (EmployeeNewParams) MarshalJSON

func (r EmployeeNewParams) MarshalJSON() (data []byte, err error)

func (*EmployeeNewParams) UnmarshalJSON

func (r *EmployeeNewParams) UnmarshalJSON(data []byte) error

type EmployeeNewParamsActiveAccount

type EmployeeNewParamsActiveAccount string
const (
	EmployeeNewParamsActiveAccountActive   EmployeeNewParamsActiveAccount = "Active"
	EmployeeNewParamsActiveAccountInactive EmployeeNewParamsActiveAccount = "Inactive"
)

type EmployeeNewParamsAddress

type EmployeeNewParamsAddress struct {
	City       string            `json:"city,required"`
	PostalCode string            `json:"postalCode,required"`
	State      string            `json:"state,required"`
	Street1    string            `json:"street1,required"`
	Country    param.Opt[string] `json:"country,omitzero"`
	County     param.Opt[string] `json:"county,omitzero"`
	Street2    param.Opt[string] `json:"street2,omitzero"`
	// contains filtered or unexported fields
}

The properties City, PostalCode, State, Street1 are required.

func (EmployeeNewParamsAddress) MarshalJSON

func (r EmployeeNewParamsAddress) MarshalJSON() (data []byte, err error)

func (*EmployeeNewParamsAddress) UnmarshalJSON

func (r *EmployeeNewParamsAddress) UnmarshalJSON(data []byte) error

type EmployeeNewParamsExtendedField

type EmployeeNewParamsExtendedField struct {
	Name  string `json:"name,required"`
	Value string `json:"value,required"`
	// contains filtered or unexported fields
}

The properties Name, Value are required.

func (EmployeeNewParamsExtendedField) MarshalJSON

func (r EmployeeNewParamsExtendedField) MarshalJSON() (data []byte, err error)

func (*EmployeeNewParamsExtendedField) UnmarshalJSON

func (r *EmployeeNewParamsExtendedField) UnmarshalJSON(data []byte) error

type EmployeeNewParamsPhone

type EmployeeNewParamsPhone struct {
	Number string `json:"number,required"`
	// Any of "Cell", "Home", "Work", "Other".
	Type string `json:"type,omitzero,required"`
	// contains filtered or unexported fields
}

The properties Number, Type are required.

func (EmployeeNewParamsPhone) MarshalJSON

func (r EmployeeNewParamsPhone) MarshalJSON() (data []byte, err error)

func (*EmployeeNewParamsPhone) UnmarshalJSON

func (r *EmployeeNewParamsPhone) UnmarshalJSON(data []byte) error

type EmployeeNewResponse

type EmployeeNewResponse struct {
	// ID of the created employee
	EmployeeID string `json:"employeeId,required"`
	Message    string `json:"message,required"`
	Success    bool   `json:"success,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EmployeeID  respjson.Field
		Message     respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Employee created successfully

func (EmployeeNewResponse) RawJSON

func (r EmployeeNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmployeeNewResponse) UnmarshalJSON

func (r *EmployeeNewResponse) UnmarshalJSON(data []byte) error

type EmployeeService

type EmployeeService struct {
	Options []option.RequestOption
}

EmployeeService contains methods and other services that help with interacting with the bluehive API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmployeeService method instead.

func NewEmployeeService

func NewEmployeeService(opts ...option.RequestOption) (r EmployeeService)

NewEmployeeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EmployeeService) Delete

func (r *EmployeeService) Delete(ctx context.Context, employeeID string, opts ...option.RequestOption) (res *EmployeeDeleteResponse, err error)

Delete an employee from the system. Cannot delete employees with existing orders.

func (*EmployeeService) Get

func (r *EmployeeService) Get(ctx context.Context, employeeID string, opts ...option.RequestOption) (res *EmployeeGetResponse, err error)

Retrieve an employee by their unique ID.

func (*EmployeeService) LinkUser

Link an employee to a user account with specified roles

func (*EmployeeService) List

List all employees for a given employer with pagination.

func (*EmployeeService) New

Create a new employee in the system.

func (*EmployeeService) UnlinkUser

Remove the link between an employee and a user account

func (*EmployeeService) Update

Update an existing employee in the system.

type EmployeeUnlinkUserParams

type EmployeeUnlinkUserParams struct {
	// ID of the employee to unlink
	EmployeeID string `json:"employeeId,required"`
	// ID of the user to unlink from
	UserID string `json:"userId,required"`
	// contains filtered or unexported fields
}

func (EmployeeUnlinkUserParams) MarshalJSON

func (r EmployeeUnlinkUserParams) MarshalJSON() (data []byte, err error)

func (*EmployeeUnlinkUserParams) UnmarshalJSON

func (r *EmployeeUnlinkUserParams) UnmarshalJSON(data []byte) error

type EmployeeUnlinkUserResponse

type EmployeeUnlinkUserResponse struct {
	Message string `json:"message,required"`
	Success bool   `json:"success,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Employee unlinked successfully

func (EmployeeUnlinkUserResponse) RawJSON

func (r EmployeeUnlinkUserResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmployeeUnlinkUserResponse) UnmarshalJSON

func (r *EmployeeUnlinkUserResponse) UnmarshalJSON(data []byte) error

type EmployeeUpdateParams

type EmployeeUpdateParams struct {
	ID         string            `json:"_id,required"`
	Blurb      param.Opt[string] `json:"blurb,omitzero"`
	Dob        param.Opt[string] `json:"dob,omitzero"`
	Email      param.Opt[string] `json:"email,omitzero" format:"email"`
	EmployerID param.Opt[string] `json:"employer_id,omitzero"`
	FirstName  param.Opt[string] `json:"firstName,omitzero"`
	LastName   param.Opt[string] `json:"lastName,omitzero"`
	Title      param.Opt[string] `json:"title,omitzero"`
	// Any of "Active", "Inactive".
	ActiveAccount  EmployeeUpdateParamsActiveAccount   `json:"activeAccount,omitzero"`
	Address        EmployeeUpdateParamsAddress         `json:"address,omitzero"`
	Departments    []string                            `json:"departments,omitzero"`
	ExtendedFields []EmployeeUpdateParamsExtendedField `json:"extendedFields,omitzero"`
	Phone          []EmployeeUpdateParamsPhone         `json:"phone,omitzero"`
	// contains filtered or unexported fields
}

func (EmployeeUpdateParams) MarshalJSON

func (r EmployeeUpdateParams) MarshalJSON() (data []byte, err error)

func (*EmployeeUpdateParams) UnmarshalJSON

func (r *EmployeeUpdateParams) UnmarshalJSON(data []byte) error

type EmployeeUpdateParamsActiveAccount

type EmployeeUpdateParamsActiveAccount string
const (
	EmployeeUpdateParamsActiveAccountActive   EmployeeUpdateParamsActiveAccount = "Active"
	EmployeeUpdateParamsActiveAccountInactive EmployeeUpdateParamsActiveAccount = "Inactive"
)

type EmployeeUpdateParamsAddress

type EmployeeUpdateParamsAddress struct {
	City       string            `json:"city,required"`
	PostalCode string            `json:"postalCode,required"`
	State      string            `json:"state,required"`
	Street1    string            `json:"street1,required"`
	Country    param.Opt[string] `json:"country,omitzero"`
	County     param.Opt[string] `json:"county,omitzero"`
	Street2    param.Opt[string] `json:"street2,omitzero"`
	// contains filtered or unexported fields
}

The properties City, PostalCode, State, Street1 are required.

func (EmployeeUpdateParamsAddress) MarshalJSON

func (r EmployeeUpdateParamsAddress) MarshalJSON() (data []byte, err error)

func (*EmployeeUpdateParamsAddress) UnmarshalJSON

func (r *EmployeeUpdateParamsAddress) UnmarshalJSON(data []byte) error

type EmployeeUpdateParamsExtendedField

type EmployeeUpdateParamsExtendedField struct {
	Name  string `json:"name,required"`
	Value string `json:"value,required"`
	// contains filtered or unexported fields
}

The properties Name, Value are required.

func (EmployeeUpdateParamsExtendedField) MarshalJSON

func (r EmployeeUpdateParamsExtendedField) MarshalJSON() (data []byte, err error)

func (*EmployeeUpdateParamsExtendedField) UnmarshalJSON

func (r *EmployeeUpdateParamsExtendedField) UnmarshalJSON(data []byte) error

type EmployeeUpdateParamsPhone

type EmployeeUpdateParamsPhone struct {
	Number string `json:"number,required"`
	// Any of "Cell", "Home", "Work", "Other".
	Type string `json:"type,omitzero,required"`
	// contains filtered or unexported fields
}

The properties Number, Type are required.

func (EmployeeUpdateParamsPhone) MarshalJSON

func (r EmployeeUpdateParamsPhone) MarshalJSON() (data []byte, err error)

func (*EmployeeUpdateParamsPhone) UnmarshalJSON

func (r *EmployeeUpdateParamsPhone) UnmarshalJSON(data []byte) error

type EmployeeUpdateResponse

type EmployeeUpdateResponse struct {
	Message string `json:"message,required"`
	Success bool   `json:"success,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Employee updated successfully

func (EmployeeUpdateResponse) RawJSON

func (r EmployeeUpdateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmployeeUpdateResponse) UnmarshalJSON

func (r *EmployeeUpdateResponse) UnmarshalJSON(data []byte) error

type EmployerGetResponse

type EmployerGetResponse map[string]any

type EmployerListParams

type EmployerListParams struct {
	LoginToken string `header:"login-token,required" json:"-"`
	UserID     string `header:"user-id,required" json:"-"`
	// contains filtered or unexported fields
}

type EmployerListResponse

type EmployerListResponse map[string]any

type EmployerNewParams

type EmployerNewParams struct {
	Address         EmployerNewParamsAddress `json:"address,omitzero,required"`
	Email           string                   `json:"email,required" format:"email"`
	Name            string                   `json:"name,required"`
	Phones          []EmployerNewParamsPhone `json:"phones,omitzero,required"`
	Demo            param.Opt[bool]          `json:"demo,omitzero"`
	EmployeeConsent param.Opt[bool]          `json:"employeeConsent,omitzero"`
	OnsiteClinic    param.Opt[bool]          `json:"onsiteClinic,omitzero"`
	Website         param.Opt[string]        `json:"website,omitzero"`
	BillingAddress  map[string]any           `json:"billingAddress,omitzero"`
	Checkr          EmployerNewParamsCheckr  `json:"checkr,omitzero"`
	Metadata        map[string]any           `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (EmployerNewParams) MarshalJSON

func (r EmployerNewParams) MarshalJSON() (data []byte, err error)

func (*EmployerNewParams) UnmarshalJSON

func (r *EmployerNewParams) UnmarshalJSON(data []byte) error

type EmployerNewParamsAddress

type EmployerNewParamsAddress struct {
	City    string            `json:"city,required"`
	State   string            `json:"state,required"`
	Street1 string            `json:"street1,required"`
	ZipCode string            `json:"zipCode,required"`
	Country param.Opt[string] `json:"country,omitzero"`
	Street2 param.Opt[string] `json:"street2,omitzero"`
	// contains filtered or unexported fields
}

The properties City, State, Street1, ZipCode are required.

func (EmployerNewParamsAddress) MarshalJSON

func (r EmployerNewParamsAddress) MarshalJSON() (data []byte, err error)

func (*EmployerNewParamsAddress) UnmarshalJSON

func (r *EmployerNewParamsAddress) UnmarshalJSON(data []byte) error

type EmployerNewParamsCheckr

type EmployerNewParamsCheckr struct {
	ID     string            `json:"id,required"`
	Status param.Opt[string] `json:"status,omitzero"`
	// contains filtered or unexported fields
}

The property ID is required.

func (EmployerNewParamsCheckr) MarshalJSON

func (r EmployerNewParamsCheckr) MarshalJSON() (data []byte, err error)

func (*EmployerNewParamsCheckr) UnmarshalJSON

func (r *EmployerNewParamsCheckr) UnmarshalJSON(data []byte) error

type EmployerNewParamsPhone

type EmployerNewParamsPhone struct {
	Number  string            `json:"number,required"`
	Primary param.Opt[bool]   `json:"primary,omitzero"`
	Type    param.Opt[string] `json:"type,omitzero"`
	// contains filtered or unexported fields
}

The property Number is required.

func (EmployerNewParamsPhone) MarshalJSON

func (r EmployerNewParamsPhone) MarshalJSON() (data []byte, err error)

func (*EmployerNewParamsPhone) UnmarshalJSON

func (r *EmployerNewParamsPhone) UnmarshalJSON(data []byte) error

type EmployerNewResponse

type EmployerNewResponse struct {
	ID              string           `json:"_id,required"`
	Address         map[string]any   `json:"address,required"`
	Email           string           `json:"email,required"`
	Name            string           `json:"name,required"`
	Phones          []map[string]any `json:"phones,required"`
	CreatedAt       string           `json:"createdAt"`
	CreatedBy       string           `json:"createdBy"`
	Demo            bool             `json:"demo"`
	EmployeeConsent bool             `json:"employeeConsent"`
	OnsiteClinic    bool             `json:"onsiteClinic"`
	Website         string           `json:"website"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Address         respjson.Field
		Email           respjson.Field
		Name            respjson.Field
		Phones          respjson.Field
		CreatedAt       respjson.Field
		CreatedBy       respjson.Field
		Demo            respjson.Field
		EmployeeConsent respjson.Field
		OnsiteClinic    respjson.Field
		Website         respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EmployerNewResponse) RawJSON

func (r EmployerNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmployerNewResponse) UnmarshalJSON

func (r *EmployerNewResponse) UnmarshalJSON(data []byte) error

type EmployerService

type EmployerService struct {
	Options        []option.RequestOption
	ServiceBundles EmployerServiceBundleService
}

EmployerService contains methods and other services that help with interacting with the bluehive API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmployerService method instead.

func NewEmployerService

func NewEmployerService(opts ...option.RequestOption) (r EmployerService)

NewEmployerService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EmployerService) Get

func (r *EmployerService) Get(ctx context.Context, employerID string, opts ...option.RequestOption) (res *EmployerGetResponse, err error)

Get Employer

func (*EmployerService) List

Get Employers for Current User

func (*EmployerService) New

Create Employer

type EmployerServiceBundleDeleteParams

type EmployerServiceBundleDeleteParams struct {
	EmployerID string `path:"employerId,required" json:"-"`
	// contains filtered or unexported fields
}

type EmployerServiceBundleGetParams

type EmployerServiceBundleGetParams struct {
	EmployerID string `path:"employerId,required" json:"-"`
	// contains filtered or unexported fields
}

type EmployerServiceBundleGetResponse

type EmployerServiceBundleGetResponse struct {
	ID         string   `json:"_id,required"`
	BundleName string   `json:"bundleName,required"`
	EmployerID string   `json:"employerId,required"`
	ServiceIDs []string `json:"serviceIds,required"`
	CreatedAt  string   `json:"createdAt"`
	CreatedBy  string   `json:"createdBy"`
	Roles      []string `json:"roles,nullable"`
	UpdatedAt  string   `json:"updatedAt"`
	UpdatedBy  string   `json:"updatedBy"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		BundleName  respjson.Field
		EmployerID  respjson.Field
		ServiceIDs  respjson.Field
		CreatedAt   respjson.Field
		CreatedBy   respjson.Field
		Roles       respjson.Field
		UpdatedAt   respjson.Field
		UpdatedBy   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EmployerServiceBundleGetResponse) RawJSON

Returns the unmodified JSON received from the API

func (*EmployerServiceBundleGetResponse) UnmarshalJSON

func (r *EmployerServiceBundleGetResponse) UnmarshalJSON(data []byte) error

type EmployerServiceBundleListResponse

type EmployerServiceBundleListResponse struct {
	ID         string   `json:"_id,required"`
	BundleName string   `json:"bundleName,required"`
	EmployerID string   `json:"employerId,required"`
	ServiceIDs []string `json:"serviceIds,required"`
	CreatedAt  string   `json:"createdAt"`
	CreatedBy  string   `json:"createdBy"`
	Roles      []string `json:"roles,nullable"`
	UpdatedAt  string   `json:"updatedAt"`
	UpdatedBy  string   `json:"updatedBy"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		BundleName  respjson.Field
		EmployerID  respjson.Field
		ServiceIDs  respjson.Field
		CreatedAt   respjson.Field
		CreatedBy   respjson.Field
		Roles       respjson.Field
		UpdatedAt   respjson.Field
		UpdatedBy   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EmployerServiceBundleListResponse) RawJSON

Returns the unmodified JSON received from the API

func (*EmployerServiceBundleListResponse) UnmarshalJSON

func (r *EmployerServiceBundleListResponse) UnmarshalJSON(data []byte) error

type EmployerServiceBundleNewParams

type EmployerServiceBundleNewParams struct {
	BundleName string            `json:"bundleName,required"`
	ServiceIDs []string          `json:"serviceIds,omitzero,required"`
	ID         param.Opt[string] `json:"_id,omitzero"`
	Roles      []string          `json:"roles,omitzero"`
	// contains filtered or unexported fields
}

func (EmployerServiceBundleNewParams) MarshalJSON

func (r EmployerServiceBundleNewParams) MarshalJSON() (data []byte, err error)

func (*EmployerServiceBundleNewParams) UnmarshalJSON

func (r *EmployerServiceBundleNewParams) UnmarshalJSON(data []byte) error

type EmployerServiceBundleNewResponse

type EmployerServiceBundleNewResponse struct {
	ID         string   `json:"_id,required"`
	BundleName string   `json:"bundleName,required"`
	EmployerID string   `json:"employerId,required"`
	ServiceIDs []string `json:"serviceIds,required"`
	CreatedAt  string   `json:"createdAt"`
	CreatedBy  string   `json:"createdBy"`
	Roles      []string `json:"roles,nullable"`
	UpdatedAt  string   `json:"updatedAt"`
	UpdatedBy  string   `json:"updatedBy"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		BundleName  respjson.Field
		EmployerID  respjson.Field
		ServiceIDs  respjson.Field
		CreatedAt   respjson.Field
		CreatedBy   respjson.Field
		Roles       respjson.Field
		UpdatedAt   respjson.Field
		UpdatedBy   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EmployerServiceBundleNewResponse) RawJSON

Returns the unmodified JSON received from the API

func (*EmployerServiceBundleNewResponse) UnmarshalJSON

func (r *EmployerServiceBundleNewResponse) UnmarshalJSON(data []byte) error

type EmployerServiceBundleService

type EmployerServiceBundleService struct {
	Options []option.RequestOption
}

EmployerServiceBundleService contains methods and other services that help with interacting with the bluehive API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmployerServiceBundleService method instead.

func NewEmployerServiceBundleService

func NewEmployerServiceBundleService(opts ...option.RequestOption) (r EmployerServiceBundleService)

NewEmployerServiceBundleService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*EmployerServiceBundleService) Delete

Delete Service Bundle

func (*EmployerServiceBundleService) Get

Get Service Bundle

func (*EmployerServiceBundleService) List

List Service Bundles

func (*EmployerServiceBundleService) New

Create Service Bundle

func (*EmployerServiceBundleService) Update

Update Service Bundle

type EmployerServiceBundleUpdateParams

type EmployerServiceBundleUpdateParams struct {
	EmployerID string            `path:"employerId,required" json:"-"`
	BundleName string            `json:"bundleName,required"`
	ServiceIDs []string          `json:"serviceIds,omitzero,required"`
	ID         param.Opt[string] `json:"_id,omitzero"`
	Roles      []string          `json:"roles,omitzero"`
	// contains filtered or unexported fields
}

func (EmployerServiceBundleUpdateParams) MarshalJSON

func (r EmployerServiceBundleUpdateParams) MarshalJSON() (data []byte, err error)

func (*EmployerServiceBundleUpdateParams) UnmarshalJSON

func (r *EmployerServiceBundleUpdateParams) UnmarshalJSON(data []byte) error

type EmployerServiceBundleUpdateResponse

type EmployerServiceBundleUpdateResponse struct {
	ID         string   `json:"_id,required"`
	BundleName string   `json:"bundleName,required"`
	EmployerID string   `json:"employerId,required"`
	ServiceIDs []string `json:"serviceIds,required"`
	CreatedAt  string   `json:"createdAt"`
	CreatedBy  string   `json:"createdBy"`
	Roles      []string `json:"roles,nullable"`
	UpdatedAt  string   `json:"updatedAt"`
	UpdatedBy  string   `json:"updatedBy"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		BundleName  respjson.Field
		EmployerID  respjson.Field
		ServiceIDs  respjson.Field
		CreatedAt   respjson.Field
		CreatedBy   respjson.Field
		Roles       respjson.Field
		UpdatedAt   respjson.Field
		UpdatedBy   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EmployerServiceBundleUpdateResponse) RawJSON

Returns the unmodified JSON received from the API

func (*EmployerServiceBundleUpdateResponse) UnmarshalJSON

func (r *EmployerServiceBundleUpdateResponse) UnmarshalJSON(data []byte) error

type Error

type Error = apierror.Error

type FaxGetStatusResponse

type FaxGetStatusResponse struct {
	// Fax identifier
	ID string `json:"id,required"`
	// ISO timestamp when fax was created
	CreatedAt string `json:"createdAt,required"`
	// Sender fax number
	From string `json:"from,required"`
	// Provider used to send the fax
	Provider string `json:"provider,required"`
	// Current fax status
	//
	// Any of "queued", "dialing", "sending", "delivered", "failed", "cancelled",
	// "retrying".
	Status FaxGetStatusResponseStatus `json:"status,required"`
	// Recipient fax number
	To string `json:"to,required"`
	// ISO timestamp when status was last updated
	UpdatedAt string `json:"updatedAt,required"`
	// Cost of the fax
	Cost float64 `json:"cost"`
	// ISO timestamp when fax was delivered
	DeliveredAt string `json:"deliveredAt"`
	// Call duration in seconds
	Duration float64 `json:"duration"`
	// Error message if fax failed
	ErrorMessage string `json:"errorMessage"`
	// Number of pages in the fax
	PageCount float64 `json:"pageCount"`
	// Provider-specific additional data
	ProviderData map[string]any `json:"providerData"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		CreatedAt    respjson.Field
		From         respjson.Field
		Provider     respjson.Field
		Status       respjson.Field
		To           respjson.Field
		UpdatedAt    respjson.Field
		Cost         respjson.Field
		DeliveredAt  respjson.Field
		Duration     respjson.Field
		ErrorMessage respjson.Field
		PageCount    respjson.Field
		ProviderData respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FaxGetStatusResponse) RawJSON

func (r FaxGetStatusResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FaxGetStatusResponse) UnmarshalJSON

func (r *FaxGetStatusResponse) UnmarshalJSON(data []byte) error

type FaxGetStatusResponseStatus

type FaxGetStatusResponseStatus string

Current fax status

const (
	FaxGetStatusResponseStatusQueued    FaxGetStatusResponseStatus = "queued"
	FaxGetStatusResponseStatusDialing   FaxGetStatusResponseStatus = "dialing"
	FaxGetStatusResponseStatusSending   FaxGetStatusResponseStatus = "sending"
	FaxGetStatusResponseStatusDelivered FaxGetStatusResponseStatus = "delivered"
	FaxGetStatusResponseStatusFailed    FaxGetStatusResponseStatus = "failed"
	FaxGetStatusResponseStatusCancelled FaxGetStatusResponseStatus = "cancelled"
	FaxGetStatusResponseStatusRetrying  FaxGetStatusResponseStatus = "retrying"
)

type FaxListProvidersResponse

type FaxListProvidersResponse struct {
	Providers []FaxListProvidersResponseProvider `json:"providers,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Providers   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FaxListProvidersResponse) RawJSON

func (r FaxListProvidersResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FaxListProvidersResponse) UnmarshalJSON

func (r *FaxListProvidersResponse) UnmarshalJSON(data []byte) error

type FaxListProvidersResponseProvider

type FaxListProvidersResponseProvider struct {
	// Whether the provider is properly configured
	Configured bool `json:"configured,required"`
	// Whether this is the default provider
	IsDefault bool `json:"isDefault,required"`
	// Provider name
	Name string `json:"name,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Configured  respjson.Field
		IsDefault   respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FaxListProvidersResponseProvider) RawJSON

Returns the unmodified JSON received from the API

func (*FaxListProvidersResponseProvider) UnmarshalJSON

func (r *FaxListProvidersResponseProvider) UnmarshalJSON(data []byte) error

type FaxSendParams

type FaxSendParams struct {
	Document FaxSendParamsDocument `json:"document,omitzero,required"`
	// Recipient fax number (E.164 format preferred)
	To string `json:"to,required"`
	// Sender fax number (optional, uses default if not provided)
	From param.Opt[string] `json:"from,omitzero"`
	// Optional provider override (uses default if not specified)
	Provider param.Opt[string] `json:"provider,omitzero"`
	// Subject line for the fax
	Subject param.Opt[string] `json:"subject,omitzero"`
	// contains filtered or unexported fields
}

func (FaxSendParams) MarshalJSON

func (r FaxSendParams) MarshalJSON() (data []byte, err error)

func (*FaxSendParams) UnmarshalJSON

func (r *FaxSendParams) UnmarshalJSON(data []byte) error

type FaxSendParamsDocument

type FaxSendParamsDocument struct {
	// Base64 encoded document content
	Content string `json:"content,required"`
	// MIME type of the document
	//
	// Any of "application/pdf", "image/tiff", "image/tif", "image/jpeg", "image/jpg",
	// "image/png", "text/plain".
	ContentType string `json:"contentType,omitzero,required"`
	// Optional filename for the document
	Filename param.Opt[string] `json:"filename,omitzero"`
	// contains filtered or unexported fields
}

The properties Content, ContentType are required.

func (FaxSendParamsDocument) MarshalJSON

func (r FaxSendParamsDocument) MarshalJSON() (data []byte, err error)

func (*FaxSendParamsDocument) UnmarshalJSON

func (r *FaxSendParamsDocument) UnmarshalJSON(data []byte) error

type FaxSendResponse

type FaxSendResponse struct {
	// Unique fax identifier
	ID string `json:"id,required"`
	// ISO timestamp when fax was created
	CreatedAt string `json:"createdAt,required"`
	// Sender fax number
	From string `json:"from,required"`
	// Provider used to send the fax
	Provider string `json:"provider,required"`
	// Current fax status
	//
	// Any of "queued", "dialing", "sending", "delivered", "failed", "cancelled",
	// "retrying".
	Status FaxSendResponseStatus `json:"status,required"`
	// Recipient fax number
	To string `json:"to,required"`
	// Estimated delivery time (ISO timestamp)
	EstimatedDelivery string `json:"estimatedDelivery"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		CreatedAt         respjson.Field
		From              respjson.Field
		Provider          respjson.Field
		Status            respjson.Field
		To                respjson.Field
		EstimatedDelivery respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FaxSendResponse) RawJSON

func (r FaxSendResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FaxSendResponse) UnmarshalJSON

func (r *FaxSendResponse) UnmarshalJSON(data []byte) error

type FaxSendResponseStatus

type FaxSendResponseStatus string

Current fax status

const (
	FaxSendResponseStatusQueued    FaxSendResponseStatus = "queued"
	FaxSendResponseStatusDialing   FaxSendResponseStatus = "dialing"
	FaxSendResponseStatusSending   FaxSendResponseStatus = "sending"
	FaxSendResponseStatusDelivered FaxSendResponseStatus = "delivered"
	FaxSendResponseStatusFailed    FaxSendResponseStatus = "failed"
	FaxSendResponseStatusCancelled FaxSendResponseStatus = "cancelled"
	FaxSendResponseStatusRetrying  FaxSendResponseStatus = "retrying"
)

type FaxService

type FaxService struct {
	Options []option.RequestOption
}

FaxService contains methods and other services that help with interacting with the bluehive API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFaxService method instead.

func NewFaxService

func NewFaxService(opts ...option.RequestOption) (r FaxService)

NewFaxService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*FaxService) GetStatus

func (r *FaxService) GetStatus(ctx context.Context, id string, opts ...option.RequestOption) (res *FaxGetStatusResponse, err error)

Retrieve the current status and details of a fax by its ID.

func (*FaxService) ListProviders

func (r *FaxService) ListProviders(ctx context.Context, opts ...option.RequestOption) (res *FaxListProvidersResponse, err error)

Get a list of available fax providers and their configuration status.

func (*FaxService) Send

func (r *FaxService) Send(ctx context.Context, body FaxSendParams, opts ...option.RequestOption) (res *FaxSendResponse, err error)

Send a fax document to a specified number using the configured fax provider.

type HealthCheckResponse

type HealthCheckResponse struct {
	// Any of "ok".
	Status HealthCheckResponseStatus `json:"status,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (HealthCheckResponse) RawJSON

func (r HealthCheckResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*HealthCheckResponse) UnmarshalJSON

func (r *HealthCheckResponse) UnmarshalJSON(data []byte) error

type HealthCheckResponseStatus

type HealthCheckResponseStatus string
const (
	HealthCheckResponseStatusOk HealthCheckResponseStatus = "ok"
)

type HealthService

type HealthService struct {
	Options []option.RequestOption
}

HealthService contains methods and other services that help with interacting with the bluehive API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHealthService method instead.

func NewHealthService

func NewHealthService(opts ...option.RequestOption) (r HealthService)

NewHealthService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*HealthService) Check

func (r *HealthService) Check(ctx context.Context, opts ...option.RequestOption) (res *HealthCheckResponse, err error)

Check the service health and ensure the API is running properly.

type Hl7ProcessParams

type Hl7ProcessParams struct {
	// Form field (legacy support)
	F param.Opt[string] `json:"f,omitzero"`
	// Interface identifier (legacy support)
	Interface param.Opt[string] `json:"interface,omitzero"`
	// Login password (legacy support)
	LoginPasswd param.Opt[string] `json:"login_passwd,omitzero"`
	// Login user (legacy support)
	LoginUser param.Opt[string] `json:"login_user,omitzero"`
	// HL7 message content - the primary way to send HL7 data
	Message param.Opt[string] `json:"message,omitzero"`
	// Base64 encoded HL7 message (legacy support)
	MessageB64 param.Opt[string] `json:"message_b64,omitzero"`
	// contains filtered or unexported fields
}

func (Hl7ProcessParams) MarshalJSON

func (r Hl7ProcessParams) MarshalJSON() (data []byte, err error)

func (*Hl7ProcessParams) UnmarshalJSON

func (r *Hl7ProcessParams) UnmarshalJSON(data []byte) error

type Hl7SendResultsParams

type Hl7SendResultsParams struct {
	// Employee ID to send results for
	EmployeeID string `json:"employeeId,required"`
	// File containing the results
	File Hl7SendResultsParamsFile `json:"file,omitzero,required"`
	// contains filtered or unexported fields
}

func (Hl7SendResultsParams) MarshalJSON

func (r Hl7SendResultsParams) MarshalJSON() (data []byte, err error)

func (*Hl7SendResultsParams) UnmarshalJSON

func (r *Hl7SendResultsParams) UnmarshalJSON(data []byte) error

type Hl7SendResultsParamsFile

type Hl7SendResultsParamsFile struct {
	// Base64 encoded file content
	Base64 string `json:"base64,required"`
	// File name
	Name string `json:"name,required"`
	// MIME type of the file
	Type string `json:"type,required"`
	// contains filtered or unexported fields
}

File containing the results

The properties Base64, Name, Type are required.

func (Hl7SendResultsParamsFile) MarshalJSON

func (r Hl7SendResultsParamsFile) MarshalJSON() (data []byte, err error)

func (*Hl7SendResultsParamsFile) UnmarshalJSON

func (r *Hl7SendResultsParamsFile) UnmarshalJSON(data []byte) error

type Hl7Service

type Hl7Service struct {
	Options []option.RequestOption
}

Hl7Service contains methods and other services that help with interacting with the bluehive API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHl7Service method instead.

func NewHl7Service

func NewHl7Service(opts ...option.RequestOption) (r Hl7Service)

NewHl7Service generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*Hl7Service) Process

func (r *Hl7Service) Process(ctx context.Context, body Hl7ProcessParams, opts ...option.RequestOption) (res *string, err error)

Process incoming HL7 messages from EHR systems. Accepts JSON with "message" field, raw text/plain HL7 content, or form-encoded data.

func (*Hl7Service) SendResults

func (r *Hl7Service) SendResults(ctx context.Context, body Hl7SendResultsParams, opts ...option.RequestOption) (res *string, err error)

Send lab results or documents via HL7

type IntegrationCheckActiveParams

type IntegrationCheckActiveParams struct {
	XBrandID string `header:"x-brand-id,required" json:"-"`
	// contains filtered or unexported fields
}

type IntegrationCheckActiveResponse

type IntegrationCheckActiveResponse struct {
	Active bool `json:"active,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Active      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IntegrationCheckActiveResponse) RawJSON

Returns the unmodified JSON received from the API

func (*IntegrationCheckActiveResponse) UnmarshalJSON

func (r *IntegrationCheckActiveResponse) UnmarshalJSON(data []byte) error

type IntegrationListParams

type IntegrationListParams struct {
	XBrandID string `header:"x-brand-id,required" json:"-"`
	// contains filtered or unexported fields
}

type IntegrationListResponse

type IntegrationListResponse struct {
	Integrations map[string]IntegrationListResponseIntegration `json:"integrations,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Integrations respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IntegrationListResponse) RawJSON

func (r IntegrationListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*IntegrationListResponse) UnmarshalJSON

func (r *IntegrationListResponse) UnmarshalJSON(data []byte) error

type IntegrationListResponseIntegration

type IntegrationListResponseIntegration struct {
	Active      bool           `json:"active,required"`
	DisplayName string         `json:"displayName,required"`
	Config      map[string]any `json:"config"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Active      respjson.Field
		DisplayName respjson.Field
		Config      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IntegrationListResponseIntegration) RawJSON

Returns the unmodified JSON received from the API

func (*IntegrationListResponseIntegration) UnmarshalJSON

func (r *IntegrationListResponseIntegration) UnmarshalJSON(data []byte) error

type IntegrationService

type IntegrationService struct {
	Options []option.RequestOption
}

IntegrationService contains methods and other services that help with interacting with the bluehive API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewIntegrationService method instead.

func NewIntegrationService

func NewIntegrationService(opts ...option.RequestOption) (r IntegrationService)

NewIntegrationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*IntegrationService) CheckActive

Returns true if the named integration is active for the given brand (brand resolved via x-brand-id header).

func (*IntegrationService) List

Returns the current brand integrations object keyed by integration name (empty object if none). Brand resolved via x-brand-id header.

type OrderGetResponse

type OrderGetResponse struct {
	OrderID     string `json:"orderId"`
	OrderNumber string `json:"orderNumber"`
	Status      string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		OrderID     respjson.Field
		OrderNumber respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrderGetResponse) RawJSON

func (r OrderGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrderGetResponse) UnmarshalJSON

func (r *OrderGetResponse) UnmarshalJSON(data []byte) error

type OrderGetResultsParams

type OrderGetResultsParams struct {
	Page      param.Opt[int64]     `query:"page,omitzero" json:"-"`
	PageSize  param.Opt[int64]     `query:"pageSize,omitzero" json:"-"`
	ServiceID param.Opt[string]    `query:"serviceId,omitzero" json:"-"`
	Since     param.Opt[time.Time] `query:"since,omitzero" format:"date-time" json:"-"`
	Status    param.Opt[string]    `query:"status,omitzero" json:"-"`
	Until     param.Opt[time.Time] `query:"until,omitzero" format:"date-time" json:"-"`
	// contains filtered or unexported fields
}

func (OrderGetResultsParams) URLQuery

func (r OrderGetResultsParams) URLQuery() (v url.Values, err error)

URLQuery serializes OrderGetResultsParams's query parameters as `url.Values`.

type OrderGetResultsResponse

type OrderGetResultsResponse struct {
	Meta     OrderGetResultsResponseMeta      `json:"meta,required"`
	Services []OrderGetResultsResponseService `json:"services,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Meta        respjson.Field
		Services    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrderGetResultsResponse) RawJSON

func (r OrderGetResultsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrderGetResultsResponse) UnmarshalJSON

func (r *OrderGetResultsResponse) UnmarshalJSON(data []byte) error

type OrderGetResultsResponseMeta

type OrderGetResultsResponseMeta struct {
	OrderID       string  `json:"orderId,required"`
	Page          float64 `json:"page,required"`
	PageSize      float64 `json:"pageSize,required"`
	Returned      float64 `json:"returned,required"`
	TotalServices float64 `json:"totalServices,required"`
	EmployeeID    string  `json:"employeeId"`
	OrderNumber   string  `json:"orderNumber"`
	ProviderID    string  `json:"providerId"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		OrderID       respjson.Field
		Page          respjson.Field
		PageSize      respjson.Field
		Returned      respjson.Field
		TotalServices respjson.Field
		EmployeeID    respjson.Field
		OrderNumber   respjson.Field
		ProviderID    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrderGetResultsResponseMeta) RawJSON

func (r OrderGetResultsResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrderGetResultsResponseMeta) UnmarshalJSON

func (r *OrderGetResultsResponseMeta) UnmarshalJSON(data []byte) error

type OrderGetResultsResponseService

type OrderGetResultsResponseService struct {
	ServiceID         string    `json:"serviceId,required"`
	Status            string    `json:"status,required"`
	AltTxt            string    `json:"altTxt"`
	CompletedDatetime time.Time `json:"completed_datetime" format:"date-time"`
	Contacts          []string  `json:"contacts"`
	DrawnDatetime     time.Time `json:"drawn_datetime" format:"date-time"`
	FileIDs           []string  `json:"fileIds"`
	Message           string    `json:"message"`
	Result            string    `json:"result"`
	ResultsPosted     time.Time `json:"resultsPosted" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ServiceID         respjson.Field
		Status            respjson.Field
		AltTxt            respjson.Field
		CompletedDatetime respjson.Field
		Contacts          respjson.Field
		DrawnDatetime     respjson.Field
		FileIDs           respjson.Field
		Message           respjson.Field
		Result            respjson.Field
		ResultsPosted     respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrderGetResultsResponseService) RawJSON

Returns the unmodified JSON received from the API

func (*OrderGetResultsResponseService) UnmarshalJSON

func (r *OrderGetResultsResponseService) UnmarshalJSON(data []byte) error

type OrderNewParams

type OrderNewParams struct {

	// This field is a request body variant, only one variant field can be set.
	OfObject *OrderNewParamsBodyObject `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfOrderNewsBodyObject *OrderNewParamsBodyObject `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfVariant2 *OrderNewParamsBodyObject `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfVariant3 *OrderNewParamsBodyObject `json:",inline"`
	// contains filtered or unexported fields
}

func (OrderNewParams) MarshalJSON

func (u OrderNewParams) MarshalJSON() ([]byte, error)

func (*OrderNewParams) UnmarshalJSON

func (r *OrderNewParams) UnmarshalJSON(data []byte) error

type OrderNewParamsBodyObject

type OrderNewParamsBodyObject struct {
	// Any of "self-pay", "employer-sponsored".
	PaymentMethod   string                            `json:"paymentMethod,omitzero,required"`
	Person          OrderNewParamsBodyObjectPerson    `json:"person,omitzero,required"`
	ProviderID      string                            `json:"providerId,required"`
	Services        []OrderNewParamsBodyObjectService `json:"services,omitzero,required"`
	ID              param.Opt[string]                 `json:"_id,omitzero"`
	BrandID         param.Opt[string]                 `json:"brandId,omitzero"`
	DueDate         param.Opt[time.Time]              `json:"dueDate,omitzero" format:"date-time"`
	EmployeeID      param.Opt[string]                 `json:"employeeId,omitzero"`
	EmployerID      param.Opt[string]                 `json:"employerId,omitzero"`
	ProviderCreated param.Opt[bool]                   `json:"providerCreated,omitzero"`
	ReCaptchaToken  param.Opt[string]                 `json:"reCaptchaToken,omitzero"`
	TokenID         param.Opt[string]                 `json:"tokenId,omitzero"`
	DueDates        []time.Time                       `json:"dueDates,omitzero" format:"date-time"`
	EmployeeIDs     []string                          `json:"employeeIds,omitzero"`
	// Optional arbitrary metadata (<=10KB when JSON stringified)
	Metadata     map[string]any                        `json:"metadata,omitzero"`
	ProvidersIDs []OrderNewParamsBodyObjectProvidersID `json:"providersIds,omitzero"`
	Quantities   map[string]int64                      `json:"quantities,omitzero"`
	ServicesIDs  []string                              `json:"servicesIds,omitzero"`
	// contains filtered or unexported fields
}

The properties PaymentMethod, Person, ProviderID, Services are required.

func (OrderNewParamsBodyObject) MarshalJSON

func (r OrderNewParamsBodyObject) MarshalJSON() (data []byte, err error)

func (*OrderNewParamsBodyObject) UnmarshalJSON

func (r *OrderNewParamsBodyObject) UnmarshalJSON(data []byte) error

type OrderNewParamsBodyObjectPerson

type OrderNewParamsBodyObjectPerson struct {
	City string `json:"city,required"`
	// Date of birth in YYYY-MM-DD format
	Dob       string `json:"dob,required"`
	Email     string `json:"email,required"`
	FirstName string `json:"firstName,required"`
	LastName  string `json:"lastName,required"`
	Phone     string `json:"phone,required"`
	State     string `json:"state,required"`
	Street    string `json:"street,required"`
	// US ZIP code in 12345 or 12345-6789 format
	Zipcode string            `json:"zipcode,required"`
	Country param.Opt[string] `json:"country,omitzero"`
	County  param.Opt[string] `json:"county,omitzero"`
	Street2 param.Opt[string] `json:"street2,omitzero"`
	// contains filtered or unexported fields
}

The properties City, Dob, Email, FirstName, LastName, Phone, State, Street, Zipcode are required.

func (OrderNewParamsBodyObjectPerson) MarshalJSON

func (r OrderNewParamsBodyObjectPerson) MarshalJSON() (data []byte, err error)

func (*OrderNewParamsBodyObjectPerson) UnmarshalJSON

func (r *OrderNewParamsBodyObjectPerson) UnmarshalJSON(data []byte) error

type OrderNewParamsBodyObjectProvidersID

type OrderNewParamsBodyObjectProvidersID struct {
	ProviderID string            `json:"providerId,required"`
	ServiceID  param.Opt[string] `json:"serviceId,omitzero"`
	// contains filtered or unexported fields
}

The property ProviderID is required.

func (OrderNewParamsBodyObjectProvidersID) MarshalJSON

func (r OrderNewParamsBodyObjectProvidersID) MarshalJSON() (data []byte, err error)

func (*OrderNewParamsBodyObjectProvidersID) UnmarshalJSON

func (r *OrderNewParamsBodyObjectProvidersID) UnmarshalJSON(data []byte) error

type OrderNewParamsBodyObjectService

type OrderNewParamsBodyObjectService struct {
	ID         string          `json:"_id,required"`
	Quantity   int64           `json:"quantity,required"`
	AutoAccept param.Opt[bool] `json:"autoAccept,omitzero"`
	// contains filtered or unexported fields
}

The properties ID, Quantity are required.

func (OrderNewParamsBodyObjectService) MarshalJSON

func (r OrderNewParamsBodyObjectService) MarshalJSON() (data []byte, err error)

func (*OrderNewParamsBodyObjectService) UnmarshalJSON

func (r *OrderNewParamsBodyObjectService) UnmarshalJSON(data []byte) error

type OrderNewResponseObject

type OrderNewResponseObject struct {
	OrderID     string `json:"orderId,required"`
	OrderNumber string `json:"orderNumber,required"`
	// Any of true.
	Success          bool   `json:"success,required"`
	HostedInvoiceURL string `json:"hostedInvoiceUrl" format:"uri"`
	Message          string `json:"message"`
	SelfPay          bool   `json:"selfPay"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		OrderID          respjson.Field
		OrderNumber      respjson.Field
		Success          respjson.Field
		HostedInvoiceURL respjson.Field
		Message          respjson.Field
		SelfPay          respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrderNewResponseObject) RawJSON

func (r OrderNewResponseObject) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrderNewResponseObject) UnmarshalJSON

func (r *OrderNewResponseObject) UnmarshalJSON(data []byte) error

type OrderNewResponseUnion

type OrderNewResponseUnion struct {
	// This field is from variant [OrderNewResponseObject].
	OrderID string `json:"orderId"`
	// This field is from variant [OrderNewResponseObject].
	OrderNumber string `json:"orderNumber"`
	// This field is from variant [OrderNewResponseObject].
	Success bool `json:"success"`
	// This field is from variant [OrderNewResponseObject].
	HostedInvoiceURL string `json:"hostedInvoiceUrl"`
	// This field is from variant [OrderNewResponseObject].
	Message string `json:"message"`
	// This field is from variant [OrderNewResponseObject].
	SelfPay bool `json:"selfPay"`
	// This field is from variant [OrderNewResponseObject].
	OrderResults []OrderNewResponseObjectOrderResult `json:"orderResults"`
	// This field is from variant [OrderNewResponseObject].
	Status string `json:"status"`
	JSON   struct {
		OrderID          respjson.Field
		OrderNumber      respjson.Field
		Success          respjson.Field
		HostedInvoiceURL respjson.Field
		Message          respjson.Field
		SelfPay          respjson.Field
		OrderResults     respjson.Field
		Status           respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

OrderNewResponseUnion contains all possible properties and values from OrderNewResponseObject, OrderNewResponseObject.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (OrderNewResponseUnion) AsOrderNewResponseObject

func (u OrderNewResponseUnion) AsOrderNewResponseObject() (v OrderNewResponseObject)

func (OrderNewResponseUnion) AsVariant2

func (u OrderNewResponseUnion) AsVariant2() (v OrderNewResponseObject)

func (OrderNewResponseUnion) RawJSON

func (u OrderNewResponseUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrderNewResponseUnion) UnmarshalJSON

func (r *OrderNewResponseUnion) UnmarshalJSON(data []byte) error

type OrderScheduleAppointmentParams

type OrderScheduleAppointmentParams struct {
	Appointment OrderScheduleAppointmentParamsAppointmentUnion `json:"appointment,omitzero,required"`
	// Order access code for authorization
	OrderAccessCode param.Opt[string] `json:"orderAccessCode,omitzero"`
	// Provider ID for authorization
	ProviderID param.Opt[string] `json:"providerId,omitzero"`
	// contains filtered or unexported fields
}

func (OrderScheduleAppointmentParams) MarshalJSON

func (r OrderScheduleAppointmentParams) MarshalJSON() (data []byte, err error)

func (*OrderScheduleAppointmentParams) UnmarshalJSON

func (r *OrderScheduleAppointmentParams) UnmarshalJSON(data []byte) error

type OrderScheduleAppointmentParamsAppointmentObject

type OrderScheduleAppointmentParamsAppointmentObject struct {
	// Required for appointment type
	Date string `json:"date,required"`
	// Required for appointment type
	DateTime time.Time `json:"dateTime,required" format:"date-time"`
	// Required for appointment type
	Time string `json:"time,required"`
	// Optional for walkin type
	Notes param.Opt[string] `json:"notes,omitzero"`
	// Any of "appointment".
	Type string `json:"type,omitzero"`
	// contains filtered or unexported fields
}

The properties Date, DateTime, Time are required.

func (OrderScheduleAppointmentParamsAppointmentObject) MarshalJSON

func (r OrderScheduleAppointmentParamsAppointmentObject) MarshalJSON() (data []byte, err error)

func (*OrderScheduleAppointmentParamsAppointmentObject) UnmarshalJSON

type OrderScheduleAppointmentParamsAppointmentUnion

type OrderScheduleAppointmentParamsAppointmentUnion struct {
	OfOrderScheduleAppointmentsAppointmentObject *OrderScheduleAppointmentParamsAppointmentObject `json:",omitzero,inline"`
	OfVariant2                                   *OrderScheduleAppointmentParamsAppointmentObject `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (OrderScheduleAppointmentParamsAppointmentUnion) GetDate

Returns a pointer to the underlying variant's property, if present.

func (OrderScheduleAppointmentParamsAppointmentUnion) GetDateTime

Returns a pointer to the underlying variant's DateTime property, if present.

func (OrderScheduleAppointmentParamsAppointmentUnion) GetNotes

Returns a pointer to the underlying variant's property, if present.

func (OrderScheduleAppointmentParamsAppointmentUnion) GetTime

Returns a pointer to the underlying variant's property, if present.

func (OrderScheduleAppointmentParamsAppointmentUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (OrderScheduleAppointmentParamsAppointmentUnion) MarshalJSON

func (*OrderScheduleAppointmentParamsAppointmentUnion) UnmarshalJSON

type OrderScheduleAppointmentResponse

type OrderScheduleAppointmentResponse struct {
	Message string `json:"message,required"`
	Success bool   `json:"success,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrderScheduleAppointmentResponse) RawJSON

Returns the unmodified JSON received from the API

func (*OrderScheduleAppointmentResponse) UnmarshalJSON

func (r *OrderScheduleAppointmentResponse) UnmarshalJSON(data []byte) error

type OrderSendForEmployeeParams

type OrderSendForEmployeeParams struct {
	// Employee ID to send order to
	EmployeeID string `json:"employeeId,required"`
	// Employer ID sending the order
	EmployerID string `json:"employerId,required"`
	// Array mapping each service (by index) to a provider; serviceId optional
	ProvidersIDs []OrderSendForEmployeeParamsProvidersID `json:"providersIds,omitzero,required"`
	// Array of service IDs to include in the order
	ServicesIDs []string `json:"servicesIds,omitzero,required"`
	LoginToken  string   `header:"login-token,required" json:"-"`
	UserID      string   `header:"user-id,required" json:"-"`
	// Brand ID for branded orders
	BrandID param.Opt[string] `json:"brandId,omitzero"`
	// Due date for the order (date or date-time ISO string)
	DueDate param.Opt[string] `json:"dueDate,omitzero"`
	// Whether this order is being created by a provider (affects permission checking)
	ProviderCreated param.Opt[bool] `json:"providerCreated,omitzero"`
	// Single provider ID (shortcut when all services map to one provider)
	ProviderID param.Opt[string] `json:"providerId,omitzero"`
	// Array of due dates per service
	DueDates []string `json:"dueDates,omitzero"`
	// Optional arbitrary metadata to store on the order (non-indexed passthrough,
	// <=10KB when JSON stringified)
	Metadata map[string]any `json:"metadata,omitzero"`
	// Service ID to quantity mapping
	Quantities map[string]int64 `json:"quantities,omitzero"`
	// contains filtered or unexported fields
}

func (OrderSendForEmployeeParams) MarshalJSON

func (r OrderSendForEmployeeParams) MarshalJSON() (data []byte, err error)

func (*OrderSendForEmployeeParams) UnmarshalJSON

func (r *OrderSendForEmployeeParams) UnmarshalJSON(data []byte) error

type OrderSendForEmployeeParamsProvidersID

type OrderSendForEmployeeParamsProvidersID struct {
	ProviderID string            `json:"providerId,required"`
	ServiceID  param.Opt[string] `json:"serviceId,omitzero"`
	// contains filtered or unexported fields
}

The property ProviderID is required.

func (OrderSendForEmployeeParamsProvidersID) MarshalJSON

func (r OrderSendForEmployeeParamsProvidersID) MarshalJSON() (data []byte, err error)

func (*OrderSendForEmployeeParamsProvidersID) UnmarshalJSON

func (r *OrderSendForEmployeeParamsProvidersID) UnmarshalJSON(data []byte) error

type OrderSendForEmployeeResponseObject

type OrderSendForEmployeeResponseObject struct {
	OrderID     string `json:"orderId,required"`
	OrderNumber string `json:"orderNumber,required"`
	// Any of true.
	Success bool   `json:"success,required"`
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		OrderID     respjson.Field
		OrderNumber respjson.Field
		Success     respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrderSendForEmployeeResponseObject) RawJSON

Returns the unmodified JSON received from the API

func (*OrderSendForEmployeeResponseObject) UnmarshalJSON

func (r *OrderSendForEmployeeResponseObject) UnmarshalJSON(data []byte) error

type OrderSendForEmployeeResponseUnion

type OrderSendForEmployeeResponseUnion struct {
	// This field is from variant [OrderSendForEmployeeResponseObject].
	OrderID string `json:"orderId"`
	// This field is from variant [OrderSendForEmployeeResponseObject].
	OrderNumber string `json:"orderNumber"`
	// This field is from variant [OrderSendForEmployeeResponseObject].
	Success bool `json:"success"`
	// This field is from variant [OrderSendForEmployeeResponseObject].
	Message string `json:"message"`
	// This field is from variant [OrderSendForEmployeeResponseObject].
	OrderResults []OrderSendForEmployeeResponseObjectOrderResult `json:"orderResults"`
	// This field is from variant [OrderSendForEmployeeResponseObject].
	Status string `json:"status"`
	JSON   struct {
		OrderID      respjson.Field
		OrderNumber  respjson.Field
		Success      respjson.Field
		Message      respjson.Field
		OrderResults respjson.Field
		Status       respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

OrderSendForEmployeeResponseUnion contains all possible properties and values from OrderSendForEmployeeResponseObject, OrderSendForEmployeeResponseObject.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (OrderSendForEmployeeResponseUnion) AsOrderSendForEmployeeResponseObject

func (u OrderSendForEmployeeResponseUnion) AsOrderSendForEmployeeResponseObject() (v OrderSendForEmployeeResponseObject)

func (OrderSendForEmployeeResponseUnion) AsVariant2

func (OrderSendForEmployeeResponseUnion) RawJSON

Returns the unmodified JSON received from the API

func (*OrderSendForEmployeeResponseUnion) UnmarshalJSON

func (r *OrderSendForEmployeeResponseUnion) UnmarshalJSON(data []byte) error

type OrderService

type OrderService struct {
	Options []option.RequestOption
}

OrderService contains methods and other services that help with interacting with the bluehive API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOrderService method instead.

func NewOrderService

func NewOrderService(opts ...option.RequestOption) (r OrderService)

NewOrderService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*OrderService) Get

func (r *OrderService) Get(ctx context.Context, orderID string, opts ...option.RequestOption) (res *OrderGetResponse, err error)

Retrieve details for a specific order

func (*OrderService) GetResults

func (r *OrderService) GetResults(ctx context.Context, orderID string, query OrderGetResultsParams, opts ...option.RequestOption) (res *OrderGetResultsResponse, err error)

Retrieve results for an order. Supports filtering by serviceId, status, date window, and pagination.

func (*OrderService) New

Create orders for consumers (self-pay or employer-sponsored), employers, or bulk orders. Consolidates functionality from legacy Order.createOrder and Order.SendOrder methods.

func (*OrderService) ScheduleAppointment

func (r *OrderService) ScheduleAppointment(ctx context.Context, orderID string, body OrderScheduleAppointmentParams, opts ...option.RequestOption) (res *OrderScheduleAppointmentResponse, err error)

Schedule an appointment or walk-in for an existing order. Sends HL7 SIU^S12 message for appointment booking.

func (*OrderService) SendForEmployee

Send an order for a specific employee. Requires API key, login token, and user ID. This endpoint specifically handles employer-to-employee order sending.

func (*OrderService) Update

func (r *OrderService) Update(ctx context.Context, orderID string, body OrderUpdateParams, opts ...option.RequestOption) (res *OrderUpdateResponse, err error)

Update order details and associated order items. Allows updating order status, metadata, and modifying order item services.

func (*OrderService) UpdateStatus

func (r *OrderService) UpdateStatus(ctx context.Context, orderID string, body OrderUpdateStatusParams, opts ...option.RequestOption) (res *OrderUpdateStatusResponse, err error)

Update the status of an existing order

func (*OrderService) UploadResults

func (r *OrderService) UploadResults(ctx context.Context, orderID string, body OrderUploadResultsParams, opts ...option.RequestOption) (res *OrderUploadResultsResponse, err error)

Upload test results for a specific order item. Supports both existing fileIds and base64 encoded files. Requires order access code and employee verification.

type OrderUpdateParams

type OrderUpdateParams struct {
	// Arbitrary metadata to update on the order (non-indexed passthrough, <=10KB when
	// JSON stringified)
	Metadata map[string]any             `json:"metadata,omitzero"`
	Services []OrderUpdateParamsService `json:"services,omitzero"`
	// Any of "order_sent", "order_accepted", "order_refused", "employee_confirmed",
	// "order_fulfilled", "order_complete".
	Status OrderUpdateParamsStatus `json:"status,omitzero"`
	// contains filtered or unexported fields
}

func (OrderUpdateParams) MarshalJSON

func (r OrderUpdateParams) MarshalJSON() (data []byte, err error)

func (*OrderUpdateParams) UnmarshalJSON

func (r *OrderUpdateParams) UnmarshalJSON(data []byte) error

type OrderUpdateParamsService

type OrderUpdateParamsService struct {
	ServiceID string               `json:"serviceId,required"`
	DueDate   param.Opt[time.Time] `json:"dueDate,omitzero" format:"date-time"`
	Results   map[string]any       `json:"results,omitzero"`
	// Any of "pending", "in_progress", "completed", "cancelled", "rejected".
	Status string `json:"status,omitzero"`
	// contains filtered or unexported fields
}

The property ServiceID is required.

func (OrderUpdateParamsService) MarshalJSON

func (r OrderUpdateParamsService) MarshalJSON() (data []byte, err error)

func (*OrderUpdateParamsService) UnmarshalJSON

func (r *OrderUpdateParamsService) UnmarshalJSON(data []byte) error

type OrderUpdateParamsStatus

type OrderUpdateParamsStatus string
const (
	OrderUpdateParamsStatusOrderSent         OrderUpdateParamsStatus = "order_sent"
	OrderUpdateParamsStatusOrderAccepted     OrderUpdateParamsStatus = "order_accepted"
	OrderUpdateParamsStatusOrderRefused      OrderUpdateParamsStatus = "order_refused"
	OrderUpdateParamsStatusEmployeeConfirmed OrderUpdateParamsStatus = "employee_confirmed"
	OrderUpdateParamsStatusOrderFulfilled    OrderUpdateParamsStatus = "order_fulfilled"
	OrderUpdateParamsStatusOrderComplete     OrderUpdateParamsStatus = "order_complete"
)

type OrderUpdateResponse

type OrderUpdateResponse struct {
	Message     string `json:"message,required"`
	OrderID     string `json:"orderId,required"`
	OrderNumber string `json:"orderNumber,required"`
	// Any of true.
	Success       bool     `json:"success,required"`
	UpdatedFields []string `json:"updatedFields"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message       respjson.Field
		OrderID       respjson.Field
		OrderNumber   respjson.Field
		Success       respjson.Field
		UpdatedFields respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrderUpdateResponse) RawJSON

func (r OrderUpdateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrderUpdateResponse) UnmarshalJSON

func (r *OrderUpdateResponse) UnmarshalJSON(data []byte) error

type OrderUpdateStatusParams

type OrderUpdateStatusParams struct {
	// Any of "order_sent", "order_accepted", "order_refused", "employee_confirmed",
	// "order_fulfilled", "order_complete".
	Status  OrderUpdateStatusParamsStatus `json:"status,omitzero,required"`
	Message param.Opt[string]             `json:"message,omitzero"`
	// contains filtered or unexported fields
}

func (OrderUpdateStatusParams) MarshalJSON

func (r OrderUpdateStatusParams) MarshalJSON() (data []byte, err error)

func (*OrderUpdateStatusParams) UnmarshalJSON

func (r *OrderUpdateStatusParams) UnmarshalJSON(data []byte) error

type OrderUpdateStatusParamsStatus

type OrderUpdateStatusParamsStatus string
const (
	OrderUpdateStatusParamsStatusOrderSent         OrderUpdateStatusParamsStatus = "order_sent"
	OrderUpdateStatusParamsStatusOrderAccepted     OrderUpdateStatusParamsStatus = "order_accepted"
	OrderUpdateStatusParamsStatusOrderRefused      OrderUpdateStatusParamsStatus = "order_refused"
	OrderUpdateStatusParamsStatusEmployeeConfirmed OrderUpdateStatusParamsStatus = "employee_confirmed"
	OrderUpdateStatusParamsStatusOrderFulfilled    OrderUpdateStatusParamsStatus = "order_fulfilled"
	OrderUpdateStatusParamsStatusOrderComplete     OrderUpdateStatusParamsStatus = "order_complete"
)

type OrderUpdateStatusResponse

type OrderUpdateStatusResponse struct {
	Message string `json:"message"`
	Success bool   `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrderUpdateStatusResponse) RawJSON

func (r OrderUpdateStatusResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrderUpdateStatusResponse) UnmarshalJSON

func (r *OrderUpdateStatusResponse) UnmarshalJSON(data []byte) error

type OrderUploadResultsParams

type OrderUploadResultsParams struct {
	CaptchaToken    string `json:"captchaToken,required"`
	OrderAccessCode string `json:"orderAccessCode,required"`
	ServiceID       string `json:"serviceId,required"`
	// Date of birth in YYYY-MM-DD format
	Dob      param.Opt[string]              `json:"dob,omitzero"`
	LastName param.Opt[string]              `json:"lastName,omitzero"`
	FileIDs  []string                       `json:"fileIds,omitzero"`
	Files    []OrderUploadResultsParamsFile `json:"files,omitzero"`
	// contains filtered or unexported fields
}

func (OrderUploadResultsParams) MarshalJSON

func (r OrderUploadResultsParams) MarshalJSON() (data []byte, err error)

func (*OrderUploadResultsParams) UnmarshalJSON

func (r *OrderUploadResultsParams) UnmarshalJSON(data []byte) error

type OrderUploadResultsParamsFile

type OrderUploadResultsParamsFile struct {
	Base64 string `json:"base64,required"`
	Name   string `json:"name,required"`
	Type   string `json:"type,required"`
	// contains filtered or unexported fields
}

The properties Base64, Name, Type are required.

func (OrderUploadResultsParamsFile) MarshalJSON

func (r OrderUploadResultsParamsFile) MarshalJSON() (data []byte, err error)

func (*OrderUploadResultsParamsFile) UnmarshalJSON

func (r *OrderUploadResultsParamsFile) UnmarshalJSON(data []byte) error

type OrderUploadResultsResponse

type OrderUploadResultsResponse struct {
	Message string `json:"message"`
	Success bool   `json:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Message     respjson.Field
		Success     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OrderUploadResultsResponse) RawJSON

func (r OrderUploadResultsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrderUploadResultsResponse) UnmarshalJSON

func (r *OrderUploadResultsResponse) UnmarshalJSON(data []byte) error

type ProviderLookupParams

type ProviderLookupParams struct {
	// Provider first name
	Firstname param.Opt[string] `query:"firstname,omitzero" json:"-"`
	// Provider last name
	Lastname param.Opt[string] `query:"lastname,omitzero" json:"-"`
	// Provider NPI number
	Npi param.Opt[string] `query:"npi,omitzero" json:"-"`
	// ZIP code to filter results by proximity
	Zipcode param.Opt[string] `query:"zipcode,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ProviderLookupParams) URLQuery

func (r ProviderLookupParams) URLQuery() (v url.Values, err error)

URLQuery serializes ProviderLookupParams's query parameters as `url.Values`.

type ProviderLookupResponse

type ProviderLookupResponse struct {
	// Number of providers found
	Count float64 `json:"count,required"`
	// List of matching providers
	Providers []ProviderLookupResponseProvider `json:"providers,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Providers   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProviderLookupResponse) RawJSON

func (r ProviderLookupResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProviderLookupResponse) UnmarshalJSON

func (r *ProviderLookupResponse) UnmarshalJSON(data []byte) error

type ProviderLookupResponseProvider

type ProviderLookupResponseProvider struct {
	// Primary address line
	Address1 string `json:"address_1,required"`
	// Secondary address line (suite, unit, etc.)
	Address2 string `json:"address_2,required"`
	// City
	City string `json:"city,required"`
	// Country code
	Country string `json:"country,required"`
	// Distance in miles from the provided ZIP code
	Distance float64 `json:"distance,required"`
	// Fax number
	FaxNumber string `json:"fax_number,required"`
	// Provider first name
	Firstname string `json:"firstname,required"`
	// Provider last name or organization name
	Lastname string `json:"lastname,required"`
	// National Provider Identifier (NPI) number
	Npi string `json:"npi,required"`
	// Postal/ZIP code
	PostalCode string `json:"postal_code,required"`
	// State or province code
	StateProvince string `json:"state_province,required"`
	// Work phone number
	WorkPhone string `json:"work_phone,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Address1      respjson.Field
		Address2      respjson.Field
		City          respjson.Field
		Country       respjson.Field
		Distance      respjson.Field
		FaxNumber     respjson.Field
		Firstname     respjson.Field
		Lastname      respjson.Field
		Npi           respjson.Field
		PostalCode    respjson.Field
		StateProvince respjson.Field
		WorkPhone     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProviderLookupResponseProvider) RawJSON

Returns the unmodified JSON received from the API

func (*ProviderLookupResponseProvider) UnmarshalJSON

func (r *ProviderLookupResponseProvider) UnmarshalJSON(data []byte) error

type ProviderService

type ProviderService struct {
	Options []option.RequestOption
}

ProviderService contains methods and other services that help with interacting with the bluehive API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProviderService method instead.

func NewProviderService

func NewProviderService(opts ...option.RequestOption) (r ProviderService)

NewProviderService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProviderService) Lookup

Search for healthcare providers by NPI number, name, or location proximity.

type VersionGetResponse

type VersionGetResponse struct {
	Version string `json:"version,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Version     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (VersionGetResponse) RawJSON

func (r VersionGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*VersionGetResponse) UnmarshalJSON

func (r *VersionGetResponse) UnmarshalJSON(data []byte) error

type VersionService

type VersionService struct {
	Options []option.RequestOption
}

VersionService contains methods and other services that help with interacting with the bluehive API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVersionService method instead.

func NewVersionService

func NewVersionService(opts ...option.RequestOption) (r VersionService)

NewVersionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*VersionService) Get

func (r *VersionService) Get(ctx context.Context, opts ...option.RequestOption) (res *VersionGetResponse, err error)

Retrieve the current version of the BlueHive API.

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
packages
shared

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL