From 3c9b85deae81d27eeb134f524c24ff705d8db97b Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 18 Mar 2026 10:31:51 +0000 Subject: [PATCH] feat: add new UserAddress type and update module paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates the Go module path from github.com/tryVital/vital-go to github.com/tryVital/vital-go/v505 across all packages. Introduces new UserAddress type with complete address field support and adds new client endpoints for Compendium, LabAccount, and OrderTransaction. Key changes: - Add UserAddress type with address fields (first_line, country, zip, etc.) - Update all import paths to use v505 module version - Add Compendium, LabAccount, and OrderTransaction client endpoints - Update UserInfo and UserInfoCreateRequest to use UserAddress instead of Address - Add JSON marshaling/unmarshaling methods to request types - Change CreateInsuranceRequest.Insured field from optional to required 🌿 Generated with Fern --- .fern/metadata.json | 7 +- .fernignore | 1 + .github/workflows/ci.yml | 14 +- activity.go | 2 +- activity/client.go | 16 +- activity/raw_client.go | 28 +- aggregate.go | 206 +- aggregate/client.go | 18 +- aggregate/raw_client.go | 36 +- body.go | 2 +- body/client.go | 16 +- body/raw_client.go | 28 +- changelog.md | 17 + client/client.go | 61 +- client/client_test.go | 2 +- compendium.go | 1367 +++++++ compendium/client.go | 65 + compendium/raw_client.go | 131 + core/request_option.go | 6 +- devices.go | 2 +- devices/client.go | 12 +- devices/raw_client.go | 18 +- electrocardiogram.go | 2 +- electrocardiogram/client.go | 12 +- electrocardiogram/raw_client.go | 18 +- error_codes.go | 4 +- errors.go | 2 +- go.mod | 2 +- insurance.go | 23 +- insurance/client.go | 20 +- insurance/raw_client.go | 38 +- internal/caller.go | 75 +- internal/caller_test.go | 239 +- internal/error_decoder.go | 2 +- internal/error_decoder_test.go | 2 +- internal/multipart.go | 3 + internal/multipart_test.go | 76 + internal/retrier_test.go | 2 +- introspect.go | 2 +- introspect/client.go | 16 +- introspect/raw_client.go | 28 +- lab_account.go | 587 +++ lab_report.go | 163 +- lab_tests.go | 3251 ++++----------- labaccount/client.go | 49 + labaccount/raw_client.go | 79 + labreport/client.go | 16 +- labreport/raw_client.go | 32 +- labtests/client.go | 135 +- labtests/raw_client.go | 357 +- link.go | 340 +- link/client.go | 76 +- link/raw_client.go | 160 +- meal.go | 2 +- meal/client.go | 12 +- meal/raw_client.go | 18 +- menstrual_cycle.go | 2 +- menstrualcycle/client.go | 12 +- menstrualcycle/raw_client.go | 18 +- option/request_option.go | 2 +- order.go | 2 +- order/client.go | 12 +- order/raw_client.go | 18 +- order_transaction.go | 328 ++ ordertransaction/client.go | 82 + ordertransaction/raw_client.go | 165 + payor.go | 25 +- payor/client.go | 12 +- payor/raw_client.go | 18 +- pointer.go | 5 + profile.go | 2 +- profile/client.go | 16 +- profile/raw_client.go | 28 +- providers.go | 2 +- providers/client.go | 12 +- providers/raw_client.go | 18 +- reference.md | 2300 ++++++----- sleep.go | 2 +- sleep/client.go | 18 +- sleep/raw_client.go | 36 +- sleep_cycle.go | 2 +- sleepcycle/client.go | 12 +- sleepcycle/raw_client.go | 18 +- team.go | 2 +- team/client.go | 20 +- team/raw_client.go | 42 +- testkit.go | 50 +- testkit/client.go | 16 +- testkit/raw_client.go | 28 +- types.go | 6764 ++++++++++++++++++++++--------- user.go | 293 +- user/client.go | 64 +- user/raw_client.go | 172 +- vitals.go | 2 +- vitals/client.go | 320 +- vitals/raw_client.go | 788 ++-- workouts.go | 2 +- workouts/client.go | 18 +- workouts/raw_client.go | 36 +- 99 files changed, 12798 insertions(+), 6884 deletions(-) create mode 100644 changelog.md create mode 100644 compendium.go create mode 100644 compendium/client.go create mode 100644 compendium/raw_client.go create mode 100644 lab_account.go create mode 100644 labaccount/client.go create mode 100644 labaccount/raw_client.go create mode 100644 order_transaction.go create mode 100644 ordertransaction/client.go create mode 100644 ordertransaction/raw_client.go diff --git a/.fern/metadata.json b/.fern/metadata.json index c85f405..d836b99 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,9 +1,10 @@ { - "cliVersion": "3.35.1", + "cliVersion": "4.33.0", "generatorName": "fernapi/fern-go-sdk", - "generatorVersion": "1.21.8", + "generatorVersion": "1.24.0", "generatorConfig": { "enableWireTests": false }, - "sdkVersion": "v1.1.575" + "originGitCommit": "50bb459c84b3982582dc3cab49e76869e4351638", + "sdkVersion": "v2.0.0" } \ No newline at end of file diff --git a/.fernignore b/.fernignore index 43ca0d2..07281cd 100644 --- a/.fernignore +++ b/.fernignore @@ -1,3 +1,4 @@ # Specify files that shouldn't be modified by Fern README.md +changelog.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56310d6..13a56af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,11 +25,21 @@ jobs: - name: Setup wiremock server run: | - if [ -f wiremock/docker-compose.test.yml ]; then docker compose -f wiremock/docker-compose.test.yml down && docker compose -f wiremock/docker-compose.test.yml up -d; fi + PROJECT_NAME="wiremock-$(basename $(dirname $(pwd)) | tr -d '.')" + echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV + if [ -f wiremock/docker-compose.test.yml ]; then + docker compose -p "$PROJECT_NAME" -f wiremock/docker-compose.test.yml down + docker compose -p "$PROJECT_NAME" -f wiremock/docker-compose.test.yml up -d + WIREMOCK_PORT=$(docker compose -p "$PROJECT_NAME" -f wiremock/docker-compose.test.yml port wiremock 8080 | cut -d: -f2) + echo "WIREMOCK_PORT=$WIREMOCK_PORT" >> $GITHUB_ENV + fi - name: Test run: go test ./... - name: Teardown wiremock server + if: always() run: | - if [ -f wiremock/docker-compose.test.yml ]; then docker compose -f wiremock/docker-compose.test.yml down; fi + if [ -f wiremock/docker-compose.test.yml ]; then + docker compose -p "$PROJECT_NAME" -f wiremock/docker-compose.test.yml down + fi diff --git a/activity.go b/activity.go index 70a2797..33b0769 100644 --- a/activity.go +++ b/activity.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) diff --git a/activity/client.go b/activity/client.go index 4244b06..f40dd21 100644 --- a/activity/client.go +++ b/activity/client.go @@ -4,10 +4,10 @@ package activity import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -36,9 +36,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) Get( ctx context.Context, userId string, - request *vitalgo.ActivityGetRequest, + request *v505.ActivityGetRequest, opts ...option.RequestOption, -) (*vitalgo.ClientActivityResponse, error) { +) (*v505.ClientActivityResponse, error) { response, err := c.WithRawResponse.Get( ctx, userId, @@ -55,9 +55,9 @@ func (c *Client) Get( func (c *Client) GetRaw( ctx context.Context, userId string, - request *vitalgo.ActivityGetRawRequest, + request *v505.ActivityGetRawRequest, opts ...option.RequestOption, -) (*vitalgo.RawActivity, error) { +) (*v505.RawActivity, error) { response, err := c.WithRawResponse.GetRaw( ctx, userId, diff --git a/activity/raw_client.go b/activity/raw_client.go index b8ce8fa..53917c7 100644 --- a/activity/raw_client.go +++ b/activity/raw_client.go @@ -4,10 +4,10 @@ package activity import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -33,9 +33,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) Get( ctx context.Context, userId string, - request *vitalgo.ActivityGetRequest, + request *v505.ActivityGetRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientActivityResponse], error) { +) (*core.Response[*v505.ClientActivityResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -57,7 +57,7 @@ func (r *RawClient) Get( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientActivityResponse + var response *v505.ClientActivityResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -69,13 +69,13 @@ func (r *RawClient) Get( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientActivityResponse]{ + return &core.Response[*v505.ClientActivityResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -85,9 +85,9 @@ func (r *RawClient) Get( func (r *RawClient) GetRaw( ctx context.Context, userId string, - request *vitalgo.ActivityGetRawRequest, + request *v505.ActivityGetRawRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.RawActivity], error) { +) (*core.Response[*v505.RawActivity], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -109,7 +109,7 @@ func (r *RawClient) GetRaw( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.RawActivity + var response *v505.RawActivity raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -121,13 +121,13 @@ func (r *RawClient) GetRaw( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.RawActivity]{ + return &core.Response[*v505.RawActivity]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/aggregate.go b/aggregate.go index 8b151af..afced5f 100644 --- a/aggregate.go +++ b/aggregate.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) @@ -51,8 +51,8 @@ var ( ) type QueryBatch struct { - Timeframe *QueryBatchTimeframe `json:"timeframe,omitempty" url:"-"` - Queries []*Query `json:"queries,omitempty" url:"-"` + Timeframe *QueryBatchTimeframe `json:"timeframe" url:"-"` + Queries []*Query `json:"queries" url:"-"` Config *QueryConfig `json:"config,omitempty" url:"-"` accept string @@ -381,6 +381,7 @@ func (a *AggregateExpr) String() string { type AggregateExprArg struct { SleepColumnExpr *SleepColumnExpr + DerivedReadinessColumnExpr *DerivedReadinessColumnExpr ActivityColumnExpr *ActivityColumnExpr WorkoutColumnExpr *WorkoutColumnExpr BodyColumnExpr *BodyColumnExpr @@ -409,6 +410,13 @@ func (a *AggregateExprArg) GetSleepColumnExpr() *SleepColumnExpr { return a.SleepColumnExpr } +func (a *AggregateExprArg) GetDerivedReadinessColumnExpr() *DerivedReadinessColumnExpr { + if a == nil { + return nil + } + return a.DerivedReadinessColumnExpr +} + func (a *AggregateExprArg) GetActivityColumnExpr() *ActivityColumnExpr { if a == nil { return nil @@ -535,6 +543,12 @@ func (a *AggregateExprArg) UnmarshalJSON(data []byte) error { a.SleepColumnExpr = valueSleepColumnExpr return nil } + valueDerivedReadinessColumnExpr := new(DerivedReadinessColumnExpr) + if err := json.Unmarshal(data, &valueDerivedReadinessColumnExpr); err == nil { + a.typ = "DerivedReadinessColumnExpr" + a.DerivedReadinessColumnExpr = valueDerivedReadinessColumnExpr + return nil + } valueActivityColumnExpr := new(ActivityColumnExpr) if err := json.Unmarshal(data, &valueActivityColumnExpr); err == nil { a.typ = "ActivityColumnExpr" @@ -644,6 +658,9 @@ func (a AggregateExprArg) MarshalJSON() ([]byte, error) { if a.typ == "SleepColumnExpr" || a.SleepColumnExpr != nil { return json.Marshal(a.SleepColumnExpr) } + if a.typ == "DerivedReadinessColumnExpr" || a.DerivedReadinessColumnExpr != nil { + return json.Marshal(a.DerivedReadinessColumnExpr) + } if a.typ == "ActivityColumnExpr" || a.ActivityColumnExpr != nil { return json.Marshal(a.ActivityColumnExpr) } @@ -700,6 +717,7 @@ func (a AggregateExprArg) MarshalJSON() ([]byte, error) { type AggregateExprArgVisitor interface { VisitSleepColumnExpr(*SleepColumnExpr) error + VisitDerivedReadinessColumnExpr(*DerivedReadinessColumnExpr) error VisitActivityColumnExpr(*ActivityColumnExpr) error VisitWorkoutColumnExpr(*WorkoutColumnExpr) error VisitBodyColumnExpr(*BodyColumnExpr) error @@ -723,6 +741,9 @@ func (a *AggregateExprArg) Accept(visitor AggregateExprArgVisitor) error { if a.typ == "SleepColumnExpr" || a.SleepColumnExpr != nil { return visitor.VisitSleepColumnExpr(a.SleepColumnExpr) } + if a.typ == "DerivedReadinessColumnExpr" || a.DerivedReadinessColumnExpr != nil { + return visitor.VisitDerivedReadinessColumnExpr(a.DerivedReadinessColumnExpr) + } if a.typ == "ActivityColumnExpr" || a.ActivityColumnExpr != nil { return visitor.VisitActivityColumnExpr(a.ActivityColumnExpr) } @@ -2189,6 +2210,126 @@ func (d *DateTruncExprArg) Accept(visitor DateTruncExprArgVisitor) error { return fmt.Errorf("type %T does not include a non-empty union type", d) } +var ( + derivedReadinessColumnExprFieldDerivedReadiness = big.NewInt(1 << 0) +) + +type DerivedReadinessColumnExpr struct { + // ℹ️ This enum is non-exhaustive. + DerivedReadiness DerivedReadinessColumnExprDerivedReadiness `json:"derived_readiness" url:"derived_readiness"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (d *DerivedReadinessColumnExpr) GetDerivedReadiness() DerivedReadinessColumnExprDerivedReadiness { + if d == nil { + return "" + } + return d.DerivedReadiness +} + +func (d *DerivedReadinessColumnExpr) GetExtraProperties() map[string]interface{} { + return d.extraProperties +} + +func (d *DerivedReadinessColumnExpr) require(field *big.Int) { + if d.explicitFields == nil { + d.explicitFields = big.NewInt(0) + } + d.explicitFields.Or(d.explicitFields, field) +} + +// SetDerivedReadiness sets the DerivedReadiness field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (d *DerivedReadinessColumnExpr) SetDerivedReadiness(derivedReadiness DerivedReadinessColumnExprDerivedReadiness) { + d.DerivedReadiness = derivedReadiness + d.require(derivedReadinessColumnExprFieldDerivedReadiness) +} + +func (d *DerivedReadinessColumnExpr) UnmarshalJSON(data []byte) error { + type unmarshaler DerivedReadinessColumnExpr + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *d = DerivedReadinessColumnExpr(value) + extraProperties, err := internal.ExtractExtraProperties(data, *d) + if err != nil { + return err + } + d.extraProperties = extraProperties + d.rawJSON = json.RawMessage(data) + return nil +} + +func (d *DerivedReadinessColumnExpr) MarshalJSON() ([]byte, error) { + type embed DerivedReadinessColumnExpr + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (d *DerivedReadinessColumnExpr) String() string { + if len(d.rawJSON) > 0 { + if value, err := internal.StringifyJSON(d.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(d); err == nil { + return value + } + return fmt.Sprintf("%#v", d) +} + +// ℹ️ This enum is non-exhaustive. +type DerivedReadinessColumnExprDerivedReadiness string + +const ( + DerivedReadinessColumnExprDerivedReadinessDate DerivedReadinessColumnExprDerivedReadiness = "date" + DerivedReadinessColumnExprDerivedReadinessChronotype DerivedReadinessColumnExprDerivedReadiness = "chronotype" + DerivedReadinessColumnExprDerivedReadinessSleepScore DerivedReadinessColumnExprDerivedReadiness = "sleep_score" + DerivedReadinessColumnExprDerivedReadinessRecoveryScore DerivedReadinessColumnExprDerivedReadiness = "recovery_score" + DerivedReadinessColumnExprDerivedReadinessRecoveryZone DerivedReadinessColumnExprDerivedReadiness = "recovery_zone" + DerivedReadinessColumnExprDerivedReadinessStressScore DerivedReadinessColumnExprDerivedReadiness = "stress_score" + DerivedReadinessColumnExprDerivedReadinessStrainScore DerivedReadinessColumnExprDerivedReadiness = "strain_score" + DerivedReadinessColumnExprDerivedReadinessStrainZone DerivedReadinessColumnExprDerivedReadiness = "strain_zone" +) + +func NewDerivedReadinessColumnExprDerivedReadinessFromString(s string) (DerivedReadinessColumnExprDerivedReadiness, error) { + switch s { + case "date": + return DerivedReadinessColumnExprDerivedReadinessDate, nil + case "chronotype": + return DerivedReadinessColumnExprDerivedReadinessChronotype, nil + case "sleep_score": + return DerivedReadinessColumnExprDerivedReadinessSleepScore, nil + case "recovery_score": + return DerivedReadinessColumnExprDerivedReadinessRecoveryScore, nil + case "recovery_zone": + return DerivedReadinessColumnExprDerivedReadinessRecoveryZone, nil + case "stress_score": + return DerivedReadinessColumnExprDerivedReadinessStressScore, nil + case "strain_score": + return DerivedReadinessColumnExprDerivedReadinessStrainScore, nil + case "strain_zone": + return DerivedReadinessColumnExprDerivedReadinessStrainZone, nil + } + var t DerivedReadinessColumnExprDerivedReadiness + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (d DerivedReadinessColumnExprDerivedReadiness) Ptr() *DerivedReadinessColumnExprDerivedReadiness { + return &d +} + var ( discreteTimeseriesExprFieldTimeseries = big.NewInt(1 << 0) discreteTimeseriesExprFieldField = big.NewInt(1 << 1) @@ -2602,19 +2743,22 @@ func (i *IndexColumnExpr) String() string { type IndexColumnExprIndex string const ( - IndexColumnExprIndexSleep IndexColumnExprIndex = "sleep" - IndexColumnExprIndexActivity IndexColumnExprIndex = "activity" - IndexColumnExprIndexWorkout IndexColumnExprIndex = "workout" - IndexColumnExprIndexBody IndexColumnExprIndex = "body" - IndexColumnExprIndexMeal IndexColumnExprIndex = "meal" - IndexColumnExprIndexProfile IndexColumnExprIndex = "profile" - IndexColumnExprIndexTimeseries IndexColumnExprIndex = "timeseries" + IndexColumnExprIndexSleep IndexColumnExprIndex = "sleep" + IndexColumnExprIndexDerivedReadiness IndexColumnExprIndex = "derived_readiness" + IndexColumnExprIndexActivity IndexColumnExprIndex = "activity" + IndexColumnExprIndexWorkout IndexColumnExprIndex = "workout" + IndexColumnExprIndexBody IndexColumnExprIndex = "body" + IndexColumnExprIndexMeal IndexColumnExprIndex = "meal" + IndexColumnExprIndexProfile IndexColumnExprIndex = "profile" + IndexColumnExprIndexTimeseries IndexColumnExprIndex = "timeseries" ) func NewIndexColumnExprIndexFromString(s string) (IndexColumnExprIndex, error) { switch s { case "sleep": return IndexColumnExprIndexSleep, nil + case "derived_readiness": + return IndexColumnExprIndexDerivedReadiness, nil case "activity": return IndexColumnExprIndexActivity, nil case "workout": @@ -3867,6 +4011,7 @@ type QueryGroupByItem struct { DateTruncExpr *DateTruncExpr DatePartExpr *DatePartExpr SleepColumnExpr *SleepColumnExpr + DerivedReadinessColumnExpr *DerivedReadinessColumnExpr ActivityColumnExpr *ActivityColumnExpr WorkoutColumnExpr *WorkoutColumnExpr BodyColumnExpr *BodyColumnExpr @@ -3909,6 +4054,13 @@ func (q *QueryGroupByItem) GetSleepColumnExpr() *SleepColumnExpr { return q.SleepColumnExpr } +func (q *QueryGroupByItem) GetDerivedReadinessColumnExpr() *DerivedReadinessColumnExpr { + if q == nil { + return nil + } + return q.DerivedReadinessColumnExpr +} + func (q *QueryGroupByItem) GetActivityColumnExpr() *ActivityColumnExpr { if q == nil { return nil @@ -4047,6 +4199,12 @@ func (q *QueryGroupByItem) UnmarshalJSON(data []byte) error { q.SleepColumnExpr = valueSleepColumnExpr return nil } + valueDerivedReadinessColumnExpr := new(DerivedReadinessColumnExpr) + if err := json.Unmarshal(data, &valueDerivedReadinessColumnExpr); err == nil { + q.typ = "DerivedReadinessColumnExpr" + q.DerivedReadinessColumnExpr = valueDerivedReadinessColumnExpr + return nil + } valueActivityColumnExpr := new(ActivityColumnExpr) if err := json.Unmarshal(data, &valueActivityColumnExpr); err == nil { q.typ = "ActivityColumnExpr" @@ -4162,6 +4320,9 @@ func (q QueryGroupByItem) MarshalJSON() ([]byte, error) { if q.typ == "SleepColumnExpr" || q.SleepColumnExpr != nil { return json.Marshal(q.SleepColumnExpr) } + if q.typ == "DerivedReadinessColumnExpr" || q.DerivedReadinessColumnExpr != nil { + return json.Marshal(q.DerivedReadinessColumnExpr) + } if q.typ == "ActivityColumnExpr" || q.ActivityColumnExpr != nil { return json.Marshal(q.ActivityColumnExpr) } @@ -4220,6 +4381,7 @@ type QueryGroupByItemVisitor interface { VisitDateTruncExpr(*DateTruncExpr) error VisitDatePartExpr(*DatePartExpr) error VisitSleepColumnExpr(*SleepColumnExpr) error + VisitDerivedReadinessColumnExpr(*DerivedReadinessColumnExpr) error VisitActivityColumnExpr(*ActivityColumnExpr) error VisitWorkoutColumnExpr(*WorkoutColumnExpr) error VisitBodyColumnExpr(*BodyColumnExpr) error @@ -4249,6 +4411,9 @@ func (q *QueryGroupByItem) Accept(visitor QueryGroupByItemVisitor) error { if q.typ == "SleepColumnExpr" || q.SleepColumnExpr != nil { return visitor.VisitSleepColumnExpr(q.SleepColumnExpr) } + if q.typ == "DerivedReadinessColumnExpr" || q.DerivedReadinessColumnExpr != nil { + return visitor.VisitDerivedReadinessColumnExpr(q.DerivedReadinessColumnExpr) + } if q.typ == "ActivityColumnExpr" || q.ActivityColumnExpr != nil { return visitor.VisitActivityColumnExpr(q.ActivityColumnExpr) } @@ -4307,6 +4472,7 @@ type QuerySelectItem struct { AggregateExpr *AggregateExpr GroupKeyColumnExpr *GroupKeyColumnExpr SleepColumnExpr *SleepColumnExpr + DerivedReadinessColumnExpr *DerivedReadinessColumnExpr ActivityColumnExpr *ActivityColumnExpr WorkoutColumnExpr *WorkoutColumnExpr BodyColumnExpr *BodyColumnExpr @@ -4350,6 +4516,13 @@ func (q *QuerySelectItem) GetSleepColumnExpr() *SleepColumnExpr { return q.SleepColumnExpr } +func (q *QuerySelectItem) GetDerivedReadinessColumnExpr() *DerivedReadinessColumnExpr { + if q == nil { + return nil + } + return q.DerivedReadinessColumnExpr +} + func (q *QuerySelectItem) GetActivityColumnExpr() *ActivityColumnExpr { if q == nil { return nil @@ -4495,6 +4668,12 @@ func (q *QuerySelectItem) UnmarshalJSON(data []byte) error { q.SleepColumnExpr = valueSleepColumnExpr return nil } + valueDerivedReadinessColumnExpr := new(DerivedReadinessColumnExpr) + if err := json.Unmarshal(data, &valueDerivedReadinessColumnExpr); err == nil { + q.typ = "DerivedReadinessColumnExpr" + q.DerivedReadinessColumnExpr = valueDerivedReadinessColumnExpr + return nil + } valueActivityColumnExpr := new(ActivityColumnExpr) if err := json.Unmarshal(data, &valueActivityColumnExpr); err == nil { q.typ = "ActivityColumnExpr" @@ -4616,6 +4795,9 @@ func (q QuerySelectItem) MarshalJSON() ([]byte, error) { if q.typ == "SleepColumnExpr" || q.SleepColumnExpr != nil { return json.Marshal(q.SleepColumnExpr) } + if q.typ == "DerivedReadinessColumnExpr" || q.DerivedReadinessColumnExpr != nil { + return json.Marshal(q.DerivedReadinessColumnExpr) + } if q.typ == "ActivityColumnExpr" || q.ActivityColumnExpr != nil { return json.Marshal(q.ActivityColumnExpr) } @@ -4677,6 +4859,7 @@ type QuerySelectItemVisitor interface { VisitAggregateExpr(*AggregateExpr) error VisitGroupKeyColumnExpr(*GroupKeyColumnExpr) error VisitSleepColumnExpr(*SleepColumnExpr) error + VisitDerivedReadinessColumnExpr(*DerivedReadinessColumnExpr) error VisitActivityColumnExpr(*ActivityColumnExpr) error VisitWorkoutColumnExpr(*WorkoutColumnExpr) error VisitBodyColumnExpr(*BodyColumnExpr) error @@ -4707,6 +4890,9 @@ func (q *QuerySelectItem) Accept(visitor QuerySelectItemVisitor) error { if q.typ == "SleepColumnExpr" || q.SleepColumnExpr != nil { return visitor.VisitSleepColumnExpr(q.SleepColumnExpr) } + if q.typ == "DerivedReadinessColumnExpr" || q.DerivedReadinessColumnExpr != nil { + return visitor.VisitDerivedReadinessColumnExpr(q.DerivedReadinessColumnExpr) + } if q.typ == "ActivityColumnExpr" || q.ActivityColumnExpr != nil { return visitor.VisitActivityColumnExpr(q.ActivityColumnExpr) } diff --git a/aggregate/client.go b/aggregate/client.go index 61f01d4..b956b81 100644 --- a/aggregate/client.go +++ b/aggregate/client.go @@ -4,10 +4,10 @@ package aggregate import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -35,9 +35,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) QueryOne( ctx context.Context, userId string, - request *vitalgo.QueryBatch, + request *v505.QueryBatch, opts ...option.RequestOption, -) (*vitalgo.AggregationResponse, error) { +) (*v505.AggregationResponse, error) { response, err := c.WithRawResponse.QueryOne( ctx, userId, @@ -55,7 +55,7 @@ func (c *Client) GetResultTableForContinuousQuery( userId string, queryIdOrSlug string, opts ...option.RequestOption, -) (*vitalgo.AggregationResult, error) { +) (*v505.AggregationResult, error) { response, err := c.WithRawResponse.GetResultTableForContinuousQuery( ctx, userId, @@ -72,9 +72,9 @@ func (c *Client) GetTaskHistoryForContinuousQuery( ctx context.Context, userId string, queryIdOrSlug string, - request *vitalgo.AggregateGetTaskHistoryForContinuousQueryRequest, + request *v505.AggregateGetTaskHistoryForContinuousQueryRequest, opts ...option.RequestOption, -) (*vitalgo.ContinuousQueryTaskHistoryResponse, error) { +) (*v505.ContinuousQueryTaskHistoryResponse, error) { response, err := c.WithRawResponse.GetTaskHistoryForContinuousQuery( ctx, userId, diff --git a/aggregate/raw_client.go b/aggregate/raw_client.go index 30f8853..0d1fb2b 100644 --- a/aggregate/raw_client.go +++ b/aggregate/raw_client.go @@ -4,10 +4,10 @@ package aggregate import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -33,9 +33,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) QueryOne( ctx context.Context, userId string, - request *vitalgo.QueryBatch, + request *v505.QueryBatch, opts ...option.RequestOption, -) (*core.Response[*vitalgo.AggregationResponse], error) { +) (*core.Response[*v505.AggregationResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -52,7 +52,7 @@ func (r *RawClient) QueryOne( ) headers.Add("accept", "*/*") headers.Add("Content-Type", "application/json") - var response *vitalgo.AggregationResponse + var response *v505.AggregationResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -65,13 +65,13 @@ func (r *RawClient) QueryOne( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.AggregationResponse]{ + return &core.Response[*v505.AggregationResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -83,7 +83,7 @@ func (r *RawClient) GetResultTableForContinuousQuery( userId string, queryIdOrSlug string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.AggregationResult], error) { +) (*core.Response[*v505.AggregationResult], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -100,7 +100,7 @@ func (r *RawClient) GetResultTableForContinuousQuery( options.ToHeader(), ) headers.Add("accept", "*/*") - var response *vitalgo.AggregationResult + var response *v505.AggregationResult raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -112,13 +112,13 @@ func (r *RawClient) GetResultTableForContinuousQuery( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.AggregationResult]{ + return &core.Response[*v505.AggregationResult]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -129,9 +129,9 @@ func (r *RawClient) GetTaskHistoryForContinuousQuery( ctx context.Context, userId string, queryIdOrSlug string, - request *vitalgo.AggregateGetTaskHistoryForContinuousQueryRequest, + request *v505.AggregateGetTaskHistoryForContinuousQueryRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ContinuousQueryTaskHistoryResponse], error) { +) (*core.Response[*v505.ContinuousQueryTaskHistoryResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -154,7 +154,7 @@ func (r *RawClient) GetTaskHistoryForContinuousQuery( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ContinuousQueryTaskHistoryResponse + var response *v505.ContinuousQueryTaskHistoryResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -166,13 +166,13 @@ func (r *RawClient) GetTaskHistoryForContinuousQuery( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ContinuousQueryTaskHistoryResponse]{ + return &core.Response[*v505.ContinuousQueryTaskHistoryResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/body.go b/body.go index 1c5296c..3407157 100644 --- a/body.go +++ b/body.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) diff --git a/body/client.go b/body/client.go index ced0615..afff5fc 100644 --- a/body/client.go +++ b/body/client.go @@ -4,10 +4,10 @@ package body import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -36,9 +36,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) Get( ctx context.Context, userId string, - request *vitalgo.BodyGetRequest, + request *v505.BodyGetRequest, opts ...option.RequestOption, -) (*vitalgo.ClientBodyResponse, error) { +) (*v505.ClientBodyResponse, error) { response, err := c.WithRawResponse.Get( ctx, userId, @@ -55,9 +55,9 @@ func (c *Client) Get( func (c *Client) GetRaw( ctx context.Context, userId string, - request *vitalgo.BodyGetRawRequest, + request *v505.BodyGetRawRequest, opts ...option.RequestOption, -) (*vitalgo.RawBody, error) { +) (*v505.RawBody, error) { response, err := c.WithRawResponse.GetRaw( ctx, userId, diff --git a/body/raw_client.go b/body/raw_client.go index a9f8a11..b2c0d23 100644 --- a/body/raw_client.go +++ b/body/raw_client.go @@ -4,10 +4,10 @@ package body import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -33,9 +33,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) Get( ctx context.Context, userId string, - request *vitalgo.BodyGetRequest, + request *v505.BodyGetRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientBodyResponse], error) { +) (*core.Response[*v505.ClientBodyResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -57,7 +57,7 @@ func (r *RawClient) Get( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientBodyResponse + var response *v505.ClientBodyResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -69,13 +69,13 @@ func (r *RawClient) Get( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientBodyResponse]{ + return &core.Response[*v505.ClientBodyResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -85,9 +85,9 @@ func (r *RawClient) Get( func (r *RawClient) GetRaw( ctx context.Context, userId string, - request *vitalgo.BodyGetRawRequest, + request *v505.BodyGetRawRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.RawBody], error) { +) (*core.Response[*v505.RawBody], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -109,7 +109,7 @@ func (r *RawClient) GetRaw( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.RawBody + var response *v505.RawBody raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -121,13 +121,13 @@ func (r *RawClient) GetRaw( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.RawBody]{ + return &core.Response[*v505.RawBody]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..a58ee98 --- /dev/null +++ b/changelog.md @@ -0,0 +1,17 @@ +## v2.0.0 - 2026-03-18 +* The SDK now supports querying derived readiness metrics including sleep score, recovery score, stress indicators, and chronotype data through new DerivedReadinessColumnExpr. Lab report parsing has been enhanced to support multiple file uploads and provides more detailed failure reasons and optional metadata fields. +* The SDK now supports asynchronous appointment booking with configurable timeout controls through new `AsyncConfirmation`, `SyncConfirmationTimeoutMillisecond`, and `AsyncConfirmationTimeoutMillisecond` parameters. Appointment notes can now be included when booking, rescheduling, or requesting appointments. Lab test creation supports new `LabAccountId` and `LabSlug` parameters for enhanced filtering. Order creation includes a new `ClinicalNotes` field, and order filtering supports `OrderTransactionId`. Address types now include `AccessNotes` for delivery instructions. Sonora Quest is now available as an appointment provider. +* The SDK now supports additional fields for manual connections including iOS SDK version, Android SDK version, and granted permissions tracking. A new Samsung Health provider option is also available for manual provider connections. +* The SDK now supports enhanced lab results with detailed biomarker data through new `BiomarkerResult`, `LabResultsRaw`, and `LabResultsMetadata` types. Address types now include an `AccessNotes` field for delivery instructions. New event types are available for lab report parsing job lifecycle tracking, and order transaction functionality has been added with `ClientFacingOrderTransaction`. Provider support has been expanded to include Samsung Health and Sonora Quest labs. +* New UserAddress type available with comprehensive address field support. The SDK module path has been updated to github.com/tryVital/vital-go/v505. New client endpoints added for Compendium, LabAccount, and OrderTransaction services. +* The SDK now supports form URL encoded request bodies for greater content type flexibility. Import paths have been updated to use the v505 module structure. Lab report parser job creation now supports multiple file uploads. +* Breaking: The Go module import path has changed from `github.com/tryVital/vital-go` to `github.com/tryVital/vital-go/v505`. Update all import statements in your code to use the new versioned path structure. All existing imports will need to be updated to reference the v505 module. +* Breaking: Import paths have changed to support Go module versioning. Update all imports from `github.com/tryVital/vital-go` to `github.com/tryVital/vital-go/v505`. This ensures proper version isolation and dependency management when using different SDK versions. +* Breaking change: All import paths have been updated to use the versioned v505 module. Update your imports from `github.com/tryVital/vital-go` to `github.com/tryVital/vital-go/v505` and change the package alias from `vitalgo` to `v505`. +* Breaking change: All types have been moved from the `vitalgo` package to `v505`. Update your imports from `github.com/tryVital/vital-go` to `github.com/tryVital/vital-go/v505` and change type references accordingly (e.g., `vitalgo.User` becomes `v505.User`). +* Breaking change: All Go import paths have been updated from `github.com/tryVital/vital-go` to `github.com/tryVital/vital-go/v505`. Update your import statements to use the new versioned package path. +* The Go module path has changed from `github.com/tryVital/vital-go` to `github.com/tryVital/vital-go/v505`. Update your import statements to use the new versioned path. All types and methods remain the same, only the import path has changed. +* The SDK now supports lab test compendium operations with new types for searching canonical lab test markers and converting provider IDs between different lab systems (Labcorp, Quest, Bioreference, and Sonora Quest). +* New Compendium, LabAccount, and OrderTransaction clients are now available, providing methods for medical data search/conversion, lab account management, and order transaction tracking with PDF result support. +* New order transaction client available with methods to retrieve transaction details, lab results, and PDF reports. The SDK also includes a new `Bytes()` utility function for working with byte slice pointers. + diff --git a/client/client.go b/client/client.go index d3a41bb..3bd4e6a 100644 --- a/client/client.go +++ b/client/client.go @@ -3,32 +3,35 @@ package client import ( - activity "github.com/tryVital/vital-go/activity" - aggregate "github.com/tryVital/vital-go/aggregate" - body "github.com/tryVital/vital-go/body" - core "github.com/tryVital/vital-go/core" - devices "github.com/tryVital/vital-go/devices" - electrocardiogram "github.com/tryVital/vital-go/electrocardiogram" - insurance "github.com/tryVital/vital-go/insurance" - internal "github.com/tryVital/vital-go/internal" - introspect "github.com/tryVital/vital-go/introspect" - labreport "github.com/tryVital/vital-go/labreport" - labtests "github.com/tryVital/vital-go/labtests" - link "github.com/tryVital/vital-go/link" - meal "github.com/tryVital/vital-go/meal" - menstrualcycle "github.com/tryVital/vital-go/menstrualcycle" - option "github.com/tryVital/vital-go/option" - order "github.com/tryVital/vital-go/order" - payor "github.com/tryVital/vital-go/payor" - profile "github.com/tryVital/vital-go/profile" - providers "github.com/tryVital/vital-go/providers" - sleep "github.com/tryVital/vital-go/sleep" - sleepcycle "github.com/tryVital/vital-go/sleepcycle" - team "github.com/tryVital/vital-go/team" - testkit "github.com/tryVital/vital-go/testkit" - user "github.com/tryVital/vital-go/user" - vitals "github.com/tryVital/vital-go/vitals" - workouts "github.com/tryVital/vital-go/workouts" + activity "github.com/tryVital/vital-go/v2/activity" + aggregate "github.com/tryVital/vital-go/v2/aggregate" + body "github.com/tryVital/vital-go/v2/body" + compendium "github.com/tryVital/vital-go/v2/compendium" + core "github.com/tryVital/vital-go/v2/core" + devices "github.com/tryVital/vital-go/v2/devices" + electrocardiogram "github.com/tryVital/vital-go/v2/electrocardiogram" + insurance "github.com/tryVital/vital-go/v2/insurance" + internal "github.com/tryVital/vital-go/v2/internal" + introspect "github.com/tryVital/vital-go/v2/introspect" + labaccount "github.com/tryVital/vital-go/v2/labaccount" + labreport "github.com/tryVital/vital-go/v2/labreport" + labtests "github.com/tryVital/vital-go/v2/labtests" + link "github.com/tryVital/vital-go/v2/link" + meal "github.com/tryVital/vital-go/v2/meal" + menstrualcycle "github.com/tryVital/vital-go/v2/menstrualcycle" + option "github.com/tryVital/vital-go/v2/option" + order "github.com/tryVital/vital-go/v2/order" + ordertransaction "github.com/tryVital/vital-go/v2/ordertransaction" + payor "github.com/tryVital/vital-go/v2/payor" + profile "github.com/tryVital/vital-go/v2/profile" + providers "github.com/tryVital/vital-go/v2/providers" + sleep "github.com/tryVital/vital-go/v2/sleep" + sleepcycle "github.com/tryVital/vital-go/v2/sleepcycle" + team "github.com/tryVital/vital-go/v2/team" + testkit "github.com/tryVital/vital-go/v2/testkit" + user "github.com/tryVital/vital-go/v2/user" + vitals "github.com/tryVital/vital-go/v2/vitals" + workouts "github.com/tryVital/vital-go/v2/workouts" ) type Client struct { @@ -49,6 +52,9 @@ type Client struct { Providers *providers.Client Introspect *introspect.Client LabTests *labtests.Client + Compendium *compendium.Client + LabAccount *labaccount.Client + OrderTransaction *ordertransaction.Client Testkit *testkit.Client Order *order.Client Insurance *insurance.Client @@ -81,6 +87,9 @@ func NewClient(opts ...option.RequestOption) *Client { Providers: providers.NewClient(options), Introspect: introspect.NewClient(options), LabTests: labtests.NewClient(options), + Compendium: compendium.NewClient(options), + LabAccount: labaccount.NewClient(options), + OrderTransaction: ordertransaction.NewClient(options), Testkit: testkit.NewClient(options), Order: order.NewClient(options), Insurance: insurance.NewClient(options), diff --git a/client/client_test.go b/client/client_test.go index 0dba352..237c7bb 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -4,7 +4,7 @@ package client import ( assert "github.com/stretchr/testify/assert" - option "github.com/tryVital/vital-go/option" + option "github.com/tryVital/vital-go/v2/option" http "net/http" testing "testing" time "time" diff --git a/compendium.go b/compendium.go new file mode 100644 index 0000000..600bdd2 --- /dev/null +++ b/compendium.go @@ -0,0 +1,1367 @@ +// Code generated by Fern. DO NOT EDIT. + +package api + +import ( + json "encoding/json" + fmt "fmt" + internal "github.com/tryVital/vital-go/v2/internal" + big "math/big" +) + +var ( + convertCompendiumBodyFieldTeamId = big.NewInt(1 << 0) + convertCompendiumBodyFieldLabTestId = big.NewInt(1 << 1) + convertCompendiumBodyFieldProviderIds = big.NewInt(1 << 2) + convertCompendiumBodyFieldTargetLab = big.NewInt(1 << 3) + convertCompendiumBodyFieldLimit = big.NewInt(1 << 4) +) + +type ConvertCompendiumBody struct { + TeamId *CompendiumConvertRequestTeamId `json:"-" url:"team_id,omitempty"` + LabTestId *string `json:"lab_test_id,omitempty" url:"-"` + ProviderIds []string `json:"provider_ids,omitempty" url:"-"` + TargetLab CompendiumSearchLabs `json:"target_lab" url:"-"` + Limit *int `json:"limit,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (c *ConvertCompendiumBody) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetTeamId sets the TeamId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConvertCompendiumBody) SetTeamId(teamId *CompendiumConvertRequestTeamId) { + c.TeamId = teamId + c.require(convertCompendiumBodyFieldTeamId) +} + +// SetLabTestId sets the LabTestId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConvertCompendiumBody) SetLabTestId(labTestId *string) { + c.LabTestId = labTestId + c.require(convertCompendiumBodyFieldLabTestId) +} + +// SetProviderIds sets the ProviderIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConvertCompendiumBody) SetProviderIds(providerIds []string) { + c.ProviderIds = providerIds + c.require(convertCompendiumBodyFieldProviderIds) +} + +// SetTargetLab sets the TargetLab field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConvertCompendiumBody) SetTargetLab(targetLab CompendiumSearchLabs) { + c.TargetLab = targetLab + c.require(convertCompendiumBodyFieldTargetLab) +} + +// SetLimit sets the Limit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConvertCompendiumBody) SetLimit(limit *int) { + c.Limit = limit + c.require(convertCompendiumBodyFieldLimit) +} + +func (c *ConvertCompendiumBody) UnmarshalJSON(data []byte) error { + type unmarshaler ConvertCompendiumBody + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *c = ConvertCompendiumBody(body) + return nil +} + +func (c *ConvertCompendiumBody) MarshalJSON() ([]byte, error) { + type embed ConvertCompendiumBody + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +var ( + searchCompendiumBodyFieldTeamId = big.NewInt(1 << 0) + searchCompendiumBodyFieldMode = big.NewInt(1 << 1) + searchCompendiumBodyFieldQuery = big.NewInt(1 << 2) + searchCompendiumBodyFieldCptCodes = big.NewInt(1 << 3) + searchCompendiumBodyFieldLoincSetHash = big.NewInt(1 << 4) + searchCompendiumBodyFieldLabs = big.NewInt(1 << 5) + searchCompendiumBodyFieldIncludeRelated = big.NewInt(1 << 6) + searchCompendiumBodyFieldLimit = big.NewInt(1 << 7) +) + +type SearchCompendiumBody struct { + TeamId *CompendiumSearchRequestTeamId `json:"-" url:"team_id,omitempty"` + Mode SearchMode `json:"mode" url:"-"` + Query *string `json:"query,omitempty" url:"-"` + CptCodes []string `json:"cpt_codes,omitempty" url:"-"` + LoincSetHash *string `json:"loinc_set_hash,omitempty" url:"-"` + Labs []CompendiumSearchLabs `json:"labs,omitempty" url:"-"` + IncludeRelated *bool `json:"include_related,omitempty" url:"-"` + Limit *int `json:"limit,omitempty" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (s *SearchCompendiumBody) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetTeamId sets the TeamId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SearchCompendiumBody) SetTeamId(teamId *CompendiumSearchRequestTeamId) { + s.TeamId = teamId + s.require(searchCompendiumBodyFieldTeamId) +} + +// SetMode sets the Mode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SearchCompendiumBody) SetMode(mode SearchMode) { + s.Mode = mode + s.require(searchCompendiumBodyFieldMode) +} + +// SetQuery sets the Query field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SearchCompendiumBody) SetQuery(query *string) { + s.Query = query + s.require(searchCompendiumBodyFieldQuery) +} + +// SetCptCodes sets the CptCodes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SearchCompendiumBody) SetCptCodes(cptCodes []string) { + s.CptCodes = cptCodes + s.require(searchCompendiumBodyFieldCptCodes) +} + +// SetLoincSetHash sets the LoincSetHash field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SearchCompendiumBody) SetLoincSetHash(loincSetHash *string) { + s.LoincSetHash = loincSetHash + s.require(searchCompendiumBodyFieldLoincSetHash) +} + +// SetLabs sets the Labs field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SearchCompendiumBody) SetLabs(labs []CompendiumSearchLabs) { + s.Labs = labs + s.require(searchCompendiumBodyFieldLabs) +} + +// SetIncludeRelated sets the IncludeRelated field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SearchCompendiumBody) SetIncludeRelated(includeRelated *bool) { + s.IncludeRelated = includeRelated + s.require(searchCompendiumBodyFieldIncludeRelated) +} + +// SetLimit sets the Limit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SearchCompendiumBody) SetLimit(limit *int) { + s.Limit = limit + s.require(searchCompendiumBodyFieldLimit) +} + +func (s *SearchCompendiumBody) UnmarshalJSON(data []byte) error { + type unmarshaler SearchCompendiumBody + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *s = SearchCompendiumBody(body) + return nil +} + +func (s *SearchCompendiumBody) MarshalJSON() ([]byte, error) { + type embed SearchCompendiumBody + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +var ( + canonicalCandidateFieldLoincSetHash = big.NewInt(1 << 0) + canonicalCandidateFieldDisplayName = big.NewInt(1 << 1) + canonicalCandidateFieldAliases = big.NewInt(1 << 2) + canonicalCandidateFieldLoincCodes = big.NewInt(1 << 3) + canonicalCandidateFieldProviderIds = big.NewInt(1 << 4) + canonicalCandidateFieldLoincComponents = big.NewInt(1 << 5) + canonicalCandidateFieldLoincGroups = big.NewInt(1 << 6) + canonicalCandidateFieldCptCodes = big.NewInt(1 << 7) + canonicalCandidateFieldPopularityScore = big.NewInt(1 << 8) + canonicalCandidateFieldConfidence = big.NewInt(1 << 9) +) + +type CanonicalCandidate struct { + LoincSetHash string `json:"loinc_set_hash" url:"loinc_set_hash"` + DisplayName string `json:"display_name" url:"display_name"` + Aliases []string `json:"aliases,omitempty" url:"aliases,omitempty"` + LoincCodes []string `json:"loinc_codes,omitempty" url:"loinc_codes,omitempty"` + ProviderIds []string `json:"provider_ids,omitempty" url:"provider_ids,omitempty"` + LoincComponents []string `json:"loinc_components,omitempty" url:"loinc_components,omitempty"` + LoincGroups []string `json:"loinc_groups,omitempty" url:"loinc_groups,omitempty"` + CptCodes []string `json:"cpt_codes,omitempty" url:"cpt_codes,omitempty"` + PopularityScore float64 `json:"popularity_score" url:"popularity_score"` + Confidence float64 `json:"confidence" url:"confidence"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *CanonicalCandidate) GetLoincSetHash() string { + if c == nil { + return "" + } + return c.LoincSetHash +} + +func (c *CanonicalCandidate) GetDisplayName() string { + if c == nil { + return "" + } + return c.DisplayName +} + +func (c *CanonicalCandidate) GetAliases() []string { + if c == nil { + return nil + } + return c.Aliases +} + +func (c *CanonicalCandidate) GetLoincCodes() []string { + if c == nil { + return nil + } + return c.LoincCodes +} + +func (c *CanonicalCandidate) GetProviderIds() []string { + if c == nil { + return nil + } + return c.ProviderIds +} + +func (c *CanonicalCandidate) GetLoincComponents() []string { + if c == nil { + return nil + } + return c.LoincComponents +} + +func (c *CanonicalCandidate) GetLoincGroups() []string { + if c == nil { + return nil + } + return c.LoincGroups +} + +func (c *CanonicalCandidate) GetCptCodes() []string { + if c == nil { + return nil + } + return c.CptCodes +} + +func (c *CanonicalCandidate) GetPopularityScore() float64 { + if c == nil { + return 0 + } + return c.PopularityScore +} + +func (c *CanonicalCandidate) GetConfidence() float64 { + if c == nil { + return 0 + } + return c.Confidence +} + +func (c *CanonicalCandidate) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *CanonicalCandidate) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetLoincSetHash sets the LoincSetHash field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CanonicalCandidate) SetLoincSetHash(loincSetHash string) { + c.LoincSetHash = loincSetHash + c.require(canonicalCandidateFieldLoincSetHash) +} + +// SetDisplayName sets the DisplayName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CanonicalCandidate) SetDisplayName(displayName string) { + c.DisplayName = displayName + c.require(canonicalCandidateFieldDisplayName) +} + +// SetAliases sets the Aliases field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CanonicalCandidate) SetAliases(aliases []string) { + c.Aliases = aliases + c.require(canonicalCandidateFieldAliases) +} + +// SetLoincCodes sets the LoincCodes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CanonicalCandidate) SetLoincCodes(loincCodes []string) { + c.LoincCodes = loincCodes + c.require(canonicalCandidateFieldLoincCodes) +} + +// SetProviderIds sets the ProviderIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CanonicalCandidate) SetProviderIds(providerIds []string) { + c.ProviderIds = providerIds + c.require(canonicalCandidateFieldProviderIds) +} + +// SetLoincComponents sets the LoincComponents field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CanonicalCandidate) SetLoincComponents(loincComponents []string) { + c.LoincComponents = loincComponents + c.require(canonicalCandidateFieldLoincComponents) +} + +// SetLoincGroups sets the LoincGroups field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CanonicalCandidate) SetLoincGroups(loincGroups []string) { + c.LoincGroups = loincGroups + c.require(canonicalCandidateFieldLoincGroups) +} + +// SetCptCodes sets the CptCodes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CanonicalCandidate) SetCptCodes(cptCodes []string) { + c.CptCodes = cptCodes + c.require(canonicalCandidateFieldCptCodes) +} + +// SetPopularityScore sets the PopularityScore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CanonicalCandidate) SetPopularityScore(popularityScore float64) { + c.PopularityScore = popularityScore + c.require(canonicalCandidateFieldPopularityScore) +} + +// SetConfidence sets the Confidence field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CanonicalCandidate) SetConfidence(confidence float64) { + c.Confidence = confidence + c.require(canonicalCandidateFieldConfidence) +} + +func (c *CanonicalCandidate) UnmarshalJSON(data []byte) error { + type unmarshaler CanonicalCandidate + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = CanonicalCandidate(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *CanonicalCandidate) MarshalJSON() ([]byte, error) { + type embed CanonicalCandidate + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *CanonicalCandidate) String() string { + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +// ℹ️ This enum is non-exhaustive. +type CompendiumSearchLabs string + +const ( + CompendiumSearchLabsLabcorp CompendiumSearchLabs = "labcorp" + CompendiumSearchLabsQuest CompendiumSearchLabs = "quest" + CompendiumSearchLabsBioreference CompendiumSearchLabs = "bioreference" + CompendiumSearchLabsSonoraQuest CompendiumSearchLabs = "sonora_quest" +) + +func NewCompendiumSearchLabsFromString(s string) (CompendiumSearchLabs, error) { + switch s { + case "labcorp": + return CompendiumSearchLabsLabcorp, nil + case "quest": + return CompendiumSearchLabsQuest, nil + case "bioreference": + return CompendiumSearchLabsBioreference, nil + case "sonora_quest": + return CompendiumSearchLabsSonoraQuest, nil + } + var t CompendiumSearchLabs + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CompendiumSearchLabs) Ptr() *CompendiumSearchLabs { + return &c +} + +var ( + convertCompendiumResponseFieldSourceLabTestId = big.NewInt(1 << 0) + convertCompendiumResponseFieldSourceLabId = big.NewInt(1 << 1) + convertCompendiumResponseFieldTargetLabId = big.NewInt(1 << 2) + convertCompendiumResponseFieldTargetLabSlug = big.NewInt(1 << 3) + convertCompendiumResponseFieldSourceProviderIds = big.NewInt(1 << 4) + convertCompendiumResponseFieldConvertedProviderIds = big.NewInt(1 << 5) + convertCompendiumResponseFieldUnresolvedProviderIds = big.NewInt(1 << 6) + convertCompendiumResponseFieldBySourceProviderId = big.NewInt(1 << 7) +) + +type ConvertCompendiumResponse struct { + SourceLabTestId *string `json:"source_lab_test_id,omitempty" url:"source_lab_test_id,omitempty"` + SourceLabId *int `json:"source_lab_id,omitempty" url:"source_lab_id,omitempty"` + TargetLabId int `json:"target_lab_id" url:"target_lab_id"` + TargetLabSlug string `json:"target_lab_slug" url:"target_lab_slug"` + SourceProviderIds []string `json:"source_provider_ids,omitempty" url:"source_provider_ids,omitempty"` + ConvertedProviderIds []string `json:"converted_provider_ids,omitempty" url:"converted_provider_ids,omitempty"` + UnresolvedProviderIds []string `json:"unresolved_provider_ids,omitempty" url:"unresolved_provider_ids,omitempty"` + BySourceProviderId map[string]*ProviderIdConversionResponse `json:"by_source_provider_id,omitempty" url:"by_source_provider_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *ConvertCompendiumResponse) GetSourceLabTestId() *string { + if c == nil { + return nil + } + return c.SourceLabTestId +} + +func (c *ConvertCompendiumResponse) GetSourceLabId() *int { + if c == nil { + return nil + } + return c.SourceLabId +} + +func (c *ConvertCompendiumResponse) GetTargetLabId() int { + if c == nil { + return 0 + } + return c.TargetLabId +} + +func (c *ConvertCompendiumResponse) GetTargetLabSlug() string { + if c == nil { + return "" + } + return c.TargetLabSlug +} + +func (c *ConvertCompendiumResponse) GetSourceProviderIds() []string { + if c == nil { + return nil + } + return c.SourceProviderIds +} + +func (c *ConvertCompendiumResponse) GetConvertedProviderIds() []string { + if c == nil { + return nil + } + return c.ConvertedProviderIds +} + +func (c *ConvertCompendiumResponse) GetUnresolvedProviderIds() []string { + if c == nil { + return nil + } + return c.UnresolvedProviderIds +} + +func (c *ConvertCompendiumResponse) GetBySourceProviderId() map[string]*ProviderIdConversionResponse { + if c == nil { + return nil + } + return c.BySourceProviderId +} + +func (c *ConvertCompendiumResponse) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ConvertCompendiumResponse) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetSourceLabTestId sets the SourceLabTestId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConvertCompendiumResponse) SetSourceLabTestId(sourceLabTestId *string) { + c.SourceLabTestId = sourceLabTestId + c.require(convertCompendiumResponseFieldSourceLabTestId) +} + +// SetSourceLabId sets the SourceLabId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConvertCompendiumResponse) SetSourceLabId(sourceLabId *int) { + c.SourceLabId = sourceLabId + c.require(convertCompendiumResponseFieldSourceLabId) +} + +// SetTargetLabId sets the TargetLabId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConvertCompendiumResponse) SetTargetLabId(targetLabId int) { + c.TargetLabId = targetLabId + c.require(convertCompendiumResponseFieldTargetLabId) +} + +// SetTargetLabSlug sets the TargetLabSlug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConvertCompendiumResponse) SetTargetLabSlug(targetLabSlug string) { + c.TargetLabSlug = targetLabSlug + c.require(convertCompendiumResponseFieldTargetLabSlug) +} + +// SetSourceProviderIds sets the SourceProviderIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConvertCompendiumResponse) SetSourceProviderIds(sourceProviderIds []string) { + c.SourceProviderIds = sourceProviderIds + c.require(convertCompendiumResponseFieldSourceProviderIds) +} + +// SetConvertedProviderIds sets the ConvertedProviderIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConvertCompendiumResponse) SetConvertedProviderIds(convertedProviderIds []string) { + c.ConvertedProviderIds = convertedProviderIds + c.require(convertCompendiumResponseFieldConvertedProviderIds) +} + +// SetUnresolvedProviderIds sets the UnresolvedProviderIds field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConvertCompendiumResponse) SetUnresolvedProviderIds(unresolvedProviderIds []string) { + c.UnresolvedProviderIds = unresolvedProviderIds + c.require(convertCompendiumResponseFieldUnresolvedProviderIds) +} + +// SetBySourceProviderId sets the BySourceProviderId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ConvertCompendiumResponse) SetBySourceProviderId(bySourceProviderId map[string]*ProviderIdConversionResponse) { + c.BySourceProviderId = bySourceProviderId + c.require(convertCompendiumResponseFieldBySourceProviderId) +} + +func (c *ConvertCompendiumResponse) UnmarshalJSON(data []byte) error { + type unmarshaler ConvertCompendiumResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ConvertCompendiumResponse(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ConvertCompendiumResponse) MarshalJSON() ([]byte, error) { + type embed ConvertCompendiumResponse + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ConvertCompendiumResponse) String() string { + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +var ( + perLabCandidateFieldMarkerId = big.NewInt(1 << 0) + perLabCandidateFieldLabId = big.NewInt(1 << 1) + perLabCandidateFieldLabSlug = big.NewInt(1 << 2) + perLabCandidateFieldName = big.NewInt(1 << 3) + perLabCandidateFieldResultNames = big.NewInt(1 << 4) + perLabCandidateFieldProviderId = big.NewInt(1 << 5) + perLabCandidateFieldLoincSetHash = big.NewInt(1 << 6) + perLabCandidateFieldLoincCodes = big.NewInt(1 << 7) + perLabCandidateFieldLoincComponents = big.NewInt(1 << 8) + perLabCandidateFieldLoincGroups = big.NewInt(1 << 9) + perLabCandidateFieldCptCodes = big.NewInt(1 << 10) + perLabCandidateFieldRelation = big.NewInt(1 << 11) + perLabCandidateFieldConfidence = big.NewInt(1 << 12) + perLabCandidateFieldReasonCodes = big.NewInt(1 << 13) + perLabCandidateFieldMarkerPopularityScore = big.NewInt(1 << 14) +) + +type PerLabCandidate struct { + MarkerId int `json:"marker_id" url:"marker_id"` + LabId int `json:"lab_id" url:"lab_id"` + LabSlug *string `json:"lab_slug,omitempty" url:"lab_slug,omitempty"` + Name string `json:"name" url:"name"` + ResultNames []string `json:"result_names,omitempty" url:"result_names,omitempty"` + ProviderId *string `json:"provider_id,omitempty" url:"provider_id,omitempty"` + LoincSetHash string `json:"loinc_set_hash" url:"loinc_set_hash"` + LoincCodes []string `json:"loinc_codes,omitempty" url:"loinc_codes,omitempty"` + LoincComponents []string `json:"loinc_components,omitempty" url:"loinc_components,omitempty"` + LoincGroups []string `json:"loinc_groups,omitempty" url:"loinc_groups,omitempty"` + CptCodes []string `json:"cpt_codes,omitempty" url:"cpt_codes,omitempty"` + Relation string `json:"relation" url:"relation"` + Confidence float64 `json:"confidence" url:"confidence"` + ReasonCodes []string `json:"reason_codes,omitempty" url:"reason_codes,omitempty"` + MarkerPopularityScore float64 `json:"marker_popularity_score" url:"marker_popularity_score"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (p *PerLabCandidate) GetMarkerId() int { + if p == nil { + return 0 + } + return p.MarkerId +} + +func (p *PerLabCandidate) GetLabId() int { + if p == nil { + return 0 + } + return p.LabId +} + +func (p *PerLabCandidate) GetLabSlug() *string { + if p == nil { + return nil + } + return p.LabSlug +} + +func (p *PerLabCandidate) GetName() string { + if p == nil { + return "" + } + return p.Name +} + +func (p *PerLabCandidate) GetResultNames() []string { + if p == nil { + return nil + } + return p.ResultNames +} + +func (p *PerLabCandidate) GetProviderId() *string { + if p == nil { + return nil + } + return p.ProviderId +} + +func (p *PerLabCandidate) GetLoincSetHash() string { + if p == nil { + return "" + } + return p.LoincSetHash +} + +func (p *PerLabCandidate) GetLoincCodes() []string { + if p == nil { + return nil + } + return p.LoincCodes +} + +func (p *PerLabCandidate) GetLoincComponents() []string { + if p == nil { + return nil + } + return p.LoincComponents +} + +func (p *PerLabCandidate) GetLoincGroups() []string { + if p == nil { + return nil + } + return p.LoincGroups +} + +func (p *PerLabCandidate) GetCptCodes() []string { + if p == nil { + return nil + } + return p.CptCodes +} + +func (p *PerLabCandidate) GetRelation() string { + if p == nil { + return "" + } + return p.Relation +} + +func (p *PerLabCandidate) GetConfidence() float64 { + if p == nil { + return 0 + } + return p.Confidence +} + +func (p *PerLabCandidate) GetReasonCodes() []string { + if p == nil { + return nil + } + return p.ReasonCodes +} + +func (p *PerLabCandidate) GetMarkerPopularityScore() float64 { + if p == nil { + return 0 + } + return p.MarkerPopularityScore +} + +func (p *PerLabCandidate) GetExtraProperties() map[string]interface{} { + return p.extraProperties +} + +func (p *PerLabCandidate) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetMarkerId sets the MarkerId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetMarkerId(markerId int) { + p.MarkerId = markerId + p.require(perLabCandidateFieldMarkerId) +} + +// SetLabId sets the LabId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetLabId(labId int) { + p.LabId = labId + p.require(perLabCandidateFieldLabId) +} + +// SetLabSlug sets the LabSlug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetLabSlug(labSlug *string) { + p.LabSlug = labSlug + p.require(perLabCandidateFieldLabSlug) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetName(name string) { + p.Name = name + p.require(perLabCandidateFieldName) +} + +// SetResultNames sets the ResultNames field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetResultNames(resultNames []string) { + p.ResultNames = resultNames + p.require(perLabCandidateFieldResultNames) +} + +// SetProviderId sets the ProviderId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetProviderId(providerId *string) { + p.ProviderId = providerId + p.require(perLabCandidateFieldProviderId) +} + +// SetLoincSetHash sets the LoincSetHash field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetLoincSetHash(loincSetHash string) { + p.LoincSetHash = loincSetHash + p.require(perLabCandidateFieldLoincSetHash) +} + +// SetLoincCodes sets the LoincCodes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetLoincCodes(loincCodes []string) { + p.LoincCodes = loincCodes + p.require(perLabCandidateFieldLoincCodes) +} + +// SetLoincComponents sets the LoincComponents field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetLoincComponents(loincComponents []string) { + p.LoincComponents = loincComponents + p.require(perLabCandidateFieldLoincComponents) +} + +// SetLoincGroups sets the LoincGroups field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetLoincGroups(loincGroups []string) { + p.LoincGroups = loincGroups + p.require(perLabCandidateFieldLoincGroups) +} + +// SetCptCodes sets the CptCodes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetCptCodes(cptCodes []string) { + p.CptCodes = cptCodes + p.require(perLabCandidateFieldCptCodes) +} + +// SetRelation sets the Relation field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetRelation(relation string) { + p.Relation = relation + p.require(perLabCandidateFieldRelation) +} + +// SetConfidence sets the Confidence field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetConfidence(confidence float64) { + p.Confidence = confidence + p.require(perLabCandidateFieldConfidence) +} + +// SetReasonCodes sets the ReasonCodes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetReasonCodes(reasonCodes []string) { + p.ReasonCodes = reasonCodes + p.require(perLabCandidateFieldReasonCodes) +} + +// SetMarkerPopularityScore sets the MarkerPopularityScore field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerLabCandidate) SetMarkerPopularityScore(markerPopularityScore float64) { + p.MarkerPopularityScore = markerPopularityScore + p.require(perLabCandidateFieldMarkerPopularityScore) +} + +func (p *PerLabCandidate) UnmarshalJSON(data []byte) error { + type unmarshaler PerLabCandidate + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *p = PerLabCandidate(value) + extraProperties, err := internal.ExtractExtraProperties(data, *p) + if err != nil { + return err + } + p.extraProperties = extraProperties + p.rawJSON = json.RawMessage(data) + return nil +} + +func (p *PerLabCandidate) MarshalJSON() ([]byte, error) { + type embed PerLabCandidate + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (p *PerLabCandidate) String() string { + if len(p.rawJSON) > 0 { + if value, err := internal.StringifyJSON(p.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(p); err == nil { + return value + } + return fmt.Sprintf("%#v", p) +} + +var ( + providerIdConversionResponseFieldSourceProviderId = big.NewInt(1 << 0) + providerIdConversionResponseFieldCandidates = big.NewInt(1 << 1) +) + +type ProviderIdConversionResponse struct { + SourceProviderId string `json:"source_provider_id" url:"source_provider_id"` + Candidates []*PerLabCandidate `json:"candidates,omitempty" url:"candidates,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (p *ProviderIdConversionResponse) GetSourceProviderId() string { + if p == nil { + return "" + } + return p.SourceProviderId +} + +func (p *ProviderIdConversionResponse) GetCandidates() []*PerLabCandidate { + if p == nil { + return nil + } + return p.Candidates +} + +func (p *ProviderIdConversionResponse) GetExtraProperties() map[string]interface{} { + return p.extraProperties +} + +func (p *ProviderIdConversionResponse) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetSourceProviderId sets the SourceProviderId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProviderIdConversionResponse) SetSourceProviderId(sourceProviderId string) { + p.SourceProviderId = sourceProviderId + p.require(providerIdConversionResponseFieldSourceProviderId) +} + +// SetCandidates sets the Candidates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ProviderIdConversionResponse) SetCandidates(candidates []*PerLabCandidate) { + p.Candidates = candidates + p.require(providerIdConversionResponseFieldCandidates) +} + +func (p *ProviderIdConversionResponse) UnmarshalJSON(data []byte) error { + type unmarshaler ProviderIdConversionResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *p = ProviderIdConversionResponse(value) + extraProperties, err := internal.ExtractExtraProperties(data, *p) + if err != nil { + return err + } + p.extraProperties = extraProperties + p.rawJSON = json.RawMessage(data) + return nil +} + +func (p *ProviderIdConversionResponse) MarshalJSON() ([]byte, error) { + type embed ProviderIdConversionResponse + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (p *ProviderIdConversionResponse) String() string { + if len(p.rawJSON) > 0 { + if value, err := internal.StringifyJSON(p.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(p); err == nil { + return value + } + return fmt.Sprintf("%#v", p) +} + +var ( + relatedCandidateFieldCanonical = big.NewInt(1 << 0) + relatedCandidateFieldRelation = big.NewInt(1 << 1) + relatedCandidateFieldConfidence = big.NewInt(1 << 2) + relatedCandidateFieldReasonCodes = big.NewInt(1 << 3) +) + +type RelatedCandidate struct { + Canonical *CanonicalCandidate `json:"canonical" url:"canonical"` + Relation string `json:"relation" url:"relation"` + Confidence float64 `json:"confidence" url:"confidence"` + ReasonCodes []string `json:"reason_codes,omitempty" url:"reason_codes,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (r *RelatedCandidate) GetCanonical() *CanonicalCandidate { + if r == nil { + return nil + } + return r.Canonical +} + +func (r *RelatedCandidate) GetRelation() string { + if r == nil { + return "" + } + return r.Relation +} + +func (r *RelatedCandidate) GetConfidence() float64 { + if r == nil { + return 0 + } + return r.Confidence +} + +func (r *RelatedCandidate) GetReasonCodes() []string { + if r == nil { + return nil + } + return r.ReasonCodes +} + +func (r *RelatedCandidate) GetExtraProperties() map[string]interface{} { + return r.extraProperties +} + +func (r *RelatedCandidate) require(field *big.Int) { + if r.explicitFields == nil { + r.explicitFields = big.NewInt(0) + } + r.explicitFields.Or(r.explicitFields, field) +} + +// SetCanonical sets the Canonical field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RelatedCandidate) SetCanonical(canonical *CanonicalCandidate) { + r.Canonical = canonical + r.require(relatedCandidateFieldCanonical) +} + +// SetRelation sets the Relation field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RelatedCandidate) SetRelation(relation string) { + r.Relation = relation + r.require(relatedCandidateFieldRelation) +} + +// SetConfidence sets the Confidence field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RelatedCandidate) SetConfidence(confidence float64) { + r.Confidence = confidence + r.require(relatedCandidateFieldConfidence) +} + +// SetReasonCodes sets the ReasonCodes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RelatedCandidate) SetReasonCodes(reasonCodes []string) { + r.ReasonCodes = reasonCodes + r.require(relatedCandidateFieldReasonCodes) +} + +func (r *RelatedCandidate) UnmarshalJSON(data []byte) error { + type unmarshaler RelatedCandidate + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *r = RelatedCandidate(value) + extraProperties, err := internal.ExtractExtraProperties(data, *r) + if err != nil { + return err + } + r.extraProperties = extraProperties + r.rawJSON = json.RawMessage(data) + return nil +} + +func (r *RelatedCandidate) MarshalJSON() ([]byte, error) { + type embed RelatedCandidate + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (r *RelatedCandidate) String() string { + if len(r.rawJSON) > 0 { + if value, err := internal.StringifyJSON(r.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(r); err == nil { + return value + } + return fmt.Sprintf("%#v", r) +} + +var ( + searchCompendiumResponseFieldMode = big.NewInt(1 << 0) + searchCompendiumResponseFieldSelectedCanonical = big.NewInt(1 << 1) + searchCompendiumResponseFieldCanonicalCandidates = big.NewInt(1 << 2) + searchCompendiumResponseFieldPerLab = big.NewInt(1 << 3) + searchCompendiumResponseFieldRelated = big.NewInt(1 << 4) +) + +type SearchCompendiumResponse struct { + Mode SearchMode `json:"mode" url:"mode"` + SelectedCanonical *CanonicalCandidate `json:"selected_canonical,omitempty" url:"selected_canonical,omitempty"` + CanonicalCandidates []*CanonicalCandidate `json:"canonical_candidates,omitempty" url:"canonical_candidates,omitempty"` + PerLab map[string][]*PerLabCandidate `json:"per_lab,omitempty" url:"per_lab,omitempty"` + Related []*RelatedCandidate `json:"related,omitempty" url:"related,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SearchCompendiumResponse) GetMode() SearchMode { + if s == nil { + return "" + } + return s.Mode +} + +func (s *SearchCompendiumResponse) GetSelectedCanonical() *CanonicalCandidate { + if s == nil { + return nil + } + return s.SelectedCanonical +} + +func (s *SearchCompendiumResponse) GetCanonicalCandidates() []*CanonicalCandidate { + if s == nil { + return nil + } + return s.CanonicalCandidates +} + +func (s *SearchCompendiumResponse) GetPerLab() map[string][]*PerLabCandidate { + if s == nil { + return nil + } + return s.PerLab +} + +func (s *SearchCompendiumResponse) GetRelated() []*RelatedCandidate { + if s == nil { + return nil + } + return s.Related +} + +func (s *SearchCompendiumResponse) GetExtraProperties() map[string]interface{} { + return s.extraProperties +} + +func (s *SearchCompendiumResponse) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetMode sets the Mode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SearchCompendiumResponse) SetMode(mode SearchMode) { + s.Mode = mode + s.require(searchCompendiumResponseFieldMode) +} + +// SetSelectedCanonical sets the SelectedCanonical field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SearchCompendiumResponse) SetSelectedCanonical(selectedCanonical *CanonicalCandidate) { + s.SelectedCanonical = selectedCanonical + s.require(searchCompendiumResponseFieldSelectedCanonical) +} + +// SetCanonicalCandidates sets the CanonicalCandidates field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SearchCompendiumResponse) SetCanonicalCandidates(canonicalCandidates []*CanonicalCandidate) { + s.CanonicalCandidates = canonicalCandidates + s.require(searchCompendiumResponseFieldCanonicalCandidates) +} + +// SetPerLab sets the PerLab field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SearchCompendiumResponse) SetPerLab(perLab map[string][]*PerLabCandidate) { + s.PerLab = perLab + s.require(searchCompendiumResponseFieldPerLab) +} + +// SetRelated sets the Related field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SearchCompendiumResponse) SetRelated(related []*RelatedCandidate) { + s.Related = related + s.require(searchCompendiumResponseFieldRelated) +} + +func (s *SearchCompendiumResponse) UnmarshalJSON(data []byte) error { + type unmarshaler SearchCompendiumResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *s = SearchCompendiumResponse(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) + if err != nil { + return err + } + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) + return nil +} + +func (s *SearchCompendiumResponse) MarshalJSON() ([]byte, error) { + type embed SearchCompendiumResponse + var marshaler = struct { + embed + }{ + embed: embed(*s), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (s *SearchCompendiumResponse) String() string { + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(s); err == nil { + return value + } + return fmt.Sprintf("%#v", s) +} + +// ℹ️ This enum is non-exhaustive. +type SearchMode string + +const ( + SearchModeCanonical SearchMode = "canonical" + SearchModeCrosswalk SearchMode = "crosswalk" +) + +func NewSearchModeFromString(s string) (SearchMode, error) { + switch s { + case "canonical": + return SearchModeCanonical, nil + case "crosswalk": + return SearchModeCrosswalk, nil + } + var t SearchMode + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (s SearchMode) Ptr() *SearchMode { + return &s +} + +type CompendiumConvertRequestTeamId string + +const ( + CompendiumConvertRequestTeamIdInferFromContext CompendiumConvertRequestTeamId = "infer_from_context" +) + +func NewCompendiumConvertRequestTeamIdFromString(s string) (CompendiumConvertRequestTeamId, error) { + switch s { + case "infer_from_context": + return CompendiumConvertRequestTeamIdInferFromContext, nil + } + var t CompendiumConvertRequestTeamId + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CompendiumConvertRequestTeamId) Ptr() *CompendiumConvertRequestTeamId { + return &c +} + +type CompendiumSearchRequestTeamId string + +const ( + CompendiumSearchRequestTeamIdInferFromContext CompendiumSearchRequestTeamId = "infer_from_context" +) + +func NewCompendiumSearchRequestTeamIdFromString(s string) (CompendiumSearchRequestTeamId, error) { + switch s { + case "infer_from_context": + return CompendiumSearchRequestTeamIdInferFromContext, nil + } + var t CompendiumSearchRequestTeamId + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c CompendiumSearchRequestTeamId) Ptr() *CompendiumSearchRequestTeamId { + return &c +} diff --git a/compendium/client.go b/compendium/client.go new file mode 100644 index 0000000..3e4a5d0 --- /dev/null +++ b/compendium/client.go @@ -0,0 +1,65 @@ +// Code generated by Fern. DO NOT EDIT. + +package compendium + +import ( + context "context" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" +) + +type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions + baseURL string + caller *internal.Caller +} + +func NewClient(options *core.RequestOptions) *Client { + return &Client{ + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (c *Client) Search( + ctx context.Context, + request *v505.SearchCompendiumBody, + opts ...option.RequestOption, +) (*v505.SearchCompendiumResponse, error) { + response, err := c.WithRawResponse.Search( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +func (c *Client) Convert( + ctx context.Context, + request *v505.ConvertCompendiumBody, + opts ...option.RequestOption, +) (*v505.ConvertCompendiumResponse, error) { + response, err := c.WithRawResponse.Convert( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} diff --git a/compendium/raw_client.go b/compendium/raw_client.go new file mode 100644 index 0000000..8c86dd7 --- /dev/null +++ b/compendium/raw_client.go @@ -0,0 +1,131 @@ +// Code generated by Fern. DO NOT EDIT. + +package compendium + +import ( + context "context" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) Search( + ctx context.Context, + request *v505.SearchCompendiumBody, + opts ...option.RequestOption, +) (*core.Response[*v505.SearchCompendiumResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.tryvital.io", + ) + endpointURL := baseURL + "/v3/compendium/search" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *v505.SearchCompendiumResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*v505.SearchCompendiumResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) Convert( + ctx context.Context, + request *v505.ConvertCompendiumBody, + opts ...option.RequestOption, +) (*core.Response[*v505.ConvertCompendiumResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.tryvital.io", + ) + endpointURL := baseURL + "/v3/compendium/convert" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + headers.Add("Content-Type", "application/json") + var response *v505.ConvertCompendiumResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodPost, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Request: request, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*v505.ConvertCompendiumResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/core/request_option.go b/core/request_option.go index c1a22f7..a781cc8 100644 --- a/core/request_option.go +++ b/core/request_option.go @@ -56,9 +56,9 @@ func (r *RequestOptions) ToHeader() http.Header { func (r *RequestOptions) cloneHeader() http.Header { headers := r.HTTPHeader.Clone() headers.Set("X-Fern-Language", "Go") - headers.Set("X-Fern-SDK-Name", "github.com/tryVital/vital-go") - headers.Set("X-Fern-SDK-Version", "v1.1.575") - headers.Set("User-Agent", "github.com/tryVital/vital-go/1.1.575") + headers.Set("X-Fern-SDK-Name", "github.com/tryVital/vital-go/v505") + headers.Set("X-Fern-SDK-Version", "v2.0.0") + headers.Set("User-Agent", "github.com/tryVital/vital-go/v2.0.0") return headers } diff --git a/devices.go b/devices.go index 0e75e1d..e6b97fd 100644 --- a/devices.go +++ b/devices.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" ) diff --git a/devices/client.go b/devices/client.go index e015b36..95461bd 100644 --- a/devices/client.go +++ b/devices/client.go @@ -4,10 +4,10 @@ package devices import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -36,9 +36,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) GetRaw( ctx context.Context, userId string, - request *vitalgo.DevicesGetRawRequest, + request *v505.DevicesGetRawRequest, opts ...option.RequestOption, -) (*vitalgo.RawDevices, error) { +) (*v505.RawDevices, error) { response, err := c.WithRawResponse.GetRaw( ctx, userId, diff --git a/devices/raw_client.go b/devices/raw_client.go index be8425c..5911548 100644 --- a/devices/raw_client.go +++ b/devices/raw_client.go @@ -4,10 +4,10 @@ package devices import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -33,9 +33,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) GetRaw( ctx context.Context, userId string, - request *vitalgo.DevicesGetRawRequest, + request *v505.DevicesGetRawRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.RawDevices], error) { +) (*core.Response[*v505.RawDevices], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -57,7 +57,7 @@ func (r *RawClient) GetRaw( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.RawDevices + var response *v505.RawDevices raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -69,13 +69,13 @@ func (r *RawClient) GetRaw( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.RawDevices]{ + return &core.Response[*v505.RawDevices]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/electrocardiogram.go b/electrocardiogram.go index a803424..3427cfc 100644 --- a/electrocardiogram.go +++ b/electrocardiogram.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) diff --git a/electrocardiogram/client.go b/electrocardiogram/client.go index 0e5dda9..6ce37b8 100644 --- a/electrocardiogram/client.go +++ b/electrocardiogram/client.go @@ -4,10 +4,10 @@ package electrocardiogram import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -36,9 +36,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) Get( ctx context.Context, userId string, - request *vitalgo.ElectrocardiogramGetRequest, + request *v505.ElectrocardiogramGetRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingElectrocardiogramResponse, error) { +) (*v505.ClientFacingElectrocardiogramResponse, error) { response, err := c.WithRawResponse.Get( ctx, userId, diff --git a/electrocardiogram/raw_client.go b/electrocardiogram/raw_client.go index 4b4bd8f..256e7b6 100644 --- a/electrocardiogram/raw_client.go +++ b/electrocardiogram/raw_client.go @@ -4,10 +4,10 @@ package electrocardiogram import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -33,9 +33,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) Get( ctx context.Context, userId string, - request *vitalgo.ElectrocardiogramGetRequest, + request *v505.ElectrocardiogramGetRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingElectrocardiogramResponse], error) { +) (*core.Response[*v505.ClientFacingElectrocardiogramResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -57,7 +57,7 @@ func (r *RawClient) Get( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingElectrocardiogramResponse + var response *v505.ClientFacingElectrocardiogramResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -69,13 +69,13 @@ func (r *RawClient) Get( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingElectrocardiogramResponse]{ + return &core.Response[*v505.ClientFacingElectrocardiogramResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/error_codes.go b/error_codes.go index 02ea0ce..f88bc43 100644 --- a/error_codes.go +++ b/error_codes.go @@ -3,8 +3,8 @@ package api import ( - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" ) var ErrorCodes internal.ErrorCodes = internal.ErrorCodes{ diff --git a/errors.go b/errors.go index fb7d918..7ab6362 100644 --- a/errors.go +++ b/errors.go @@ -4,7 +4,7 @@ package api import ( json "encoding/json" - core "github.com/tryVital/vital-go/core" + core "github.com/tryVital/vital-go/v2/core" ) // Bad Request diff --git a/go.mod b/go.mod index 2f4a446..491a943 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/tryVital/vital-go +module github.com/tryVital/vital-go/v2 go 1.21 diff --git a/insurance.go b/insurance.go index d03c6ff..09dee6d 100644 --- a/insurance.go +++ b/insurance.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" ) @@ -120,6 +120,27 @@ func (p *PayorSearchRequest) SetProviderId(providerId *string) { p.require(payorSearchRequestFieldProviderId) } +func (p *PayorSearchRequest) UnmarshalJSON(data []byte) error { + type unmarshaler PayorSearchRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *p = PayorSearchRequest(body) + return nil +} + +func (p *PayorSearchRequest) MarshalJSON() ([]byte, error) { + type embed PayorSearchRequest + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( clientFacingDiagnosisInformationFieldDiagnosisCode = big.NewInt(1 << 0) clientFacingDiagnosisInformationFieldDescription = big.NewInt(1 << 1) diff --git a/insurance/client.go b/insurance/client.go index 1f554b5..1bcec97 100644 --- a/insurance/client.go +++ b/insurance/client.go @@ -4,10 +4,10 @@ package insurance import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -34,9 +34,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) SearchGetPayorInfo( ctx context.Context, - request *vitalgo.InsuranceSearchGetPayorInfoRequest, + request *v505.InsuranceSearchGetPayorInfoRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingPayorSearchResponse, error) { +) ([]*v505.ClientFacingPayorSearchResponse, error) { response, err := c.WithRawResponse.SearchGetPayorInfo( ctx, request, @@ -50,9 +50,9 @@ func (c *Client) SearchGetPayorInfo( func (c *Client) SearchPayorInfo( ctx context.Context, - request *vitalgo.PayorSearchRequest, + request *v505.PayorSearchRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingPayorSearchResponseDeprecated, error) { +) ([]*v505.ClientFacingPayorSearchResponseDeprecated, error) { response, err := c.WithRawResponse.SearchPayorInfo( ctx, request, @@ -66,9 +66,9 @@ func (c *Client) SearchPayorInfo( func (c *Client) SearchDiagnosis( ctx context.Context, - request *vitalgo.InsuranceSearchDiagnosisRequest, + request *v505.InsuranceSearchDiagnosisRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingDiagnosisInformation, error) { +) ([]*v505.ClientFacingDiagnosisInformation, error) { response, err := c.WithRawResponse.SearchDiagnosis( ctx, request, diff --git a/insurance/raw_client.go b/insurance/raw_client.go index 46fa7bc..acce87c 100644 --- a/insurance/raw_client.go +++ b/insurance/raw_client.go @@ -4,10 +4,10 @@ package insurance import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -32,9 +32,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) SearchGetPayorInfo( ctx context.Context, - request *vitalgo.InsuranceSearchGetPayorInfoRequest, + request *v505.InsuranceSearchGetPayorInfoRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingPayorSearchResponse], error) { +) (*core.Response[[]*v505.ClientFacingPayorSearchResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -53,7 +53,7 @@ func (r *RawClient) SearchGetPayorInfo( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingPayorSearchResponse + var response []*v505.ClientFacingPayorSearchResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -65,13 +65,13 @@ func (r *RawClient) SearchGetPayorInfo( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingPayorSearchResponse]{ + return &core.Response[[]*v505.ClientFacingPayorSearchResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -80,9 +80,9 @@ func (r *RawClient) SearchGetPayorInfo( func (r *RawClient) SearchPayorInfo( ctx context.Context, - request *vitalgo.PayorSearchRequest, + request *v505.PayorSearchRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingPayorSearchResponseDeprecated], error) { +) (*core.Response[[]*v505.ClientFacingPayorSearchResponseDeprecated], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -95,7 +95,7 @@ func (r *RawClient) SearchPayorInfo( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response []*vitalgo.ClientFacingPayorSearchResponseDeprecated + var response []*v505.ClientFacingPayorSearchResponseDeprecated raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -108,13 +108,13 @@ func (r *RawClient) SearchPayorInfo( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingPayorSearchResponseDeprecated]{ + return &core.Response[[]*v505.ClientFacingPayorSearchResponseDeprecated]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -123,9 +123,9 @@ func (r *RawClient) SearchPayorInfo( func (r *RawClient) SearchDiagnosis( ctx context.Context, - request *vitalgo.InsuranceSearchDiagnosisRequest, + request *v505.InsuranceSearchDiagnosisRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingDiagnosisInformation], error) { +) (*core.Response[[]*v505.ClientFacingDiagnosisInformation], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -144,7 +144,7 @@ func (r *RawClient) SearchDiagnosis( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingDiagnosisInformation + var response []*v505.ClientFacingDiagnosisInformation raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -156,13 +156,13 @@ func (r *RawClient) SearchDiagnosis( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingDiagnosisInformation]{ + return &core.Response[[]*v505.ClientFacingDiagnosisInformation]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/internal/caller.go b/internal/caller.go index 8a40fa0..46e06a6 100644 --- a/internal/caller.go +++ b/internal/caller.go @@ -12,13 +12,14 @@ import ( "reflect" "strings" - "github.com/tryVital/vital-go/core" + "github.com/tryVital/vital-go/v2/core" ) const ( // contentType specifies the JSON Content-Type header value. - contentType = "application/json" - contentTypeHeader = "Content-Type" + contentType = "application/json" + contentTypeHeader = "Content-Type" + contentTypeFormURLEncoded = "application/x-www-form-urlencoded" ) // Caller calls APIs and deserializes their response, if any. @@ -180,7 +181,14 @@ func newRequest( request interface{}, bodyProperties map[string]interface{}, ) (*http.Request, error) { - requestBody, err := newRequestBody(request, bodyProperties) + // Determine the content type from headers, defaulting to JSON. + reqContentType := contentType + if endpointHeaders != nil { + if ct := endpointHeaders.Get(contentTypeHeader); ct != "" { + reqContentType = ct + } + } + requestBody, err := newRequestBody(request, bodyProperties, reqContentType) if err != nil { return nil, err } @@ -189,7 +197,7 @@ func newRequest( return nil, err } req = req.WithContext(ctx) - req.Header.Set(contentTypeHeader, contentType) + req.Header.Set(contentTypeHeader, reqContentType) for name, values := range endpointHeaders { req.Header[name] = values } @@ -197,11 +205,14 @@ func newRequest( } // newRequestBody returns a new io.Reader that represents the HTTP request body. -func newRequestBody(request interface{}, bodyProperties map[string]interface{}) (io.Reader, error) { +func newRequestBody(request interface{}, bodyProperties map[string]interface{}, reqContentType string) (io.Reader, error) { if isNil(request) { if len(bodyProperties) == 0 { return nil, nil } + if reqContentType == contentTypeFormURLEncoded { + return newFormURLEncodedBody(bodyProperties), nil + } requestBytes, err := json.Marshal(bodyProperties) if err != nil { return nil, err @@ -211,6 +222,10 @@ func newRequestBody(request interface{}, bodyProperties map[string]interface{}) if body, ok := request.(io.Reader); ok { return body, nil } + // Handle form URL encoded content type. + if reqContentType == contentTypeFormURLEncoded { + return newFormURLEncodedRequestBody(request, bodyProperties) + } requestBytes, err := MarshalJSONWithExtraProperties(request, bodyProperties) if err != nil { return nil, err @@ -218,6 +233,54 @@ func newRequestBody(request interface{}, bodyProperties map[string]interface{}) return bytes.NewReader(requestBytes), nil } +// newFormURLEncodedBody returns a new io.Reader that represents a form URL encoded body +// from the given body properties map. +func newFormURLEncodedBody(bodyProperties map[string]interface{}) io.Reader { + values := url.Values{} + for key, val := range bodyProperties { + values.Set(key, fmt.Sprintf("%v", val)) + } + return strings.NewReader(values.Encode()) +} + +// newFormURLEncodedRequestBody returns a new io.Reader that represents a form URL encoded body +// from the given request struct and body properties. +func newFormURLEncodedRequestBody(request interface{}, bodyProperties map[string]interface{}) (io.Reader, error) { + values := url.Values{} + // Marshal the request to JSON first to respect any custom MarshalJSON methods, + // then unmarshal into a map to extract the field values. + jsonBytes, err := json.Marshal(request) + if err != nil { + return nil, err + } + var jsonMap map[string]interface{} + if err := json.Unmarshal(jsonBytes, &jsonMap); err != nil { + return nil, err + } + // Convert the JSON map to form URL encoded values. + for key, val := range jsonMap { + if val == nil { + continue + } + values.Set(key, fmt.Sprintf("%v", val)) + } + // Add any extra body properties. + for key, val := range bodyProperties { + values.Set(key, fmt.Sprintf("%v", val)) + } + return strings.NewReader(values.Encode()), nil +} + +// isZeroValue checks if the given reflect.Value is the zero value for its type. +func isZeroValue(v reflect.Value) bool { + switch v.Kind() { + case reflect.Ptr, reflect.Interface, reflect.Slice, reflect.Map, reflect.Chan, reflect.Func: + return v.IsNil() + default: + return v.IsZero() + } +} + // decodeError decodes the error from the given HTTP response. Note that // it's the caller's responsibility to close the response body. func decodeError(response *http.Response, errorDecoder ErrorDecoder) error { diff --git a/internal/caller_test.go b/internal/caller_test.go index 18fc297..7a1153d 100644 --- a/internal/caller_test.go +++ b/internal/caller_test.go @@ -11,11 +11,12 @@ import ( "net/http/httptest" "net/url" "strconv" + "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tryVital/vital-go/core" + "github.com/tryVital/vital-go/v2/core" ) // InternalTestCase represents a single test case. @@ -467,3 +468,239 @@ func newTestErrorDecoder(t *testing.T) func(int, http.Header, io.Reader) error { return apiError } } + +// FormURLEncodedTestRequest is a test struct for form URL encoding tests. +type FormURLEncodedTestRequest struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` + GrantType string `json:"grant_type,omitempty"` + Scope *string `json:"scope,omitempty"` + NilPointer *string `json:"nil_pointer,omitempty"` +} + +func TestNewFormURLEncodedBody(t *testing.T) { + t.Run("simple key-value pairs", func(t *testing.T) { + bodyProperties := map[string]interface{}{ + "client_id": "test_client_id", + "client_secret": "test_client_secret", + "grant_type": "client_credentials", + } + reader := newFormURLEncodedBody(bodyProperties) + body, err := io.ReadAll(reader) + require.NoError(t, err) + + // Parse the body and verify values + values, err := url.ParseQuery(string(body)) + require.NoError(t, err) + + assert.Equal(t, "test_client_id", values.Get("client_id")) + assert.Equal(t, "test_client_secret", values.Get("client_secret")) + assert.Equal(t, "client_credentials", values.Get("grant_type")) + + // Verify it's not JSON + bodyStr := string(body) + assert.False(t, strings.HasPrefix(strings.TrimSpace(bodyStr), "{"), + "Body should not be JSON, got: %s", bodyStr) + }) + + t.Run("special characters requiring URL encoding", func(t *testing.T) { + bodyProperties := map[string]interface{}{ + "value_with_space": "hello world", + "value_with_ampersand": "a&b", + "value_with_equals": "a=b", + "value_with_plus": "a+b", + } + reader := newFormURLEncodedBody(bodyProperties) + body, err := io.ReadAll(reader) + require.NoError(t, err) + + // Parse the body and verify values are correctly decoded + values, err := url.ParseQuery(string(body)) + require.NoError(t, err) + + assert.Equal(t, "hello world", values.Get("value_with_space")) + assert.Equal(t, "a&b", values.Get("value_with_ampersand")) + assert.Equal(t, "a=b", values.Get("value_with_equals")) + assert.Equal(t, "a+b", values.Get("value_with_plus")) + }) + + t.Run("empty map", func(t *testing.T) { + bodyProperties := map[string]interface{}{} + reader := newFormURLEncodedBody(bodyProperties) + body, err := io.ReadAll(reader) + require.NoError(t, err) + assert.Empty(t, string(body)) + }) +} + +func TestNewFormURLEncodedRequestBody(t *testing.T) { + t.Run("struct with json tags", func(t *testing.T) { + scope := "read write" + request := &FormURLEncodedTestRequest{ + ClientID: "test_client_id", + ClientSecret: "test_client_secret", + GrantType: "client_credentials", + Scope: &scope, + NilPointer: nil, + } + reader, err := newFormURLEncodedRequestBody(request, nil) + require.NoError(t, err) + + body, err := io.ReadAll(reader) + require.NoError(t, err) + + // Parse the body and verify values + values, err := url.ParseQuery(string(body)) + require.NoError(t, err) + + assert.Equal(t, "test_client_id", values.Get("client_id")) + assert.Equal(t, "test_client_secret", values.Get("client_secret")) + assert.Equal(t, "client_credentials", values.Get("grant_type")) + assert.Equal(t, "read write", values.Get("scope")) + // nil_pointer should not be present (nil pointer with omitempty) + assert.Empty(t, values.Get("nil_pointer")) + + // Verify it's not JSON + bodyStr := string(body) + assert.False(t, strings.HasPrefix(strings.TrimSpace(bodyStr), "{"), + "Body should not be JSON, got: %s", bodyStr) + }) + + t.Run("struct with omitempty and zero values", func(t *testing.T) { + request := &FormURLEncodedTestRequest{ + ClientID: "test_client_id", + ClientSecret: "test_client_secret", + GrantType: "", // empty string with omitempty should be omitted + Scope: nil, + NilPointer: nil, + } + reader, err := newFormURLEncodedRequestBody(request, nil) + require.NoError(t, err) + + body, err := io.ReadAll(reader) + require.NoError(t, err) + + values, err := url.ParseQuery(string(body)) + require.NoError(t, err) + + assert.Equal(t, "test_client_id", values.Get("client_id")) + assert.Equal(t, "test_client_secret", values.Get("client_secret")) + // grant_type should not be present (empty string with omitempty) + assert.Empty(t, values.Get("grant_type")) + assert.Empty(t, values.Get("scope")) + }) + + t.Run("struct with extra body properties", func(t *testing.T) { + request := &FormURLEncodedTestRequest{ + ClientID: "test_client_id", + ClientSecret: "test_client_secret", + } + bodyProperties := map[string]interface{}{ + "extra_param": "extra_value", + } + reader, err := newFormURLEncodedRequestBody(request, bodyProperties) + require.NoError(t, err) + + body, err := io.ReadAll(reader) + require.NoError(t, err) + + values, err := url.ParseQuery(string(body)) + require.NoError(t, err) + + assert.Equal(t, "test_client_id", values.Get("client_id")) + assert.Equal(t, "test_client_secret", values.Get("client_secret")) + assert.Equal(t, "extra_value", values.Get("extra_param")) + }) + + t.Run("special characters in struct fields", func(t *testing.T) { + scope := "read&write=all+permissions" + request := &FormURLEncodedTestRequest{ + ClientID: "client with spaces", + ClientSecret: "secret&with=special+chars", + Scope: &scope, + } + reader, err := newFormURLEncodedRequestBody(request, nil) + require.NoError(t, err) + + body, err := io.ReadAll(reader) + require.NoError(t, err) + + values, err := url.ParseQuery(string(body)) + require.NoError(t, err) + + assert.Equal(t, "client with spaces", values.Get("client_id")) + assert.Equal(t, "secret&with=special+chars", values.Get("client_secret")) + assert.Equal(t, "read&write=all+permissions", values.Get("scope")) + }) +} + +func TestNewRequestBodyFormURLEncoded(t *testing.T) { + t.Run("selects form encoding when content-type is form-urlencoded", func(t *testing.T) { + request := &FormURLEncodedTestRequest{ + ClientID: "test_client_id", + ClientSecret: "test_client_secret", + GrantType: "client_credentials", + } + reader, err := newRequestBody(request, nil, contentTypeFormURLEncoded) + require.NoError(t, err) + + body, err := io.ReadAll(reader) + require.NoError(t, err) + + // Verify it's form-urlencoded, not JSON + bodyStr := string(body) + assert.False(t, strings.HasPrefix(strings.TrimSpace(bodyStr), "{"), + "Body should not be JSON when Content-Type is form-urlencoded, got: %s", bodyStr) + + // Parse and verify values + values, err := url.ParseQuery(bodyStr) + require.NoError(t, err) + + assert.Equal(t, "test_client_id", values.Get("client_id")) + assert.Equal(t, "test_client_secret", values.Get("client_secret")) + assert.Equal(t, "client_credentials", values.Get("grant_type")) + }) + + t.Run("selects JSON encoding when content-type is application/json", func(t *testing.T) { + request := &FormURLEncodedTestRequest{ + ClientID: "test_client_id", + ClientSecret: "test_client_secret", + } + reader, err := newRequestBody(request, nil, contentType) + require.NoError(t, err) + + body, err := io.ReadAll(reader) + require.NoError(t, err) + + // Verify it's JSON + bodyStr := string(body) + assert.True(t, strings.HasPrefix(strings.TrimSpace(bodyStr), "{"), + "Body should be JSON when Content-Type is application/json, got: %s", bodyStr) + + // Parse and verify it's valid JSON + var parsed map[string]interface{} + err = json.Unmarshal(body, &parsed) + require.NoError(t, err) + + assert.Equal(t, "test_client_id", parsed["client_id"]) + assert.Equal(t, "test_client_secret", parsed["client_secret"]) + }) + + t.Run("form encoding with body properties only (nil request)", func(t *testing.T) { + bodyProperties := map[string]interface{}{ + "client_id": "test_client_id", + "client_secret": "test_client_secret", + } + reader, err := newRequestBody(nil, bodyProperties, contentTypeFormURLEncoded) + require.NoError(t, err) + + body, err := io.ReadAll(reader) + require.NoError(t, err) + + values, err := url.ParseQuery(string(body)) + require.NoError(t, err) + + assert.Equal(t, "test_client_id", values.Get("client_id")) + assert.Equal(t, "test_client_secret", values.Get("client_secret")) + }) +} diff --git a/internal/error_decoder.go b/internal/error_decoder.go index b8229ed..be685e2 100644 --- a/internal/error_decoder.go +++ b/internal/error_decoder.go @@ -8,7 +8,7 @@ import ( "io" "net/http" - "github.com/tryVital/vital-go/core" + "github.com/tryVital/vital-go/v2/core" ) // ErrorCodes maps HTTP status codes to error constructors. diff --git a/internal/error_decoder_test.go b/internal/error_decoder_test.go index e763a63..bfd3e16 100644 --- a/internal/error_decoder_test.go +++ b/internal/error_decoder_test.go @@ -7,7 +7,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/tryVital/vital-go/core" + "github.com/tryVital/vital-go/v2/core" ) func TestErrorDecoder(t *testing.T) { diff --git a/internal/multipart.go b/internal/multipart.go index 67a2229..d8d9955 100644 --- a/internal/multipart.go +++ b/internal/multipart.go @@ -119,6 +119,9 @@ func (w *MultipartWriter) writeFile( filename = getFilename(file) contentType = getContentType(file) ) + if filename == "" { + filename = field + } if contentType == "" { contentType = defaultContentType } diff --git a/internal/multipart_test.go b/internal/multipart_test.go index 07008dd..13201f7 100644 --- a/internal/multipart_test.go +++ b/internal/multipart_test.go @@ -1,6 +1,7 @@ package internal import ( + "bytes" "encoding/json" "io" "mime/multipart" @@ -174,6 +175,81 @@ func TestMultipartWriter(t *testing.T) { } }) + t.Run("write file without name", func(t *testing.T) { + tests := []struct { + desc string + giveField string + giveReader func(content string) io.Reader + giveContent string + wantFilename string + }{ + { + desc: "strings.Reader without name uses field name as filename", + giveField: "file", + giveReader: func(content string) io.Reader { + return strings.NewReader(content) + }, + giveContent: "test content", + wantFilename: "file", + }, + { + desc: "bytes.Reader without name uses field name as filename", + giveField: "document", + giveReader: func(content string) io.Reader { + return bytes.NewReader([]byte(content)) + }, + giveContent: "some data", + wantFilename: "document", + }, + { + desc: "bytes.Buffer without name uses field name as filename", + giveField: "upload", + giveReader: func(content string) io.Reader { + return bytes.NewBufferString(content) + }, + giveContent: "buffer content", + wantFilename: "upload", + }, + } + + for _, tt := range tests { + t.Run(tt.desc, func(t *testing.T) { + w := NewMultipartWriter() + + reader := tt.giveReader(tt.giveContent) + require.NoError(t, w.WriteFile(tt.giveField, reader)) + require.NoError(t, w.Close()) + + multipartReader := multipart.NewReader(w.Buffer(), w.writer.Boundary()) + form, err := multipartReader.ReadForm(maxFormMemory) + require.NoError(t, err) + defer func() { + require.NoError(t, form.RemoveAll()) + }() + + files := form.File[tt.giveField] + require.Len(t, files, 1) + + file := files[0] + assert.Equal(t, tt.wantFilename, file.Filename) + + // Verify the Content-Disposition header includes the filename attribute + contentDisposition := file.Header.Get("Content-Disposition") + assert.Contains(t, contentDisposition, `filename="`+tt.wantFilename+`"`) + + f, err := file.Open() + require.NoError(t, err) + defer func() { + require.NoError(t, f.Close()) + }() + + content, err := io.ReadAll(f) + require.NoError(t, err) + assert.Equal(t, tt.giveContent, string(content)) + }) + } + }) + t.Run("write JSON", func(t *testing.T) { type testStruct struct { Name string `json:"name"` diff --git a/internal/retrier_test.go b/internal/retrier_test.go index a78c333..0151984 100644 --- a/internal/retrier_test.go +++ b/internal/retrier_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tryVital/vital-go/core" + "github.com/tryVital/vital-go/v2/core" ) type RetryTestCase struct { diff --git a/introspect.go b/introspect.go index cf009ca..e106743 100644 --- a/introspect.go +++ b/introspect.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) diff --git a/introspect/client.go b/introspect/client.go index af5e38a..53548b1 100644 --- a/introspect/client.go +++ b/introspect/client.go @@ -4,10 +4,10 @@ package introspect import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -34,9 +34,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) GetUserResources( ctx context.Context, - request *vitalgo.IntrospectGetUserResourcesRequest, + request *v505.IntrospectGetUserResourcesRequest, opts ...option.RequestOption, -) (*vitalgo.UserResourcesResponse, error) { +) (*v505.UserResourcesResponse, error) { response, err := c.WithRawResponse.GetUserResources( ctx, request, @@ -50,9 +50,9 @@ func (c *Client) GetUserResources( func (c *Client) GetUserHistoricalPulls( ctx context.Context, - request *vitalgo.IntrospectGetUserHistoricalPullsRequest, + request *v505.IntrospectGetUserHistoricalPullsRequest, opts ...option.RequestOption, -) (*vitalgo.UserHistoricalPullsResponse, error) { +) (*v505.UserHistoricalPullsResponse, error) { response, err := c.WithRawResponse.GetUserHistoricalPulls( ctx, request, diff --git a/introspect/raw_client.go b/introspect/raw_client.go index e025044..b07354a 100644 --- a/introspect/raw_client.go +++ b/introspect/raw_client.go @@ -4,10 +4,10 @@ package introspect import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -32,9 +32,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) GetUserResources( ctx context.Context, - request *vitalgo.IntrospectGetUserResourcesRequest, + request *v505.IntrospectGetUserResourcesRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.UserResourcesResponse], error) { +) (*core.Response[*v505.UserResourcesResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -53,7 +53,7 @@ func (r *RawClient) GetUserResources( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.UserResourcesResponse + var response *v505.UserResourcesResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -65,13 +65,13 @@ func (r *RawClient) GetUserResources( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.UserResourcesResponse]{ + return &core.Response[*v505.UserResourcesResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -80,9 +80,9 @@ func (r *RawClient) GetUserResources( func (r *RawClient) GetUserHistoricalPulls( ctx context.Context, - request *vitalgo.IntrospectGetUserHistoricalPullsRequest, + request *v505.IntrospectGetUserHistoricalPullsRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.UserHistoricalPullsResponse], error) { +) (*core.Response[*v505.UserHistoricalPullsResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -101,7 +101,7 @@ func (r *RawClient) GetUserHistoricalPulls( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.UserHistoricalPullsResponse + var response *v505.UserHistoricalPullsResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -113,13 +113,13 @@ func (r *RawClient) GetUserHistoricalPulls( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.UserHistoricalPullsResponse]{ + return &core.Response[*v505.UserHistoricalPullsResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/lab_account.go b/lab_account.go new file mode 100644 index 0000000..849c5db --- /dev/null +++ b/lab_account.go @@ -0,0 +1,587 @@ +// Code generated by Fern. DO NOT EDIT. + +package api + +import ( + json "encoding/json" + fmt "fmt" + internal "github.com/tryVital/vital-go/v2/internal" + big "math/big" +) + +var ( + labAccountGetTeamLabAccountsRequestFieldLabAccountId = big.NewInt(1 << 0) + labAccountGetTeamLabAccountsRequestFieldStatus = big.NewInt(1 << 1) +) + +type LabAccountGetTeamLabAccountsRequest struct { + LabAccountId *string `json:"-" url:"lab_account_id,omitempty"` + Status *LabAccountStatus `json:"-" url:"status,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LabAccountGetTeamLabAccountsRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetLabAccountId sets the LabAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabAccountGetTeamLabAccountsRequest) SetLabAccountId(labAccountId *string) { + l.LabAccountId = labAccountId + l.require(labAccountGetTeamLabAccountsRequestFieldLabAccountId) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabAccountGetTeamLabAccountsRequest) SetStatus(status *LabAccountStatus) { + l.Status = status + l.require(labAccountGetTeamLabAccountsRequestFieldStatus) +} + +var ( + clientFacingLabAccountFieldId = big.NewInt(1 << 0) + clientFacingLabAccountFieldLab = big.NewInt(1 << 1) + clientFacingLabAccountFieldOrgId = big.NewInt(1 << 2) + clientFacingLabAccountFieldStatus = big.NewInt(1 << 3) + clientFacingLabAccountFieldDelegatedFlow = big.NewInt(1 << 4) + clientFacingLabAccountFieldProviderAccountId = big.NewInt(1 << 5) + clientFacingLabAccountFieldAccountName = big.NewInt(1 << 6) + clientFacingLabAccountFieldDefaultClinicalNotes = big.NewInt(1 << 7) + clientFacingLabAccountFieldBusinessUnits = big.NewInt(1 << 8) + clientFacingLabAccountFieldAllowedBilling = big.NewInt(1 << 9) + clientFacingLabAccountFieldTeamIdAllowlist = big.NewInt(1 << 10) +) + +type ClientFacingLabAccount struct { + Id string `json:"id" url:"id"` + Lab Labs `json:"lab" url:"lab"` + OrgId *string `json:"org_id,omitempty" url:"org_id,omitempty"` + Status LabAccountStatus `json:"status" url:"status"` + DelegatedFlow LabAccountDelegatedFlow `json:"delegated_flow" url:"delegated_flow"` + ProviderAccountId string `json:"provider_account_id" url:"provider_account_id"` + AccountName *string `json:"account_name,omitempty" url:"account_name,omitempty"` + DefaultClinicalNotes *string `json:"default_clinical_notes,omitempty" url:"default_clinical_notes,omitempty"` + BusinessUnits []string `json:"business_units,omitempty" url:"business_units,omitempty"` + AllowedBilling map[string][]UsState `json:"allowed_billing" url:"allowed_billing"` + TeamIdAllowlist []string `json:"team_id_allowlist" url:"team_id_allowlist"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *ClientFacingLabAccount) GetId() string { + if c == nil { + return "" + } + return c.Id +} + +func (c *ClientFacingLabAccount) GetLab() Labs { + if c == nil { + return "" + } + return c.Lab +} + +func (c *ClientFacingLabAccount) GetOrgId() *string { + if c == nil { + return nil + } + return c.OrgId +} + +func (c *ClientFacingLabAccount) GetStatus() LabAccountStatus { + if c == nil { + return "" + } + return c.Status +} + +func (c *ClientFacingLabAccount) GetDelegatedFlow() LabAccountDelegatedFlow { + if c == nil { + return "" + } + return c.DelegatedFlow +} + +func (c *ClientFacingLabAccount) GetProviderAccountId() string { + if c == nil { + return "" + } + return c.ProviderAccountId +} + +func (c *ClientFacingLabAccount) GetAccountName() *string { + if c == nil { + return nil + } + return c.AccountName +} + +func (c *ClientFacingLabAccount) GetDefaultClinicalNotes() *string { + if c == nil { + return nil + } + return c.DefaultClinicalNotes +} + +func (c *ClientFacingLabAccount) GetBusinessUnits() []string { + if c == nil { + return nil + } + return c.BusinessUnits +} + +func (c *ClientFacingLabAccount) GetAllowedBilling() map[string][]UsState { + if c == nil { + return nil + } + return c.AllowedBilling +} + +func (c *ClientFacingLabAccount) GetTeamIdAllowlist() []string { + if c == nil { + return nil + } + return c.TeamIdAllowlist +} + +func (c *ClientFacingLabAccount) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingLabAccount) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabAccount) SetId(id string) { + c.Id = id + c.require(clientFacingLabAccountFieldId) +} + +// SetLab sets the Lab field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabAccount) SetLab(lab Labs) { + c.Lab = lab + c.require(clientFacingLabAccountFieldLab) +} + +// SetOrgId sets the OrgId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabAccount) SetOrgId(orgId *string) { + c.OrgId = orgId + c.require(clientFacingLabAccountFieldOrgId) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabAccount) SetStatus(status LabAccountStatus) { + c.Status = status + c.require(clientFacingLabAccountFieldStatus) +} + +// SetDelegatedFlow sets the DelegatedFlow field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabAccount) SetDelegatedFlow(delegatedFlow LabAccountDelegatedFlow) { + c.DelegatedFlow = delegatedFlow + c.require(clientFacingLabAccountFieldDelegatedFlow) +} + +// SetProviderAccountId sets the ProviderAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabAccount) SetProviderAccountId(providerAccountId string) { + c.ProviderAccountId = providerAccountId + c.require(clientFacingLabAccountFieldProviderAccountId) +} + +// SetAccountName sets the AccountName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabAccount) SetAccountName(accountName *string) { + c.AccountName = accountName + c.require(clientFacingLabAccountFieldAccountName) +} + +// SetDefaultClinicalNotes sets the DefaultClinicalNotes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabAccount) SetDefaultClinicalNotes(defaultClinicalNotes *string) { + c.DefaultClinicalNotes = defaultClinicalNotes + c.require(clientFacingLabAccountFieldDefaultClinicalNotes) +} + +// SetBusinessUnits sets the BusinessUnits field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabAccount) SetBusinessUnits(businessUnits []string) { + c.BusinessUnits = businessUnits + c.require(clientFacingLabAccountFieldBusinessUnits) +} + +// SetAllowedBilling sets the AllowedBilling field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabAccount) SetAllowedBilling(allowedBilling map[string][]UsState) { + c.AllowedBilling = allowedBilling + c.require(clientFacingLabAccountFieldAllowedBilling) +} + +// SetTeamIdAllowlist sets the TeamIdAllowlist field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabAccount) SetTeamIdAllowlist(teamIdAllowlist []string) { + c.TeamIdAllowlist = teamIdAllowlist + c.require(clientFacingLabAccountFieldTeamIdAllowlist) +} + +func (c *ClientFacingLabAccount) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingLabAccount + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ClientFacingLabAccount(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingLabAccount) MarshalJSON() ([]byte, error) { + type embed ClientFacingLabAccount + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingLabAccount) String() string { + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +var ( + getTeamLabAccountsResponseFieldData = big.NewInt(1 << 0) +) + +type GetTeamLabAccountsResponse struct { + Data []*ClientFacingLabAccount `json:"data,omitempty" url:"data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (g *GetTeamLabAccountsResponse) GetData() []*ClientFacingLabAccount { + if g == nil { + return nil + } + return g.Data +} + +func (g *GetTeamLabAccountsResponse) GetExtraProperties() map[string]interface{} { + return g.extraProperties +} + +func (g *GetTeamLabAccountsResponse) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GetTeamLabAccountsResponse) SetData(data []*ClientFacingLabAccount) { + g.Data = data + g.require(getTeamLabAccountsResponseFieldData) +} + +func (g *GetTeamLabAccountsResponse) UnmarshalJSON(data []byte) error { + type unmarshaler GetTeamLabAccountsResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *g = GetTeamLabAccountsResponse(value) + extraProperties, err := internal.ExtractExtraProperties(data, *g) + if err != nil { + return err + } + g.extraProperties = extraProperties + g.rawJSON = json.RawMessage(data) + return nil +} + +func (g *GetTeamLabAccountsResponse) MarshalJSON() ([]byte, error) { + type embed GetTeamLabAccountsResponse + var marshaler = struct { + embed + }{ + embed: embed(*g), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, g.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (g *GetTeamLabAccountsResponse) String() string { + if len(g.rawJSON) > 0 { + if value, err := internal.StringifyJSON(g.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(g); err == nil { + return value + } + return fmt.Sprintf("%#v", g) +} + +// Describes which parts of the lab testing flow are delegated to the customer. +// +// - ORDER_DELEGATED: Ordering using client's physicians, critical result follow up via Junction +// - RESULT_DELEGATED: Ordering using Junction's Physician Network, critical results handled by client +// - FULLY_DELEGATED: Order and critical results handled by client +// - NOT_DELEGATED: Junction handles both ordering and results ℹ️ This enum is non-exhaustive. +type LabAccountDelegatedFlow string + +const ( + LabAccountDelegatedFlowOrderDelegated LabAccountDelegatedFlow = "order_delegated" + LabAccountDelegatedFlowResultDelegated LabAccountDelegatedFlow = "result_delegated" + LabAccountDelegatedFlowFullyDelegated LabAccountDelegatedFlow = "fully_delegated" + LabAccountDelegatedFlowNotDelegated LabAccountDelegatedFlow = "not_delegated" +) + +func NewLabAccountDelegatedFlowFromString(s string) (LabAccountDelegatedFlow, error) { + switch s { + case "order_delegated": + return LabAccountDelegatedFlowOrderDelegated, nil + case "result_delegated": + return LabAccountDelegatedFlowResultDelegated, nil + case "fully_delegated": + return LabAccountDelegatedFlowFullyDelegated, nil + case "not_delegated": + return LabAccountDelegatedFlowNotDelegated, nil + } + var t LabAccountDelegatedFlow + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (l LabAccountDelegatedFlow) Ptr() *LabAccountDelegatedFlow { + return &l +} + +// ℹ️ This enum is non-exhaustive. +type LabAccountStatus string + +const ( + LabAccountStatusActive LabAccountStatus = "active" + LabAccountStatusPending LabAccountStatus = "pending" + LabAccountStatusSuspended LabAccountStatus = "suspended" +) + +func NewLabAccountStatusFromString(s string) (LabAccountStatus, error) { + switch s { + case "active": + return LabAccountStatusActive, nil + case "pending": + return LabAccountStatusPending, nil + case "suspended": + return LabAccountStatusSuspended, nil + } + var t LabAccountStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (l LabAccountStatus) Ptr() *LabAccountStatus { + return &l +} + +// ℹ️ This enum is non-exhaustive. +type UsState string + +const ( + UsStateAl UsState = "AL" + UsStateAk UsState = "AK" + UsStateAz UsState = "AZ" + UsStateAr UsState = "AR" + UsStateCa UsState = "CA" + UsStateCo UsState = "CO" + UsStateCt UsState = "CT" + UsStateDe UsState = "DE" + UsStateFl UsState = "FL" + UsStateGa UsState = "GA" + UsStateHi UsState = "HI" + UsStateId UsState = "ID" + UsStateIl UsState = "IL" + UsStateIn UsState = "IN" + UsStateIa UsState = "IA" + UsStateKs UsState = "KS" + UsStateKy UsState = "KY" + UsStateLa UsState = "LA" + UsStateMe UsState = "ME" + UsStateMd UsState = "MD" + UsStateMa UsState = "MA" + UsStateMi UsState = "MI" + UsStateMn UsState = "MN" + UsStateMs UsState = "MS" + UsStateMo UsState = "MO" + UsStateMt UsState = "MT" + UsStateNe UsState = "NE" + UsStateNv UsState = "NV" + UsStateNh UsState = "NH" + UsStateNj UsState = "NJ" + UsStateNm UsState = "NM" + UsStateNy UsState = "NY" + UsStateNc UsState = "NC" + UsStateNd UsState = "ND" + UsStateOh UsState = "OH" + UsStateOk UsState = "OK" + UsStateOr UsState = "OR" + UsStatePa UsState = "PA" + UsStateRi UsState = "RI" + UsStateSc UsState = "SC" + UsStateSd UsState = "SD" + UsStateTn UsState = "TN" + UsStateTx UsState = "TX" + UsStateUt UsState = "UT" + UsStateVt UsState = "VT" + UsStateVa UsState = "VA" + UsStateWa UsState = "WA" + UsStateWv UsState = "WV" + UsStateWi UsState = "WI" + UsStateWy UsState = "WY" +) + +func NewUsStateFromString(s string) (UsState, error) { + switch s { + case "AL": + return UsStateAl, nil + case "AK": + return UsStateAk, nil + case "AZ": + return UsStateAz, nil + case "AR": + return UsStateAr, nil + case "CA": + return UsStateCa, nil + case "CO": + return UsStateCo, nil + case "CT": + return UsStateCt, nil + case "DE": + return UsStateDe, nil + case "FL": + return UsStateFl, nil + case "GA": + return UsStateGa, nil + case "HI": + return UsStateHi, nil + case "ID": + return UsStateId, nil + case "IL": + return UsStateIl, nil + case "IN": + return UsStateIn, nil + case "IA": + return UsStateIa, nil + case "KS": + return UsStateKs, nil + case "KY": + return UsStateKy, nil + case "LA": + return UsStateLa, nil + case "ME": + return UsStateMe, nil + case "MD": + return UsStateMd, nil + case "MA": + return UsStateMa, nil + case "MI": + return UsStateMi, nil + case "MN": + return UsStateMn, nil + case "MS": + return UsStateMs, nil + case "MO": + return UsStateMo, nil + case "MT": + return UsStateMt, nil + case "NE": + return UsStateNe, nil + case "NV": + return UsStateNv, nil + case "NH": + return UsStateNh, nil + case "NJ": + return UsStateNj, nil + case "NM": + return UsStateNm, nil + case "NY": + return UsStateNy, nil + case "NC": + return UsStateNc, nil + case "ND": + return UsStateNd, nil + case "OH": + return UsStateOh, nil + case "OK": + return UsStateOk, nil + case "OR": + return UsStateOr, nil + case "PA": + return UsStatePa, nil + case "RI": + return UsStateRi, nil + case "SC": + return UsStateSc, nil + case "SD": + return UsStateSd, nil + case "TN": + return UsStateTn, nil + case "TX": + return UsStateTx, nil + case "UT": + return UsStateUt, nil + case "VT": + return UsStateVt, nil + case "VA": + return UsStateVa, nil + case "WA": + return UsStateWa, nil + case "WV": + return UsStateWv, nil + case "WI": + return UsStateWi, nil + case "WY": + return UsStateWy, nil + } + var t UsState + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (u UsState) Ptr() *UsState { + return &u +} diff --git a/lab_report.go b/lab_report.go index f0858c2..bada585 100644 --- a/lab_report.go +++ b/lab_report.go @@ -5,15 +5,15 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" io "io" big "math/big" ) type BodyCreateLabReportParserJob struct { - File io.Reader `json:"-" url:"-"` - UserId string `json:"user_id" url:"-"` - NeedsHumanReview *bool `json:"needs_human_review,omitempty" url:"-"` + File []io.Reader `json:"-" url:"-"` + UserId string `json:"user_id" url:"-"` + NeedsHumanReview *bool `json:"needs_human_review,omitempty" url:"-"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -540,20 +540,20 @@ func (p *ParsedLabReportData) String() string { var ( parsingJobFieldId = big.NewInt(1 << 0) - parsingJobFieldJobId = big.NewInt(1 << 1) - parsingJobFieldStatus = big.NewInt(1 << 2) + parsingJobFieldStatus = big.NewInt(1 << 1) + parsingJobFieldFailureReason = big.NewInt(1 << 2) parsingJobFieldData = big.NewInt(1 << 3) parsingJobFieldNeedsHumanReview = big.NewInt(1 << 4) parsingJobFieldIsReviewed = big.NewInt(1 << 5) ) type ParsingJob struct { - Id string `json:"id" url:"id"` - JobId string `json:"job_id" url:"job_id"` - Status ParsingJobStatus `json:"status" url:"status"` - Data *ParsedLabReportData `json:"data,omitempty" url:"data,omitempty"` - NeedsHumanReview bool `json:"needs_human_review" url:"needs_human_review"` - IsReviewed bool `json:"is_reviewed" url:"is_reviewed"` + Id string `json:"id" url:"id"` + Status ParsingJobStatus `json:"status" url:"status"` + FailureReason *ParsingJobFailureReason `json:"failure_reason,omitempty" url:"failure_reason,omitempty"` + Data *ParsedLabReportData `json:"data,omitempty" url:"data,omitempty"` + NeedsHumanReview bool `json:"needs_human_review" url:"needs_human_review"` + IsReviewed bool `json:"is_reviewed" url:"is_reviewed"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -569,18 +569,18 @@ func (p *ParsingJob) GetId() string { return p.Id } -func (p *ParsingJob) GetJobId() string { +func (p *ParsingJob) GetStatus() ParsingJobStatus { if p == nil { return "" } - return p.JobId + return p.Status } -func (p *ParsingJob) GetStatus() ParsingJobStatus { +func (p *ParsingJob) GetFailureReason() *ParsingJobFailureReason { if p == nil { - return "" + return nil } - return p.Status + return p.FailureReason } func (p *ParsingJob) GetData() *ParsedLabReportData { @@ -622,13 +622,6 @@ func (p *ParsingJob) SetId(id string) { p.require(parsingJobFieldId) } -// SetJobId sets the JobId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (p *ParsingJob) SetJobId(jobId string) { - p.JobId = jobId - p.require(parsingJobFieldJobId) -} - // SetStatus sets the Status field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (p *ParsingJob) SetStatus(status ParsingJobStatus) { @@ -636,6 +629,13 @@ func (p *ParsingJob) SetStatus(status ParsingJobStatus) { p.require(parsingJobFieldStatus) } +// SetFailureReason sets the FailureReason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ParsingJob) SetFailureReason(failureReason *ParsingJobFailureReason) { + p.FailureReason = failureReason + p.require(parsingJobFieldFailureReason) +} + // SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (p *ParsingJob) SetData(data *ParsedLabReportData) { @@ -696,6 +696,32 @@ func (p *ParsingJob) String() string { return fmt.Sprintf("%#v", p) } +// Machine-readable failure reasons for parsing jobs. ℹ️ This enum is non-exhaustive. +type ParsingJobFailureReason string + +const ( + ParsingJobFailureReasonInvalidInput ParsingJobFailureReason = "invalid_input" + ParsingJobFailureReasonLowQuality ParsingJobFailureReason = "low_quality" + ParsingJobFailureReasonNotEnglish ParsingJobFailureReason = "not_english" +) + +func NewParsingJobFailureReasonFromString(s string) (ParsingJobFailureReason, error) { + switch s { + case "invalid_input": + return ParsingJobFailureReasonInvalidInput, nil + case "low_quality": + return ParsingJobFailureReasonLowQuality, nil + case "not_english": + return ParsingJobFailureReasonNotEnglish, nil + } + var t ParsingJobFailureReason + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (p ParsingJobFailureReason) Ptr() *ParsingJobFailureReason { + return &p +} + // ℹ️ This enum is non-exhaustive. type ParsingJobStatus string @@ -729,20 +755,23 @@ var ( resultMetadataFieldPatientFirstName = big.NewInt(1 << 0) resultMetadataFieldPatientLastName = big.NewInt(1 << 1) resultMetadataFieldDob = big.NewInt(1 << 2) - resultMetadataFieldLabName = big.NewInt(1 << 3) - resultMetadataFieldDateReported = big.NewInt(1 << 4) - resultMetadataFieldDateCollected = big.NewInt(1 << 5) - resultMetadataFieldSpecimenNumber = big.NewInt(1 << 6) + resultMetadataFieldGender = big.NewInt(1 << 3) + resultMetadataFieldLabName = big.NewInt(1 << 4) + resultMetadataFieldDateReported = big.NewInt(1 << 5) + resultMetadataFieldDateCollected = big.NewInt(1 << 6) + resultMetadataFieldSpecimenNumber = big.NewInt(1 << 7) ) type ResultMetadata struct { - PatientFirstName string `json:"patient_first_name" url:"patient_first_name"` - PatientLastName string `json:"patient_last_name" url:"patient_last_name"` - Dob string `json:"dob" url:"dob"` - LabName string `json:"lab_name" url:"lab_name"` - DateReported *string `json:"date_reported,omitempty" url:"date_reported,omitempty"` - DateCollected *string `json:"date_collected,omitempty" url:"date_collected,omitempty"` - SpecimenNumber *string `json:"specimen_number,omitempty" url:"specimen_number,omitempty"` + PatientFirstName *string `json:"patient_first_name,omitempty" url:"patient_first_name,omitempty"` + PatientLastName *string `json:"patient_last_name,omitempty" url:"patient_last_name,omitempty"` + Dob *string `json:"dob,omitempty" url:"dob,omitempty"` + // ℹ️ This enum is non-exhaustive. + Gender *ResultMetadataGender `json:"gender,omitempty" url:"gender,omitempty"` + LabName *string `json:"lab_name,omitempty" url:"lab_name,omitempty"` + DateReported *string `json:"date_reported,omitempty" url:"date_reported,omitempty"` + DateCollected *string `json:"date_collected,omitempty" url:"date_collected,omitempty"` + SpecimenNumber *string `json:"specimen_number,omitempty" url:"specimen_number,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -751,30 +780,37 @@ type ResultMetadata struct { rawJSON json.RawMessage } -func (r *ResultMetadata) GetPatientFirstName() string { +func (r *ResultMetadata) GetPatientFirstName() *string { if r == nil { - return "" + return nil } return r.PatientFirstName } -func (r *ResultMetadata) GetPatientLastName() string { +func (r *ResultMetadata) GetPatientLastName() *string { if r == nil { - return "" + return nil } return r.PatientLastName } -func (r *ResultMetadata) GetDob() string { +func (r *ResultMetadata) GetDob() *string { if r == nil { - return "" + return nil } return r.Dob } -func (r *ResultMetadata) GetLabName() string { +func (r *ResultMetadata) GetGender() *ResultMetadataGender { if r == nil { - return "" + return nil + } + return r.Gender +} + +func (r *ResultMetadata) GetLabName() *string { + if r == nil { + return nil } return r.LabName } @@ -813,28 +849,35 @@ func (r *ResultMetadata) require(field *big.Int) { // SetPatientFirstName sets the PatientFirstName field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (r *ResultMetadata) SetPatientFirstName(patientFirstName string) { +func (r *ResultMetadata) SetPatientFirstName(patientFirstName *string) { r.PatientFirstName = patientFirstName r.require(resultMetadataFieldPatientFirstName) } // SetPatientLastName sets the PatientLastName field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (r *ResultMetadata) SetPatientLastName(patientLastName string) { +func (r *ResultMetadata) SetPatientLastName(patientLastName *string) { r.PatientLastName = patientLastName r.require(resultMetadataFieldPatientLastName) } // SetDob sets the Dob field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (r *ResultMetadata) SetDob(dob string) { +func (r *ResultMetadata) SetDob(dob *string) { r.Dob = dob r.require(resultMetadataFieldDob) } +// SetGender sets the Gender field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *ResultMetadata) SetGender(gender *ResultMetadataGender) { + r.Gender = gender + r.require(resultMetadataFieldGender) +} + // SetLabName sets the LabName field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (r *ResultMetadata) SetLabName(labName string) { +func (r *ResultMetadata) SetLabName(labName *string) { r.LabName = labName r.require(resultMetadataFieldLabName) } @@ -898,3 +941,29 @@ func (r *ResultMetadata) String() string { } return fmt.Sprintf("%#v", r) } + +// ℹ️ This enum is non-exhaustive. +type ResultMetadataGender string + +const ( + ResultMetadataGenderMale ResultMetadataGender = "male" + ResultMetadataGenderFemale ResultMetadataGender = "female" + ResultMetadataGenderOther ResultMetadataGender = "other" +) + +func NewResultMetadataGenderFromString(s string) (ResultMetadataGender, error) { + switch s { + case "male": + return ResultMetadataGenderMale, nil + case "female": + return ResultMetadataGenderFemale, nil + case "other": + return ResultMetadataGenderOther, nil + } + var t ResultMetadataGender + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (r ResultMetadataGender) Ptr() *ResultMetadataGender { + return &r +} diff --git a/lab_tests.go b/lab_tests.go index 6b29f22..a5103c8 100644 --- a/lab_tests.go +++ b/lab_tests.go @@ -5,11 +5,61 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) +var ( + labTestsBookPscAppointmentRequestFieldIdempotencyKey = big.NewInt(1 << 0) + labTestsBookPscAppointmentRequestFieldIdempotencyError = big.NewInt(1 << 1) +) + +type LabTestsBookPscAppointmentRequest struct { + // [!] This feature (Idempotency Key) is under closed beta. Idempotency Key support for booking PSC appointment. + IdempotencyKey *string `json:"-" url:"-"` + // If `no-cache`, applies idempotency only to successful outcomes. + IdempotencyError *string `json:"-" url:"-"` + Body *AppointmentBookingRequest `json:"-" url:"-"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` +} + +func (l *LabTestsBookPscAppointmentRequest) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetIdempotencyKey sets the IdempotencyKey field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabTestsBookPscAppointmentRequest) SetIdempotencyKey(idempotencyKey *string) { + l.IdempotencyKey = idempotencyKey + l.require(labTestsBookPscAppointmentRequestFieldIdempotencyKey) +} + +// SetIdempotencyError sets the IdempotencyError field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabTestsBookPscAppointmentRequest) SetIdempotencyError(idempotencyError *string) { + l.IdempotencyError = idempotencyError + l.require(labTestsBookPscAppointmentRequestFieldIdempotencyError) +} + +func (l *LabTestsBookPscAppointmentRequest) UnmarshalJSON(data []byte) error { + body := new(AppointmentBookingRequest) + if err := json.Unmarshal(data, &body); err != nil { + return err + } + l.Body = body + return nil +} + +func (l *LabTestsBookPscAppointmentRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(l.Body) +} + var ( apiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequestFieldCancellationReasonId = big.NewInt(1 << 0) apiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequestFieldNotes = big.NewInt(1 << 1) @@ -44,6 +94,27 @@ func (a *ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelReques a.require(apiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequestFieldNotes) } +func (a *ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest) UnmarshalJSON(data []byte) error { + type unmarshaler ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *a = ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest(body) + return nil +} + +func (a *ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest) MarshalJSON() ([]byte, error) { + type embed ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest + var marshaler = struct { + embed + }{ + embed: embed(*a), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( vitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequestFieldCancellationReasonId = big.NewInt(1 << 0) vitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequestFieldNote = big.NewInt(1 << 1) @@ -78,22 +149,47 @@ func (v *VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest) SetNote(n v.require(vitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequestFieldNote) } +func (v *VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest) UnmarshalJSON(data []byte) error { + type unmarshaler VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *v = VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest(body) + return nil +} + +func (v *VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest) MarshalJSON() ([]byte, error) { + type embed VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest + var marshaler = struct { + embed + }{ + embed: embed(*v), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( - createLabTestRequestFieldMarkerIds = big.NewInt(1 << 0) - createLabTestRequestFieldProviderIds = big.NewInt(1 << 1) - createLabTestRequestFieldName = big.NewInt(1 << 2) - createLabTestRequestFieldMethod = big.NewInt(1 << 3) - createLabTestRequestFieldDescription = big.NewInt(1 << 4) - createLabTestRequestFieldFasting = big.NewInt(1 << 5) + createLabTestRequestFieldMarkerIds = big.NewInt(1 << 0) + createLabTestRequestFieldProviderIds = big.NewInt(1 << 1) + createLabTestRequestFieldName = big.NewInt(1 << 2) + createLabTestRequestFieldMethod = big.NewInt(1 << 3) + createLabTestRequestFieldDescription = big.NewInt(1 << 4) + createLabTestRequestFieldFasting = big.NewInt(1 << 5) + createLabTestRequestFieldLabAccountId = big.NewInt(1 << 6) + createLabTestRequestFieldLabSlug = big.NewInt(1 << 7) ) type CreateLabTestRequest struct { - MarkerIds []int `json:"marker_ids,omitempty" url:"-"` - ProviderIds []string `json:"provider_ids,omitempty" url:"-"` - Name string `json:"name" url:"-"` - Method LabTestCollectionMethod `json:"method" url:"-"` - Description string `json:"description" url:"-"` - Fasting *bool `json:"fasting,omitempty" url:"-"` + MarkerIds []int `json:"marker_ids,omitempty" url:"-"` + ProviderIds []string `json:"provider_ids,omitempty" url:"-"` + Name string `json:"name" url:"-"` + Method LabTestCollectionMethod `json:"method" url:"-"` + Description string `json:"description" url:"-"` + Fasting *bool `json:"fasting,omitempty" url:"-"` + LabAccountId *string `json:"lab_account_id,omitempty" url:"-"` + LabSlug *Labs `json:"lab_slug,omitempty" url:"-"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -148,6 +244,41 @@ func (c *CreateLabTestRequest) SetFasting(fasting *bool) { c.require(createLabTestRequestFieldFasting) } +// SetLabAccountId sets the LabAccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateLabTestRequest) SetLabAccountId(labAccountId *string) { + c.LabAccountId = labAccountId + c.require(createLabTestRequestFieldLabAccountId) +} + +// SetLabSlug sets the LabSlug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateLabTestRequest) SetLabSlug(labSlug *Labs) { + c.LabSlug = labSlug + c.require(createLabTestRequestFieldLabSlug) +} + +func (c *CreateLabTestRequest) UnmarshalJSON(data []byte) error { + type unmarshaler CreateLabTestRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *c = CreateLabTestRequest(body) + return nil +} + +func (c *CreateLabTestRequest) MarshalJSON() ([]byte, error) { + type embed CreateLabTestRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( createOrderRequestCompatibleFieldIdempotencyKey = big.NewInt(1 << 0) createOrderRequestCompatibleFieldIdempotencyError = big.NewInt(1 << 1) @@ -164,10 +295,11 @@ var ( createOrderRequestCompatibleFieldActivateBy = big.NewInt(1 << 12) createOrderRequestCompatibleFieldAoeAnswers = big.NewInt(1 << 13) createOrderRequestCompatibleFieldPassthrough = big.NewInt(1 << 14) - createOrderRequestCompatibleFieldLabAccountId = big.NewInt(1 << 15) - createOrderRequestCompatibleFieldCreatorMemberId = big.NewInt(1 << 16) - createOrderRequestCompatibleFieldPatientDetails = big.NewInt(1 << 17) - createOrderRequestCompatibleFieldPatientAddress = big.NewInt(1 << 18) + createOrderRequestCompatibleFieldClinicalNotes = big.NewInt(1 << 15) + createOrderRequestCompatibleFieldLabAccountId = big.NewInt(1 << 16) + createOrderRequestCompatibleFieldCreatorMemberId = big.NewInt(1 << 17) + createOrderRequestCompatibleFieldPatientDetails = big.NewInt(1 << 18) + createOrderRequestCompatibleFieldPatientAddress = big.NewInt(1 << 19) ) type CreateOrderRequestCompatible struct { @@ -188,10 +320,11 @@ type CreateOrderRequestCompatible struct { ActivateBy *string `json:"activate_by,omitempty" url:"-"` AoeAnswers []*AoEAnswer `json:"aoe_answers,omitempty" url:"-"` Passthrough *string `json:"passthrough,omitempty" url:"-"` + ClinicalNotes *string `json:"clinical_notes,omitempty" url:"-"` LabAccountId *string `json:"lab_account_id,omitempty" url:"-"` CreatorMemberId *string `json:"creator_member_id,omitempty" url:"-"` - PatientDetails *PatientDetailsWithValidation `json:"patient_details,omitempty" url:"-"` - PatientAddress *PatientAddressWithValidation `json:"patient_address,omitempty" url:"-"` + PatientDetails *PatientDetailsWithValidation `json:"patient_details" url:"-"` + PatientAddress *PatientAddressWithValidation `json:"patient_address" url:"-"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -309,6 +442,13 @@ func (c *CreateOrderRequestCompatible) SetPassthrough(passthrough *string) { c.require(createOrderRequestCompatibleFieldPassthrough) } +// SetClinicalNotes sets the ClinicalNotes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *CreateOrderRequestCompatible) SetClinicalNotes(clinicalNotes *string) { + c.ClinicalNotes = clinicalNotes + c.require(createOrderRequestCompatibleFieldClinicalNotes) +} + // SetLabAccountId sets the LabAccountId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (c *CreateOrderRequestCompatible) SetLabAccountId(labAccountId *string) { @@ -337,6 +477,27 @@ func (c *CreateOrderRequestCompatible) SetPatientAddress(patientAddress *Patient c.require(createOrderRequestCompatibleFieldPatientAddress) } +func (c *CreateOrderRequestCompatible) UnmarshalJSON(data []byte) error { + type unmarshaler CreateOrderRequestCompatible + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *c = CreateOrderRequestCompatible(body) + return nil +} + +func (c *CreateOrderRequestCompatible) MarshalJSON() ([]byte, error) { + type embed CreateOrderRequestCompatible + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( labTestsGetRequestFieldGenerationMethod = big.NewInt(1 << 0) labTestsGetRequestFieldLabSlug = big.NewInt(1 << 1) @@ -571,16 +732,19 @@ func (l *LabTestsGetLabelsPdfRequest) SetCollectionDate(collectionDate time.Time var ( labTestsGetMarkersRequestFieldLabId = big.NewInt(1 << 0) - labTestsGetMarkersRequestFieldName = big.NewInt(1 << 1) - labTestsGetMarkersRequestFieldALaCarteEnabled = big.NewInt(1 << 2) - labTestsGetMarkersRequestFieldLabAccountId = big.NewInt(1 << 3) - labTestsGetMarkersRequestFieldPage = big.NewInt(1 << 4) - labTestsGetMarkersRequestFieldSize = big.NewInt(1 << 5) + labTestsGetMarkersRequestFieldLabSlug = big.NewInt(1 << 1) + labTestsGetMarkersRequestFieldName = big.NewInt(1 << 2) + labTestsGetMarkersRequestFieldALaCarteEnabled = big.NewInt(1 << 3) + labTestsGetMarkersRequestFieldLabAccountId = big.NewInt(1 << 4) + labTestsGetMarkersRequestFieldPage = big.NewInt(1 << 5) + labTestsGetMarkersRequestFieldSize = big.NewInt(1 << 6) ) type LabTestsGetMarkersRequest struct { // The identifier Vital assigned to a lab partner. LabId []*int `json:"-" url:"lab_id,omitempty"` + // The slug of the lab for these markers. If both lab_id and lab_slug are provided, lab_slug will be used. + LabSlug *string `json:"-" url:"lab_slug,omitempty"` // The name or test code of an individual biomarker or a panel. Name *string `json:"-" url:"name,omitempty"` ALaCarteEnabled *bool `json:"-" url:"a_la_carte_enabled,omitempty"` @@ -607,6 +771,13 @@ func (l *LabTestsGetMarkersRequest) SetLabId(labId []*int) { l.require(labTestsGetMarkersRequestFieldLabId) } +// SetLabSlug sets the LabSlug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabTestsGetMarkersRequest) SetLabSlug(labSlug *string) { + l.LabSlug = labSlug + l.require(labTestsGetMarkersRequestFieldLabSlug) +} + // SetName sets the Name field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (l *LabTestsGetMarkersRequest) SetName(name *string) { @@ -813,8 +984,9 @@ var ( labTestsGetOrdersRequestFieldPatientName = big.NewInt(1 << 13) labTestsGetOrdersRequestFieldShippingRecipientName = big.NewInt(1 << 14) labTestsGetOrdersRequestFieldOrderIds = big.NewInt(1 << 15) - labTestsGetOrdersRequestFieldPage = big.NewInt(1 << 16) - labTestsGetOrdersRequestFieldSize = big.NewInt(1 << 17) + labTestsGetOrdersRequestFieldOrderTransactionId = big.NewInt(1 << 16) + labTestsGetOrdersRequestFieldPage = big.NewInt(1 << 17) + labTestsGetOrdersRequestFieldSize = big.NewInt(1 << 18) ) type LabTestsGetOrdersRequest struct { @@ -850,8 +1022,10 @@ type LabTestsGetOrdersRequest struct { ShippingRecipientName *string `json:"-" url:"shipping_recipient_name,omitempty"` // Filter by order ids. OrderIds []*string `json:"-" url:"order_ids,omitempty"` - Page *int `json:"-" url:"page,omitempty"` - Size *int `json:"-" url:"size,omitempty"` + // Filter by order transaction ID + OrderTransactionId *string `json:"-" url:"order_transaction_id,omitempty"` + Page *int `json:"-" url:"page,omitempty"` + Size *int `json:"-" url:"size,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -976,6 +1150,13 @@ func (l *LabTestsGetOrdersRequest) SetOrderIds(orderIds []*string) { l.require(labTestsGetOrdersRequestFieldOrderIds) } +// SetOrderTransactionId sets the OrderTransactionId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabTestsGetOrdersRequest) SetOrderTransactionId(orderTransactionId *string) { + l.OrderTransactionId = orderTransactionId + l.require(labTestsGetOrdersRequestFieldOrderTransactionId) +} + // SetPage sets the Page field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (l *LabTestsGetOrdersRequest) SetPage(page *int) { @@ -1153,11 +1334,12 @@ func (l *LabTestsGetPhlebotomyAppointmentAvailabilityRequest) MarshalJSON() ([]b } var ( - labTestsGetPscAppointmentAvailabilityRequestFieldLab = big.NewInt(1 << 0) - labTestsGetPscAppointmentAvailabilityRequestFieldStartDate = big.NewInt(1 << 1) - labTestsGetPscAppointmentAvailabilityRequestFieldSiteCodes = big.NewInt(1 << 2) - labTestsGetPscAppointmentAvailabilityRequestFieldZipCode = big.NewInt(1 << 3) - labTestsGetPscAppointmentAvailabilityRequestFieldRadius = big.NewInt(1 << 4) + labTestsGetPscAppointmentAvailabilityRequestFieldLab = big.NewInt(1 << 0) + labTestsGetPscAppointmentAvailabilityRequestFieldStartDate = big.NewInt(1 << 1) + labTestsGetPscAppointmentAvailabilityRequestFieldSiteCodes = big.NewInt(1 << 2) + labTestsGetPscAppointmentAvailabilityRequestFieldZipCode = big.NewInt(1 << 3) + labTestsGetPscAppointmentAvailabilityRequestFieldRadius = big.NewInt(1 << 4) + labTestsGetPscAppointmentAvailabilityRequestFieldAllowStale = big.NewInt(1 << 5) ) type LabTestsGetPscAppointmentAvailabilityRequest struct { @@ -1171,6 +1353,8 @@ type LabTestsGetPscAppointmentAvailabilityRequest struct { ZipCode *string `json:"-" url:"zip_code,omitempty"` // Radius in which to search. (meters) Radius *AllowedRadius `json:"-" url:"radius,omitempty"` + // If true, allows cached availability data to be returned. + AllowStale *bool `json:"-" url:"allow_stale,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -1218,6 +1402,13 @@ func (l *LabTestsGetPscAppointmentAvailabilityRequest) SetRadius(radius *Allowed l.require(labTestsGetPscAppointmentAvailabilityRequestFieldRadius) } +// SetAllowStale sets the AllowStale field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabTestsGetPscAppointmentAvailabilityRequest) SetAllowStale(allowStale *bool) { + l.AllowStale = allowStale + l.require(labTestsGetPscAppointmentAvailabilityRequestFieldAllowStale) +} + var ( labTestsGetPscInfoRequestFieldZipCode = big.NewInt(1 << 0) labTestsGetPscInfoRequestFieldLabId = big.NewInt(1 << 1) @@ -1299,11 +1490,11 @@ var ( type ImportOrderBody struct { UserId string `json:"user_id" url:"-"` BillingType Billing `json:"billing_type" url:"-"` - OrderSet *OrderSetRequest `json:"order_set,omitempty" url:"-"` + OrderSet *OrderSetRequest `json:"order_set" url:"-"` CollectionMethod LabTestCollectionMethod `json:"collection_method" url:"-"` Physician *PhysicianCreateRequest `json:"physician,omitempty" url:"-"` - PatientDetails *PatientDetailsWithValidation `json:"patient_details,omitempty" url:"-"` - PatientAddress *PatientAddress `json:"patient_address,omitempty" url:"-"` + PatientDetails *PatientDetailsWithValidation `json:"patient_details" url:"-"` + PatientAddress *PatientAddress `json:"patient_address" url:"-"` SampleId string `json:"sample_id" url:"-"` LabAccountId *string `json:"lab_account_id,omitempty" url:"-"` @@ -1381,15 +1572,38 @@ func (i *ImportOrderBody) SetLabAccountId(labAccountId *string) { i.require(importOrderBodyFieldLabAccountId) } +func (i *ImportOrderBody) UnmarshalJSON(data []byte) error { + type unmarshaler ImportOrderBody + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *i = ImportOrderBody(body) + return nil +} + +func (i *ImportOrderBody) MarshalJSON() ([]byte, error) { + type embed ImportOrderBody + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( - requestAppointmentRequestFieldAddress = big.NewInt(1 << 0) - requestAppointmentRequestFieldProvider = big.NewInt(1 << 1) + requestAppointmentRequestFieldAddress = big.NewInt(1 << 0) + requestAppointmentRequestFieldProvider = big.NewInt(1 << 1) + requestAppointmentRequestFieldAppointmentNotes = big.NewInt(1 << 2) ) type RequestAppointmentRequest struct { // At-home phlebotomy appointment address. - Address *UsAddress `json:"address,omitempty" url:"-"` - Provider AppointmentProvider `json:"provider" url:"-"` + Address *UsAddress `json:"address" url:"-"` + Provider AppointmentProvider `json:"provider" url:"-"` + AppointmentNotes *string `json:"appointment_notes,omitempty" url:"-"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -1416,6 +1630,34 @@ func (r *RequestAppointmentRequest) SetProvider(provider AppointmentProvider) { r.require(requestAppointmentRequestFieldProvider) } +// SetAppointmentNotes sets the AppointmentNotes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (r *RequestAppointmentRequest) SetAppointmentNotes(appointmentNotes *string) { + r.AppointmentNotes = appointmentNotes + r.require(requestAppointmentRequestFieldAppointmentNotes) +} + +func (r *RequestAppointmentRequest) UnmarshalJSON(data []byte) error { + type unmarshaler RequestAppointmentRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *r = RequestAppointmentRequest(body) + return nil +} + +func (r *RequestAppointmentRequest) MarshalJSON() ([]byte, error) { + type embed RequestAppointmentRequest + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( labTestsSimulateOrderProcessRequestFieldFinalStatus = big.NewInt(1 << 0) labTestsSimulateOrderProcessRequestFieldDelay = big.NewInt(1 << 1) @@ -1795,11 +2037,22 @@ func (a *AppointmentAvailabilitySlots) String() string { } var ( - appointmentBookingRequestFieldBookingKey = big.NewInt(1 << 0) + appointmentBookingRequestFieldBookingKey = big.NewInt(1 << 0) + appointmentBookingRequestFieldAppointmentNotes = big.NewInt(1 << 1) + appointmentBookingRequestFieldAsyncConfirmation = big.NewInt(1 << 2) + appointmentBookingRequestFieldSyncConfirmationTimeoutMillisecond = big.NewInt(1 << 3) + appointmentBookingRequestFieldAsyncConfirmationTimeoutMillisecond = big.NewInt(1 << 4) ) type AppointmentBookingRequest struct { - BookingKey string `json:"booking_key" url:"booking_key"` + BookingKey string `json:"booking_key" url:"booking_key"` + AppointmentNotes *string `json:"appointment_notes,omitempty" url:"appointment_notes,omitempty"` + // If true, the endpoint attempts to confirm the booking within the `sync_confirmation_timeout_millisecond` window. If confirmation is not received in time, a pending appointment is returned and booking continues asynchronously. If false (default), the endpoint waits for confirmation or returns a 500 error on failure. + AsyncConfirmation *bool `json:"async_confirmation,omitempty" url:"async_confirmation,omitempty"` + // Maximum time (in milliseconds) to wait for booking confirmation before returning a pending appointment. Only applies when `async_confirmation` is true. Defaults to 2500ms. Range: 1000-10000ms. + SyncConfirmationTimeoutMillisecond *int `json:"sync_confirmation_timeout_millisecond,omitempty" url:"sync_confirmation_timeout_millisecond,omitempty"` + // Maximum time (in milliseconds) to attempt asynchronous booking before cancelling the pending appointment. Only applies when `async_confirmation` is true. Defaults to 15 minutes. Range: 60000-172800000ms. + AsyncConfirmationTimeoutMillisecond *int `json:"async_confirmation_timeout_millisecond,omitempty" url:"async_confirmation_timeout_millisecond,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -1815,6 +2068,34 @@ func (a *AppointmentBookingRequest) GetBookingKey() string { return a.BookingKey } +func (a *AppointmentBookingRequest) GetAppointmentNotes() *string { + if a == nil { + return nil + } + return a.AppointmentNotes +} + +func (a *AppointmentBookingRequest) GetAsyncConfirmation() *bool { + if a == nil { + return nil + } + return a.AsyncConfirmation +} + +func (a *AppointmentBookingRequest) GetSyncConfirmationTimeoutMillisecond() *int { + if a == nil { + return nil + } + return a.SyncConfirmationTimeoutMillisecond +} + +func (a *AppointmentBookingRequest) GetAsyncConfirmationTimeoutMillisecond() *int { + if a == nil { + return nil + } + return a.AsyncConfirmationTimeoutMillisecond +} + func (a *AppointmentBookingRequest) GetExtraProperties() map[string]interface{} { return a.extraProperties } @@ -1833,6 +2114,34 @@ func (a *AppointmentBookingRequest) SetBookingKey(bookingKey string) { a.require(appointmentBookingRequestFieldBookingKey) } +// SetAppointmentNotes sets the AppointmentNotes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AppointmentBookingRequest) SetAppointmentNotes(appointmentNotes *string) { + a.AppointmentNotes = appointmentNotes + a.require(appointmentBookingRequestFieldAppointmentNotes) +} + +// SetAsyncConfirmation sets the AsyncConfirmation field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AppointmentBookingRequest) SetAsyncConfirmation(asyncConfirmation *bool) { + a.AsyncConfirmation = asyncConfirmation + a.require(appointmentBookingRequestFieldAsyncConfirmation) +} + +// SetSyncConfirmationTimeoutMillisecond sets the SyncConfirmationTimeoutMillisecond field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AppointmentBookingRequest) SetSyncConfirmationTimeoutMillisecond(syncConfirmationTimeoutMillisecond *int) { + a.SyncConfirmationTimeoutMillisecond = syncConfirmationTimeoutMillisecond + a.require(appointmentBookingRequestFieldSyncConfirmationTimeoutMillisecond) +} + +// SetAsyncConfirmationTimeoutMillisecond sets the AsyncConfirmationTimeoutMillisecond field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AppointmentBookingRequest) SetAsyncConfirmationTimeoutMillisecond(asyncConfirmationTimeoutMillisecond *int) { + a.AsyncConfirmationTimeoutMillisecond = asyncConfirmationTimeoutMillisecond + a.require(appointmentBookingRequestFieldAsyncConfirmationTimeoutMillisecond) +} + func (a *AppointmentBookingRequest) UnmarshalJSON(data []byte) error { type unmarshaler AppointmentBookingRequest var value unmarshaler @@ -2072,6 +2381,7 @@ const ( AppointmentProviderGetlabs AppointmentProvider = "getlabs" AppointmentProviderPhlebfinders AppointmentProvider = "phlebfinders" AppointmentProviderQuest AppointmentProvider = "quest" + AppointmentProviderSonoraQuest AppointmentProvider = "sonora_quest" ) func NewAppointmentProviderFromString(s string) (AppointmentProvider, error) { @@ -2082,6 +2392,8 @@ func NewAppointmentProviderFromString(s string) (AppointmentProvider, error) { return AppointmentProviderPhlebfinders, nil case "quest": return AppointmentProviderQuest, nil + case "sonora_quest": + return AppointmentProviderSonoraQuest, nil } var t AppointmentProvider return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -2092,14 +2404,36 @@ func (a AppointmentProvider) Ptr() *AppointmentProvider { } // ℹ️ This enum is non-exhaustive. -type AppointmentPscLabs = string +type AppointmentPscLabs string + +const ( + AppointmentPscLabsQuest AppointmentPscLabs = "quest" + AppointmentPscLabsSonoraQuest AppointmentPscLabs = "sonora_quest" +) + +func NewAppointmentPscLabsFromString(s string) (AppointmentPscLabs, error) { + switch s { + case "quest": + return AppointmentPscLabsQuest, nil + case "sonora_quest": + return AppointmentPscLabsSonoraQuest, nil + } + var t AppointmentPscLabs + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (a AppointmentPscLabs) Ptr() *AppointmentPscLabs { + return &a +} var ( - appointmentRescheduleRequestFieldBookingKey = big.NewInt(1 << 0) + appointmentRescheduleRequestFieldBookingKey = big.NewInt(1 << 0) + appointmentRescheduleRequestFieldAppointmentNotes = big.NewInt(1 << 1) ) type AppointmentRescheduleRequest struct { - BookingKey string `json:"booking_key" url:"booking_key"` + BookingKey string `json:"booking_key" url:"booking_key"` + AppointmentNotes *string `json:"appointment_notes,omitempty" url:"appointment_notes,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -2115,6 +2449,13 @@ func (a *AppointmentRescheduleRequest) GetBookingKey() string { return a.BookingKey } +func (a *AppointmentRescheduleRequest) GetAppointmentNotes() *string { + if a == nil { + return nil + } + return a.AppointmentNotes +} + func (a *AppointmentRescheduleRequest) GetExtraProperties() map[string]interface{} { return a.extraProperties } @@ -2133,6 +2474,13 @@ func (a *AppointmentRescheduleRequest) SetBookingKey(bookingKey string) { a.require(appointmentRescheduleRequestFieldBookingKey) } +// SetAppointmentNotes sets the AppointmentNotes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AppointmentRescheduleRequest) SetAppointmentNotes(appointmentNotes *string) { + a.AppointmentNotes = appointmentNotes + a.require(appointmentRescheduleRequestFieldAppointmentNotes) +} + func (a *AppointmentRescheduleRequest) UnmarshalJSON(data []byte) error { type unmarshaler AppointmentRescheduleRequest var value unmarshaler @@ -2363,49 +2711,50 @@ func (a *AreaInfo) String() string { return fmt.Sprintf("%#v", a) } -// Represent the schema for an individual biomarker result. var ( - biomarkerResultFieldName = big.NewInt(1 << 0) - biomarkerResultFieldSlug = big.NewInt(1 << 1) - biomarkerResultFieldResult = big.NewInt(1 << 2) - biomarkerResultFieldType = big.NewInt(1 << 3) - biomarkerResultFieldUnit = big.NewInt(1 << 4) - biomarkerResultFieldTimestamp = big.NewInt(1 << 5) - biomarkerResultFieldNotes = big.NewInt(1 << 6) - biomarkerResultFieldReferenceRange = big.NewInt(1 << 7) - biomarkerResultFieldMinRangeValue = big.NewInt(1 << 8) - biomarkerResultFieldMaxRangeValue = big.NewInt(1 << 9) - biomarkerResultFieldIsAboveMaxRange = big.NewInt(1 << 10) - biomarkerResultFieldIsBelowMinRange = big.NewInt(1 << 11) - biomarkerResultFieldInterpretation = big.NewInt(1 << 12) - biomarkerResultFieldLoinc = big.NewInt(1 << 13) - biomarkerResultFieldLoincSlug = big.NewInt(1 << 14) - biomarkerResultFieldProviderId = big.NewInt(1 << 15) - biomarkerResultFieldSourceMarkers = big.NewInt(1 << 16) - biomarkerResultFieldPerformingLaboratory = big.NewInt(1 << 17) - biomarkerResultFieldSourceSampleId = big.NewInt(1 << 18) + clientFacingAppointmentFieldId = big.NewInt(1 << 0) + clientFacingAppointmentFieldUserId = big.NewInt(1 << 1) + clientFacingAppointmentFieldOrderId = big.NewInt(1 << 2) + clientFacingAppointmentFieldOrderTransactionId = big.NewInt(1 << 3) + clientFacingAppointmentFieldAddress = big.NewInt(1 << 4) + clientFacingAppointmentFieldLocation = big.NewInt(1 << 5) + clientFacingAppointmentFieldStartAt = big.NewInt(1 << 6) + clientFacingAppointmentFieldEndAt = big.NewInt(1 << 7) + clientFacingAppointmentFieldIanaTimezone = big.NewInt(1 << 8) + clientFacingAppointmentFieldType = big.NewInt(1 << 9) + clientFacingAppointmentFieldProvider = big.NewInt(1 << 10) + clientFacingAppointmentFieldStatus = big.NewInt(1 << 11) + clientFacingAppointmentFieldProviderId = big.NewInt(1 << 12) + clientFacingAppointmentFieldExternalId = big.NewInt(1 << 13) + clientFacingAppointmentFieldCanReschedule = big.NewInt(1 << 14) + clientFacingAppointmentFieldAppointmentNotes = big.NewInt(1 << 15) + clientFacingAppointmentFieldEventStatus = big.NewInt(1 << 16) + clientFacingAppointmentFieldEventData = big.NewInt(1 << 17) + clientFacingAppointmentFieldEvents = big.NewInt(1 << 18) ) -type BiomarkerResult struct { - Name string `json:"name" url:"name"` - Slug *string `json:"slug,omitempty" url:"slug,omitempty"` - Result string `json:"result" url:"result"` - Type ResultType `json:"type" url:"type"` - Unit *string `json:"unit,omitempty" url:"unit,omitempty"` - Timestamp *time.Time `json:"timestamp,omitempty" url:"timestamp,omitempty"` - Notes *string `json:"notes,omitempty" url:"notes,omitempty"` - ReferenceRange *string `json:"reference_range,omitempty" url:"reference_range,omitempty"` - MinRangeValue *float64 `json:"min_range_value,omitempty" url:"min_range_value,omitempty"` - MaxRangeValue *float64 `json:"max_range_value,omitempty" url:"max_range_value,omitempty"` - IsAboveMaxRange *bool `json:"is_above_max_range,omitempty" url:"is_above_max_range,omitempty"` - IsBelowMinRange *bool `json:"is_below_min_range,omitempty" url:"is_below_min_range,omitempty"` - Interpretation *string `json:"interpretation,omitempty" url:"interpretation,omitempty"` - Loinc *string `json:"loinc,omitempty" url:"loinc,omitempty"` - LoincSlug *string `json:"loinc_slug,omitempty" url:"loinc_slug,omitempty"` - ProviderId *string `json:"provider_id,omitempty" url:"provider_id,omitempty"` - SourceMarkers []*ParentBiomarkerData `json:"source_markers,omitempty" url:"source_markers,omitempty"` - PerformingLaboratory *string `json:"performing_laboratory,omitempty" url:"performing_laboratory,omitempty"` - SourceSampleId *string `json:"source_sample_id,omitempty" url:"source_sample_id,omitempty"` +type ClientFacingAppointment struct { + Id string `json:"id" url:"id"` + UserId string `json:"user_id" url:"user_id"` + OrderId string `json:"order_id" url:"order_id"` + OrderTransactionId *string `json:"order_transaction_id,omitempty" url:"order_transaction_id,omitempty"` + Address *UsAddress `json:"address" url:"address"` + Location *LngLat `json:"location" url:"location"` + // Time is in UTC + StartAt *time.Time `json:"start_at,omitempty" url:"start_at,omitempty"` + // Time is in UTC + EndAt *time.Time `json:"end_at,omitempty" url:"end_at,omitempty"` + IanaTimezone *string `json:"iana_timezone,omitempty" url:"iana_timezone,omitempty"` + Type AppointmentType `json:"type" url:"type"` + Provider AppointmentProvider `json:"provider" url:"provider"` + Status AppointmentStatus `json:"status" url:"status"` + ProviderId string `json:"provider_id" url:"provider_id"` + ExternalId *string `json:"external_id,omitempty" url:"external_id,omitempty"` + CanReschedule bool `json:"can_reschedule" url:"can_reschedule"` + AppointmentNotes *string `json:"appointment_notes,omitempty" url:"appointment_notes,omitempty"` + EventStatus AppointmentEventStatus `json:"event_status" url:"event_status"` + EventData map[string]interface{} `json:"event_data,omitempty" url:"event_data,omitempty"` + Events []*ClientFacingAppointmentEvent `json:"events" url:"events"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -2414,474 +2763,116 @@ type BiomarkerResult struct { rawJSON json.RawMessage } -func (b *BiomarkerResult) GetName() string { - if b == nil { +func (c *ClientFacingAppointment) GetId() string { + if c == nil { return "" } - return b.Name -} - -func (b *BiomarkerResult) GetSlug() *string { - if b == nil { - return nil - } - return b.Slug + return c.Id } -func (b *BiomarkerResult) GetResult() string { - if b == nil { +func (c *ClientFacingAppointment) GetUserId() string { + if c == nil { return "" } - return b.Result + return c.UserId } -func (b *BiomarkerResult) GetType() ResultType { - if b == nil { +func (c *ClientFacingAppointment) GetOrderId() string { + if c == nil { return "" } - return b.Type + return c.OrderId } -func (b *BiomarkerResult) GetUnit() *string { - if b == nil { +func (c *ClientFacingAppointment) GetOrderTransactionId() *string { + if c == nil { return nil } - return b.Unit + return c.OrderTransactionId } -func (b *BiomarkerResult) GetTimestamp() *time.Time { - if b == nil { +func (c *ClientFacingAppointment) GetAddress() *UsAddress { + if c == nil { return nil } - return b.Timestamp + return c.Address } -func (b *BiomarkerResult) GetNotes() *string { - if b == nil { +func (c *ClientFacingAppointment) GetLocation() *LngLat { + if c == nil { return nil } - return b.Notes + return c.Location } -func (b *BiomarkerResult) GetReferenceRange() *string { - if b == nil { +func (c *ClientFacingAppointment) GetStartAt() *time.Time { + if c == nil { return nil } - return b.ReferenceRange + return c.StartAt } -func (b *BiomarkerResult) GetMinRangeValue() *float64 { - if b == nil { +func (c *ClientFacingAppointment) GetEndAt() *time.Time { + if c == nil { return nil } - return b.MinRangeValue + return c.EndAt } -func (b *BiomarkerResult) GetMaxRangeValue() *float64 { - if b == nil { +func (c *ClientFacingAppointment) GetIanaTimezone() *string { + if c == nil { return nil } - return b.MaxRangeValue + return c.IanaTimezone } -func (b *BiomarkerResult) GetIsAboveMaxRange() *bool { - if b == nil { - return nil +func (c *ClientFacingAppointment) GetType() AppointmentType { + if c == nil { + return "" } - return b.IsAboveMaxRange + return c.Type } -func (b *BiomarkerResult) GetIsBelowMinRange() *bool { - if b == nil { - return nil +func (c *ClientFacingAppointment) GetProvider() AppointmentProvider { + if c == nil { + return "" } - return b.IsBelowMinRange + return c.Provider } -func (b *BiomarkerResult) GetInterpretation() *string { - if b == nil { - return nil +func (c *ClientFacingAppointment) GetStatus() AppointmentStatus { + if c == nil { + return "" } - return b.Interpretation + return c.Status } -func (b *BiomarkerResult) GetLoinc() *string { - if b == nil { - return nil +func (c *ClientFacingAppointment) GetProviderId() string { + if c == nil { + return "" } - return b.Loinc + return c.ProviderId } -func (b *BiomarkerResult) GetLoincSlug() *string { - if b == nil { +func (c *ClientFacingAppointment) GetExternalId() *string { + if c == nil { return nil } - return b.LoincSlug + return c.ExternalId } -func (b *BiomarkerResult) GetProviderId() *string { - if b == nil { - return nil - } - return b.ProviderId -} - -func (b *BiomarkerResult) GetSourceMarkers() []*ParentBiomarkerData { - if b == nil { - return nil - } - return b.SourceMarkers -} - -func (b *BiomarkerResult) GetPerformingLaboratory() *string { - if b == nil { - return nil - } - return b.PerformingLaboratory -} - -func (b *BiomarkerResult) GetSourceSampleId() *string { - if b == nil { - return nil - } - return b.SourceSampleId -} - -func (b *BiomarkerResult) GetExtraProperties() map[string]interface{} { - return b.extraProperties -} - -func (b *BiomarkerResult) require(field *big.Int) { - if b.explicitFields == nil { - b.explicitFields = big.NewInt(0) - } - b.explicitFields.Or(b.explicitFields, field) -} - -// SetName sets the Name field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetName(name string) { - b.Name = name - b.require(biomarkerResultFieldName) -} - -// SetSlug sets the Slug field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetSlug(slug *string) { - b.Slug = slug - b.require(biomarkerResultFieldSlug) -} - -// SetResult sets the Result field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetResult(result string) { - b.Result = result - b.require(biomarkerResultFieldResult) -} - -// SetType sets the Type field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetType(type_ ResultType) { - b.Type = type_ - b.require(biomarkerResultFieldType) -} - -// SetUnit sets the Unit field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetUnit(unit *string) { - b.Unit = unit - b.require(biomarkerResultFieldUnit) -} - -// SetTimestamp sets the Timestamp field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetTimestamp(timestamp *time.Time) { - b.Timestamp = timestamp - b.require(biomarkerResultFieldTimestamp) -} - -// SetNotes sets the Notes field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetNotes(notes *string) { - b.Notes = notes - b.require(biomarkerResultFieldNotes) -} - -// SetReferenceRange sets the ReferenceRange field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetReferenceRange(referenceRange *string) { - b.ReferenceRange = referenceRange - b.require(biomarkerResultFieldReferenceRange) -} - -// SetMinRangeValue sets the MinRangeValue field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetMinRangeValue(minRangeValue *float64) { - b.MinRangeValue = minRangeValue - b.require(biomarkerResultFieldMinRangeValue) -} - -// SetMaxRangeValue sets the MaxRangeValue field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetMaxRangeValue(maxRangeValue *float64) { - b.MaxRangeValue = maxRangeValue - b.require(biomarkerResultFieldMaxRangeValue) -} - -// SetIsAboveMaxRange sets the IsAboveMaxRange field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetIsAboveMaxRange(isAboveMaxRange *bool) { - b.IsAboveMaxRange = isAboveMaxRange - b.require(biomarkerResultFieldIsAboveMaxRange) -} - -// SetIsBelowMinRange sets the IsBelowMinRange field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetIsBelowMinRange(isBelowMinRange *bool) { - b.IsBelowMinRange = isBelowMinRange - b.require(biomarkerResultFieldIsBelowMinRange) -} - -// SetInterpretation sets the Interpretation field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetInterpretation(interpretation *string) { - b.Interpretation = interpretation - b.require(biomarkerResultFieldInterpretation) -} - -// SetLoinc sets the Loinc field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetLoinc(loinc *string) { - b.Loinc = loinc - b.require(biomarkerResultFieldLoinc) -} - -// SetLoincSlug sets the LoincSlug field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetLoincSlug(loincSlug *string) { - b.LoincSlug = loincSlug - b.require(biomarkerResultFieldLoincSlug) -} - -// SetProviderId sets the ProviderId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetProviderId(providerId *string) { - b.ProviderId = providerId - b.require(biomarkerResultFieldProviderId) -} - -// SetSourceMarkers sets the SourceMarkers field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetSourceMarkers(sourceMarkers []*ParentBiomarkerData) { - b.SourceMarkers = sourceMarkers - b.require(biomarkerResultFieldSourceMarkers) -} - -// SetPerformingLaboratory sets the PerformingLaboratory field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetPerformingLaboratory(performingLaboratory *string) { - b.PerformingLaboratory = performingLaboratory - b.require(biomarkerResultFieldPerformingLaboratory) -} - -// SetSourceSampleId sets the SourceSampleId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (b *BiomarkerResult) SetSourceSampleId(sourceSampleId *string) { - b.SourceSampleId = sourceSampleId - b.require(biomarkerResultFieldSourceSampleId) -} - -func (b *BiomarkerResult) UnmarshalJSON(data []byte) error { - type embed BiomarkerResult - var unmarshaler = struct { - embed - Timestamp *internal.DateTime `json:"timestamp,omitempty"` - }{ - embed: embed(*b), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *b = BiomarkerResult(unmarshaler.embed) - b.Timestamp = unmarshaler.Timestamp.TimePtr() - extraProperties, err := internal.ExtractExtraProperties(data, *b) - if err != nil { - return err - } - b.extraProperties = extraProperties - b.rawJSON = json.RawMessage(data) - return nil -} - -func (b *BiomarkerResult) MarshalJSON() ([]byte, error) { - type embed BiomarkerResult - var marshaler = struct { - embed - Timestamp *internal.DateTime `json:"timestamp,omitempty"` - }{ - embed: embed(*b), - Timestamp: internal.NewOptionalDateTime(b.Timestamp), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (b *BiomarkerResult) String() string { - if len(b.rawJSON) > 0 { - if value, err := internal.StringifyJSON(b.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(b); err == nil { - return value - } - return fmt.Sprintf("%#v", b) -} - -var ( - clientFacingAppointmentFieldId = big.NewInt(1 << 0) - clientFacingAppointmentFieldUserId = big.NewInt(1 << 1) - clientFacingAppointmentFieldOrderId = big.NewInt(1 << 2) - clientFacingAppointmentFieldAddress = big.NewInt(1 << 3) - clientFacingAppointmentFieldLocation = big.NewInt(1 << 4) - clientFacingAppointmentFieldStartAt = big.NewInt(1 << 5) - clientFacingAppointmentFieldEndAt = big.NewInt(1 << 6) - clientFacingAppointmentFieldIanaTimezone = big.NewInt(1 << 7) - clientFacingAppointmentFieldType = big.NewInt(1 << 8) - clientFacingAppointmentFieldProvider = big.NewInt(1 << 9) - clientFacingAppointmentFieldStatus = big.NewInt(1 << 10) - clientFacingAppointmentFieldProviderId = big.NewInt(1 << 11) - clientFacingAppointmentFieldExternalId = big.NewInt(1 << 12) - clientFacingAppointmentFieldCanReschedule = big.NewInt(1 << 13) - clientFacingAppointmentFieldEventStatus = big.NewInt(1 << 14) - clientFacingAppointmentFieldEventData = big.NewInt(1 << 15) - clientFacingAppointmentFieldEvents = big.NewInt(1 << 16) -) - -type ClientFacingAppointment struct { - Id string `json:"id" url:"id"` - UserId string `json:"user_id" url:"user_id"` - OrderId string `json:"order_id" url:"order_id"` - Address *UsAddress `json:"address" url:"address"` - Location *LngLat `json:"location" url:"location"` - // Time is in UTC - StartAt *time.Time `json:"start_at,omitempty" url:"start_at,omitempty"` - // Time is in UTC - EndAt *time.Time `json:"end_at,omitempty" url:"end_at,omitempty"` - IanaTimezone *string `json:"iana_timezone,omitempty" url:"iana_timezone,omitempty"` - Type AppointmentType `json:"type" url:"type"` - Provider AppointmentProvider `json:"provider" url:"provider"` - Status AppointmentStatus `json:"status" url:"status"` - ProviderId string `json:"provider_id" url:"provider_id"` - ExternalId *string `json:"external_id,omitempty" url:"external_id,omitempty"` - CanReschedule bool `json:"can_reschedule" url:"can_reschedule"` - EventStatus AppointmentEventStatus `json:"event_status" url:"event_status"` - EventData map[string]interface{} `json:"event_data,omitempty" url:"event_data,omitempty"` - Events []*ClientFacingAppointmentEvent `json:"events" url:"events"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (c *ClientFacingAppointment) GetId() string { - if c == nil { - return "" - } - return c.Id -} - -func (c *ClientFacingAppointment) GetUserId() string { - if c == nil { - return "" - } - return c.UserId -} - -func (c *ClientFacingAppointment) GetOrderId() string { - if c == nil { - return "" - } - return c.OrderId -} - -func (c *ClientFacingAppointment) GetAddress() *UsAddress { - if c == nil { - return nil - } - return c.Address -} - -func (c *ClientFacingAppointment) GetLocation() *LngLat { - if c == nil { - return nil - } - return c.Location -} - -func (c *ClientFacingAppointment) GetStartAt() *time.Time { - if c == nil { - return nil - } - return c.StartAt -} - -func (c *ClientFacingAppointment) GetEndAt() *time.Time { - if c == nil { - return nil - } - return c.EndAt -} - -func (c *ClientFacingAppointment) GetIanaTimezone() *string { - if c == nil { - return nil - } - return c.IanaTimezone -} - -func (c *ClientFacingAppointment) GetType() AppointmentType { - if c == nil { - return "" - } - return c.Type -} - -func (c *ClientFacingAppointment) GetProvider() AppointmentProvider { - if c == nil { - return "" - } - return c.Provider -} - -func (c *ClientFacingAppointment) GetStatus() AppointmentStatus { - if c == nil { - return "" - } - return c.Status -} - -func (c *ClientFacingAppointment) GetProviderId() string { +func (c *ClientFacingAppointment) GetCanReschedule() bool { if c == nil { - return "" + return false } - return c.ProviderId + return c.CanReschedule } -func (c *ClientFacingAppointment) GetExternalId() *string { +func (c *ClientFacingAppointment) GetAppointmentNotes() *string { if c == nil { return nil } - return c.ExternalId -} - -func (c *ClientFacingAppointment) GetCanReschedule() bool { - if c == nil { - return false - } - return c.CanReschedule + return c.AppointmentNotes } func (c *ClientFacingAppointment) GetEventStatus() AppointmentEventStatus { @@ -2937,6 +2928,13 @@ func (c *ClientFacingAppointment) SetOrderId(orderId string) { c.require(clientFacingAppointmentFieldOrderId) } +// SetOrderTransactionId sets the OrderTransactionId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingAppointment) SetOrderTransactionId(orderTransactionId *string) { + c.OrderTransactionId = orderTransactionId + c.require(clientFacingAppointmentFieldOrderTransactionId) +} + // SetAddress sets the Address field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (c *ClientFacingAppointment) SetAddress(address *UsAddress) { @@ -3014,6 +3012,13 @@ func (c *ClientFacingAppointment) SetCanReschedule(canReschedule bool) { c.require(clientFacingAppointmentFieldCanReschedule) } +// SetAppointmentNotes sets the AppointmentNotes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingAppointment) SetAppointmentNotes(appointmentNotes *string) { + c.AppointmentNotes = appointmentNotes + c.require(clientFacingAppointmentFieldAppointmentNotes) +} + // SetEventStatus sets the EventStatus field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (c *ClientFacingAppointment) SetEventStatus(eventStatus AppointmentEventStatus) { @@ -3479,6 +3484,7 @@ const ( ClientFacingLabsQuest ClientFacingLabs = "quest" ClientFacingLabsLabcorp ClientFacingLabs = "labcorp" ClientFacingLabsBioreference ClientFacingLabs = "bioreference" + ClientFacingLabsSonoraQuest ClientFacingLabs = "sonora_quest" ) func NewClientFacingLabsFromString(s string) (ClientFacingLabs, error) { @@ -3489,6 +3495,8 @@ func NewClientFacingLabsFromString(s string) (ClientFacingLabs, error) { return ClientFacingLabsLabcorp, nil case "bioreference": return ClientFacingLabsBioreference, nil + case "sonora_quest": + return ClientFacingLabsSonoraQuest, nil } var t ClientFacingLabs return "", fmt.Errorf("%s is not a valid %T", s, t) @@ -4117,17 +4125,15 @@ func (c *ClientFacingResult) String() string { } var ( - clinicalInformationFieldFasting = big.NewInt(1 << 0) - clinicalInformationFieldNotes = big.NewInt(1 << 1) - clinicalInformationFieldInformation = big.NewInt(1 << 2) - clinicalInformationFieldTotalVolume = big.NewInt(1 << 3) + daySlotsFieldLocation = big.NewInt(1 << 0) + daySlotsFieldDate = big.NewInt(1 << 1) + daySlotsFieldSlots = big.NewInt(1 << 2) ) -type ClinicalInformation struct { - Fasting *bool `json:"fasting,omitempty" url:"fasting,omitempty"` - Notes *string `json:"notes,omitempty" url:"notes,omitempty"` - Information *string `json:"information,omitempty" url:"information,omitempty"` - TotalVolume *string `json:"total_volume,omitempty" url:"total_volume,omitempty"` +type DaySlots struct { + Location *AppointmentLocation `json:"location,omitempty" url:"location,omitempty"` + Date string `json:"date" url:"date"` + Slots []*TimeSlot `json:"slots" url:"slots"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -4136,153 +4142,29 @@ type ClinicalInformation struct { rawJSON json.RawMessage } -func (c *ClinicalInformation) GetFasting() *bool { - if c == nil { - return nil - } - return c.Fasting -} - -func (c *ClinicalInformation) GetNotes() *string { - if c == nil { +func (d *DaySlots) GetLocation() *AppointmentLocation { + if d == nil { return nil } - return c.Notes + return d.Location } -func (c *ClinicalInformation) GetInformation() *string { - if c == nil { - return nil +func (d *DaySlots) GetDate() string { + if d == nil { + return "" } - return c.Information + return d.Date } -func (c *ClinicalInformation) GetTotalVolume() *string { - if c == nil { +func (d *DaySlots) GetSlots() []*TimeSlot { + if d == nil { return nil } - return c.TotalVolume + return d.Slots } -func (c *ClinicalInformation) GetExtraProperties() map[string]interface{} { - return c.extraProperties -} - -func (c *ClinicalInformation) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) - } - c.explicitFields.Or(c.explicitFields, field) -} - -// SetFasting sets the Fasting field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClinicalInformation) SetFasting(fasting *bool) { - c.Fasting = fasting - c.require(clinicalInformationFieldFasting) -} - -// SetNotes sets the Notes field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClinicalInformation) SetNotes(notes *string) { - c.Notes = notes - c.require(clinicalInformationFieldNotes) -} - -// SetInformation sets the Information field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClinicalInformation) SetInformation(information *string) { - c.Information = information - c.require(clinicalInformationFieldInformation) -} - -// SetTotalVolume sets the TotalVolume field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClinicalInformation) SetTotalVolume(totalVolume *string) { - c.TotalVolume = totalVolume - c.require(clinicalInformationFieldTotalVolume) -} - -func (c *ClinicalInformation) UnmarshalJSON(data []byte) error { - type unmarshaler ClinicalInformation - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = ClinicalInformation(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) - if err != nil { - return err - } - c.extraProperties = extraProperties - c.rawJSON = json.RawMessage(data) - return nil -} - -func (c *ClinicalInformation) MarshalJSON() ([]byte, error) { - type embed ClinicalInformation - var marshaler = struct { - embed - }{ - embed: embed(*c), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (c *ClinicalInformation) String() string { - if len(c.rawJSON) > 0 { - if value, err := internal.StringifyJSON(c.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(c); err == nil { - return value - } - return fmt.Sprintf("%#v", c) -} - -var ( - daySlotsFieldLocation = big.NewInt(1 << 0) - daySlotsFieldDate = big.NewInt(1 << 1) - daySlotsFieldSlots = big.NewInt(1 << 2) -) - -type DaySlots struct { - Location *AppointmentLocation `json:"location,omitempty" url:"location,omitempty"` - Date string `json:"date" url:"date"` - Slots []*TimeSlot `json:"slots" url:"slots"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (d *DaySlots) GetLocation() *AppointmentLocation { - if d == nil { - return nil - } - return d.Location -} - -func (d *DaySlots) GetDate() string { - if d == nil { - return "" - } - return d.Date -} - -func (d *DaySlots) GetSlots() []*TimeSlot { - if d == nil { - return nil - } - return d.Slots -} - -func (d *DaySlots) GetExtraProperties() map[string]interface{} { - return d.extraProperties +func (d *DaySlots) GetExtraProperties() map[string]interface{} { + return d.extraProperties } func (d *DaySlots) require(field *big.Int) { @@ -4352,56 +4234,6 @@ func (d *DaySlots) String() string { return fmt.Sprintf("%#v", d) } -// ℹ️ This enum is non-exhaustive. -type FailureType string - -const ( - FailureTypeQuantityNotSufficientFailure FailureType = "quantity_not_sufficient_failure" - FailureTypeCollectionProcessFailure FailureType = "collection_process_failure" - FailureTypeDropOffFailure FailureType = "drop_off_failure" - FailureTypeInternalLabFailure FailureType = "internal_lab_failure" - FailureTypeOrderEntryFailure FailureType = "order_entry_failure" - FailureTypeNonFailure FailureType = "non_failure" - FailureTypeUnknownFailure FailureType = "unknown_failure" - FailureTypePatientConditionFailure FailureType = "patient_condition_failure" - FailureTypeMissingResultCalcFailure FailureType = "missing_result_calc_failure" - FailureTypeMissingDemoAoeCalcFailure FailureType = "missing_demo_aoe_calc_failure" - FailureTypeInsufficientVolume FailureType = "insufficient_volume" -) - -func NewFailureTypeFromString(s string) (FailureType, error) { - switch s { - case "quantity_not_sufficient_failure": - return FailureTypeQuantityNotSufficientFailure, nil - case "collection_process_failure": - return FailureTypeCollectionProcessFailure, nil - case "drop_off_failure": - return FailureTypeDropOffFailure, nil - case "internal_lab_failure": - return FailureTypeInternalLabFailure, nil - case "order_entry_failure": - return FailureTypeOrderEntryFailure, nil - case "non_failure": - return FailureTypeNonFailure, nil - case "unknown_failure": - return FailureTypeUnknownFailure, nil - case "patient_condition_failure": - return FailureTypePatientConditionFailure, nil - case "missing_result_calc_failure": - return FailureTypeMissingResultCalcFailure, nil - case "missing_demo_aoe_calc_failure": - return FailureTypeMissingDemoAoeCalcFailure, nil - case "insufficient_volume": - return FailureTypeInsufficientVolume, nil - } - var t FailureType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (f FailureType) Ptr() *FailureType { - return &f -} - var ( getMarkersResponseFieldMarkers = big.NewInt(1 << 0) getMarkersResponseFieldTotal = big.NewInt(1 << 1) @@ -5122,38 +4954,41 @@ func (l *LabLocationMetadata) String() string { return fmt.Sprintf("%#v", l) } +// ℹ️ This enum is non-exhaustive. +type LabTestGenerationMethodFilter string + +const ( + LabTestGenerationMethodFilterAuto LabTestGenerationMethodFilter = "auto" + LabTestGenerationMethodFilterManual LabTestGenerationMethodFilter = "manual" + LabTestGenerationMethodFilterAll LabTestGenerationMethodFilter = "all" +) + +func NewLabTestGenerationMethodFilterFromString(s string) (LabTestGenerationMethodFilter, error) { + switch s { + case "auto": + return LabTestGenerationMethodFilterAuto, nil + case "manual": + return LabTestGenerationMethodFilterManual, nil + case "all": + return LabTestGenerationMethodFilterAll, nil + } + var t LabTestGenerationMethodFilter + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (l LabTestGenerationMethodFilter) Ptr() *LabTestGenerationMethodFilter { + return &l +} + var ( - labResultsMetadataFieldAge = big.NewInt(1 << 0) - labResultsMetadataFieldDob = big.NewInt(1 << 1) - labResultsMetadataFieldClia = big.NewInt(1 << 2) - labResultsMetadataFieldPatient = big.NewInt(1 << 3) - labResultsMetadataFieldProvider = big.NewInt(1 << 4) - labResultsMetadataFieldLaboratory = big.NewInt(1 << 5) - labResultsMetadataFieldDateReported = big.NewInt(1 << 6) - labResultsMetadataFieldDateCollected = big.NewInt(1 << 7) - labResultsMetadataFieldSpecimenNumber = big.NewInt(1 << 8) - labResultsMetadataFieldDateReceived = big.NewInt(1 << 9) - labResultsMetadataFieldStatus = big.NewInt(1 << 10) - labResultsMetadataFieldInterpretation = big.NewInt(1 << 11) - labResultsMetadataFieldPatientId = big.NewInt(1 << 12) - labResultsMetadataFieldAccountId = big.NewInt(1 << 13) + labTestResourcesResponseFieldData = big.NewInt(1 << 0) + labTestResourcesResponseFieldNextCursor = big.NewInt(1 << 1) ) -type LabResultsMetadata struct { - Age string `json:"age" url:"age"` - Dob string `json:"dob" url:"dob"` - Clia *string `json:"clia_#,omitempty" url:"clia_#,omitempty"` - Patient string `json:"patient" url:"patient"` - Provider *string `json:"provider,omitempty" url:"provider,omitempty"` - Laboratory *string `json:"laboratory,omitempty" url:"laboratory,omitempty"` - DateReported string `json:"date_reported" url:"date_reported"` - DateCollected *string `json:"date_collected,omitempty" url:"date_collected,omitempty"` - SpecimenNumber string `json:"specimen_number" url:"specimen_number"` - DateReceived *string `json:"date_received,omitempty" url:"date_received,omitempty"` - Status *string `json:"status,omitempty" url:"status,omitempty"` - Interpretation *string `json:"interpretation,omitempty" url:"interpretation,omitempty"` - PatientId *string `json:"patient_id,omitempty" url:"patient_id,omitempty"` - AccountId *string `json:"account_id,omitempty" url:"account_id,omitempty"` +type LabTestResourcesResponse struct { + Data []*ClientFacingLabTest `json:"data" url:"data"` + // The cursor for fetching the next page, or `null` to fetch the first page. + NextCursor *string `json:"next_cursor,omitempty" url:"next_cursor,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -5162,843 +4997,176 @@ type LabResultsMetadata struct { rawJSON json.RawMessage } -func (l *LabResultsMetadata) GetAge() string { - if l == nil { - return "" - } - return l.Age -} - -func (l *LabResultsMetadata) GetDob() string { +func (l *LabTestResourcesResponse) GetData() []*ClientFacingLabTest { if l == nil { - return "" + return nil } - return l.Dob + return l.Data } -func (l *LabResultsMetadata) GetClia() *string { +func (l *LabTestResourcesResponse) GetNextCursor() *string { if l == nil { return nil } - return l.Clia + return l.NextCursor } -func (l *LabResultsMetadata) GetPatient() string { - if l == nil { - return "" - } - return l.Patient +func (l *LabTestResourcesResponse) GetExtraProperties() map[string]interface{} { + return l.extraProperties } -func (l *LabResultsMetadata) GetProvider() *string { - if l == nil { - return nil +func (l *LabTestResourcesResponse) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) } - return l.Provider + l.explicitFields.Or(l.explicitFields, field) } -func (l *LabResultsMetadata) GetLaboratory() *string { - if l == nil { - return nil - } - return l.Laboratory +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabTestResourcesResponse) SetData(data []*ClientFacingLabTest) { + l.Data = data + l.require(labTestResourcesResponseFieldData) } -func (l *LabResultsMetadata) GetDateReported() string { - if l == nil { - return "" - } - return l.DateReported +// SetNextCursor sets the NextCursor field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabTestResourcesResponse) SetNextCursor(nextCursor *string) { + l.NextCursor = nextCursor + l.require(labTestResourcesResponseFieldNextCursor) } -func (l *LabResultsMetadata) GetDateCollected() *string { - if l == nil { - return nil +func (l *LabTestResourcesResponse) UnmarshalJSON(data []byte) error { + type unmarshaler LabTestResourcesResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err } - return l.DateCollected -} - -func (l *LabResultsMetadata) GetSpecimenNumber() string { - if l == nil { - return "" + *l = LabTestResourcesResponse(value) + extraProperties, err := internal.ExtractExtraProperties(data, *l) + if err != nil { + return err } - return l.SpecimenNumber + l.extraProperties = extraProperties + l.rawJSON = json.RawMessage(data) + return nil } -func (l *LabResultsMetadata) GetDateReceived() *string { - if l == nil { - return nil +func (l *LabTestResourcesResponse) MarshalJSON() ([]byte, error) { + type embed LabTestResourcesResponse + var marshaler = struct { + embed + }{ + embed: embed(*l), } - return l.DateReceived + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) } -func (l *LabResultsMetadata) GetStatus() *string { - if l == nil { - return nil +func (l *LabTestResourcesResponse) String() string { + if len(l.rawJSON) > 0 { + if value, err := internal.StringifyJSON(l.rawJSON); err == nil { + return value + } } - return l.Status + if value, err := internal.StringifyJSON(l); err == nil { + return value + } + return fmt.Sprintf("%#v", l) } -func (l *LabResultsMetadata) GetInterpretation() *string { - if l == nil { - return nil - } - return l.Interpretation +var ( + lngLatFieldLng = big.NewInt(1 << 0) + lngLatFieldLat = big.NewInt(1 << 1) +) + +type LngLat struct { + Lng float64 `json:"lng" url:"lng"` + Lat float64 `json:"lat" url:"lat"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage } -func (l *LabResultsMetadata) GetPatientId() *string { +func (l *LngLat) GetLng() float64 { if l == nil { - return nil + return 0 } - return l.PatientId + return l.Lng } -func (l *LabResultsMetadata) GetAccountId() *string { +func (l *LngLat) GetLat() float64 { if l == nil { - return nil + return 0 } - return l.AccountId + return l.Lat } -func (l *LabResultsMetadata) GetExtraProperties() map[string]interface{} { +func (l *LngLat) GetExtraProperties() map[string]interface{} { return l.extraProperties } -func (l *LabResultsMetadata) require(field *big.Int) { +func (l *LngLat) require(field *big.Int) { if l.explicitFields == nil { l.explicitFields = big.NewInt(0) } l.explicitFields.Or(l.explicitFields, field) } -// SetAge sets the Age field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetAge(age string) { - l.Age = age - l.require(labResultsMetadataFieldAge) -} - -// SetDob sets the Dob field and marks it as non-optional; +// SetLng sets the Lng field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetDob(dob string) { - l.Dob = dob - l.require(labResultsMetadataFieldDob) +func (l *LngLat) SetLng(lng float64) { + l.Lng = lng + l.require(lngLatFieldLng) } -// SetClia sets the Clia field and marks it as non-optional; +// SetLat sets the Lat field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetClia(clia *string) { - l.Clia = clia - l.require(labResultsMetadataFieldClia) +func (l *LngLat) SetLat(lat float64) { + l.Lat = lat + l.require(lngLatFieldLat) } -// SetPatient sets the Patient field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetPatient(patient string) { - l.Patient = patient - l.require(labResultsMetadataFieldPatient) -} - -// SetProvider sets the Provider field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetProvider(provider *string) { - l.Provider = provider - l.require(labResultsMetadataFieldProvider) -} - -// SetLaboratory sets the Laboratory field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetLaboratory(laboratory *string) { - l.Laboratory = laboratory - l.require(labResultsMetadataFieldLaboratory) -} - -// SetDateReported sets the DateReported field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetDateReported(dateReported string) { - l.DateReported = dateReported - l.require(labResultsMetadataFieldDateReported) -} - -// SetDateCollected sets the DateCollected field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetDateCollected(dateCollected *string) { - l.DateCollected = dateCollected - l.require(labResultsMetadataFieldDateCollected) -} - -// SetSpecimenNumber sets the SpecimenNumber field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetSpecimenNumber(specimenNumber string) { - l.SpecimenNumber = specimenNumber - l.require(labResultsMetadataFieldSpecimenNumber) -} - -// SetDateReceived sets the DateReceived field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetDateReceived(dateReceived *string) { - l.DateReceived = dateReceived - l.require(labResultsMetadataFieldDateReceived) -} - -// SetStatus sets the Status field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetStatus(status *string) { - l.Status = status - l.require(labResultsMetadataFieldStatus) -} - -// SetInterpretation sets the Interpretation field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetInterpretation(interpretation *string) { - l.Interpretation = interpretation - l.require(labResultsMetadataFieldInterpretation) -} - -// SetPatientId sets the PatientId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetPatientId(patientId *string) { - l.PatientId = patientId - l.require(labResultsMetadataFieldPatientId) -} - -// SetAccountId sets the AccountId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsMetadata) SetAccountId(accountId *string) { - l.AccountId = accountId - l.require(labResultsMetadataFieldAccountId) -} - -func (l *LabResultsMetadata) UnmarshalJSON(data []byte) error { - type unmarshaler LabResultsMetadata - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LabResultsMetadata(value) - extraProperties, err := internal.ExtractExtraProperties(data, *l) - if err != nil { - return err - } - l.extraProperties = extraProperties - l.rawJSON = json.RawMessage(data) - return nil -} - -func (l *LabResultsMetadata) MarshalJSON() ([]byte, error) { - type embed LabResultsMetadata - var marshaler = struct { - embed - }{ - embed: embed(*l), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (l *LabResultsMetadata) String() string { - if len(l.rawJSON) > 0 { - if value, err := internal.StringifyJSON(l.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -var ( - labResultsRawFieldMetadata = big.NewInt(1 << 0) - labResultsRawFieldResults = big.NewInt(1 << 1) - labResultsRawFieldMissingResults = big.NewInt(1 << 2) - labResultsRawFieldSampleInformation = big.NewInt(1 << 3) -) - -type LabResultsRaw struct { - Metadata *LabResultsMetadata `json:"metadata" url:"metadata"` - Results *LabResultsRawResults `json:"results" url:"results"` - MissingResults []*MissingBiomarkerResult `json:"missing_results,omitempty" url:"missing_results,omitempty"` - SampleInformation map[string]*SampleData `json:"sample_information,omitempty" url:"sample_information,omitempty"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (l *LabResultsRaw) GetMetadata() *LabResultsMetadata { - if l == nil { - return nil - } - return l.Metadata -} - -func (l *LabResultsRaw) GetResults() *LabResultsRawResults { - if l == nil { - return nil - } - return l.Results -} - -func (l *LabResultsRaw) GetMissingResults() []*MissingBiomarkerResult { - if l == nil { - return nil - } - return l.MissingResults -} - -func (l *LabResultsRaw) GetSampleInformation() map[string]*SampleData { - if l == nil { - return nil - } - return l.SampleInformation -} - -func (l *LabResultsRaw) GetExtraProperties() map[string]interface{} { - return l.extraProperties -} - -func (l *LabResultsRaw) require(field *big.Int) { - if l.explicitFields == nil { - l.explicitFields = big.NewInt(0) - } - l.explicitFields.Or(l.explicitFields, field) -} - -// SetMetadata sets the Metadata field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsRaw) SetMetadata(metadata *LabResultsMetadata) { - l.Metadata = metadata - l.require(labResultsRawFieldMetadata) -} - -// SetResults sets the Results field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsRaw) SetResults(results *LabResultsRawResults) { - l.Results = results - l.require(labResultsRawFieldResults) -} - -// SetMissingResults sets the MissingResults field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsRaw) SetMissingResults(missingResults []*MissingBiomarkerResult) { - l.MissingResults = missingResults - l.require(labResultsRawFieldMissingResults) -} - -// SetSampleInformation sets the SampleInformation field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabResultsRaw) SetSampleInformation(sampleInformation map[string]*SampleData) { - l.SampleInformation = sampleInformation - l.require(labResultsRawFieldSampleInformation) -} - -func (l *LabResultsRaw) UnmarshalJSON(data []byte) error { - type unmarshaler LabResultsRaw - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LabResultsRaw(value) - extraProperties, err := internal.ExtractExtraProperties(data, *l) - if err != nil { - return err - } - l.extraProperties = extraProperties - l.rawJSON = json.RawMessage(data) - return nil -} - -func (l *LabResultsRaw) MarshalJSON() ([]byte, error) { - type embed LabResultsRaw - var marshaler = struct { - embed - }{ - embed: embed(*l), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (l *LabResultsRaw) String() string { - if len(l.rawJSON) > 0 { - if value, err := internal.StringifyJSON(l.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -type LabResultsRawResults struct { - BiomarkerResultList []*BiomarkerResult - StringUnknownMap map[string]interface{} - - typ string -} - -func (l *LabResultsRawResults) GetBiomarkerResultList() []*BiomarkerResult { - if l == nil { - return nil - } - return l.BiomarkerResultList -} - -func (l *LabResultsRawResults) GetStringUnknownMap() map[string]interface{} { - if l == nil { - return nil - } - return l.StringUnknownMap -} - -func (l *LabResultsRawResults) UnmarshalJSON(data []byte) error { - var valueBiomarkerResultList []*BiomarkerResult - if err := json.Unmarshal(data, &valueBiomarkerResultList); err == nil { - l.typ = "BiomarkerResultList" - l.BiomarkerResultList = valueBiomarkerResultList - return nil - } - var valueStringUnknownMap map[string]interface{} - if err := json.Unmarshal(data, &valueStringUnknownMap); err == nil { - l.typ = "StringUnknownMap" - l.StringUnknownMap = valueStringUnknownMap - return nil - } - return fmt.Errorf("%s cannot be deserialized as a %T", data, l) -} - -func (l LabResultsRawResults) MarshalJSON() ([]byte, error) { - if l.typ == "BiomarkerResultList" || l.BiomarkerResultList != nil { - return json.Marshal(l.BiomarkerResultList) - } - if l.typ == "StringUnknownMap" || l.StringUnknownMap != nil { - return json.Marshal(l.StringUnknownMap) - } - return nil, fmt.Errorf("type %T does not include a non-empty union type", l) -} - -type LabResultsRawResultsVisitor interface { - VisitBiomarkerResultList([]*BiomarkerResult) error - VisitStringUnknownMap(map[string]interface{}) error -} - -func (l *LabResultsRawResults) Accept(visitor LabResultsRawResultsVisitor) error { - if l.typ == "BiomarkerResultList" || l.BiomarkerResultList != nil { - return visitor.VisitBiomarkerResultList(l.BiomarkerResultList) - } - if l.typ == "StringUnknownMap" || l.StringUnknownMap != nil { - return visitor.VisitStringUnknownMap(l.StringUnknownMap) - } - return fmt.Errorf("type %T does not include a non-empty union type", l) -} - -// ℹ️ This enum is non-exhaustive. -type LabTestGenerationMethodFilter string - -const ( - LabTestGenerationMethodFilterAuto LabTestGenerationMethodFilter = "auto" - LabTestGenerationMethodFilterManual LabTestGenerationMethodFilter = "manual" - LabTestGenerationMethodFilterAll LabTestGenerationMethodFilter = "all" -) - -func NewLabTestGenerationMethodFilterFromString(s string) (LabTestGenerationMethodFilter, error) { - switch s { - case "auto": - return LabTestGenerationMethodFilterAuto, nil - case "manual": - return LabTestGenerationMethodFilterManual, nil - case "all": - return LabTestGenerationMethodFilterAll, nil - } - var t LabTestGenerationMethodFilter - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (l LabTestGenerationMethodFilter) Ptr() *LabTestGenerationMethodFilter { - return &l -} - -var ( - labTestResourcesResponseFieldData = big.NewInt(1 << 0) - labTestResourcesResponseFieldNextCursor = big.NewInt(1 << 1) -) - -type LabTestResourcesResponse struct { - Data []*ClientFacingLabTest `json:"data" url:"data"` - // The cursor for fetching the next page, or `null` to fetch the first page. - NextCursor *string `json:"next_cursor,omitempty" url:"next_cursor,omitempty"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (l *LabTestResourcesResponse) GetData() []*ClientFacingLabTest { - if l == nil { - return nil - } - return l.Data -} - -func (l *LabTestResourcesResponse) GetNextCursor() *string { - if l == nil { - return nil - } - return l.NextCursor -} - -func (l *LabTestResourcesResponse) GetExtraProperties() map[string]interface{} { - return l.extraProperties -} - -func (l *LabTestResourcesResponse) require(field *big.Int) { - if l.explicitFields == nil { - l.explicitFields = big.NewInt(0) - } - l.explicitFields.Or(l.explicitFields, field) -} - -// SetData sets the Data field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabTestResourcesResponse) SetData(data []*ClientFacingLabTest) { - l.Data = data - l.require(labTestResourcesResponseFieldData) -} - -// SetNextCursor sets the NextCursor field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LabTestResourcesResponse) SetNextCursor(nextCursor *string) { - l.NextCursor = nextCursor - l.require(labTestResourcesResponseFieldNextCursor) -} - -func (l *LabTestResourcesResponse) UnmarshalJSON(data []byte) error { - type unmarshaler LabTestResourcesResponse - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LabTestResourcesResponse(value) - extraProperties, err := internal.ExtractExtraProperties(data, *l) - if err != nil { - return err - } - l.extraProperties = extraProperties - l.rawJSON = json.RawMessage(data) - return nil -} - -func (l *LabTestResourcesResponse) MarshalJSON() ([]byte, error) { - type embed LabTestResourcesResponse - var marshaler = struct { - embed - }{ - embed: embed(*l), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (l *LabTestResourcesResponse) String() string { - if len(l.rawJSON) > 0 { - if value, err := internal.StringifyJSON(l.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -var ( - lngLatFieldLng = big.NewInt(1 << 0) - lngLatFieldLat = big.NewInt(1 << 1) -) - -type LngLat struct { - Lng float64 `json:"lng" url:"lng"` - Lat float64 `json:"lat" url:"lat"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (l *LngLat) GetLng() float64 { - if l == nil { - return 0 - } - return l.Lng -} - -func (l *LngLat) GetLat() float64 { - if l == nil { - return 0 - } - return l.Lat -} - -func (l *LngLat) GetExtraProperties() map[string]interface{} { - return l.extraProperties -} - -func (l *LngLat) require(field *big.Int) { - if l.explicitFields == nil { - l.explicitFields = big.NewInt(0) - } - l.explicitFields.Or(l.explicitFields, field) -} - -// SetLng sets the Lng field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LngLat) SetLng(lng float64) { - l.Lng = lng - l.require(lngLatFieldLng) -} - -// SetLat sets the Lat field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (l *LngLat) SetLat(lat float64) { - l.Lat = lat - l.require(lngLatFieldLat) -} - -func (l *LngLat) UnmarshalJSON(data []byte) error { - type unmarshaler LngLat - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *l = LngLat(value) - extraProperties, err := internal.ExtractExtraProperties(data, *l) - if err != nil { - return err - } - l.extraProperties = extraProperties - l.rawJSON = json.RawMessage(data) - return nil -} - -func (l *LngLat) MarshalJSON() ([]byte, error) { - type embed LngLat - var marshaler = struct { - embed - }{ - embed: embed(*l), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (l *LngLat) String() string { - if len(l.rawJSON) > 0 { - if value, err := internal.StringifyJSON(l.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(l); err == nil { - return value - } - return fmt.Sprintf("%#v", l) -} - -var ( - missingBiomarkerResultFieldName = big.NewInt(1 << 0) - missingBiomarkerResultFieldSlug = big.NewInt(1 << 1) - missingBiomarkerResultFieldInferredFailureType = big.NewInt(1 << 2) - missingBiomarkerResultFieldNote = big.NewInt(1 << 3) - missingBiomarkerResultFieldLoinc = big.NewInt(1 << 4) - missingBiomarkerResultFieldLoincSlug = big.NewInt(1 << 5) - missingBiomarkerResultFieldProviderId = big.NewInt(1 << 6) - missingBiomarkerResultFieldSourceMarkers = big.NewInt(1 << 7) -) - -type MissingBiomarkerResult struct { - Name string `json:"name" url:"name"` - Slug string `json:"slug" url:"slug"` - InferredFailureType FailureType `json:"inferred_failure_type" url:"inferred_failure_type"` - Note *string `json:"note,omitempty" url:"note,omitempty"` - Loinc *string `json:"loinc,omitempty" url:"loinc,omitempty"` - LoincSlug *string `json:"loinc_slug,omitempty" url:"loinc_slug,omitempty"` - ProviderId *string `json:"provider_id,omitempty" url:"provider_id,omitempty"` - SourceMarkers []*ParentBiomarkerData `json:"source_markers,omitempty" url:"source_markers,omitempty"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (m *MissingBiomarkerResult) GetName() string { - if m == nil { - return "" - } - return m.Name -} - -func (m *MissingBiomarkerResult) GetSlug() string { - if m == nil { - return "" - } - return m.Slug -} - -func (m *MissingBiomarkerResult) GetInferredFailureType() FailureType { - if m == nil { - return "" - } - return m.InferredFailureType -} - -func (m *MissingBiomarkerResult) GetNote() *string { - if m == nil { - return nil - } - return m.Note -} - -func (m *MissingBiomarkerResult) GetLoinc() *string { - if m == nil { - return nil - } - return m.Loinc -} - -func (m *MissingBiomarkerResult) GetLoincSlug() *string { - if m == nil { - return nil - } - return m.LoincSlug -} - -func (m *MissingBiomarkerResult) GetProviderId() *string { - if m == nil { - return nil - } - return m.ProviderId -} - -func (m *MissingBiomarkerResult) GetSourceMarkers() []*ParentBiomarkerData { - if m == nil { - return nil - } - return m.SourceMarkers -} - -func (m *MissingBiomarkerResult) GetExtraProperties() map[string]interface{} { - return m.extraProperties -} - -func (m *MissingBiomarkerResult) require(field *big.Int) { - if m.explicitFields == nil { - m.explicitFields = big.NewInt(0) - } - m.explicitFields.Or(m.explicitFields, field) -} - -// SetName sets the Name field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (m *MissingBiomarkerResult) SetName(name string) { - m.Name = name - m.require(missingBiomarkerResultFieldName) -} - -// SetSlug sets the Slug field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (m *MissingBiomarkerResult) SetSlug(slug string) { - m.Slug = slug - m.require(missingBiomarkerResultFieldSlug) -} - -// SetInferredFailureType sets the InferredFailureType field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (m *MissingBiomarkerResult) SetInferredFailureType(inferredFailureType FailureType) { - m.InferredFailureType = inferredFailureType - m.require(missingBiomarkerResultFieldInferredFailureType) -} - -// SetNote sets the Note field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (m *MissingBiomarkerResult) SetNote(note *string) { - m.Note = note - m.require(missingBiomarkerResultFieldNote) -} - -// SetLoinc sets the Loinc field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (m *MissingBiomarkerResult) SetLoinc(loinc *string) { - m.Loinc = loinc - m.require(missingBiomarkerResultFieldLoinc) -} - -// SetLoincSlug sets the LoincSlug field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (m *MissingBiomarkerResult) SetLoincSlug(loincSlug *string) { - m.LoincSlug = loincSlug - m.require(missingBiomarkerResultFieldLoincSlug) -} - -// SetProviderId sets the ProviderId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (m *MissingBiomarkerResult) SetProviderId(providerId *string) { - m.ProviderId = providerId - m.require(missingBiomarkerResultFieldProviderId) -} - -// SetSourceMarkers sets the SourceMarkers field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (m *MissingBiomarkerResult) SetSourceMarkers(sourceMarkers []*ParentBiomarkerData) { - m.SourceMarkers = sourceMarkers - m.require(missingBiomarkerResultFieldSourceMarkers) -} - -func (m *MissingBiomarkerResult) UnmarshalJSON(data []byte) error { - type unmarshaler MissingBiomarkerResult +func (l *LngLat) UnmarshalJSON(data []byte) error { + type unmarshaler LngLat var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *m = MissingBiomarkerResult(value) - extraProperties, err := internal.ExtractExtraProperties(data, *m) + *l = LngLat(value) + extraProperties, err := internal.ExtractExtraProperties(data, *l) if err != nil { return err } - m.extraProperties = extraProperties - m.rawJSON = json.RawMessage(data) + l.extraProperties = extraProperties + l.rawJSON = json.RawMessage(data) return nil } -func (m *MissingBiomarkerResult) MarshalJSON() ([]byte, error) { - type embed MissingBiomarkerResult +func (l *LngLat) MarshalJSON() ([]byte, error) { + type embed LngLat var marshaler = struct { embed }{ - embed: embed(*m), + embed: embed(*l), } - explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) return json.Marshal(explicitMarshaler) } -func (m *MissingBiomarkerResult) String() string { - if len(m.rawJSON) > 0 { - if value, err := internal.StringifyJSON(m.rawJSON); err == nil { +func (l *LngLat) String() string { + if len(l.rawJSON) > 0 { + if value, err := internal.StringifyJSON(l.rawJSON); err == nil { return value } } - if value, err := internal.StringifyJSON(m); err == nil { + if value, err := internal.StringifyJSON(l); err == nil { return value } - return fmt.Sprintf("%#v", m) + return fmt.Sprintf("%#v", l) } // ℹ️ This enum is non-exhaustive. @@ -6024,98 +5192,6 @@ func (o OrderActivationType) Ptr() *OrderActivationType { return &o } -// ℹ️ This enum is non-exhaustive. -type OrderLowLevelStatus string - -const ( - OrderLowLevelStatusOrdered OrderLowLevelStatus = "ordered" - OrderLowLevelStatusRequisitionCreated OrderLowLevelStatus = "requisition_created" - OrderLowLevelStatusRequisitionBypassed OrderLowLevelStatus = "requisition_bypassed" - OrderLowLevelStatusTransitCustomer OrderLowLevelStatus = "transit_customer" - OrderLowLevelStatusOutForDelivery OrderLowLevelStatus = "out_for_delivery" - OrderLowLevelStatusWithCustomer OrderLowLevelStatus = "with_customer" - OrderLowLevelStatusTransitLab OrderLowLevelStatus = "transit_lab" - OrderLowLevelStatusDeliveredToLab OrderLowLevelStatus = "delivered_to_lab" - OrderLowLevelStatusCompleted OrderLowLevelStatus = "completed" - OrderLowLevelStatusFailureToDeliverToLab OrderLowLevelStatus = "failure_to_deliver_to_lab" - OrderLowLevelStatusFailureToDeliverToCustomer OrderLowLevelStatus = "failure_to_deliver_to_customer" - OrderLowLevelStatusProblemInTransitLab OrderLowLevelStatus = "problem_in_transit_lab" - OrderLowLevelStatusProblemInTransitCustomer OrderLowLevelStatus = "problem_in_transit_customer" - OrderLowLevelStatusSampleError OrderLowLevelStatus = "sample_error" - OrderLowLevelStatusAppointmentScheduled OrderLowLevelStatus = "appointment_scheduled" - OrderLowLevelStatusAppointmentCancelled OrderLowLevelStatus = "appointment_cancelled" - OrderLowLevelStatusAppointmentPending OrderLowLevelStatus = "appointment_pending" - OrderLowLevelStatusDrawCompleted OrderLowLevelStatus = "draw_completed" - OrderLowLevelStatusCancelled OrderLowLevelStatus = "cancelled" - OrderLowLevelStatusLost OrderLowLevelStatus = "lost" - OrderLowLevelStatusDoNotProcess OrderLowLevelStatus = "do_not_process" - OrderLowLevelStatusPartialResults OrderLowLevelStatus = "partial_results" - OrderLowLevelStatusAwaitingRegistration OrderLowLevelStatus = "awaiting_registration" - OrderLowLevelStatusRegistered OrderLowLevelStatus = "registered" - OrderLowLevelStatusRedrawAvailable OrderLowLevelStatus = "redraw_available" -) - -func NewOrderLowLevelStatusFromString(s string) (OrderLowLevelStatus, error) { - switch s { - case "ordered": - return OrderLowLevelStatusOrdered, nil - case "requisition_created": - return OrderLowLevelStatusRequisitionCreated, nil - case "requisition_bypassed": - return OrderLowLevelStatusRequisitionBypassed, nil - case "transit_customer": - return OrderLowLevelStatusTransitCustomer, nil - case "out_for_delivery": - return OrderLowLevelStatusOutForDelivery, nil - case "with_customer": - return OrderLowLevelStatusWithCustomer, nil - case "transit_lab": - return OrderLowLevelStatusTransitLab, nil - case "delivered_to_lab": - return OrderLowLevelStatusDeliveredToLab, nil - case "completed": - return OrderLowLevelStatusCompleted, nil - case "failure_to_deliver_to_lab": - return OrderLowLevelStatusFailureToDeliverToLab, nil - case "failure_to_deliver_to_customer": - return OrderLowLevelStatusFailureToDeliverToCustomer, nil - case "problem_in_transit_lab": - return OrderLowLevelStatusProblemInTransitLab, nil - case "problem_in_transit_customer": - return OrderLowLevelStatusProblemInTransitCustomer, nil - case "sample_error": - return OrderLowLevelStatusSampleError, nil - case "appointment_scheduled": - return OrderLowLevelStatusAppointmentScheduled, nil - case "appointment_cancelled": - return OrderLowLevelStatusAppointmentCancelled, nil - case "appointment_pending": - return OrderLowLevelStatusAppointmentPending, nil - case "draw_completed": - return OrderLowLevelStatusDrawCompleted, nil - case "cancelled": - return OrderLowLevelStatusCancelled, nil - case "lost": - return OrderLowLevelStatusLost, nil - case "do_not_process": - return OrderLowLevelStatusDoNotProcess, nil - case "partial_results": - return OrderLowLevelStatusPartialResults, nil - case "awaiting_registration": - return OrderLowLevelStatusAwaitingRegistration, nil - case "registered": - return OrderLowLevelStatusRegistered, nil - case "redraw_available": - return OrderLowLevelStatusRedrawAvailable, nil - } - var t OrderLowLevelStatus - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (o OrderLowLevelStatus) Ptr() *OrderLowLevelStatus { - return &o -} - var ( orderSetRequestFieldLabTestIds = big.NewInt(1 << 0) orderSetRequestFieldAddOn = big.NewInt(1 << 1) @@ -6226,132 +5302,6 @@ func (o *OrderSetRequest) String() string { return fmt.Sprintf("%#v", o) } -var ( - parentBiomarkerDataFieldMarkerId = big.NewInt(1 << 0) - parentBiomarkerDataFieldName = big.NewInt(1 << 1) - parentBiomarkerDataFieldSlug = big.NewInt(1 << 2) - parentBiomarkerDataFieldProviderId = big.NewInt(1 << 3) -) - -type ParentBiomarkerData struct { - MarkerId int `json:"marker_id" url:"marker_id"` - Name string `json:"name" url:"name"` - Slug string `json:"slug" url:"slug"` - ProviderId *string `json:"provider_id,omitempty" url:"provider_id,omitempty"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (p *ParentBiomarkerData) GetMarkerId() int { - if p == nil { - return 0 - } - return p.MarkerId -} - -func (p *ParentBiomarkerData) GetName() string { - if p == nil { - return "" - } - return p.Name -} - -func (p *ParentBiomarkerData) GetSlug() string { - if p == nil { - return "" - } - return p.Slug -} - -func (p *ParentBiomarkerData) GetProviderId() *string { - if p == nil { - return nil - } - return p.ProviderId -} - -func (p *ParentBiomarkerData) GetExtraProperties() map[string]interface{} { - return p.extraProperties -} - -func (p *ParentBiomarkerData) require(field *big.Int) { - if p.explicitFields == nil { - p.explicitFields = big.NewInt(0) - } - p.explicitFields.Or(p.explicitFields, field) -} - -// SetMarkerId sets the MarkerId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (p *ParentBiomarkerData) SetMarkerId(markerId int) { - p.MarkerId = markerId - p.require(parentBiomarkerDataFieldMarkerId) -} - -// SetName sets the Name field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (p *ParentBiomarkerData) SetName(name string) { - p.Name = name - p.require(parentBiomarkerDataFieldName) -} - -// SetSlug sets the Slug field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (p *ParentBiomarkerData) SetSlug(slug string) { - p.Slug = slug - p.require(parentBiomarkerDataFieldSlug) -} - -// SetProviderId sets the ProviderId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (p *ParentBiomarkerData) SetProviderId(providerId *string) { - p.ProviderId = providerId - p.require(parentBiomarkerDataFieldProviderId) -} - -func (p *ParentBiomarkerData) UnmarshalJSON(data []byte) error { - type unmarshaler ParentBiomarkerData - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *p = ParentBiomarkerData(value) - extraProperties, err := internal.ExtractExtraProperties(data, *p) - if err != nil { - return err - } - p.extraProperties = extraProperties - p.rawJSON = json.RawMessage(data) - return nil -} - -func (p *ParentBiomarkerData) MarshalJSON() ([]byte, error) { - type embed ParentBiomarkerData - var marshaler = struct { - embed - }{ - embed: embed(*p), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (p *ParentBiomarkerData) String() string { - if len(p.rawJSON) > 0 { - if value, err := internal.StringifyJSON(p.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(p); err == nil { - return value - } - return fmt.Sprintf("%#v", p) -} - var ( patientAddressFieldReceiverName = big.NewInt(1 << 0) patientAddressFieldFirstLine = big.NewInt(1 << 1) @@ -6360,6 +5310,7 @@ var ( patientAddressFieldState = big.NewInt(1 << 4) patientAddressFieldZip = big.NewInt(1 << 5) patientAddressFieldCountry = big.NewInt(1 << 6) + patientAddressFieldAccessNotes = big.NewInt(1 << 7) ) type PatientAddress struct { @@ -6370,6 +5321,7 @@ type PatientAddress struct { State string `json:"state" url:"state"` Zip string `json:"zip" url:"zip"` Country string `json:"country" url:"country"` + AccessNotes *string `json:"access_notes,omitempty" url:"access_notes,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -6427,6 +5379,13 @@ func (p *PatientAddress) GetCountry() string { return p.Country } +func (p *PatientAddress) GetAccessNotes() *string { + if p == nil { + return nil + } + return p.AccessNotes +} + func (p *PatientAddress) GetExtraProperties() map[string]interface{} { return p.extraProperties } @@ -6468,158 +5427,39 @@ func (p *PatientAddress) SetCity(city string) { // SetState sets the State field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (p *PatientAddress) SetState(state string) { - p.State = state - p.require(patientAddressFieldState) -} - -// SetZip sets the Zip field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (p *PatientAddress) SetZip(zip string) { - p.Zip = zip - p.require(patientAddressFieldZip) -} - -// SetCountry sets the Country field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (p *PatientAddress) SetCountry(country string) { - p.Country = country - p.require(patientAddressFieldCountry) -} - -func (p *PatientAddress) UnmarshalJSON(data []byte) error { - type unmarshaler PatientAddress - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *p = PatientAddress(value) - extraProperties, err := internal.ExtractExtraProperties(data, *p) - if err != nil { - return err - } - p.extraProperties = extraProperties - p.rawJSON = json.RawMessage(data) - return nil -} - -func (p *PatientAddress) MarshalJSON() ([]byte, error) { - type embed PatientAddress - var marshaler = struct { - embed - }{ - embed: embed(*p), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (p *PatientAddress) String() string { - if len(p.rawJSON) > 0 { - if value, err := internal.StringifyJSON(p.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(p); err == nil { - return value - } - return fmt.Sprintf("%#v", p) -} - -var ( - performingLaboratoryFieldName = big.NewInt(1 << 0) - performingLaboratoryFieldPhoneNumber = big.NewInt(1 << 1) - performingLaboratoryFieldMedicalDirector = big.NewInt(1 << 2) - performingLaboratoryFieldAddress = big.NewInt(1 << 3) -) - -type PerformingLaboratory struct { - Name string `json:"name" url:"name"` - PhoneNumber *string `json:"phone_number,omitempty" url:"phone_number,omitempty"` - MedicalDirector *string `json:"medical_director,omitempty" url:"medical_director,omitempty"` - Address *Address `json:"address,omitempty" url:"address,omitempty"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (p *PerformingLaboratory) GetName() string { - if p == nil { - return "" - } - return p.Name -} - -func (p *PerformingLaboratory) GetPhoneNumber() *string { - if p == nil { - return nil - } - return p.PhoneNumber -} - -func (p *PerformingLaboratory) GetMedicalDirector() *string { - if p == nil { - return nil - } - return p.MedicalDirector -} - -func (p *PerformingLaboratory) GetAddress() *Address { - if p == nil { - return nil - } - return p.Address -} - -func (p *PerformingLaboratory) GetExtraProperties() map[string]interface{} { - return p.extraProperties -} - -func (p *PerformingLaboratory) require(field *big.Int) { - if p.explicitFields == nil { - p.explicitFields = big.NewInt(0) - } - p.explicitFields.Or(p.explicitFields, field) -} - -// SetName sets the Name field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (p *PerformingLaboratory) SetName(name string) { - p.Name = name - p.require(performingLaboratoryFieldName) +func (p *PatientAddress) SetState(state string) { + p.State = state + p.require(patientAddressFieldState) } -// SetPhoneNumber sets the PhoneNumber field and marks it as non-optional; +// SetZip sets the Zip field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (p *PerformingLaboratory) SetPhoneNumber(phoneNumber *string) { - p.PhoneNumber = phoneNumber - p.require(performingLaboratoryFieldPhoneNumber) +func (p *PatientAddress) SetZip(zip string) { + p.Zip = zip + p.require(patientAddressFieldZip) } -// SetMedicalDirector sets the MedicalDirector field and marks it as non-optional; +// SetCountry sets the Country field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (p *PerformingLaboratory) SetMedicalDirector(medicalDirector *string) { - p.MedicalDirector = medicalDirector - p.require(performingLaboratoryFieldMedicalDirector) +func (p *PatientAddress) SetCountry(country string) { + p.Country = country + p.require(patientAddressFieldCountry) } -// SetAddress sets the Address field and marks it as non-optional; +// SetAccessNotes sets the AccessNotes field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (p *PerformingLaboratory) SetAddress(address *Address) { - p.Address = address - p.require(performingLaboratoryFieldAddress) +func (p *PatientAddress) SetAccessNotes(accessNotes *string) { + p.AccessNotes = accessNotes + p.require(patientAddressFieldAccessNotes) } -func (p *PerformingLaboratory) UnmarshalJSON(data []byte) error { - type unmarshaler PerformingLaboratory +func (p *PatientAddress) UnmarshalJSON(data []byte) error { + type unmarshaler PatientAddress var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *p = PerformingLaboratory(value) + *p = PatientAddress(value) extraProperties, err := internal.ExtractExtraProperties(data, *p) if err != nil { return err @@ -6629,8 +5469,8 @@ func (p *PerformingLaboratory) UnmarshalJSON(data []byte) error { return nil } -func (p *PerformingLaboratory) MarshalJSON() ([]byte, error) { - type embed PerformingLaboratory +func (p *PatientAddress) MarshalJSON() ([]byte, error) { + type embed PatientAddress var marshaler = struct { embed }{ @@ -6640,7 +5480,7 @@ func (p *PerformingLaboratory) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (p *PerformingLaboratory) String() string { +func (p *PatientAddress) String() string { if len(p.rawJSON) > 0 { if value, err := internal.StringifyJSON(p.rawJSON); err == nil { return value @@ -7265,536 +6105,147 @@ func (p *PscAreaInfoDetails) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &value); err != nil { return err } - *p = PscAreaInfoDetails(value) - extraProperties, err := internal.ExtractExtraProperties(data, *p) - if err != nil { - return err - } - p.extraProperties = extraProperties - p.rawJSON = json.RawMessage(data) - return nil -} - -func (p *PscAreaInfoDetails) MarshalJSON() ([]byte, error) { - type embed PscAreaInfoDetails - var marshaler = struct { - embed - }{ - embed: embed(*p), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (p *PscAreaInfoDetails) String() string { - if len(p.rawJSON) > 0 { - if value, err := internal.StringifyJSON(p.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(p); err == nil { - return value - } - return fmt.Sprintf("%#v", p) -} - -var ( - pscInfoFieldLabId = big.NewInt(1 << 0) - pscInfoFieldSlug = big.NewInt(1 << 1) - pscInfoFieldPatientServiceCenters = big.NewInt(1 << 2) -) - -type PscInfo struct { - LabId int `json:"lab_id" url:"lab_id"` - Slug Labs `json:"slug" url:"slug"` - PatientServiceCenters []*ClientFacingLabLocation `json:"patient_service_centers" url:"patient_service_centers"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (p *PscInfo) GetLabId() int { - if p == nil { - return 0 - } - return p.LabId -} - -func (p *PscInfo) GetSlug() Labs { - if p == nil { - return "" - } - return p.Slug -} - -func (p *PscInfo) GetPatientServiceCenters() []*ClientFacingLabLocation { - if p == nil { - return nil - } - return p.PatientServiceCenters -} - -func (p *PscInfo) GetExtraProperties() map[string]interface{} { - return p.extraProperties -} - -func (p *PscInfo) require(field *big.Int) { - if p.explicitFields == nil { - p.explicitFields = big.NewInt(0) - } - p.explicitFields.Or(p.explicitFields, field) -} - -// SetLabId sets the LabId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (p *PscInfo) SetLabId(labId int) { - p.LabId = labId - p.require(pscInfoFieldLabId) -} - -// SetSlug sets the Slug field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (p *PscInfo) SetSlug(slug Labs) { - p.Slug = slug - p.require(pscInfoFieldSlug) -} - -// SetPatientServiceCenters sets the PatientServiceCenters field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (p *PscInfo) SetPatientServiceCenters(patientServiceCenters []*ClientFacingLabLocation) { - p.PatientServiceCenters = patientServiceCenters - p.require(pscInfoFieldPatientServiceCenters) -} - -func (p *PscInfo) UnmarshalJSON(data []byte) error { - type unmarshaler PscInfo - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *p = PscInfo(value) - extraProperties, err := internal.ExtractExtraProperties(data, *p) - if err != nil { - return err - } - p.extraProperties = extraProperties - p.rawJSON = json.RawMessage(data) - return nil -} - -func (p *PscInfo) MarshalJSON() ([]byte, error) { - type embed PscInfo - var marshaler = struct { - embed - }{ - embed: embed(*p), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (p *PscInfo) String() string { - if len(p.rawJSON) > 0 { - if value, err := internal.StringifyJSON(p.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(p); err == nil { - return value - } - return fmt.Sprintf("%#v", p) -} - -// ℹ️ This enum is non-exhaustive. -type ResultType string - -const ( - ResultTypeNumeric ResultType = "numeric" - ResultTypeRange ResultType = "range" - ResultTypeComment ResultType = "comment" - ResultTypeCodedValue ResultType = "coded_value" -) - -func NewResultTypeFromString(s string) (ResultType, error) { - switch s { - case "numeric": - return ResultTypeNumeric, nil - case "range": - return ResultTypeRange, nil - case "comment": - return ResultTypeComment, nil - case "coded_value": - return ResultTypeCodedValue, nil - } - var t ResultType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (r ResultType) Ptr() *ResultType { - return &r -} - -var ( - sampleDataFieldSampleId = big.NewInt(1 << 0) - sampleDataFieldControlNumber = big.NewInt(1 << 1) - sampleDataFieldDateCollected = big.NewInt(1 << 2) - sampleDataFieldDateReceived = big.NewInt(1 << 3) - sampleDataFieldDateReported = big.NewInt(1 << 4) - sampleDataFieldPerformingLaboratories = big.NewInt(1 << 5) - sampleDataFieldClinicalInformation = big.NewInt(1 << 6) -) - -type SampleData struct { - SampleId *string `json:"sample_id,omitempty" url:"sample_id,omitempty"` - ControlNumber *string `json:"control_number,omitempty" url:"control_number,omitempty"` - DateCollected *SampleDataDateCollected `json:"date_collected,omitempty" url:"date_collected,omitempty"` - DateReceived *SampleDataDateReceived `json:"date_received,omitempty" url:"date_received,omitempty"` - DateReported *SampleDataDateReported `json:"date_reported,omitempty" url:"date_reported,omitempty"` - PerformingLaboratories map[string]*PerformingLaboratory `json:"performing_laboratories,omitempty" url:"performing_laboratories,omitempty"` - ClinicalInformation *ClinicalInformation `json:"clinical_information,omitempty" url:"clinical_information,omitempty"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (s *SampleData) GetSampleId() *string { - if s == nil { - return nil - } - return s.SampleId -} - -func (s *SampleData) GetControlNumber() *string { - if s == nil { - return nil - } - return s.ControlNumber -} - -func (s *SampleData) GetDateCollected() *SampleDataDateCollected { - if s == nil { - return nil - } - return s.DateCollected -} - -func (s *SampleData) GetDateReceived() *SampleDataDateReceived { - if s == nil { - return nil - } - return s.DateReceived -} - -func (s *SampleData) GetDateReported() *SampleDataDateReported { - if s == nil { - return nil - } - return s.DateReported -} - -func (s *SampleData) GetPerformingLaboratories() map[string]*PerformingLaboratory { - if s == nil { - return nil - } - return s.PerformingLaboratories -} - -func (s *SampleData) GetClinicalInformation() *ClinicalInformation { - if s == nil { - return nil - } - return s.ClinicalInformation -} - -func (s *SampleData) GetExtraProperties() map[string]interface{} { - return s.extraProperties -} - -func (s *SampleData) require(field *big.Int) { - if s.explicitFields == nil { - s.explicitFields = big.NewInt(0) - } - s.explicitFields.Or(s.explicitFields, field) -} - -// SetSampleId sets the SampleId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SampleData) SetSampleId(sampleId *string) { - s.SampleId = sampleId - s.require(sampleDataFieldSampleId) -} - -// SetControlNumber sets the ControlNumber field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SampleData) SetControlNumber(controlNumber *string) { - s.ControlNumber = controlNumber - s.require(sampleDataFieldControlNumber) -} - -// SetDateCollected sets the DateCollected field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SampleData) SetDateCollected(dateCollected *SampleDataDateCollected) { - s.DateCollected = dateCollected - s.require(sampleDataFieldDateCollected) -} - -// SetDateReceived sets the DateReceived field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SampleData) SetDateReceived(dateReceived *SampleDataDateReceived) { - s.DateReceived = dateReceived - s.require(sampleDataFieldDateReceived) -} - -// SetDateReported sets the DateReported field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SampleData) SetDateReported(dateReported *SampleDataDateReported) { - s.DateReported = dateReported - s.require(sampleDataFieldDateReported) -} - -// SetPerformingLaboratories sets the PerformingLaboratories field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SampleData) SetPerformingLaboratories(performingLaboratories map[string]*PerformingLaboratory) { - s.PerformingLaboratories = performingLaboratories - s.require(sampleDataFieldPerformingLaboratories) -} - -// SetClinicalInformation sets the ClinicalInformation field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (s *SampleData) SetClinicalInformation(clinicalInformation *ClinicalInformation) { - s.ClinicalInformation = clinicalInformation - s.require(sampleDataFieldClinicalInformation) -} - -func (s *SampleData) UnmarshalJSON(data []byte) error { - type unmarshaler SampleData - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *s = SampleData(value) - extraProperties, err := internal.ExtractExtraProperties(data, *s) + *p = PscAreaInfoDetails(value) + extraProperties, err := internal.ExtractExtraProperties(data, *p) if err != nil { return err } - s.extraProperties = extraProperties - s.rawJSON = json.RawMessage(data) + p.extraProperties = extraProperties + p.rawJSON = json.RawMessage(data) return nil } -func (s *SampleData) MarshalJSON() ([]byte, error) { - type embed SampleData +func (p *PscAreaInfoDetails) MarshalJSON() ([]byte, error) { + type embed PscAreaInfoDetails var marshaler = struct { embed }{ - embed: embed(*s), + embed: embed(*p), } - explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) return json.Marshal(explicitMarshaler) } -func (s *SampleData) String() string { - if len(s.rawJSON) > 0 { - if value, err := internal.StringifyJSON(s.rawJSON); err == nil { +func (p *PscAreaInfoDetails) String() string { + if len(p.rawJSON) > 0 { + if value, err := internal.StringifyJSON(p.rawJSON); err == nil { return value } } - if value, err := internal.StringifyJSON(s); err == nil { + if value, err := internal.StringifyJSON(p); err == nil { return value } - return fmt.Sprintf("%#v", s) -} - -type SampleDataDateCollected struct { - UtcTimestampWithTimezoneOffset *UtcTimestampWithTimezoneOffset - String string - - typ string -} - -func (s *SampleDataDateCollected) GetUtcTimestampWithTimezoneOffset() *UtcTimestampWithTimezoneOffset { - if s == nil { - return nil - } - return s.UtcTimestampWithTimezoneOffset -} - -func (s *SampleDataDateCollected) GetString() string { - if s == nil { - return "" - } - return s.String -} - -func (s *SampleDataDateCollected) UnmarshalJSON(data []byte) error { - valueUtcTimestampWithTimezoneOffset := new(UtcTimestampWithTimezoneOffset) - if err := json.Unmarshal(data, &valueUtcTimestampWithTimezoneOffset); err == nil { - s.typ = "UtcTimestampWithTimezoneOffset" - s.UtcTimestampWithTimezoneOffset = valueUtcTimestampWithTimezoneOffset - return nil - } - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - s.typ = "String" - s.String = valueString - return nil - } - return fmt.Errorf("%s cannot be deserialized as a %T", data, s) -} - -func (s SampleDataDateCollected) MarshalJSON() ([]byte, error) { - if s.typ == "UtcTimestampWithTimezoneOffset" || s.UtcTimestampWithTimezoneOffset != nil { - return json.Marshal(s.UtcTimestampWithTimezoneOffset) - } - if s.typ == "String" || s.String != "" { - return json.Marshal(s.String) - } - return nil, fmt.Errorf("type %T does not include a non-empty union type", s) + return fmt.Sprintf("%#v", p) } -type SampleDataDateCollectedVisitor interface { - VisitUtcTimestampWithTimezoneOffset(*UtcTimestampWithTimezoneOffset) error - VisitString(string) error -} +var ( + pscInfoFieldLabId = big.NewInt(1 << 0) + pscInfoFieldSlug = big.NewInt(1 << 1) + pscInfoFieldPatientServiceCenters = big.NewInt(1 << 2) +) -func (s *SampleDataDateCollected) Accept(visitor SampleDataDateCollectedVisitor) error { - if s.typ == "UtcTimestampWithTimezoneOffset" || s.UtcTimestampWithTimezoneOffset != nil { - return visitor.VisitUtcTimestampWithTimezoneOffset(s.UtcTimestampWithTimezoneOffset) - } - if s.typ == "String" || s.String != "" { - return visitor.VisitString(s.String) - } - return fmt.Errorf("type %T does not include a non-empty union type", s) -} +type PscInfo struct { + LabId int `json:"lab_id" url:"lab_id"` + Slug Labs `json:"slug" url:"slug"` + PatientServiceCenters []*ClientFacingLabLocation `json:"patient_service_centers" url:"patient_service_centers"` -type SampleDataDateReceived struct { - UtcTimestampWithTimezoneOffset *UtcTimestampWithTimezoneOffset - String string + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` - typ string + extraProperties map[string]interface{} + rawJSON json.RawMessage } -func (s *SampleDataDateReceived) GetUtcTimestampWithTimezoneOffset() *UtcTimestampWithTimezoneOffset { - if s == nil { - return nil +func (p *PscInfo) GetLabId() int { + if p == nil { + return 0 } - return s.UtcTimestampWithTimezoneOffset + return p.LabId } -func (s *SampleDataDateReceived) GetString() string { - if s == nil { +func (p *PscInfo) GetSlug() Labs { + if p == nil { return "" } - return s.String + return p.Slug } -func (s *SampleDataDateReceived) UnmarshalJSON(data []byte) error { - valueUtcTimestampWithTimezoneOffset := new(UtcTimestampWithTimezoneOffset) - if err := json.Unmarshal(data, &valueUtcTimestampWithTimezoneOffset); err == nil { - s.typ = "UtcTimestampWithTimezoneOffset" - s.UtcTimestampWithTimezoneOffset = valueUtcTimestampWithTimezoneOffset - return nil - } - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - s.typ = "String" - s.String = valueString +func (p *PscInfo) GetPatientServiceCenters() []*ClientFacingLabLocation { + if p == nil { return nil } - return fmt.Errorf("%s cannot be deserialized as a %T", data, s) -} - -func (s SampleDataDateReceived) MarshalJSON() ([]byte, error) { - if s.typ == "UtcTimestampWithTimezoneOffset" || s.UtcTimestampWithTimezoneOffset != nil { - return json.Marshal(s.UtcTimestampWithTimezoneOffset) - } - if s.typ == "String" || s.String != "" { - return json.Marshal(s.String) - } - return nil, fmt.Errorf("type %T does not include a non-empty union type", s) + return p.PatientServiceCenters } -type SampleDataDateReceivedVisitor interface { - VisitUtcTimestampWithTimezoneOffset(*UtcTimestampWithTimezoneOffset) error - VisitString(string) error +func (p *PscInfo) GetExtraProperties() map[string]interface{} { + return p.extraProperties } -func (s *SampleDataDateReceived) Accept(visitor SampleDataDateReceivedVisitor) error { - if s.typ == "UtcTimestampWithTimezoneOffset" || s.UtcTimestampWithTimezoneOffset != nil { - return visitor.VisitUtcTimestampWithTimezoneOffset(s.UtcTimestampWithTimezoneOffset) - } - if s.typ == "String" || s.String != "" { - return visitor.VisitString(s.String) +func (p *PscInfo) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) } - return fmt.Errorf("type %T does not include a non-empty union type", s) + p.explicitFields.Or(p.explicitFields, field) } -type SampleDataDateReported struct { - UtcTimestampWithTimezoneOffset *UtcTimestampWithTimezoneOffset - String string - - typ string +// SetLabId sets the LabId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PscInfo) SetLabId(labId int) { + p.LabId = labId + p.require(pscInfoFieldLabId) } -func (s *SampleDataDateReported) GetUtcTimestampWithTimezoneOffset() *UtcTimestampWithTimezoneOffset { - if s == nil { - return nil - } - return s.UtcTimestampWithTimezoneOffset +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PscInfo) SetSlug(slug Labs) { + p.Slug = slug + p.require(pscInfoFieldSlug) } -func (s *SampleDataDateReported) GetString() string { - if s == nil { - return "" - } - return s.String +// SetPatientServiceCenters sets the PatientServiceCenters field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PscInfo) SetPatientServiceCenters(patientServiceCenters []*ClientFacingLabLocation) { + p.PatientServiceCenters = patientServiceCenters + p.require(pscInfoFieldPatientServiceCenters) } -func (s *SampleDataDateReported) UnmarshalJSON(data []byte) error { - valueUtcTimestampWithTimezoneOffset := new(UtcTimestampWithTimezoneOffset) - if err := json.Unmarshal(data, &valueUtcTimestampWithTimezoneOffset); err == nil { - s.typ = "UtcTimestampWithTimezoneOffset" - s.UtcTimestampWithTimezoneOffset = valueUtcTimestampWithTimezoneOffset - return nil +func (p *PscInfo) UnmarshalJSON(data []byte) error { + type unmarshaler PscInfo + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err } - var valueString string - if err := json.Unmarshal(data, &valueString); err == nil { - s.typ = "String" - s.String = valueString - return nil + *p = PscInfo(value) + extraProperties, err := internal.ExtractExtraProperties(data, *p) + if err != nil { + return err } - return fmt.Errorf("%s cannot be deserialized as a %T", data, s) + p.extraProperties = extraProperties + p.rawJSON = json.RawMessage(data) + return nil } -func (s SampleDataDateReported) MarshalJSON() ([]byte, error) { - if s.typ == "UtcTimestampWithTimezoneOffset" || s.UtcTimestampWithTimezoneOffset != nil { - return json.Marshal(s.UtcTimestampWithTimezoneOffset) - } - if s.typ == "String" || s.String != "" { - return json.Marshal(s.String) +func (p *PscInfo) MarshalJSON() ([]byte, error) { + type embed PscInfo + var marshaler = struct { + embed + }{ + embed: embed(*p), } - return nil, fmt.Errorf("type %T does not include a non-empty union type", s) -} - -type SampleDataDateReportedVisitor interface { - VisitUtcTimestampWithTimezoneOffset(*UtcTimestampWithTimezoneOffset) error - VisitString(string) error + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) } -func (s *SampleDataDateReported) Accept(visitor SampleDataDateReportedVisitor) error { - if s.typ == "UtcTimestampWithTimezoneOffset" || s.UtcTimestampWithTimezoneOffset != nil { - return visitor.VisitUtcTimestampWithTimezoneOffset(s.UtcTimestampWithTimezoneOffset) +func (p *PscInfo) String() string { + if len(p.rawJSON) > 0 { + if value, err := internal.StringifyJSON(p.rawJSON); err == nil { + return value + } } - if s.typ == "String" || s.String != "" { - return visitor.VisitString(s.String) + if value, err := internal.StringifyJSON(p); err == nil { + return value } - return fmt.Errorf("type %T does not include a non-empty union type", s) + return fmt.Sprintf("%#v", p) } var ( @@ -8100,12 +6551,13 @@ func (t *TimeSlot) String() string { } var ( - usAddressFieldFirstLine = big.NewInt(1 << 0) - usAddressFieldSecondLine = big.NewInt(1 << 1) - usAddressFieldCity = big.NewInt(1 << 2) - usAddressFieldState = big.NewInt(1 << 3) - usAddressFieldZipCode = big.NewInt(1 << 4) - usAddressFieldUnit = big.NewInt(1 << 5) + usAddressFieldFirstLine = big.NewInt(1 << 0) + usAddressFieldSecondLine = big.NewInt(1 << 1) + usAddressFieldCity = big.NewInt(1 << 2) + usAddressFieldState = big.NewInt(1 << 3) + usAddressFieldZipCode = big.NewInt(1 << 4) + usAddressFieldUnit = big.NewInt(1 << 5) + usAddressFieldAccessNotes = big.NewInt(1 << 6) ) type UsAddress struct { @@ -8115,7 +6567,8 @@ type UsAddress struct { State string `json:"state" url:"state"` ZipCode string `json:"zip_code" url:"zip_code"` // Deprecated. Use `second_line` instead to provide the unit number. Subject to removal after 20 Nov 2023. - Unit *string `json:"unit,omitempty" url:"unit,omitempty"` + Unit *string `json:"unit,omitempty" url:"unit,omitempty"` + AccessNotes *string `json:"access_notes,omitempty" url:"access_notes,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -8166,6 +6619,13 @@ func (u *UsAddress) GetUnit() *string { return u.Unit } +func (u *UsAddress) GetAccessNotes() *string { + if u == nil { + return nil + } + return u.AccessNotes +} + func (u *UsAddress) GetExtraProperties() map[string]interface{} { return u.extraProperties } @@ -8219,6 +6679,13 @@ func (u *UsAddress) SetUnit(unit *string) { u.require(usAddressFieldUnit) } +// SetAccessNotes sets the AccessNotes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UsAddress) SetAccessNotes(accessNotes *string) { + u.AccessNotes = accessNotes + u.require(usAddressFieldAccessNotes) +} + func (u *UsAddress) UnmarshalJSON(data []byte) error { type unmarshaler UsAddress var value unmarshaler @@ -8258,108 +6725,6 @@ func (u *UsAddress) String() string { return fmt.Sprintf("%#v", u) } -var ( - utcTimestampWithTimezoneOffsetFieldTimestamp = big.NewInt(1 << 0) - utcTimestampWithTimezoneOffsetFieldTimezoneOffset = big.NewInt(1 << 1) -) - -type UtcTimestampWithTimezoneOffset struct { - Timestamp time.Time `json:"timestamp" url:"timestamp"` - TimezoneOffset int `json:"timezone_offset" url:"timezone_offset"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (u *UtcTimestampWithTimezoneOffset) GetTimestamp() time.Time { - if u == nil { - return time.Time{} - } - return u.Timestamp -} - -func (u *UtcTimestampWithTimezoneOffset) GetTimezoneOffset() int { - if u == nil { - return 0 - } - return u.TimezoneOffset -} - -func (u *UtcTimestampWithTimezoneOffset) GetExtraProperties() map[string]interface{} { - return u.extraProperties -} - -func (u *UtcTimestampWithTimezoneOffset) require(field *big.Int) { - if u.explicitFields == nil { - u.explicitFields = big.NewInt(0) - } - u.explicitFields.Or(u.explicitFields, field) -} - -// SetTimestamp sets the Timestamp field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (u *UtcTimestampWithTimezoneOffset) SetTimestamp(timestamp time.Time) { - u.Timestamp = timestamp - u.require(utcTimestampWithTimezoneOffsetFieldTimestamp) -} - -// SetTimezoneOffset sets the TimezoneOffset field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (u *UtcTimestampWithTimezoneOffset) SetTimezoneOffset(timezoneOffset int) { - u.TimezoneOffset = timezoneOffset - u.require(utcTimestampWithTimezoneOffsetFieldTimezoneOffset) -} - -func (u *UtcTimestampWithTimezoneOffset) UnmarshalJSON(data []byte) error { - type embed UtcTimestampWithTimezoneOffset - var unmarshaler = struct { - embed - Timestamp *internal.DateTime `json:"timestamp"` - }{ - embed: embed(*u), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *u = UtcTimestampWithTimezoneOffset(unmarshaler.embed) - u.Timestamp = unmarshaler.Timestamp.Time() - extraProperties, err := internal.ExtractExtraProperties(data, *u) - if err != nil { - return err - } - u.extraProperties = extraProperties - u.rawJSON = json.RawMessage(data) - return nil -} - -func (u *UtcTimestampWithTimezoneOffset) MarshalJSON() ([]byte, error) { - type embed UtcTimestampWithTimezoneOffset - var marshaler = struct { - embed - Timestamp *internal.DateTime `json:"timestamp"` - }{ - embed: embed(*u), - Timestamp: internal.NewDateTime(u.Timestamp), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (u *UtcTimestampWithTimezoneOffset) String() string { - if len(u.rawJSON) > 0 { - if value, err := internal.StringifyJSON(u.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(u); err == nil { - return value - } - return fmt.Sprintf("%#v", u) -} - var ( validateIcdCodesResponseFieldValid = big.NewInt(1 << 0) validateIcdCodesResponseFieldErrors = big.NewInt(1 << 1) @@ -8661,12 +7026,33 @@ func (u *UpdateLabTestRequest) SetActive(active *bool) { u.require(updateLabTestRequestFieldActive) } +func (u *UpdateLabTestRequest) UnmarshalJSON(data []byte) error { + type unmarshaler UpdateLabTestRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *u = UpdateLabTestRequest(body) + return nil +} + +func (u *UpdateLabTestRequest) MarshalJSON() ([]byte, error) { + type embed UpdateLabTestRequest + var marshaler = struct { + embed + }{ + embed: embed(*u), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( validateIcdCodesBodyFieldCodes = big.NewInt(1 << 0) ) type ValidateIcdCodesBody struct { - Codes []string `json:"codes,omitempty" url:"-"` + Codes []string `json:"codes" url:"-"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -8685,3 +7071,24 @@ func (v *ValidateIcdCodesBody) SetCodes(codes []string) { v.Codes = codes v.require(validateIcdCodesBodyFieldCodes) } + +func (v *ValidateIcdCodesBody) UnmarshalJSON(data []byte) error { + type unmarshaler ValidateIcdCodesBody + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *v = ValidateIcdCodesBody(body) + return nil +} + +func (v *ValidateIcdCodesBody) MarshalJSON() ([]byte, error) { + type embed ValidateIcdCodesBody + var marshaler = struct { + embed + }{ + embed: embed(*v), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, v.explicitFields) + return json.Marshal(explicitMarshaler) +} diff --git a/labaccount/client.go b/labaccount/client.go new file mode 100644 index 0000000..bbaa2f3 --- /dev/null +++ b/labaccount/client.go @@ -0,0 +1,49 @@ +// Code generated by Fern. DO NOT EDIT. + +package labaccount + +import ( + context "context" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" +) + +type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions + baseURL string + caller *internal.Caller +} + +func NewClient(options *core.RequestOptions) *Client { + return &Client{ + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (c *Client) GetTeamLabAccounts( + ctx context.Context, + request *v505.LabAccountGetTeamLabAccountsRequest, + opts ...option.RequestOption, +) (*v505.GetTeamLabAccountsResponse, error) { + response, err := c.WithRawResponse.GetTeamLabAccounts( + ctx, + request, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} diff --git a/labaccount/raw_client.go b/labaccount/raw_client.go new file mode 100644 index 0000000..9357b39 --- /dev/null +++ b/labaccount/raw_client.go @@ -0,0 +1,79 @@ +// Code generated by Fern. DO NOT EDIT. + +package labaccount + +import ( + context "context" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) GetTeamLabAccounts( + ctx context.Context, + request *v505.LabAccountGetTeamLabAccountsRequest, + opts ...option.RequestOption, +) (*core.Response[*v505.GetTeamLabAccountsResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.tryvital.io", + ) + endpointURL := baseURL + "/v3/lab_test/lab_account" + queryParams, err := internal.QueryValues(request) + if err != nil { + return nil, err + } + if len(queryParams) > 0 { + endpointURL += "?" + queryParams.Encode() + } + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *v505.GetTeamLabAccountsResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*v505.GetTeamLabAccountsResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/labreport/client.go b/labreport/client.go index 71c84e4..4c0e1da 100644 --- a/labreport/client.go +++ b/labreport/client.go @@ -4,10 +4,10 @@ package labreport import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -32,13 +32,13 @@ func NewClient(options *core.RequestOptions) *Client { } } -// Creates a parse job, uploads the file to provider, persists the job row, +// Creates a parse job, uploads the file(s) to provider, persists the job row, // and starts the ParseLabReport. Returns a generated job_id. func (c *Client) ParserCreateJob( ctx context.Context, - request *vitalgo.BodyCreateLabReportParserJob, + request *v505.BodyCreateLabReportParserJob, opts ...option.RequestOption, -) (*vitalgo.ParsingJob, error) { +) (*v505.ParsingJob, error) { response, err := c.WithRawResponse.ParserCreateJob( ctx, request, @@ -59,7 +59,7 @@ func (c *Client) ParserGetJob( ctx context.Context, jobId string, opts ...option.RequestOption, -) (*vitalgo.ParsingJob, error) { +) (*v505.ParsingJob, error) { response, err := c.WithRawResponse.ParserGetJob( ctx, jobId, diff --git a/labreport/raw_client.go b/labreport/raw_client.go index 177bee3..3ac2b7f 100644 --- a/labreport/raw_client.go +++ b/labreport/raw_client.go @@ -5,10 +5,10 @@ package labreport import ( context "context" fmt "fmt" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -33,9 +33,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) ParserCreateJob( ctx context.Context, - request *vitalgo.BodyCreateLabReportParserJob, + request *v505.BodyCreateLabReportParserJob, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ParsingJob], error) { +) (*core.Response[*v505.ParsingJob], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -48,8 +48,10 @@ func (r *RawClient) ParserCreateJob( options.ToHeader(), ) writer := internal.NewMultipartWriter() - if err := writer.WriteFile("file", request.File); err != nil { - return nil, err + for _, f := range request.File { + if err := writer.WriteFile("file", f); err != nil { + return nil, err + } } if err := writer.WriteField("user_id", request.UserId); err != nil { return nil, err @@ -64,7 +66,7 @@ func (r *RawClient) ParserCreateJob( } headers.Set("Content-Type", writer.ContentType()) - var response *vitalgo.ParsingJob + var response *v505.ParsingJob raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -77,13 +79,13 @@ func (r *RawClient) ParserCreateJob( Client: options.HTTPClient, Request: writer.Buffer(), Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ParsingJob]{ + return &core.Response[*v505.ParsingJob]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -94,7 +96,7 @@ func (r *RawClient) ParserGetJob( ctx context.Context, jobId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ParsingJob], error) { +) (*core.Response[*v505.ParsingJob], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -109,7 +111,7 @@ func (r *RawClient) ParserGetJob( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ParsingJob + var response *v505.ParsingJob raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -121,13 +123,13 @@ func (r *RawClient) ParserGetJob( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ParsingJob]{ + return &core.Response[*v505.ParsingJob]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/labtests/client.go b/labtests/client.go index f850df1..1a5df72 100644 --- a/labtests/client.go +++ b/labtests/client.go @@ -4,10 +4,10 @@ package labtests import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" io "io" ) @@ -36,9 +36,9 @@ func NewClient(options *core.RequestOptions) *Client { // GET all the lab tests the team has access to. func (c *Client) Get( ctx context.Context, - request *vitalgo.LabTestsGetRequest, + request *v505.LabTestsGetRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingLabTest, error) { +) ([]*v505.ClientFacingLabTest, error) { response, err := c.WithRawResponse.Get( ctx, request, @@ -52,9 +52,9 @@ func (c *Client) Get( func (c *Client) Create( ctx context.Context, - request *vitalgo.CreateLabTestRequest, + request *v505.CreateLabTestRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingLabTest, error) { +) (*v505.ClientFacingLabTest, error) { response, err := c.WithRawResponse.Create( ctx, request, @@ -70,9 +70,9 @@ func (c *Client) Create( func (c *Client) GetById( ctx context.Context, labTestId string, - request *vitalgo.LabTestsGetByIdRequest, + request *v505.LabTestsGetByIdRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingLabTest, error) { +) (*v505.ClientFacingLabTest, error) { response, err := c.WithRawResponse.GetById( ctx, labTestId, @@ -88,9 +88,9 @@ func (c *Client) GetById( func (c *Client) UpdateLabTest( ctx context.Context, labTestId string, - request *vitalgo.UpdateLabTestRequest, + request *v505.UpdateLabTestRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingLabTest, error) { +) (*v505.ClientFacingLabTest, error) { response, err := c.WithRawResponse.UpdateLabTest( ctx, labTestId, @@ -103,12 +103,12 @@ func (c *Client) UpdateLabTest( return response.Body, nil } -// GET all the markers for the given lab. +// List active and orderable markers for a given Lab. Note that reflex markers are not included. func (c *Client) GetMarkers( ctx context.Context, - request *vitalgo.LabTestsGetMarkersRequest, + request *v505.LabTestsGetMarkersRequest, opts ...option.RequestOption, -) (*vitalgo.GetMarkersResponse, error) { +) (*v505.GetMarkersResponse, error) { response, err := c.WithRawResponse.GetMarkers( ctx, request, @@ -122,9 +122,9 @@ func (c *Client) GetMarkers( func (c *Client) GetMarkersForOrderSet( ctx context.Context, - request *vitalgo.LabTestsGetMarkersForOrderSetRequest, + request *v505.LabTestsGetMarkersForOrderSetRequest, opts ...option.RequestOption, -) (*vitalgo.GetMarkersResponse, error) { +) (*v505.GetMarkersResponse, error) { response, err := c.WithRawResponse.GetMarkersForOrderSet( ctx, request, @@ -136,12 +136,13 @@ func (c *Client) GetMarkersForOrderSet( return response.Body, nil } +// List all markers for a given Lab Test, as well as any associated reflex markers. func (c *Client) GetMarkersForLabTest( ctx context.Context, labTestId string, - request *vitalgo.LabTestsGetMarkersForLabTestRequest, + request *v505.LabTestsGetMarkersForLabTestRequest, opts ...option.RequestOption, -) (*vitalgo.GetMarkersResponse, error) { +) (*v505.GetMarkersResponse, error) { response, err := c.WithRawResponse.GetMarkersForLabTest( ctx, labTestId, @@ -159,9 +160,9 @@ func (c *Client) GetMarkersByLabAndProviderId( ctx context.Context, providerId string, labId int, - request *vitalgo.LabTestsGetMarkersByLabAndProviderIdRequest, + request *v505.LabTestsGetMarkersByLabAndProviderIdRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingMarker, error) { +) (*v505.ClientFacingMarker, error) { response, err := c.WithRawResponse.GetMarkersByLabAndProviderId( ctx, providerId, @@ -179,7 +180,7 @@ func (c *Client) GetMarkersByLabAndProviderId( func (c *Client) GetLabs( ctx context.Context, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingLab, error) { +) ([]*v505.ClientFacingLab, error) { response, err := c.WithRawResponse.GetLabs( ctx, opts..., @@ -193,9 +194,9 @@ func (c *Client) GetLabs( // GET lab tests the team has access to as a paginated list. func (c *Client) GetPaginated( ctx context.Context, - request *vitalgo.LabTestsGetPaginatedRequest, + request *v505.LabTestsGetPaginatedRequest, opts ...option.RequestOption, -) (*vitalgo.LabTestResourcesResponse, error) { +) (*v505.LabTestResourcesResponse, error) { response, err := c.WithRawResponse.GetPaginated( ctx, request, @@ -226,9 +227,9 @@ func (c *Client) GetLabTestCollectionInstructionPdf( // GET many orders with filters. func (c *Client) GetOrders( ctx context.Context, - request *vitalgo.LabTestsGetOrdersRequest, + request *v505.LabTestsGetOrdersRequest, opts ...option.RequestOption, -) (*vitalgo.GetOrdersResponse, error) { +) (*v505.GetOrdersResponse, error) { response, err := c.WithRawResponse.GetOrders( ctx, request, @@ -244,9 +245,9 @@ func (c *Client) GetOrders( // for the given address and order. func (c *Client) GetPhlebotomyAppointmentAvailability( ctx context.Context, - request *vitalgo.LabTestsGetPhlebotomyAppointmentAvailabilityRequest, + request *v505.LabTestsGetPhlebotomyAppointmentAvailabilityRequest, opts ...option.RequestOption, -) (*vitalgo.AppointmentAvailabilitySlots, error) { +) (*v505.AppointmentAvailabilitySlots, error) { response, err := c.WithRawResponse.GetPhlebotomyAppointmentAvailability( ctx, request, @@ -263,9 +264,9 @@ func (c *Client) BookPhlebotomyAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.AppointmentBookingRequest, + request *v505.AppointmentBookingRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingAppointment, error) { +) (*v505.ClientFacingAppointment, error) { response, err := c.WithRawResponse.BookPhlebotomyAppointment( ctx, orderId, @@ -283,9 +284,9 @@ func (c *Client) RequestPhlebotomyAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.RequestAppointmentRequest, + request *v505.RequestAppointmentRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingAppointment, error) { +) (*v505.ClientFacingAppointment, error) { response, err := c.WithRawResponse.RequestPhlebotomyAppointment( ctx, orderId, @@ -303,9 +304,9 @@ func (c *Client) ReschedulePhlebotomyAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.AppointmentRescheduleRequest, + request *v505.AppointmentRescheduleRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingAppointment, error) { +) (*v505.ClientFacingAppointment, error) { response, err := c.WithRawResponse.ReschedulePhlebotomyAppointment( ctx, orderId, @@ -323,9 +324,9 @@ func (c *Client) CancelPhlebotomyAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest, + request *v505.ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingAppointment, error) { +) (*v505.ClientFacingAppointment, error) { response, err := c.WithRawResponse.CancelPhlebotomyAppointment( ctx, orderId, @@ -342,7 +343,7 @@ func (c *Client) CancelPhlebotomyAppointment( func (c *Client) GetPhlebotomyAppointmentCancellationReason( ctx context.Context, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingAppointmentCancellationReason, error) { +) ([]*v505.ClientFacingAppointmentCancellationReason, error) { response, err := c.WithRawResponse.GetPhlebotomyAppointmentCancellationReason( ctx, opts..., @@ -359,7 +360,7 @@ func (c *Client) GetPhlebotomyAppointment( // Your Order ID. orderId string, opts ...option.RequestOption, -) (*vitalgo.ClientFacingAppointment, error) { +) (*v505.ClientFacingAppointment, error) { response, err := c.WithRawResponse.GetPhlebotomyAppointment( ctx, orderId, @@ -378,9 +379,9 @@ func (c *Client) GetPhlebotomyAppointment( // * List of Lab locations in the area. func (c *Client) GetAreaInfo( ctx context.Context, - request *vitalgo.LabTestsGetAreaInfoRequest, + request *v505.LabTestsGetAreaInfoRequest, opts ...option.RequestOption, -) (*vitalgo.AreaInfo, error) { +) (*v505.AreaInfo, error) { response, err := c.WithRawResponse.GetAreaInfo( ctx, request, @@ -394,9 +395,9 @@ func (c *Client) GetAreaInfo( func (c *Client) GetPscInfo( ctx context.Context, - request *vitalgo.LabTestsGetPscInfoRequest, + request *v505.LabTestsGetPscInfoRequest, opts ...option.RequestOption, -) (*vitalgo.PscInfo, error) { +) (*v505.PscInfo, error) { response, err := c.WithRawResponse.GetPscInfo( ctx, request, @@ -412,9 +413,9 @@ func (c *Client) GetOrderPscInfo( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.LabTestsGetOrderPscInfoRequest, + request *v505.LabTestsGetOrderPscInfoRequest, opts ...option.RequestOption, -) (*vitalgo.PscInfo, error) { +) (*v505.PscInfo, error) { response, err := c.WithRawResponse.GetOrderPscInfo( ctx, orderId, @@ -450,7 +451,7 @@ func (c *Client) GetResultMetadata( ctx context.Context, orderId string, opts ...option.RequestOption, -) (*vitalgo.LabResultsMetadata, error) { +) (*v505.LabResultsMetadata, error) { response, err := c.WithRawResponse.GetResultMetadata( ctx, orderId, @@ -467,7 +468,7 @@ func (c *Client) GetResultRaw( ctx context.Context, orderId string, opts ...option.RequestOption, -) (*vitalgo.LabResultsRaw, error) { +) (*v505.LabResultsRaw, error) { response, err := c.WithRawResponse.GetResultRaw( ctx, orderId, @@ -483,7 +484,7 @@ func (c *Client) GetResultRaw( func (c *Client) GetLabelsPdf( ctx context.Context, orderId string, - request *vitalgo.LabTestsGetLabelsPdfRequest, + request *v505.LabTestsGetLabelsPdfRequest, opts ...option.RequestOption, ) (io.Reader, error) { response, err := c.WithRawResponse.GetLabelsPdf( @@ -500,9 +501,9 @@ func (c *Client) GetLabelsPdf( func (c *Client) GetPscAppointmentAvailability( ctx context.Context, - request *vitalgo.LabTestsGetPscAppointmentAvailabilityRequest, + request *v505.LabTestsGetPscAppointmentAvailabilityRequest, opts ...option.RequestOption, -) (*vitalgo.AppointmentAvailabilitySlots, error) { +) (*v505.AppointmentAvailabilitySlots, error) { response, err := c.WithRawResponse.GetPscAppointmentAvailability( ctx, request, @@ -518,9 +519,9 @@ func (c *Client) BookPscAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.AppointmentBookingRequest, + request *v505.LabTestsBookPscAppointmentRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingAppointment, error) { +) (*v505.ClientFacingAppointment, error) { response, err := c.WithRawResponse.BookPscAppointment( ctx, orderId, @@ -537,9 +538,9 @@ func (c *Client) ReschedulePscAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.AppointmentRescheduleRequest, + request *v505.AppointmentRescheduleRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingAppointment, error) { +) (*v505.ClientFacingAppointment, error) { response, err := c.WithRawResponse.ReschedulePscAppointment( ctx, orderId, @@ -556,9 +557,9 @@ func (c *Client) CancelPscAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest, + request *v505.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingAppointment, error) { +) (*v505.ClientFacingAppointment, error) { response, err := c.WithRawResponse.CancelPscAppointment( ctx, orderId, @@ -574,7 +575,7 @@ func (c *Client) CancelPscAppointment( func (c *Client) GetPscAppointmentCancellationReason( ctx context.Context, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingAppointmentCancellationReason, error) { +) ([]*v505.ClientFacingAppointmentCancellationReason, error) { response, err := c.WithRawResponse.GetPscAppointmentCancellationReason( ctx, opts..., @@ -591,7 +592,7 @@ func (c *Client) GetPscAppointment( // Your Order ID. orderId string, opts ...option.RequestOption, -) (*vitalgo.ClientFacingAppointment, error) { +) (*v505.ClientFacingAppointment, error) { response, err := c.WithRawResponse.GetPscAppointment( ctx, orderId, @@ -663,7 +664,7 @@ func (c *Client) GetOrder( // Your Order ID. orderId string, opts ...option.RequestOption, -) (*vitalgo.ClientFacingOrder, error) { +) (*v505.ClientFacingOrder, error) { response, err := c.WithRawResponse.GetOrder( ctx, orderId, @@ -677,9 +678,9 @@ func (c *Client) GetOrder( func (c *Client) CreateOrder( ctx context.Context, - request *vitalgo.CreateOrderRequestCompatible, + request *v505.CreateOrderRequestCompatible, opts ...option.RequestOption, -) (*vitalgo.PostOrderResponse, error) { +) (*v505.PostOrderResponse, error) { response, err := c.WithRawResponse.CreateOrder( ctx, request, @@ -693,9 +694,9 @@ func (c *Client) CreateOrder( func (c *Client) ImportOrder( ctx context.Context, - request *vitalgo.ImportOrderBody, + request *v505.ImportOrderBody, opts ...option.RequestOption, -) (*vitalgo.PostOrderResponse, error) { +) (*v505.PostOrderResponse, error) { response, err := c.WithRawResponse.ImportOrder( ctx, request, @@ -713,7 +714,7 @@ func (c *Client) CancelOrder( // Your Order ID. orderId string, opts ...option.RequestOption, -) (*vitalgo.PostOrderResponse, error) { +) (*v505.PostOrderResponse, error) { response, err := c.WithRawResponse.CancelOrder( ctx, orderId, @@ -729,7 +730,7 @@ func (c *Client) CancelOrder( func (c *Client) SimulateOrderProcess( ctx context.Context, orderId string, - request *vitalgo.LabTestsSimulateOrderProcessRequest, + request *v505.LabTestsSimulateOrderProcessRequest, opts ...option.RequestOption, ) (any, error) { response, err := c.WithRawResponse.SimulateOrderProcess( @@ -750,7 +751,7 @@ func (c *Client) UpdateOnSiteCollectionOrderDrawCompleted( // Your Order ID. orderId string, opts ...option.RequestOption, -) (*vitalgo.PostOrderResponse, error) { +) (*v505.PostOrderResponse, error) { response, err := c.WithRawResponse.UpdateOnSiteCollectionOrderDrawCompleted( ctx, orderId, @@ -764,9 +765,9 @@ func (c *Client) UpdateOnSiteCollectionOrderDrawCompleted( func (c *Client) ValidateIcdCodes( ctx context.Context, - request *vitalgo.ValidateIcdCodesBody, + request *v505.ValidateIcdCodesBody, opts ...option.RequestOption, -) (*vitalgo.ValidateIcdCodesResponse, error) { +) (*v505.ValidateIcdCodesResponse, error) { response, err := c.WithRawResponse.ValidateIcdCodes( ctx, request, diff --git a/labtests/raw_client.go b/labtests/raw_client.go index 46e32b0..183826a 100644 --- a/labtests/raw_client.go +++ b/labtests/raw_client.go @@ -5,10 +5,10 @@ package labtests import ( bytes "bytes" context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" io "io" http "net/http" ) @@ -34,9 +34,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) Get( ctx context.Context, - request *vitalgo.LabTestsGetRequest, + request *v505.LabTestsGetRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingLabTest], error) { +) (*core.Response[[]*v505.ClientFacingLabTest], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -55,7 +55,7 @@ func (r *RawClient) Get( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingLabTest + var response []*v505.ClientFacingLabTest raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -67,13 +67,13 @@ func (r *RawClient) Get( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingLabTest]{ + return &core.Response[[]*v505.ClientFacingLabTest]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -82,9 +82,9 @@ func (r *RawClient) Get( func (r *RawClient) Create( ctx context.Context, - request *vitalgo.CreateLabTestRequest, + request *v505.CreateLabTestRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingLabTest], error) { +) (*core.Response[*v505.ClientFacingLabTest], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -97,7 +97,7 @@ func (r *RawClient) Create( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.ClientFacingLabTest + var response *v505.ClientFacingLabTest raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -110,13 +110,13 @@ func (r *RawClient) Create( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingLabTest]{ + return &core.Response[*v505.ClientFacingLabTest]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -126,9 +126,9 @@ func (r *RawClient) Create( func (r *RawClient) GetById( ctx context.Context, labTestId string, - request *vitalgo.LabTestsGetByIdRequest, + request *v505.LabTestsGetByIdRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingLabTest], error) { +) (*core.Response[*v505.ClientFacingLabTest], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -150,7 +150,7 @@ func (r *RawClient) GetById( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingLabTest + var response *v505.ClientFacingLabTest raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -162,13 +162,13 @@ func (r *RawClient) GetById( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingLabTest]{ + return &core.Response[*v505.ClientFacingLabTest]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -178,9 +178,9 @@ func (r *RawClient) GetById( func (r *RawClient) UpdateLabTest( ctx context.Context, labTestId string, - request *vitalgo.UpdateLabTestRequest, + request *v505.UpdateLabTestRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingLabTest], error) { +) (*core.Response[*v505.ClientFacingLabTest], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -196,7 +196,7 @@ func (r *RawClient) UpdateLabTest( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.ClientFacingLabTest + var response *v505.ClientFacingLabTest raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -209,13 +209,13 @@ func (r *RawClient) UpdateLabTest( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingLabTest]{ + return &core.Response[*v505.ClientFacingLabTest]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -224,9 +224,9 @@ func (r *RawClient) UpdateLabTest( func (r *RawClient) GetMarkers( ctx context.Context, - request *vitalgo.LabTestsGetMarkersRequest, + request *v505.LabTestsGetMarkersRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GetMarkersResponse], error) { +) (*core.Response[*v505.GetMarkersResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -245,7 +245,7 @@ func (r *RawClient) GetMarkers( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GetMarkersResponse + var response *v505.GetMarkersResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -257,13 +257,13 @@ func (r *RawClient) GetMarkers( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GetMarkersResponse]{ + return &core.Response[*v505.GetMarkersResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -272,9 +272,9 @@ func (r *RawClient) GetMarkers( func (r *RawClient) GetMarkersForOrderSet( ctx context.Context, - request *vitalgo.LabTestsGetMarkersForOrderSetRequest, + request *v505.LabTestsGetMarkersForOrderSetRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GetMarkersResponse], error) { +) (*core.Response[*v505.GetMarkersResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -294,7 +294,7 @@ func (r *RawClient) GetMarkersForOrderSet( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.GetMarkersResponse + var response *v505.GetMarkersResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -307,13 +307,13 @@ func (r *RawClient) GetMarkersForOrderSet( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GetMarkersResponse]{ + return &core.Response[*v505.GetMarkersResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -323,9 +323,9 @@ func (r *RawClient) GetMarkersForOrderSet( func (r *RawClient) GetMarkersForLabTest( ctx context.Context, labTestId string, - request *vitalgo.LabTestsGetMarkersForLabTestRequest, + request *v505.LabTestsGetMarkersForLabTestRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GetMarkersResponse], error) { +) (*core.Response[*v505.GetMarkersResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -347,7 +347,7 @@ func (r *RawClient) GetMarkersForLabTest( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GetMarkersResponse + var response *v505.GetMarkersResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -359,13 +359,13 @@ func (r *RawClient) GetMarkersForLabTest( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GetMarkersResponse]{ + return &core.Response[*v505.GetMarkersResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -376,9 +376,9 @@ func (r *RawClient) GetMarkersByLabAndProviderId( ctx context.Context, providerId string, labId int, - request *vitalgo.LabTestsGetMarkersByLabAndProviderIdRequest, + request *v505.LabTestsGetMarkersByLabAndProviderIdRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingMarker], error) { +) (*core.Response[*v505.ClientFacingMarker], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -401,7 +401,7 @@ func (r *RawClient) GetMarkersByLabAndProviderId( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingMarker + var response *v505.ClientFacingMarker raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -413,13 +413,13 @@ func (r *RawClient) GetMarkersByLabAndProviderId( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingMarker]{ + return &core.Response[*v505.ClientFacingMarker]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -429,7 +429,7 @@ func (r *RawClient) GetMarkersByLabAndProviderId( func (r *RawClient) GetLabs( ctx context.Context, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingLab], error) { +) (*core.Response[[]*v505.ClientFacingLab], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -441,7 +441,7 @@ func (r *RawClient) GetLabs( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingLab + var response []*v505.ClientFacingLab raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -458,7 +458,7 @@ func (r *RawClient) GetLabs( if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingLab]{ + return &core.Response[[]*v505.ClientFacingLab]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -467,9 +467,9 @@ func (r *RawClient) GetLabs( func (r *RawClient) GetPaginated( ctx context.Context, - request *vitalgo.LabTestsGetPaginatedRequest, + request *v505.LabTestsGetPaginatedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.LabTestResourcesResponse], error) { +) (*core.Response[*v505.LabTestResourcesResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -488,7 +488,7 @@ func (r *RawClient) GetPaginated( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.LabTestResourcesResponse + var response *v505.LabTestResourcesResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -500,13 +500,13 @@ func (r *RawClient) GetPaginated( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.LabTestResourcesResponse]{ + return &core.Response[*v505.LabTestResourcesResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -544,7 +544,7 @@ func (r *RawClient) GetLabTestCollectionInstructionPdf( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -559,9 +559,9 @@ func (r *RawClient) GetLabTestCollectionInstructionPdf( func (r *RawClient) GetOrders( ctx context.Context, - request *vitalgo.LabTestsGetOrdersRequest, + request *v505.LabTestsGetOrdersRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GetOrdersResponse], error) { +) (*core.Response[*v505.GetOrdersResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -580,7 +580,7 @@ func (r *RawClient) GetOrders( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GetOrdersResponse + var response *v505.GetOrdersResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -592,13 +592,13 @@ func (r *RawClient) GetOrders( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GetOrdersResponse]{ + return &core.Response[*v505.GetOrdersResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -607,9 +607,9 @@ func (r *RawClient) GetOrders( func (r *RawClient) GetPhlebotomyAppointmentAvailability( ctx context.Context, - request *vitalgo.LabTestsGetPhlebotomyAppointmentAvailabilityRequest, + request *v505.LabTestsGetPhlebotomyAppointmentAvailabilityRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.AppointmentAvailabilitySlots], error) { +) (*core.Response[*v505.AppointmentAvailabilitySlots], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -629,7 +629,7 @@ func (r *RawClient) GetPhlebotomyAppointmentAvailability( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.AppointmentAvailabilitySlots + var response *v505.AppointmentAvailabilitySlots raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -642,13 +642,13 @@ func (r *RawClient) GetPhlebotomyAppointmentAvailability( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.AppointmentAvailabilitySlots]{ + return &core.Response[*v505.AppointmentAvailabilitySlots]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -659,9 +659,9 @@ func (r *RawClient) BookPhlebotomyAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.AppointmentBookingRequest, + request *v505.AppointmentBookingRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingAppointment], error) { +) (*core.Response[*v505.ClientFacingAppointment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -676,7 +676,7 @@ func (r *RawClient) BookPhlebotomyAppointment( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingAppointment + var response *v505.ClientFacingAppointment raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -689,13 +689,13 @@ func (r *RawClient) BookPhlebotomyAppointment( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingAppointment]{ + return &core.Response[*v505.ClientFacingAppointment]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -706,9 +706,9 @@ func (r *RawClient) RequestPhlebotomyAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.RequestAppointmentRequest, + request *v505.RequestAppointmentRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingAppointment], error) { +) (*core.Response[*v505.ClientFacingAppointment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -724,7 +724,7 @@ func (r *RawClient) RequestPhlebotomyAppointment( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.ClientFacingAppointment + var response *v505.ClientFacingAppointment raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -737,13 +737,13 @@ func (r *RawClient) RequestPhlebotomyAppointment( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingAppointment]{ + return &core.Response[*v505.ClientFacingAppointment]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -754,9 +754,9 @@ func (r *RawClient) ReschedulePhlebotomyAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.AppointmentRescheduleRequest, + request *v505.AppointmentRescheduleRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingAppointment], error) { +) (*core.Response[*v505.ClientFacingAppointment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -771,7 +771,7 @@ func (r *RawClient) ReschedulePhlebotomyAppointment( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingAppointment + var response *v505.ClientFacingAppointment raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -784,13 +784,13 @@ func (r *RawClient) ReschedulePhlebotomyAppointment( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingAppointment]{ + return &core.Response[*v505.ClientFacingAppointment]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -801,9 +801,9 @@ func (r *RawClient) CancelPhlebotomyAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest, + request *v505.ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingAppointment], error) { +) (*core.Response[*v505.ClientFacingAppointment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -819,7 +819,7 @@ func (r *RawClient) CancelPhlebotomyAppointment( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.ClientFacingAppointment + var response *v505.ClientFacingAppointment raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -832,13 +832,13 @@ func (r *RawClient) CancelPhlebotomyAppointment( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingAppointment]{ + return &core.Response[*v505.ClientFacingAppointment]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -848,7 +848,7 @@ func (r *RawClient) CancelPhlebotomyAppointment( func (r *RawClient) GetPhlebotomyAppointmentCancellationReason( ctx context.Context, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingAppointmentCancellationReason], error) { +) (*core.Response[[]*v505.ClientFacingAppointmentCancellationReason], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -860,7 +860,7 @@ func (r *RawClient) GetPhlebotomyAppointmentCancellationReason( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingAppointmentCancellationReason + var response []*v505.ClientFacingAppointmentCancellationReason raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -877,7 +877,7 @@ func (r *RawClient) GetPhlebotomyAppointmentCancellationReason( if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingAppointmentCancellationReason]{ + return &core.Response[[]*v505.ClientFacingAppointmentCancellationReason]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -889,7 +889,7 @@ func (r *RawClient) GetPhlebotomyAppointment( // Your Order ID. orderId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingAppointment], error) { +) (*core.Response[*v505.ClientFacingAppointment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -904,7 +904,7 @@ func (r *RawClient) GetPhlebotomyAppointment( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingAppointment + var response *v505.ClientFacingAppointment raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -916,13 +916,13 @@ func (r *RawClient) GetPhlebotomyAppointment( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingAppointment]{ + return &core.Response[*v505.ClientFacingAppointment]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -931,9 +931,9 @@ func (r *RawClient) GetPhlebotomyAppointment( func (r *RawClient) GetAreaInfo( ctx context.Context, - request *vitalgo.LabTestsGetAreaInfoRequest, + request *v505.LabTestsGetAreaInfoRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.AreaInfo], error) { +) (*core.Response[*v505.AreaInfo], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -952,7 +952,7 @@ func (r *RawClient) GetAreaInfo( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.AreaInfo + var response *v505.AreaInfo raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -964,13 +964,13 @@ func (r *RawClient) GetAreaInfo( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.AreaInfo]{ + return &core.Response[*v505.AreaInfo]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -979,9 +979,9 @@ func (r *RawClient) GetAreaInfo( func (r *RawClient) GetPscInfo( ctx context.Context, - request *vitalgo.LabTestsGetPscInfoRequest, + request *v505.LabTestsGetPscInfoRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.PscInfo], error) { +) (*core.Response[*v505.PscInfo], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1000,7 +1000,7 @@ func (r *RawClient) GetPscInfo( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.PscInfo + var response *v505.PscInfo raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1012,13 +1012,13 @@ func (r *RawClient) GetPscInfo( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.PscInfo]{ + return &core.Response[*v505.PscInfo]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1029,9 +1029,9 @@ func (r *RawClient) GetOrderPscInfo( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.LabTestsGetOrderPscInfoRequest, + request *v505.LabTestsGetOrderPscInfoRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.PscInfo], error) { +) (*core.Response[*v505.PscInfo], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1053,7 +1053,7 @@ func (r *RawClient) GetOrderPscInfo( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.PscInfo + var response *v505.PscInfo raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1065,13 +1065,13 @@ func (r *RawClient) GetOrderPscInfo( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.PscInfo]{ + return &core.Response[*v505.PscInfo]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1109,7 +1109,7 @@ func (r *RawClient) GetResultPdf( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -1126,7 +1126,7 @@ func (r *RawClient) GetResultMetadata( ctx context.Context, orderId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.LabResultsMetadata], error) { +) (*core.Response[*v505.LabResultsMetadata], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1141,7 +1141,7 @@ func (r *RawClient) GetResultMetadata( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.LabResultsMetadata + var response *v505.LabResultsMetadata raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1153,13 +1153,13 @@ func (r *RawClient) GetResultMetadata( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.LabResultsMetadata]{ + return &core.Response[*v505.LabResultsMetadata]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1170,7 +1170,7 @@ func (r *RawClient) GetResultRaw( ctx context.Context, orderId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.LabResultsRaw], error) { +) (*core.Response[*v505.LabResultsRaw], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1185,7 +1185,7 @@ func (r *RawClient) GetResultRaw( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.LabResultsRaw + var response *v505.LabResultsRaw raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1197,13 +1197,13 @@ func (r *RawClient) GetResultRaw( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.LabResultsRaw]{ + return &core.Response[*v505.LabResultsRaw]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1213,7 +1213,7 @@ func (r *RawClient) GetResultRaw( func (r *RawClient) GetLabelsPdf( ctx context.Context, orderId string, - request *vitalgo.LabTestsGetLabelsPdfRequest, + request *v505.LabTestsGetLabelsPdfRequest, opts ...option.RequestOption, ) (*core.Response[io.Reader], error) { options := core.NewRequestOptions(opts...) @@ -1249,7 +1249,7 @@ func (r *RawClient) GetLabelsPdf( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -1264,9 +1264,9 @@ func (r *RawClient) GetLabelsPdf( func (r *RawClient) GetPscAppointmentAvailability( ctx context.Context, - request *vitalgo.LabTestsGetPscAppointmentAvailabilityRequest, + request *v505.LabTestsGetPscAppointmentAvailabilityRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.AppointmentAvailabilitySlots], error) { +) (*core.Response[*v505.AppointmentAvailabilitySlots], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1285,7 +1285,7 @@ func (r *RawClient) GetPscAppointmentAvailability( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.AppointmentAvailabilitySlots + var response *v505.AppointmentAvailabilitySlots raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1297,13 +1297,13 @@ func (r *RawClient) GetPscAppointmentAvailability( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.AppointmentAvailabilitySlots]{ + return &core.Response[*v505.AppointmentAvailabilitySlots]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1314,9 +1314,9 @@ func (r *RawClient) BookPscAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.AppointmentBookingRequest, + request *v505.LabTestsBookPscAppointmentRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingAppointment], error) { +) (*core.Response[*v505.ClientFacingAppointment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1331,7 +1331,14 @@ func (r *RawClient) BookPscAppointment( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingAppointment + if request.IdempotencyKey != nil { + headers.Add("x-idempotency-key", *request.IdempotencyKey) + } + if request.IdempotencyError != nil { + headers.Add("x-idempotency-error", *request.IdempotencyError) + } + headers.Add("Content-Type", "application/json") + var response *v505.ClientFacingAppointment raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1344,13 +1351,13 @@ func (r *RawClient) BookPscAppointment( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingAppointment]{ + return &core.Response[*v505.ClientFacingAppointment]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1361,9 +1368,9 @@ func (r *RawClient) ReschedulePscAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.AppointmentRescheduleRequest, + request *v505.AppointmentRescheduleRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingAppointment], error) { +) (*core.Response[*v505.ClientFacingAppointment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1378,7 +1385,7 @@ func (r *RawClient) ReschedulePscAppointment( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingAppointment + var response *v505.ClientFacingAppointment raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1391,13 +1398,13 @@ func (r *RawClient) ReschedulePscAppointment( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingAppointment]{ + return &core.Response[*v505.ClientFacingAppointment]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1408,9 +1415,9 @@ func (r *RawClient) CancelPscAppointment( ctx context.Context, // Your Order ID. orderId string, - request *vitalgo.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest, + request *v505.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingAppointment], error) { +) (*core.Response[*v505.ClientFacingAppointment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1426,7 +1433,7 @@ func (r *RawClient) CancelPscAppointment( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.ClientFacingAppointment + var response *v505.ClientFacingAppointment raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1439,13 +1446,13 @@ func (r *RawClient) CancelPscAppointment( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingAppointment]{ + return &core.Response[*v505.ClientFacingAppointment]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1455,7 +1462,7 @@ func (r *RawClient) CancelPscAppointment( func (r *RawClient) GetPscAppointmentCancellationReason( ctx context.Context, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingAppointmentCancellationReason], error) { +) (*core.Response[[]*v505.ClientFacingAppointmentCancellationReason], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1467,7 +1474,7 @@ func (r *RawClient) GetPscAppointmentCancellationReason( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingAppointmentCancellationReason + var response []*v505.ClientFacingAppointmentCancellationReason raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1484,7 +1491,7 @@ func (r *RawClient) GetPscAppointmentCancellationReason( if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingAppointmentCancellationReason]{ + return &core.Response[[]*v505.ClientFacingAppointmentCancellationReason]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1496,7 +1503,7 @@ func (r *RawClient) GetPscAppointment( // Your Order ID. orderId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingAppointment], error) { +) (*core.Response[*v505.ClientFacingAppointment], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1511,7 +1518,7 @@ func (r *RawClient) GetPscAppointment( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingAppointment + var response *v505.ClientFacingAppointment raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1523,13 +1530,13 @@ func (r *RawClient) GetPscAppointment( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingAppointment]{ + return &core.Response[*v505.ClientFacingAppointment]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1568,7 +1575,7 @@ func (r *RawClient) GetOrderCollectionInstructionPdf( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -1613,7 +1620,7 @@ func (r *RawClient) GetOrderRequistionPdf( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -1658,7 +1665,7 @@ func (r *RawClient) GetOrderAbnPdf( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -1676,7 +1683,7 @@ func (r *RawClient) GetOrder( // Your Order ID. orderId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingOrder], error) { +) (*core.Response[*v505.ClientFacingOrder], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1691,7 +1698,7 @@ func (r *RawClient) GetOrder( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingOrder + var response *v505.ClientFacingOrder raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1703,13 +1710,13 @@ func (r *RawClient) GetOrder( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingOrder]{ + return &core.Response[*v505.ClientFacingOrder]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1718,9 +1725,9 @@ func (r *RawClient) GetOrder( func (r *RawClient) CreateOrder( ctx context.Context, - request *vitalgo.CreateOrderRequestCompatible, + request *v505.CreateOrderRequestCompatible, opts ...option.RequestOption, -) (*core.Response[*vitalgo.PostOrderResponse], error) { +) (*core.Response[*v505.PostOrderResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1739,7 +1746,7 @@ func (r *RawClient) CreateOrder( headers.Add("X-Idempotency-Error", *request.IdempotencyError) } headers.Add("Content-Type", "application/json") - var response *vitalgo.PostOrderResponse + var response *v505.PostOrderResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1752,13 +1759,13 @@ func (r *RawClient) CreateOrder( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.PostOrderResponse]{ + return &core.Response[*v505.PostOrderResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1767,9 +1774,9 @@ func (r *RawClient) CreateOrder( func (r *RawClient) ImportOrder( ctx context.Context, - request *vitalgo.ImportOrderBody, + request *v505.ImportOrderBody, opts ...option.RequestOption, -) (*core.Response[*vitalgo.PostOrderResponse], error) { +) (*core.Response[*v505.PostOrderResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1782,7 +1789,7 @@ func (r *RawClient) ImportOrder( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.PostOrderResponse + var response *v505.PostOrderResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1795,13 +1802,13 @@ func (r *RawClient) ImportOrder( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.PostOrderResponse]{ + return &core.Response[*v505.PostOrderResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1813,7 +1820,7 @@ func (r *RawClient) CancelOrder( // Your Order ID. orderId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.PostOrderResponse], error) { +) (*core.Response[*v505.PostOrderResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1828,7 +1835,7 @@ func (r *RawClient) CancelOrder( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.PostOrderResponse + var response *v505.PostOrderResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1840,13 +1847,13 @@ func (r *RawClient) CancelOrder( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.PostOrderResponse]{ + return &core.Response[*v505.PostOrderResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1856,7 +1863,7 @@ func (r *RawClient) CancelOrder( func (r *RawClient) SimulateOrderProcess( ctx context.Context, orderId string, - request *vitalgo.LabTestsSimulateOrderProcessRequest, + request *v505.LabTestsSimulateOrderProcessRequest, opts ...option.RequestOption, ) (*core.Response[any], error) { options := core.NewRequestOptions(opts...) @@ -1894,7 +1901,7 @@ func (r *RawClient) SimulateOrderProcess( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -1912,7 +1919,7 @@ func (r *RawClient) UpdateOnSiteCollectionOrderDrawCompleted( // Your Order ID. orderId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.PostOrderResponse], error) { +) (*core.Response[*v505.PostOrderResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1927,7 +1934,7 @@ func (r *RawClient) UpdateOnSiteCollectionOrderDrawCompleted( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.PostOrderResponse + var response *v505.PostOrderResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1939,13 +1946,13 @@ func (r *RawClient) UpdateOnSiteCollectionOrderDrawCompleted( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.PostOrderResponse]{ + return &core.Response[*v505.PostOrderResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1954,9 +1961,9 @@ func (r *RawClient) UpdateOnSiteCollectionOrderDrawCompleted( func (r *RawClient) ValidateIcdCodes( ctx context.Context, - request *vitalgo.ValidateIcdCodesBody, + request *v505.ValidateIcdCodesBody, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ValidateIcdCodesResponse], error) { +) (*core.Response[*v505.ValidateIcdCodesResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1969,7 +1976,7 @@ func (r *RawClient) ValidateIcdCodes( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.ValidateIcdCodesResponse + var response *v505.ValidateIcdCodesResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1982,13 +1989,13 @@ func (r *RawClient) ValidateIcdCodes( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ValidateIcdCodesResponse]{ + return &core.Response[*v505.ValidateIcdCodesResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/link.go b/link.go index ef0713f..8556d59 100644 --- a/link.go +++ b/link.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) @@ -62,6 +62,27 @@ func (b *BulkExportConnectionsBody) SetNextToken(nextToken *string) { b.require(bulkExportConnectionsBodyFieldNextToken) } +func (b *BulkExportConnectionsBody) UnmarshalJSON(data []byte) error { + type unmarshaler BulkExportConnectionsBody + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *b = BulkExportConnectionsBody(body) + return nil +} + +func (b *BulkExportConnectionsBody) MarshalJSON() ([]byte, error) { + type embed BulkExportConnectionsBody + var marshaler = struct { + embed + }{ + embed: embed(*b), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( bulkImportConnectionsBodyFieldTeamId = big.NewInt(1 << 0) bulkImportConnectionsBodyFieldProvider = big.NewInt(1 << 1) @@ -72,7 +93,7 @@ var ( type BulkImportConnectionsBody struct { TeamId *LinkBulkImportRequestTeamId `json:"-" url:"team_id,omitempty"` Provider OAuthProviders `json:"provider" url:"-"` - Connections []*ConnectionRecipe `json:"connections,omitempty" url:"-"` + Connections []*ConnectionRecipe `json:"connections" url:"-"` // Whether or not the endpoint should wait for the Bulk Op to complete before responding. // // When `wait_for_completion` is enabled, the endpoint may respond 200 OK if the Bulk Op takes less than 20 seconds to complete. @@ -120,6 +141,27 @@ func (b *BulkImportConnectionsBody) SetWaitForCompletion(waitForCompletion *bool b.require(bulkImportConnectionsBodyFieldWaitForCompletion) } +func (b *BulkImportConnectionsBody) UnmarshalJSON(data []byte) error { + type unmarshaler BulkImportConnectionsBody + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *b = BulkImportConnectionsBody(body) + return nil +} + +func (b *BulkImportConnectionsBody) MarshalJSON() ([]byte, error) { + type embed BulkImportConnectionsBody + var marshaler = struct { + embed + }{ + embed: embed(*b), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( bulkPauseConnectionsBodyFieldTeamId = big.NewInt(1 << 0) bulkPauseConnectionsBodyFieldUserIds = big.NewInt(1 << 1) @@ -128,7 +170,7 @@ var ( type BulkPauseConnectionsBody struct { TeamId *LinkBulkPauseRequestTeamId `json:"-" url:"team_id,omitempty"` - UserIds []string `json:"user_ids,omitempty" url:"-"` + UserIds []string `json:"user_ids" url:"-"` Provider OAuthProviders `json:"provider" url:"-"` // Private bitmask of fields set to an explicit value and therefore not to be omitted @@ -163,6 +205,27 @@ func (b *BulkPauseConnectionsBody) SetProvider(provider OAuthProviders) { b.require(bulkPauseConnectionsBodyFieldProvider) } +func (b *BulkPauseConnectionsBody) UnmarshalJSON(data []byte) error { + type unmarshaler BulkPauseConnectionsBody + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *b = BulkPauseConnectionsBody(body) + return nil +} + +func (b *BulkPauseConnectionsBody) MarshalJSON() ([]byte, error) { + type embed BulkPauseConnectionsBody + var marshaler = struct { + embed + }{ + embed: embed(*b), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( bulkTriggerHistoricalPullBodyFieldTeamId = big.NewInt(1 << 0) bulkTriggerHistoricalPullBodyFieldUserIds = big.NewInt(1 << 1) @@ -172,7 +235,7 @@ var ( type BulkTriggerHistoricalPullBody struct { TeamId *LinkBulkTriggerHistoricalPullRequestTeamId `json:"-" url:"team_id,omitempty"` - UserIds []string `json:"user_ids,omitempty" url:"-"` + UserIds []string `json:"user_ids" url:"-"` Provider OAuthProviders `json:"provider" url:"-"` // Whether or not the endpoint should wait for the Bulk Op to complete before responding. // @@ -221,6 +284,27 @@ func (b *BulkTriggerHistoricalPullBody) SetWaitForCompletion(waitForCompletion * b.require(bulkTriggerHistoricalPullBodyFieldWaitForCompletion) } +func (b *BulkTriggerHistoricalPullBody) UnmarshalJSON(data []byte) error { + type unmarshaler BulkTriggerHistoricalPullBody + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *b = BulkTriggerHistoricalPullBody(body) + return nil +} + +func (b *BulkTriggerHistoricalPullBody) MarshalJSON() ([]byte, error) { + type embed BulkTriggerHistoricalPullBody + var marshaler = struct { + embed + }{ + embed: embed(*b), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( linkCodeCreateRequestFieldUserId = big.NewInt(1 << 0) linkCodeCreateRequestFieldExpiresAt = big.NewInt(1 << 1) @@ -290,6 +374,27 @@ func (c *CompletePasswordProviderMfaBody) SetMfaCode(mfaCode string) { c.require(completePasswordProviderMfaBodyFieldMfaCode) } +func (c *CompletePasswordProviderMfaBody) UnmarshalJSON(data []byte) error { + type unmarshaler CompletePasswordProviderMfaBody + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *c = CompletePasswordProviderMfaBody(body) + return nil +} + +func (c *CompletePasswordProviderMfaBody) MarshalJSON() ([]byte, error) { + type embed CompletePasswordProviderMfaBody + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( demoConnectionCreationPayloadFieldUserId = big.NewInt(1 << 0) demoConnectionCreationPayloadFieldProvider = big.NewInt(1 << 1) @@ -326,6 +431,27 @@ func (d *DemoConnectionCreationPayload) SetProvider(provider DemoProviders) { d.require(demoConnectionCreationPayloadFieldProvider) } +func (d *DemoConnectionCreationPayload) UnmarshalJSON(data []byte) error { + type unmarshaler DemoConnectionCreationPayload + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *d = DemoConnectionCreationPayload(body) + return nil +} + +func (d *DemoConnectionCreationPayload) MarshalJSON() ([]byte, error) { + type embed DemoConnectionCreationPayload + var marshaler = struct { + embed + }{ + embed: embed(*d), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, d.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( emailProviderAuthLinkFieldVitalLinkToken = big.NewInt(1 << 0) emailProviderAuthLinkFieldEmail = big.NewInt(1 << 1) @@ -378,14 +504,41 @@ func (e *EmailProviderAuthLink) SetRegion(region *Region) { e.require(emailProviderAuthLinkFieldRegion) } +func (e *EmailProviderAuthLink) UnmarshalJSON(data []byte) error { + type unmarshaler EmailProviderAuthLink + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *e = EmailProviderAuthLink(body) + return nil +} + +func (e *EmailProviderAuthLink) MarshalJSON() ([]byte, error) { + type embed EmailProviderAuthLink + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( - manualConnectionDataFieldUserId = big.NewInt(1 << 0) - manualConnectionDataFieldProviderId = big.NewInt(1 << 1) + manualConnectionDataFieldVitalIosSdkVersion = big.NewInt(1 << 0) + manualConnectionDataFieldVitalAndroidSdkVersion = big.NewInt(1 << 1) + manualConnectionDataFieldUserId = big.NewInt(1 << 2) + manualConnectionDataFieldProviderId = big.NewInt(1 << 3) + manualConnectionDataFieldGrantedPermissions = big.NewInt(1 << 4) ) type ManualConnectionData struct { - UserId string `json:"user_id" url:"-"` - ProviderId *string `json:"provider_id,omitempty" url:"-"` + VitalIosSdkVersion *string `json:"-" url:"-"` + VitalAndroidSdkVersion *string `json:"-" url:"-"` + UserId string `json:"user_id" url:"-"` + ProviderId *string `json:"provider_id,omitempty" url:"-"` + GrantedPermissions []string `json:"granted_permissions,omitempty" url:"-"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -398,6 +551,20 @@ func (m *ManualConnectionData) require(field *big.Int) { m.explicitFields.Or(m.explicitFields, field) } +// SetVitalIosSdkVersion sets the VitalIosSdkVersion field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ManualConnectionData) SetVitalIosSdkVersion(vitalIosSdkVersion *string) { + m.VitalIosSdkVersion = vitalIosSdkVersion + m.require(manualConnectionDataFieldVitalIosSdkVersion) +} + +// SetVitalAndroidSdkVersion sets the VitalAndroidSdkVersion field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ManualConnectionData) SetVitalAndroidSdkVersion(vitalAndroidSdkVersion *string) { + m.VitalAndroidSdkVersion = vitalAndroidSdkVersion + m.require(manualConnectionDataFieldVitalAndroidSdkVersion) +} + // SetUserId sets the UserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (m *ManualConnectionData) SetUserId(userId string) { @@ -412,6 +579,34 @@ func (m *ManualConnectionData) SetProviderId(providerId *string) { m.require(manualConnectionDataFieldProviderId) } +// SetGrantedPermissions sets the GrantedPermissions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *ManualConnectionData) SetGrantedPermissions(grantedPermissions []string) { + m.GrantedPermissions = grantedPermissions + m.require(manualConnectionDataFieldGrantedPermissions) +} + +func (m *ManualConnectionData) UnmarshalJSON(data []byte) error { + type unmarshaler ManualConnectionData + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *m = ManualConnectionData(body) + return nil +} + +func (m *ManualConnectionData) MarshalJSON() ([]byte, error) { + type embed ManualConnectionData + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( individualProviderDataFieldVitalLinkToken = big.NewInt(1 << 0) individualProviderDataFieldUsername = big.NewInt(1 << 1) @@ -467,6 +662,27 @@ func (i *IndividualProviderData) SetRegion(region *Region) { i.require(individualProviderDataFieldRegion) } +func (i *IndividualProviderData) UnmarshalJSON(data []byte) error { + type unmarshaler IndividualProviderData + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *i = IndividualProviderData(body) + return nil +} + +func (i *IndividualProviderData) MarshalJSON() ([]byte, error) { + type embed IndividualProviderData + var marshaler = struct { + embed + }{ + embed: embed(*i), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, i.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( emailAuthLinkFieldVitalLinkToken = big.NewInt(1 << 0) emailAuthLinkFieldEmail = big.NewInt(1 << 1) @@ -528,6 +744,27 @@ func (e *EmailAuthLink) SetRegion(region *Region) { e.require(emailAuthLinkFieldRegion) } +func (e *EmailAuthLink) UnmarshalJSON(data []byte) error { + type unmarshaler EmailAuthLink + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *e = EmailAuthLink(body) + return nil +} + +func (e *EmailAuthLink) MarshalJSON() ([]byte, error) { + type embed EmailAuthLink + var marshaler = struct { + embed + }{ + embed: embed(*e), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, e.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( linkGenerateOauthLinkRequestFieldVitalLinkToken = big.NewInt(1 << 0) ) @@ -603,6 +840,27 @@ func (l *LinkTokenValidationRequest) SetToken(token string) { l.require(linkTokenValidationRequestFieldToken) } +func (l *LinkTokenValidationRequest) UnmarshalJSON(data []byte) error { + type unmarshaler LinkTokenValidationRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *l = LinkTokenValidationRequest(body) + return nil +} + +func (l *LinkTokenValidationRequest) MarshalJSON() ([]byte, error) { + type embed LinkTokenValidationRequest + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( linkListBulkOpsRequestFieldNextCursor = big.NewInt(1 << 0) linkListBulkOpsRequestFieldPageSize = big.NewInt(1 << 1) @@ -707,6 +965,27 @@ func (p *PasswordAuthLink) SetAuthType(authType AuthType) { p.require(passwordAuthLinkFieldAuthType) } +func (p *PasswordAuthLink) UnmarshalJSON(data []byte) error { + type unmarshaler PasswordAuthLink + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *p = PasswordAuthLink(body) + return nil +} + +func (p *PasswordAuthLink) MarshalJSON() ([]byte, error) { + type embed PasswordAuthLink + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( beginLinkTokenRequestFieldLinkToken = big.NewInt(1 << 0) beginLinkTokenRequestFieldProvider = big.NewInt(1 << 1) @@ -741,6 +1020,27 @@ func (b *BeginLinkTokenRequest) SetProvider(provider Providers) { b.require(beginLinkTokenRequestFieldProvider) } +func (b *BeginLinkTokenRequest) UnmarshalJSON(data []byte) error { + type unmarshaler BeginLinkTokenRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *b = BeginLinkTokenRequest(body) + return nil +} + +func (b *BeginLinkTokenRequest) MarshalJSON() ([]byte, error) { + type embed BeginLinkTokenRequest + var marshaler = struct { + embed + }{ + embed: embed(*b), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( linkTokenExchangeFieldUserId = big.NewInt(1 << 0) linkTokenExchangeFieldProvider = big.NewInt(1 << 1) @@ -829,6 +1129,27 @@ func (l *LinkTokenExchange) SetOnClose(onClose *string) { l.require(linkTokenExchangeFieldOnClose) } +func (l *LinkTokenExchange) UnmarshalJSON(data []byte) error { + type unmarshaler LinkTokenExchange + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *l = LinkTokenExchange(body) + return nil +} + +func (l *LinkTokenExchange) MarshalJSON() ([]byte, error) { + type embed LinkTokenExchange + var marshaler = struct { + embed + }{ + embed: embed(*l), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( linkTokenStateRequestFieldVitalLinkToken = big.NewInt(1 << 0) ) @@ -1813,6 +2134,7 @@ const ( ManualProvidersAppleHealthKit ManualProviders = "apple_health_kit" ManualProvidersManual ManualProviders = "manual" ManualProvidersHealthConnect ManualProviders = "health_connect" + ManualProvidersSamsungHealth ManualProviders = "samsung_health" ) func NewManualProvidersFromString(s string) (ManualProviders, error) { @@ -1835,6 +2157,8 @@ func NewManualProvidersFromString(s string) (ManualProviders, error) { return ManualProvidersManual, nil case "health_connect": return ManualProvidersHealthConnect, nil + case "samsung_health": + return ManualProvidersSamsungHealth, nil } var t ManualProviders return "", fmt.Errorf("%s is not a valid %T", s, t) diff --git a/link/client.go b/link/client.go index 10f3b64..0a1617a 100644 --- a/link/client.go +++ b/link/client.go @@ -4,10 +4,10 @@ package link import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -34,9 +34,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) ListBulkOps( ctx context.Context, - request *vitalgo.LinkListBulkOpsRequest, + request *v505.LinkListBulkOpsRequest, opts ...option.RequestOption, -) (*vitalgo.BulkOpsResponse, error) { +) (*v505.BulkOpsResponse, error) { response, err := c.WithRawResponse.ListBulkOps( ctx, request, @@ -50,9 +50,9 @@ func (c *Client) ListBulkOps( func (c *Client) BulkImport( ctx context.Context, - request *vitalgo.BulkImportConnectionsBody, + request *v505.BulkImportConnectionsBody, opts ...option.RequestOption, -) (*vitalgo.BulkImportConnectionsResponse, error) { +) (*v505.BulkImportConnectionsResponse, error) { response, err := c.WithRawResponse.BulkImport( ctx, request, @@ -66,7 +66,7 @@ func (c *Client) BulkImport( func (c *Client) BulkTriggerHistoricalPull( ctx context.Context, - request *vitalgo.BulkTriggerHistoricalPullBody, + request *v505.BulkTriggerHistoricalPullBody, opts ...option.RequestOption, ) (any, error) { response, err := c.WithRawResponse.BulkTriggerHistoricalPull( @@ -82,9 +82,9 @@ func (c *Client) BulkTriggerHistoricalPull( func (c *Client) BulkExport( ctx context.Context, - request *vitalgo.BulkExportConnectionsBody, + request *v505.BulkExportConnectionsBody, opts ...option.RequestOption, -) (*vitalgo.BulkExportConnectionsResponse, error) { +) (*v505.BulkExportConnectionsResponse, error) { response, err := c.WithRawResponse.BulkExport( ctx, request, @@ -98,7 +98,7 @@ func (c *Client) BulkExport( func (c *Client) BulkPause( ctx context.Context, - request *vitalgo.BulkPauseConnectionsBody, + request *v505.BulkPauseConnectionsBody, opts ...option.RequestOption, ) (any, error) { response, err := c.WithRawResponse.BulkPause( @@ -120,9 +120,9 @@ func (c *Client) BulkPause( // pass in your own custom redirect_url parameter. func (c *Client) Token( ctx context.Context, - request *vitalgo.LinkTokenExchange, + request *v505.LinkTokenExchange, opts ...option.RequestOption, -) (*vitalgo.LinkTokenExchangeResponse, error) { +) (*v505.LinkTokenExchangeResponse, error) { response, err := c.WithRawResponse.Token( ctx, request, @@ -136,7 +136,7 @@ func (c *Client) Token( func (c *Client) IsTokenValid( ctx context.Context, - request *vitalgo.LinkTokenValidationRequest, + request *v505.LinkTokenValidationRequest, opts ...option.RequestOption, ) (map[string]any, error) { response, err := c.WithRawResponse.IsTokenValid( @@ -153,9 +153,9 @@ func (c *Client) IsTokenValid( // Generate a token to invite a user of Vital mobile app to your team func (c *Client) CodeCreate( ctx context.Context, - request *vitalgo.LinkCodeCreateRequest, + request *v505.LinkCodeCreateRequest, opts ...option.RequestOption, -) (*vitalgo.VitalTokenCreatedResponse, error) { +) (*v505.VitalTokenCreatedResponse, error) { response, err := c.WithRawResponse.CodeCreate( ctx, request, @@ -171,7 +171,7 @@ func (c *Client) CodeCreate( // Start link token process func (c *Client) StartConnect( ctx context.Context, - request *vitalgo.BeginLinkTokenRequest, + request *v505.BeginLinkTokenRequest, opts ...option.RequestOption, ) (map[string]any, error) { response, err := c.WithRawResponse.StartConnect( @@ -189,7 +189,7 @@ func (c *Client) StartConnect( // Check link token state - can be hit continuously used as heartbeat func (c *Client) TokenState( ctx context.Context, - request *vitalgo.LinkTokenStateRequest, + request *v505.LinkTokenStateRequest, opts ...option.RequestOption, ) (map[string]any, error) { response, err := c.WithRawResponse.TokenState( @@ -206,7 +206,7 @@ func (c *Client) TokenState( // Deprecated. Use `POST /v2/link/provider/email/{provider}` instead. func (c *Client) EmailAuth( ctx context.Context, - request *vitalgo.EmailAuthLink, + request *v505.EmailAuthLink, opts ...option.RequestOption, ) (any, error) { response, err := c.WithRawResponse.EmailAuth( @@ -223,7 +223,7 @@ func (c *Client) EmailAuth( // Deprecated. Use `POST /v2/link/provider/password/{provider}` instead. func (c *Client) PasswordAuth( ctx context.Context, - request *vitalgo.PasswordAuthLink, + request *v505.PasswordAuthLink, opts ...option.RequestOption, ) (any, error) { response, err := c.WithRawResponse.PasswordAuth( @@ -240,10 +240,10 @@ func (c *Client) PasswordAuth( // This endpoint generates an OAuth link for oauth provider func (c *Client) GenerateOauthLink( ctx context.Context, - oauthProvider *vitalgo.OAuthProviders, - request *vitalgo.LinkGenerateOauthLinkRequest, + oauthProvider *v505.OAuthProviders, + request *v505.LinkGenerateOauthLinkRequest, opts ...option.RequestOption, -) (*vitalgo.Source, error) { +) (*v505.Source, error) { response, err := c.WithRawResponse.GenerateOauthLink( ctx, oauthProvider, @@ -259,10 +259,10 @@ func (c *Client) GenerateOauthLink( // This connects auth providers that are password based. func (c *Client) ConnectPasswordProvider( ctx context.Context, - provider *vitalgo.PasswordProviders, - request *vitalgo.IndividualProviderData, + provider *v505.PasswordProviders, + request *v505.IndividualProviderData, opts ...option.RequestOption, -) (*vitalgo.ProviderLinkResponse, error) { +) (*v505.ProviderLinkResponse, error) { response, err := c.WithRawResponse.ConnectPasswordProvider( ctx, provider, @@ -278,10 +278,10 @@ func (c *Client) ConnectPasswordProvider( // This connects auth providers that are password based. func (c *Client) CompletePasswordProviderMfa( ctx context.Context, - provider *vitalgo.PasswordProviders, - request *vitalgo.CompletePasswordProviderMfaBody, + provider *v505.PasswordProviders, + request *v505.CompletePasswordProviderMfaBody, opts ...option.RequestOption, -) (*vitalgo.ProviderLinkResponse, error) { +) (*v505.ProviderLinkResponse, error) { response, err := c.WithRawResponse.CompletePasswordProviderMfa( ctx, provider, @@ -297,8 +297,8 @@ func (c *Client) CompletePasswordProviderMfa( // This connects auth providers that are email based. func (c *Client) ConnectEmailAuthProvider( ctx context.Context, - provider vitalgo.EmailProviders, - request *vitalgo.EmailProviderAuthLink, + provider v505.EmailProviders, + request *v505.EmailProviderAuthLink, opts ...option.RequestOption, ) (any, error) { response, err := c.WithRawResponse.ConnectEmailAuthProvider( @@ -316,9 +316,9 @@ func (c *Client) ConnectEmailAuthProvider( // GET List of all available providers given the generated link token. func (c *Client) GetAllProviders( ctx context.Context, - request *vitalgo.LinkGetAllProvidersRequest, + request *v505.LinkGetAllProvidersRequest, opts ...option.RequestOption, -) ([]*vitalgo.SourceLink, error) { +) ([]*v505.SourceLink, error) { response, err := c.WithRawResponse.GetAllProviders( ctx, request, @@ -332,8 +332,8 @@ func (c *Client) GetAllProviders( func (c *Client) ConnectManualProvider( ctx context.Context, - provider *vitalgo.ManualProviders, - request *vitalgo.ManualConnectionData, + provider *v505.ManualProviders, + request *v505.ManualConnectionData, opts ...option.RequestOption, ) (map[string]bool, error) { response, err := c.WithRawResponse.ConnectManualProvider( @@ -351,9 +351,9 @@ func (c *Client) ConnectManualProvider( // POST Connect the given Vital user to a demo provider. func (c *Client) ConnectDemoProvider( ctx context.Context, - request *vitalgo.DemoConnectionCreationPayload, + request *v505.DemoConnectionCreationPayload, opts ...option.RequestOption, -) (*vitalgo.DemoConnectionStatus, error) { +) (*v505.DemoConnectionStatus, error) { response, err := c.WithRawResponse.ConnectDemoProvider( ctx, request, diff --git a/link/raw_client.go b/link/raw_client.go index b3084e5..b46dea1 100644 --- a/link/raw_client.go +++ b/link/raw_client.go @@ -4,10 +4,10 @@ package link import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -32,9 +32,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) ListBulkOps( ctx context.Context, - request *vitalgo.LinkListBulkOpsRequest, + request *v505.LinkListBulkOpsRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.BulkOpsResponse], error) { +) (*core.Response[*v505.BulkOpsResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -53,7 +53,7 @@ func (r *RawClient) ListBulkOps( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.BulkOpsResponse + var response *v505.BulkOpsResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -65,13 +65,13 @@ func (r *RawClient) ListBulkOps( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.BulkOpsResponse]{ + return &core.Response[*v505.BulkOpsResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -80,9 +80,9 @@ func (r *RawClient) ListBulkOps( func (r *RawClient) BulkImport( ctx context.Context, - request *vitalgo.BulkImportConnectionsBody, + request *v505.BulkImportConnectionsBody, opts ...option.RequestOption, -) (*core.Response[*vitalgo.BulkImportConnectionsResponse], error) { +) (*core.Response[*v505.BulkImportConnectionsResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -102,7 +102,7 @@ func (r *RawClient) BulkImport( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.BulkImportConnectionsResponse + var response *v505.BulkImportConnectionsResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -115,13 +115,13 @@ func (r *RawClient) BulkImport( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.BulkImportConnectionsResponse]{ + return &core.Response[*v505.BulkImportConnectionsResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -130,7 +130,7 @@ func (r *RawClient) BulkImport( func (r *RawClient) BulkTriggerHistoricalPull( ctx context.Context, - request *vitalgo.BulkTriggerHistoricalPullBody, + request *v505.BulkTriggerHistoricalPullBody, opts ...option.RequestOption, ) (*core.Response[any], error) { options := core.NewRequestOptions(opts...) @@ -165,7 +165,7 @@ func (r *RawClient) BulkTriggerHistoricalPull( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -180,9 +180,9 @@ func (r *RawClient) BulkTriggerHistoricalPull( func (r *RawClient) BulkExport( ctx context.Context, - request *vitalgo.BulkExportConnectionsBody, + request *v505.BulkExportConnectionsBody, opts ...option.RequestOption, -) (*core.Response[*vitalgo.BulkExportConnectionsResponse], error) { +) (*core.Response[*v505.BulkExportConnectionsResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -202,7 +202,7 @@ func (r *RawClient) BulkExport( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.BulkExportConnectionsResponse + var response *v505.BulkExportConnectionsResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -215,13 +215,13 @@ func (r *RawClient) BulkExport( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.BulkExportConnectionsResponse]{ + return &core.Response[*v505.BulkExportConnectionsResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -230,7 +230,7 @@ func (r *RawClient) BulkExport( func (r *RawClient) BulkPause( ctx context.Context, - request *vitalgo.BulkPauseConnectionsBody, + request *v505.BulkPauseConnectionsBody, opts ...option.RequestOption, ) (*core.Response[any], error) { options := core.NewRequestOptions(opts...) @@ -265,7 +265,7 @@ func (r *RawClient) BulkPause( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -280,9 +280,9 @@ func (r *RawClient) BulkPause( func (r *RawClient) Token( ctx context.Context, - request *vitalgo.LinkTokenExchange, + request *v505.LinkTokenExchange, opts ...option.RequestOption, -) (*core.Response[*vitalgo.LinkTokenExchangeResponse], error) { +) (*core.Response[*v505.LinkTokenExchangeResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -295,7 +295,7 @@ func (r *RawClient) Token( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.LinkTokenExchangeResponse + var response *v505.LinkTokenExchangeResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -308,13 +308,13 @@ func (r *RawClient) Token( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.LinkTokenExchangeResponse]{ + return &core.Response[*v505.LinkTokenExchangeResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -323,7 +323,7 @@ func (r *RawClient) Token( func (r *RawClient) IsTokenValid( ctx context.Context, - request *vitalgo.LinkTokenValidationRequest, + request *v505.LinkTokenValidationRequest, opts ...option.RequestOption, ) (*core.Response[map[string]any], error) { options := core.NewRequestOptions(opts...) @@ -351,7 +351,7 @@ func (r *RawClient) IsTokenValid( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -366,9 +366,9 @@ func (r *RawClient) IsTokenValid( func (r *RawClient) CodeCreate( ctx context.Context, - request *vitalgo.LinkCodeCreateRequest, + request *v505.LinkCodeCreateRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.VitalTokenCreatedResponse], error) { +) (*core.Response[*v505.VitalTokenCreatedResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -387,7 +387,7 @@ func (r *RawClient) CodeCreate( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.VitalTokenCreatedResponse + var response *v505.VitalTokenCreatedResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -399,13 +399,13 @@ func (r *RawClient) CodeCreate( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.VitalTokenCreatedResponse]{ + return &core.Response[*v505.VitalTokenCreatedResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -414,7 +414,7 @@ func (r *RawClient) CodeCreate( func (r *RawClient) StartConnect( ctx context.Context, - request *vitalgo.BeginLinkTokenRequest, + request *v505.BeginLinkTokenRequest, opts ...option.RequestOption, ) (*core.Response[map[string]any], error) { options := core.NewRequestOptions(opts...) @@ -442,7 +442,7 @@ func (r *RawClient) StartConnect( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -457,7 +457,7 @@ func (r *RawClient) StartConnect( func (r *RawClient) TokenState( ctx context.Context, - request *vitalgo.LinkTokenStateRequest, + request *v505.LinkTokenStateRequest, opts ...option.RequestOption, ) (*core.Response[map[string]any], error) { options := core.NewRequestOptions(opts...) @@ -487,7 +487,7 @@ func (r *RawClient) TokenState( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -502,7 +502,7 @@ func (r *RawClient) TokenState( func (r *RawClient) EmailAuth( ctx context.Context, - request *vitalgo.EmailAuthLink, + request *v505.EmailAuthLink, opts ...option.RequestOption, ) (*core.Response[any], error) { options := core.NewRequestOptions(opts...) @@ -533,7 +533,7 @@ func (r *RawClient) EmailAuth( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -548,7 +548,7 @@ func (r *RawClient) EmailAuth( func (r *RawClient) PasswordAuth( ctx context.Context, - request *vitalgo.PasswordAuthLink, + request *v505.PasswordAuthLink, opts ...option.RequestOption, ) (*core.Response[any], error) { options := core.NewRequestOptions(opts...) @@ -579,7 +579,7 @@ func (r *RawClient) PasswordAuth( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -594,10 +594,10 @@ func (r *RawClient) PasswordAuth( func (r *RawClient) GenerateOauthLink( ctx context.Context, - oauthProvider *vitalgo.OAuthProviders, - request *vitalgo.LinkGenerateOauthLinkRequest, + oauthProvider *v505.OAuthProviders, + request *v505.LinkGenerateOauthLinkRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.Source], error) { +) (*core.Response[*v505.Source], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -616,7 +616,7 @@ func (r *RawClient) GenerateOauthLink( headers.Add("x-vital-link-token", *request.VitalLinkToken) } - var response *vitalgo.Source + var response *v505.Source raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -628,13 +628,13 @@ func (r *RawClient) GenerateOauthLink( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.Source]{ + return &core.Response[*v505.Source]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -643,10 +643,10 @@ func (r *RawClient) GenerateOauthLink( func (r *RawClient) ConnectPasswordProvider( ctx context.Context, - provider *vitalgo.PasswordProviders, - request *vitalgo.IndividualProviderData, + provider *v505.PasswordProviders, + request *v505.IndividualProviderData, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ProviderLinkResponse], error) { +) (*core.Response[*v505.ProviderLinkResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -665,7 +665,7 @@ func (r *RawClient) ConnectPasswordProvider( headers.Add("x-vital-link-token", *request.VitalLinkToken) } headers.Add("Content-Type", "application/json") - var response *vitalgo.ProviderLinkResponse + var response *v505.ProviderLinkResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -678,13 +678,13 @@ func (r *RawClient) ConnectPasswordProvider( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ProviderLinkResponse]{ + return &core.Response[*v505.ProviderLinkResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -693,10 +693,10 @@ func (r *RawClient) ConnectPasswordProvider( func (r *RawClient) CompletePasswordProviderMfa( ctx context.Context, - provider *vitalgo.PasswordProviders, - request *vitalgo.CompletePasswordProviderMfaBody, + provider *v505.PasswordProviders, + request *v505.CompletePasswordProviderMfaBody, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ProviderLinkResponse], error) { +) (*core.Response[*v505.ProviderLinkResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -715,7 +715,7 @@ func (r *RawClient) CompletePasswordProviderMfa( headers.Add("x-vital-link-token", *request.VitalLinkToken) } headers.Add("Content-Type", "application/json") - var response *vitalgo.ProviderLinkResponse + var response *v505.ProviderLinkResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -728,13 +728,13 @@ func (r *RawClient) CompletePasswordProviderMfa( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ProviderLinkResponse]{ + return &core.Response[*v505.ProviderLinkResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -743,8 +743,8 @@ func (r *RawClient) CompletePasswordProviderMfa( func (r *RawClient) ConnectEmailAuthProvider( ctx context.Context, - provider vitalgo.EmailProviders, - request *vitalgo.EmailProviderAuthLink, + provider v505.EmailProviders, + request *v505.EmailProviderAuthLink, opts ...option.RequestOption, ) (*core.Response[any], error) { options := core.NewRequestOptions(opts...) @@ -778,7 +778,7 @@ func (r *RawClient) ConnectEmailAuthProvider( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -793,9 +793,9 @@ func (r *RawClient) ConnectEmailAuthProvider( func (r *RawClient) GetAllProviders( ctx context.Context, - request *vitalgo.LinkGetAllProvidersRequest, + request *v505.LinkGetAllProvidersRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.SourceLink], error) { +) (*core.Response[[]*v505.SourceLink], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -811,7 +811,7 @@ func (r *RawClient) GetAllProviders( headers.Add("x-vital-link-token", *request.VitalLinkToken) } - var response []*vitalgo.SourceLink + var response []*v505.SourceLink raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -823,13 +823,13 @@ func (r *RawClient) GetAllProviders( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.SourceLink]{ + return &core.Response[[]*v505.SourceLink]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -838,8 +838,8 @@ func (r *RawClient) GetAllProviders( func (r *RawClient) ConnectManualProvider( ctx context.Context, - provider *vitalgo.ManualProviders, - request *vitalgo.ManualConnectionData, + provider *v505.ManualProviders, + request *v505.ManualConnectionData, opts ...option.RequestOption, ) (*core.Response[map[string]bool], error) { options := core.NewRequestOptions(opts...) @@ -856,6 +856,12 @@ func (r *RawClient) ConnectManualProvider( r.options.ToHeader(), options.ToHeader(), ) + if request.VitalIosSdkVersion != nil { + headers.Add("x-vital-ios-sdk-version", *request.VitalIosSdkVersion) + } + if request.VitalAndroidSdkVersion != nil { + headers.Add("x-vital-android-sdk-version", *request.VitalAndroidSdkVersion) + } headers.Add("Content-Type", "application/json") var response map[string]bool raw, err := r.caller.Call( @@ -870,7 +876,7 @@ func (r *RawClient) ConnectManualProvider( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -885,9 +891,9 @@ func (r *RawClient) ConnectManualProvider( func (r *RawClient) ConnectDemoProvider( ctx context.Context, - request *vitalgo.DemoConnectionCreationPayload, + request *v505.DemoConnectionCreationPayload, opts ...option.RequestOption, -) (*core.Response[*vitalgo.DemoConnectionStatus], error) { +) (*core.Response[*v505.DemoConnectionStatus], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -900,7 +906,7 @@ func (r *RawClient) ConnectDemoProvider( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.DemoConnectionStatus + var response *v505.DemoConnectionStatus raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -913,13 +919,13 @@ func (r *RawClient) ConnectDemoProvider( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.DemoConnectionStatus]{ + return &core.Response[*v505.DemoConnectionStatus]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/meal.go b/meal.go index 22333d0..59c6e15 100644 --- a/meal.go +++ b/meal.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) diff --git a/meal/client.go b/meal/client.go index 93417b1..d826b38 100644 --- a/meal/client.go +++ b/meal/client.go @@ -4,10 +4,10 @@ package meal import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -36,9 +36,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) Get( ctx context.Context, userId string, - request *vitalgo.MealGetRequest, + request *v505.MealGetRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingMealResponse, error) { +) (*v505.ClientFacingMealResponse, error) { response, err := c.WithRawResponse.Get( ctx, userId, diff --git a/meal/raw_client.go b/meal/raw_client.go index 41fc4df..b9a80f5 100644 --- a/meal/raw_client.go +++ b/meal/raw_client.go @@ -4,10 +4,10 @@ package meal import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -33,9 +33,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) Get( ctx context.Context, userId string, - request *vitalgo.MealGetRequest, + request *v505.MealGetRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingMealResponse], error) { +) (*core.Response[*v505.ClientFacingMealResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -57,7 +57,7 @@ func (r *RawClient) Get( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingMealResponse + var response *v505.ClientFacingMealResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -69,13 +69,13 @@ func (r *RawClient) Get( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingMealResponse]{ + return &core.Response[*v505.ClientFacingMealResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/menstrual_cycle.go b/menstrual_cycle.go index be0329a..0d2927c 100644 --- a/menstrual_cycle.go +++ b/menstrual_cycle.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) diff --git a/menstrualcycle/client.go b/menstrualcycle/client.go index b45e6c4..377dba9 100644 --- a/menstrualcycle/client.go +++ b/menstrualcycle/client.go @@ -4,10 +4,10 @@ package menstrualcycle import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -35,9 +35,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) Get( ctx context.Context, userId string, - request *vitalgo.MenstrualCycleGetRequest, + request *v505.MenstrualCycleGetRequest, opts ...option.RequestOption, -) (*vitalgo.MenstrualCycleResponse, error) { +) (*v505.MenstrualCycleResponse, error) { response, err := c.WithRawResponse.Get( ctx, userId, diff --git a/menstrualcycle/raw_client.go b/menstrualcycle/raw_client.go index dc2fbb2..9ecad61 100644 --- a/menstrualcycle/raw_client.go +++ b/menstrualcycle/raw_client.go @@ -4,10 +4,10 @@ package menstrualcycle import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -33,9 +33,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) Get( ctx context.Context, userId string, - request *vitalgo.MenstrualCycleGetRequest, + request *v505.MenstrualCycleGetRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.MenstrualCycleResponse], error) { +) (*core.Response[*v505.MenstrualCycleResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -57,7 +57,7 @@ func (r *RawClient) Get( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.MenstrualCycleResponse + var response *v505.MenstrualCycleResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -69,13 +69,13 @@ func (r *RawClient) Get( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.MenstrualCycleResponse]{ + return &core.Response[*v505.MenstrualCycleResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/option/request_option.go b/option/request_option.go index dc7ff50..93c0df2 100644 --- a/option/request_option.go +++ b/option/request_option.go @@ -3,7 +3,7 @@ package option import ( - core "github.com/tryVital/vital-go/core" + core "github.com/tryVital/vital-go/v2/core" http "net/http" url "net/url" ) diff --git a/order.go b/order.go index dc81d93..0ca0270 100644 --- a/order.go +++ b/order.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) diff --git a/order/client.go b/order/client.go index 252ad29..4ae04e2 100644 --- a/order/client.go +++ b/order/client.go @@ -4,10 +4,10 @@ package order import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -35,9 +35,9 @@ func NewClient(options *core.RequestOptions) *Client { // Replay a webhook for a given set of orders func (c *Client) ResendEvents( ctx context.Context, - request *vitalgo.ResendWebhookBody, + request *v505.ResendWebhookBody, opts ...option.RequestOption, -) (*vitalgo.ResendWebhookResponse, error) { +) (*v505.ResendWebhookResponse, error) { response, err := c.WithRawResponse.ResendEvents( ctx, request, diff --git a/order/raw_client.go b/order/raw_client.go index 26357b7..3452b2b 100644 --- a/order/raw_client.go +++ b/order/raw_client.go @@ -4,10 +4,10 @@ package order import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -32,9 +32,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) ResendEvents( ctx context.Context, - request *vitalgo.ResendWebhookBody, + request *v505.ResendWebhookBody, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ResendWebhookResponse], error) { +) (*core.Response[*v505.ResendWebhookResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -47,7 +47,7 @@ func (r *RawClient) ResendEvents( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.ResendWebhookResponse + var response *v505.ResendWebhookResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -60,13 +60,13 @@ func (r *RawClient) ResendEvents( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ResendWebhookResponse]{ + return &core.Response[*v505.ResendWebhookResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/order_transaction.go b/order_transaction.go new file mode 100644 index 0000000..009c9af --- /dev/null +++ b/order_transaction.go @@ -0,0 +1,328 @@ +// Code generated by Fern. DO NOT EDIT. + +package api + +import ( + json "encoding/json" + fmt "fmt" + internal "github.com/tryVital/vital-go/v2/internal" + big "math/big" + time "time" +) + +var ( + getOrderTransactionResponseFieldId = big.NewInt(1 << 0) + getOrderTransactionResponseFieldTeamId = big.NewInt(1 << 1) + getOrderTransactionResponseFieldStatus = big.NewInt(1 << 2) + getOrderTransactionResponseFieldOrders = big.NewInt(1 << 3) +) + +type GetOrderTransactionResponse struct { + Id string `json:"id" url:"id"` + TeamId string `json:"team_id" url:"team_id"` + Status OrderTransactionStatus `json:"status" url:"status"` + Orders []*OrderSummary `json:"orders,omitempty" url:"orders,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (g *GetOrderTransactionResponse) GetId() string { + if g == nil { + return "" + } + return g.Id +} + +func (g *GetOrderTransactionResponse) GetTeamId() string { + if g == nil { + return "" + } + return g.TeamId +} + +func (g *GetOrderTransactionResponse) GetStatus() OrderTransactionStatus { + if g == nil { + return "" + } + return g.Status +} + +func (g *GetOrderTransactionResponse) GetOrders() []*OrderSummary { + if g == nil { + return nil + } + return g.Orders +} + +func (g *GetOrderTransactionResponse) GetExtraProperties() map[string]interface{} { + return g.extraProperties +} + +func (g *GetOrderTransactionResponse) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GetOrderTransactionResponse) SetId(id string) { + g.Id = id + g.require(getOrderTransactionResponseFieldId) +} + +// SetTeamId sets the TeamId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GetOrderTransactionResponse) SetTeamId(teamId string) { + g.TeamId = teamId + g.require(getOrderTransactionResponseFieldTeamId) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GetOrderTransactionResponse) SetStatus(status OrderTransactionStatus) { + g.Status = status + g.require(getOrderTransactionResponseFieldStatus) +} + +// SetOrders sets the Orders field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GetOrderTransactionResponse) SetOrders(orders []*OrderSummary) { + g.Orders = orders + g.require(getOrderTransactionResponseFieldOrders) +} + +func (g *GetOrderTransactionResponse) UnmarshalJSON(data []byte) error { + type unmarshaler GetOrderTransactionResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *g = GetOrderTransactionResponse(value) + extraProperties, err := internal.ExtractExtraProperties(data, *g) + if err != nil { + return err + } + g.extraProperties = extraProperties + g.rawJSON = json.RawMessage(data) + return nil +} + +func (g *GetOrderTransactionResponse) MarshalJSON() ([]byte, error) { + type embed GetOrderTransactionResponse + var marshaler = struct { + embed + }{ + embed: embed(*g), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, g.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (g *GetOrderTransactionResponse) String() string { + if len(g.rawJSON) > 0 { + if value, err := internal.StringifyJSON(g.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(g); err == nil { + return value + } + return fmt.Sprintf("%#v", g) +} + +// Lightweight order summary. +var ( + orderSummaryFieldId = big.NewInt(1 << 0) + orderSummaryFieldOrigin = big.NewInt(1 << 1) + orderSummaryFieldParentId = big.NewInt(1 << 2) + orderSummaryFieldLastStatus = big.NewInt(1 << 3) + orderSummaryFieldLastStatusCreatedAt = big.NewInt(1 << 4) + orderSummaryFieldUpdatedAt = big.NewInt(1 << 5) + orderSummaryFieldCreatedAt = big.NewInt(1 << 6) +) + +type OrderSummary struct { + Id string `json:"id" url:"id"` + Origin *OrderOrigin `json:"origin,omitempty" url:"origin,omitempty"` + ParentId *string `json:"parent_id,omitempty" url:"parent_id,omitempty"` + LastStatus OrderLowLevelStatus `json:"last_status" url:"last_status"` + LastStatusCreatedAt time.Time `json:"last_status_created_at" url:"last_status_created_at"` + UpdatedAt time.Time `json:"updated_at" url:"updated_at"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (o *OrderSummary) GetId() string { + if o == nil { + return "" + } + return o.Id +} + +func (o *OrderSummary) GetOrigin() *OrderOrigin { + if o == nil { + return nil + } + return o.Origin +} + +func (o *OrderSummary) GetParentId() *string { + if o == nil { + return nil + } + return o.ParentId +} + +func (o *OrderSummary) GetLastStatus() OrderLowLevelStatus { + if o == nil { + return "" + } + return o.LastStatus +} + +func (o *OrderSummary) GetLastStatusCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.LastStatusCreatedAt +} + +func (o *OrderSummary) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} + +func (o *OrderSummary) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *OrderSummary) GetExtraProperties() map[string]interface{} { + return o.extraProperties +} + +func (o *OrderSummary) require(field *big.Int) { + if o.explicitFields == nil { + o.explicitFields = big.NewInt(0) + } + o.explicitFields.Or(o.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OrderSummary) SetId(id string) { + o.Id = id + o.require(orderSummaryFieldId) +} + +// SetOrigin sets the Origin field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OrderSummary) SetOrigin(origin *OrderOrigin) { + o.Origin = origin + o.require(orderSummaryFieldOrigin) +} + +// SetParentId sets the ParentId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OrderSummary) SetParentId(parentId *string) { + o.ParentId = parentId + o.require(orderSummaryFieldParentId) +} + +// SetLastStatus sets the LastStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OrderSummary) SetLastStatus(lastStatus OrderLowLevelStatus) { + o.LastStatus = lastStatus + o.require(orderSummaryFieldLastStatus) +} + +// SetLastStatusCreatedAt sets the LastStatusCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OrderSummary) SetLastStatusCreatedAt(lastStatusCreatedAt time.Time) { + o.LastStatusCreatedAt = lastStatusCreatedAt + o.require(orderSummaryFieldLastStatusCreatedAt) +} + +// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OrderSummary) SetUpdatedAt(updatedAt time.Time) { + o.UpdatedAt = updatedAt + o.require(orderSummaryFieldUpdatedAt) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (o *OrderSummary) SetCreatedAt(createdAt time.Time) { + o.CreatedAt = createdAt + o.require(orderSummaryFieldCreatedAt) +} + +func (o *OrderSummary) UnmarshalJSON(data []byte) error { + type embed OrderSummary + var unmarshaler = struct { + embed + LastStatusCreatedAt *internal.DateTime `json:"last_status_created_at"` + UpdatedAt *internal.DateTime `json:"updated_at"` + CreatedAt *internal.DateTime `json:"created_at"` + }{ + embed: embed(*o), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *o = OrderSummary(unmarshaler.embed) + o.LastStatusCreatedAt = unmarshaler.LastStatusCreatedAt.Time() + o.UpdatedAt = unmarshaler.UpdatedAt.Time() + o.CreatedAt = unmarshaler.CreatedAt.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *o) + if err != nil { + return err + } + o.extraProperties = extraProperties + o.rawJSON = json.RawMessage(data) + return nil +} + +func (o *OrderSummary) MarshalJSON() ([]byte, error) { + type embed OrderSummary + var marshaler = struct { + embed + LastStatusCreatedAt *internal.DateTime `json:"last_status_created_at"` + UpdatedAt *internal.DateTime `json:"updated_at"` + CreatedAt *internal.DateTime `json:"created_at"` + }{ + embed: embed(*o), + LastStatusCreatedAt: internal.NewDateTime(o.LastStatusCreatedAt), + UpdatedAt: internal.NewDateTime(o.UpdatedAt), + CreatedAt: internal.NewDateTime(o.CreatedAt), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, o.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (o *OrderSummary) String() string { + if len(o.rawJSON) > 0 { + if value, err := internal.StringifyJSON(o.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(o); err == nil { + return value + } + return fmt.Sprintf("%#v", o) +} diff --git a/ordertransaction/client.go b/ordertransaction/client.go new file mode 100644 index 0000000..cc987ab --- /dev/null +++ b/ordertransaction/client.go @@ -0,0 +1,82 @@ +// Code generated by Fern. DO NOT EDIT. + +package ordertransaction + +import ( + context "context" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" + io "io" +) + +type Client struct { + WithRawResponse *RawClient + + options *core.RequestOptions + baseURL string + caller *internal.Caller +} + +func NewClient(options *core.RequestOptions) *Client { + return &Client{ + WithRawResponse: NewRawClient(options), + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (c *Client) GetTransaction( + ctx context.Context, + transactionId string, + opts ...option.RequestOption, +) (*v505.GetOrderTransactionResponse, error) { + response, err := c.WithRawResponse.GetTransaction( + ctx, + transactionId, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +func (c *Client) GetTransactionResult( + ctx context.Context, + transactionId string, + opts ...option.RequestOption, +) (*v505.LabResultsRaw, error) { + response, err := c.WithRawResponse.GetTransactionResult( + ctx, + transactionId, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} + +func (c *Client) GetTransactionResultPdf( + ctx context.Context, + transactionId string, + opts ...option.RequestOption, +) (io.Reader, error) { + response, err := c.WithRawResponse.GetTransactionResultPdf( + ctx, + transactionId, + opts..., + ) + if err != nil { + return nil, err + } + return response.Body, nil +} diff --git a/ordertransaction/raw_client.go b/ordertransaction/raw_client.go new file mode 100644 index 0000000..10eddc3 --- /dev/null +++ b/ordertransaction/raw_client.go @@ -0,0 +1,165 @@ +// Code generated by Fern. DO NOT EDIT. + +package ordertransaction + +import ( + bytes "bytes" + context "context" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" + io "io" + http "net/http" +) + +type RawClient struct { + baseURL string + caller *internal.Caller + options *core.RequestOptions +} + +func NewRawClient(options *core.RequestOptions) *RawClient { + return &RawClient{ + options: options, + baseURL: options.BaseURL, + caller: internal.NewCaller( + &internal.CallerParams{ + Client: options.HTTPClient, + MaxAttempts: options.MaxAttempts, + }, + ), + } +} + +func (r *RawClient) GetTransaction( + ctx context.Context, + transactionId string, + opts ...option.RequestOption, +) (*core.Response[*v505.GetOrderTransactionResponse], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.tryvital.io", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v3/order_transaction/%v", + transactionId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *v505.GetOrderTransactionResponse + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*v505.GetOrderTransactionResponse]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) GetTransactionResult( + ctx context.Context, + transactionId string, + opts ...option.RequestOption, +) (*core.Response[*v505.LabResultsRaw], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.tryvital.io", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v3/order_transaction/%v/result", + transactionId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + var response *v505.LabResultsRaw + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: &response, + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[*v505.LabResultsRaw]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} + +func (r *RawClient) GetTransactionResultPdf( + ctx context.Context, + transactionId string, + opts ...option.RequestOption, +) (*core.Response[io.Reader], error) { + options := core.NewRequestOptions(opts...) + baseURL := internal.ResolveBaseURL( + options.BaseURL, + r.baseURL, + "https://api.tryvital.io", + ) + endpointURL := internal.EncodeURL( + baseURL+"/v3/order_transaction/%v/result/pdf", + transactionId, + ) + headers := internal.MergeHeaders( + r.options.ToHeader(), + options.ToHeader(), + ) + response := bytes.NewBuffer(nil) + raw, err := r.caller.Call( + ctx, + &internal.CallParams{ + URL: endpointURL, + Method: http.MethodGet, + Headers: headers, + MaxAttempts: options.MaxAttempts, + BodyProperties: options.BodyProperties, + QueryParameters: options.QueryParameters, + Client: options.HTTPClient, + Response: response, + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), + }, + ) + if err != nil { + return nil, err + } + return &core.Response[io.Reader]{ + StatusCode: raw.StatusCode, + Header: raw.Header, + Body: response, + }, nil +} diff --git a/payor.go b/payor.go index a3d3197..fb4d73c 100644 --- a/payor.go +++ b/payor.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" ) @@ -18,7 +18,7 @@ var ( type CreatePayorBody struct { Name string `json:"name" url:"-"` - Address *Address `json:"address,omitempty" url:"-"` + Address *Address `json:"address" url:"-"` Provider *PayorCodeExternalProvider `json:"provider,omitempty" url:"-"` ProviderPayorId *string `json:"provider_payor_id,omitempty" url:"-"` @@ -61,6 +61,27 @@ func (c *CreatePayorBody) SetProviderPayorId(providerPayorId *string) { c.require(createPayorBodyFieldProviderPayorId) } +func (c *CreatePayorBody) UnmarshalJSON(data []byte) error { + type unmarshaler CreatePayorBody + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *c = CreatePayorBody(body) + return nil +} + +func (c *CreatePayorBody) MarshalJSON() ([]byte, error) { + type embed CreatePayorBody + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( clientFacingPayorFieldPayorCode = big.NewInt(1 << 0) clientFacingPayorFieldName = big.NewInt(1 << 1) diff --git a/payor/client.go b/payor/client.go index 48ad8e4..c71b1ae 100644 --- a/payor/client.go +++ b/payor/client.go @@ -4,10 +4,10 @@ package payor import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -34,9 +34,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) CreatePayor( ctx context.Context, - request *vitalgo.CreatePayorBody, + request *v505.CreatePayorBody, opts ...option.RequestOption, -) (*vitalgo.ClientFacingPayor, error) { +) (*v505.ClientFacingPayor, error) { response, err := c.WithRawResponse.CreatePayor( ctx, request, diff --git a/payor/raw_client.go b/payor/raw_client.go index 943d328..01cd071 100644 --- a/payor/raw_client.go +++ b/payor/raw_client.go @@ -4,10 +4,10 @@ package payor import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -32,9 +32,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) CreatePayor( ctx context.Context, - request *vitalgo.CreatePayorBody, + request *v505.CreatePayorBody, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingPayor], error) { +) (*core.Response[*v505.ClientFacingPayor], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -47,7 +47,7 @@ func (r *RawClient) CreatePayor( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.ClientFacingPayor + var response *v505.ClientFacingPayor raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -60,13 +60,13 @@ func (r *RawClient) CreatePayor( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingPayor]{ + return &core.Response[*v505.ClientFacingPayor]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/pointer.go b/pointer.go index faaf462..f9a8177 100644 --- a/pointer.go +++ b/pointer.go @@ -16,6 +16,11 @@ func Byte(b byte) *byte { return &b } +// Bytes returns a pointer to the given []byte value. +func Bytes(b []byte) *[]byte { + return &b +} + // Complex64 returns a pointer to the given complex64 value. func Complex64(c complex64) *complex64 { return &c diff --git a/profile.go b/profile.go index f59af33..0efd663 100644 --- a/profile.go +++ b/profile.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) diff --git a/profile/client.go b/profile/client.go index 836291f..b69beb8 100644 --- a/profile/client.go +++ b/profile/client.go @@ -4,10 +4,10 @@ package profile import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -36,9 +36,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) Get( ctx context.Context, userId string, - request *vitalgo.ProfileGetRequest, + request *v505.ProfileGetRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingProfile, error) { +) (*v505.ClientFacingProfile, error) { response, err := c.WithRawResponse.Get( ctx, userId, @@ -55,9 +55,9 @@ func (c *Client) Get( func (c *Client) GetRaw( ctx context.Context, userId string, - request *vitalgo.ProfileGetRawRequest, + request *v505.ProfileGetRawRequest, opts ...option.RequestOption, -) (*vitalgo.RawProfile, error) { +) (*v505.RawProfile, error) { response, err := c.WithRawResponse.GetRaw( ctx, userId, diff --git a/profile/raw_client.go b/profile/raw_client.go index d17825c..a69cefc 100644 --- a/profile/raw_client.go +++ b/profile/raw_client.go @@ -4,10 +4,10 @@ package profile import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -33,9 +33,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) Get( ctx context.Context, userId string, - request *vitalgo.ProfileGetRequest, + request *v505.ProfileGetRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingProfile], error) { +) (*core.Response[*v505.ClientFacingProfile], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -57,7 +57,7 @@ func (r *RawClient) Get( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingProfile + var response *v505.ClientFacingProfile raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -69,13 +69,13 @@ func (r *RawClient) Get( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingProfile]{ + return &core.Response[*v505.ClientFacingProfile]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -85,9 +85,9 @@ func (r *RawClient) Get( func (r *RawClient) GetRaw( ctx context.Context, userId string, - request *vitalgo.ProfileGetRawRequest, + request *v505.ProfileGetRawRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.RawProfile], error) { +) (*core.Response[*v505.RawProfile], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -109,7 +109,7 @@ func (r *RawClient) GetRaw( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.RawProfile + var response *v505.RawProfile raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -121,13 +121,13 @@ func (r *RawClient) GetRaw( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.RawProfile]{ + return &core.Response[*v505.RawProfile]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/providers.go b/providers.go index 8df605c..d539447 100644 --- a/providers.go +++ b/providers.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" ) diff --git a/providers/client.go b/providers/client.go index 8a3d6cd..35cf7eb 100644 --- a/providers/client.go +++ b/providers/client.go @@ -4,10 +4,10 @@ package providers import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -35,9 +35,9 @@ func NewClient(options *core.RequestOptions) *Client { // Get Provider list func (c *Client) GetAll( ctx context.Context, - request *vitalgo.ProvidersGetAllRequest, + request *v505.ProvidersGetAllRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingProviderDetailed, error) { +) ([]*v505.ClientFacingProviderDetailed, error) { response, err := c.WithRawResponse.GetAll( ctx, request, diff --git a/providers/raw_client.go b/providers/raw_client.go index c731771..8b2914e 100644 --- a/providers/raw_client.go +++ b/providers/raw_client.go @@ -4,10 +4,10 @@ package providers import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -32,9 +32,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) GetAll( ctx context.Context, - request *vitalgo.ProvidersGetAllRequest, + request *v505.ProvidersGetAllRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingProviderDetailed], error) { +) (*core.Response[[]*v505.ClientFacingProviderDetailed], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -53,7 +53,7 @@ func (r *RawClient) GetAll( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingProviderDetailed + var response []*v505.ClientFacingProviderDetailed raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -65,13 +65,13 @@ func (r *RawClient) GetAll( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingProviderDetailed]{ + return &core.Response[[]*v505.ClientFacingProviderDetailed]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/reference.md b/reference.md index e2b07c2..2ec3a55 100644 --- a/reference.md +++ b/reference.md @@ -1,6 +1,6 @@ # Reference ## Link -
client.Link.ListBulkOps() -> *vitalgo.BulkOpsResponse +
client.Link.ListBulkOps() -> *v505.BulkOpsResponse
@@ -13,14 +13,14 @@
```go -request := &vitalgo.LinkListBulkOpsRequest{ - NextCursor: vitalgo.String( +request := &v505.LinkListBulkOpsRequest{ + NextCursor: v505.String( "next_cursor", ), - PageSize: vitalgo.Int( + PageSize: v505.Int( 1, ), - TeamId: vitalgo.LinkListBulkOpsRequestTeamIdInferFromContext.Ptr(), + TeamId: v505.LinkListBulkOpsRequestTeamIdInferFromContext.Ptr(), } client.Link.ListBulkOps( context.TODO(), @@ -57,7 +57,7 @@ client.Link.ListBulkOps(
-**teamId:** `*vitalgo.LinkListBulkOpsRequestTeamId` +**teamId:** `*v505.LinkListBulkOpsRequestTeamId`
@@ -69,7 +69,7 @@ client.Link.ListBulkOps(
-
client.Link.BulkImport(request) -> *vitalgo.BulkImportConnectionsResponse +
client.Link.BulkImport(request) -> *v505.BulkImportConnectionsResponse
@@ -82,11 +82,11 @@ client.Link.ListBulkOps(
```go -request := &vitalgo.BulkImportConnectionsBody{ - TeamId: vitalgo.LinkBulkImportRequestTeamIdInferFromContext.Ptr(), - Provider: vitalgo.OAuthProvidersOura, - Connections: []*vitalgo.ConnectionRecipe{ - &vitalgo.ConnectionRecipe{ +request := &v505.BulkImportConnectionsBody{ + TeamId: v505.LinkBulkImportRequestTeamIdInferFromContext.Ptr(), + Provider: v505.OAuthProvidersOura, + Connections: []*v505.ConnectionRecipe{ + &v505.ConnectionRecipe{ UserId: "user_id", AccessToken: "access_token", RefreshToken: "refresh_token", @@ -114,7 +114,7 @@ client.Link.BulkImport(
-**teamId:** `*vitalgo.LinkBulkImportRequestTeamId` +**teamId:** `*v505.LinkBulkImportRequestTeamId`
@@ -122,7 +122,7 @@ client.Link.BulkImport(
-**provider:** `*vitalgo.OAuthProviders` +**provider:** `*v505.OAuthProviders`
@@ -130,7 +130,7 @@ client.Link.BulkImport(
-**connections:** `[]*vitalgo.ConnectionRecipe` +**connections:** `[]*v505.ConnectionRecipe`
@@ -171,12 +171,12 @@ the [List Bulk Ops](https://docs.tryvital.io/api-reference/link/list-bulk-ops) e
```go -request := &vitalgo.BulkTriggerHistoricalPullBody{ - TeamId: vitalgo.LinkBulkTriggerHistoricalPullRequestTeamIdInferFromContext.Ptr(), +request := &v505.BulkTriggerHistoricalPullBody{ + TeamId: v505.LinkBulkTriggerHistoricalPullRequestTeamIdInferFromContext.Ptr(), UserIds: []string{ "user_ids", }, - Provider: vitalgo.OAuthProvidersOura, + Provider: v505.OAuthProvidersOura, } client.Link.BulkTriggerHistoricalPull( context.TODO(), @@ -197,7 +197,7 @@ client.Link.BulkTriggerHistoricalPull(
-**teamId:** `*vitalgo.LinkBulkTriggerHistoricalPullRequestTeamId` +**teamId:** `*v505.LinkBulkTriggerHistoricalPullRequestTeamId`
@@ -213,7 +213,7 @@ client.Link.BulkTriggerHistoricalPull(
-**provider:** `*vitalgo.OAuthProviders` +**provider:** `*v505.OAuthProviders`
@@ -241,7 +241,7 @@ the [List Bulk Ops](https://docs.tryvital.io/api-reference/link/list-bulk-ops) e
-
client.Link.BulkExport(request) -> *vitalgo.BulkExportConnectionsResponse +
client.Link.BulkExport(request) -> *v505.BulkExportConnectionsResponse
@@ -254,9 +254,9 @@ the [List Bulk Ops](https://docs.tryvital.io/api-reference/link/list-bulk-ops) e
```go -request := &vitalgo.BulkExportConnectionsBody{ - TeamId: vitalgo.LinkBulkExportRequestTeamIdInferFromContext.Ptr(), - Provider: vitalgo.OAuthProvidersOura, +request := &v505.BulkExportConnectionsBody{ + TeamId: v505.LinkBulkExportRequestTeamIdInferFromContext.Ptr(), + Provider: v505.OAuthProvidersOura, } client.Link.BulkExport( context.TODO(), @@ -277,7 +277,7 @@ client.Link.BulkExport(
-**teamId:** `*vitalgo.LinkBulkExportRequestTeamId` +**teamId:** `*v505.LinkBulkExportRequestTeamId`
@@ -293,7 +293,7 @@ client.Link.BulkExport(
-**provider:** `*vitalgo.OAuthProviders` +**provider:** `*v505.OAuthProviders`
@@ -326,12 +326,12 @@ client.Link.BulkExport(
```go -request := &vitalgo.BulkPauseConnectionsBody{ - TeamId: vitalgo.LinkBulkPauseRequestTeamIdInferFromContext.Ptr(), +request := &v505.BulkPauseConnectionsBody{ + TeamId: v505.LinkBulkPauseRequestTeamIdInferFromContext.Ptr(), UserIds: []string{ "user_ids", }, - Provider: vitalgo.OAuthProvidersOura, + Provider: v505.OAuthProvidersOura, } client.Link.BulkPause( context.TODO(), @@ -352,7 +352,7 @@ client.Link.BulkPause(
-**teamId:** `*vitalgo.LinkBulkPauseRequestTeamId` +**teamId:** `*v505.LinkBulkPauseRequestTeamId`
@@ -368,7 +368,7 @@ client.Link.BulkPause(
-**provider:** `*vitalgo.OAuthProviders` +**provider:** `*v505.OAuthProviders`
@@ -380,7 +380,7 @@ client.Link.BulkPause(
-
client.Link.Token(request) -> *vitalgo.LinkTokenExchangeResponse +
client.Link.Token(request) -> *v505.LinkTokenExchangeResponse
@@ -412,7 +412,7 @@ pass in your own custom redirect_url parameter.
```go -request := &vitalgo.LinkTokenExchange{ +request := &v505.LinkTokenExchange{ UserId: "user_id", } client.Link.Token( @@ -442,7 +442,7 @@ client.Link.Token(
-**provider:** `*vitalgo.Providers` +**provider:** `*v505.Providers`
@@ -458,7 +458,7 @@ client.Link.Token(
-**filterOnProviders:** `[]*vitalgo.Providers` +**filterOnProviders:** `[]*v505.Providers` An allowlist of providers dictating what Vital Link Widget should show to the end user. If unspecified, all linkable providers are shown. @@ -519,7 +519,7 @@ This has no effect on programmatic Vital Link API usage.
```go -request := &vitalgo.LinkTokenValidationRequest{ +request := &v505.LinkTokenValidationRequest{ Token: "token", } client.Link.IsTokenValid( @@ -553,7 +553,7 @@ client.Link.IsTokenValid(
-
client.Link.CodeCreate() -> *vitalgo.VitalTokenCreatedResponse +
client.Link.CodeCreate() -> *v505.VitalTokenCreatedResponse
@@ -580,10 +580,10 @@ Generate a token to invite a user of Vital mobile app to your team
```go -request := &vitalgo.LinkCodeCreateRequest{ +request := &v505.LinkCodeCreateRequest{ UserId: "user_id", - ExpiresAt: vitalgo.Time( - vitalgo.MustParseDateTime( + ExpiresAt: v505.Time( + v505.MustParseDateTime( "2024-01-15T09:30:00Z", ), ), @@ -655,9 +655,9 @@ Start link token process
```go -request := &vitalgo.BeginLinkTokenRequest{ +request := &v505.BeginLinkTokenRequest{ LinkToken: "link_token", - Provider: vitalgo.ProvidersOura, + Provider: v505.ProvidersOura, } client.Link.StartConnect( context.TODO(), @@ -686,7 +686,7 @@ client.Link.StartConnect(
-**provider:** `*vitalgo.Providers` +**provider:** `*v505.Providers`
@@ -726,11 +726,7 @@ Check link token state - can be hit continuously used as heartbeat
```go -request := &vitalgo.LinkTokenStateRequest{ - VitalLinkToken: vitalgo.String( - "x-vital-link-token", - ), - } +request := &v505.LinkTokenStateRequest{} client.Link.TokenState( context.TODO(), request, @@ -789,13 +785,10 @@ Deprecated. Use `POST /v2/link/provider/email/{provider}` instead.
```go -request := &vitalgo.EmailAuthLink{ - VitalLinkToken: vitalgo.String( - "x-vital-link-token", - ), +request := &v505.EmailAuthLink{ Email: "email", - Provider: vitalgo.ProvidersOura, - AuthType: vitalgo.AuthTypePassword, + Provider: v505.ProvidersOura, + AuthType: v505.AuthTypePassword, } client.Link.EmailAuth( context.TODO(), @@ -832,7 +825,7 @@ client.Link.EmailAuth(
-**provider:** `*vitalgo.Providers` +**provider:** `*v505.Providers`
@@ -840,7 +833,7 @@ client.Link.EmailAuth(
-**authType:** `*vitalgo.AuthType` +**authType:** `*v505.AuthType`
@@ -848,7 +841,7 @@ client.Link.EmailAuth(
-**region:** `*vitalgo.Region` +**region:** `*v505.Region`
@@ -887,14 +880,11 @@ Deprecated. Use `POST /v2/link/provider/password/{provider}` instead.
```go -request := &vitalgo.PasswordAuthLink{ - VitalLinkToken: vitalgo.String( - "x-vital-link-token", - ), +request := &v505.PasswordAuthLink{ Username: "username", Password: "password", - Provider: vitalgo.ProvidersOura, - AuthType: vitalgo.AuthTypePassword, + Provider: v505.ProvidersOura, + AuthType: v505.AuthTypePassword, } client.Link.PasswordAuth( context.TODO(), @@ -939,7 +929,7 @@ client.Link.PasswordAuth(
-**provider:** `*vitalgo.Providers` +**provider:** `*v505.Providers`
@@ -947,7 +937,7 @@ client.Link.PasswordAuth(
-**authType:** `*vitalgo.AuthType` +**authType:** `*v505.AuthType`
@@ -959,7 +949,7 @@ client.Link.PasswordAuth(
-
client.Link.GenerateOauthLink(OauthProvider) -> *vitalgo.Source +
client.Link.GenerateOauthLink(OauthProvider) -> *v505.Source
@@ -986,14 +976,10 @@ This endpoint generates an OAuth link for oauth provider
```go -request := &vitalgo.LinkGenerateOauthLinkRequest{ - VitalLinkToken: vitalgo.String( - "x-vital-link-token", - ), - } +request := &v505.LinkGenerateOauthLinkRequest{} client.Link.GenerateOauthLink( context.TODO(), - vitalgo.OAuthProvidersOura.Ptr(), + v505.OAuthProvidersOura.Ptr(), request, ) } @@ -1011,7 +997,7 @@ client.Link.GenerateOauthLink(
-**oauthProvider:** `*vitalgo.OAuthProviders` +**oauthProvider:** `*v505.OAuthProviders`
@@ -1031,7 +1017,7 @@ client.Link.GenerateOauthLink(
-
client.Link.ConnectPasswordProvider(Provider, request) -> *vitalgo.ProviderLinkResponse +
client.Link.ConnectPasswordProvider(Provider, request) -> *v505.ProviderLinkResponse
@@ -1058,16 +1044,13 @@ This connects auth providers that are password based.
```go -request := &vitalgo.IndividualProviderData{ - VitalLinkToken: vitalgo.String( - "x-vital-link-token", - ), +request := &v505.IndividualProviderData{ Username: "username", Password: "password", } client.Link.ConnectPasswordProvider( context.TODO(), - vitalgo.PasswordProvidersWhoop.Ptr(), + v505.PasswordProvidersWhoop.Ptr(), request, ) } @@ -1085,7 +1068,7 @@ client.Link.ConnectPasswordProvider(
-**provider:** `*vitalgo.PasswordProviders` +**provider:** `*v505.PasswordProviders`
@@ -1117,7 +1100,7 @@ client.Link.ConnectPasswordProvider(
-**region:** `*vitalgo.Region` — Provider region to authenticate against. Only applicable to specific providers. +**region:** `*v505.Region` — Provider region to authenticate against. Only applicable to specific providers.
@@ -1129,7 +1112,7 @@ client.Link.ConnectPasswordProvider(
-
client.Link.CompletePasswordProviderMfa(Provider, request) -> *vitalgo.ProviderLinkResponse +
client.Link.CompletePasswordProviderMfa(Provider, request) -> *v505.ProviderLinkResponse
@@ -1156,15 +1139,12 @@ This connects auth providers that are password based.
```go -request := &vitalgo.CompletePasswordProviderMfaBody{ - VitalLinkToken: vitalgo.String( - "x-vital-link-token", - ), +request := &v505.CompletePasswordProviderMfaBody{ MfaCode: "mfa_code", } client.Link.CompletePasswordProviderMfa( context.TODO(), - vitalgo.PasswordProvidersWhoop.Ptr(), + v505.PasswordProvidersWhoop.Ptr(), request, ) } @@ -1182,7 +1162,7 @@ client.Link.CompletePasswordProviderMfa(
-**provider:** `*vitalgo.PasswordProviders` +**provider:** `*v505.PasswordProviders`
@@ -1237,15 +1217,12 @@ This connects auth providers that are email based.
```go -request := &vitalgo.EmailProviderAuthLink{ - VitalLinkToken: vitalgo.String( - "x-vital-link-token", - ), +request := &v505.EmailProviderAuthLink{ Email: "email", } client.Link.ConnectEmailAuthProvider( context.TODO(), - vitalgo.EmailProviders( + v505.EmailProviders( "freestyle_libre", ), request, @@ -1265,7 +1242,7 @@ client.Link.ConnectEmailAuthProvider(
-**provider:** `vitalgo.EmailProviders` +**provider:** `v505.EmailProviders`
@@ -1289,7 +1266,7 @@ client.Link.ConnectEmailAuthProvider(
-**emailProviderAuthLinkProvider:** `*vitalgo.Providers` +**emailProviderAuthLinkProvider:** `*v505.Providers`
@@ -1297,7 +1274,7 @@ client.Link.ConnectEmailAuthProvider(
-**region:** `*vitalgo.Region` +**region:** `*v505.Region`
@@ -1309,7 +1286,7 @@ client.Link.ConnectEmailAuthProvider(
-
client.Link.GetAllProviders() -> []*vitalgo.SourceLink +
client.Link.GetAllProviders() -> []*v505.SourceLink
@@ -1336,11 +1313,7 @@ GET List of all available providers given the generated link token.
```go -request := &vitalgo.LinkGetAllProvidersRequest{ - VitalLinkToken: vitalgo.String( - "x-vital-link-token", - ), - } +request := &v505.LinkGetAllProvidersRequest{} client.Link.GetAllProviders( context.TODO(), request, @@ -1385,12 +1358,12 @@ client.Link.GetAllProviders(
```go -request := &vitalgo.ManualConnectionData{ +request := &v505.ManualConnectionData{ UserId: "user_id", } client.Link.ConnectManualProvider( context.TODO(), - vitalgo.ManualProvidersBeurerBle.Ptr(), + v505.ManualProvidersBeurerBle.Ptr(), request, ) } @@ -1408,7 +1381,23 @@ client.Link.ConnectManualProvider(
-**provider:** `*vitalgo.ManualProviders` +**provider:** `*v505.ManualProviders` + +
+
+ +
+
+ +**vitalIosSdkVersion:** `*string` + +
+
+ +
+
+ +**vitalAndroidSdkVersion:** `*string`
@@ -1426,6 +1415,14 @@ client.Link.ConnectManualProvider( **providerId:** `*string` +
+
+ +
+
+ +**grantedPermissions:** `[]string` +
@@ -1436,7 +1433,7 @@ client.Link.ConnectManualProvider(
-
client.Link.ConnectDemoProvider(request) -> *vitalgo.DemoConnectionStatus +
client.Link.ConnectDemoProvider(request) -> *v505.DemoConnectionStatus
@@ -1463,9 +1460,9 @@ POST Connect the given Vital user to a demo provider.
```go -request := &vitalgo.DemoConnectionCreationPayload{ +request := &v505.DemoConnectionCreationPayload{ UserId: "user_id", - Provider: vitalgo.DemoProvidersAppleHealthKit, + Provider: v505.DemoProvidersAppleHealthKit, } client.Link.ConnectDemoProvider( context.TODO(), @@ -1494,7 +1491,7 @@ client.Link.ConnectDemoProvider(
-**provider:** `*vitalgo.DemoProviders` — Demo provider. For more information, please check out our docs (https://docs.tryvital.io/wearables/providers/test_data) +**provider:** `*v505.DemoProviders` — Demo provider. For more information, please check out our docs (https://docs.tryvital.io/wearables/providers/test_data)
@@ -1507,7 +1504,7 @@ client.Link.ConnectDemoProvider(
## Electrocardiogram -
client.Electrocardiogram.Get(UserId) -> *vitalgo.ClientFacingElectrocardiogramResponse +
client.Electrocardiogram.Get(UserId) -> *v505.ClientFacingElectrocardiogramResponse
@@ -1534,12 +1531,12 @@ Get electrocardiogram summary for user_id
```go -request := &vitalgo.ElectrocardiogramGetRequest{ +request := &v505.ElectrocardiogramGetRequest{ StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), } @@ -1600,7 +1597,7 @@ client.Electrocardiogram.Get(
## SleepCycle -
client.SleepCycle.Get(UserId) -> *vitalgo.ClientSleepCycleResponse +
client.SleepCycle.Get(UserId) -> *v505.ClientSleepCycleResponse
@@ -1627,12 +1624,12 @@ Get sleep cycle for user_id
```go -request := &vitalgo.SleepCycleGetRequest{ +request := &v505.SleepCycleGetRequest{ StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), } @@ -1693,7 +1690,7 @@ client.SleepCycle.Get(
## Profile -
client.Profile.Get(UserId) -> *vitalgo.ClientFacingProfile +
client.Profile.Get(UserId) -> *v505.ClientFacingProfile
@@ -1720,8 +1717,8 @@ Get profile for user_id
```go -request := &vitalgo.ProfileGetRequest{ - Provider: vitalgo.String( +request := &v505.ProfileGetRequest{ + Provider: v505.String( "provider", ), } @@ -1765,7 +1762,7 @@ client.Profile.Get(
-
client.Profile.GetRaw(UserId) -> *vitalgo.RawProfile +
client.Profile.GetRaw(UserId) -> *v505.RawProfile
@@ -1792,8 +1789,8 @@ Get raw profile for user_id
```go -request := &vitalgo.ProfileGetRawRequest{ - Provider: vitalgo.String( +request := &v505.ProfileGetRawRequest{ + Provider: v505.String( "provider", ), } @@ -1838,7 +1835,7 @@ client.Profile.GetRaw(
## Devices -
client.Devices.GetRaw(UserId) -> *vitalgo.RawDevices +
client.Devices.GetRaw(UserId) -> *v505.RawDevices
@@ -1865,8 +1862,8 @@ Get Devices for user_id
```go -request := &vitalgo.DevicesGetRawRequest{ - Provider: vitalgo.String( +request := &v505.DevicesGetRawRequest{ + Provider: v505.String( "provider", ), } @@ -1911,7 +1908,7 @@ client.Devices.GetRaw(
## Activity -
client.Activity.Get(UserId) -> *vitalgo.ClientActivityResponse +
client.Activity.Get(UserId) -> *v505.ClientActivityResponse
@@ -1938,12 +1935,12 @@ Get activity summary for user_id
```go -request := &vitalgo.ActivityGetRequest{ - Provider: vitalgo.String( +request := &v505.ActivityGetRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -2003,7 +2000,7 @@ client.Activity.Get(
-
client.Activity.GetRaw(UserId) -> *vitalgo.RawActivity +
client.Activity.GetRaw(UserId) -> *v505.RawActivity
@@ -2030,12 +2027,12 @@ Get raw activity summary for user_id
```go -request := &vitalgo.ActivityGetRawRequest{ - Provider: vitalgo.String( +request := &v505.ActivityGetRawRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -2096,7 +2093,7 @@ client.Activity.GetRaw(
## Workouts -
client.Workouts.Get(UserId) -> *vitalgo.ClientWorkoutResponse +
client.Workouts.Get(UserId) -> *v505.ClientWorkoutResponse
@@ -2123,12 +2120,12 @@ Get workout summary for user_id
```go -request := &vitalgo.WorkoutsGetRequest{ - Provider: vitalgo.String( +request := &v505.WorkoutsGetRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -2188,7 +2185,7 @@ client.Workouts.Get(
-
client.Workouts.GetRaw(UserId) -> *vitalgo.RawWorkout +
client.Workouts.GetRaw(UserId) -> *v505.RawWorkout
@@ -2215,12 +2212,12 @@ Get raw workout summary for user_id
```go -request := &vitalgo.WorkoutsGetRawRequest{ - Provider: vitalgo.String( +request := &v505.WorkoutsGetRawRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -2280,7 +2277,7 @@ client.Workouts.GetRaw(
-
client.Workouts.GetByWorkoutId(WorkoutId) -> *vitalgo.ClientFacingStream +
client.Workouts.GetByWorkoutId(WorkoutId) -> *v505.ClientFacingStream
@@ -2325,7 +2322,7 @@ client.Workouts.GetByWorkoutId(
## Sleep -
client.Sleep.Get(UserId) -> *vitalgo.ClientSleepResponse +
client.Sleep.Get(UserId) -> *v505.ClientSleepResponse
@@ -2352,12 +2349,12 @@ Get sleep summary for user_id
```go -request := &vitalgo.SleepGetRequest{ - Provider: vitalgo.String( +request := &v505.SleepGetRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -2417,7 +2414,7 @@ client.Sleep.Get(
-
client.Sleep.GetRaw(UserId) -> *vitalgo.RawSleep +
client.Sleep.GetRaw(UserId) -> *v505.RawSleep
@@ -2444,12 +2441,12 @@ Get raw sleep summary for user_id
```go -request := &vitalgo.SleepGetRawRequest{ - Provider: vitalgo.String( +request := &v505.SleepGetRawRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -2509,7 +2506,7 @@ client.Sleep.GetRaw(
-
client.Sleep.GetStreamBySleepId(SleepId) -> *vitalgo.ClientFacingSleepStream +
client.Sleep.GetStreamBySleepId(SleepId) -> *v505.ClientFacingSleepStream
@@ -2568,7 +2565,7 @@ client.Sleep.GetStreamBySleepId(
## Body -
client.Body.Get(UserId) -> *vitalgo.ClientBodyResponse +
client.Body.Get(UserId) -> *v505.ClientBodyResponse
@@ -2595,12 +2592,12 @@ Get Body summary for user_id
```go -request := &vitalgo.BodyGetRequest{ - Provider: vitalgo.String( +request := &v505.BodyGetRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -2660,7 +2657,7 @@ client.Body.Get(
-
client.Body.GetRaw(UserId) -> *vitalgo.RawBody +
client.Body.GetRaw(UserId) -> *v505.RawBody
@@ -2687,12 +2684,12 @@ Get raw Body summary for user_id
```go -request := &vitalgo.BodyGetRawRequest{ - Provider: vitalgo.String( +request := &v505.BodyGetRawRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -2753,7 +2750,7 @@ client.Body.GetRaw(
## Meal -
client.Meal.Get(UserId) -> *vitalgo.ClientFacingMealResponse +
client.Meal.Get(UserId) -> *v505.ClientFacingMealResponse
@@ -2780,12 +2777,12 @@ Get user's meals
```go -request := &vitalgo.MealGetRequest{ - Provider: vitalgo.String( +request := &v505.MealGetRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -2846,7 +2843,7 @@ client.Meal.Get(
## MenstrualCycle -
client.MenstrualCycle.Get(UserId) -> *vitalgo.MenstrualCycleResponse +
client.MenstrualCycle.Get(UserId) -> *v505.MenstrualCycleResponse
@@ -2859,12 +2856,12 @@ client.Meal.Get(
```go -request := &vitalgo.MenstrualCycleGetRequest{ - Provider: vitalgo.String( +request := &v505.MenstrualCycleGetRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -2925,7 +2922,7 @@ client.MenstrualCycle.Get(
## Vitals -
client.Vitals.WorkoutSwimmingStrokeGrouped(UserId) -> *vitalgo.GroupedWorkoutSwimmingStrokeResponse +
client.Vitals.WorkoutSwimmingStrokeGrouped(UserId) -> *v505.GroupedWorkoutSwimmingStrokeResponse
@@ -2938,18 +2935,18 @@ client.MenstrualCycle.Get(
```go -request := &vitalgo.VitalsWorkoutSwimmingStrokeGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsWorkoutSwimmingStrokeGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -3025,7 +3022,7 @@ client.Vitals.WorkoutSwimmingStrokeGrouped(
-
client.Vitals.WorkoutDistanceGrouped(UserId) -> *vitalgo.GroupedWorkoutDistanceResponse +
client.Vitals.WorkoutDistanceGrouped(UserId) -> *v505.GroupedWorkoutDistanceResponse
@@ -3038,18 +3035,18 @@ client.Vitals.WorkoutSwimmingStrokeGrouped(
```go -request := &vitalgo.VitalsWorkoutDistanceGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsWorkoutDistanceGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -3125,7 +3122,7 @@ client.Vitals.WorkoutDistanceGrouped(
-
client.Vitals.HeartRateRecoveryOneMinuteGrouped(UserId) -> *vitalgo.GroupedHeartRateRecoveryOneMinuteResponse +
client.Vitals.HeartRateRecoveryOneMinuteGrouped(UserId) -> *v505.GroupedHeartRateRecoveryOneMinuteResponse
@@ -3138,18 +3135,18 @@ client.Vitals.WorkoutDistanceGrouped(
```go -request := &vitalgo.VitalsHeartRateRecoveryOneMinuteGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsHeartRateRecoveryOneMinuteGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -3225,7 +3222,7 @@ client.Vitals.HeartRateRecoveryOneMinuteGrouped(
-
client.Vitals.WaistCircumferenceGrouped(UserId) -> *vitalgo.GroupedWaistCircumferenceResponse +
client.Vitals.WaistCircumferenceGrouped(UserId) -> *v505.GroupedWaistCircumferenceResponse
@@ -3238,18 +3235,18 @@ client.Vitals.HeartRateRecoveryOneMinuteGrouped(
```go -request := &vitalgo.VitalsWaistCircumferenceGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsWaistCircumferenceGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -3325,7 +3322,7 @@ client.Vitals.WaistCircumferenceGrouped(
-
client.Vitals.LeanBodyMassGrouped(UserId) -> *vitalgo.GroupedLeanBodyMassResponse +
client.Vitals.LeanBodyMassGrouped(UserId) -> *v505.GroupedLeanBodyMassResponse
@@ -3338,18 +3335,18 @@ client.Vitals.WaistCircumferenceGrouped(
```go -request := &vitalgo.VitalsLeanBodyMassGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsLeanBodyMassGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -3425,7 +3422,7 @@ client.Vitals.LeanBodyMassGrouped(
-
client.Vitals.BodyMassIndexGrouped(UserId) -> *vitalgo.GroupedBodyMassIndexResponse +
client.Vitals.BodyMassIndexGrouped(UserId) -> *v505.GroupedBodyMassIndexResponse
@@ -3438,18 +3435,18 @@ client.Vitals.LeanBodyMassGrouped(
```go -request := &vitalgo.VitalsBodyMassIndexGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsBodyMassIndexGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -3525,7 +3522,7 @@ client.Vitals.BodyMassIndexGrouped(
-
client.Vitals.BasalBodyTemperatureGrouped(UserId) -> *vitalgo.GroupedBasalBodyTemperatureResponse +
client.Vitals.BasalBodyTemperatureGrouped(UserId) -> *v505.GroupedBasalBodyTemperatureResponse
@@ -3538,18 +3535,18 @@ client.Vitals.BodyMassIndexGrouped(
```go -request := &vitalgo.VitalsBasalBodyTemperatureGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsBasalBodyTemperatureGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -3625,7 +3622,7 @@ client.Vitals.BasalBodyTemperatureGrouped(
-
client.Vitals.HandwashingGrouped(UserId) -> *vitalgo.GroupedHandwashingResponse +
client.Vitals.HandwashingGrouped(UserId) -> *v505.GroupedHandwashingResponse
@@ -3638,18 +3635,18 @@ client.Vitals.BasalBodyTemperatureGrouped(
```go -request := &vitalgo.VitalsHandwashingGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsHandwashingGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -3725,7 +3722,7 @@ client.Vitals.HandwashingGrouped(
-
client.Vitals.DaylightExposureGrouped(UserId) -> *vitalgo.GroupedDaylightExposureResponse +
client.Vitals.DaylightExposureGrouped(UserId) -> *v505.GroupedDaylightExposureResponse
@@ -3738,18 +3735,18 @@ client.Vitals.HandwashingGrouped(
```go -request := &vitalgo.VitalsDaylightExposureGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsDaylightExposureGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -3825,7 +3822,7 @@ client.Vitals.DaylightExposureGrouped(
-
client.Vitals.UvExposureGrouped(UserId) -> *vitalgo.GroupedUvExposureResponse +
client.Vitals.UvExposureGrouped(UserId) -> *v505.GroupedUvExposureResponse
@@ -3838,18 +3835,18 @@ client.Vitals.DaylightExposureGrouped(
```go -request := &vitalgo.VitalsUvExposureGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsUvExposureGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -3925,7 +3922,7 @@ client.Vitals.UvExposureGrouped(
-
client.Vitals.FallGrouped(UserId) -> *vitalgo.GroupedFallResponse +
client.Vitals.FallGrouped(UserId) -> *v505.GroupedFallResponse
@@ -3938,18 +3935,18 @@ client.Vitals.UvExposureGrouped(
```go -request := &vitalgo.VitalsFallGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsFallGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -4025,7 +4022,7 @@ client.Vitals.FallGrouped(
-
client.Vitals.InhalerUsageGrouped(UserId) -> *vitalgo.GroupedInhalerUsageResponse +
client.Vitals.InhalerUsageGrouped(UserId) -> *v505.GroupedInhalerUsageResponse
@@ -4038,18 +4035,18 @@ client.Vitals.FallGrouped(
```go -request := &vitalgo.VitalsInhalerUsageGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsInhalerUsageGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -4125,7 +4122,7 @@ client.Vitals.InhalerUsageGrouped(
-
client.Vitals.PeakExpiratoryFlowRateGrouped(UserId) -> *vitalgo.GroupedPeakExpiratoryFlowRateResponse +
client.Vitals.PeakExpiratoryFlowRateGrouped(UserId) -> *v505.GroupedPeakExpiratoryFlowRateResponse
@@ -4138,18 +4135,18 @@ client.Vitals.InhalerUsageGrouped(
```go -request := &vitalgo.VitalsPeakExpiratoryFlowRateGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsPeakExpiratoryFlowRateGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -4225,7 +4222,7 @@ client.Vitals.PeakExpiratoryFlowRateGrouped(
-
client.Vitals.ForcedVitalCapacityGrouped(UserId) -> *vitalgo.GroupedForcedVitalCapacityResponse +
client.Vitals.ForcedVitalCapacityGrouped(UserId) -> *v505.GroupedForcedVitalCapacityResponse
@@ -4238,18 +4235,18 @@ client.Vitals.PeakExpiratoryFlowRateGrouped(
```go -request := &vitalgo.VitalsForcedVitalCapacityGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsForcedVitalCapacityGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -4325,7 +4322,7 @@ client.Vitals.ForcedVitalCapacityGrouped(
-
client.Vitals.ForcedExpiratoryVolume1Grouped(UserId) -> *vitalgo.GroupedForcedExpiratoryVolume1Response +
client.Vitals.ForcedExpiratoryVolume1Grouped(UserId) -> *v505.GroupedForcedExpiratoryVolume1Response
@@ -4338,18 +4335,18 @@ client.Vitals.ForcedVitalCapacityGrouped(
```go -request := &vitalgo.VitalsForcedExpiratoryVolume1GroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsForcedExpiratoryVolume1GroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -4425,7 +4422,7 @@ client.Vitals.ForcedExpiratoryVolume1Grouped(
-
client.Vitals.WheelchairPushGrouped(UserId) -> *vitalgo.GroupedWheelchairPushResponse +
client.Vitals.WheelchairPushGrouped(UserId) -> *v505.GroupedWheelchairPushResponse
@@ -4438,18 +4435,18 @@ client.Vitals.ForcedExpiratoryVolume1Grouped(
```go -request := &vitalgo.VitalsWheelchairPushGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsWheelchairPushGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -4525,7 +4522,7 @@ client.Vitals.WheelchairPushGrouped(
-
client.Vitals.SleepBreathingDisturbanceGrouped(UserId) -> *vitalgo.GroupedSleepBreathingDisturbanceResponse +
client.Vitals.SleepBreathingDisturbanceGrouped(UserId) -> *v505.GroupedSleepBreathingDisturbanceResponse
@@ -4538,18 +4535,18 @@ client.Vitals.WheelchairPushGrouped(
```go -request := &vitalgo.VitalsSleepBreathingDisturbanceGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsSleepBreathingDisturbanceGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -4625,7 +4622,7 @@ client.Vitals.SleepBreathingDisturbanceGrouped(
-
client.Vitals.SleepApneaAlertGrouped(UserId) -> *vitalgo.GroupedSleepApneaAlertResponse +
client.Vitals.SleepApneaAlertGrouped(UserId) -> *v505.GroupedSleepApneaAlertResponse
@@ -4638,18 +4635,18 @@ client.Vitals.SleepBreathingDisturbanceGrouped(
```go -request := &vitalgo.VitalsSleepApneaAlertGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsSleepApneaAlertGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -4725,7 +4722,7 @@ client.Vitals.SleepApneaAlertGrouped(
-
client.Vitals.StandDurationGrouped(UserId) -> *vitalgo.GroupedStandDurationResponse +
client.Vitals.StandDurationGrouped(UserId) -> *v505.GroupedStandDurationResponse
@@ -4738,18 +4735,18 @@ client.Vitals.SleepApneaAlertGrouped(
```go -request := &vitalgo.VitalsStandDurationGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsStandDurationGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -4825,7 +4822,7 @@ client.Vitals.StandDurationGrouped(
-
client.Vitals.StandHourGrouped(UserId) -> *vitalgo.GroupedStandHourResponse +
client.Vitals.StandHourGrouped(UserId) -> *v505.GroupedStandHourResponse
@@ -4838,18 +4835,18 @@ client.Vitals.StandDurationGrouped(
```go -request := &vitalgo.VitalsStandHourGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsStandHourGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -4925,7 +4922,7 @@ client.Vitals.StandHourGrouped(
-
client.Vitals.HeartRateAlertGrouped(UserId) -> *vitalgo.GroupedHeartRateAlertResponse +
client.Vitals.HeartRateAlertGrouped(UserId) -> *v505.GroupedHeartRateAlertResponse
@@ -4938,18 +4935,18 @@ client.Vitals.StandHourGrouped(
```go -request := &vitalgo.VitalsHeartRateAlertGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsHeartRateAlertGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -5025,7 +5022,7 @@ client.Vitals.HeartRateAlertGrouped(
-
client.Vitals.AfibBurdenGrouped(UserId) -> *vitalgo.GroupedAFibBurdenResponse +
client.Vitals.AfibBurdenGrouped(UserId) -> *v505.GroupedAFibBurdenResponse
@@ -5038,18 +5035,18 @@ client.Vitals.HeartRateAlertGrouped(
```go -request := &vitalgo.VitalsAfibBurdenGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsAfibBurdenGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -5125,7 +5122,7 @@ client.Vitals.AfibBurdenGrouped(
-
client.Vitals.WorkoutDurationGrouped(UserId) -> *vitalgo.GroupedWorkoutDurationResponse +
client.Vitals.WorkoutDurationGrouped(UserId) -> *v505.GroupedWorkoutDurationResponse
@@ -5138,18 +5135,18 @@ client.Vitals.AfibBurdenGrouped(
```go -request := &vitalgo.VitalsWorkoutDurationGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsWorkoutDurationGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -5225,7 +5222,7 @@ client.Vitals.WorkoutDurationGrouped(
-
client.Vitals.Vo2MaxGrouped(UserId) -> *vitalgo.GroupedVo2MaxResponse +
client.Vitals.Vo2MaxGrouped(UserId) -> *v505.GroupedVo2MaxResponse
@@ -5238,18 +5235,18 @@ client.Vitals.WorkoutDurationGrouped(
```go -request := &vitalgo.VitalsVo2MaxGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsVo2MaxGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -5325,7 +5322,7 @@ client.Vitals.Vo2MaxGrouped(
-
client.Vitals.StressLevelGrouped(UserId) -> *vitalgo.GroupedStressLevelResponse +
client.Vitals.StressLevelGrouped(UserId) -> *v505.GroupedStressLevelResponse
@@ -5338,18 +5335,18 @@ client.Vitals.Vo2MaxGrouped(
```go -request := &vitalgo.VitalsStressLevelGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsStressLevelGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -5425,7 +5422,7 @@ client.Vitals.StressLevelGrouped(
-
client.Vitals.MindfulnessMinutesGrouped(UserId) -> *vitalgo.GroupedMindfulnessMinutesResponse +
client.Vitals.MindfulnessMinutesGrouped(UserId) -> *v505.GroupedMindfulnessMinutesResponse
@@ -5438,18 +5435,18 @@ client.Vitals.StressLevelGrouped(
```go -request := &vitalgo.VitalsMindfulnessMinutesGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsMindfulnessMinutesGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -5525,7 +5522,7 @@ client.Vitals.MindfulnessMinutesGrouped(
-
client.Vitals.CaffeineGrouped(UserId) -> *vitalgo.GroupedCaffeineResponse +
client.Vitals.CaffeineGrouped(UserId) -> *v505.GroupedCaffeineResponse
@@ -5538,18 +5535,18 @@ client.Vitals.MindfulnessMinutesGrouped(
```go -request := &vitalgo.VitalsCaffeineGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsCaffeineGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -5625,7 +5622,7 @@ client.Vitals.CaffeineGrouped(
-
client.Vitals.WaterGrouped(UserId) -> *vitalgo.GroupedWaterResponse +
client.Vitals.WaterGrouped(UserId) -> *v505.GroupedWaterResponse
@@ -5638,18 +5635,18 @@ client.Vitals.CaffeineGrouped(
```go -request := &vitalgo.VitalsWaterGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsWaterGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -5725,7 +5722,7 @@ client.Vitals.WaterGrouped(
-
client.Vitals.StepsGrouped(UserId) -> *vitalgo.GroupedStepsResponse +
client.Vitals.StepsGrouped(UserId) -> *v505.GroupedStepsResponse
@@ -5738,18 +5735,18 @@ client.Vitals.WaterGrouped(
```go -request := &vitalgo.VitalsStepsGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsStepsGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -5825,7 +5822,7 @@ client.Vitals.StepsGrouped(
-
client.Vitals.FloorsClimbedGrouped(UserId) -> *vitalgo.GroupedFloorsClimbedResponse +
client.Vitals.FloorsClimbedGrouped(UserId) -> *v505.GroupedFloorsClimbedResponse
@@ -5838,18 +5835,18 @@ client.Vitals.StepsGrouped(
```go -request := &vitalgo.VitalsFloorsClimbedGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsFloorsClimbedGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -5925,7 +5922,7 @@ client.Vitals.FloorsClimbedGrouped(
-
client.Vitals.DistanceGrouped(UserId) -> *vitalgo.GroupedDistanceResponse +
client.Vitals.DistanceGrouped(UserId) -> *v505.GroupedDistanceResponse
@@ -5938,18 +5935,18 @@ client.Vitals.FloorsClimbedGrouped(
```go -request := &vitalgo.VitalsDistanceGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsDistanceGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -6025,7 +6022,7 @@ client.Vitals.DistanceGrouped(
-
client.Vitals.CaloriesBasalGrouped(UserId) -> *vitalgo.GroupedCaloriesBasalResponse +
client.Vitals.CaloriesBasalGrouped(UserId) -> *v505.GroupedCaloriesBasalResponse
@@ -6038,18 +6035,18 @@ client.Vitals.DistanceGrouped(
```go -request := &vitalgo.VitalsCaloriesBasalGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsCaloriesBasalGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -6125,7 +6122,7 @@ client.Vitals.CaloriesBasalGrouped(
-
client.Vitals.CaloriesActiveGrouped(UserId) -> *vitalgo.GroupedCaloriesActiveResponse +
client.Vitals.CaloriesActiveGrouped(UserId) -> *v505.GroupedCaloriesActiveResponse
@@ -6138,18 +6135,18 @@ client.Vitals.CaloriesBasalGrouped(
```go -request := &vitalgo.VitalsCaloriesActiveGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsCaloriesActiveGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -6225,7 +6222,7 @@ client.Vitals.CaloriesActiveGrouped(
-
client.Vitals.RespiratoryRateGrouped(UserId) -> *vitalgo.GroupedRespiratoryRateResponse +
client.Vitals.RespiratoryRateGrouped(UserId) -> *v505.GroupedRespiratoryRateResponse
@@ -6238,18 +6235,18 @@ client.Vitals.CaloriesActiveGrouped(
```go -request := &vitalgo.VitalsRespiratoryRateGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsRespiratoryRateGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -6325,7 +6322,7 @@ client.Vitals.RespiratoryRateGrouped(
-
client.Vitals.NoteGrouped(UserId) -> *vitalgo.GroupedNoteResponse +
client.Vitals.NoteGrouped(UserId) -> *v505.GroupedNoteResponse
@@ -6338,18 +6335,18 @@ client.Vitals.RespiratoryRateGrouped(
```go -request := &vitalgo.VitalsNoteGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsNoteGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -6425,7 +6422,7 @@ client.Vitals.NoteGrouped(
-
client.Vitals.InsulinInjectionGrouped(UserId) -> *vitalgo.GroupedInsulinInjectionResponse +
client.Vitals.InsulinInjectionGrouped(UserId) -> *v505.GroupedInsulinInjectionResponse
@@ -6438,18 +6435,18 @@ client.Vitals.NoteGrouped(
```go -request := &vitalgo.VitalsInsulinInjectionGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsInsulinInjectionGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -6525,7 +6522,7 @@ client.Vitals.InsulinInjectionGrouped(
-
client.Vitals.IgeGrouped(UserId) -> *vitalgo.GroupedIgeResponse +
client.Vitals.IgeGrouped(UserId) -> *v505.GroupedIgeResponse
@@ -6538,18 +6535,18 @@ client.Vitals.InsulinInjectionGrouped(
```go -request := &vitalgo.VitalsIgeGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsIgeGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -6625,7 +6622,7 @@ client.Vitals.IgeGrouped(
-
client.Vitals.IggGrouped(UserId) -> *vitalgo.GroupedIggResponse +
client.Vitals.IggGrouped(UserId) -> *v505.GroupedIggResponse
@@ -6638,18 +6635,18 @@ client.Vitals.IgeGrouped(
```go -request := &vitalgo.VitalsIggGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsIggGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -6725,7 +6722,7 @@ client.Vitals.IggGrouped(
-
client.Vitals.HypnogramGrouped(UserId) -> *vitalgo.GroupedHypnogramResponse +
client.Vitals.HypnogramGrouped(UserId) -> *v505.GroupedHypnogramResponse
@@ -6738,18 +6735,18 @@ client.Vitals.IggGrouped(
```go -request := &vitalgo.VitalsHypnogramGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsHypnogramGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -6825,7 +6822,7 @@ client.Vitals.HypnogramGrouped(
-
client.Vitals.HrvGrouped(UserId) -> *vitalgo.GroupedHrvResponse +
client.Vitals.HrvGrouped(UserId) -> *v505.GroupedHrvResponse
@@ -6838,18 +6835,18 @@ client.Vitals.HypnogramGrouped(
```go -request := &vitalgo.VitalsHrvGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsHrvGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -6925,7 +6922,7 @@ client.Vitals.HrvGrouped(
-
client.Vitals.HeartrateGrouped(UserId) -> *vitalgo.GroupedHeartRateResponse +
client.Vitals.HeartrateGrouped(UserId) -> *v505.GroupedHeartRateResponse
@@ -6938,18 +6935,18 @@ client.Vitals.HrvGrouped(
```go -request := &vitalgo.VitalsHeartrateGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsHeartrateGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -7025,7 +7022,7 @@ client.Vitals.HeartrateGrouped(
-
client.Vitals.GlucoseGrouped(UserId) -> *vitalgo.GroupedGlucoseResponse +
client.Vitals.GlucoseGrouped(UserId) -> *v505.GroupedGlucoseResponse
@@ -7038,18 +7035,18 @@ client.Vitals.HeartrateGrouped(
```go -request := &vitalgo.VitalsGlucoseGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsGlucoseGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -7125,7 +7122,7 @@ client.Vitals.GlucoseGrouped(
-
client.Vitals.CholesterolGrouped(UserId) -> *vitalgo.GroupedCholesterolResponse +
client.Vitals.CholesterolGrouped(UserId) -> *v505.GroupedCholesterolResponse
@@ -7138,18 +7135,18 @@ client.Vitals.GlucoseGrouped(
```go -request := &vitalgo.VitalsCholesterolGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsCholesterolGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -7225,7 +7222,7 @@ client.Vitals.CholesterolGrouped(
-
client.Vitals.CarbohydratesGrouped(UserId) -> *vitalgo.GroupedCarbohydratesResponse +
client.Vitals.CarbohydratesGrouped(UserId) -> *v505.GroupedCarbohydratesResponse
@@ -7238,18 +7235,18 @@ client.Vitals.CholesterolGrouped(
```go -request := &vitalgo.VitalsCarbohydratesGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsCarbohydratesGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -7325,7 +7322,7 @@ client.Vitals.CarbohydratesGrouped(
-
client.Vitals.BodyTemperatureDeltaGrouped(UserId) -> *vitalgo.GroupedBodyTemperatureDeltaResponse +
client.Vitals.BodyTemperatureDeltaGrouped(UserId) -> *v505.GroupedBodyTemperatureDeltaResponse
@@ -7338,18 +7335,18 @@ client.Vitals.CarbohydratesGrouped(
```go -request := &vitalgo.VitalsBodyTemperatureDeltaGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsBodyTemperatureDeltaGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -7425,7 +7422,7 @@ client.Vitals.BodyTemperatureDeltaGrouped(
-
client.Vitals.BodyTemperatureGrouped(UserId) -> *vitalgo.GroupedBodyTemperatureResponse +
client.Vitals.BodyTemperatureGrouped(UserId) -> *v505.GroupedBodyTemperatureResponse
@@ -7438,18 +7435,18 @@ client.Vitals.BodyTemperatureDeltaGrouped(
```go -request := &vitalgo.VitalsBodyTemperatureGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsBodyTemperatureGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -7525,7 +7522,7 @@ client.Vitals.BodyTemperatureGrouped(
-
client.Vitals.BodyWeightGrouped(UserId) -> *vitalgo.GroupedBodyWeightResponse +
client.Vitals.BodyWeightGrouped(UserId) -> *v505.GroupedBodyWeightResponse
@@ -7538,18 +7535,18 @@ client.Vitals.BodyTemperatureGrouped(
```go -request := &vitalgo.VitalsBodyWeightGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsBodyWeightGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -7625,7 +7622,7 @@ client.Vitals.BodyWeightGrouped(
-
client.Vitals.BodyFatGrouped(UserId) -> *vitalgo.GroupedBodyFatResponse +
client.Vitals.BodyFatGrouped(UserId) -> *v505.GroupedBodyFatResponse
@@ -7638,18 +7635,18 @@ client.Vitals.BodyWeightGrouped(
```go -request := &vitalgo.VitalsBodyFatGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsBodyFatGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -7725,7 +7722,7 @@ client.Vitals.BodyFatGrouped(
-
client.Vitals.BloodOxygenGrouped(UserId) -> *vitalgo.GroupedBloodOxygenResponse +
client.Vitals.BloodOxygenGrouped(UserId) -> *v505.GroupedBloodOxygenResponse
@@ -7738,18 +7735,18 @@ client.Vitals.BodyFatGrouped(
```go -request := &vitalgo.VitalsBloodOxygenGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsBloodOxygenGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -7825,7 +7822,7 @@ client.Vitals.BloodOxygenGrouped(
-
client.Vitals.ElectrocardiogramVoltageGrouped(UserId) -> *vitalgo.GroupedElectrocardiogramVoltageResponse +
client.Vitals.ElectrocardiogramVoltageGrouped(UserId) -> *v505.GroupedElectrocardiogramVoltageResponse
@@ -7838,18 +7835,18 @@ client.Vitals.BloodOxygenGrouped(
```go -request := &vitalgo.VitalsElectrocardiogramVoltageGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsElectrocardiogramVoltageGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -7925,7 +7922,7 @@ client.Vitals.ElectrocardiogramVoltageGrouped(
-
client.Vitals.BloodPressureGrouped(UserId) -> *vitalgo.GroupedBloodPressureResponse +
client.Vitals.BloodPressureGrouped(UserId) -> *v505.GroupedBloodPressureResponse
@@ -7938,18 +7935,18 @@ client.Vitals.ElectrocardiogramVoltageGrouped(
```go -request := &vitalgo.VitalsBloodPressureGroupedRequest{ - Cursor: vitalgo.String( +request := &v505.VitalsBloodPressureGroupedRequest{ + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - Provider: vitalgo.String( + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -8025,7 +8022,7 @@ client.Vitals.BloodPressureGrouped(
-
client.Vitals.Vo2Max(UserId) -> []*vitalgo.ClientFacingVo2MaxTimeseries +
client.Vitals.Vo2Max(UserId) -> []*v505.ClientFacingVo2MaxTimeseries
@@ -8038,12 +8035,12 @@ client.Vitals.BloodPressureGrouped(
```go -request := &vitalgo.VitalsVo2MaxRequest{ - Provider: vitalgo.String( +request := &v505.VitalsVo2MaxRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -8103,7 +8100,7 @@ client.Vitals.Vo2Max(
-
client.Vitals.StressLevel(UserId) -> []*vitalgo.ClientFacingStressLevelTimeseries +
client.Vitals.StressLevel(UserId) -> []*v505.ClientFacingStressLevelTimeseries
@@ -8116,12 +8113,12 @@ client.Vitals.Vo2Max(
```go -request := &vitalgo.VitalsStressLevelRequest{ - Provider: vitalgo.String( +request := &v505.VitalsStressLevelRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -8181,7 +8178,7 @@ client.Vitals.StressLevel(
-
client.Vitals.MindfulnessMinutes(UserId) -> []*vitalgo.ClientFacingMindfulnessMinutesTimeseries +
client.Vitals.MindfulnessMinutes(UserId) -> []*v505.ClientFacingMindfulnessMinutesTimeseries
@@ -8194,12 +8191,12 @@ client.Vitals.StressLevel(
```go -request := &vitalgo.VitalsMindfulnessMinutesRequest{ - Provider: vitalgo.String( +request := &v505.VitalsMindfulnessMinutesRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -8259,7 +8256,7 @@ client.Vitals.MindfulnessMinutes(
-
client.Vitals.Caffeine(UserId) -> []*vitalgo.ClientFacingCaffeineTimeseries +
client.Vitals.Caffeine(UserId) -> []*v505.ClientFacingCaffeineTimeseries
@@ -8272,12 +8269,12 @@ client.Vitals.MindfulnessMinutes(
```go -request := &vitalgo.VitalsCaffeineRequest{ - Provider: vitalgo.String( +request := &v505.VitalsCaffeineRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -8337,7 +8334,7 @@ client.Vitals.Caffeine(
-
client.Vitals.Water(UserId) -> []*vitalgo.ClientFacingWaterTimeseries +
client.Vitals.Water(UserId) -> []*v505.ClientFacingWaterTimeseries
@@ -8350,12 +8347,12 @@ client.Vitals.Caffeine(
```go -request := &vitalgo.VitalsWaterRequest{ - Provider: vitalgo.String( +request := &v505.VitalsWaterRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -8415,7 +8412,7 @@ client.Vitals.Water(
-
client.Vitals.Steps(UserId) -> []*vitalgo.ClientFacingStepsTimeseries +
client.Vitals.Steps(UserId) -> []*v505.ClientFacingStepsTimeseries
@@ -8428,12 +8425,12 @@ client.Vitals.Water(
```go -request := &vitalgo.VitalsStepsRequest{ - Provider: vitalgo.String( +request := &v505.VitalsStepsRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -8493,7 +8490,7 @@ client.Vitals.Steps(
-
client.Vitals.FloorsClimbed(UserId) -> []*vitalgo.ClientFacingFloorsClimbedTimeseries +
client.Vitals.FloorsClimbed(UserId) -> []*v505.ClientFacingFloorsClimbedTimeseries
@@ -8506,12 +8503,12 @@ client.Vitals.Steps(
```go -request := &vitalgo.VitalsFloorsClimbedRequest{ - Provider: vitalgo.String( +request := &v505.VitalsFloorsClimbedRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -8571,7 +8568,7 @@ client.Vitals.FloorsClimbed(
-
client.Vitals.Distance(UserId) -> []*vitalgo.ClientFacingDistanceTimeseries +
client.Vitals.Distance(UserId) -> []*v505.ClientFacingDistanceTimeseries
@@ -8584,12 +8581,12 @@ client.Vitals.FloorsClimbed(
```go -request := &vitalgo.VitalsDistanceRequest{ - Provider: vitalgo.String( +request := &v505.VitalsDistanceRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -8649,7 +8646,7 @@ client.Vitals.Distance(
-
client.Vitals.CaloriesBasal(UserId) -> []*vitalgo.ClientFacingCaloriesBasalTimeseries +
client.Vitals.CaloriesBasal(UserId) -> []*v505.ClientFacingCaloriesBasalTimeseries
@@ -8662,12 +8659,12 @@ client.Vitals.Distance(
```go -request := &vitalgo.VitalsCaloriesBasalRequest{ - Provider: vitalgo.String( +request := &v505.VitalsCaloriesBasalRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -8727,7 +8724,7 @@ client.Vitals.CaloriesBasal(
-
client.Vitals.CaloriesActive(UserId) -> []*vitalgo.ClientFacingCaloriesActiveTimeseries +
client.Vitals.CaloriesActive(UserId) -> []*v505.ClientFacingCaloriesActiveTimeseries
@@ -8740,12 +8737,12 @@ client.Vitals.CaloriesBasal(
```go -request := &vitalgo.VitalsCaloriesActiveRequest{ - Provider: vitalgo.String( +request := &v505.VitalsCaloriesActiveRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -8805,7 +8802,7 @@ client.Vitals.CaloriesActive(
-
client.Vitals.RespiratoryRate(UserId) -> []*vitalgo.ClientFacingRespiratoryRateTimeseries +
client.Vitals.RespiratoryRate(UserId) -> []*v505.ClientFacingRespiratoryRateTimeseries
@@ -8818,12 +8815,12 @@ client.Vitals.CaloriesActive(
```go -request := &vitalgo.VitalsRespiratoryRateRequest{ - Provider: vitalgo.String( +request := &v505.VitalsRespiratoryRateRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -8883,7 +8880,7 @@ client.Vitals.RespiratoryRate(
-
client.Vitals.Ige(UserId) -> []*vitalgo.ClientFacingIgeTimeseries +
client.Vitals.Ige(UserId) -> []*v505.ClientFacingIgeTimeseries
@@ -8896,12 +8893,12 @@ client.Vitals.RespiratoryRate(
```go -request := &vitalgo.VitalsIgeRequest{ - Provider: vitalgo.String( +request := &v505.VitalsIgeRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -8961,7 +8958,7 @@ client.Vitals.Ige(
-
client.Vitals.Igg(UserId) -> []*vitalgo.ClientFacingIggTimeseries +
client.Vitals.Igg(UserId) -> []*v505.ClientFacingIggTimeseries
@@ -8974,12 +8971,12 @@ client.Vitals.Ige(
```go -request := &vitalgo.VitalsIggRequest{ - Provider: vitalgo.String( +request := &v505.VitalsIggRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -9039,7 +9036,7 @@ client.Vitals.Igg(
-
client.Vitals.Hypnogram(UserId) -> []*vitalgo.ClientFacingHypnogramTimeseries +
client.Vitals.Hypnogram(UserId) -> []*v505.ClientFacingHypnogramTimeseries
@@ -9052,12 +9049,12 @@ client.Vitals.Igg(
```go -request := &vitalgo.VitalsHypnogramRequest{ - Provider: vitalgo.String( +request := &v505.VitalsHypnogramRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -9117,7 +9114,7 @@ client.Vitals.Hypnogram(
-
client.Vitals.Hrv(UserId) -> []*vitalgo.ClientFacingHrvTimeseries +
client.Vitals.Hrv(UserId) -> []*v505.ClientFacingHrvTimeseries
@@ -9130,12 +9127,12 @@ client.Vitals.Hypnogram(
```go -request := &vitalgo.VitalsHrvRequest{ - Provider: vitalgo.String( +request := &v505.VitalsHrvRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -9195,7 +9192,7 @@ client.Vitals.Hrv(
-
client.Vitals.Heartrate(UserId) -> []*vitalgo.ClientFacingHeartRateTimeseries +
client.Vitals.Heartrate(UserId) -> []*v505.ClientFacingHeartRateTimeseries
@@ -9208,12 +9205,12 @@ client.Vitals.Hrv(
```go -request := &vitalgo.VitalsHeartrateRequest{ - Provider: vitalgo.String( +request := &v505.VitalsHeartrateRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -9273,7 +9270,7 @@ client.Vitals.Heartrate(
-
client.Vitals.Glucose(UserId) -> []*vitalgo.ClientFacingGlucoseTimeseries +
client.Vitals.Glucose(UserId) -> []*v505.ClientFacingGlucoseTimeseries
@@ -9286,12 +9283,12 @@ client.Vitals.Heartrate(
```go -request := &vitalgo.VitalsGlucoseRequest{ - Provider: vitalgo.String( +request := &v505.VitalsGlucoseRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -9351,7 +9348,7 @@ client.Vitals.Glucose(
-
client.Vitals.CholesterolTriglycerides(UserId) -> []*vitalgo.ClientFacingCholesterolTimeseries +
client.Vitals.CholesterolTriglycerides(UserId) -> []*v505.ClientFacingCholesterolTimeseries
@@ -9364,12 +9361,12 @@ client.Vitals.Glucose(
```go -request := &vitalgo.VitalsCholesterolTriglyceridesRequest{ - Provider: vitalgo.String( +request := &v505.VitalsCholesterolTriglyceridesRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -9429,7 +9426,7 @@ client.Vitals.CholesterolTriglycerides(
-
client.Vitals.CholesterolTotal(UserId) -> []*vitalgo.ClientFacingCholesterolTimeseries +
client.Vitals.CholesterolTotal(UserId) -> []*v505.ClientFacingCholesterolTimeseries
@@ -9442,12 +9439,12 @@ client.Vitals.CholesterolTriglycerides(
```go -request := &vitalgo.VitalsCholesterolTotalRequest{ - Provider: vitalgo.String( +request := &v505.VitalsCholesterolTotalRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -9507,7 +9504,7 @@ client.Vitals.CholesterolTotal(
-
client.Vitals.CholesterolLdl(UserId) -> []*vitalgo.ClientFacingCholesterolTimeseries +
client.Vitals.CholesterolLdl(UserId) -> []*v505.ClientFacingCholesterolTimeseries
@@ -9520,12 +9517,12 @@ client.Vitals.CholesterolTotal(
```go -request := &vitalgo.VitalsCholesterolLdlRequest{ - Provider: vitalgo.String( +request := &v505.VitalsCholesterolLdlRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -9585,7 +9582,7 @@ client.Vitals.CholesterolLdl(
-
client.Vitals.CholesterolHdl(UserId) -> []*vitalgo.ClientFacingCholesterolTimeseries +
client.Vitals.CholesterolHdl(UserId) -> []*v505.ClientFacingCholesterolTimeseries
@@ -9598,12 +9595,12 @@ client.Vitals.CholesterolLdl(
```go -request := &vitalgo.VitalsCholesterolHdlRequest{ - Provider: vitalgo.String( +request := &v505.VitalsCholesterolHdlRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -9663,7 +9660,7 @@ client.Vitals.CholesterolHdl(
-
client.Vitals.Cholesterol(UserId) -> []*vitalgo.ClientFacingCholesterolTimeseries +
client.Vitals.Cholesterol(UserId) -> []*v505.ClientFacingCholesterolTimeseries
@@ -9676,12 +9673,12 @@ client.Vitals.CholesterolHdl(
```go -request := &vitalgo.VitalsCholesterolRequest{ - Provider: vitalgo.String( +request := &v505.VitalsCholesterolRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -9741,7 +9738,7 @@ client.Vitals.Cholesterol(
-
client.Vitals.BodyWeight(UserId) -> []*vitalgo.ClientFacingBodyWeightTimeseries +
client.Vitals.BodyWeight(UserId) -> []*v505.ClientFacingBodyWeightTimeseries
@@ -9754,12 +9751,12 @@ client.Vitals.Cholesterol(
```go -request := &vitalgo.VitalsBodyWeightRequest{ - Provider: vitalgo.String( +request := &v505.VitalsBodyWeightRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -9819,7 +9816,7 @@ client.Vitals.BodyWeight(
-
client.Vitals.BodyFat(UserId) -> []*vitalgo.ClientFacingBodyFatTimeseries +
client.Vitals.BodyFat(UserId) -> []*v505.ClientFacingBodyFatTimeseries
@@ -9832,12 +9829,12 @@ client.Vitals.BodyWeight(
```go -request := &vitalgo.VitalsBodyFatRequest{ - Provider: vitalgo.String( +request := &v505.VitalsBodyFatRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -9897,7 +9894,7 @@ client.Vitals.BodyFat(
-
client.Vitals.BloodOxygen(UserId) -> []*vitalgo.ClientFacingBloodOxygenTimeseries +
client.Vitals.BloodOxygen(UserId) -> []*v505.ClientFacingBloodOxygenTimeseries
@@ -9910,12 +9907,12 @@ client.Vitals.BodyFat(
```go -request := &vitalgo.VitalsBloodOxygenRequest{ - Provider: vitalgo.String( +request := &v505.VitalsBloodOxygenRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -9975,7 +9972,7 @@ client.Vitals.BloodOxygen(
-
client.Vitals.ElectrocardiogramVoltage(UserId) -> []*vitalgo.ClientFacingElectrocardiogramVoltageTimeseries +
client.Vitals.ElectrocardiogramVoltage(UserId) -> []*v505.ClientFacingElectrocardiogramVoltageTimeseries
@@ -9988,12 +9985,12 @@ client.Vitals.BloodOxygen(
```go -request := &vitalgo.VitalsElectrocardiogramVoltageRequest{ - Provider: vitalgo.String( +request := &v505.VitalsElectrocardiogramVoltageRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -10053,7 +10050,7 @@ client.Vitals.ElectrocardiogramVoltage(
-
client.Vitals.BloodPressure(UserId) -> []*vitalgo.ClientFacingBloodPressureTimeseries +
client.Vitals.BloodPressure(UserId) -> []*v505.ClientFacingBloodPressureTimeseries
@@ -10066,12 +10063,12 @@ client.Vitals.ElectrocardiogramVoltage(
```go -request := &vitalgo.VitalsBloodPressureRequest{ - Provider: vitalgo.String( +request := &v505.VitalsBloodPressureRequest{ + Provider: v505.String( "provider", ), StartDate: "start_date", - EndDate: vitalgo.String( + EndDate: v505.String( "end_date", ), } @@ -10132,7 +10129,7 @@ client.Vitals.BloodPressure(
## User -
client.User.GetAll() -> *vitalgo.PaginatedUsersResponse +
client.User.GetAll() -> *v505.PaginatedUsersResponse
@@ -10159,11 +10156,11 @@ GET All users for team.
```go -request := &vitalgo.UserGetAllRequest{ - Offset: vitalgo.Int( +request := &v505.UserGetAllRequest{ + Offset: v505.Int( 1, ), - Limit: vitalgo.Int( + Limit: v505.Int( 1, ), } @@ -10206,7 +10203,7 @@ client.User.GetAll(
-
client.User.Create(request) -> *vitalgo.ClientFacingUserKey +
client.User.Create(request) -> *v505.ClientFacingUserKey
@@ -10233,7 +10230,7 @@ POST Create a Vital user given a client_user_id and returns the user_id.
```go -request := &vitalgo.UserCreateBody{ +request := &v505.UserCreateBody{ ClientUserId: "client_user_id", } client.User.Create( @@ -10304,7 +10301,7 @@ client.User.Create(
-
client.User.GetTeamMetrics() -> *vitalgo.MetricsResult +
client.User.GetTeamMetrics() -> *v505.MetricsResult
@@ -10346,7 +10343,7 @@ client.User.GetTeamMetrics(
-
client.User.GetConnectedProviders(UserId) -> map[string][]*vitalgo.ClientFacingProviderWithStatus +
client.User.GetConnectedProviders(UserId) -> map[string][]*v505.ClientFacingProviderWithStatus
@@ -10404,7 +10401,7 @@ client.User.GetConnectedProviders(
-
client.User.GetLatestUserInfo(UserId) -> *vitalgo.UserInfo +
client.User.GetLatestUserInfo(UserId) -> *v505.UserInfo
@@ -10448,7 +10445,7 @@ client.User.GetLatestUserInfo(
-
client.User.CreateInsurance(UserId, request) -> *vitalgo.ClientFacingInsurance +
client.User.CreateInsurance(UserId, request) -> *v505.ClientFacingInsurance
@@ -10461,15 +10458,15 @@ client.User.GetLatestUserInfo(
```go -request := &vitalgo.CreateInsuranceRequest{ +request := &v505.CreateInsuranceRequest{ PayorCode: "payor_code", MemberId: "member_id", - Relationship: vitalgo.ResponsibleRelationshipSelf, - Insured: &vitalgo.VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails{ + Relationship: v505.ResponsibleRelationshipSelf, + Insured: &v505.VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails{ FirstName: "first_name", LastName: "last_name", - Gender: vitalgo.GenderFemale, - Address: &vitalgo.Address{ + Gender: v505.GenderFemale, + Address: &v505.Address{ FirstLine: "first_line", Country: "country", Zip: "zip", @@ -10533,7 +10530,7 @@ client.User.CreateInsurance(
-**relationship:** `*vitalgo.ResponsibleRelationship` +**relationship:** `*v505.ResponsibleRelationship`
@@ -10541,7 +10538,7 @@ client.User.CreateInsurance(
-**insured:** `*vitalgo.VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails` +**insured:** `*v505.VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails`
@@ -10549,7 +10546,7 @@ client.User.CreateInsurance(
-**guarantor:** `*vitalgo.GuarantorDetails` +**guarantor:** `*v505.GuarantorDetails`
@@ -10569,7 +10566,7 @@ client.User.CreateInsurance(
-
client.User.GetLatestInsurance(UserId) -> *vitalgo.ClientFacingInsurance +
client.User.GetLatestInsurance(UserId) -> *v505.ClientFacingInsurance
@@ -10582,8 +10579,8 @@ client.User.CreateInsurance(
```go -request := &vitalgo.UserGetLatestInsuranceRequest{ - IsPrimary: vitalgo.Bool( +request := &v505.UserGetLatestInsuranceRequest{ + IsPrimary: v505.Bool( true, ), } @@ -10627,7 +10624,7 @@ client.User.GetLatestInsurance(
-
client.User.UpsertUserInfo(UserId, request) -> *vitalgo.UserInfo +
client.User.UpsertUserInfo(UserId, request) -> *v505.UserInfo
@@ -10640,14 +10637,14 @@ client.User.GetLatestInsurance(
```go -request := &vitalgo.UserInfoCreateRequest{ +request := &v505.UserInfoCreateRequest{ FirstName: "first_name", LastName: "last_name", Email: "email", PhoneNumber: "phone_number", Gender: "gender", Dob: "dob", - Address: &vitalgo.Address{ + Address: &v505.UserAddress{ FirstLine: "first_line", Country: "country", Zip: "zip", @@ -10731,7 +10728,7 @@ client.User.UpsertUserInfo(
-**address:** `*vitalgo.Address` +**address:** `*v505.UserAddress`
@@ -10739,7 +10736,7 @@ client.User.UpsertUserInfo(
-**medicalProxy:** `*vitalgo.GuarantorDetails` +**medicalProxy:** `*v505.GuarantorDetails`
@@ -10747,7 +10744,7 @@ client.User.UpsertUserInfo(
-**race:** `*vitalgo.Race` +**race:** `*v505.Race`
@@ -10755,7 +10752,7 @@ client.User.UpsertUserInfo(
-**ethnicity:** `*vitalgo.Ethnicity` +**ethnicity:** `*v505.Ethnicity`
@@ -10763,7 +10760,7 @@ client.User.UpsertUserInfo(
-**sexualOrientation:** `*vitalgo.SexualOrientation` +**sexualOrientation:** `*v505.SexualOrientation`
@@ -10771,7 +10768,7 @@ client.User.UpsertUserInfo(
-**genderIdentity:** `*vitalgo.GenderIdentity` +**genderIdentity:** `*v505.GenderIdentity`
@@ -10783,7 +10780,7 @@ client.User.UpsertUserInfo(
-
client.User.GetByClientUserId(ClientUserId) -> *vitalgo.ClientFacingUser +
client.User.GetByClientUserId(ClientUserId) -> *v505.ClientFacingUser
@@ -10841,7 +10838,7 @@ client.User.GetByClientUserId(
-
client.User.DeregisterProvider(UserId, Provider) -> *vitalgo.UserSuccessResponse +
client.User.DeregisterProvider(UserId, Provider) -> *v505.UserSuccessResponse
@@ -10857,7 +10854,7 @@ client.User.GetByClientUserId( client.User.DeregisterProvider( context.TODO(), "user_id", - vitalgo.ProvidersOura.Ptr(), + v505.ProvidersOura.Ptr(), ) } ``` @@ -10882,7 +10879,7 @@ client.User.DeregisterProvider(
-**provider:** `*vitalgo.Providers` — Provider slug. e.g., `oura`, `fitbit`, `garmin`. +**provider:** `*v505.Providers` — Provider slug. e.g., `oura`, `fitbit`, `garmin`.
@@ -10894,7 +10891,7 @@ client.User.DeregisterProvider(
-
client.User.Get(UserId) -> *vitalgo.ClientFacingUser +
client.User.Get(UserId) -> *v505.ClientFacingUser
@@ -10938,7 +10935,7 @@ client.User.Get(
-
client.User.Delete(UserId) -> *vitalgo.UserSuccessResponse +
client.User.Delete(UserId) -> *v505.UserSuccessResponse
@@ -10995,7 +10992,7 @@ client.User.Delete(
```go -request := &vitalgo.UserPatchBody{} +request := &v505.UserPatchBody{} client.User.Patch( context.TODO(), "user_id", @@ -11073,7 +11070,7 @@ client.User.Patch(
-
client.User.UndoDelete() -> *vitalgo.UserSuccessResponse +
client.User.UndoDelete() -> *v505.UserSuccessResponse
@@ -11086,11 +11083,11 @@ client.User.Patch(
```go -request := &vitalgo.UserUndoDeleteRequest{ - UserId: vitalgo.String( +request := &v505.UserUndoDeleteRequest{ + UserId: v505.String( "user_id", ), - ClientUserId: vitalgo.String( + ClientUserId: v505.String( "client_user_id", ), } @@ -11133,7 +11130,7 @@ client.User.UndoDelete(
-
client.User.Refresh(UserId) -> *vitalgo.UserRefreshSuccessResponse +
client.User.Refresh(UserId) -> *v505.UserRefreshSuccessResponse
@@ -11160,8 +11157,8 @@ Trigger a manual refresh for a specific user
```go -request := &vitalgo.UserRefreshRequest{ - Timeout: vitalgo.Float64( +request := &v505.UserRefreshRequest{ + Timeout: v505.Float64( 1.1, ), } @@ -11205,7 +11202,7 @@ client.User.Refresh(
-
client.User.GetDevices(UserId) -> []*vitalgo.ClientFacingDevice +
client.User.GetDevices(UserId) -> []*v505.ClientFacingDevice
@@ -11249,7 +11246,7 @@ client.User.GetDevices(
-
client.User.GetDevice(UserId, DeviceId) -> *vitalgo.ClientFacingDevice +
client.User.GetDevice(UserId, DeviceId) -> *v505.ClientFacingDevice
@@ -11302,7 +11299,7 @@ client.User.GetDevice(
-
client.User.GetUserSignInToken(UserId) -> *vitalgo.UserSignInTokenResponse +
client.User.GetUserSignInToken(UserId) -> *v505.UserSignInTokenResponse
@@ -11346,7 +11343,7 @@ client.User.GetUserSignInToken(
-
client.User.CreatePortalUrl(UserId, request) -> *vitalgo.CreateUserPortalUrlResponse +
client.User.CreatePortalUrl(UserId, request) -> *v505.CreateUserPortalUrlResponse
@@ -11359,8 +11356,8 @@ client.User.GetUserSignInToken(
```go -request := &vitalgo.CreateUserPortalUrlBody{ - Context: vitalgo.CreateUserPortalUrlBodyContextLaunch, +request := &v505.CreateUserPortalUrlBody{ + Context: v505.CreateUserPortalUrlBodyContextLaunch, } client.User.CreatePortalUrl( context.TODO(), @@ -11390,7 +11387,7 @@ client.User.CreatePortalUrl(
-**context:** `*vitalgo.CreateUserPortalUrlBodyContext` +**context:** `*v505.CreateUserPortalUrlBodyContext` `launch`: Generates a short-lived (minutes) portal URL that is intended for launching a user from your authenticated web context directly into the Junction User Portal. This URL is not suitable for asynchronous @@ -11446,11 +11443,7 @@ Post teams.
```go -request := &vitalgo.TeamGetLinkConfigRequest{ - VitalLinkToken: vitalgo.String( - "x-vital-link-token", - ), - } +request := &v505.TeamGetLinkConfigRequest{} client.Team.GetLinkConfig( context.TODO(), request, @@ -11482,7 +11475,7 @@ client.Team.GetLinkConfig(
-
client.Team.Get(TeamId) -> *vitalgo.ClientFacingTeam +
client.Team.Get(TeamId) -> *v505.ClientFacingTeam
@@ -11540,7 +11533,7 @@ client.Team.Get(
-
client.Team.GetUserById() -> []*vitalgo.ClientFacingUser +
client.Team.GetUserById() -> []*v505.ClientFacingUser
@@ -11567,8 +11560,8 @@ Search team users by user_id
```go -request := &vitalgo.TeamGetUserByIdRequest{ - QueryId: vitalgo.String( +request := &v505.TeamGetUserByIdRequest{ + QueryId: v505.String( "query_id", ), } @@ -11658,8 +11651,8 @@ GET source priorities.
```go -request := &vitalgo.TeamGetSourcePrioritiesRequest{ - DataType: vitalgo.PriorityResourceWorkouts.Ptr(), +request := &v505.TeamGetSourcePrioritiesRequest{ + DataType: v505.PriorityResourceWorkouts.Ptr(), } client.Team.GetSourcePriorities( context.TODO(), @@ -11680,7 +11673,7 @@ client.Team.GetSourcePriorities(
-**dataType:** `*vitalgo.PriorityResource` +**dataType:** `*v505.PriorityResource`
@@ -11734,7 +11727,7 @@ client.Team.UpdateSourcePriorities(
-
client.Team.GetPhysicians(TeamId) -> []*vitalgo.ClientFacingPhysician +
client.Team.GetPhysicians(TeamId) -> []*v505.ClientFacingPhysician
@@ -11779,7 +11772,7 @@ client.Team.GetPhysicians(
## Providers -
client.Providers.GetAll() -> []*vitalgo.ClientFacingProviderDetailed +
client.Providers.GetAll() -> []*v505.ClientFacingProviderDetailed
@@ -11806,8 +11799,8 @@ Get Provider list
```go -request := &vitalgo.ProvidersGetAllRequest{ - SourceType: vitalgo.String( +request := &v505.ProvidersGetAllRequest{ + SourceType: v505.String( "source_type", ), } @@ -11843,7 +11836,7 @@ client.Providers.GetAll(
## Introspect -
client.Introspect.GetUserResources() -> *vitalgo.UserResourcesResponse +
client.Introspect.GetUserResources() -> *v505.UserResourcesResponse
@@ -11856,18 +11849,18 @@ client.Providers.GetAll(
```go -request := &vitalgo.IntrospectGetUserResourcesRequest{ - UserId: vitalgo.String( +request := &v505.IntrospectGetUserResourcesRequest{ + UserId: v505.String( "user_id", ), - Provider: vitalgo.ProvidersOura.Ptr(), - UserLimit: vitalgo.Int( + Provider: v505.ProvidersOura.Ptr(), + UserLimit: v505.Int( 1, ), - Cursor: vitalgo.String( + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), } @@ -11898,7 +11891,7 @@ client.Introspect.GetUserResources(
-**provider:** `*vitalgo.Providers` +**provider:** `*v505.Providers`
@@ -11934,7 +11927,7 @@ client.Introspect.GetUserResources(
-
client.Introspect.GetUserHistoricalPulls() -> *vitalgo.UserHistoricalPullsResponse +
client.Introspect.GetUserHistoricalPulls() -> *v505.UserHistoricalPullsResponse
@@ -11947,18 +11940,18 @@ client.Introspect.GetUserResources(
```go -request := &vitalgo.IntrospectGetUserHistoricalPullsRequest{ - UserId: vitalgo.String( +request := &v505.IntrospectGetUserHistoricalPullsRequest{ + UserId: v505.String( "user_id", ), - Provider: vitalgo.ProvidersOura.Ptr(), - UserLimit: vitalgo.Int( + Provider: v505.ProvidersOura.Ptr(), + UserLimit: v505.Int( 1, ), - Cursor: vitalgo.String( + Cursor: v505.String( "cursor", ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), } @@ -11989,7 +11982,7 @@ client.Introspect.GetUserHistoricalPulls(
-**provider:** `*vitalgo.Providers` +**provider:** `*v505.Providers`
@@ -12026,7 +12019,7 @@ client.Introspect.GetUserHistoricalPulls(
## LabTests -
client.LabTests.Get() -> []*vitalgo.ClientFacingLabTest +
client.LabTests.Get() -> []*v505.ClientFacingLabTest
@@ -12053,18 +12046,18 @@ GET all the lab tests the team has access to.
```go -request := &vitalgo.LabTestsGetRequest{ - GenerationMethod: vitalgo.LabTestGenerationMethodFilterAuto.Ptr(), - LabSlug: vitalgo.String( +request := &v505.LabTestsGetRequest{ + GenerationMethod: v505.LabTestGenerationMethodFilterAuto.Ptr(), + LabSlug: v505.String( "lab_slug", ), - CollectionMethod: vitalgo.LabTestCollectionMethodTestkit.Ptr(), - Status: vitalgo.LabTestStatusActive.Ptr(), - Name: vitalgo.String( + CollectionMethod: v505.LabTestCollectionMethodTestkit.Ptr(), + Status: v505.LabTestStatusActive.Ptr(), + Name: v505.String( "name", ), - OrderKey: vitalgo.LabTestsGetRequestOrderKeyPrice.Ptr(), - OrderDirection: vitalgo.LabTestsGetRequestOrderDirectionAsc.Ptr(), + OrderKey: v505.LabTestsGetRequestOrderKeyPrice.Ptr(), + OrderDirection: v505.LabTestsGetRequestOrderDirectionAsc.Ptr(), } client.LabTests.Get( context.TODO(), @@ -12085,7 +12078,7 @@ client.LabTests.Get(
-**generationMethod:** `*vitalgo.LabTestGenerationMethodFilter` — Filter on whether auto-generated lab tests created by Vital, manually created lab tests, or all lab tests should be returned. +**generationMethod:** `*v505.LabTestGenerationMethodFilter` — Filter on whether auto-generated lab tests created by Vital, manually created lab tests, or all lab tests should be returned.
@@ -12101,7 +12094,7 @@ client.LabTests.Get(
-**collectionMethod:** `*vitalgo.LabTestCollectionMethod` — Filter by the collection method for these lab tests. +**collectionMethod:** `*v505.LabTestCollectionMethod` — Filter by the collection method for these lab tests.
@@ -12109,7 +12102,7 @@ client.LabTests.Get(
-**status:** `*vitalgo.LabTestStatus` — Filter by the status of these lab tests. +**status:** `*v505.LabTestStatus` — Filter by the status of these lab tests.
@@ -12141,7 +12134,7 @@ client.LabTests.Get(
-**orderKey:** `*vitalgo.LabTestsGetRequestOrderKey` +**orderKey:** `*v505.LabTestsGetRequestOrderKey`
@@ -12149,7 +12142,7 @@ client.LabTests.Get(
-**orderDirection:** `*vitalgo.LabTestsGetRequestOrderDirection` +**orderDirection:** `*v505.LabTestsGetRequestOrderDirection`
@@ -12161,7 +12154,7 @@ client.LabTests.Get(
-
client.LabTests.Create(request) -> *vitalgo.ClientFacingLabTest +
client.LabTests.Create(request) -> *v505.ClientFacingLabTest
@@ -12174,9 +12167,9 @@ client.LabTests.Get(
```go -request := &vitalgo.CreateLabTestRequest{ +request := &v505.CreateLabTestRequest{ Name: "name", - Method: vitalgo.LabTestCollectionMethodTestkit, + Method: v505.LabTestCollectionMethodTestkit, Description: "description", } client.LabTests.Create( @@ -12222,7 +12215,7 @@ client.LabTests.Create(
-**method:** `*vitalgo.LabTestCollectionMethod` +**method:** `*v505.LabTestCollectionMethod`
@@ -12240,6 +12233,22 @@ client.LabTests.Create( **fasting:** `*bool` +
+
+ +
+
+ +**labAccountId:** `*string` + +
+
+ +
+
+ +**labSlug:** `*v505.Labs` +
@@ -12250,7 +12259,7 @@ client.LabTests.Create(
-
client.LabTests.GetById(LabTestId) -> *vitalgo.ClientFacingLabTest +
client.LabTests.GetById(LabTestId) -> *v505.ClientFacingLabTest
@@ -12277,8 +12286,8 @@ GET all the lab tests the team has access to.
```go -request := &vitalgo.LabTestsGetByIdRequest{ - LabAccountId: vitalgo.String( +request := &v505.LabTestsGetByIdRequest{ + LabAccountId: v505.String( "lab_account_id", ), } @@ -12322,7 +12331,7 @@ client.LabTests.GetById(
-
client.LabTests.UpdateLabTest(LabTestId, request) -> *vitalgo.ClientFacingLabTest +
client.LabTests.UpdateLabTest(LabTestId, request) -> *v505.ClientFacingLabTest
@@ -12335,7 +12344,7 @@ client.LabTests.GetById(
```go -request := &vitalgo.UpdateLabTestRequest{} +request := &v505.UpdateLabTestRequest{} client.LabTests.UpdateLabTest( context.TODO(), "lab_test_id", @@ -12384,7 +12393,7 @@ client.LabTests.UpdateLabTest(
-
client.LabTests.GetMarkers() -> *vitalgo.GetMarkersResponse +
client.LabTests.GetMarkers() -> *v505.GetMarkersResponse
@@ -12396,7 +12405,7 @@ client.LabTests.UpdateLabTest(
-GET all the markers for the given lab. +List active and orderable markers for a given Lab. Note that reflex markers are not included.
@@ -12411,20 +12420,23 @@ GET all the markers for the given lab.
```go -request := &vitalgo.LabTestsGetMarkersRequest{ - Name: vitalgo.String( +request := &v505.LabTestsGetMarkersRequest{ + LabSlug: v505.String( + "lab_slug", + ), + Name: v505.String( "name", ), - ALaCarteEnabled: vitalgo.Bool( + ALaCarteEnabled: v505.Bool( true, ), - LabAccountId: vitalgo.String( + LabAccountId: v505.String( "lab_account_id", ), - Page: vitalgo.Int( + Page: v505.Int( 1, ), - Size: vitalgo.Int( + Size: v505.Int( 1, ), } @@ -12455,6 +12467,14 @@ client.LabTests.GetMarkers(
+**labSlug:** `*string` — The slug of the lab for these markers. If both lab_id and lab_slug are provided, lab_slug will be used. + +
+
+ +
+
+ **name:** `*string` — The name or test code of an individual biomarker or a panel.
@@ -12499,7 +12519,7 @@ client.LabTests.GetMarkers(
-
client.LabTests.GetMarkersForOrderSet(request) -> *vitalgo.GetMarkersResponse +
client.LabTests.GetMarkersForOrderSet(request) -> *v505.GetMarkersResponse
@@ -12512,14 +12532,14 @@ client.LabTests.GetMarkers(
```go -request := &vitalgo.LabTestsGetMarkersForOrderSetRequest{ - Page: vitalgo.Int( +request := &v505.LabTestsGetMarkersForOrderSetRequest{ + Page: v505.Int( 1, ), - Size: vitalgo.Int( + Size: v505.Int( 1, ), - Body: &vitalgo.OrderSetRequest{}, + Body: &v505.OrderSetRequest{}, } client.LabTests.GetMarkersForOrderSet( context.TODO(), @@ -12556,7 +12576,7 @@ client.LabTests.GetMarkersForOrderSet(
-**request:** `*vitalgo.OrderSetRequest` +**request:** `*v505.OrderSetRequest`
@@ -12568,10 +12588,24 @@ client.LabTests.GetMarkersForOrderSet(
-
client.LabTests.GetMarkersForLabTest(LabTestId) -> *vitalgo.GetMarkersResponse +
client.LabTests.GetMarkersForLabTest(LabTestId) -> *v505.GetMarkersResponse
+#### 📝 Description + +
+
+ +
+
+ +List all markers for a given Lab Test, as well as any associated reflex markers. +
+
+
+
+ #### 🔌 Usage
@@ -12581,14 +12615,14 @@ client.LabTests.GetMarkersForOrderSet(
```go -request := &vitalgo.LabTestsGetMarkersForLabTestRequest{ - LabAccountId: vitalgo.String( +request := &v505.LabTestsGetMarkersForLabTestRequest{ + LabAccountId: v505.String( "lab_account_id", ), - Page: vitalgo.Int( + Page: v505.Int( 1, ), - Size: vitalgo.Int( + Size: v505.Int( 1, ), } @@ -12648,7 +12682,7 @@ client.LabTests.GetMarkersForLabTest(
-
client.LabTests.GetMarkersByLabAndProviderId(ProviderId, LabId) -> *vitalgo.ClientFacingMarker +
client.LabTests.GetMarkersByLabAndProviderId(ProviderId, LabId) -> *v505.ClientFacingMarker
@@ -12675,8 +12709,8 @@ GET a specific marker for the given lab and provider_id
```go -request := &vitalgo.LabTestsGetMarkersByLabAndProviderIdRequest{ - LabAccountId: vitalgo.String( +request := &v505.LabTestsGetMarkersByLabAndProviderIdRequest{ + LabAccountId: v505.String( "lab_account_id", ), } @@ -12729,7 +12763,7 @@ client.LabTests.GetMarkersByLabAndProviderId(
-
client.LabTests.GetLabs() -> []*vitalgo.ClientFacingLab +
client.LabTests.GetLabs() -> []*v505.ClientFacingLab
@@ -12771,7 +12805,7 @@ client.LabTests.GetLabs(
-
client.LabTests.GetPaginated() -> *vitalgo.LabTestResourcesResponse +
client.LabTests.GetPaginated() -> *v505.LabTestResourcesResponse
@@ -12798,24 +12832,24 @@ GET lab tests the team has access to as a paginated list.
```go -request := &vitalgo.LabTestsGetPaginatedRequest{ - LabTestLimit: vitalgo.Int( +request := &v505.LabTestsGetPaginatedRequest{ + LabTestLimit: v505.Int( 1, ), - NextCursor: vitalgo.String( + NextCursor: v505.String( "next_cursor", ), - GenerationMethod: vitalgo.LabTestGenerationMethodFilterAuto.Ptr(), - LabSlug: vitalgo.String( + GenerationMethod: v505.LabTestGenerationMethodFilterAuto.Ptr(), + LabSlug: v505.String( "lab_slug", ), - CollectionMethod: vitalgo.LabTestCollectionMethodTestkit.Ptr(), - Status: vitalgo.LabTestStatusActive.Ptr(), - Name: vitalgo.String( + CollectionMethod: v505.LabTestCollectionMethodTestkit.Ptr(), + Status: v505.LabTestStatusActive.Ptr(), + Name: v505.String( "name", ), - OrderKey: vitalgo.LabTestsGetPaginatedRequestOrderKeyPrice.Ptr(), - OrderDirection: vitalgo.LabTestsGetPaginatedRequestOrderDirectionAsc.Ptr(), + OrderKey: v505.LabTestsGetPaginatedRequestOrderKeyPrice.Ptr(), + OrderDirection: v505.LabTestsGetPaginatedRequestOrderDirectionAsc.Ptr(), } client.LabTests.GetPaginated( context.TODO(), @@ -12852,7 +12886,7 @@ client.LabTests.GetPaginated(
-**generationMethod:** `*vitalgo.LabTestGenerationMethodFilter` — Filter on whether auto-generated lab tests created by Vital, manually created lab tests, or all lab tests should be returned. +**generationMethod:** `*v505.LabTestGenerationMethodFilter` — Filter on whether auto-generated lab tests created by Vital, manually created lab tests, or all lab tests should be returned.
@@ -12868,7 +12902,7 @@ client.LabTests.GetPaginated(
-**collectionMethod:** `*vitalgo.LabTestCollectionMethod` — Filter by the collection method for these lab tests. +**collectionMethod:** `*v505.LabTestCollectionMethod` — Filter by the collection method for these lab tests.
@@ -12876,7 +12910,7 @@ client.LabTests.GetPaginated(
-**status:** `*vitalgo.LabTestStatus` — Filter by the status of these lab tests. +**status:** `*v505.LabTestStatus` — Filter by the status of these lab tests.
@@ -12908,7 +12942,7 @@ client.LabTests.GetPaginated(
-**orderKey:** `*vitalgo.LabTestsGetPaginatedRequestOrderKey` +**orderKey:** `*v505.LabTestsGetPaginatedRequestOrderKey`
@@ -12916,7 +12950,7 @@ client.LabTests.GetPaginated(
-**orderDirection:** `*vitalgo.LabTestsGetPaginatedRequestOrderDirection` +**orderDirection:** `*v505.LabTestsGetPaginatedRequestOrderDirection`
@@ -12972,7 +13006,7 @@ client.LabTests.GetLabTestCollectionInstructionPdf(
-
client.LabTests.GetOrders() -> *vitalgo.GetOrdersResponse +
client.LabTests.GetOrders() -> *v505.GetOrdersResponse
@@ -12999,49 +13033,52 @@ GET many orders with filters.
```go -request := &vitalgo.LabTestsGetOrdersRequest{ - SearchInput: vitalgo.String( +request := &v505.LabTestsGetOrdersRequest{ + SearchInput: v505.String( "search_input", ), - StartDate: vitalgo.Time( - vitalgo.MustParseDateTime( + StartDate: v505.Time( + v505.MustParseDateTime( "2024-01-15T09:30:00Z", ), ), - EndDate: vitalgo.Time( - vitalgo.MustParseDateTime( + EndDate: v505.Time( + v505.MustParseDateTime( "2024-01-15T09:30:00Z", ), ), - UpdatedStartDate: vitalgo.Time( - vitalgo.MustParseDateTime( + UpdatedStartDate: v505.Time( + v505.MustParseDateTime( "2024-01-15T09:30:00Z", ), ), - UpdatedEndDate: vitalgo.Time( - vitalgo.MustParseDateTime( + UpdatedEndDate: v505.Time( + v505.MustParseDateTime( "2024-01-15T09:30:00Z", ), ), - OrderKey: vitalgo.LabTestsGetOrdersRequestOrderKeyCreatedAt.Ptr(), - OrderDirection: vitalgo.LabTestsGetOrdersRequestOrderDirectionAsc.Ptr(), - IsCritical: vitalgo.Bool( + OrderKey: v505.LabTestsGetOrdersRequestOrderKeyCreatedAt.Ptr(), + OrderDirection: v505.LabTestsGetOrdersRequestOrderDirectionAsc.Ptr(), + IsCritical: v505.Bool( true, ), - Interpretation: vitalgo.InterpretationNormal.Ptr(), - UserId: vitalgo.String( + Interpretation: v505.InterpretationNormal.Ptr(), + UserId: v505.String( "user_id", ), - PatientName: vitalgo.String( + PatientName: v505.String( "patient_name", ), - ShippingRecipientName: vitalgo.String( + ShippingRecipientName: v505.String( "shipping_recipient_name", ), - Page: vitalgo.Int( + OrderTransactionId: v505.String( + "order_transaction_id", + ), + Page: v505.Int( 1, ), - Size: vitalgo.Int( + Size: v505.Int( 1, ), } @@ -13104,7 +13141,7 @@ client.LabTests.GetOrders(
-**status:** `*vitalgo.OrderLowLevelStatus` — Filter by low level status. +**status:** `*v505.OrderLowLevelStatus` — Filter by low level status.
@@ -13112,7 +13149,7 @@ client.LabTests.GetOrders(
-**orderKey:** `*vitalgo.LabTestsGetOrdersRequestOrderKey` — Order key to sort by. +**orderKey:** `*v505.LabTestsGetOrdersRequestOrderKey` — Order key to sort by.
@@ -13120,7 +13157,7 @@ client.LabTests.GetOrders(
-**orderDirection:** `*vitalgo.LabTestsGetOrdersRequestOrderDirection` — Order direction to sort by. +**orderDirection:** `*v505.LabTestsGetOrdersRequestOrderDirection` — Order direction to sort by.
@@ -13128,7 +13165,7 @@ client.LabTests.GetOrders(
-**orderType:** `*vitalgo.LabTestCollectionMethod` — Filter by method used to perform the lab test. +**orderType:** `*v505.LabTestCollectionMethod` — Filter by method used to perform the lab test.
@@ -13144,7 +13181,7 @@ client.LabTests.GetOrders(
-**interpretation:** `*vitalgo.Interpretation` — Filter by result interpretation of the lab test. +**interpretation:** `*v505.Interpretation` — Filter by result interpretation of the lab test.
@@ -13152,7 +13189,7 @@ client.LabTests.GetOrders(
-**orderActivationTypes:** `*vitalgo.OrderActivationType` — Filter by activation type. +**orderActivationTypes:** `*v505.OrderActivationType` — Filter by activation type.
@@ -13192,6 +13229,14 @@ client.LabTests.GetOrders(
+**orderTransactionId:** `*string` — Filter by order transaction ID + +
+
+ +
+
+ **page:** `*int`
@@ -13212,7 +13257,7 @@ client.LabTests.GetOrders(
-
client.LabTests.GetPhlebotomyAppointmentAvailability(request) -> *vitalgo.AppointmentAvailabilitySlots +
client.LabTests.GetPhlebotomyAppointmentAvailability(request) -> *v505.AppointmentAvailabilitySlots
@@ -13240,11 +13285,11 @@ for the given address and order.
```go -request := &vitalgo.LabTestsGetPhlebotomyAppointmentAvailabilityRequest{ - StartDate: vitalgo.String( +request := &v505.LabTestsGetPhlebotomyAppointmentAvailabilityRequest{ + StartDate: v505.String( "start_date", ), - Body: &vitalgo.UsAddress{ + Body: &v505.UsAddress{ FirstLine: "first_line", City: "city", State: "state", @@ -13278,7 +13323,7 @@ client.LabTests.GetPhlebotomyAppointmentAvailability(
-**request:** `*vitalgo.UsAddress` — At-home phlebotomy appointment address. +**request:** `*v505.UsAddress` — At-home phlebotomy appointment address.
@@ -13290,7 +13335,7 @@ client.LabTests.GetPhlebotomyAppointmentAvailability(
-
client.LabTests.BookPhlebotomyAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.BookPhlebotomyAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -13317,7 +13362,7 @@ Book an at-home phlebotomy appointment.
```go -request := &vitalgo.AppointmentBookingRequest{ +request := &v505.AppointmentBookingRequest{ BookingKey: "booking_key", } client.LabTests.BookPhlebotomyAppointment( @@ -13348,7 +13393,7 @@ client.LabTests.BookPhlebotomyAppointment(
-**request:** `*vitalgo.AppointmentBookingRequest` +**request:** `*v505.AppointmentBookingRequest`
@@ -13360,7 +13405,7 @@ client.LabTests.BookPhlebotomyAppointment(
-
client.LabTests.RequestPhlebotomyAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.RequestPhlebotomyAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -13387,14 +13432,14 @@ Request an at-home phlebotomy appointment.
```go -request := &vitalgo.RequestAppointmentRequest{ - Address: &vitalgo.UsAddress{ +request := &v505.RequestAppointmentRequest{ + Address: &v505.UsAddress{ FirstLine: "first_line", City: "city", State: "state", ZipCode: "zip_code", }, - Provider: vitalgo.AppointmentProviderGetlabs, + Provider: v505.AppointmentProviderGetlabs, } client.LabTests.RequestPhlebotomyAppointment( context.TODO(), @@ -13424,7 +13469,15 @@ client.LabTests.RequestPhlebotomyAppointment(
-**address:** `*vitalgo.UsAddress` — At-home phlebotomy appointment address. +**address:** `*v505.UsAddress` — At-home phlebotomy appointment address. + +
+
+ +
+
+ +**provider:** `*v505.AppointmentProvider`
@@ -13432,7 +13485,7 @@ client.LabTests.RequestPhlebotomyAppointment(
-**provider:** `*vitalgo.AppointmentProvider` +**appointmentNotes:** `*string`
@@ -13444,7 +13497,7 @@ client.LabTests.RequestPhlebotomyAppointment(
-
client.LabTests.ReschedulePhlebotomyAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.ReschedulePhlebotomyAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -13471,7 +13524,7 @@ Reschedule a previously booked at-home phlebotomy appointment.
```go -request := &vitalgo.AppointmentRescheduleRequest{ +request := &v505.AppointmentRescheduleRequest{ BookingKey: "booking_key", } client.LabTests.ReschedulePhlebotomyAppointment( @@ -13502,7 +13555,7 @@ client.LabTests.ReschedulePhlebotomyAppointment(
-**request:** `*vitalgo.AppointmentRescheduleRequest` +**request:** `*v505.AppointmentRescheduleRequest`
@@ -13514,7 +13567,7 @@ client.LabTests.ReschedulePhlebotomyAppointment(
-
client.LabTests.CancelPhlebotomyAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.CancelPhlebotomyAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -13541,7 +13594,7 @@ Cancel a previously booked at-home phlebotomy appointment.
```go -request := &vitalgo.ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest{ +request := &v505.ApiApiV1EndpointsVitalApiLabTestingOrdersHelpersAppointmentCancelRequest{ CancellationReasonId: "cancellation_reason_id", } client.LabTests.CancelPhlebotomyAppointment( @@ -13592,7 +13645,7 @@ client.LabTests.CancelPhlebotomyAppointment(
-
client.LabTests.GetPhlebotomyAppointmentCancellationReason() -> []*vitalgo.ClientFacingAppointmentCancellationReason +
client.LabTests.GetPhlebotomyAppointmentCancellationReason() -> []*v505.ClientFacingAppointmentCancellationReason
@@ -13634,7 +13687,7 @@ client.LabTests.GetPhlebotomyAppointmentCancellationReason(
-
client.LabTests.GetPhlebotomyAppointment(OrderId) -> *vitalgo.ClientFacingAppointment +
client.LabTests.GetPhlebotomyAppointment(OrderId) -> *v505.ClientFacingAppointment
@@ -13692,7 +13745,7 @@ client.LabTests.GetPhlebotomyAppointment(
-
client.LabTests.GetAreaInfo() -> *vitalgo.AreaInfo +
client.LabTests.GetAreaInfo() -> *v505.AreaInfo
@@ -13723,11 +13776,11 @@ Information returned:
```go -request := &vitalgo.LabTestsGetAreaInfoRequest{ +request := &v505.LabTestsGetAreaInfoRequest{ ZipCode: "zip_code", - Radius: vitalgo.AllowedRadiusTen.Ptr(), - Lab: vitalgo.ClientFacingLabsQuest.Ptr(), - LabAccountId: vitalgo.String( + Radius: v505.AllowedRadiusTen.Ptr(), + Lab: v505.ClientFacingLabsQuest.Ptr(), + LabAccountId: v505.String( "lab_account_id", ), } @@ -13758,7 +13811,7 @@ client.LabTests.GetAreaInfo(
-**radius:** `*vitalgo.AllowedRadius` — Radius in which to search in miles +**radius:** `*v505.AllowedRadius` — Radius in which to search in miles
@@ -13766,7 +13819,7 @@ client.LabTests.GetAreaInfo(
-**lab:** `*vitalgo.ClientFacingLabs` — Lab to check for PSCs +**lab:** `*v505.ClientFacingLabs` — Lab to check for PSCs
@@ -13774,7 +13827,7 @@ client.LabTests.GetAreaInfo(
-**labs:** `*vitalgo.ClientFacingLabs` — List of labs to check for PSCs +**labs:** `*v505.ClientFacingLabs` — List of labs to check for PSCs
@@ -13794,7 +13847,7 @@ client.LabTests.GetAreaInfo(
-
client.LabTests.GetPscInfo() -> *vitalgo.PscInfo +
client.LabTests.GetPscInfo() -> *v505.PscInfo
@@ -13807,11 +13860,11 @@ client.LabTests.GetAreaInfo(
```go -request := &vitalgo.LabTestsGetPscInfoRequest{ +request := &v505.LabTestsGetPscInfoRequest{ ZipCode: "zip_code", LabId: 1, - Radius: vitalgo.AllowedRadiusTen.Ptr(), - LabAccountId: vitalgo.String( + Radius: v505.AllowedRadiusTen.Ptr(), + LabAccountId: v505.String( "lab_account_id", ), } @@ -13850,7 +13903,7 @@ client.LabTests.GetPscInfo(
-**radius:** `*vitalgo.AllowedRadius` — Radius in which to search in miles. Note that we limit to 30 PSCs. +**radius:** `*v505.AllowedRadius` — Radius in which to search in miles. Note that we limit to 30 PSCs.
@@ -13858,7 +13911,7 @@ client.LabTests.GetPscInfo(
-**capabilities:** `*vitalgo.LabLocationCapability` — Filter for only locations with certain capabilities +**capabilities:** `*v505.LabLocationCapability` — Filter for only locations with certain capabilities
@@ -13878,7 +13931,7 @@ client.LabTests.GetPscInfo(
-
client.LabTests.GetOrderPscInfo(OrderId) -> *vitalgo.PscInfo +
client.LabTests.GetOrderPscInfo(OrderId) -> *v505.PscInfo
@@ -13891,8 +13944,8 @@ client.LabTests.GetPscInfo(
```go -request := &vitalgo.LabTestsGetOrderPscInfoRequest{ - Radius: vitalgo.AllowedRadiusTen.Ptr(), +request := &v505.LabTestsGetOrderPscInfoRequest{ + Radius: v505.AllowedRadiusTen.Ptr(), } client.LabTests.GetOrderPscInfo( context.TODO(), @@ -13922,7 +13975,7 @@ client.LabTests.GetOrderPscInfo(
-**radius:** `*vitalgo.AllowedRadius` — Radius in which to search in miles +**radius:** `*v505.AllowedRadius` — Radius in which to search in miles
@@ -13930,7 +13983,7 @@ client.LabTests.GetOrderPscInfo(
-**capabilities:** `*vitalgo.LabLocationCapability` — Filter for only locations with certain capabilities +**capabilities:** `*v505.LabLocationCapability` — Filter for only locations with certain capabilities
@@ -14000,7 +14053,7 @@ client.LabTests.GetResultPdf(
-
client.LabTests.GetResultMetadata(OrderId) -> *vitalgo.LabResultsMetadata +
client.LabTests.GetResultMetadata(OrderId) -> *v505.LabResultsMetadata
@@ -14059,7 +14112,7 @@ client.LabTests.GetResultMetadata(
-
client.LabTests.GetResultRaw(OrderId) -> *vitalgo.LabResultsRaw +
client.LabTests.GetResultRaw(OrderId) -> *v505.LabResultsRaw
@@ -14144,8 +14197,8 @@ This endpoint returns the printed labels for the order.
```go -request := &vitalgo.LabTestsGetLabelsPdfRequest{ - CollectionDate: vitalgo.MustParseDateTime( +request := &v505.LabTestsGetLabelsPdfRequest{ + CollectionDate: v505.MustParseDateTime( "2024-01-15T09:30:00Z", ), } @@ -14197,7 +14250,7 @@ client.LabTests.GetLabelsPdf(
-
client.LabTests.GetPscAppointmentAvailability() -> *vitalgo.AppointmentAvailabilitySlots +
client.LabTests.GetPscAppointmentAvailability() -> *v505.AppointmentAvailabilitySlots
@@ -14210,17 +14263,18 @@ client.LabTests.GetLabelsPdf(
```go -request := &vitalgo.LabTestsGetPscAppointmentAvailabilityRequest{ - Lab: vitalgo.AppointmentPscLabs( - "quest", - ), - StartDate: vitalgo.String( +request := &v505.LabTestsGetPscAppointmentAvailabilityRequest{ + Lab: v505.AppointmentPscLabsQuest, + StartDate: v505.String( "start_date", ), - ZipCode: vitalgo.String( + ZipCode: v505.String( "zip_code", ), - Radius: vitalgo.AllowedRadiusTen.Ptr(), + Radius: v505.AllowedRadiusTen.Ptr(), + AllowStale: v505.Bool( + true, + ), } client.LabTests.GetPscAppointmentAvailability( context.TODO(), @@ -14241,7 +14295,7 @@ client.LabTests.GetPscAppointmentAvailability(
-**lab:** `vitalgo.AppointmentPscLabs` — Lab to check for availability +**lab:** `*v505.AppointmentPscLabs` — Lab to check for availability
@@ -14273,7 +14327,15 @@ client.LabTests.GetPscAppointmentAvailability(
-**radius:** `*vitalgo.AllowedRadius` — Radius in which to search. (meters) +**radius:** `*v505.AllowedRadius` — Radius in which to search. (meters) + +
+
+ +
+
+ +**allowStale:** `*bool` — If true, allows cached availability data to be returned.
@@ -14285,7 +14347,7 @@ client.LabTests.GetPscAppointmentAvailability(
-
client.LabTests.BookPscAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.BookPscAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -14298,8 +14360,10 @@ client.LabTests.GetPscAppointmentAvailability(
```go -request := &vitalgo.AppointmentBookingRequest{ - BookingKey: "booking_key", +request := &v505.LabTestsBookPscAppointmentRequest{ + Body: &v505.AppointmentBookingRequest{ + BookingKey: "booking_key", + }, } client.LabTests.BookPscAppointment( context.TODO(), @@ -14329,7 +14393,23 @@ client.LabTests.BookPscAppointment(
-**request:** `*vitalgo.AppointmentBookingRequest` +**idempotencyKey:** `*string` — [!] This feature (Idempotency Key) is under closed beta. Idempotency Key support for booking PSC appointment. + +
+
+ +
+
+ +**idempotencyError:** `*string` — If `no-cache`, applies idempotency only to successful outcomes. + +
+
+ +
+
+ +**request:** `*v505.AppointmentBookingRequest`
@@ -14341,7 +14421,7 @@ client.LabTests.BookPscAppointment(
-
client.LabTests.ReschedulePscAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.ReschedulePscAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -14354,7 +14434,7 @@ client.LabTests.BookPscAppointment(
```go -request := &vitalgo.AppointmentRescheduleRequest{ +request := &v505.AppointmentRescheduleRequest{ BookingKey: "booking_key", } client.LabTests.ReschedulePscAppointment( @@ -14385,7 +14465,7 @@ client.LabTests.ReschedulePscAppointment(
-**request:** `*vitalgo.AppointmentRescheduleRequest` +**request:** `*v505.AppointmentRescheduleRequest`
@@ -14397,7 +14477,7 @@ client.LabTests.ReschedulePscAppointment(
-
client.LabTests.CancelPscAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.CancelPscAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -14410,7 +14490,7 @@ client.LabTests.ReschedulePscAppointment(
```go -request := &vitalgo.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest{ +request := &v505.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest{ CancellationReasonId: "cancellationReasonId", } client.LabTests.CancelPscAppointment( @@ -14461,7 +14541,7 @@ client.LabTests.CancelPscAppointment(
-
client.LabTests.GetPscAppointmentCancellationReason() -> []*vitalgo.ClientFacingAppointmentCancellationReason +
client.LabTests.GetPscAppointmentCancellationReason() -> []*v505.ClientFacingAppointmentCancellationReason
@@ -14489,7 +14569,7 @@ client.LabTests.GetPscAppointmentCancellationReason(
-
client.LabTests.GetPscAppointment(OrderId) -> *vitalgo.ClientFacingAppointment +
client.LabTests.GetPscAppointment(OrderId) -> *v505.ClientFacingAppointment
@@ -14721,7 +14801,7 @@ client.LabTests.GetOrderAbnPdf(
-
client.LabTests.GetOrder(OrderId) -> *vitalgo.ClientFacingOrder +
client.LabTests.GetOrder(OrderId) -> *v505.ClientFacingOrder
@@ -14779,7 +14859,7 @@ client.LabTests.GetOrder(
-
client.LabTests.CreateOrder(request) -> *vitalgo.PostOrderResponse +
client.LabTests.CreateOrder(request) -> *v505.PostOrderResponse
@@ -14792,20 +14872,17 @@ client.LabTests.GetOrder(
```go -request := &vitalgo.CreateOrderRequestCompatible{ - IdempotencyKey: vitalgo.String( - "X-Idempotency-Key", - ), +request := &v505.CreateOrderRequestCompatible{ UserId: "user_id", - PatientDetails: &vitalgo.PatientDetailsWithValidation{ + PatientDetails: &v505.PatientDetailsWithValidation{ FirstName: "first_name", LastName: "last_name", Dob: "dob", - Gender: vitalgo.GenderFemale, + Gender: v505.GenderFemale, PhoneNumber: "phone_number", Email: "email", }, - PatientAddress: &vitalgo.PatientAddressWithValidation{ + PatientAddress: &v505.PatientAddressWithValidation{ FirstLine: "first_line", City: "city", State: "state", @@ -14864,7 +14941,7 @@ client.LabTests.CreateOrder(
-**orderSet:** `*vitalgo.OrderSetRequest` +**orderSet:** `*v505.OrderSetRequest`
@@ -14872,7 +14949,7 @@ client.LabTests.CreateOrder(
-**collectionMethod:** `*vitalgo.LabTestCollectionMethod` +**collectionMethod:** `*v505.LabTestCollectionMethod`
@@ -14880,7 +14957,7 @@ client.LabTests.CreateOrder(
-**physician:** `*vitalgo.PhysicianCreateRequest` +**physician:** `*v505.PhysicianCreateRequest`
@@ -14888,7 +14965,7 @@ client.LabTests.CreateOrder(
-**healthInsurance:** `*vitalgo.HealthInsuranceCreateRequest` +**healthInsurance:** `*v505.HealthInsuranceCreateRequest`
@@ -14904,7 +14981,7 @@ client.LabTests.CreateOrder(
-**billingType:** `*vitalgo.Billing` +**billingType:** `*v505.Billing`
@@ -14920,7 +14997,7 @@ client.LabTests.CreateOrder(
-**consents:** `[]*vitalgo.Consent` +**consents:** `[]*v505.Consent`
@@ -14936,7 +15013,7 @@ client.LabTests.CreateOrder(
-**aoeAnswers:** `[]*vitalgo.AoEAnswer` +**aoeAnswers:** `[]*v505.AoEAnswer`
@@ -14952,6 +15029,14 @@ client.LabTests.CreateOrder(
+**clinicalNotes:** `*string` + +
+
+ +
+
+ **labAccountId:** `*string`
@@ -14968,7 +15053,7 @@ client.LabTests.CreateOrder(
-**patientDetails:** `*vitalgo.PatientDetailsWithValidation` +**patientDetails:** `*v505.PatientDetailsWithValidation`
@@ -14976,7 +15061,7 @@ client.LabTests.CreateOrder(
-**patientAddress:** `*vitalgo.PatientAddressWithValidation` +**patientAddress:** `*v505.PatientAddressWithValidation`
@@ -14988,7 +15073,7 @@ client.LabTests.CreateOrder(
-
client.LabTests.ImportOrder(request) -> *vitalgo.PostOrderResponse +
client.LabTests.ImportOrder(request) -> *v505.PostOrderResponse
@@ -15001,20 +15086,20 @@ client.LabTests.CreateOrder(
```go -request := &vitalgo.ImportOrderBody{ +request := &v505.ImportOrderBody{ UserId: "user_id", - BillingType: vitalgo.BillingClientBill, - OrderSet: &vitalgo.OrderSetRequest{}, - CollectionMethod: vitalgo.LabTestCollectionMethodTestkit, - PatientDetails: &vitalgo.PatientDetailsWithValidation{ + BillingType: v505.BillingClientBill, + OrderSet: &v505.OrderSetRequest{}, + CollectionMethod: v505.LabTestCollectionMethodTestkit, + PatientDetails: &v505.PatientDetailsWithValidation{ FirstName: "first_name", LastName: "last_name", Dob: "dob", - Gender: vitalgo.GenderFemale, + Gender: v505.GenderFemale, PhoneNumber: "phone_number", Email: "email", }, - PatientAddress: &vitalgo.PatientAddress{ + PatientAddress: &v505.PatientAddress{ ReceiverName: "receiver_name", FirstLine: "first_line", City: "city", @@ -15051,7 +15136,7 @@ client.LabTests.ImportOrder(
-**billingType:** `*vitalgo.Billing` +**billingType:** `*v505.Billing`
@@ -15059,7 +15144,7 @@ client.LabTests.ImportOrder(
-**orderSet:** `*vitalgo.OrderSetRequest` +**orderSet:** `*v505.OrderSetRequest`
@@ -15067,7 +15152,7 @@ client.LabTests.ImportOrder(
-**collectionMethod:** `*vitalgo.LabTestCollectionMethod` +**collectionMethod:** `*v505.LabTestCollectionMethod`
@@ -15075,7 +15160,7 @@ client.LabTests.ImportOrder(
-**physician:** `*vitalgo.PhysicianCreateRequest` +**physician:** `*v505.PhysicianCreateRequest`
@@ -15083,7 +15168,7 @@ client.LabTests.ImportOrder(
-**patientDetails:** `*vitalgo.PatientDetailsWithValidation` +**patientDetails:** `*v505.PatientDetailsWithValidation`
@@ -15091,7 +15176,7 @@ client.LabTests.ImportOrder(
-**patientAddress:** `*vitalgo.PatientAddress` +**patientAddress:** `*v505.PatientAddress`
@@ -15119,7 +15204,7 @@ client.LabTests.ImportOrder(
-
client.LabTests.CancelOrder(OrderId) -> *vitalgo.PostOrderResponse +
client.LabTests.CancelOrder(OrderId) -> *v505.PostOrderResponse
@@ -15204,12 +15289,12 @@ Get available test kits.
```go -request := &vitalgo.LabTestsSimulateOrderProcessRequest{ - FinalStatus: vitalgo.OrderStatusReceivedWalkInTestOrdered.Ptr(), - Delay: vitalgo.Int( +request := &v505.LabTestsSimulateOrderProcessRequest{ + FinalStatus: v505.OrderStatusReceivedWalkInTestOrdered.Ptr(), + Delay: v505.Int( 1, ), - Body: &vitalgo.SimulationFlags{}, + Body: &v505.SimulationFlags{}, } client.LabTests.SimulateOrderProcess( context.TODO(), @@ -15239,7 +15324,7 @@ client.LabTests.SimulateOrderProcess(
-**finalStatus:** `*vitalgo.OrderStatus` +**finalStatus:** `*v505.OrderStatus`
@@ -15255,7 +15340,7 @@ client.LabTests.SimulateOrderProcess(
-**request:** `*vitalgo.SimulationFlags` +**request:** `*v505.SimulationFlags`
@@ -15267,7 +15352,7 @@ client.LabTests.SimulateOrderProcess(
-
client.LabTests.UpdateOnSiteCollectionOrderDrawCompleted(OrderId) -> *vitalgo.PostOrderResponse +
client.LabTests.UpdateOnSiteCollectionOrderDrawCompleted(OrderId) -> *v505.PostOrderResponse
@@ -15325,7 +15410,7 @@ client.LabTests.UpdateOnSiteCollectionOrderDrawCompleted(
-
client.LabTests.ValidateIcdCodes(request) -> *vitalgo.ValidateIcdCodesResponse +
client.LabTests.ValidateIcdCodes(request) -> *v505.ValidateIcdCodesResponse
@@ -15338,7 +15423,7 @@ client.LabTests.UpdateOnSiteCollectionOrderDrawCompleted(
```go -request := &vitalgo.ValidateIcdCodesBody{ +request := &v505.ValidateIcdCodesBody{ Codes: []string{ "codes", }, @@ -15370,12 +15455,389 @@ client.LabTests.ValidateIcdCodes(
+ + +
+ +## Compendium +
client.Compendium.Search(request) -> *v505.SearchCompendiumResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &v505.SearchCompendiumBody{ + TeamId: v505.CompendiumSearchRequestTeamIdInferFromContext.Ptr(), + Mode: v505.SearchModeCanonical, + } +client.Compendium.Search( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**teamId:** `*v505.CompendiumSearchRequestTeamId` + +
+
+ +
+
+ +**mode:** `*v505.SearchMode` + +
+
+ +
+
+ +**query:** `*string` + +
+
+ +
+
+ +**cptCodes:** `[]string` + +
+
+ +
+
+ +**loincSetHash:** `*string` + +
+
+ +
+
+ +**labs:** `[]*v505.CompendiumSearchLabs` + +
+
+ +
+
+ +**includeRelated:** `*bool` + +
+
+ +
+
+ +**limit:** `*int` + +
+
+
+
+ + +
+
+
+ +
client.Compendium.Convert(request) -> *v505.ConvertCompendiumResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &v505.ConvertCompendiumBody{ + TeamId: v505.CompendiumConvertRequestTeamIdInferFromContext.Ptr(), + TargetLab: v505.CompendiumSearchLabsLabcorp, + } +client.Compendium.Convert( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**teamId:** `*v505.CompendiumConvertRequestTeamId` + +
+
+ +
+
+ +**labTestId:** `*string` + +
+
+ +
+
+ +**providerIds:** `[]string` + +
+
+ +
+
+ +**targetLab:** `*v505.CompendiumSearchLabs` + +
+
+ +
+
+ +**limit:** `*int` + +
+
+
+
+ + +
+
+
+ +## LabAccount +
client.LabAccount.GetTeamLabAccounts() -> *v505.GetTeamLabAccountsResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +request := &v505.LabAccountGetTeamLabAccountsRequest{ + LabAccountId: v505.String( + "lab_account_id", + ), + Status: v505.LabAccountStatusActive.Ptr(), + } +client.LabAccount.GetTeamLabAccounts( + context.TODO(), + request, + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**labAccountId:** `*string` + +
+
+ +
+
+ +**status:** `*v505.LabAccountStatus` + +
+
+
+
+ + +
+
+
+ +## OrderTransaction +
client.OrderTransaction.GetTransaction(TransactionId) -> *v505.GetOrderTransactionResponse +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.OrderTransaction.GetTransaction( + context.TODO(), + "transaction_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**transactionId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.OrderTransaction.GetTransactionResult(TransactionId) -> *v505.LabResultsRaw +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.OrderTransaction.GetTransactionResult( + context.TODO(), + "transaction_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**transactionId:** `string` + +
+
+
+
+ + +
+
+
+ +
client.OrderTransaction.GetTransactionResultPdf(TransactionId) -> string +
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```go +client.OrderTransaction.GetTransactionResultPdf( + context.TODO(), + "transaction_id", + ) +} +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**transactionId:** `string` + +
+
+
+
+ +
## Testkit -
client.Testkit.Register(request) -> *vitalgo.PostOrderResponse +
client.Testkit.Register(request) -> *v505.PostOrderResponse
@@ -15388,17 +15850,17 @@ client.LabTests.ValidateIcdCodes(
```go -request := &vitalgo.RegisterTestkitRequest{ +request := &v505.RegisterTestkitRequest{ SampleId: "sample_id", - PatientDetails: &vitalgo.PatientDetailsWithValidation{ + PatientDetails: &v505.PatientDetailsWithValidation{ FirstName: "first_name", LastName: "last_name", Dob: "dob", - Gender: vitalgo.GenderFemale, + Gender: v505.GenderFemale, PhoneNumber: "phone_number", Email: "email", }, - PatientAddress: &vitalgo.PatientAddressWithValidation{ + PatientAddress: &v505.PatientAddressWithValidation{ FirstLine: "first_line", City: "city", State: "state", @@ -15441,7 +15903,7 @@ client.Testkit.Register(
-**patientDetails:** `*vitalgo.PatientDetailsWithValidation` +**patientDetails:** `*v505.PatientDetailsWithValidation`
@@ -15449,7 +15911,7 @@ client.Testkit.Register(
-**patientAddress:** `*vitalgo.PatientAddressWithValidation` +**patientAddress:** `*v505.PatientAddressWithValidation`
@@ -15457,7 +15919,7 @@ client.Testkit.Register(
-**physician:** `*vitalgo.PhysicianCreateRequestBase` +**physician:** `*v505.PhysicianCreateRequestBase`
@@ -15465,7 +15927,7 @@ client.Testkit.Register(
-**healthInsurance:** `*vitalgo.HealthInsuranceCreateRequest` +**healthInsurance:** `*v505.HealthInsuranceCreateRequest`
@@ -15473,7 +15935,7 @@ client.Testkit.Register(
-**consents:** `[]*vitalgo.Consent` +**consents:** `[]*v505.Consent`
@@ -15485,7 +15947,7 @@ client.Testkit.Register(
-
client.Testkit.CreateOrder(request) -> *vitalgo.PostOrderResponse +
client.Testkit.CreateOrder(request) -> *v505.PostOrderResponse
@@ -15512,10 +15974,10 @@ Creates an order for an unregistered testkit
```go -request := &vitalgo.CreateRegistrableTestkitOrderRequest{ +request := &v505.CreateRegistrableTestkitOrderRequest{ UserId: "user_id", LabTestId: "lab_test_id", - ShippingDetails: &vitalgo.ShippingAddressWithValidation{ + ShippingDetails: &v505.ShippingAddressWithValidation{ ReceiverName: "receiver_name", FirstLine: "first_line", City: "city", @@ -15560,7 +16022,7 @@ client.Testkit.CreateOrder(
-**shippingDetails:** `*vitalgo.ShippingAddressWithValidation` +**shippingDetails:** `*v505.ShippingAddressWithValidation`
@@ -15589,7 +16051,7 @@ client.Testkit.CreateOrder(
## Order -
client.Order.ResendEvents(request) -> *vitalgo.ResendWebhookResponse +
client.Order.ResendEvents(request) -> *v505.ResendWebhookResponse
@@ -15616,7 +16078,7 @@ Replay a webhook for a given set of orders
```go -request := &vitalgo.ResendWebhookBody{} +request := &v505.ResendWebhookBody{} client.Order.ResendEvents( context.TODO(), request, @@ -15665,7 +16127,7 @@ client.Order.ResendEvents(
## Insurance -
client.Insurance.SearchGetPayorInfo() -> []*vitalgo.ClientFacingPayorSearchResponse +
client.Insurance.SearchGetPayorInfo() -> []*v505.ClientFacingPayorSearchResponse
@@ -15678,12 +16140,12 @@ client.Order.ResendEvents(
```go -request := &vitalgo.InsuranceSearchGetPayorInfoRequest{ - InsuranceName: vitalgo.String( +request := &v505.InsuranceSearchGetPayorInfoRequest{ + InsuranceName: v505.String( "insurance_name", ), - Provider: vitalgo.PayorCodeExternalProviderChangeHealthcare.Ptr(), - ProviderPayorId: vitalgo.String( + Provider: v505.PayorCodeExternalProviderChangeHealthcare.Ptr(), + ProviderPayorId: v505.String( "provider_payor_id", ), } @@ -15714,7 +16176,7 @@ client.Insurance.SearchGetPayorInfo(
-**provider:** `*vitalgo.PayorCodeExternalProvider` +**provider:** `*v505.PayorCodeExternalProvider`
@@ -15734,7 +16196,7 @@ client.Insurance.SearchGetPayorInfo(
-
client.Insurance.SearchPayorInfo(request) -> []*vitalgo.ClientFacingPayorSearchResponseDeprecated +
client.Insurance.SearchPayorInfo(request) -> []*v505.ClientFacingPayorSearchResponseDeprecated
@@ -15747,7 +16209,7 @@ client.Insurance.SearchGetPayorInfo(
```go -request := &vitalgo.PayorSearchRequest{} +request := &v505.PayorSearchRequest{} client.Insurance.SearchPayorInfo( context.TODO(), request, @@ -15775,7 +16237,7 @@ client.Insurance.SearchPayorInfo(
-**provider:** `*vitalgo.PayorCodeExternalProvider` +**provider:** `*v505.PayorCodeExternalProvider`
@@ -15795,7 +16257,7 @@ client.Insurance.SearchPayorInfo(
-
client.Insurance.SearchDiagnosis() -> []*vitalgo.ClientFacingDiagnosisInformation +
client.Insurance.SearchDiagnosis() -> []*v505.ClientFacingDiagnosisInformation
@@ -15808,7 +16270,7 @@ client.Insurance.SearchPayorInfo(
```go -request := &vitalgo.InsuranceSearchDiagnosisRequest{ +request := &v505.InsuranceSearchDiagnosisRequest{ DiagnosisQuery: "diagnosis_query", } client.Insurance.SearchDiagnosis( @@ -15843,7 +16305,7 @@ client.Insurance.SearchDiagnosis(
## Payor -
client.Payor.CreatePayor(request) -> *vitalgo.ClientFacingPayor +
client.Payor.CreatePayor(request) -> *v505.ClientFacingPayor
@@ -15856,9 +16318,9 @@ client.Insurance.SearchDiagnosis(
```go -request := &vitalgo.CreatePayorBody{ +request := &v505.CreatePayorBody{ Name: "name", - Address: &vitalgo.Address{ + Address: &v505.Address{ FirstLine: "first_line", Country: "country", Zip: "zip", @@ -15893,7 +16355,7 @@ client.Payor.CreatePayor(
-**address:** `*vitalgo.Address` +**address:** `*v505.Address`
@@ -15901,7 +16363,7 @@ client.Payor.CreatePayor(
-**provider:** `*vitalgo.PayorCodeExternalProvider` +**provider:** `*v505.PayorCodeExternalProvider`
@@ -15922,7 +16384,7 @@ client.Payor.CreatePayor(
## LabReport -
client.LabReport.ParserCreateJob(request) -> *vitalgo.ParsingJob +
client.LabReport.ParserCreateJob(request) -> *v505.ParsingJob
@@ -15934,7 +16396,7 @@ client.Payor.CreatePayor(
-Creates a parse job, uploads the file to provider, persists the job row, +Creates a parse job, uploads the file(s) to provider, persists the job row, and starts the ParseLabReport. Returns a generated job_id.
@@ -15950,7 +16412,7 @@ and starts the ParseLabReport. Returns a generated job_id.
```go -request := &vitalgo.BodyCreateLabReportParserJob{ +request := &v505.BodyCreateLabReportParserJob{ UserId: "user_id", } client.LabReport.ParserCreateJob( @@ -15969,7 +16431,7 @@ client.LabReport.ParserCreateJob(
-
client.LabReport.ParserGetJob(JobId) -> *vitalgo.ParsingJob +
client.LabReport.ParserGetJob(JobId) -> *v505.ParsingJob
@@ -16031,7 +16493,7 @@ client.LabReport.ParserGetJob(
## Aggregate -
client.Aggregate.QueryOne(UserId, request) -> *vitalgo.AggregationResponse +
client.Aggregate.QueryOne(UserId, request) -> *v505.AggregationResponse
@@ -16044,26 +16506,26 @@ client.LabReport.ParserGetJob(
```go -request := &vitalgo.QueryBatch{ - Timeframe: &vitalgo.QueryBatchTimeframe{ - RelativeTimeframe: &vitalgo.RelativeTimeframe{ +request := &v505.QueryBatch{ + Timeframe: &v505.QueryBatchTimeframe{ + RelativeTimeframe: &v505.RelativeTimeframe{ Anchor: "anchor", - Past: &vitalgo.Period{ - Unit: vitalgo.PeriodUnitMinute, + Past: &v505.Period{ + Unit: v505.PeriodUnitMinute, }, }, }, - Queries: []*vitalgo.Query{ - &vitalgo.Query{ - Select: []*vitalgo.QuerySelectItem{ - &vitalgo.QuerySelectItem{ - AggregateExpr: &vitalgo.AggregateExpr{ - Arg: &vitalgo.AggregateExprArg{ - SleepColumnExpr: &vitalgo.SleepColumnExpr{ - Sleep: vitalgo.SleepColumnExprSleepId, + Queries: []*v505.Query{ + &v505.Query{ + Select: []*v505.QuerySelectItem{ + &v505.QuerySelectItem{ + AggregateExpr: &v505.AggregateExpr{ + Arg: &v505.AggregateExprArg{ + SleepColumnExpr: &v505.SleepColumnExpr{ + Sleep: v505.SleepColumnExprSleepId, }, }, - Func: vitalgo.AggregateExprFuncMean, + Func: v505.AggregateExprFuncMean, }, }, }, @@ -16106,7 +16568,7 @@ client.Aggregate.QueryOne(
-**timeframe:** `*vitalgo.QueryBatchTimeframe` +**timeframe:** `*v505.QueryBatchTimeframe`
@@ -16114,7 +16576,7 @@ client.Aggregate.QueryOne(
-**queries:** `[]*vitalgo.Query` +**queries:** `[]*v505.Query`
@@ -16122,7 +16584,7 @@ client.Aggregate.QueryOne(
-**config:** `*vitalgo.QueryConfig` +**config:** `*v505.QueryConfig`
@@ -16134,7 +16596,7 @@ client.Aggregate.QueryOne(
-
client.Aggregate.GetResultTableForContinuousQuery(UserId, QueryIdOrSlug) -> *vitalgo.AggregationResult +
client.Aggregate.GetResultTableForContinuousQuery(UserId, QueryIdOrSlug) -> *v505.AggregationResult
@@ -16195,7 +16657,7 @@ client.Aggregate.GetResultTableForContinuousQuery(
-
client.Aggregate.GetTaskHistoryForContinuousQuery(UserId, QueryIdOrSlug) -> *vitalgo.ContinuousQueryTaskHistoryResponse +
client.Aggregate.GetTaskHistoryForContinuousQuery(UserId, QueryIdOrSlug) -> *v505.ContinuousQueryTaskHistoryResponse
@@ -16208,11 +16670,11 @@ client.Aggregate.GetResultTableForContinuousQuery(
```go -request := &vitalgo.AggregateGetTaskHistoryForContinuousQueryRequest{ - NextCursor: vitalgo.String( +request := &v505.AggregateGetTaskHistoryForContinuousQueryRequest{ + NextCursor: v505.String( "next_cursor", ), - Limit: vitalgo.Int( + Limit: v505.Int( 1, ), } diff --git a/sleep.go b/sleep.go index de987bd..2270504 100644 --- a/sleep.go +++ b/sleep.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) diff --git a/sleep/client.go b/sleep/client.go index 60fbd29..9884b3a 100644 --- a/sleep/client.go +++ b/sleep/client.go @@ -4,10 +4,10 @@ package sleep import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -36,9 +36,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) Get( ctx context.Context, userId string, - request *vitalgo.SleepGetRequest, + request *v505.SleepGetRequest, opts ...option.RequestOption, -) (*vitalgo.ClientSleepResponse, error) { +) (*v505.ClientSleepResponse, error) { response, err := c.WithRawResponse.Get( ctx, userId, @@ -55,9 +55,9 @@ func (c *Client) Get( func (c *Client) GetRaw( ctx context.Context, userId string, - request *vitalgo.SleepGetRawRequest, + request *v505.SleepGetRawRequest, opts ...option.RequestOption, -) (*vitalgo.RawSleep, error) { +) (*v505.RawSleep, error) { response, err := c.WithRawResponse.GetRaw( ctx, userId, @@ -76,7 +76,7 @@ func (c *Client) GetStreamBySleepId( // The Vital Sleep ID sleepId string, opts ...option.RequestOption, -) (*vitalgo.ClientFacingSleepStream, error) { +) (*v505.ClientFacingSleepStream, error) { response, err := c.WithRawResponse.GetStreamBySleepId( ctx, sleepId, diff --git a/sleep/raw_client.go b/sleep/raw_client.go index ff3b3bf..db6a13e 100644 --- a/sleep/raw_client.go +++ b/sleep/raw_client.go @@ -4,10 +4,10 @@ package sleep import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -33,9 +33,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) Get( ctx context.Context, userId string, - request *vitalgo.SleepGetRequest, + request *v505.SleepGetRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientSleepResponse], error) { +) (*core.Response[*v505.ClientSleepResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -57,7 +57,7 @@ func (r *RawClient) Get( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientSleepResponse + var response *v505.ClientSleepResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -69,13 +69,13 @@ func (r *RawClient) Get( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientSleepResponse]{ + return &core.Response[*v505.ClientSleepResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -85,9 +85,9 @@ func (r *RawClient) Get( func (r *RawClient) GetRaw( ctx context.Context, userId string, - request *vitalgo.SleepGetRawRequest, + request *v505.SleepGetRawRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.RawSleep], error) { +) (*core.Response[*v505.RawSleep], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -109,7 +109,7 @@ func (r *RawClient) GetRaw( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.RawSleep + var response *v505.RawSleep raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -121,13 +121,13 @@ func (r *RawClient) GetRaw( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.RawSleep]{ + return &core.Response[*v505.RawSleep]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -139,7 +139,7 @@ func (r *RawClient) GetStreamBySleepId( // The Vital Sleep ID sleepId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingSleepStream], error) { +) (*core.Response[*v505.ClientFacingSleepStream], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -154,7 +154,7 @@ func (r *RawClient) GetStreamBySleepId( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingSleepStream + var response *v505.ClientFacingSleepStream raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -166,13 +166,13 @@ func (r *RawClient) GetStreamBySleepId( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingSleepStream]{ + return &core.Response[*v505.ClientFacingSleepStream]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/sleep_cycle.go b/sleep_cycle.go index 717b346..ff0a8c0 100644 --- a/sleep_cycle.go +++ b/sleep_cycle.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) diff --git a/sleepcycle/client.go b/sleepcycle/client.go index 8899d76..5617dc3 100644 --- a/sleepcycle/client.go +++ b/sleepcycle/client.go @@ -4,10 +4,10 @@ package sleepcycle import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -36,9 +36,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) Get( ctx context.Context, userId string, - request *vitalgo.SleepCycleGetRequest, + request *v505.SleepCycleGetRequest, opts ...option.RequestOption, -) (*vitalgo.ClientSleepCycleResponse, error) { +) (*v505.ClientSleepCycleResponse, error) { response, err := c.WithRawResponse.Get( ctx, userId, diff --git a/sleepcycle/raw_client.go b/sleepcycle/raw_client.go index d583a67..1940472 100644 --- a/sleepcycle/raw_client.go +++ b/sleepcycle/raw_client.go @@ -4,10 +4,10 @@ package sleepcycle import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -33,9 +33,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) Get( ctx context.Context, userId string, - request *vitalgo.SleepCycleGetRequest, + request *v505.SleepCycleGetRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientSleepCycleResponse], error) { +) (*core.Response[*v505.ClientSleepCycleResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -57,7 +57,7 @@ func (r *RawClient) Get( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientSleepCycleResponse + var response *v505.ClientSleepCycleResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -69,13 +69,13 @@ func (r *RawClient) Get( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientSleepCycleResponse]{ + return &core.Response[*v505.ClientSleepCycleResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/team.go b/team.go index 8f70f0f..d0e4993 100644 --- a/team.go +++ b/team.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) diff --git a/team/client.go b/team/client.go index 558e9e8..a6ecd64 100644 --- a/team/client.go +++ b/team/client.go @@ -4,10 +4,10 @@ package team import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -35,7 +35,7 @@ func NewClient(options *core.RequestOptions) *Client { // Post teams. func (c *Client) GetLinkConfig( ctx context.Context, - request *vitalgo.TeamGetLinkConfigRequest, + request *v505.TeamGetLinkConfigRequest, opts ...option.RequestOption, ) (map[string]any, error) { response, err := c.WithRawResponse.GetLinkConfig( @@ -54,7 +54,7 @@ func (c *Client) Get( ctx context.Context, teamId string, opts ...option.RequestOption, -) (*vitalgo.ClientFacingTeam, error) { +) (*v505.ClientFacingTeam, error) { response, err := c.WithRawResponse.Get( ctx, teamId, @@ -69,9 +69,9 @@ func (c *Client) Get( // Search team users by user_id func (c *Client) GetUserById( ctx context.Context, - request *vitalgo.TeamGetUserByIdRequest, + request *v505.TeamGetUserByIdRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingUser, error) { +) ([]*v505.ClientFacingUser, error) { response, err := c.WithRawResponse.GetUserById( ctx, request, @@ -100,7 +100,7 @@ func (c *Client) GetSvixUrl( // GET source priorities. func (c *Client) GetSourcePriorities( ctx context.Context, - request *vitalgo.TeamGetSourcePrioritiesRequest, + request *v505.TeamGetSourcePrioritiesRequest, opts ...option.RequestOption, ) ([]map[string]any, error) { response, err := c.WithRawResponse.GetSourcePriorities( @@ -133,7 +133,7 @@ func (c *Client) GetPhysicians( ctx context.Context, teamId string, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingPhysician, error) { +) ([]*v505.ClientFacingPhysician, error) { response, err := c.WithRawResponse.GetPhysicians( ctx, teamId, diff --git a/team/raw_client.go b/team/raw_client.go index babe524..694f7a2 100644 --- a/team/raw_client.go +++ b/team/raw_client.go @@ -4,10 +4,10 @@ package team import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -32,7 +32,7 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) GetLinkConfig( ctx context.Context, - request *vitalgo.TeamGetLinkConfigRequest, + request *v505.TeamGetLinkConfigRequest, opts ...option.RequestOption, ) (*core.Response[map[string]any], error) { options := core.NewRequestOptions(opts...) @@ -62,7 +62,7 @@ func (r *RawClient) GetLinkConfig( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -79,7 +79,7 @@ func (r *RawClient) Get( ctx context.Context, teamId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingTeam], error) { +) (*core.Response[*v505.ClientFacingTeam], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -94,7 +94,7 @@ func (r *RawClient) Get( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingTeam + var response *v505.ClientFacingTeam raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -106,13 +106,13 @@ func (r *RawClient) Get( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingTeam]{ + return &core.Response[*v505.ClientFacingTeam]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -121,9 +121,9 @@ func (r *RawClient) Get( func (r *RawClient) GetUserById( ctx context.Context, - request *vitalgo.TeamGetUserByIdRequest, + request *v505.TeamGetUserByIdRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingUser], error) { +) (*core.Response[[]*v505.ClientFacingUser], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -142,7 +142,7 @@ func (r *RawClient) GetUserById( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingUser + var response []*v505.ClientFacingUser raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -154,13 +154,13 @@ func (r *RawClient) GetUserById( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingUser]{ + return &core.Response[[]*v505.ClientFacingUser]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -208,7 +208,7 @@ func (r *RawClient) GetSvixUrl( func (r *RawClient) GetSourcePriorities( ctx context.Context, - request *vitalgo.TeamGetSourcePrioritiesRequest, + request *v505.TeamGetSourcePrioritiesRequest, opts ...option.RequestOption, ) (*core.Response[[]map[string]any], error) { options := core.NewRequestOptions(opts...) @@ -241,7 +241,7 @@ func (r *RawClient) GetSourcePriorities( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -297,7 +297,7 @@ func (r *RawClient) GetPhysicians( ctx context.Context, teamId string, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingPhysician], error) { +) (*core.Response[[]*v505.ClientFacingPhysician], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -312,7 +312,7 @@ func (r *RawClient) GetPhysicians( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingPhysician + var response []*v505.ClientFacingPhysician raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -324,13 +324,13 @@ func (r *RawClient) GetPhysicians( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingPhysician]{ + return &core.Response[[]*v505.ClientFacingPhysician]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/testkit.go b/testkit.go index cb1066f..17e5504 100644 --- a/testkit.go +++ b/testkit.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" ) @@ -20,7 +20,7 @@ var ( type CreateRegistrableTestkitOrderRequest struct { UserId string `json:"user_id" url:"-"` LabTestId string `json:"lab_test_id" url:"-"` - ShippingDetails *ShippingAddressWithValidation `json:"shipping_details,omitempty" url:"-"` + ShippingDetails *ShippingAddressWithValidation `json:"shipping_details" url:"-"` Passthrough *string `json:"passthrough,omitempty" url:"-"` LabAccountId *string `json:"lab_account_id,omitempty" url:"-"` @@ -70,6 +70,27 @@ func (c *CreateRegistrableTestkitOrderRequest) SetLabAccountId(labAccountId *str c.require(createRegistrableTestkitOrderRequestFieldLabAccountId) } +func (c *CreateRegistrableTestkitOrderRequest) UnmarshalJSON(data []byte) error { + type unmarshaler CreateRegistrableTestkitOrderRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *c = CreateRegistrableTestkitOrderRequest(body) + return nil +} + +func (c *CreateRegistrableTestkitOrderRequest) MarshalJSON() ([]byte, error) { + type embed CreateRegistrableTestkitOrderRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( registerTestkitRequestFieldUserId = big.NewInt(1 << 0) registerTestkitRequestFieldSampleId = big.NewInt(1 << 1) @@ -84,8 +105,8 @@ type RegisterTestkitRequest struct { // The user ID of the patient. UserId *string `json:"user_id,omitempty" url:"-"` SampleId string `json:"sample_id" url:"-"` - PatientDetails *PatientDetailsWithValidation `json:"patient_details,omitempty" url:"-"` - PatientAddress *PatientAddressWithValidation `json:"patient_address,omitempty" url:"-"` + PatientDetails *PatientDetailsWithValidation `json:"patient_details" url:"-"` + PatientAddress *PatientAddressWithValidation `json:"patient_address" url:"-"` Physician *PhysicianCreateRequestBase `json:"physician,omitempty" url:"-"` HealthInsurance *HealthInsuranceCreateRequest `json:"health_insurance,omitempty" url:"-"` Consents []*Consent `json:"consents,omitempty" url:"-"` @@ -150,6 +171,27 @@ func (r *RegisterTestkitRequest) SetConsents(consents []*Consent) { r.require(registerTestkitRequestFieldConsents) } +func (r *RegisterTestkitRequest) UnmarshalJSON(data []byte) error { + type unmarshaler RegisterTestkitRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *r = RegisterTestkitRequest(body) + return nil +} + +func (r *RegisterTestkitRequest) MarshalJSON() ([]byte, error) { + type embed RegisterTestkitRequest + var marshaler = struct { + embed + }{ + embed: embed(*r), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, r.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( physicianCreateRequestBaseFieldFirstName = big.NewInt(1 << 0) physicianCreateRequestBaseFieldLastName = big.NewInt(1 << 1) diff --git a/testkit/client.go b/testkit/client.go index 153971e..307a628 100644 --- a/testkit/client.go +++ b/testkit/client.go @@ -4,10 +4,10 @@ package testkit import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -34,9 +34,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) Register( ctx context.Context, - request *vitalgo.RegisterTestkitRequest, + request *v505.RegisterTestkitRequest, opts ...option.RequestOption, -) (*vitalgo.PostOrderResponse, error) { +) (*v505.PostOrderResponse, error) { response, err := c.WithRawResponse.Register( ctx, request, @@ -51,9 +51,9 @@ func (c *Client) Register( // Creates an order for an unregistered testkit func (c *Client) CreateOrder( ctx context.Context, - request *vitalgo.CreateRegistrableTestkitOrderRequest, + request *v505.CreateRegistrableTestkitOrderRequest, opts ...option.RequestOption, -) (*vitalgo.PostOrderResponse, error) { +) (*v505.PostOrderResponse, error) { response, err := c.WithRawResponse.CreateOrder( ctx, request, diff --git a/testkit/raw_client.go b/testkit/raw_client.go index be0cfc0..991e569 100644 --- a/testkit/raw_client.go +++ b/testkit/raw_client.go @@ -4,10 +4,10 @@ package testkit import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -32,9 +32,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) Register( ctx context.Context, - request *vitalgo.RegisterTestkitRequest, + request *v505.RegisterTestkitRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.PostOrderResponse], error) { +) (*core.Response[*v505.PostOrderResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -47,7 +47,7 @@ func (r *RawClient) Register( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.PostOrderResponse + var response *v505.PostOrderResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -60,13 +60,13 @@ func (r *RawClient) Register( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.PostOrderResponse]{ + return &core.Response[*v505.PostOrderResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -75,9 +75,9 @@ func (r *RawClient) Register( func (r *RawClient) CreateOrder( ctx context.Context, - request *vitalgo.CreateRegistrableTestkitOrderRequest, + request *v505.CreateRegistrableTestkitOrderRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.PostOrderResponse], error) { +) (*core.Response[*v505.PostOrderResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -90,7 +90,7 @@ func (r *RawClient) CreateOrder( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.PostOrderResponse + var response *v505.PostOrderResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -103,13 +103,13 @@ func (r *RawClient) CreateOrder( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.PostOrderResponse]{ + return &core.Response[*v505.PostOrderResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/types.go b/types.go index e6f9c36..0b725cf 100644 --- a/types.go +++ b/types.go @@ -5,27 +5,29 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) var ( - addressFieldFirstLine = big.NewInt(1 << 0) - addressFieldSecondLine = big.NewInt(1 << 1) - addressFieldCountry = big.NewInt(1 << 2) - addressFieldZip = big.NewInt(1 << 3) - addressFieldCity = big.NewInt(1 << 4) - addressFieldState = big.NewInt(1 << 5) + addressFieldFirstLine = big.NewInt(1 << 0) + addressFieldSecondLine = big.NewInt(1 << 1) + addressFieldCountry = big.NewInt(1 << 2) + addressFieldZip = big.NewInt(1 << 3) + addressFieldCity = big.NewInt(1 << 4) + addressFieldState = big.NewInt(1 << 5) + addressFieldAccessNotes = big.NewInt(1 << 6) ) type Address struct { - FirstLine string `json:"first_line" url:"first_line"` - SecondLine *string `json:"second_line,omitempty" url:"second_line,omitempty"` - Country string `json:"country" url:"country"` - Zip string `json:"zip" url:"zip"` - City string `json:"city" url:"city"` - State string `json:"state" url:"state"` + FirstLine string `json:"first_line" url:"first_line"` + SecondLine *string `json:"second_line,omitempty" url:"second_line,omitempty"` + Country string `json:"country" url:"country"` + Zip string `json:"zip" url:"zip"` + City string `json:"city" url:"city"` + State string `json:"state" url:"state"` + AccessNotes *string `json:"access_notes,omitempty" url:"access_notes,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -76,6 +78,13 @@ func (a *Address) GetState() string { return a.State } +func (a *Address) GetAccessNotes() *string { + if a == nil { + return nil + } + return a.AccessNotes +} + func (a *Address) GetExtraProperties() map[string]interface{} { return a.extraProperties } @@ -129,6 +138,13 @@ func (a *Address) SetState(state string) { a.require(addressFieldState) } +// SetAccessNotes sets the AccessNotes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *Address) SetAccessNotes(accessNotes *string) { + a.AccessNotes = accessNotes + a.require(addressFieldAccessNotes) +} + func (a *Address) UnmarshalJSON(data []byte) error { type unmarshaler Address var value unmarshaler @@ -385,6 +401,381 @@ func (b Billing) Ptr() *Billing { return &b } +// Represent the schema for an individual biomarker result. +var ( + biomarkerResultFieldName = big.NewInt(1 << 0) + biomarkerResultFieldSlug = big.NewInt(1 << 1) + biomarkerResultFieldResult = big.NewInt(1 << 2) + biomarkerResultFieldType = big.NewInt(1 << 3) + biomarkerResultFieldUnit = big.NewInt(1 << 4) + biomarkerResultFieldTimestamp = big.NewInt(1 << 5) + biomarkerResultFieldNotes = big.NewInt(1 << 6) + biomarkerResultFieldReferenceRange = big.NewInt(1 << 7) + biomarkerResultFieldMinRangeValue = big.NewInt(1 << 8) + biomarkerResultFieldMaxRangeValue = big.NewInt(1 << 9) + biomarkerResultFieldIsAboveMaxRange = big.NewInt(1 << 10) + biomarkerResultFieldIsBelowMinRange = big.NewInt(1 << 11) + biomarkerResultFieldInterpretation = big.NewInt(1 << 12) + biomarkerResultFieldLoinc = big.NewInt(1 << 13) + biomarkerResultFieldLoincSlug = big.NewInt(1 << 14) + biomarkerResultFieldProviderId = big.NewInt(1 << 15) + biomarkerResultFieldSourceMarkers = big.NewInt(1 << 16) + biomarkerResultFieldPerformingLaboratory = big.NewInt(1 << 17) + biomarkerResultFieldSourceSampleId = big.NewInt(1 << 18) +) + +type BiomarkerResult struct { + Name string `json:"name" url:"name"` + Slug *string `json:"slug,omitempty" url:"slug,omitempty"` + Result string `json:"result" url:"result"` + Type ResultType `json:"type" url:"type"` + Unit *string `json:"unit,omitempty" url:"unit,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty" url:"timestamp,omitempty"` + Notes *string `json:"notes,omitempty" url:"notes,omitempty"` + ReferenceRange *string `json:"reference_range,omitempty" url:"reference_range,omitempty"` + MinRangeValue *float64 `json:"min_range_value,omitempty" url:"min_range_value,omitempty"` + MaxRangeValue *float64 `json:"max_range_value,omitempty" url:"max_range_value,omitempty"` + IsAboveMaxRange *bool `json:"is_above_max_range,omitempty" url:"is_above_max_range,omitempty"` + IsBelowMinRange *bool `json:"is_below_min_range,omitempty" url:"is_below_min_range,omitempty"` + Interpretation *string `json:"interpretation,omitempty" url:"interpretation,omitempty"` + Loinc *string `json:"loinc,omitempty" url:"loinc,omitempty"` + LoincSlug *string `json:"loinc_slug,omitempty" url:"loinc_slug,omitempty"` + ProviderId *string `json:"provider_id,omitempty" url:"provider_id,omitempty"` + SourceMarkers []*ParentBiomarkerData `json:"source_markers,omitempty" url:"source_markers,omitempty"` + PerformingLaboratory *string `json:"performing_laboratory,omitempty" url:"performing_laboratory,omitempty"` + SourceSampleId *string `json:"source_sample_id,omitempty" url:"source_sample_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (b *BiomarkerResult) GetName() string { + if b == nil { + return "" + } + return b.Name +} + +func (b *BiomarkerResult) GetSlug() *string { + if b == nil { + return nil + } + return b.Slug +} + +func (b *BiomarkerResult) GetResult() string { + if b == nil { + return "" + } + return b.Result +} + +func (b *BiomarkerResult) GetType() ResultType { + if b == nil { + return "" + } + return b.Type +} + +func (b *BiomarkerResult) GetUnit() *string { + if b == nil { + return nil + } + return b.Unit +} + +func (b *BiomarkerResult) GetTimestamp() *time.Time { + if b == nil { + return nil + } + return b.Timestamp +} + +func (b *BiomarkerResult) GetNotes() *string { + if b == nil { + return nil + } + return b.Notes +} + +func (b *BiomarkerResult) GetReferenceRange() *string { + if b == nil { + return nil + } + return b.ReferenceRange +} + +func (b *BiomarkerResult) GetMinRangeValue() *float64 { + if b == nil { + return nil + } + return b.MinRangeValue +} + +func (b *BiomarkerResult) GetMaxRangeValue() *float64 { + if b == nil { + return nil + } + return b.MaxRangeValue +} + +func (b *BiomarkerResult) GetIsAboveMaxRange() *bool { + if b == nil { + return nil + } + return b.IsAboveMaxRange +} + +func (b *BiomarkerResult) GetIsBelowMinRange() *bool { + if b == nil { + return nil + } + return b.IsBelowMinRange +} + +func (b *BiomarkerResult) GetInterpretation() *string { + if b == nil { + return nil + } + return b.Interpretation +} + +func (b *BiomarkerResult) GetLoinc() *string { + if b == nil { + return nil + } + return b.Loinc +} + +func (b *BiomarkerResult) GetLoincSlug() *string { + if b == nil { + return nil + } + return b.LoincSlug +} + +func (b *BiomarkerResult) GetProviderId() *string { + if b == nil { + return nil + } + return b.ProviderId +} + +func (b *BiomarkerResult) GetSourceMarkers() []*ParentBiomarkerData { + if b == nil { + return nil + } + return b.SourceMarkers +} + +func (b *BiomarkerResult) GetPerformingLaboratory() *string { + if b == nil { + return nil + } + return b.PerformingLaboratory +} + +func (b *BiomarkerResult) GetSourceSampleId() *string { + if b == nil { + return nil + } + return b.SourceSampleId +} + +func (b *BiomarkerResult) GetExtraProperties() map[string]interface{} { + return b.extraProperties +} + +func (b *BiomarkerResult) require(field *big.Int) { + if b.explicitFields == nil { + b.explicitFields = big.NewInt(0) + } + b.explicitFields.Or(b.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetName(name string) { + b.Name = name + b.require(biomarkerResultFieldName) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetSlug(slug *string) { + b.Slug = slug + b.require(biomarkerResultFieldSlug) +} + +// SetResult sets the Result field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetResult(result string) { + b.Result = result + b.require(biomarkerResultFieldResult) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetType(type_ ResultType) { + b.Type = type_ + b.require(biomarkerResultFieldType) +} + +// SetUnit sets the Unit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetUnit(unit *string) { + b.Unit = unit + b.require(biomarkerResultFieldUnit) +} + +// SetTimestamp sets the Timestamp field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetTimestamp(timestamp *time.Time) { + b.Timestamp = timestamp + b.require(biomarkerResultFieldTimestamp) +} + +// SetNotes sets the Notes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetNotes(notes *string) { + b.Notes = notes + b.require(biomarkerResultFieldNotes) +} + +// SetReferenceRange sets the ReferenceRange field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetReferenceRange(referenceRange *string) { + b.ReferenceRange = referenceRange + b.require(biomarkerResultFieldReferenceRange) +} + +// SetMinRangeValue sets the MinRangeValue field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetMinRangeValue(minRangeValue *float64) { + b.MinRangeValue = minRangeValue + b.require(biomarkerResultFieldMinRangeValue) +} + +// SetMaxRangeValue sets the MaxRangeValue field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetMaxRangeValue(maxRangeValue *float64) { + b.MaxRangeValue = maxRangeValue + b.require(biomarkerResultFieldMaxRangeValue) +} + +// SetIsAboveMaxRange sets the IsAboveMaxRange field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetIsAboveMaxRange(isAboveMaxRange *bool) { + b.IsAboveMaxRange = isAboveMaxRange + b.require(biomarkerResultFieldIsAboveMaxRange) +} + +// SetIsBelowMinRange sets the IsBelowMinRange field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetIsBelowMinRange(isBelowMinRange *bool) { + b.IsBelowMinRange = isBelowMinRange + b.require(biomarkerResultFieldIsBelowMinRange) +} + +// SetInterpretation sets the Interpretation field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetInterpretation(interpretation *string) { + b.Interpretation = interpretation + b.require(biomarkerResultFieldInterpretation) +} + +// SetLoinc sets the Loinc field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetLoinc(loinc *string) { + b.Loinc = loinc + b.require(biomarkerResultFieldLoinc) +} + +// SetLoincSlug sets the LoincSlug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetLoincSlug(loincSlug *string) { + b.LoincSlug = loincSlug + b.require(biomarkerResultFieldLoincSlug) +} + +// SetProviderId sets the ProviderId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetProviderId(providerId *string) { + b.ProviderId = providerId + b.require(biomarkerResultFieldProviderId) +} + +// SetSourceMarkers sets the SourceMarkers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetSourceMarkers(sourceMarkers []*ParentBiomarkerData) { + b.SourceMarkers = sourceMarkers + b.require(biomarkerResultFieldSourceMarkers) +} + +// SetPerformingLaboratory sets the PerformingLaboratory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetPerformingLaboratory(performingLaboratory *string) { + b.PerformingLaboratory = performingLaboratory + b.require(biomarkerResultFieldPerformingLaboratory) +} + +// SetSourceSampleId sets the SourceSampleId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (b *BiomarkerResult) SetSourceSampleId(sourceSampleId *string) { + b.SourceSampleId = sourceSampleId + b.require(biomarkerResultFieldSourceSampleId) +} + +func (b *BiomarkerResult) UnmarshalJSON(data []byte) error { + type embed BiomarkerResult + var unmarshaler = struct { + embed + Timestamp *internal.DateTime `json:"timestamp,omitempty"` + }{ + embed: embed(*b), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *b = BiomarkerResult(unmarshaler.embed) + b.Timestamp = unmarshaler.Timestamp.TimePtr() + extraProperties, err := internal.ExtractExtraProperties(data, *b) + if err != nil { + return err + } + b.extraProperties = extraProperties + b.rawJSON = json.RawMessage(data) + return nil +} + +func (b *BiomarkerResult) MarshalJSON() ([]byte, error) { + type embed BiomarkerResult + var marshaler = struct { + embed + Timestamp *internal.DateTime `json:"timestamp,omitempty"` + }{ + embed: embed(*b), + Timestamp: internal.NewOptionalDateTime(b.Timestamp), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, b.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (b *BiomarkerResult) String() string { + if len(b.rawJSON) > 0 { + if value, err := internal.StringifyJSON(b.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(b); err == nil { + return value + } + return fmt.Sprintf("%#v", b) +} + var ( clientFacingActivityChangedFieldEventType = big.NewInt(1 << 0) clientFacingActivityChangedFieldUserId = big.NewInt(1 << 1) @@ -12273,299 +12664,114 @@ func (c *ClientFacingLab) String() string { } var ( - clientFacingLabTestFieldId = big.NewInt(1 << 0) - clientFacingLabTestFieldSlug = big.NewInt(1 << 1) - clientFacingLabTestFieldName = big.NewInt(1 << 2) - clientFacingLabTestFieldSampleType = big.NewInt(1 << 3) - clientFacingLabTestFieldMethod = big.NewInt(1 << 4) - clientFacingLabTestFieldPrice = big.NewInt(1 << 5) - clientFacingLabTestFieldIsActive = big.NewInt(1 << 6) - clientFacingLabTestFieldStatus = big.NewInt(1 << 7) - clientFacingLabTestFieldFasting = big.NewInt(1 << 8) - clientFacingLabTestFieldLab = big.NewInt(1 << 9) - clientFacingLabTestFieldMarkers = big.NewInt(1 << 10) - clientFacingLabTestFieldIsDelegated = big.NewInt(1 << 11) - clientFacingLabTestFieldAutoGenerated = big.NewInt(1 << 12) - clientFacingLabTestFieldHasCollectionInstructions = big.NewInt(1 << 13) - clientFacingLabTestFieldCommonTatDays = big.NewInt(1 << 14) - clientFacingLabTestFieldWorstCaseTatDays = big.NewInt(1 << 15) + clientFacingLabReportParsingJobCreatedEventFieldUserId = big.NewInt(1 << 0) + clientFacingLabReportParsingJobCreatedEventFieldClientUserId = big.NewInt(1 << 1) + clientFacingLabReportParsingJobCreatedEventFieldTeamId = big.NewInt(1 << 2) + clientFacingLabReportParsingJobCreatedEventFieldData = big.NewInt(1 << 3) ) -type ClientFacingLabTest struct { - Id string `json:"id" url:"id"` - Slug string `json:"slug" url:"slug"` - Name string `json:"name" url:"name"` - SampleType LabTestSampleType `json:"sample_type" url:"sample_type"` - Method LabTestCollectionMethod `json:"method" url:"method"` - Price float64 `json:"price" url:"price"` - // Deprecated. Use status instead. - IsActive bool `json:"is_active" url:"is_active"` - Status LabTestStatus `json:"status" url:"status"` - // Defines whether a lab test requires fasting. - Fasting *bool `json:"fasting,omitempty" url:"fasting,omitempty"` - Lab *ClientFacingLab `json:"lab,omitempty" url:"lab,omitempty"` - Markers []*ClientFacingMarker `json:"markers,omitempty" url:"markers,omitempty"` - // Deprecated and always false. Delegation is now at the lab account level. Used to denote whether a lab test requires using non-Vital physician networks. - IsDelegated *bool `json:"is_delegated,omitempty" url:"is_delegated,omitempty"` - // Whether the lab test was auto-generated by Vital - AutoGenerated *bool `json:"auto_generated,omitempty" url:"auto_generated,omitempty"` - // Whether or not the lab test has collection instructions. - HasCollectionInstructions *bool `json:"has_collection_instructions,omitempty" url:"has_collection_instructions,omitempty"` - // The common turnaround time in days for the lab test. This is the expected time for the lab to process the test and return results. - CommonTatDays *int `json:"common_tat_days,omitempty" url:"common_tat_days,omitempty"` - // The worst-case turnaround time in days for the lab test. This is the maximum time the lab may take to process the test and return results. - WorstCaseTatDays *int `json:"worst_case_tat_days,omitempty" url:"worst_case_tat_days,omitempty"` +type ClientFacingLabReportParsingJobCreatedEvent struct { + UserId string `json:"user_id" url:"user_id"` + ClientUserId string `json:"client_user_id" url:"client_user_id"` + TeamId string `json:"team_id" url:"team_id"` + Data *ParsingJob `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` + eventType string extraProperties map[string]interface{} rawJSON json.RawMessage } -func (c *ClientFacingLabTest) GetId() string { +func (c *ClientFacingLabReportParsingJobCreatedEvent) GetUserId() string { if c == nil { return "" } - return c.Id + return c.UserId } -func (c *ClientFacingLabTest) GetSlug() string { +func (c *ClientFacingLabReportParsingJobCreatedEvent) GetClientUserId() string { if c == nil { return "" } - return c.Slug + return c.ClientUserId } -func (c *ClientFacingLabTest) GetName() string { +func (c *ClientFacingLabReportParsingJobCreatedEvent) GetTeamId() string { if c == nil { return "" } - return c.Name + return c.TeamId } -func (c *ClientFacingLabTest) GetSampleType() LabTestSampleType { +func (c *ClientFacingLabReportParsingJobCreatedEvent) GetData() *ParsingJob { if c == nil { - return "" + return nil } - return c.SampleType + return c.Data } -func (c *ClientFacingLabTest) GetMethod() LabTestCollectionMethod { - if c == nil { - return "" - } - return c.Method +func (c *ClientFacingLabReportParsingJobCreatedEvent) EventType() string { + return c.eventType } -func (c *ClientFacingLabTest) GetPrice() float64 { - if c == nil { - return 0 - } - return c.Price -} - -func (c *ClientFacingLabTest) GetIsActive() bool { - if c == nil { - return false - } - return c.IsActive -} - -func (c *ClientFacingLabTest) GetStatus() LabTestStatus { - if c == nil { - return "" - } - return c.Status -} - -func (c *ClientFacingLabTest) GetFasting() *bool { - if c == nil { - return nil - } - return c.Fasting -} - -func (c *ClientFacingLabTest) GetLab() *ClientFacingLab { - if c == nil { - return nil - } - return c.Lab -} - -func (c *ClientFacingLabTest) GetMarkers() []*ClientFacingMarker { - if c == nil { - return nil - } - return c.Markers -} - -func (c *ClientFacingLabTest) GetIsDelegated() *bool { - if c == nil { - return nil - } - return c.IsDelegated -} - -func (c *ClientFacingLabTest) GetAutoGenerated() *bool { - if c == nil { - return nil - } - return c.AutoGenerated -} - -func (c *ClientFacingLabTest) GetHasCollectionInstructions() *bool { - if c == nil { - return nil - } - return c.HasCollectionInstructions -} - -func (c *ClientFacingLabTest) GetCommonTatDays() *int { - if c == nil { - return nil - } - return c.CommonTatDays -} - -func (c *ClientFacingLabTest) GetWorstCaseTatDays() *int { - if c == nil { - return nil - } - return c.WorstCaseTatDays -} - -func (c *ClientFacingLabTest) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingLabReportParsingJobCreatedEvent) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingLabTest) require(field *big.Int) { +func (c *ClientFacingLabReportParsingJobCreatedEvent) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } c.explicitFields.Or(c.explicitFields, field) } -// SetId sets the Id field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetId(id string) { - c.Id = id - c.require(clientFacingLabTestFieldId) -} - -// SetSlug sets the Slug field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetSlug(slug string) { - c.Slug = slug - c.require(clientFacingLabTestFieldSlug) -} - -// SetName sets the Name field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetName(name string) { - c.Name = name - c.require(clientFacingLabTestFieldName) -} - -// SetSampleType sets the SampleType field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetSampleType(sampleType LabTestSampleType) { - c.SampleType = sampleType - c.require(clientFacingLabTestFieldSampleType) -} - -// SetMethod sets the Method field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetMethod(method LabTestCollectionMethod) { - c.Method = method - c.require(clientFacingLabTestFieldMethod) -} - -// SetPrice sets the Price field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetPrice(price float64) { - c.Price = price - c.require(clientFacingLabTestFieldPrice) -} - -// SetIsActive sets the IsActive field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetIsActive(isActive bool) { - c.IsActive = isActive - c.require(clientFacingLabTestFieldIsActive) -} - -// SetStatus sets the Status field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetStatus(status LabTestStatus) { - c.Status = status - c.require(clientFacingLabTestFieldStatus) -} - -// SetFasting sets the Fasting field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetFasting(fasting *bool) { - c.Fasting = fasting - c.require(clientFacingLabTestFieldFasting) -} - -// SetLab sets the Lab field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetLab(lab *ClientFacingLab) { - c.Lab = lab - c.require(clientFacingLabTestFieldLab) -} - -// SetMarkers sets the Markers field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetMarkers(markers []*ClientFacingMarker) { - c.Markers = markers - c.require(clientFacingLabTestFieldMarkers) -} - -// SetIsDelegated sets the IsDelegated field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetIsDelegated(isDelegated *bool) { - c.IsDelegated = isDelegated - c.require(clientFacingLabTestFieldIsDelegated) -} - -// SetAutoGenerated sets the AutoGenerated field and marks it as non-optional; +// SetUserId sets the UserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetAutoGenerated(autoGenerated *bool) { - c.AutoGenerated = autoGenerated - c.require(clientFacingLabTestFieldAutoGenerated) +func (c *ClientFacingLabReportParsingJobCreatedEvent) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingLabReportParsingJobCreatedEventFieldUserId) } -// SetHasCollectionInstructions sets the HasCollectionInstructions field and marks it as non-optional; +// SetClientUserId sets the ClientUserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetHasCollectionInstructions(hasCollectionInstructions *bool) { - c.HasCollectionInstructions = hasCollectionInstructions - c.require(clientFacingLabTestFieldHasCollectionInstructions) +func (c *ClientFacingLabReportParsingJobCreatedEvent) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingLabReportParsingJobCreatedEventFieldClientUserId) } -// SetCommonTatDays sets the CommonTatDays field and marks it as non-optional; +// SetTeamId sets the TeamId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetCommonTatDays(commonTatDays *int) { - c.CommonTatDays = commonTatDays - c.require(clientFacingLabTestFieldCommonTatDays) +func (c *ClientFacingLabReportParsingJobCreatedEvent) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingLabReportParsingJobCreatedEventFieldTeamId) } -// SetWorstCaseTatDays sets the WorstCaseTatDays field and marks it as non-optional; +// SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLabTest) SetWorstCaseTatDays(worstCaseTatDays *int) { - c.WorstCaseTatDays = worstCaseTatDays - c.require(clientFacingLabTestFieldWorstCaseTatDays) +func (c *ClientFacingLabReportParsingJobCreatedEvent) SetData(data *ParsingJob) { + c.Data = data + c.require(clientFacingLabReportParsingJobCreatedEventFieldData) } -func (c *ClientFacingLabTest) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingLabTest - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (c *ClientFacingLabReportParsingJobCreatedEvent) UnmarshalJSON(data []byte) error { + type embed ClientFacingLabReportParsingJobCreatedEvent + var unmarshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingLabTest(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) + *c = ClientFacingLabReportParsingJobCreatedEvent(unmarshaler.embed) + if unmarshaler.EventType != "lab_report.parsing_job.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "lab_report.parsing_job.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") if err != nil { return err } @@ -12574,18 +12780,20 @@ func (c *ClientFacingLabTest) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingLabTest) MarshalJSON() ([]byte, error) { - type embed ClientFacingLabTest +func (c *ClientFacingLabReportParsingJobCreatedEvent) MarshalJSON() ([]byte, error) { + type embed ClientFacingLabReportParsingJobCreatedEvent var marshaler = struct { embed + EventType string `json:"event_type"` }{ - embed: embed(*c), + embed: embed(*c), + EventType: "lab_report.parsing_job.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingLabTest) String() string { +func (c *ClientFacingLabReportParsingJobCreatedEvent) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -12598,117 +12806,115 @@ func (c *ClientFacingLabTest) String() string { } var ( - clientFacingLeanBodyMassChangedFieldEventType = big.NewInt(1 << 0) - clientFacingLeanBodyMassChangedFieldUserId = big.NewInt(1 << 1) - clientFacingLeanBodyMassChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingLeanBodyMassChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingLeanBodyMassChangedFieldData = big.NewInt(1 << 4) + clientFacingLabReportParsingJobUpdatedEventFieldUserId = big.NewInt(1 << 0) + clientFacingLabReportParsingJobUpdatedEventFieldClientUserId = big.NewInt(1 << 1) + clientFacingLabReportParsingJobUpdatedEventFieldTeamId = big.NewInt(1 << 2) + clientFacingLabReportParsingJobUpdatedEventFieldData = big.NewInt(1 << 3) ) -type ClientFacingLeanBodyMassChanged struct { - EventType ClientFacingLeanBodyMassChangedEventType `json:"event_type" url:"event_type"` - UserId string `json:"user_id" url:"user_id"` - ClientUserId string `json:"client_user_id" url:"client_user_id"` - TeamId string `json:"team_id" url:"team_id"` - Data *GroupedLeanBodyMass `json:"data" url:"data"` +type ClientFacingLabReportParsingJobUpdatedEvent struct { + UserId string `json:"user_id" url:"user_id"` + ClientUserId string `json:"client_user_id" url:"client_user_id"` + TeamId string `json:"team_id" url:"team_id"` + Data *ParsingJob `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` + eventType string extraProperties map[string]interface{} rawJSON json.RawMessage } -func (c *ClientFacingLeanBodyMassChanged) GetEventType() ClientFacingLeanBodyMassChangedEventType { - if c == nil { - return "" - } - return c.EventType -} - -func (c *ClientFacingLeanBodyMassChanged) GetUserId() string { +func (c *ClientFacingLabReportParsingJobUpdatedEvent) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingLeanBodyMassChanged) GetClientUserId() string { +func (c *ClientFacingLabReportParsingJobUpdatedEvent) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingLeanBodyMassChanged) GetTeamId() string { +func (c *ClientFacingLabReportParsingJobUpdatedEvent) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingLeanBodyMassChanged) GetData() *GroupedLeanBodyMass { +func (c *ClientFacingLabReportParsingJobUpdatedEvent) GetData() *ParsingJob { if c == nil { return nil } return c.Data } -func (c *ClientFacingLeanBodyMassChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingLabReportParsingJobUpdatedEvent) EventType() string { + return c.eventType +} + +func (c *ClientFacingLabReportParsingJobUpdatedEvent) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingLeanBodyMassChanged) require(field *big.Int) { +func (c *ClientFacingLabReportParsingJobUpdatedEvent) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } c.explicitFields.Or(c.explicitFields, field) } -// SetEventType sets the EventType field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLeanBodyMassChanged) SetEventType(eventType ClientFacingLeanBodyMassChangedEventType) { - c.EventType = eventType - c.require(clientFacingLeanBodyMassChangedFieldEventType) -} - // SetUserId sets the UserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLeanBodyMassChanged) SetUserId(userId string) { +func (c *ClientFacingLabReportParsingJobUpdatedEvent) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingLeanBodyMassChangedFieldUserId) + c.require(clientFacingLabReportParsingJobUpdatedEventFieldUserId) } // SetClientUserId sets the ClientUserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLeanBodyMassChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingLabReportParsingJobUpdatedEvent) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingLeanBodyMassChangedFieldClientUserId) + c.require(clientFacingLabReportParsingJobUpdatedEventFieldClientUserId) } // SetTeamId sets the TeamId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLeanBodyMassChanged) SetTeamId(teamId string) { +func (c *ClientFacingLabReportParsingJobUpdatedEvent) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingLeanBodyMassChangedFieldTeamId) + c.require(clientFacingLabReportParsingJobUpdatedEventFieldTeamId) } // SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLeanBodyMassChanged) SetData(data *GroupedLeanBodyMass) { +func (c *ClientFacingLabReportParsingJobUpdatedEvent) SetData(data *ParsingJob) { c.Data = data - c.require(clientFacingLeanBodyMassChangedFieldData) + c.require(clientFacingLabReportParsingJobUpdatedEventFieldData) } -func (c *ClientFacingLeanBodyMassChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingLeanBodyMassChanged - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = ClientFacingLeanBodyMassChanged(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) - if err != nil { +func (c *ClientFacingLabReportParsingJobUpdatedEvent) UnmarshalJSON(data []byte) error { + type embed ClientFacingLabReportParsingJobUpdatedEvent + var unmarshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *c = ClientFacingLabReportParsingJobUpdatedEvent(unmarshaler.embed) + if unmarshaler.EventType != "lab_report.parsing_job.updated" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "lab_report.parsing_job.updated", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + if err != nil { return err } c.extraProperties = extraProperties @@ -12716,18 +12922,20 @@ func (c *ClientFacingLeanBodyMassChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingLeanBodyMassChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingLeanBodyMassChanged +func (c *ClientFacingLabReportParsingJobUpdatedEvent) MarshalJSON() ([]byte, error) { + type embed ClientFacingLabReportParsingJobUpdatedEvent var marshaler = struct { embed + EventType string `json:"event_type"` }{ - embed: embed(*c), + embed: embed(*c), + EventType: "lab_report.parsing_job.updated", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingLeanBodyMassChanged) String() string { +func (c *ClientFacingLabReportParsingJobUpdatedEvent) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -12739,313 +12947,174 @@ func (c *ClientFacingLeanBodyMassChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingLeanBodyMassChangedEventType string - -const ( - ClientFacingLeanBodyMassChangedEventTypeDailyDataLeanBodyMassCreated ClientFacingLeanBodyMassChangedEventType = "daily.data.lean_body_mass.created" - ClientFacingLeanBodyMassChangedEventTypeDailyDataLeanBodyMassUpdated ClientFacingLeanBodyMassChangedEventType = "daily.data.lean_body_mass.updated" -) - -func NewClientFacingLeanBodyMassChangedEventTypeFromString(s string) (ClientFacingLeanBodyMassChangedEventType, error) { - switch s { - case "daily.data.lean_body_mass.created": - return ClientFacingLeanBodyMassChangedEventTypeDailyDataLeanBodyMassCreated, nil - case "daily.data.lean_body_mass.updated": - return ClientFacingLeanBodyMassChangedEventTypeDailyDataLeanBodyMassUpdated, nil - } - var t ClientFacingLeanBodyMassChangedEventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ClientFacingLeanBodyMassChangedEventType) Ptr() *ClientFacingLeanBodyMassChangedEventType { - return &c -} - var ( - clientFacingLeanBodyMassHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingLeanBodyMassHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingLeanBodyMassHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingLeanBodyMassHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingLabTestFieldId = big.NewInt(1 << 0) + clientFacingLabTestFieldSlug = big.NewInt(1 << 1) + clientFacingLabTestFieldName = big.NewInt(1 << 2) + clientFacingLabTestFieldSampleType = big.NewInt(1 << 3) + clientFacingLabTestFieldMethod = big.NewInt(1 << 4) + clientFacingLabTestFieldPrice = big.NewInt(1 << 5) + clientFacingLabTestFieldIsActive = big.NewInt(1 << 6) + clientFacingLabTestFieldStatus = big.NewInt(1 << 7) + clientFacingLabTestFieldFasting = big.NewInt(1 << 8) + clientFacingLabTestFieldLab = big.NewInt(1 << 9) + clientFacingLabTestFieldMarkers = big.NewInt(1 << 10) + clientFacingLabTestFieldIsDelegated = big.NewInt(1 << 11) + clientFacingLabTestFieldAutoGenerated = big.NewInt(1 << 12) + clientFacingLabTestFieldHasCollectionInstructions = big.NewInt(1 << 13) + clientFacingLabTestFieldCommonTatDays = big.NewInt(1 << 14) + clientFacingLabTestFieldWorstCaseTatDays = big.NewInt(1 << 15) ) -type ClientFacingLeanBodyMassHistoricalPullCompleted struct { - UserId string `json:"user_id" url:"user_id"` - ClientUserId string `json:"client_user_id" url:"client_user_id"` - TeamId string `json:"team_id" url:"team_id"` - Data *HistoricalPullCompleted `json:"data" url:"data"` +type ClientFacingLabTest struct { + Id string `json:"id" url:"id"` + Slug string `json:"slug" url:"slug"` + Name string `json:"name" url:"name"` + SampleType LabTestSampleType `json:"sample_type" url:"sample_type"` + Method LabTestCollectionMethod `json:"method" url:"method"` + Price float64 `json:"price" url:"price"` + // Deprecated. Use status instead. + IsActive bool `json:"is_active" url:"is_active"` + Status LabTestStatus `json:"status" url:"status"` + // Defines whether a lab test requires fasting. + Fasting *bool `json:"fasting,omitempty" url:"fasting,omitempty"` + Lab *ClientFacingLab `json:"lab,omitempty" url:"lab,omitempty"` + Markers []*ClientFacingMarker `json:"markers,omitempty" url:"markers,omitempty"` + // Deprecated and always false. Delegation is now at the lab account level. Used to denote whether a lab test requires using non-Vital physician networks. + IsDelegated *bool `json:"is_delegated,omitempty" url:"is_delegated,omitempty"` + // Whether the lab test was auto-generated by Vital + AutoGenerated *bool `json:"auto_generated,omitempty" url:"auto_generated,omitempty"` + // Whether or not the lab test has collection instructions. + HasCollectionInstructions *bool `json:"has_collection_instructions,omitempty" url:"has_collection_instructions,omitempty"` + // The common turnaround time in days for the lab test. This is the expected time for the lab to process the test and return results. + CommonTatDays *int `json:"common_tat_days,omitempty" url:"common_tat_days,omitempty"` + // The worst-case turnaround time in days for the lab test. This is the maximum time the lab may take to process the test and return results. + WorstCaseTatDays *int `json:"worst_case_tat_days,omitempty" url:"worst_case_tat_days,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` - eventType string extraProperties map[string]interface{} rawJSON json.RawMessage } -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingLabTest) GetId() string { if c == nil { return "" } - return c.UserId + return c.Id } -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingLabTest) GetSlug() string { if c == nil { return "" } - return c.ClientUserId + return c.Slug } -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingLabTest) GetName() string { if c == nil { return "" } - return c.TeamId + return c.Name } -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingLabTest) GetSampleType() LabTestSampleType { if c == nil { - return nil + return "" } - return c.Data + return c.SampleType } -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) EventType() string { - return c.eventType +func (c *ClientFacingLabTest) GetMethod() LabTestCollectionMethod { + if c == nil { + return "" + } + return c.Method } -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { - return c.extraProperties +func (c *ClientFacingLabTest) GetPrice() float64 { + if c == nil { + return 0 + } + return c.Price } -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) +func (c *ClientFacingLabTest) GetIsActive() bool { + if c == nil { + return false } - c.explicitFields.Or(c.explicitFields, field) + return c.IsActive } -// SetUserId sets the UserId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingLeanBodyMassHistoricalPullCompletedFieldUserId) +func (c *ClientFacingLabTest) GetStatus() LabTestStatus { + if c == nil { + return "" + } + return c.Status } -// SetClientUserId sets the ClientUserId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingLeanBodyMassHistoricalPullCompletedFieldClientUserId) +func (c *ClientFacingLabTest) GetFasting() *bool { + if c == nil { + return nil + } + return c.Fasting } -// SetTeamId sets the TeamId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingLeanBodyMassHistoricalPullCompletedFieldTeamId) +func (c *ClientFacingLabTest) GetLab() *ClientFacingLab { + if c == nil { + return nil + } + return c.Lab } -// SetData sets the Data field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { - c.Data = data - c.require(clientFacingLeanBodyMassHistoricalPullCompletedFieldData) +func (c *ClientFacingLabTest) GetMarkers() []*ClientFacingMarker { + if c == nil { + return nil + } + return c.Markers } -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingLeanBodyMassHistoricalPullCompleted - var unmarshaler = struct { - embed - EventType string `json:"event_type"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *c = ClientFacingLeanBodyMassHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.lean_body_mass.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.lean_body_mass.created", unmarshaler.EventType) +func (c *ClientFacingLabTest) GetIsDelegated() *bool { + if c == nil { + return nil } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") - if err != nil { - return err + return c.IsDelegated +} + +func (c *ClientFacingLabTest) GetAutoGenerated() *bool { + if c == nil { + return nil } - c.extraProperties = extraProperties - c.rawJSON = json.RawMessage(data) - return nil + return c.AutoGenerated } -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingLeanBodyMassHistoricalPullCompleted - var marshaler = struct { - embed - EventType string `json:"event_type"` - }{ - embed: embed(*c), - EventType: "historical.data.lean_body_mass.created", +func (c *ClientFacingLabTest) GetHasCollectionInstructions() *bool { + if c == nil { + return nil } - explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) - return json.Marshal(explicitMarshaler) + return c.HasCollectionInstructions } -func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) String() string { - if len(c.rawJSON) > 0 { - if value, err := internal.StringifyJSON(c.rawJSON); err == nil { - return value - } +func (c *ClientFacingLabTest) GetCommonTatDays() *int { + if c == nil { + return nil } - if value, err := internal.StringifyJSON(c); err == nil { - return value + return c.CommonTatDays +} + +func (c *ClientFacingLabTest) GetWorstCaseTatDays() *int { + if c == nil { + return nil } - return fmt.Sprintf("%#v", c) + return c.WorstCaseTatDays } -var ( - clientFacingMarkerFieldId = big.NewInt(1 << 0) - clientFacingMarkerFieldName = big.NewInt(1 << 1) - clientFacingMarkerFieldSlug = big.NewInt(1 << 2) - clientFacingMarkerFieldDescription = big.NewInt(1 << 3) - clientFacingMarkerFieldLabId = big.NewInt(1 << 4) - clientFacingMarkerFieldProviderId = big.NewInt(1 << 5) - clientFacingMarkerFieldType = big.NewInt(1 << 6) - clientFacingMarkerFieldUnit = big.NewInt(1 << 7) - clientFacingMarkerFieldPrice = big.NewInt(1 << 8) - clientFacingMarkerFieldAoe = big.NewInt(1 << 9) - clientFacingMarkerFieldALaCarteEnabled = big.NewInt(1 << 10) - clientFacingMarkerFieldCommonTatDays = big.NewInt(1 << 11) - clientFacingMarkerFieldWorstCaseTatDays = big.NewInt(1 << 12) - clientFacingMarkerFieldIsOrderable = big.NewInt(1 << 13) -) +func (c *ClientFacingLabTest) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} -type ClientFacingMarker struct { - Id int `json:"id" url:"id"` - Name string `json:"name" url:"name"` - Slug string `json:"slug" url:"slug"` - Description *string `json:"description,omitempty" url:"description,omitempty"` - LabId *int `json:"lab_id,omitempty" url:"lab_id,omitempty"` - ProviderId *string `json:"provider_id,omitempty" url:"provider_id,omitempty"` - Type *MarkerType `json:"type,omitempty" url:"type,omitempty"` - Unit *string `json:"unit,omitempty" url:"unit,omitempty"` - Price *string `json:"price,omitempty" url:"price,omitempty"` - Aoe *AoE `json:"aoe,omitempty" url:"aoe,omitempty"` - ALaCarteEnabled *bool `json:"a_la_carte_enabled,omitempty" url:"a_la_carte_enabled,omitempty"` - CommonTatDays *int `json:"common_tat_days,omitempty" url:"common_tat_days,omitempty"` - WorstCaseTatDays *int `json:"worst_case_tat_days,omitempty" url:"worst_case_tat_days,omitempty"` - IsOrderable *bool `json:"is_orderable,omitempty" url:"is_orderable,omitempty"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` - - extraProperties map[string]interface{} - rawJSON json.RawMessage -} - -func (c *ClientFacingMarker) GetId() int { - if c == nil { - return 0 - } - return c.Id -} - -func (c *ClientFacingMarker) GetName() string { - if c == nil { - return "" - } - return c.Name -} - -func (c *ClientFacingMarker) GetSlug() string { - if c == nil { - return "" - } - return c.Slug -} - -func (c *ClientFacingMarker) GetDescription() *string { - if c == nil { - return nil - } - return c.Description -} - -func (c *ClientFacingMarker) GetLabId() *int { - if c == nil { - return nil - } - return c.LabId -} - -func (c *ClientFacingMarker) GetProviderId() *string { - if c == nil { - return nil - } - return c.ProviderId -} - -func (c *ClientFacingMarker) GetType() *MarkerType { - if c == nil { - return nil - } - return c.Type -} - -func (c *ClientFacingMarker) GetUnit() *string { - if c == nil { - return nil - } - return c.Unit -} - -func (c *ClientFacingMarker) GetPrice() *string { - if c == nil { - return nil - } - return c.Price -} - -func (c *ClientFacingMarker) GetAoe() *AoE { - if c == nil { - return nil - } - return c.Aoe -} - -func (c *ClientFacingMarker) GetALaCarteEnabled() *bool { - if c == nil { - return nil - } - return c.ALaCarteEnabled -} - -func (c *ClientFacingMarker) GetCommonTatDays() *int { - if c == nil { - return nil - } - return c.CommonTatDays -} - -func (c *ClientFacingMarker) GetWorstCaseTatDays() *int { - if c == nil { - return nil - } - return c.WorstCaseTatDays -} - -func (c *ClientFacingMarker) GetIsOrderable() *bool { - if c == nil { - return nil - } - return c.IsOrderable -} - -func (c *ClientFacingMarker) GetExtraProperties() map[string]interface{} { - return c.extraProperties -} - -func (c *ClientFacingMarker) require(field *big.Int) { +func (c *ClientFacingLabTest) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -13054,109 +13123,123 @@ func (c *ClientFacingMarker) require(field *big.Int) { // SetId sets the Id field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetId(id int) { +func (c *ClientFacingLabTest) SetId(id string) { c.Id = id - c.require(clientFacingMarkerFieldId) + c.require(clientFacingLabTestFieldId) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabTest) SetSlug(slug string) { + c.Slug = slug + c.require(clientFacingLabTestFieldSlug) } // SetName sets the Name field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetName(name string) { +func (c *ClientFacingLabTest) SetName(name string) { c.Name = name - c.require(clientFacingMarkerFieldName) + c.require(clientFacingLabTestFieldName) } -// SetSlug sets the Slug field and marks it as non-optional; +// SetSampleType sets the SampleType field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetSlug(slug string) { - c.Slug = slug - c.require(clientFacingMarkerFieldSlug) +func (c *ClientFacingLabTest) SetSampleType(sampleType LabTestSampleType) { + c.SampleType = sampleType + c.require(clientFacingLabTestFieldSampleType) } -// SetDescription sets the Description field and marks it as non-optional; +// SetMethod sets the Method field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetDescription(description *string) { - c.Description = description - c.require(clientFacingMarkerFieldDescription) +func (c *ClientFacingLabTest) SetMethod(method LabTestCollectionMethod) { + c.Method = method + c.require(clientFacingLabTestFieldMethod) } -// SetLabId sets the LabId field and marks it as non-optional; +// SetPrice sets the Price field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetLabId(labId *int) { - c.LabId = labId - c.require(clientFacingMarkerFieldLabId) +func (c *ClientFacingLabTest) SetPrice(price float64) { + c.Price = price + c.require(clientFacingLabTestFieldPrice) } -// SetProviderId sets the ProviderId field and marks it as non-optional; +// SetIsActive sets the IsActive field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetProviderId(providerId *string) { - c.ProviderId = providerId - c.require(clientFacingMarkerFieldProviderId) +func (c *ClientFacingLabTest) SetIsActive(isActive bool) { + c.IsActive = isActive + c.require(clientFacingLabTestFieldIsActive) } -// SetType sets the Type field and marks it as non-optional; +// SetStatus sets the Status field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetType(type_ *MarkerType) { - c.Type = type_ - c.require(clientFacingMarkerFieldType) +func (c *ClientFacingLabTest) SetStatus(status LabTestStatus) { + c.Status = status + c.require(clientFacingLabTestFieldStatus) } -// SetUnit sets the Unit field and marks it as non-optional; +// SetFasting sets the Fasting field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetUnit(unit *string) { - c.Unit = unit - c.require(clientFacingMarkerFieldUnit) +func (c *ClientFacingLabTest) SetFasting(fasting *bool) { + c.Fasting = fasting + c.require(clientFacingLabTestFieldFasting) } -// SetPrice sets the Price field and marks it as non-optional; +// SetLab sets the Lab field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetPrice(price *string) { - c.Price = price - c.require(clientFacingMarkerFieldPrice) +func (c *ClientFacingLabTest) SetLab(lab *ClientFacingLab) { + c.Lab = lab + c.require(clientFacingLabTestFieldLab) } -// SetAoe sets the Aoe field and marks it as non-optional; +// SetMarkers sets the Markers field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetAoe(aoe *AoE) { - c.Aoe = aoe - c.require(clientFacingMarkerFieldAoe) +func (c *ClientFacingLabTest) SetMarkers(markers []*ClientFacingMarker) { + c.Markers = markers + c.require(clientFacingLabTestFieldMarkers) } -// SetALaCarteEnabled sets the ALaCarteEnabled field and marks it as non-optional; +// SetIsDelegated sets the IsDelegated field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetALaCarteEnabled(aLaCarteEnabled *bool) { - c.ALaCarteEnabled = aLaCarteEnabled - c.require(clientFacingMarkerFieldALaCarteEnabled) +func (c *ClientFacingLabTest) SetIsDelegated(isDelegated *bool) { + c.IsDelegated = isDelegated + c.require(clientFacingLabTestFieldIsDelegated) +} + +// SetAutoGenerated sets the AutoGenerated field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabTest) SetAutoGenerated(autoGenerated *bool) { + c.AutoGenerated = autoGenerated + c.require(clientFacingLabTestFieldAutoGenerated) +} + +// SetHasCollectionInstructions sets the HasCollectionInstructions field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingLabTest) SetHasCollectionInstructions(hasCollectionInstructions *bool) { + c.HasCollectionInstructions = hasCollectionInstructions + c.require(clientFacingLabTestFieldHasCollectionInstructions) } // SetCommonTatDays sets the CommonTatDays field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetCommonTatDays(commonTatDays *int) { +func (c *ClientFacingLabTest) SetCommonTatDays(commonTatDays *int) { c.CommonTatDays = commonTatDays - c.require(clientFacingMarkerFieldCommonTatDays) + c.require(clientFacingLabTestFieldCommonTatDays) } // SetWorstCaseTatDays sets the WorstCaseTatDays field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetWorstCaseTatDays(worstCaseTatDays *int) { +func (c *ClientFacingLabTest) SetWorstCaseTatDays(worstCaseTatDays *int) { c.WorstCaseTatDays = worstCaseTatDays - c.require(clientFacingMarkerFieldWorstCaseTatDays) -} - -// SetIsOrderable sets the IsOrderable field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMarker) SetIsOrderable(isOrderable *bool) { - c.IsOrderable = isOrderable - c.require(clientFacingMarkerFieldIsOrderable) + c.require(clientFacingLabTestFieldWorstCaseTatDays) } -func (c *ClientFacingMarker) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingMarker +func (c *ClientFacingLabTest) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingLabTest var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingMarker(value) + *c = ClientFacingLabTest(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -13166,8 +13249,8 @@ func (c *ClientFacingMarker) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingMarker) MarshalJSON() ([]byte, error) { - type embed ClientFacingMarker +func (c *ClientFacingLabTest) MarshalJSON() ([]byte, error) { + type embed ClientFacingLabTest var marshaler = struct { embed }{ @@ -13177,7 +13260,7 @@ func (c *ClientFacingMarker) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingMarker) String() string { +func (c *ClientFacingLabTest) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -13190,19 +13273,19 @@ func (c *ClientFacingMarker) String() string { } var ( - clientFacingMealChangedFieldEventType = big.NewInt(1 << 0) - clientFacingMealChangedFieldUserId = big.NewInt(1 << 1) - clientFacingMealChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingMealChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingMealChangedFieldData = big.NewInt(1 << 4) + clientFacingLeanBodyMassChangedFieldEventType = big.NewInt(1 << 0) + clientFacingLeanBodyMassChangedFieldUserId = big.NewInt(1 << 1) + clientFacingLeanBodyMassChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingLeanBodyMassChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingLeanBodyMassChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingMealChanged struct { - EventType ClientFacingMealChangedEventType `json:"event_type" url:"event_type"` - UserId string `json:"user_id" url:"user_id"` - ClientUserId string `json:"client_user_id" url:"client_user_id"` - TeamId string `json:"team_id" url:"team_id"` - Data *MealInDbBaseClientFacingSource `json:"data" url:"data"` +type ClientFacingLeanBodyMassChanged struct { + EventType ClientFacingLeanBodyMassChangedEventType `json:"event_type" url:"event_type"` + UserId string `json:"user_id" url:"user_id"` + ClientUserId string `json:"client_user_id" url:"client_user_id"` + TeamId string `json:"team_id" url:"team_id"` + Data *GroupedLeanBodyMass `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -13211,46 +13294,46 @@ type ClientFacingMealChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingMealChanged) GetEventType() ClientFacingMealChangedEventType { +func (c *ClientFacingLeanBodyMassChanged) GetEventType() ClientFacingLeanBodyMassChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingMealChanged) GetUserId() string { +func (c *ClientFacingLeanBodyMassChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingMealChanged) GetClientUserId() string { +func (c *ClientFacingLeanBodyMassChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingMealChanged) GetTeamId() string { +func (c *ClientFacingLeanBodyMassChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingMealChanged) GetData() *MealInDbBaseClientFacingSource { +func (c *ClientFacingLeanBodyMassChanged) GetData() *GroupedLeanBodyMass { if c == nil { return nil } return c.Data } -func (c *ClientFacingMealChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingLeanBodyMassChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingMealChanged) require(field *big.Int) { +func (c *ClientFacingLeanBodyMassChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -13259,46 +13342,46 @@ func (c *ClientFacingMealChanged) require(field *big.Int) { // SetEventType sets the EventType field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMealChanged) SetEventType(eventType ClientFacingMealChangedEventType) { +func (c *ClientFacingLeanBodyMassChanged) SetEventType(eventType ClientFacingLeanBodyMassChangedEventType) { c.EventType = eventType - c.require(clientFacingMealChangedFieldEventType) + c.require(clientFacingLeanBodyMassChangedFieldEventType) } // SetUserId sets the UserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMealChanged) SetUserId(userId string) { +func (c *ClientFacingLeanBodyMassChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingMealChangedFieldUserId) + c.require(clientFacingLeanBodyMassChangedFieldUserId) } // SetClientUserId sets the ClientUserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMealChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingLeanBodyMassChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingMealChangedFieldClientUserId) + c.require(clientFacingLeanBodyMassChangedFieldClientUserId) } // SetTeamId sets the TeamId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMealChanged) SetTeamId(teamId string) { +func (c *ClientFacingLeanBodyMassChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingMealChangedFieldTeamId) + c.require(clientFacingLeanBodyMassChangedFieldTeamId) } // SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMealChanged) SetData(data *MealInDbBaseClientFacingSource) { +func (c *ClientFacingLeanBodyMassChanged) SetData(data *GroupedLeanBodyMass) { c.Data = data - c.require(clientFacingMealChangedFieldData) + c.require(clientFacingLeanBodyMassChangedFieldData) } -func (c *ClientFacingMealChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingMealChanged +func (c *ClientFacingLeanBodyMassChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingLeanBodyMassChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingMealChanged(value) + *c = ClientFacingLeanBodyMassChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -13308,8 +13391,8 @@ func (c *ClientFacingMealChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingMealChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingMealChanged +func (c *ClientFacingLeanBodyMassChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingLeanBodyMassChanged var marshaler = struct { embed }{ @@ -13319,7 +13402,7 @@ func (c *ClientFacingMealChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingMealChanged) String() string { +func (c *ClientFacingLeanBodyMassChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -13331,36 +13414,36 @@ func (c *ClientFacingMealChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingMealChangedEventType string +type ClientFacingLeanBodyMassChangedEventType string const ( - ClientFacingMealChangedEventTypeDailyDataMealCreated ClientFacingMealChangedEventType = "daily.data.meal.created" - ClientFacingMealChangedEventTypeDailyDataMealUpdated ClientFacingMealChangedEventType = "daily.data.meal.updated" + ClientFacingLeanBodyMassChangedEventTypeDailyDataLeanBodyMassCreated ClientFacingLeanBodyMassChangedEventType = "daily.data.lean_body_mass.created" + ClientFacingLeanBodyMassChangedEventTypeDailyDataLeanBodyMassUpdated ClientFacingLeanBodyMassChangedEventType = "daily.data.lean_body_mass.updated" ) -func NewClientFacingMealChangedEventTypeFromString(s string) (ClientFacingMealChangedEventType, error) { +func NewClientFacingLeanBodyMassChangedEventTypeFromString(s string) (ClientFacingLeanBodyMassChangedEventType, error) { switch s { - case "daily.data.meal.created": - return ClientFacingMealChangedEventTypeDailyDataMealCreated, nil - case "daily.data.meal.updated": - return ClientFacingMealChangedEventTypeDailyDataMealUpdated, nil + case "daily.data.lean_body_mass.created": + return ClientFacingLeanBodyMassChangedEventTypeDailyDataLeanBodyMassCreated, nil + case "daily.data.lean_body_mass.updated": + return ClientFacingLeanBodyMassChangedEventTypeDailyDataLeanBodyMassUpdated, nil } - var t ClientFacingMealChangedEventType + var t ClientFacingLeanBodyMassChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingMealChangedEventType) Ptr() *ClientFacingMealChangedEventType { +func (c ClientFacingLeanBodyMassChangedEventType) Ptr() *ClientFacingLeanBodyMassChangedEventType { return &c } var ( - clientFacingMealHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingMealHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingMealHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingMealHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingLeanBodyMassHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingLeanBodyMassHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingLeanBodyMassHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingLeanBodyMassHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingMealHistoricalPullCompleted struct { +type ClientFacingLeanBodyMassHistoricalPullCompleted struct { UserId string `json:"user_id" url:"user_id"` ClientUserId string `json:"client_user_id" url:"client_user_id"` TeamId string `json:"team_id" url:"team_id"` @@ -13374,43 +13457,43 @@ type ClientFacingMealHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingMealHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingMealHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingMealHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingMealHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingMealHistoricalPullCompleted) EventType() string { +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingMealHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingMealHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -13419,34 +13502,34 @@ func (c *ClientFacingMealHistoricalPullCompleted) require(field *big.Int) { // SetUserId sets the UserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMealHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingMealHistoricalPullCompletedFieldUserId) + c.require(clientFacingLeanBodyMassHistoricalPullCompletedFieldUserId) } // SetClientUserId sets the ClientUserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMealHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingMealHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingLeanBodyMassHistoricalPullCompletedFieldClientUserId) } // SetTeamId sets the TeamId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMealHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingMealHistoricalPullCompletedFieldTeamId) + c.require(clientFacingLeanBodyMassHistoricalPullCompletedFieldTeamId) } // SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMealHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingMealHistoricalPullCompletedFieldData) + c.require(clientFacingLeanBodyMassHistoricalPullCompletedFieldData) } -func (c *ClientFacingMealHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingMealHistoricalPullCompleted +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingLeanBodyMassHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -13456,9 +13539,9 @@ func (c *ClientFacingMealHistoricalPullCompleted) UnmarshalJSON(data []byte) err if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingMealHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.meal.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.meal.created", unmarshaler.EventType) + *c = ClientFacingLeanBodyMassHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.lean_body_mass.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.lean_body_mass.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -13470,20 +13553,20 @@ func (c *ClientFacingMealHistoricalPullCompleted) UnmarshalJSON(data []byte) err return nil } -func (c *ClientFacingMealHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingMealHistoricalPullCompleted +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingLeanBodyMassHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "historical.data.meal.created", + EventType: "historical.data.lean_body_mass.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingMealHistoricalPullCompleted) String() string { +func (c *ClientFacingLeanBodyMassHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -13496,19 +13579,37 @@ func (c *ClientFacingMealHistoricalPullCompleted) String() string { } var ( - clientFacingMenstrualCycleChangedFieldEventType = big.NewInt(1 << 0) - clientFacingMenstrualCycleChangedFieldUserId = big.NewInt(1 << 1) - clientFacingMenstrualCycleChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingMenstrualCycleChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingMenstrualCycleChangedFieldData = big.NewInt(1 << 4) + clientFacingMarkerFieldId = big.NewInt(1 << 0) + clientFacingMarkerFieldName = big.NewInt(1 << 1) + clientFacingMarkerFieldSlug = big.NewInt(1 << 2) + clientFacingMarkerFieldDescription = big.NewInt(1 << 3) + clientFacingMarkerFieldLabId = big.NewInt(1 << 4) + clientFacingMarkerFieldProviderId = big.NewInt(1 << 5) + clientFacingMarkerFieldType = big.NewInt(1 << 6) + clientFacingMarkerFieldUnit = big.NewInt(1 << 7) + clientFacingMarkerFieldPrice = big.NewInt(1 << 8) + clientFacingMarkerFieldAoe = big.NewInt(1 << 9) + clientFacingMarkerFieldALaCarteEnabled = big.NewInt(1 << 10) + clientFacingMarkerFieldCommonTatDays = big.NewInt(1 << 11) + clientFacingMarkerFieldWorstCaseTatDays = big.NewInt(1 << 12) + clientFacingMarkerFieldIsOrderable = big.NewInt(1 << 13) ) -type ClientFacingMenstrualCycleChanged struct { - EventType ClientFacingMenstrualCycleChangedEventType `json:"event_type" url:"event_type"` - UserId string `json:"user_id" url:"user_id"` - ClientUserId string `json:"client_user_id" url:"client_user_id"` - TeamId string `json:"team_id" url:"team_id"` - Data *ClientFacingMenstrualCycle `json:"data" url:"data"` +type ClientFacingMarker struct { + Id int `json:"id" url:"id"` + Name string `json:"name" url:"name"` + Slug string `json:"slug" url:"slug"` + Description *string `json:"description,omitempty" url:"description,omitempty"` + LabId *int `json:"lab_id,omitempty" url:"lab_id,omitempty"` + ProviderId *string `json:"provider_id,omitempty" url:"provider_id,omitempty"` + Type *MarkerType `json:"type,omitempty" url:"type,omitempty"` + Unit *string `json:"unit,omitempty" url:"unit,omitempty"` + Price *string `json:"price,omitempty" url:"price,omitempty"` + Aoe *AoE `json:"aoe,omitempty" url:"aoe,omitempty"` + ALaCarteEnabled *bool `json:"a_la_carte_enabled,omitempty" url:"a_la_carte_enabled,omitempty"` + CommonTatDays *int `json:"common_tat_days,omitempty" url:"common_tat_days,omitempty"` + WorstCaseTatDays *int `json:"worst_case_tat_days,omitempty" url:"worst_case_tat_days,omitempty"` + IsOrderable *bool `json:"is_orderable,omitempty" url:"is_orderable,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -13517,94 +13618,220 @@ type ClientFacingMenstrualCycleChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingMenstrualCycleChanged) GetEventType() ClientFacingMenstrualCycleChangedEventType { +func (c *ClientFacingMarker) GetId() int { if c == nil { - return "" + return 0 } - return c.EventType + return c.Id } -func (c *ClientFacingMenstrualCycleChanged) GetUserId() string { +func (c *ClientFacingMarker) GetName() string { if c == nil { return "" } - return c.UserId + return c.Name } -func (c *ClientFacingMenstrualCycleChanged) GetClientUserId() string { +func (c *ClientFacingMarker) GetSlug() string { if c == nil { return "" } - return c.ClientUserId + return c.Slug } -func (c *ClientFacingMenstrualCycleChanged) GetTeamId() string { +func (c *ClientFacingMarker) GetDescription() *string { if c == nil { - return "" + return nil } - return c.TeamId + return c.Description } -func (c *ClientFacingMenstrualCycleChanged) GetData() *ClientFacingMenstrualCycle { +func (c *ClientFacingMarker) GetLabId() *int { if c == nil { return nil } - return c.Data + return c.LabId } -func (c *ClientFacingMenstrualCycleChanged) GetExtraProperties() map[string]interface{} { - return c.extraProperties +func (c *ClientFacingMarker) GetProviderId() *string { + if c == nil { + return nil + } + return c.ProviderId } -func (c *ClientFacingMenstrualCycleChanged) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) +func (c *ClientFacingMarker) GetType() *MarkerType { + if c == nil { + return nil } - c.explicitFields.Or(c.explicitFields, field) + return c.Type } -// SetEventType sets the EventType field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMenstrualCycleChanged) SetEventType(eventType ClientFacingMenstrualCycleChangedEventType) { - c.EventType = eventType - c.require(clientFacingMenstrualCycleChangedFieldEventType) +func (c *ClientFacingMarker) GetUnit() *string { + if c == nil { + return nil + } + return c.Unit } -// SetUserId sets the UserId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMenstrualCycleChanged) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingMenstrualCycleChangedFieldUserId) +func (c *ClientFacingMarker) GetPrice() *string { + if c == nil { + return nil + } + return c.Price } -// SetClientUserId sets the ClientUserId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMenstrualCycleChanged) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingMenstrualCycleChangedFieldClientUserId) +func (c *ClientFacingMarker) GetAoe() *AoE { + if c == nil { + return nil + } + return c.Aoe } -// SetTeamId sets the TeamId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMenstrualCycleChanged) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingMenstrualCycleChangedFieldTeamId) +func (c *ClientFacingMarker) GetALaCarteEnabled() *bool { + if c == nil { + return nil + } + return c.ALaCarteEnabled } -// SetData sets the Data field and marks it as non-optional; +func (c *ClientFacingMarker) GetCommonTatDays() *int { + if c == nil { + return nil + } + return c.CommonTatDays +} + +func (c *ClientFacingMarker) GetWorstCaseTatDays() *int { + if c == nil { + return nil + } + return c.WorstCaseTatDays +} + +func (c *ClientFacingMarker) GetIsOrderable() *bool { + if c == nil { + return nil + } + return c.IsOrderable +} + +func (c *ClientFacingMarker) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingMarker) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMenstrualCycleChanged) SetData(data *ClientFacingMenstrualCycle) { - c.Data = data - c.require(clientFacingMenstrualCycleChangedFieldData) +func (c *ClientFacingMarker) SetId(id int) { + c.Id = id + c.require(clientFacingMarkerFieldId) } -func (c *ClientFacingMenstrualCycleChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingMenstrualCycleChanged +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMarker) SetName(name string) { + c.Name = name + c.require(clientFacingMarkerFieldName) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMarker) SetSlug(slug string) { + c.Slug = slug + c.require(clientFacingMarkerFieldSlug) +} + +// SetDescription sets the Description field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMarker) SetDescription(description *string) { + c.Description = description + c.require(clientFacingMarkerFieldDescription) +} + +// SetLabId sets the LabId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMarker) SetLabId(labId *int) { + c.LabId = labId + c.require(clientFacingMarkerFieldLabId) +} + +// SetProviderId sets the ProviderId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMarker) SetProviderId(providerId *string) { + c.ProviderId = providerId + c.require(clientFacingMarkerFieldProviderId) +} + +// SetType sets the Type field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMarker) SetType(type_ *MarkerType) { + c.Type = type_ + c.require(clientFacingMarkerFieldType) +} + +// SetUnit sets the Unit field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMarker) SetUnit(unit *string) { + c.Unit = unit + c.require(clientFacingMarkerFieldUnit) +} + +// SetPrice sets the Price field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMarker) SetPrice(price *string) { + c.Price = price + c.require(clientFacingMarkerFieldPrice) +} + +// SetAoe sets the Aoe field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMarker) SetAoe(aoe *AoE) { + c.Aoe = aoe + c.require(clientFacingMarkerFieldAoe) +} + +// SetALaCarteEnabled sets the ALaCarteEnabled field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMarker) SetALaCarteEnabled(aLaCarteEnabled *bool) { + c.ALaCarteEnabled = aLaCarteEnabled + c.require(clientFacingMarkerFieldALaCarteEnabled) +} + +// SetCommonTatDays sets the CommonTatDays field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMarker) SetCommonTatDays(commonTatDays *int) { + c.CommonTatDays = commonTatDays + c.require(clientFacingMarkerFieldCommonTatDays) +} + +// SetWorstCaseTatDays sets the WorstCaseTatDays field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMarker) SetWorstCaseTatDays(worstCaseTatDays *int) { + c.WorstCaseTatDays = worstCaseTatDays + c.require(clientFacingMarkerFieldWorstCaseTatDays) +} + +// SetIsOrderable sets the IsOrderable field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMarker) SetIsOrderable(isOrderable *bool) { + c.IsOrderable = isOrderable + c.require(clientFacingMarkerFieldIsOrderable) +} + +func (c *ClientFacingMarker) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingMarker var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingMenstrualCycleChanged(value) + *c = ClientFacingMarker(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -13614,8 +13841,8 @@ func (c *ClientFacingMenstrualCycleChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingMenstrualCycleChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingMenstrualCycleChanged +func (c *ClientFacingMarker) MarshalJSON() ([]byte, error) { + type embed ClientFacingMarker var marshaler = struct { embed }{ @@ -13625,7 +13852,7 @@ func (c *ClientFacingMenstrualCycleChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingMenstrualCycleChanged) String() string { +func (c *ClientFacingMarker) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -13637,138 +13864,118 @@ func (c *ClientFacingMenstrualCycleChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingMenstrualCycleChangedEventType string - -const ( - ClientFacingMenstrualCycleChangedEventTypeDailyDataMenstrualCycleCreated ClientFacingMenstrualCycleChangedEventType = "daily.data.menstrual_cycle.created" - ClientFacingMenstrualCycleChangedEventTypeDailyDataMenstrualCycleUpdated ClientFacingMenstrualCycleChangedEventType = "daily.data.menstrual_cycle.updated" -) - -func NewClientFacingMenstrualCycleChangedEventTypeFromString(s string) (ClientFacingMenstrualCycleChangedEventType, error) { - switch s { - case "daily.data.menstrual_cycle.created": - return ClientFacingMenstrualCycleChangedEventTypeDailyDataMenstrualCycleCreated, nil - case "daily.data.menstrual_cycle.updated": - return ClientFacingMenstrualCycleChangedEventTypeDailyDataMenstrualCycleUpdated, nil - } - var t ClientFacingMenstrualCycleChangedEventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ClientFacingMenstrualCycleChangedEventType) Ptr() *ClientFacingMenstrualCycleChangedEventType { - return &c -} - var ( - clientFacingMenstrualCycleHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingMenstrualCycleHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingMenstrualCycleHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingMenstrualCycleHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingMealChangedFieldEventType = big.NewInt(1 << 0) + clientFacingMealChangedFieldUserId = big.NewInt(1 << 1) + clientFacingMealChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingMealChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingMealChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingMenstrualCycleHistoricalPullCompleted struct { - UserId string `json:"user_id" url:"user_id"` - ClientUserId string `json:"client_user_id" url:"client_user_id"` - TeamId string `json:"team_id" url:"team_id"` - Data *HistoricalPullCompleted `json:"data" url:"data"` +type ClientFacingMealChanged struct { + EventType ClientFacingMealChangedEventType `json:"event_type" url:"event_type"` + UserId string `json:"user_id" url:"user_id"` + ClientUserId string `json:"client_user_id" url:"client_user_id"` + TeamId string `json:"team_id" url:"team_id"` + Data *MealInDbBaseClientFacingSource `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` - eventType string extraProperties map[string]interface{} rawJSON json.RawMessage } -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingMealChanged) GetEventType() ClientFacingMealChangedEventType { + if c == nil { + return "" + } + return c.EventType +} + +func (c *ClientFacingMealChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingMealChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingMealChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingMealChanged) GetData() *MealInDbBaseClientFacingSource { if c == nil { return nil } return c.Data } -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) EventType() string { - return c.eventType -} - -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingMealChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingMealChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } c.explicitFields.Or(c.explicitFields, field) } +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMealChanged) SetEventType(eventType ClientFacingMealChangedEventType) { + c.EventType = eventType + c.require(clientFacingMealChangedFieldEventType) +} + // SetUserId sets the UserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingMealChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingMenstrualCycleHistoricalPullCompletedFieldUserId) + c.require(clientFacingMealChangedFieldUserId) } // SetClientUserId sets the ClientUserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingMealChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingMenstrualCycleHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingMealChangedFieldClientUserId) } // SetTeamId sets the TeamId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingMealChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingMenstrualCycleHistoricalPullCompletedFieldTeamId) + c.require(clientFacingMealChangedFieldTeamId) } // SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingMealChanged) SetData(data *MealInDbBaseClientFacingSource) { c.Data = data - c.require(clientFacingMenstrualCycleHistoricalPullCompletedFieldData) + c.require(clientFacingMealChangedFieldData) } -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingMenstrualCycleHistoricalPullCompleted - var unmarshaler = struct { - embed - EventType string `json:"event_type"` - }{ - embed: embed(*c), +func (c *ClientFacingMealChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingMealChanged + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *c = ClientFacingMenstrualCycleHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.menstrual_cycle.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.menstrual_cycle.created", unmarshaler.EventType) - } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") - if err != nil { + *c = ClientFacingMealChanged(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { return err } c.extraProperties = extraProperties @@ -13776,20 +13983,18 @@ func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) UnmarshalJSON(data [ return nil } -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingMenstrualCycleHistoricalPullCompleted +func (c *ClientFacingMealChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingMealChanged var marshaler = struct { embed - EventType string `json:"event_type"` }{ - embed: embed(*c), - EventType: "historical.data.menstrual_cycle.created", + embed: embed(*c), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) String() string { +func (c *ClientFacingMealChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -13801,117 +14006,137 @@ func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) String() string { return fmt.Sprintf("%#v", c) } +type ClientFacingMealChangedEventType string + +const ( + ClientFacingMealChangedEventTypeDailyDataMealCreated ClientFacingMealChangedEventType = "daily.data.meal.created" + ClientFacingMealChangedEventTypeDailyDataMealUpdated ClientFacingMealChangedEventType = "daily.data.meal.updated" +) + +func NewClientFacingMealChangedEventTypeFromString(s string) (ClientFacingMealChangedEventType, error) { + switch s { + case "daily.data.meal.created": + return ClientFacingMealChangedEventTypeDailyDataMealCreated, nil + case "daily.data.meal.updated": + return ClientFacingMealChangedEventTypeDailyDataMealUpdated, nil + } + var t ClientFacingMealChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingMealChangedEventType) Ptr() *ClientFacingMealChangedEventType { + return &c +} + var ( - clientFacingMindfulnessMinutesChangedFieldEventType = big.NewInt(1 << 0) - clientFacingMindfulnessMinutesChangedFieldUserId = big.NewInt(1 << 1) - clientFacingMindfulnessMinutesChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingMindfulnessMinutesChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingMindfulnessMinutesChangedFieldData = big.NewInt(1 << 4) + clientFacingMealHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingMealHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingMealHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingMealHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingMindfulnessMinutesChanged struct { - EventType ClientFacingMindfulnessMinutesChangedEventType `json:"event_type" url:"event_type"` - UserId string `json:"user_id" url:"user_id"` - ClientUserId string `json:"client_user_id" url:"client_user_id"` - TeamId string `json:"team_id" url:"team_id"` - Data *GroupedMindfulnessMinutes `json:"data" url:"data"` +type ClientFacingMealHistoricalPullCompleted struct { + UserId string `json:"user_id" url:"user_id"` + ClientUserId string `json:"client_user_id" url:"client_user_id"` + TeamId string `json:"team_id" url:"team_id"` + Data *HistoricalPullCompleted `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` + eventType string extraProperties map[string]interface{} rawJSON json.RawMessage } -func (c *ClientFacingMindfulnessMinutesChanged) GetEventType() ClientFacingMindfulnessMinutesChangedEventType { - if c == nil { - return "" - } - return c.EventType -} - -func (c *ClientFacingMindfulnessMinutesChanged) GetUserId() string { +func (c *ClientFacingMealHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingMindfulnessMinutesChanged) GetClientUserId() string { +func (c *ClientFacingMealHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingMindfulnessMinutesChanged) GetTeamId() string { +func (c *ClientFacingMealHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingMindfulnessMinutesChanged) GetData() *GroupedMindfulnessMinutes { +func (c *ClientFacingMealHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingMindfulnessMinutesChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingMealHistoricalPullCompleted) EventType() string { + return c.eventType +} + +func (c *ClientFacingMealHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingMindfulnessMinutesChanged) require(field *big.Int) { +func (c *ClientFacingMealHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } c.explicitFields.Or(c.explicitFields, field) } -// SetEventType sets the EventType field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMindfulnessMinutesChanged) SetEventType(eventType ClientFacingMindfulnessMinutesChangedEventType) { - c.EventType = eventType - c.require(clientFacingMindfulnessMinutesChangedFieldEventType) -} - // SetUserId sets the UserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMindfulnessMinutesChanged) SetUserId(userId string) { +func (c *ClientFacingMealHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingMindfulnessMinutesChangedFieldUserId) + c.require(clientFacingMealHistoricalPullCompletedFieldUserId) } // SetClientUserId sets the ClientUserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMindfulnessMinutesChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingMealHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingMindfulnessMinutesChangedFieldClientUserId) + c.require(clientFacingMealHistoricalPullCompletedFieldClientUserId) } // SetTeamId sets the TeamId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMindfulnessMinutesChanged) SetTeamId(teamId string) { +func (c *ClientFacingMealHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingMindfulnessMinutesChangedFieldTeamId) + c.require(clientFacingMealHistoricalPullCompletedFieldTeamId) } // SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMindfulnessMinutesChanged) SetData(data *GroupedMindfulnessMinutes) { +func (c *ClientFacingMealHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingMindfulnessMinutesChangedFieldData) + c.require(clientFacingMealHistoricalPullCompletedFieldData) } -func (c *ClientFacingMindfulnessMinutesChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingMindfulnessMinutesChanged - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (c *ClientFacingMealHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingMealHistoricalPullCompleted + var unmarshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingMindfulnessMinutesChanged(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) + *c = ClientFacingMealHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.meal.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.meal.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") if err != nil { return err } @@ -13920,18 +14145,20 @@ func (c *ClientFacingMindfulnessMinutesChanged) UnmarshalJSON(data []byte) error return nil } -func (c *ClientFacingMindfulnessMinutesChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingMindfulnessMinutesChanged +func (c *ClientFacingMealHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingMealHistoricalPullCompleted var marshaler = struct { embed + EventType string `json:"event_type"` }{ - embed: embed(*c), + embed: embed(*c), + EventType: "historical.data.meal.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingMindfulnessMinutesChanged) String() string { +func (c *ClientFacingMealHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -13943,137 +14170,117 @@ func (c *ClientFacingMindfulnessMinutesChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingMindfulnessMinutesChangedEventType string - -const ( - ClientFacingMindfulnessMinutesChangedEventTypeDailyDataMindfulnessMinutesCreated ClientFacingMindfulnessMinutesChangedEventType = "daily.data.mindfulness_minutes.created" - ClientFacingMindfulnessMinutesChangedEventTypeDailyDataMindfulnessMinutesUpdated ClientFacingMindfulnessMinutesChangedEventType = "daily.data.mindfulness_minutes.updated" -) - -func NewClientFacingMindfulnessMinutesChangedEventTypeFromString(s string) (ClientFacingMindfulnessMinutesChangedEventType, error) { - switch s { - case "daily.data.mindfulness_minutes.created": - return ClientFacingMindfulnessMinutesChangedEventTypeDailyDataMindfulnessMinutesCreated, nil - case "daily.data.mindfulness_minutes.updated": - return ClientFacingMindfulnessMinutesChangedEventTypeDailyDataMindfulnessMinutesUpdated, nil - } - var t ClientFacingMindfulnessMinutesChangedEventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ClientFacingMindfulnessMinutesChangedEventType) Ptr() *ClientFacingMindfulnessMinutesChangedEventType { - return &c -} - var ( - clientFacingMindfulnessMinutesHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingMindfulnessMinutesHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingMindfulnessMinutesHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingMindfulnessMinutesHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingMenstrualCycleChangedFieldEventType = big.NewInt(1 << 0) + clientFacingMenstrualCycleChangedFieldUserId = big.NewInt(1 << 1) + clientFacingMenstrualCycleChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingMenstrualCycleChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingMenstrualCycleChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingMindfulnessMinutesHistoricalPullCompleted struct { - UserId string `json:"user_id" url:"user_id"` - ClientUserId string `json:"client_user_id" url:"client_user_id"` - TeamId string `json:"team_id" url:"team_id"` - Data *HistoricalPullCompleted `json:"data" url:"data"` +type ClientFacingMenstrualCycleChanged struct { + EventType ClientFacingMenstrualCycleChangedEventType `json:"event_type" url:"event_type"` + UserId string `json:"user_id" url:"user_id"` + ClientUserId string `json:"client_user_id" url:"client_user_id"` + TeamId string `json:"team_id" url:"team_id"` + Data *ClientFacingMenstrualCycle `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` - eventType string extraProperties map[string]interface{} rawJSON json.RawMessage } -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingMenstrualCycleChanged) GetEventType() ClientFacingMenstrualCycleChangedEventType { + if c == nil { + return "" + } + return c.EventType +} + +func (c *ClientFacingMenstrualCycleChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingMenstrualCycleChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingMenstrualCycleChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingMenstrualCycleChanged) GetData() *ClientFacingMenstrualCycle { if c == nil { return nil } return c.Data } -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) EventType() string { - return c.eventType -} - -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingMenstrualCycleChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingMenstrualCycleChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } c.explicitFields.Or(c.explicitFields, field) } +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMenstrualCycleChanged) SetEventType(eventType ClientFacingMenstrualCycleChangedEventType) { + c.EventType = eventType + c.require(clientFacingMenstrualCycleChangedFieldEventType) +} + // SetUserId sets the UserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingMenstrualCycleChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingMindfulnessMinutesHistoricalPullCompletedFieldUserId) + c.require(clientFacingMenstrualCycleChangedFieldUserId) } // SetClientUserId sets the ClientUserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingMenstrualCycleChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingMindfulnessMinutesHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingMenstrualCycleChangedFieldClientUserId) } // SetTeamId sets the TeamId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingMenstrualCycleChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingMindfulnessMinutesHistoricalPullCompletedFieldTeamId) + c.require(clientFacingMenstrualCycleChangedFieldTeamId) } // SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingMenstrualCycleChanged) SetData(data *ClientFacingMenstrualCycle) { c.Data = data - c.require(clientFacingMindfulnessMinutesHistoricalPullCompletedFieldData) + c.require(clientFacingMenstrualCycleChangedFieldData) } -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingMindfulnessMinutesHistoricalPullCompleted - var unmarshaler = struct { - embed - EventType string `json:"event_type"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { +func (c *ClientFacingMenstrualCycleChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingMenstrualCycleChanged + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingMindfulnessMinutesHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.mindfulness_minutes.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.mindfulness_minutes.created", unmarshaler.EventType) - } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + *c = ClientFacingMenstrualCycleChanged(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } @@ -14082,20 +14289,18 @@ func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) UnmarshalJSON(da return nil } -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingMindfulnessMinutesHistoricalPullCompleted +func (c *ClientFacingMenstrualCycleChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingMenstrualCycleChanged var marshaler = struct { embed - EventType string `json:"event_type"` }{ - embed: embed(*c), - EventType: "historical.data.mindfulness_minutes.created", + embed: embed(*c), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) String() string { +func (c *ClientFacingMenstrualCycleChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -14107,117 +14312,137 @@ func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) String() string return fmt.Sprintf("%#v", c) } +type ClientFacingMenstrualCycleChangedEventType string + +const ( + ClientFacingMenstrualCycleChangedEventTypeDailyDataMenstrualCycleCreated ClientFacingMenstrualCycleChangedEventType = "daily.data.menstrual_cycle.created" + ClientFacingMenstrualCycleChangedEventTypeDailyDataMenstrualCycleUpdated ClientFacingMenstrualCycleChangedEventType = "daily.data.menstrual_cycle.updated" +) + +func NewClientFacingMenstrualCycleChangedEventTypeFromString(s string) (ClientFacingMenstrualCycleChangedEventType, error) { + switch s { + case "daily.data.menstrual_cycle.created": + return ClientFacingMenstrualCycleChangedEventTypeDailyDataMenstrualCycleCreated, nil + case "daily.data.menstrual_cycle.updated": + return ClientFacingMenstrualCycleChangedEventTypeDailyDataMenstrualCycleUpdated, nil + } + var t ClientFacingMenstrualCycleChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingMenstrualCycleChangedEventType) Ptr() *ClientFacingMenstrualCycleChangedEventType { + return &c +} + var ( - clientFacingNoteChangedFieldEventType = big.NewInt(1 << 0) - clientFacingNoteChangedFieldUserId = big.NewInt(1 << 1) - clientFacingNoteChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingNoteChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingNoteChangedFieldData = big.NewInt(1 << 4) + clientFacingMenstrualCycleHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingMenstrualCycleHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingMenstrualCycleHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingMenstrualCycleHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingNoteChanged struct { - EventType ClientFacingNoteChangedEventType `json:"event_type" url:"event_type"` - UserId string `json:"user_id" url:"user_id"` - ClientUserId string `json:"client_user_id" url:"client_user_id"` - TeamId string `json:"team_id" url:"team_id"` - Data *GroupedNote `json:"data" url:"data"` +type ClientFacingMenstrualCycleHistoricalPullCompleted struct { + UserId string `json:"user_id" url:"user_id"` + ClientUserId string `json:"client_user_id" url:"client_user_id"` + TeamId string `json:"team_id" url:"team_id"` + Data *HistoricalPullCompleted `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` + eventType string extraProperties map[string]interface{} rawJSON json.RawMessage } -func (c *ClientFacingNoteChanged) GetEventType() ClientFacingNoteChangedEventType { - if c == nil { - return "" - } - return c.EventType -} - -func (c *ClientFacingNoteChanged) GetUserId() string { +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingNoteChanged) GetClientUserId() string { +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingNoteChanged) GetTeamId() string { +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingNoteChanged) GetData() *GroupedNote { +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingNoteChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) EventType() string { + return c.eventType +} + +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingNoteChanged) require(field *big.Int) { +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } c.explicitFields.Or(c.explicitFields, field) } -// SetEventType sets the EventType field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingNoteChanged) SetEventType(eventType ClientFacingNoteChangedEventType) { - c.EventType = eventType - c.require(clientFacingNoteChangedFieldEventType) -} - // SetUserId sets the UserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingNoteChanged) SetUserId(userId string) { +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingNoteChangedFieldUserId) + c.require(clientFacingMenstrualCycleHistoricalPullCompletedFieldUserId) } // SetClientUserId sets the ClientUserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingNoteChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingNoteChangedFieldClientUserId) + c.require(clientFacingMenstrualCycleHistoricalPullCompletedFieldClientUserId) } // SetTeamId sets the TeamId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingNoteChanged) SetTeamId(teamId string) { +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingNoteChangedFieldTeamId) + c.require(clientFacingMenstrualCycleHistoricalPullCompletedFieldTeamId) } // SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingNoteChanged) SetData(data *GroupedNote) { +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingNoteChangedFieldData) + c.require(clientFacingMenstrualCycleHistoricalPullCompletedFieldData) } -func (c *ClientFacingNoteChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingNoteChanged - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingMenstrualCycleHistoricalPullCompleted + var unmarshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingNoteChanged(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) + *c = ClientFacingMenstrualCycleHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.menstrual_cycle.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.menstrual_cycle.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") if err != nil { return err } @@ -14226,18 +14451,20 @@ func (c *ClientFacingNoteChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingNoteChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingNoteChanged +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingMenstrualCycleHistoricalPullCompleted var marshaler = struct { embed + EventType string `json:"event_type"` }{ - embed: embed(*c), + embed: embed(*c), + EventType: "historical.data.menstrual_cycle.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingNoteChanged) String() string { +func (c *ClientFacingMenstrualCycleHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -14249,137 +14476,117 @@ func (c *ClientFacingNoteChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingNoteChangedEventType string - -const ( - ClientFacingNoteChangedEventTypeDailyDataNoteCreated ClientFacingNoteChangedEventType = "daily.data.note.created" - ClientFacingNoteChangedEventTypeDailyDataNoteUpdated ClientFacingNoteChangedEventType = "daily.data.note.updated" -) - -func NewClientFacingNoteChangedEventTypeFromString(s string) (ClientFacingNoteChangedEventType, error) { - switch s { - case "daily.data.note.created": - return ClientFacingNoteChangedEventTypeDailyDataNoteCreated, nil - case "daily.data.note.updated": - return ClientFacingNoteChangedEventTypeDailyDataNoteUpdated, nil - } - var t ClientFacingNoteChangedEventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ClientFacingNoteChangedEventType) Ptr() *ClientFacingNoteChangedEventType { - return &c -} - var ( - clientFacingNoteHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingNoteHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingNoteHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingNoteHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingMindfulnessMinutesChangedFieldEventType = big.NewInt(1 << 0) + clientFacingMindfulnessMinutesChangedFieldUserId = big.NewInt(1 << 1) + clientFacingMindfulnessMinutesChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingMindfulnessMinutesChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingMindfulnessMinutesChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingNoteHistoricalPullCompleted struct { - UserId string `json:"user_id" url:"user_id"` - ClientUserId string `json:"client_user_id" url:"client_user_id"` - TeamId string `json:"team_id" url:"team_id"` - Data *HistoricalPullCompleted `json:"data" url:"data"` +type ClientFacingMindfulnessMinutesChanged struct { + EventType ClientFacingMindfulnessMinutesChangedEventType `json:"event_type" url:"event_type"` + UserId string `json:"user_id" url:"user_id"` + ClientUserId string `json:"client_user_id" url:"client_user_id"` + TeamId string `json:"team_id" url:"team_id"` + Data *GroupedMindfulnessMinutes `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` - eventType string extraProperties map[string]interface{} rawJSON json.RawMessage } -func (c *ClientFacingNoteHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingMindfulnessMinutesChanged) GetEventType() ClientFacingMindfulnessMinutesChangedEventType { + if c == nil { + return "" + } + return c.EventType +} + +func (c *ClientFacingMindfulnessMinutesChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingNoteHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingMindfulnessMinutesChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingNoteHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingMindfulnessMinutesChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingNoteHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingMindfulnessMinutesChanged) GetData() *GroupedMindfulnessMinutes { if c == nil { return nil } return c.Data } -func (c *ClientFacingNoteHistoricalPullCompleted) EventType() string { - return c.eventType -} - -func (c *ClientFacingNoteHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingMindfulnessMinutesChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingNoteHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingMindfulnessMinutesChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } c.explicitFields.Or(c.explicitFields, field) } +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMindfulnessMinutesChanged) SetEventType(eventType ClientFacingMindfulnessMinutesChangedEventType) { + c.EventType = eventType + c.require(clientFacingMindfulnessMinutesChangedFieldEventType) +} + // SetUserId sets the UserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingNoteHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingMindfulnessMinutesChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingNoteHistoricalPullCompletedFieldUserId) + c.require(clientFacingMindfulnessMinutesChangedFieldUserId) } // SetClientUserId sets the ClientUserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingNoteHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingMindfulnessMinutesChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingNoteHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingMindfulnessMinutesChangedFieldClientUserId) } // SetTeamId sets the TeamId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingNoteHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingMindfulnessMinutesChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingNoteHistoricalPullCompletedFieldTeamId) + c.require(clientFacingMindfulnessMinutesChangedFieldTeamId) } // SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingNoteHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingMindfulnessMinutesChanged) SetData(data *GroupedMindfulnessMinutes) { c.Data = data - c.require(clientFacingNoteHistoricalPullCompletedFieldData) + c.require(clientFacingMindfulnessMinutesChangedFieldData) } -func (c *ClientFacingNoteHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingNoteHistoricalPullCompleted - var unmarshaler = struct { - embed - EventType string `json:"event_type"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { +func (c *ClientFacingMindfulnessMinutesChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingMindfulnessMinutesChanged + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingNoteHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.note.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.note.created", unmarshaler.EventType) - } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + *c = ClientFacingMindfulnessMinutesChanged(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } @@ -14388,20 +14595,18 @@ func (c *ClientFacingNoteHistoricalPullCompleted) UnmarshalJSON(data []byte) err return nil } -func (c *ClientFacingNoteHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingNoteHistoricalPullCompleted +func (c *ClientFacingMindfulnessMinutesChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingMindfulnessMinutesChanged var marshaler = struct { embed - EventType string `json:"event_type"` }{ - embed: embed(*c), - EventType: "historical.data.note.created", + embed: embed(*c), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingNoteHistoricalPullCompleted) String() string { +func (c *ClientFacingMindfulnessMinutesChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -14413,96 +14618,137 @@ func (c *ClientFacingNoteHistoricalPullCompleted) String() string { return fmt.Sprintf("%#v", c) } -// Schema for an on-site collection order in the client facing API. -// To be used as part of a ClientFacingOrder. -var ( - clientFacingOnSiteCollectionOrderFieldId = big.NewInt(1 << 0) - clientFacingOnSiteCollectionOrderFieldCreatedAt = big.NewInt(1 << 1) - clientFacingOnSiteCollectionOrderFieldUpdatedAt = big.NewInt(1 << 2) +type ClientFacingMindfulnessMinutesChangedEventType string + +const ( + ClientFacingMindfulnessMinutesChangedEventTypeDailyDataMindfulnessMinutesCreated ClientFacingMindfulnessMinutesChangedEventType = "daily.data.mindfulness_minutes.created" + ClientFacingMindfulnessMinutesChangedEventTypeDailyDataMindfulnessMinutesUpdated ClientFacingMindfulnessMinutesChangedEventType = "daily.data.mindfulness_minutes.updated" ) -type ClientFacingOnSiteCollectionOrder struct { - // The Junction on-site collection Order ID - Id string `json:"id" url:"id"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - UpdatedAt time.Time `json:"updated_at" url:"updated_at"` +func NewClientFacingMindfulnessMinutesChangedEventTypeFromString(s string) (ClientFacingMindfulnessMinutesChangedEventType, error) { + switch s { + case "daily.data.mindfulness_minutes.created": + return ClientFacingMindfulnessMinutesChangedEventTypeDailyDataMindfulnessMinutesCreated, nil + case "daily.data.mindfulness_minutes.updated": + return ClientFacingMindfulnessMinutesChangedEventTypeDailyDataMindfulnessMinutesUpdated, nil + } + var t ClientFacingMindfulnessMinutesChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingMindfulnessMinutesChangedEventType) Ptr() *ClientFacingMindfulnessMinutesChangedEventType { + return &c +} + +var ( + clientFacingMindfulnessMinutesHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingMindfulnessMinutesHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingMindfulnessMinutesHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingMindfulnessMinutesHistoricalPullCompletedFieldData = big.NewInt(1 << 3) +) + +type ClientFacingMindfulnessMinutesHistoricalPullCompleted struct { + UserId string `json:"user_id" url:"user_id"` + ClientUserId string `json:"client_user_id" url:"client_user_id"` + TeamId string `json:"team_id" url:"team_id"` + Data *HistoricalPullCompleted `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` + eventType string extraProperties map[string]interface{} rawJSON json.RawMessage } -func (c *ClientFacingOnSiteCollectionOrder) GetId() string { +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } - return c.Id + return c.UserId } -func (c *ClientFacingOnSiteCollectionOrder) GetCreatedAt() time.Time { +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) GetClientUserId() string { if c == nil { - return time.Time{} + return "" } - return c.CreatedAt + return c.ClientUserId } -func (c *ClientFacingOnSiteCollectionOrder) GetUpdatedAt() time.Time { +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) GetTeamId() string { if c == nil { - return time.Time{} + return "" } - return c.UpdatedAt + return c.TeamId } -func (c *ClientFacingOnSiteCollectionOrder) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) GetData() *HistoricalPullCompleted { + if c == nil { + return nil + } + return c.Data +} + +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) EventType() string { + return c.eventType +} + +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingOnSiteCollectionOrder) require(field *big.Int) { +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } c.explicitFields.Or(c.explicitFields, field) } -// SetId sets the Id field and marks it as non-optional; +// SetUserId sets the UserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOnSiteCollectionOrder) SetId(id string) { - c.Id = id - c.require(clientFacingOnSiteCollectionOrderFieldId) +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingMindfulnessMinutesHistoricalPullCompletedFieldUserId) } -// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// SetClientUserId sets the ClientUserId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOnSiteCollectionOrder) SetCreatedAt(createdAt time.Time) { - c.CreatedAt = createdAt - c.require(clientFacingOnSiteCollectionOrderFieldCreatedAt) +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingMindfulnessMinutesHistoricalPullCompletedFieldClientUserId) } -// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// SetTeamId sets the TeamId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOnSiteCollectionOrder) SetUpdatedAt(updatedAt time.Time) { - c.UpdatedAt = updatedAt - c.require(clientFacingOnSiteCollectionOrderFieldUpdatedAt) +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingMindfulnessMinutesHistoricalPullCompletedFieldTeamId) } -func (c *ClientFacingOnSiteCollectionOrder) UnmarshalJSON(data []byte) error { - type embed ClientFacingOnSiteCollectionOrder +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { + c.Data = data + c.require(clientFacingMindfulnessMinutesHistoricalPullCompletedFieldData) +} + +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingMindfulnessMinutesHistoricalPullCompleted var unmarshaler = struct { embed - CreatedAt *internal.DateTime `json:"created_at"` - UpdatedAt *internal.DateTime `json:"updated_at"` + EventType string `json:"event_type"` }{ embed: embed(*c), } if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingOnSiteCollectionOrder(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c.UpdatedAt = unmarshaler.UpdatedAt.Time() - extraProperties, err := internal.ExtractExtraProperties(data, *c) + *c = ClientFacingMindfulnessMinutesHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.mindfulness_minutes.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.mindfulness_minutes.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") if err != nil { return err } @@ -14511,22 +14757,20 @@ func (c *ClientFacingOnSiteCollectionOrder) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingOnSiteCollectionOrder) MarshalJSON() ([]byte, error) { - type embed ClientFacingOnSiteCollectionOrder +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingMindfulnessMinutesHistoricalPullCompleted var marshaler = struct { embed - CreatedAt *internal.DateTime `json:"created_at"` - UpdatedAt *internal.DateTime `json:"updated_at"` + EventType string `json:"event_type"` }{ embed: embed(*c), - CreatedAt: internal.NewDateTime(c.CreatedAt), - UpdatedAt: internal.NewDateTime(c.UpdatedAt), + EventType: "historical.data.mindfulness_minutes.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingOnSiteCollectionOrder) String() string { +func (c *ClientFacingMindfulnessMinutesHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -14539,11 +14783,19 @@ func (c *ClientFacingOnSiteCollectionOrder) String() string { } var ( - clientFacingOnSiteCollectionOrderDetailsFieldData = big.NewInt(1 << 0) + clientFacingNoteChangedFieldEventType = big.NewInt(1 << 0) + clientFacingNoteChangedFieldUserId = big.NewInt(1 << 1) + clientFacingNoteChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingNoteChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingNoteChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingOnSiteCollectionOrderDetails struct { - Data *ClientFacingOnSiteCollectionOrder `json:"data,omitempty" url:"data,omitempty"` +type ClientFacingNoteChanged struct { + EventType ClientFacingNoteChangedEventType `json:"event_type" url:"event_type"` + UserId string `json:"user_id" url:"user_id"` + ClientUserId string `json:"client_user_id" url:"client_user_id"` + TeamId string `json:"team_id" url:"team_id"` + Data *GroupedNote `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -14552,38 +14804,94 @@ type ClientFacingOnSiteCollectionOrderDetails struct { rawJSON json.RawMessage } -func (c *ClientFacingOnSiteCollectionOrderDetails) GetData() *ClientFacingOnSiteCollectionOrder { +func (c *ClientFacingNoteChanged) GetEventType() ClientFacingNoteChangedEventType { + if c == nil { + return "" + } + return c.EventType +} + +func (c *ClientFacingNoteChanged) GetUserId() string { + if c == nil { + return "" + } + return c.UserId +} + +func (c *ClientFacingNoteChanged) GetClientUserId() string { + if c == nil { + return "" + } + return c.ClientUserId +} + +func (c *ClientFacingNoteChanged) GetTeamId() string { + if c == nil { + return "" + } + return c.TeamId +} + +func (c *ClientFacingNoteChanged) GetData() *GroupedNote { if c == nil { return nil } return c.Data } -func (c *ClientFacingOnSiteCollectionOrderDetails) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingNoteChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingOnSiteCollectionOrderDetails) require(field *big.Int) { +func (c *ClientFacingNoteChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } c.explicitFields.Or(c.explicitFields, field) } +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingNoteChanged) SetEventType(eventType ClientFacingNoteChangedEventType) { + c.EventType = eventType + c.require(clientFacingNoteChangedFieldEventType) +} + +// SetUserId sets the UserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingNoteChanged) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingNoteChangedFieldUserId) +} + +// SetClientUserId sets the ClientUserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingNoteChanged) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingNoteChangedFieldClientUserId) +} + +// SetTeamId sets the TeamId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingNoteChanged) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingNoteChangedFieldTeamId) +} + // SetData sets the Data field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOnSiteCollectionOrderDetails) SetData(data *ClientFacingOnSiteCollectionOrder) { +func (c *ClientFacingNoteChanged) SetData(data *GroupedNote) { c.Data = data - c.require(clientFacingOnSiteCollectionOrderDetailsFieldData) + c.require(clientFacingNoteChangedFieldData) } -func (c *ClientFacingOnSiteCollectionOrderDetails) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingOnSiteCollectionOrderDetails +func (c *ClientFacingNoteChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingNoteChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingOnSiteCollectionOrderDetails(value) + *c = ClientFacingNoteChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -14593,8 +14901,8 @@ func (c *ClientFacingOnSiteCollectionOrderDetails) UnmarshalJSON(data []byte) er return nil } -func (c *ClientFacingOnSiteCollectionOrderDetails) MarshalJSON() ([]byte, error) { - type embed ClientFacingOnSiteCollectionOrderDetails +func (c *ClientFacingNoteChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingNoteChanged var marshaler = struct { embed }{ @@ -14604,7 +14912,7 @@ func (c *ClientFacingOnSiteCollectionOrderDetails) MarshalJSON() ([]byte, error) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingOnSiteCollectionOrderDetails) String() string { +func (c *ClientFacingNoteChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -14616,483 +14924,246 @@ func (c *ClientFacingOnSiteCollectionOrderDetails) String() string { return fmt.Sprintf("%#v", c) } +type ClientFacingNoteChangedEventType string + +const ( + ClientFacingNoteChangedEventTypeDailyDataNoteCreated ClientFacingNoteChangedEventType = "daily.data.note.created" + ClientFacingNoteChangedEventTypeDailyDataNoteUpdated ClientFacingNoteChangedEventType = "daily.data.note.updated" +) + +func NewClientFacingNoteChangedEventTypeFromString(s string) (ClientFacingNoteChangedEventType, error) { + switch s { + case "daily.data.note.created": + return ClientFacingNoteChangedEventTypeDailyDataNoteCreated, nil + case "daily.data.note.updated": + return ClientFacingNoteChangedEventTypeDailyDataNoteUpdated, nil + } + var t ClientFacingNoteChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingNoteChangedEventType) Ptr() *ClientFacingNoteChangedEventType { + return &c +} + var ( - clientFacingOrderFieldUserId = big.NewInt(1 << 0) - clientFacingOrderFieldId = big.NewInt(1 << 1) - clientFacingOrderFieldTeamId = big.NewInt(1 << 2) - clientFacingOrderFieldPatientDetails = big.NewInt(1 << 3) - clientFacingOrderFieldPatientAddress = big.NewInt(1 << 4) - clientFacingOrderFieldLabTest = big.NewInt(1 << 5) - clientFacingOrderFieldDetails = big.NewInt(1 << 6) - clientFacingOrderFieldSampleId = big.NewInt(1 << 7) - clientFacingOrderFieldNotes = big.NewInt(1 << 8) - clientFacingOrderFieldCreatedAt = big.NewInt(1 << 9) - clientFacingOrderFieldUpdatedAt = big.NewInt(1 << 10) - clientFacingOrderFieldEvents = big.NewInt(1 << 11) - clientFacingOrderFieldStatus = big.NewInt(1 << 12) - clientFacingOrderFieldPhysician = big.NewInt(1 << 13) - clientFacingOrderFieldHealthInsuranceId = big.NewInt(1 << 14) - clientFacingOrderFieldRequisitionFormUrl = big.NewInt(1 << 15) - clientFacingOrderFieldPriority = big.NewInt(1 << 16) - clientFacingOrderFieldShippingDetails = big.NewInt(1 << 17) - clientFacingOrderFieldActivateBy = big.NewInt(1 << 18) - clientFacingOrderFieldPassthrough = big.NewInt(1 << 19) - clientFacingOrderFieldBillingType = big.NewInt(1 << 20) - clientFacingOrderFieldIcdCodes = big.NewInt(1 << 21) - clientFacingOrderFieldHasAbn = big.NewInt(1 << 22) - clientFacingOrderFieldInterpretation = big.NewInt(1 << 23) - clientFacingOrderFieldHasMissingResults = big.NewInt(1 << 24) - clientFacingOrderFieldExpectedResultByDate = big.NewInt(1 << 25) - clientFacingOrderFieldWorstCaseResultByDate = big.NewInt(1 << 26) + clientFacingNoteHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingNoteHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingNoteHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingNoteHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingOrder struct { - // User id returned by vital create user request. This id should be stored in your database against the user and used for all interactions with the vital api. - UserId string `json:"user_id" url:"user_id"` - // The Vital Order ID - Id string `json:"id" url:"id"` - // Your team id. - TeamId string `json:"team_id" url:"team_id"` - // Patient Details - PatientDetails *ClientFacingPatientDetailsCompatible `json:"patient_details,omitempty" url:"patient_details,omitempty"` - // Patient Address - PatientAddress *PatientAddressCompatible `json:"patient_address,omitempty" url:"patient_address,omitempty"` - // The Vital Test associated with the order - LabTest *ClientFacingLabTest `json:"lab_test" url:"lab_test"` - Details *ClientFacingOrderDetails `json:"details" url:"details"` - // Sample ID - SampleId *string `json:"sample_id,omitempty" url:"sample_id,omitempty"` - // Notes associated with the order - Notes *string `json:"notes,omitempty" url:"notes,omitempty"` - // When your order was created - CreatedAt time.Time `json:"created_at" url:"created_at"` - // When your order was last updated. - UpdatedAt time.Time `json:"updated_at" url:"updated_at"` - Events []*ClientFacingOrderEvent `json:"events" url:"events"` - Status *OrderTopLevelStatus `json:"status,omitempty" url:"status,omitempty"` - Physician *ClientFacingPhysician `json:"physician,omitempty" url:"physician,omitempty"` - // Vital ID of the health insurance. - HealthInsuranceId *string `json:"health_insurance_id,omitempty" url:"health_insurance_id,omitempty"` - // DEPRECATED. Requistion form url. - RequisitionFormUrl *string `json:"requisition_form_url,omitempty" url:"requisition_form_url,omitempty"` - // Defines whether order is priority or not. For some labs, this refers to a STAT order. - Priority *bool `json:"priority,omitempty" url:"priority,omitempty"` - // Shipping Details. For unregistered testkit orders. - ShippingDetails *ShippingAddress `json:"shipping_details,omitempty" url:"shipping_details,omitempty"` - // Schedule an Order to be processed in a future date. - ActivateBy *string `json:"activate_by,omitempty" url:"activate_by,omitempty"` - Passthrough *string `json:"passthrough,omitempty" url:"passthrough,omitempty"` - BillingType *Billing `json:"billing_type,omitempty" url:"billing_type,omitempty"` - IcdCodes []string `json:"icd_codes,omitempty" url:"icd_codes,omitempty"` - // Defines whether the order has an Advanced Beneficiary Notice (ABN) form or not. - HasAbn bool `json:"has_abn" url:"has_abn"` - // Interpretation of the order result. Can be one of (normal, abnormal, critical). - Interpretation *Interpretation `json:"interpretation,omitempty" url:"interpretation,omitempty"` - // Defines whether the order result has missing biomarkers. - HasMissingResults *bool `json:"has_missing_results,omitempty" url:"has_missing_results,omitempty"` - // The common-case date by which the order result is expected to be available. - ExpectedResultByDate *string `json:"expected_result_by_date,omitempty" url:"expected_result_by_date,omitempty"` - // The latest date by which the order result is expected to be available. - WorstCaseResultByDate *string `json:"worst_case_result_by_date,omitempty" url:"worst_case_result_by_date,omitempty"` +type ClientFacingNoteHistoricalPullCompleted struct { + UserId string `json:"user_id" url:"user_id"` + ClientUserId string `json:"client_user_id" url:"client_user_id"` + TeamId string `json:"team_id" url:"team_id"` + Data *HistoricalPullCompleted `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` + eventType string extraProperties map[string]interface{} rawJSON json.RawMessage } -func (c *ClientFacingOrder) GetUserId() string { +func (c *ClientFacingNoteHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingOrder) GetId() string { +func (c *ClientFacingNoteHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } - return c.Id + return c.ClientUserId } -func (c *ClientFacingOrder) GetTeamId() string { +func (c *ClientFacingNoteHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingOrder) GetPatientDetails() *ClientFacingPatientDetailsCompatible { +func (c *ClientFacingNoteHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } - return c.PatientDetails + return c.Data } -func (c *ClientFacingOrder) GetPatientAddress() *PatientAddressCompatible { - if c == nil { - return nil - } - return c.PatientAddress +func (c *ClientFacingNoteHistoricalPullCompleted) EventType() string { + return c.eventType } -func (c *ClientFacingOrder) GetLabTest() *ClientFacingLabTest { - if c == nil { - return nil - } - return c.LabTest +func (c *ClientFacingNoteHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { + return c.extraProperties } -func (c *ClientFacingOrder) GetDetails() *ClientFacingOrderDetails { - if c == nil { - return nil +func (c *ClientFacingNoteHistoricalPullCompleted) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) } - return c.Details + c.explicitFields.Or(c.explicitFields, field) } -func (c *ClientFacingOrder) GetSampleId() *string { - if c == nil { - return nil - } - return c.SampleId +// SetUserId sets the UserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingNoteHistoricalPullCompleted) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingNoteHistoricalPullCompletedFieldUserId) } -func (c *ClientFacingOrder) GetNotes() *string { - if c == nil { - return nil - } - return c.Notes +// SetClientUserId sets the ClientUserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingNoteHistoricalPullCompleted) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingNoteHistoricalPullCompletedFieldClientUserId) } -func (c *ClientFacingOrder) GetCreatedAt() time.Time { - if c == nil { - return time.Time{} - } - return c.CreatedAt +// SetTeamId sets the TeamId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingNoteHistoricalPullCompleted) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingNoteHistoricalPullCompletedFieldTeamId) } -func (c *ClientFacingOrder) GetUpdatedAt() time.Time { - if c == nil { - return time.Time{} - } - return c.UpdatedAt +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingNoteHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { + c.Data = data + c.require(clientFacingNoteHistoricalPullCompletedFieldData) } -func (c *ClientFacingOrder) GetEvents() []*ClientFacingOrderEvent { - if c == nil { - return nil +func (c *ClientFacingNoteHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingNoteHistoricalPullCompleted + var unmarshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), } - return c.Events -} - -func (c *ClientFacingOrder) GetStatus() *OrderTopLevelStatus { - if c == nil { - return nil + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err } - return c.Status -} - -func (c *ClientFacingOrder) GetPhysician() *ClientFacingPhysician { - if c == nil { - return nil + *c = ClientFacingNoteHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.note.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.note.created", unmarshaler.EventType) } - return c.Physician -} - -func (c *ClientFacingOrder) GetHealthInsuranceId() *string { - if c == nil { - return nil + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + if err != nil { + return err } - return c.HealthInsuranceId + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil } -func (c *ClientFacingOrder) GetRequisitionFormUrl() *string { - if c == nil { - return nil +func (c *ClientFacingNoteHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingNoteHistoricalPullCompleted + var marshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + EventType: "historical.data.note.created", } - return c.RequisitionFormUrl + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } -func (c *ClientFacingOrder) GetPriority() *bool { - if c == nil { - return nil +func (c *ClientFacingNoteHistoricalPullCompleted) String() string { + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } } - return c.Priority -} - -func (c *ClientFacingOrder) GetShippingDetails() *ShippingAddress { - if c == nil { - return nil + if value, err := internal.StringifyJSON(c); err == nil { + return value } - return c.ShippingDetails + return fmt.Sprintf("%#v", c) } -func (c *ClientFacingOrder) GetActivateBy() *string { - if c == nil { - return nil - } - return c.ActivateBy -} +// Schema for an on-site collection order in the client facing API. +// To be used as part of a ClientFacingOrder. +var ( + clientFacingOnSiteCollectionOrderFieldId = big.NewInt(1 << 0) + clientFacingOnSiteCollectionOrderFieldCreatedAt = big.NewInt(1 << 1) + clientFacingOnSiteCollectionOrderFieldUpdatedAt = big.NewInt(1 << 2) +) -func (c *ClientFacingOrder) GetPassthrough() *string { - if c == nil { - return nil - } - return c.Passthrough +type ClientFacingOnSiteCollectionOrder struct { + // The Junction on-site collection Order ID + Id string `json:"id" url:"id"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + UpdatedAt time.Time `json:"updated_at" url:"updated_at"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage } -func (c *ClientFacingOrder) GetBillingType() *Billing { +func (c *ClientFacingOnSiteCollectionOrder) GetId() string { if c == nil { - return nil + return "" } - return c.BillingType + return c.Id } -func (c *ClientFacingOrder) GetIcdCodes() []string { +func (c *ClientFacingOnSiteCollectionOrder) GetCreatedAt() time.Time { if c == nil { - return nil + return time.Time{} } - return c.IcdCodes + return c.CreatedAt } -func (c *ClientFacingOrder) GetHasAbn() bool { +func (c *ClientFacingOnSiteCollectionOrder) GetUpdatedAt() time.Time { if c == nil { - return false + return time.Time{} } - return c.HasAbn + return c.UpdatedAt } -func (c *ClientFacingOrder) GetInterpretation() *Interpretation { - if c == nil { - return nil - } - return c.Interpretation +func (c *ClientFacingOnSiteCollectionOrder) GetExtraProperties() map[string]interface{} { + return c.extraProperties } -func (c *ClientFacingOrder) GetHasMissingResults() *bool { - if c == nil { - return nil +func (c *ClientFacingOnSiteCollectionOrder) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) } - return c.HasMissingResults -} - -func (c *ClientFacingOrder) GetExpectedResultByDate() *string { - if c == nil { - return nil - } - return c.ExpectedResultByDate -} - -func (c *ClientFacingOrder) GetWorstCaseResultByDate() *string { - if c == nil { - return nil - } - return c.WorstCaseResultByDate -} - -func (c *ClientFacingOrder) GetExtraProperties() map[string]interface{} { - return c.extraProperties -} - -func (c *ClientFacingOrder) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) - } - c.explicitFields.Or(c.explicitFields, field) -} - -// SetUserId sets the UserId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingOrderFieldUserId) + c.explicitFields.Or(c.explicitFields, field) } // SetId sets the Id field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetId(id string) { +func (c *ClientFacingOnSiteCollectionOrder) SetId(id string) { c.Id = id - c.require(clientFacingOrderFieldId) -} - -// SetTeamId sets the TeamId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingOrderFieldTeamId) -} - -// SetPatientDetails sets the PatientDetails field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetPatientDetails(patientDetails *ClientFacingPatientDetailsCompatible) { - c.PatientDetails = patientDetails - c.require(clientFacingOrderFieldPatientDetails) -} - -// SetPatientAddress sets the PatientAddress field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetPatientAddress(patientAddress *PatientAddressCompatible) { - c.PatientAddress = patientAddress - c.require(clientFacingOrderFieldPatientAddress) -} - -// SetLabTest sets the LabTest field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetLabTest(labTest *ClientFacingLabTest) { - c.LabTest = labTest - c.require(clientFacingOrderFieldLabTest) -} - -// SetDetails sets the Details field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetDetails(details *ClientFacingOrderDetails) { - c.Details = details - c.require(clientFacingOrderFieldDetails) -} - -// SetSampleId sets the SampleId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetSampleId(sampleId *string) { - c.SampleId = sampleId - c.require(clientFacingOrderFieldSampleId) -} - -// SetNotes sets the Notes field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetNotes(notes *string) { - c.Notes = notes - c.require(clientFacingOrderFieldNotes) + c.require(clientFacingOnSiteCollectionOrderFieldId) } // SetCreatedAt sets the CreatedAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetCreatedAt(createdAt time.Time) { +func (c *ClientFacingOnSiteCollectionOrder) SetCreatedAt(createdAt time.Time) { c.CreatedAt = createdAt - c.require(clientFacingOrderFieldCreatedAt) + c.require(clientFacingOnSiteCollectionOrderFieldCreatedAt) } // SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetUpdatedAt(updatedAt time.Time) { +func (c *ClientFacingOnSiteCollectionOrder) SetUpdatedAt(updatedAt time.Time) { c.UpdatedAt = updatedAt - c.require(clientFacingOrderFieldUpdatedAt) -} - -// SetEvents sets the Events field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetEvents(events []*ClientFacingOrderEvent) { - c.Events = events - c.require(clientFacingOrderFieldEvents) -} - -// SetStatus sets the Status field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetStatus(status *OrderTopLevelStatus) { - c.Status = status - c.require(clientFacingOrderFieldStatus) -} - -// SetPhysician sets the Physician field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetPhysician(physician *ClientFacingPhysician) { - c.Physician = physician - c.require(clientFacingOrderFieldPhysician) -} - -// SetHealthInsuranceId sets the HealthInsuranceId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetHealthInsuranceId(healthInsuranceId *string) { - c.HealthInsuranceId = healthInsuranceId - c.require(clientFacingOrderFieldHealthInsuranceId) -} - -// SetRequisitionFormUrl sets the RequisitionFormUrl field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetRequisitionFormUrl(requisitionFormUrl *string) { - c.RequisitionFormUrl = requisitionFormUrl - c.require(clientFacingOrderFieldRequisitionFormUrl) -} - -// SetPriority sets the Priority field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetPriority(priority *bool) { - c.Priority = priority - c.require(clientFacingOrderFieldPriority) -} - -// SetShippingDetails sets the ShippingDetails field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetShippingDetails(shippingDetails *ShippingAddress) { - c.ShippingDetails = shippingDetails - c.require(clientFacingOrderFieldShippingDetails) -} - -// SetActivateBy sets the ActivateBy field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetActivateBy(activateBy *string) { - c.ActivateBy = activateBy - c.require(clientFacingOrderFieldActivateBy) -} - -// SetPassthrough sets the Passthrough field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetPassthrough(passthrough *string) { - c.Passthrough = passthrough - c.require(clientFacingOrderFieldPassthrough) -} - -// SetBillingType sets the BillingType field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetBillingType(billingType *Billing) { - c.BillingType = billingType - c.require(clientFacingOrderFieldBillingType) -} - -// SetIcdCodes sets the IcdCodes field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetIcdCodes(icdCodes []string) { - c.IcdCodes = icdCodes - c.require(clientFacingOrderFieldIcdCodes) -} - -// SetHasAbn sets the HasAbn field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetHasAbn(hasAbn bool) { - c.HasAbn = hasAbn - c.require(clientFacingOrderFieldHasAbn) -} - -// SetInterpretation sets the Interpretation field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetInterpretation(interpretation *Interpretation) { - c.Interpretation = interpretation - c.require(clientFacingOrderFieldInterpretation) -} - -// SetHasMissingResults sets the HasMissingResults field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetHasMissingResults(hasMissingResults *bool) { - c.HasMissingResults = hasMissingResults - c.require(clientFacingOrderFieldHasMissingResults) -} - -// SetExpectedResultByDate sets the ExpectedResultByDate field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetExpectedResultByDate(expectedResultByDate *string) { - c.ExpectedResultByDate = expectedResultByDate - c.require(clientFacingOrderFieldExpectedResultByDate) -} - -// SetWorstCaseResultByDate sets the WorstCaseResultByDate field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrder) SetWorstCaseResultByDate(worstCaseResultByDate *string) { - c.WorstCaseResultByDate = worstCaseResultByDate - c.require(clientFacingOrderFieldWorstCaseResultByDate) + c.require(clientFacingOnSiteCollectionOrderFieldUpdatedAt) } -func (c *ClientFacingOrder) UnmarshalJSON(data []byte) error { - type embed ClientFacingOrder +func (c *ClientFacingOnSiteCollectionOrder) UnmarshalJSON(data []byte) error { + type embed ClientFacingOnSiteCollectionOrder var unmarshaler = struct { embed CreatedAt *internal.DateTime `json:"created_at"` @@ -15103,7 +15174,7 @@ func (c *ClientFacingOrder) UnmarshalJSON(data []byte) error { if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingOrder(unmarshaler.embed) + *c = ClientFacingOnSiteCollectionOrder(unmarshaler.embed) c.CreatedAt = unmarshaler.CreatedAt.Time() c.UpdatedAt = unmarshaler.UpdatedAt.Time() extraProperties, err := internal.ExtractExtraProperties(data, *c) @@ -15115,8 +15186,8 @@ func (c *ClientFacingOrder) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingOrder) MarshalJSON() ([]byte, error) { - type embed ClientFacingOrder +func (c *ClientFacingOnSiteCollectionOrder) MarshalJSON() ([]byte, error) { + type embed ClientFacingOnSiteCollectionOrder var marshaler = struct { embed CreatedAt *internal.DateTime `json:"created_at"` @@ -15126,36 +15197,1013 @@ func (c *ClientFacingOrder) MarshalJSON() ([]byte, error) { CreatedAt: internal.NewDateTime(c.CreatedAt), UpdatedAt: internal.NewDateTime(c.UpdatedAt), } - explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (c *ClientFacingOrder) String() string { - if len(c.rawJSON) > 0 { - if value, err := internal.StringifyJSON(c.rawJSON); err == nil { - return value + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingOnSiteCollectionOrder) String() string { + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +var ( + clientFacingOnSiteCollectionOrderDetailsFieldData = big.NewInt(1 << 0) +) + +type ClientFacingOnSiteCollectionOrderDetails struct { + Data *ClientFacingOnSiteCollectionOrder `json:"data,omitempty" url:"data,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *ClientFacingOnSiteCollectionOrderDetails) GetData() *ClientFacingOnSiteCollectionOrder { + if c == nil { + return nil + } + return c.Data +} + +func (c *ClientFacingOnSiteCollectionOrderDetails) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingOnSiteCollectionOrderDetails) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOnSiteCollectionOrderDetails) SetData(data *ClientFacingOnSiteCollectionOrder) { + c.Data = data + c.require(clientFacingOnSiteCollectionOrderDetailsFieldData) +} + +func (c *ClientFacingOnSiteCollectionOrderDetails) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingOnSiteCollectionOrderDetails + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ClientFacingOnSiteCollectionOrderDetails(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingOnSiteCollectionOrderDetails) MarshalJSON() ([]byte, error) { + type embed ClientFacingOnSiteCollectionOrderDetails + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingOnSiteCollectionOrderDetails) String() string { + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +var ( + clientFacingOrderFieldUserId = big.NewInt(1 << 0) + clientFacingOrderFieldId = big.NewInt(1 << 1) + clientFacingOrderFieldTeamId = big.NewInt(1 << 2) + clientFacingOrderFieldPatientDetails = big.NewInt(1 << 3) + clientFacingOrderFieldPatientAddress = big.NewInt(1 << 4) + clientFacingOrderFieldLabTest = big.NewInt(1 << 5) + clientFacingOrderFieldDetails = big.NewInt(1 << 6) + clientFacingOrderFieldSampleId = big.NewInt(1 << 7) + clientFacingOrderFieldNotes = big.NewInt(1 << 8) + clientFacingOrderFieldClinicalNotes = big.NewInt(1 << 9) + clientFacingOrderFieldCreatedAt = big.NewInt(1 << 10) + clientFacingOrderFieldUpdatedAt = big.NewInt(1 << 11) + clientFacingOrderFieldEvents = big.NewInt(1 << 12) + clientFacingOrderFieldStatus = big.NewInt(1 << 13) + clientFacingOrderFieldPhysician = big.NewInt(1 << 14) + clientFacingOrderFieldHealthInsuranceId = big.NewInt(1 << 15) + clientFacingOrderFieldRequisitionFormUrl = big.NewInt(1 << 16) + clientFacingOrderFieldPriority = big.NewInt(1 << 17) + clientFacingOrderFieldShippingDetails = big.NewInt(1 << 18) + clientFacingOrderFieldActivateBy = big.NewInt(1 << 19) + clientFacingOrderFieldPassthrough = big.NewInt(1 << 20) + clientFacingOrderFieldBillingType = big.NewInt(1 << 21) + clientFacingOrderFieldIcdCodes = big.NewInt(1 << 22) + clientFacingOrderFieldHasAbn = big.NewInt(1 << 23) + clientFacingOrderFieldInterpretation = big.NewInt(1 << 24) + clientFacingOrderFieldHasMissingResults = big.NewInt(1 << 25) + clientFacingOrderFieldExpectedResultByDate = big.NewInt(1 << 26) + clientFacingOrderFieldWorstCaseResultByDate = big.NewInt(1 << 27) + clientFacingOrderFieldOrigin = big.NewInt(1 << 28) + clientFacingOrderFieldOrderTransaction = big.NewInt(1 << 29) +) + +type ClientFacingOrder struct { + // User id returned by vital create user request. This id should be stored in your database against the user and used for all interactions with the vital api. + UserId string `json:"user_id" url:"user_id"` + // The Vital Order ID + Id string `json:"id" url:"id"` + // Your team id. + TeamId string `json:"team_id" url:"team_id"` + // Patient Details + PatientDetails *ClientFacingPatientDetailsCompatible `json:"patient_details,omitempty" url:"patient_details,omitempty"` + // Patient Address + PatientAddress *PatientAddressCompatible `json:"patient_address,omitempty" url:"patient_address,omitempty"` + // The Vital Test associated with the order + LabTest *ClientFacingLabTest `json:"lab_test" url:"lab_test"` + Details *ClientFacingOrderDetails `json:"details" url:"details"` + // Sample ID + SampleId *string `json:"sample_id,omitempty" url:"sample_id,omitempty"` + // Notes associated with the order + Notes *string `json:"notes,omitempty" url:"notes,omitempty"` + ClinicalNotes *string `json:"clinical_notes,omitempty" url:"clinical_notes,omitempty"` + // When your order was created + CreatedAt time.Time `json:"created_at" url:"created_at"` + // When your order was last updated. + UpdatedAt time.Time `json:"updated_at" url:"updated_at"` + Events []*ClientFacingOrderEvent `json:"events" url:"events"` + Status *OrderTopLevelStatus `json:"status,omitempty" url:"status,omitempty"` + Physician *ClientFacingPhysician `json:"physician,omitempty" url:"physician,omitempty"` + // Vital ID of the health insurance. + HealthInsuranceId *string `json:"health_insurance_id,omitempty" url:"health_insurance_id,omitempty"` + // DEPRECATED. Requistion form url. + RequisitionFormUrl *string `json:"requisition_form_url,omitempty" url:"requisition_form_url,omitempty"` + // Defines whether order is priority or not. For some labs, this refers to a STAT order. + Priority *bool `json:"priority,omitempty" url:"priority,omitempty"` + // Shipping Details. For unregistered testkit orders. + ShippingDetails *ShippingAddress `json:"shipping_details,omitempty" url:"shipping_details,omitempty"` + // Schedule an Order to be processed in a future date. + ActivateBy *string `json:"activate_by,omitempty" url:"activate_by,omitempty"` + Passthrough *string `json:"passthrough,omitempty" url:"passthrough,omitempty"` + BillingType *Billing `json:"billing_type,omitempty" url:"billing_type,omitempty"` + IcdCodes []string `json:"icd_codes,omitempty" url:"icd_codes,omitempty"` + // Defines whether the order has an Advanced Beneficiary Notice (ABN) form or not. + HasAbn bool `json:"has_abn" url:"has_abn"` + // Interpretation of the order result. Can be one of (normal, abnormal, critical). + Interpretation *Interpretation `json:"interpretation,omitempty" url:"interpretation,omitempty"` + // Defines whether the order result has missing biomarkers. + HasMissingResults *bool `json:"has_missing_results,omitempty" url:"has_missing_results,omitempty"` + // The common-case date by which the order result is expected to be available. + ExpectedResultByDate *string `json:"expected_result_by_date,omitempty" url:"expected_result_by_date,omitempty"` + // The latest date by which the order result is expected to be available. + WorstCaseResultByDate *string `json:"worst_case_result_by_date,omitempty" url:"worst_case_result_by_date,omitempty"` + Origin *OrderOrigin `json:"origin,omitempty" url:"origin,omitempty"` + OrderTransaction *ClientFacingOrderTransaction `json:"order_transaction,omitempty" url:"order_transaction,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *ClientFacingOrder) GetUserId() string { + if c == nil { + return "" + } + return c.UserId +} + +func (c *ClientFacingOrder) GetId() string { + if c == nil { + return "" + } + return c.Id +} + +func (c *ClientFacingOrder) GetTeamId() string { + if c == nil { + return "" + } + return c.TeamId +} + +func (c *ClientFacingOrder) GetPatientDetails() *ClientFacingPatientDetailsCompatible { + if c == nil { + return nil + } + return c.PatientDetails +} + +func (c *ClientFacingOrder) GetPatientAddress() *PatientAddressCompatible { + if c == nil { + return nil + } + return c.PatientAddress +} + +func (c *ClientFacingOrder) GetLabTest() *ClientFacingLabTest { + if c == nil { + return nil + } + return c.LabTest +} + +func (c *ClientFacingOrder) GetDetails() *ClientFacingOrderDetails { + if c == nil { + return nil + } + return c.Details +} + +func (c *ClientFacingOrder) GetSampleId() *string { + if c == nil { + return nil + } + return c.SampleId +} + +func (c *ClientFacingOrder) GetNotes() *string { + if c == nil { + return nil + } + return c.Notes +} + +func (c *ClientFacingOrder) GetClinicalNotes() *string { + if c == nil { + return nil + } + return c.ClinicalNotes +} + +func (c *ClientFacingOrder) GetCreatedAt() time.Time { + if c == nil { + return time.Time{} + } + return c.CreatedAt +} + +func (c *ClientFacingOrder) GetUpdatedAt() time.Time { + if c == nil { + return time.Time{} + } + return c.UpdatedAt +} + +func (c *ClientFacingOrder) GetEvents() []*ClientFacingOrderEvent { + if c == nil { + return nil + } + return c.Events +} + +func (c *ClientFacingOrder) GetStatus() *OrderTopLevelStatus { + if c == nil { + return nil + } + return c.Status +} + +func (c *ClientFacingOrder) GetPhysician() *ClientFacingPhysician { + if c == nil { + return nil + } + return c.Physician +} + +func (c *ClientFacingOrder) GetHealthInsuranceId() *string { + if c == nil { + return nil + } + return c.HealthInsuranceId +} + +func (c *ClientFacingOrder) GetRequisitionFormUrl() *string { + if c == nil { + return nil + } + return c.RequisitionFormUrl +} + +func (c *ClientFacingOrder) GetPriority() *bool { + if c == nil { + return nil + } + return c.Priority +} + +func (c *ClientFacingOrder) GetShippingDetails() *ShippingAddress { + if c == nil { + return nil + } + return c.ShippingDetails +} + +func (c *ClientFacingOrder) GetActivateBy() *string { + if c == nil { + return nil + } + return c.ActivateBy +} + +func (c *ClientFacingOrder) GetPassthrough() *string { + if c == nil { + return nil + } + return c.Passthrough +} + +func (c *ClientFacingOrder) GetBillingType() *Billing { + if c == nil { + return nil + } + return c.BillingType +} + +func (c *ClientFacingOrder) GetIcdCodes() []string { + if c == nil { + return nil + } + return c.IcdCodes +} + +func (c *ClientFacingOrder) GetHasAbn() bool { + if c == nil { + return false + } + return c.HasAbn +} + +func (c *ClientFacingOrder) GetInterpretation() *Interpretation { + if c == nil { + return nil + } + return c.Interpretation +} + +func (c *ClientFacingOrder) GetHasMissingResults() *bool { + if c == nil { + return nil + } + return c.HasMissingResults +} + +func (c *ClientFacingOrder) GetExpectedResultByDate() *string { + if c == nil { + return nil + } + return c.ExpectedResultByDate +} + +func (c *ClientFacingOrder) GetWorstCaseResultByDate() *string { + if c == nil { + return nil + } + return c.WorstCaseResultByDate +} + +func (c *ClientFacingOrder) GetOrigin() *OrderOrigin { + if c == nil { + return nil + } + return c.Origin +} + +func (c *ClientFacingOrder) GetOrderTransaction() *ClientFacingOrderTransaction { + if c == nil { + return nil + } + return c.OrderTransaction +} + +func (c *ClientFacingOrder) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingOrder) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetUserId sets the UserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingOrderFieldUserId) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetId(id string) { + c.Id = id + c.require(clientFacingOrderFieldId) +} + +// SetTeamId sets the TeamId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingOrderFieldTeamId) +} + +// SetPatientDetails sets the PatientDetails field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetPatientDetails(patientDetails *ClientFacingPatientDetailsCompatible) { + c.PatientDetails = patientDetails + c.require(clientFacingOrderFieldPatientDetails) +} + +// SetPatientAddress sets the PatientAddress field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetPatientAddress(patientAddress *PatientAddressCompatible) { + c.PatientAddress = patientAddress + c.require(clientFacingOrderFieldPatientAddress) +} + +// SetLabTest sets the LabTest field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetLabTest(labTest *ClientFacingLabTest) { + c.LabTest = labTest + c.require(clientFacingOrderFieldLabTest) +} + +// SetDetails sets the Details field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetDetails(details *ClientFacingOrderDetails) { + c.Details = details + c.require(clientFacingOrderFieldDetails) +} + +// SetSampleId sets the SampleId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetSampleId(sampleId *string) { + c.SampleId = sampleId + c.require(clientFacingOrderFieldSampleId) +} + +// SetNotes sets the Notes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetNotes(notes *string) { + c.Notes = notes + c.require(clientFacingOrderFieldNotes) +} + +// SetClinicalNotes sets the ClinicalNotes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetClinicalNotes(clinicalNotes *string) { + c.ClinicalNotes = clinicalNotes + c.require(clientFacingOrderFieldClinicalNotes) +} + +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetCreatedAt(createdAt time.Time) { + c.CreatedAt = createdAt + c.require(clientFacingOrderFieldCreatedAt) +} + +// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetUpdatedAt(updatedAt time.Time) { + c.UpdatedAt = updatedAt + c.require(clientFacingOrderFieldUpdatedAt) +} + +// SetEvents sets the Events field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetEvents(events []*ClientFacingOrderEvent) { + c.Events = events + c.require(clientFacingOrderFieldEvents) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetStatus(status *OrderTopLevelStatus) { + c.Status = status + c.require(clientFacingOrderFieldStatus) +} + +// SetPhysician sets the Physician field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetPhysician(physician *ClientFacingPhysician) { + c.Physician = physician + c.require(clientFacingOrderFieldPhysician) +} + +// SetHealthInsuranceId sets the HealthInsuranceId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetHealthInsuranceId(healthInsuranceId *string) { + c.HealthInsuranceId = healthInsuranceId + c.require(clientFacingOrderFieldHealthInsuranceId) +} + +// SetRequisitionFormUrl sets the RequisitionFormUrl field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetRequisitionFormUrl(requisitionFormUrl *string) { + c.RequisitionFormUrl = requisitionFormUrl + c.require(clientFacingOrderFieldRequisitionFormUrl) +} + +// SetPriority sets the Priority field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetPriority(priority *bool) { + c.Priority = priority + c.require(clientFacingOrderFieldPriority) +} + +// SetShippingDetails sets the ShippingDetails field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetShippingDetails(shippingDetails *ShippingAddress) { + c.ShippingDetails = shippingDetails + c.require(clientFacingOrderFieldShippingDetails) +} + +// SetActivateBy sets the ActivateBy field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetActivateBy(activateBy *string) { + c.ActivateBy = activateBy + c.require(clientFacingOrderFieldActivateBy) +} + +// SetPassthrough sets the Passthrough field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetPassthrough(passthrough *string) { + c.Passthrough = passthrough + c.require(clientFacingOrderFieldPassthrough) +} + +// SetBillingType sets the BillingType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetBillingType(billingType *Billing) { + c.BillingType = billingType + c.require(clientFacingOrderFieldBillingType) +} + +// SetIcdCodes sets the IcdCodes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetIcdCodes(icdCodes []string) { + c.IcdCodes = icdCodes + c.require(clientFacingOrderFieldIcdCodes) +} + +// SetHasAbn sets the HasAbn field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetHasAbn(hasAbn bool) { + c.HasAbn = hasAbn + c.require(clientFacingOrderFieldHasAbn) +} + +// SetInterpretation sets the Interpretation field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetInterpretation(interpretation *Interpretation) { + c.Interpretation = interpretation + c.require(clientFacingOrderFieldInterpretation) +} + +// SetHasMissingResults sets the HasMissingResults field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetHasMissingResults(hasMissingResults *bool) { + c.HasMissingResults = hasMissingResults + c.require(clientFacingOrderFieldHasMissingResults) +} + +// SetExpectedResultByDate sets the ExpectedResultByDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetExpectedResultByDate(expectedResultByDate *string) { + c.ExpectedResultByDate = expectedResultByDate + c.require(clientFacingOrderFieldExpectedResultByDate) +} + +// SetWorstCaseResultByDate sets the WorstCaseResultByDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetWorstCaseResultByDate(worstCaseResultByDate *string) { + c.WorstCaseResultByDate = worstCaseResultByDate + c.require(clientFacingOrderFieldWorstCaseResultByDate) +} + +// SetOrigin sets the Origin field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetOrigin(origin *OrderOrigin) { + c.Origin = origin + c.require(clientFacingOrderFieldOrigin) +} + +// SetOrderTransaction sets the OrderTransaction field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrder) SetOrderTransaction(orderTransaction *ClientFacingOrderTransaction) { + c.OrderTransaction = orderTransaction + c.require(clientFacingOrderFieldOrderTransaction) +} + +func (c *ClientFacingOrder) UnmarshalJSON(data []byte) error { + type embed ClientFacingOrder + var unmarshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at"` + UpdatedAt *internal.DateTime `json:"updated_at"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *c = ClientFacingOrder(unmarshaler.embed) + c.CreatedAt = unmarshaler.CreatedAt.Time() + c.UpdatedAt = unmarshaler.UpdatedAt.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingOrder) MarshalJSON() ([]byte, error) { + type embed ClientFacingOrder + var marshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at"` + UpdatedAt *internal.DateTime `json:"updated_at"` + }{ + embed: embed(*c), + CreatedAt: internal.NewDateTime(c.CreatedAt), + UpdatedAt: internal.NewDateTime(c.UpdatedAt), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingOrder) String() string { + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +var ( + clientFacingOrderChangedFieldEventType = big.NewInt(1 << 0) + clientFacingOrderChangedFieldUserId = big.NewInt(1 << 1) + clientFacingOrderChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingOrderChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingOrderChangedFieldData = big.NewInt(1 << 4) +) + +type ClientFacingOrderChanged struct { + EventType ClientFacingOrderChangedEventType `json:"event_type" url:"event_type"` + UserId string `json:"user_id" url:"user_id"` + ClientUserId string `json:"client_user_id" url:"client_user_id"` + TeamId string `json:"team_id" url:"team_id"` + Data *ClientFacingOrder `json:"data" url:"data"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *ClientFacingOrderChanged) GetEventType() ClientFacingOrderChangedEventType { + if c == nil { + return "" + } + return c.EventType +} + +func (c *ClientFacingOrderChanged) GetUserId() string { + if c == nil { + return "" + } + return c.UserId +} + +func (c *ClientFacingOrderChanged) GetClientUserId() string { + if c == nil { + return "" + } + return c.ClientUserId +} + +func (c *ClientFacingOrderChanged) GetTeamId() string { + if c == nil { + return "" + } + return c.TeamId +} + +func (c *ClientFacingOrderChanged) GetData() *ClientFacingOrder { + if c == nil { + return nil + } + return c.Data +} + +func (c *ClientFacingOrderChanged) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingOrderChanged) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetEventType sets the EventType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrderChanged) SetEventType(eventType ClientFacingOrderChangedEventType) { + c.EventType = eventType + c.require(clientFacingOrderChangedFieldEventType) +} + +// SetUserId sets the UserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrderChanged) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingOrderChangedFieldUserId) +} + +// SetClientUserId sets the ClientUserId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrderChanged) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingOrderChangedFieldClientUserId) +} + +// SetTeamId sets the TeamId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrderChanged) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingOrderChangedFieldTeamId) +} + +// SetData sets the Data field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrderChanged) SetData(data *ClientFacingOrder) { + c.Data = data + c.require(clientFacingOrderChangedFieldData) +} + +func (c *ClientFacingOrderChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingOrderChanged + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ClientFacingOrderChanged(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingOrderChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingOrderChanged + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingOrderChanged) String() string { + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +type ClientFacingOrderChangedEventType string + +const ( + ClientFacingOrderChangedEventTypeLabtestOrderCreated ClientFacingOrderChangedEventType = "labtest.order.created" + ClientFacingOrderChangedEventTypeLabtestOrderUpdated ClientFacingOrderChangedEventType = "labtest.order.updated" +) + +func NewClientFacingOrderChangedEventTypeFromString(s string) (ClientFacingOrderChangedEventType, error) { + switch s { + case "labtest.order.created": + return ClientFacingOrderChangedEventTypeLabtestOrderCreated, nil + case "labtest.order.updated": + return ClientFacingOrderChangedEventTypeLabtestOrderUpdated, nil + } + var t ClientFacingOrderChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingOrderChangedEventType) Ptr() *ClientFacingOrderChangedEventType { + return &c +} + +type ClientFacingOrderDetails struct { + Type string + WalkInTest *ClientFacingWalkInOrderDetails + Testkit *ClientFacingTestKitOrderDetails + AtHomePhlebotomy *ClientFacingAtHomePhlebotomyOrderDetails + OnSiteCollection *ClientFacingOnSiteCollectionOrderDetails +} + +func (c *ClientFacingOrderDetails) GetType() string { + if c == nil { + return "" + } + return c.Type +} + +func (c *ClientFacingOrderDetails) GetWalkInTest() *ClientFacingWalkInOrderDetails { + if c == nil { + return nil + } + return c.WalkInTest +} + +func (c *ClientFacingOrderDetails) GetTestkit() *ClientFacingTestKitOrderDetails { + if c == nil { + return nil + } + return c.Testkit +} + +func (c *ClientFacingOrderDetails) GetAtHomePhlebotomy() *ClientFacingAtHomePhlebotomyOrderDetails { + if c == nil { + return nil + } + return c.AtHomePhlebotomy +} + +func (c *ClientFacingOrderDetails) GetOnSiteCollection() *ClientFacingOnSiteCollectionOrderDetails { + if c == nil { + return nil + } + return c.OnSiteCollection +} + +func (c *ClientFacingOrderDetails) UnmarshalJSON(data []byte) error { + var unmarshaler struct { + Type string `json:"type"` + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + c.Type = unmarshaler.Type + if unmarshaler.Type == "" { + return fmt.Errorf("%T did not include discriminant type", c) + } + switch unmarshaler.Type { + case "walk_in_test": + value := new(ClientFacingWalkInOrderDetails) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + c.WalkInTest = value + case "testkit": + value := new(ClientFacingTestKitOrderDetails) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + c.Testkit = value + case "at_home_phlebotomy": + value := new(ClientFacingAtHomePhlebotomyOrderDetails) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + c.AtHomePhlebotomy = value + case "on_site_collection": + value := new(ClientFacingOnSiteCollectionOrderDetails) + if err := json.Unmarshal(data, &value); err != nil { + return err + } + c.OnSiteCollection = value + } + return nil +} + +func (c ClientFacingOrderDetails) MarshalJSON() ([]byte, error) { + if err := c.validate(); err != nil { + return nil, err + } + if c.WalkInTest != nil { + return internal.MarshalJSONWithExtraProperty(c.WalkInTest, "type", "walk_in_test") + } + if c.Testkit != nil { + return internal.MarshalJSONWithExtraProperty(c.Testkit, "type", "testkit") + } + if c.AtHomePhlebotomy != nil { + return internal.MarshalJSONWithExtraProperty(c.AtHomePhlebotomy, "type", "at_home_phlebotomy") + } + if c.OnSiteCollection != nil { + return internal.MarshalJSONWithExtraProperty(c.OnSiteCollection, "type", "on_site_collection") + } + return nil, fmt.Errorf("type %T does not define a non-empty union type", c) +} + +type ClientFacingOrderDetailsVisitor interface { + VisitWalkInTest(*ClientFacingWalkInOrderDetails) error + VisitTestkit(*ClientFacingTestKitOrderDetails) error + VisitAtHomePhlebotomy(*ClientFacingAtHomePhlebotomyOrderDetails) error + VisitOnSiteCollection(*ClientFacingOnSiteCollectionOrderDetails) error +} + +func (c *ClientFacingOrderDetails) Accept(visitor ClientFacingOrderDetailsVisitor) error { + if c.WalkInTest != nil { + return visitor.VisitWalkInTest(c.WalkInTest) + } + if c.Testkit != nil { + return visitor.VisitTestkit(c.Testkit) + } + if c.AtHomePhlebotomy != nil { + return visitor.VisitAtHomePhlebotomy(c.AtHomePhlebotomy) + } + if c.OnSiteCollection != nil { + return visitor.VisitOnSiteCollection(c.OnSiteCollection) + } + return fmt.Errorf("type %T does not define a non-empty union type", c) +} + +func (c *ClientFacingOrderDetails) validate() error { + if c == nil { + return fmt.Errorf("type %T is nil", c) + } + var fields []string + if c.WalkInTest != nil { + fields = append(fields, "walk_in_test") + } + if c.Testkit != nil { + fields = append(fields, "testkit") + } + if c.AtHomePhlebotomy != nil { + fields = append(fields, "at_home_phlebotomy") + } + if c.OnSiteCollection != nil { + fields = append(fields, "on_site_collection") + } + if len(fields) == 0 { + if c.Type != "" { + return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", c, c.Type) } + return fmt.Errorf("type %T is empty", c) } - if value, err := internal.StringifyJSON(c); err == nil { - return value + if len(fields) > 1 { + return fmt.Errorf("type %T defines values for %s, but only one value is allowed", c, fields) } - return fmt.Sprintf("%#v", c) + if c.Type != "" { + field := fields[0] + if c.Type != field { + return fmt.Errorf( + "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", + c, + c.Type, + c, + ) + } + } + return nil } var ( - clientFacingOrderChangedFieldEventType = big.NewInt(1 << 0) - clientFacingOrderChangedFieldUserId = big.NewInt(1 << 1) - clientFacingOrderChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingOrderChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingOrderChangedFieldData = big.NewInt(1 << 4) + clientFacingOrderEventFieldId = big.NewInt(1 << 0) + clientFacingOrderEventFieldCreatedAt = big.NewInt(1 << 1) + clientFacingOrderEventFieldStatus = big.NewInt(1 << 2) ) -type ClientFacingOrderChanged struct { - EventType ClientFacingOrderChangedEventType `json:"event_type" url:"event_type"` - UserId string `json:"user_id" url:"user_id"` - ClientUserId string `json:"client_user_id" url:"client_user_id"` - TeamId string `json:"team_id" url:"team_id"` - Data *ClientFacingOrder `json:"data" url:"data"` +type ClientFacingOrderEvent struct { + Id int `json:"id" url:"id"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + Status OrderStatus `json:"status" url:"status"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -15164,94 +16212,72 @@ type ClientFacingOrderChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingOrderChanged) GetEventType() ClientFacingOrderChangedEventType { - if c == nil { - return "" - } - return c.EventType -} - -func (c *ClientFacingOrderChanged) GetUserId() string { +func (c *ClientFacingOrderEvent) GetId() int { if c == nil { - return "" + return 0 } - return c.UserId + return c.Id } -func (c *ClientFacingOrderChanged) GetClientUserId() string { +func (c *ClientFacingOrderEvent) GetCreatedAt() time.Time { if c == nil { - return "" + return time.Time{} } - return c.ClientUserId + return c.CreatedAt } -func (c *ClientFacingOrderChanged) GetTeamId() string { +func (c *ClientFacingOrderEvent) GetStatus() OrderStatus { if c == nil { return "" } - return c.TeamId -} - -func (c *ClientFacingOrderChanged) GetData() *ClientFacingOrder { - if c == nil { - return nil - } - return c.Data + return c.Status } -func (c *ClientFacingOrderChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingOrderEvent) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingOrderChanged) require(field *big.Int) { +func (c *ClientFacingOrderEvent) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } c.explicitFields.Or(c.explicitFields, field) } -// SetEventType sets the EventType field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrderChanged) SetEventType(eventType ClientFacingOrderChangedEventType) { - c.EventType = eventType - c.require(clientFacingOrderChangedFieldEventType) -} - -// SetUserId sets the UserId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrderChanged) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingOrderChangedFieldUserId) -} - -// SetClientUserId sets the ClientUserId field and marks it as non-optional; +// SetId sets the Id field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrderChanged) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingOrderChangedFieldClientUserId) +func (c *ClientFacingOrderEvent) SetId(id int) { + c.Id = id + c.require(clientFacingOrderEventFieldId) } -// SetTeamId sets the TeamId field and marks it as non-optional; +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrderChanged) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingOrderChangedFieldTeamId) +func (c *ClientFacingOrderEvent) SetCreatedAt(createdAt time.Time) { + c.CreatedAt = createdAt + c.require(clientFacingOrderEventFieldCreatedAt) } -// SetData sets the Data field and marks it as non-optional; +// SetStatus sets the Status field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrderChanged) SetData(data *ClientFacingOrder) { - c.Data = data - c.require(clientFacingOrderChangedFieldData) +func (c *ClientFacingOrderEvent) SetStatus(status OrderStatus) { + c.Status = status + c.require(clientFacingOrderEventFieldStatus) } -func (c *ClientFacingOrderChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingOrderChanged - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (c *ClientFacingOrderEvent) UnmarshalJSON(data []byte) error { + type embed ClientFacingOrderEvent + var unmarshaler = struct { + embed + CreatedAt *internal.DateTime `json:"created_at"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingOrderChanged(value) + *c = ClientFacingOrderEvent(unmarshaler.embed) + c.CreatedAt = unmarshaler.CreatedAt.Time() extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -15261,18 +16287,20 @@ func (c *ClientFacingOrderChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingOrderChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingOrderChanged +func (c *ClientFacingOrderEvent) MarshalJSON() ([]byte, error) { + type embed ClientFacingOrderEvent var marshaler = struct { embed + CreatedAt *internal.DateTime `json:"created_at"` }{ - embed: embed(*c), + embed: embed(*c), + CreatedAt: internal.NewDateTime(c.CreatedAt), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingOrderChanged) String() string { +func (c *ClientFacingOrderEvent) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -15284,203 +16312,208 @@ func (c *ClientFacingOrderChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingOrderChangedEventType string - -const ( - ClientFacingOrderChangedEventTypeLabtestOrderCreated ClientFacingOrderChangedEventType = "labtest.order.created" - ClientFacingOrderChangedEventTypeLabtestOrderUpdated ClientFacingOrderChangedEventType = "labtest.order.updated" -) - -func NewClientFacingOrderChangedEventTypeFromString(s string) (ClientFacingOrderChangedEventType, error) { - switch s { - case "labtest.order.created": - return ClientFacingOrderChangedEventTypeLabtestOrderCreated, nil - case "labtest.order.updated": - return ClientFacingOrderChangedEventTypeLabtestOrderUpdated, nil - } - var t ClientFacingOrderChangedEventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} +// Minimal order info for embedding in order_transaction payload. +var ( + clientFacingOrderInTransactionFieldId = big.NewInt(1 << 0) + clientFacingOrderInTransactionFieldLowLevelStatus = big.NewInt(1 << 1) + clientFacingOrderInTransactionFieldLowLevelStatusCreatedAt = big.NewInt(1 << 2) + clientFacingOrderInTransactionFieldOrigin = big.NewInt(1 << 3) + clientFacingOrderInTransactionFieldParentId = big.NewInt(1 << 4) + clientFacingOrderInTransactionFieldCreatedAt = big.NewInt(1 << 5) + clientFacingOrderInTransactionFieldUpdatedAt = big.NewInt(1 << 6) +) + +type ClientFacingOrderInTransaction struct { + Id string `json:"id" url:"id"` + LowLevelStatus *OrderLowLevelStatus `json:"low_level_status,omitempty" url:"low_level_status,omitempty"` + LowLevelStatusCreatedAt *time.Time `json:"low_level_status_created_at,omitempty" url:"low_level_status_created_at,omitempty"` + Origin *OrderOrigin `json:"origin,omitempty" url:"origin,omitempty"` + ParentId *string `json:"parent_id,omitempty" url:"parent_id,omitempty"` + CreatedAt time.Time `json:"created_at" url:"created_at"` + UpdatedAt time.Time `json:"updated_at" url:"updated_at"` -func (c ClientFacingOrderChangedEventType) Ptr() *ClientFacingOrderChangedEventType { - return &c -} + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` -type ClientFacingOrderDetails struct { - Type string - WalkInTest *ClientFacingWalkInOrderDetails - Testkit *ClientFacingTestKitOrderDetails - AtHomePhlebotomy *ClientFacingAtHomePhlebotomyOrderDetails - OnSiteCollection *ClientFacingOnSiteCollectionOrderDetails + extraProperties map[string]interface{} + rawJSON json.RawMessage } -func (c *ClientFacingOrderDetails) GetType() string { +func (c *ClientFacingOrderInTransaction) GetId() string { if c == nil { return "" } - return c.Type + return c.Id } -func (c *ClientFacingOrderDetails) GetWalkInTest() *ClientFacingWalkInOrderDetails { +func (c *ClientFacingOrderInTransaction) GetLowLevelStatus() *OrderLowLevelStatus { if c == nil { return nil } - return c.WalkInTest + return c.LowLevelStatus } -func (c *ClientFacingOrderDetails) GetTestkit() *ClientFacingTestKitOrderDetails { +func (c *ClientFacingOrderInTransaction) GetLowLevelStatusCreatedAt() *time.Time { if c == nil { return nil } - return c.Testkit + return c.LowLevelStatusCreatedAt } -func (c *ClientFacingOrderDetails) GetAtHomePhlebotomy() *ClientFacingAtHomePhlebotomyOrderDetails { +func (c *ClientFacingOrderInTransaction) GetOrigin() *OrderOrigin { if c == nil { return nil } - return c.AtHomePhlebotomy + return c.Origin } -func (c *ClientFacingOrderDetails) GetOnSiteCollection() *ClientFacingOnSiteCollectionOrderDetails { +func (c *ClientFacingOrderInTransaction) GetParentId() *string { if c == nil { return nil } - return c.OnSiteCollection + return c.ParentId } -func (c *ClientFacingOrderDetails) UnmarshalJSON(data []byte) error { - var unmarshaler struct { - Type string `json:"type"` - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err +func (c *ClientFacingOrderInTransaction) GetCreatedAt() time.Time { + if c == nil { + return time.Time{} } - c.Type = unmarshaler.Type - if unmarshaler.Type == "" { - return fmt.Errorf("%T did not include discriminant type", c) + return c.CreatedAt +} + +func (c *ClientFacingOrderInTransaction) GetUpdatedAt() time.Time { + if c == nil { + return time.Time{} } - switch unmarshaler.Type { - case "walk_in_test": - value := new(ClientFacingWalkInOrderDetails) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - c.WalkInTest = value - case "testkit": - value := new(ClientFacingTestKitOrderDetails) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - c.Testkit = value - case "at_home_phlebotomy": - value := new(ClientFacingAtHomePhlebotomyOrderDetails) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - c.AtHomePhlebotomy = value - case "on_site_collection": - value := new(ClientFacingOnSiteCollectionOrderDetails) - if err := json.Unmarshal(data, &value); err != nil { - return err - } - c.OnSiteCollection = value + return c.UpdatedAt +} + +func (c *ClientFacingOrderInTransaction) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingOrderInTransaction) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) } - return nil + c.explicitFields.Or(c.explicitFields, field) +} + +// SetId sets the Id field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrderInTransaction) SetId(id string) { + c.Id = id + c.require(clientFacingOrderInTransactionFieldId) +} + +// SetLowLevelStatus sets the LowLevelStatus field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrderInTransaction) SetLowLevelStatus(lowLevelStatus *OrderLowLevelStatus) { + c.LowLevelStatus = lowLevelStatus + c.require(clientFacingOrderInTransactionFieldLowLevelStatus) +} + +// SetLowLevelStatusCreatedAt sets the LowLevelStatusCreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrderInTransaction) SetLowLevelStatusCreatedAt(lowLevelStatusCreatedAt *time.Time) { + c.LowLevelStatusCreatedAt = lowLevelStatusCreatedAt + c.require(clientFacingOrderInTransactionFieldLowLevelStatusCreatedAt) +} + +// SetOrigin sets the Origin field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrderInTransaction) SetOrigin(origin *OrderOrigin) { + c.Origin = origin + c.require(clientFacingOrderInTransactionFieldOrigin) } -func (c ClientFacingOrderDetails) MarshalJSON() ([]byte, error) { - if err := c.validate(); err != nil { - return nil, err - } - if c.WalkInTest != nil { - return internal.MarshalJSONWithExtraProperty(c.WalkInTest, "type", "walk_in_test") - } - if c.Testkit != nil { - return internal.MarshalJSONWithExtraProperty(c.Testkit, "type", "testkit") - } - if c.AtHomePhlebotomy != nil { - return internal.MarshalJSONWithExtraProperty(c.AtHomePhlebotomy, "type", "at_home_phlebotomy") - } - if c.OnSiteCollection != nil { - return internal.MarshalJSONWithExtraProperty(c.OnSiteCollection, "type", "on_site_collection") - } - return nil, fmt.Errorf("type %T does not define a non-empty union type", c) +// SetParentId sets the ParentId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrderInTransaction) SetParentId(parentId *string) { + c.ParentId = parentId + c.require(clientFacingOrderInTransactionFieldParentId) } -type ClientFacingOrderDetailsVisitor interface { - VisitWalkInTest(*ClientFacingWalkInOrderDetails) error - VisitTestkit(*ClientFacingTestKitOrderDetails) error - VisitAtHomePhlebotomy(*ClientFacingAtHomePhlebotomyOrderDetails) error - VisitOnSiteCollection(*ClientFacingOnSiteCollectionOrderDetails) error +// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrderInTransaction) SetCreatedAt(createdAt time.Time) { + c.CreatedAt = createdAt + c.require(clientFacingOrderInTransactionFieldCreatedAt) } -func (c *ClientFacingOrderDetails) Accept(visitor ClientFacingOrderDetailsVisitor) error { - if c.WalkInTest != nil { - return visitor.VisitWalkInTest(c.WalkInTest) - } - if c.Testkit != nil { - return visitor.VisitTestkit(c.Testkit) - } - if c.AtHomePhlebotomy != nil { - return visitor.VisitAtHomePhlebotomy(c.AtHomePhlebotomy) - } - if c.OnSiteCollection != nil { - return visitor.VisitOnSiteCollection(c.OnSiteCollection) - } - return fmt.Errorf("type %T does not define a non-empty union type", c) +// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingOrderInTransaction) SetUpdatedAt(updatedAt time.Time) { + c.UpdatedAt = updatedAt + c.require(clientFacingOrderInTransactionFieldUpdatedAt) } -func (c *ClientFacingOrderDetails) validate() error { - if c == nil { - return fmt.Errorf("type %T is nil", c) - } - var fields []string - if c.WalkInTest != nil { - fields = append(fields, "walk_in_test") +func (c *ClientFacingOrderInTransaction) UnmarshalJSON(data []byte) error { + type embed ClientFacingOrderInTransaction + var unmarshaler = struct { + embed + LowLevelStatusCreatedAt *internal.DateTime `json:"low_level_status_created_at,omitempty"` + CreatedAt *internal.DateTime `json:"created_at"` + UpdatedAt *internal.DateTime `json:"updated_at"` + }{ + embed: embed(*c), } - if c.Testkit != nil { - fields = append(fields, "testkit") + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err } - if c.AtHomePhlebotomy != nil { - fields = append(fields, "at_home_phlebotomy") + *c = ClientFacingOrderInTransaction(unmarshaler.embed) + c.LowLevelStatusCreatedAt = unmarshaler.LowLevelStatusCreatedAt.TimePtr() + c.CreatedAt = unmarshaler.CreatedAt.Time() + c.UpdatedAt = unmarshaler.UpdatedAt.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err } - if c.OnSiteCollection != nil { - fields = append(fields, "on_site_collection") + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingOrderInTransaction) MarshalJSON() ([]byte, error) { + type embed ClientFacingOrderInTransaction + var marshaler = struct { + embed + LowLevelStatusCreatedAt *internal.DateTime `json:"low_level_status_created_at,omitempty"` + CreatedAt *internal.DateTime `json:"created_at"` + UpdatedAt *internal.DateTime `json:"updated_at"` + }{ + embed: embed(*c), + LowLevelStatusCreatedAt: internal.NewOptionalDateTime(c.LowLevelStatusCreatedAt), + CreatedAt: internal.NewDateTime(c.CreatedAt), + UpdatedAt: internal.NewDateTime(c.UpdatedAt), } - if len(fields) == 0 { - if c.Type != "" { - return fmt.Errorf("type %T defines a discriminant set to %q but the field is not set", c, c.Type) + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingOrderInTransaction) String() string { + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value } - return fmt.Errorf("type %T is empty", c) - } - if len(fields) > 1 { - return fmt.Errorf("type %T defines values for %s, but only one value is allowed", c, fields) } - if c.Type != "" { - field := fields[0] - if c.Type != field { - return fmt.Errorf( - "type %T defines a discriminant set to %q, but it does not match the %T field; either remove or update the discriminant to match", - c, - c.Type, - c, - ) - } + if value, err := internal.StringifyJSON(c); err == nil { + return value } - return nil + return fmt.Sprintf("%#v", c) } +// Order transaction info. var ( - clientFacingOrderEventFieldId = big.NewInt(1 << 0) - clientFacingOrderEventFieldCreatedAt = big.NewInt(1 << 1) - clientFacingOrderEventFieldStatus = big.NewInt(1 << 2) + clientFacingOrderTransactionFieldId = big.NewInt(1 << 0) + clientFacingOrderTransactionFieldStatus = big.NewInt(1 << 1) + clientFacingOrderTransactionFieldOrders = big.NewInt(1 << 2) ) -type ClientFacingOrderEvent struct { - Id int `json:"id" url:"id"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - Status OrderStatus `json:"status" url:"status"` +type ClientFacingOrderTransaction struct { + Id string `json:"id" url:"id"` + Status OrderTransactionStatus `json:"status" url:"status"` + Orders []*ClientFacingOrderInTransaction `json:"orders" url:"orders"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -15489,32 +16522,32 @@ type ClientFacingOrderEvent struct { rawJSON json.RawMessage } -func (c *ClientFacingOrderEvent) GetId() int { +func (c *ClientFacingOrderTransaction) GetId() string { if c == nil { - return 0 + return "" } return c.Id } -func (c *ClientFacingOrderEvent) GetCreatedAt() time.Time { +func (c *ClientFacingOrderTransaction) GetStatus() OrderTransactionStatus { if c == nil { - return time.Time{} + return "" } - return c.CreatedAt + return c.Status } -func (c *ClientFacingOrderEvent) GetStatus() OrderStatus { +func (c *ClientFacingOrderTransaction) GetOrders() []*ClientFacingOrderInTransaction { if c == nil { - return "" + return nil } - return c.Status + return c.Orders } -func (c *ClientFacingOrderEvent) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingOrderTransaction) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingOrderEvent) require(field *big.Int) { +func (c *ClientFacingOrderTransaction) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -15523,38 +16556,32 @@ func (c *ClientFacingOrderEvent) require(field *big.Int) { // SetId sets the Id field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrderEvent) SetId(id int) { +func (c *ClientFacingOrderTransaction) SetId(id string) { c.Id = id - c.require(clientFacingOrderEventFieldId) + c.require(clientFacingOrderTransactionFieldId) } -// SetCreatedAt sets the CreatedAt field and marks it as non-optional; +// SetStatus sets the Status field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrderEvent) SetCreatedAt(createdAt time.Time) { - c.CreatedAt = createdAt - c.require(clientFacingOrderEventFieldCreatedAt) +func (c *ClientFacingOrderTransaction) SetStatus(status OrderTransactionStatus) { + c.Status = status + c.require(clientFacingOrderTransactionFieldStatus) } -// SetStatus sets the Status field and marks it as non-optional; +// SetOrders sets the Orders field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingOrderEvent) SetStatus(status OrderStatus) { - c.Status = status - c.require(clientFacingOrderEventFieldStatus) +func (c *ClientFacingOrderTransaction) SetOrders(orders []*ClientFacingOrderInTransaction) { + c.Orders = orders + c.require(clientFacingOrderTransactionFieldOrders) } -func (c *ClientFacingOrderEvent) UnmarshalJSON(data []byte) error { - type embed ClientFacingOrderEvent - var unmarshaler = struct { - embed - CreatedAt *internal.DateTime `json:"created_at"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { +func (c *ClientFacingOrderTransaction) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingOrderTransaction + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingOrderEvent(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() + *c = ClientFacingOrderTransaction(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -15564,20 +16591,18 @@ func (c *ClientFacingOrderEvent) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingOrderEvent) MarshalJSON() ([]byte, error) { - type embed ClientFacingOrderEvent +func (c *ClientFacingOrderTransaction) MarshalJSON() ([]byte, error) { + type embed ClientFacingOrderTransaction var marshaler = struct { embed - CreatedAt *internal.DateTime `json:"created_at"` }{ - embed: embed(*c), - CreatedAt: internal.NewDateTime(c.CreatedAt), + embed: embed(*c), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingOrderEvent) String() string { +func (c *ClientFacingOrderTransaction) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -24914,18 +25939,144 @@ func (c *ClientUserIdConflictResponse) require(field *big.Int) { // SetDetail sets the Detail field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientUserIdConflictResponse) SetDetail(detail *ClientUserIdConflict) { - c.Detail = detail - c.require(clientUserIdConflictResponseFieldDetail) +func (c *ClientUserIdConflictResponse) SetDetail(detail *ClientUserIdConflict) { + c.Detail = detail + c.require(clientUserIdConflictResponseFieldDetail) +} + +func (c *ClientUserIdConflictResponse) UnmarshalJSON(data []byte) error { + type unmarshaler ClientUserIdConflictResponse + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ClientUserIdConflictResponse(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientUserIdConflictResponse) MarshalJSON() ([]byte, error) { + type embed ClientUserIdConflictResponse + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientUserIdConflictResponse) String() string { + if len(c.rawJSON) > 0 { + if value, err := internal.StringifyJSON(c.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +var ( + clinicalInformationFieldFasting = big.NewInt(1 << 0) + clinicalInformationFieldNotes = big.NewInt(1 << 1) + clinicalInformationFieldInformation = big.NewInt(1 << 2) + clinicalInformationFieldTotalVolume = big.NewInt(1 << 3) +) + +type ClinicalInformation struct { + Fasting *bool `json:"fasting,omitempty" url:"fasting,omitempty"` + Notes *string `json:"notes,omitempty" url:"notes,omitempty"` + Information *string `json:"information,omitempty" url:"information,omitempty"` + TotalVolume *string `json:"total_volume,omitempty" url:"total_volume,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (c *ClinicalInformation) GetFasting() *bool { + if c == nil { + return nil + } + return c.Fasting +} + +func (c *ClinicalInformation) GetNotes() *string { + if c == nil { + return nil + } + return c.Notes +} + +func (c *ClinicalInformation) GetInformation() *string { + if c == nil { + return nil + } + return c.Information +} + +func (c *ClinicalInformation) GetTotalVolume() *string { + if c == nil { + return nil + } + return c.TotalVolume +} + +func (c *ClinicalInformation) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClinicalInformation) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetFasting sets the Fasting field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClinicalInformation) SetFasting(fasting *bool) { + c.Fasting = fasting + c.require(clinicalInformationFieldFasting) +} + +// SetNotes sets the Notes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClinicalInformation) SetNotes(notes *string) { + c.Notes = notes + c.require(clinicalInformationFieldNotes) +} + +// SetInformation sets the Information field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClinicalInformation) SetInformation(information *string) { + c.Information = information + c.require(clinicalInformationFieldInformation) +} + +// SetTotalVolume sets the TotalVolume field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClinicalInformation) SetTotalVolume(totalVolume *string) { + c.TotalVolume = totalVolume + c.require(clinicalInformationFieldTotalVolume) } -func (c *ClientUserIdConflictResponse) UnmarshalJSON(data []byte) error { - type unmarshaler ClientUserIdConflictResponse +func (c *ClinicalInformation) UnmarshalJSON(data []byte) error { + type unmarshaler ClinicalInformation var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientUserIdConflictResponse(value) + *c = ClinicalInformation(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -24935,8 +26086,8 @@ func (c *ClientUserIdConflictResponse) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientUserIdConflictResponse) MarshalJSON() ([]byte, error) { - type embed ClientUserIdConflictResponse +func (c *ClinicalInformation) MarshalJSON() ([]byte, error) { + type embed ClinicalInformation var marshaler = struct { embed }{ @@ -24946,7 +26097,7 @@ func (c *ClientUserIdConflictResponse) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientUserIdConflictResponse) String() string { +func (c *ClinicalInformation) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -25371,6 +26522,56 @@ func (e Ethnicity) Ptr() *Ethnicity { return &e } +// ℹ️ This enum is non-exhaustive. +type FailureType string + +const ( + FailureTypeQuantityNotSufficientFailure FailureType = "quantity_not_sufficient_failure" + FailureTypeCollectionProcessFailure FailureType = "collection_process_failure" + FailureTypeDropOffFailure FailureType = "drop_off_failure" + FailureTypeInternalLabFailure FailureType = "internal_lab_failure" + FailureTypeOrderEntryFailure FailureType = "order_entry_failure" + FailureTypeNonFailure FailureType = "non_failure" + FailureTypeUnknownFailure FailureType = "unknown_failure" + FailureTypePatientConditionFailure FailureType = "patient_condition_failure" + FailureTypeMissingResultCalcFailure FailureType = "missing_result_calc_failure" + FailureTypeMissingDemoAoeCalcFailure FailureType = "missing_demo_aoe_calc_failure" + FailureTypeInsufficientVolume FailureType = "insufficient_volume" +) + +func NewFailureTypeFromString(s string) (FailureType, error) { + switch s { + case "quantity_not_sufficient_failure": + return FailureTypeQuantityNotSufficientFailure, nil + case "collection_process_failure": + return FailureTypeCollectionProcessFailure, nil + case "drop_off_failure": + return FailureTypeDropOffFailure, nil + case "internal_lab_failure": + return FailureTypeInternalLabFailure, nil + case "order_entry_failure": + return FailureTypeOrderEntryFailure, nil + case "non_failure": + return FailureTypeNonFailure, nil + case "unknown_failure": + return FailureTypeUnknownFailure, nil + case "patient_condition_failure": + return FailureTypePatientConditionFailure, nil + case "missing_result_calc_failure": + return FailureTypeMissingResultCalcFailure, nil + case "missing_demo_aoe_calc_failure": + return FailureTypeMissingDemoAoeCalcFailure, nil + case "insufficient_volume": + return FailureTypeInsufficientVolume, nil + } + var t FailureType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (f FailureType) Ptr() *FailureType { + return &f +} + var ( fallbackBirthDateFieldValue = big.NewInt(1 << 0) fallbackBirthDateFieldSourceSlug = big.NewInt(1 << 1) @@ -26513,117 +27714,607 @@ const ( InterpretationUnknown Interpretation = "unknown" ) -func NewInterpretationFromString(s string) (Interpretation, error) { - switch s { - case "normal": - return InterpretationNormal, nil - case "abnormal": - return InterpretationAbnormal, nil - case "critical": - return InterpretationCritical, nil - case "unknown": - return InterpretationUnknown, nil +func NewInterpretationFromString(s string) (Interpretation, error) { + switch s { + case "normal": + return InterpretationNormal, nil + case "abnormal": + return InterpretationAbnormal, nil + case "critical": + return InterpretationCritical, nil + case "unknown": + return InterpretationUnknown, nil + } + var t Interpretation + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (i Interpretation) Ptr() *Interpretation { + return &i +} + +var ( + jpegFieldContent = big.NewInt(1 << 0) +) + +type Jpeg struct { + Content string `json:"content" url:"content"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + contentType string + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (j *Jpeg) GetContent() string { + if j == nil { + return "" + } + return j.Content +} + +func (j *Jpeg) ContentType() string { + return j.contentType +} + +func (j *Jpeg) GetExtraProperties() map[string]interface{} { + return j.extraProperties +} + +func (j *Jpeg) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) + } + j.explicitFields.Or(j.explicitFields, field) +} + +// SetContent sets the Content field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (j *Jpeg) SetContent(content string) { + j.Content = content + j.require(jpegFieldContent) +} + +func (j *Jpeg) UnmarshalJSON(data []byte) error { + type embed Jpeg + var unmarshaler = struct { + embed + ContentType string `json:"content_type"` + }{ + embed: embed(*j), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *j = Jpeg(unmarshaler.embed) + if unmarshaler.ContentType != "image/jpeg" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", j, "image/jpeg", unmarshaler.ContentType) + } + j.contentType = unmarshaler.ContentType + extraProperties, err := internal.ExtractExtraProperties(data, *j, "content_type") + if err != nil { + return err + } + j.extraProperties = extraProperties + j.rawJSON = json.RawMessage(data) + return nil +} + +func (j *Jpeg) MarshalJSON() ([]byte, error) { + type embed Jpeg + var marshaler = struct { + embed + ContentType string `json:"content_type"` + }{ + embed: embed(*j), + ContentType: "image/jpeg", + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, j.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (j *Jpeg) String() string { + if len(j.rawJSON) > 0 { + if value, err := internal.StringifyJSON(j.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(j); err == nil { + return value + } + return fmt.Sprintf("%#v", j) +} + +var ( + labResultsMetadataFieldAge = big.NewInt(1 << 0) + labResultsMetadataFieldDob = big.NewInt(1 << 1) + labResultsMetadataFieldClia = big.NewInt(1 << 2) + labResultsMetadataFieldPatient = big.NewInt(1 << 3) + labResultsMetadataFieldProvider = big.NewInt(1 << 4) + labResultsMetadataFieldLaboratory = big.NewInt(1 << 5) + labResultsMetadataFieldDateReported = big.NewInt(1 << 6) + labResultsMetadataFieldDateCollected = big.NewInt(1 << 7) + labResultsMetadataFieldSpecimenNumber = big.NewInt(1 << 8) + labResultsMetadataFieldDateReceived = big.NewInt(1 << 9) + labResultsMetadataFieldStatus = big.NewInt(1 << 10) + labResultsMetadataFieldInterpretation = big.NewInt(1 << 11) + labResultsMetadataFieldPatientId = big.NewInt(1 << 12) + labResultsMetadataFieldAccountId = big.NewInt(1 << 13) +) + +type LabResultsMetadata struct { + Age string `json:"age" url:"age"` + Dob string `json:"dob" url:"dob"` + Clia *string `json:"clia_#,omitempty" url:"clia_#,omitempty"` + Patient string `json:"patient" url:"patient"` + Provider *string `json:"provider,omitempty" url:"provider,omitempty"` + Laboratory *string `json:"laboratory,omitempty" url:"laboratory,omitempty"` + DateReported string `json:"date_reported" url:"date_reported"` + DateCollected *string `json:"date_collected,omitempty" url:"date_collected,omitempty"` + SpecimenNumber string `json:"specimen_number" url:"specimen_number"` + DateReceived *string `json:"date_received,omitempty" url:"date_received,omitempty"` + Status *string `json:"status,omitempty" url:"status,omitempty"` + Interpretation *string `json:"interpretation,omitempty" url:"interpretation,omitempty"` + PatientId *string `json:"patient_id,omitempty" url:"patient_id,omitempty"` + AccountId *string `json:"account_id,omitempty" url:"account_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (l *LabResultsMetadata) GetAge() string { + if l == nil { + return "" + } + return l.Age +} + +func (l *LabResultsMetadata) GetDob() string { + if l == nil { + return "" + } + return l.Dob +} + +func (l *LabResultsMetadata) GetClia() *string { + if l == nil { + return nil + } + return l.Clia +} + +func (l *LabResultsMetadata) GetPatient() string { + if l == nil { + return "" + } + return l.Patient +} + +func (l *LabResultsMetadata) GetProvider() *string { + if l == nil { + return nil + } + return l.Provider +} + +func (l *LabResultsMetadata) GetLaboratory() *string { + if l == nil { + return nil + } + return l.Laboratory +} + +func (l *LabResultsMetadata) GetDateReported() string { + if l == nil { + return "" + } + return l.DateReported +} + +func (l *LabResultsMetadata) GetDateCollected() *string { + if l == nil { + return nil + } + return l.DateCollected +} + +func (l *LabResultsMetadata) GetSpecimenNumber() string { + if l == nil { + return "" + } + return l.SpecimenNumber +} + +func (l *LabResultsMetadata) GetDateReceived() *string { + if l == nil { + return nil + } + return l.DateReceived +} + +func (l *LabResultsMetadata) GetStatus() *string { + if l == nil { + return nil + } + return l.Status +} + +func (l *LabResultsMetadata) GetInterpretation() *string { + if l == nil { + return nil + } + return l.Interpretation +} + +func (l *LabResultsMetadata) GetPatientId() *string { + if l == nil { + return nil + } + return l.PatientId +} + +func (l *LabResultsMetadata) GetAccountId() *string { + if l == nil { + return nil + } + return l.AccountId +} + +func (l *LabResultsMetadata) GetExtraProperties() map[string]interface{} { + return l.extraProperties +} + +func (l *LabResultsMetadata) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) + } + l.explicitFields.Or(l.explicitFields, field) +} + +// SetAge sets the Age field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetAge(age string) { + l.Age = age + l.require(labResultsMetadataFieldAge) +} + +// SetDob sets the Dob field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetDob(dob string) { + l.Dob = dob + l.require(labResultsMetadataFieldDob) +} + +// SetClia sets the Clia field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetClia(clia *string) { + l.Clia = clia + l.require(labResultsMetadataFieldClia) +} + +// SetPatient sets the Patient field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetPatient(patient string) { + l.Patient = patient + l.require(labResultsMetadataFieldPatient) +} + +// SetProvider sets the Provider field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetProvider(provider *string) { + l.Provider = provider + l.require(labResultsMetadataFieldProvider) +} + +// SetLaboratory sets the Laboratory field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetLaboratory(laboratory *string) { + l.Laboratory = laboratory + l.require(labResultsMetadataFieldLaboratory) +} + +// SetDateReported sets the DateReported field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetDateReported(dateReported string) { + l.DateReported = dateReported + l.require(labResultsMetadataFieldDateReported) +} + +// SetDateCollected sets the DateCollected field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetDateCollected(dateCollected *string) { + l.DateCollected = dateCollected + l.require(labResultsMetadataFieldDateCollected) +} + +// SetSpecimenNumber sets the SpecimenNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetSpecimenNumber(specimenNumber string) { + l.SpecimenNumber = specimenNumber + l.require(labResultsMetadataFieldSpecimenNumber) +} + +// SetDateReceived sets the DateReceived field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetDateReceived(dateReceived *string) { + l.DateReceived = dateReceived + l.require(labResultsMetadataFieldDateReceived) +} + +// SetStatus sets the Status field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetStatus(status *string) { + l.Status = status + l.require(labResultsMetadataFieldStatus) +} + +// SetInterpretation sets the Interpretation field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetInterpretation(interpretation *string) { + l.Interpretation = interpretation + l.require(labResultsMetadataFieldInterpretation) +} + +// SetPatientId sets the PatientId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetPatientId(patientId *string) { + l.PatientId = patientId + l.require(labResultsMetadataFieldPatientId) +} + +// SetAccountId sets the AccountId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsMetadata) SetAccountId(accountId *string) { + l.AccountId = accountId + l.require(labResultsMetadataFieldAccountId) +} + +func (l *LabResultsMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler LabResultsMetadata + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *l = LabResultsMetadata(value) + extraProperties, err := internal.ExtractExtraProperties(data, *l) + if err != nil { + return err + } + l.extraProperties = extraProperties + l.rawJSON = json.RawMessage(data) + return nil +} + +func (l *LabResultsMetadata) MarshalJSON() ([]byte, error) { + type embed LabResultsMetadata + var marshaler = struct { + embed + }{ + embed: embed(*l), } - var t Interpretation - return "", fmt.Errorf("%s is not a valid %T", s, t) + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) + return json.Marshal(explicitMarshaler) } -func (i Interpretation) Ptr() *Interpretation { - return &i +func (l *LabResultsMetadata) String() string { + if len(l.rawJSON) > 0 { + if value, err := internal.StringifyJSON(l.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(l); err == nil { + return value + } + return fmt.Sprintf("%#v", l) } var ( - jpegFieldContent = big.NewInt(1 << 0) + labResultsRawFieldMetadata = big.NewInt(1 << 0) + labResultsRawFieldResults = big.NewInt(1 << 1) + labResultsRawFieldMissingResults = big.NewInt(1 << 2) + labResultsRawFieldSampleInformation = big.NewInt(1 << 3) + labResultsRawFieldOrderTransaction = big.NewInt(1 << 4) ) -type Jpeg struct { - Content string `json:"content" url:"content"` +type LabResultsRaw struct { + Metadata *LabResultsMetadata `json:"metadata" url:"metadata"` + Results *LabResultsRawResults `json:"results" url:"results"` + MissingResults []*MissingBiomarkerResult `json:"missing_results,omitempty" url:"missing_results,omitempty"` + SampleInformation map[string]*SampleData `json:"sample_information,omitempty" url:"sample_information,omitempty"` + OrderTransaction *ClientFacingOrderTransaction `json:"order_transaction,omitempty" url:"order_transaction,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` - contentType string extraProperties map[string]interface{} rawJSON json.RawMessage } -func (j *Jpeg) GetContent() string { - if j == nil { - return "" +func (l *LabResultsRaw) GetMetadata() *LabResultsMetadata { + if l == nil { + return nil } - return j.Content + return l.Metadata } -func (j *Jpeg) ContentType() string { - return j.contentType +func (l *LabResultsRaw) GetResults() *LabResultsRawResults { + if l == nil { + return nil + } + return l.Results } -func (j *Jpeg) GetExtraProperties() map[string]interface{} { - return j.extraProperties +func (l *LabResultsRaw) GetMissingResults() []*MissingBiomarkerResult { + if l == nil { + return nil + } + return l.MissingResults } -func (j *Jpeg) require(field *big.Int) { - if j.explicitFields == nil { - j.explicitFields = big.NewInt(0) +func (l *LabResultsRaw) GetSampleInformation() map[string]*SampleData { + if l == nil { + return nil } - j.explicitFields.Or(j.explicitFields, field) + return l.SampleInformation } -// SetContent sets the Content field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (j *Jpeg) SetContent(content string) { - j.Content = content - j.require(jpegFieldContent) +func (l *LabResultsRaw) GetOrderTransaction() *ClientFacingOrderTransaction { + if l == nil { + return nil + } + return l.OrderTransaction } -func (j *Jpeg) UnmarshalJSON(data []byte) error { - type embed Jpeg - var unmarshaler = struct { - embed - ContentType string `json:"content_type"` - }{ - embed: embed(*j), +func (l *LabResultsRaw) GetExtraProperties() map[string]interface{} { + return l.extraProperties +} + +func (l *LabResultsRaw) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) } - if err := json.Unmarshal(data, &unmarshaler); err != nil { + l.explicitFields.Or(l.explicitFields, field) +} + +// SetMetadata sets the Metadata field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsRaw) SetMetadata(metadata *LabResultsMetadata) { + l.Metadata = metadata + l.require(labResultsRawFieldMetadata) +} + +// SetResults sets the Results field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsRaw) SetResults(results *LabResultsRawResults) { + l.Results = results + l.require(labResultsRawFieldResults) +} + +// SetMissingResults sets the MissingResults field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsRaw) SetMissingResults(missingResults []*MissingBiomarkerResult) { + l.MissingResults = missingResults + l.require(labResultsRawFieldMissingResults) +} + +// SetSampleInformation sets the SampleInformation field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsRaw) SetSampleInformation(sampleInformation map[string]*SampleData) { + l.SampleInformation = sampleInformation + l.require(labResultsRawFieldSampleInformation) +} + +// SetOrderTransaction sets the OrderTransaction field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (l *LabResultsRaw) SetOrderTransaction(orderTransaction *ClientFacingOrderTransaction) { + l.OrderTransaction = orderTransaction + l.require(labResultsRawFieldOrderTransaction) +} + +func (l *LabResultsRaw) UnmarshalJSON(data []byte) error { + type unmarshaler LabResultsRaw + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *j = Jpeg(unmarshaler.embed) - if unmarshaler.ContentType != "image/jpeg" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", j, "image/jpeg", unmarshaler.ContentType) - } - j.contentType = unmarshaler.ContentType - extraProperties, err := internal.ExtractExtraProperties(data, *j, "content_type") + *l = LabResultsRaw(value) + extraProperties, err := internal.ExtractExtraProperties(data, *l) if err != nil { return err } - j.extraProperties = extraProperties - j.rawJSON = json.RawMessage(data) + l.extraProperties = extraProperties + l.rawJSON = json.RawMessage(data) return nil } -func (j *Jpeg) MarshalJSON() ([]byte, error) { - type embed Jpeg +func (l *LabResultsRaw) MarshalJSON() ([]byte, error) { + type embed LabResultsRaw var marshaler = struct { embed - ContentType string `json:"content_type"` }{ - embed: embed(*j), - ContentType: "image/jpeg", + embed: embed(*l), } - explicitMarshaler := internal.HandleExplicitFields(marshaler, j.explicitFields) + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) return json.Marshal(explicitMarshaler) } -func (j *Jpeg) String() string { - if len(j.rawJSON) > 0 { - if value, err := internal.StringifyJSON(j.rawJSON); err == nil { +func (l *LabResultsRaw) String() string { + if len(l.rawJSON) > 0 { + if value, err := internal.StringifyJSON(l.rawJSON); err == nil { return value } } - if value, err := internal.StringifyJSON(j); err == nil { + if value, err := internal.StringifyJSON(l); err == nil { return value } - return fmt.Sprintf("%#v", j) + return fmt.Sprintf("%#v", l) +} + +type LabResultsRawResults struct { + BiomarkerResultList []*BiomarkerResult + StringUnknownMap map[string]interface{} + + typ string +} + +func (l *LabResultsRawResults) GetBiomarkerResultList() []*BiomarkerResult { + if l == nil { + return nil + } + return l.BiomarkerResultList +} + +func (l *LabResultsRawResults) GetStringUnknownMap() map[string]interface{} { + if l == nil { + return nil + } + return l.StringUnknownMap +} + +func (l *LabResultsRawResults) UnmarshalJSON(data []byte) error { + var valueBiomarkerResultList []*BiomarkerResult + if err := json.Unmarshal(data, &valueBiomarkerResultList); err == nil { + l.typ = "BiomarkerResultList" + l.BiomarkerResultList = valueBiomarkerResultList + return nil + } + var valueStringUnknownMap map[string]interface{} + if err := json.Unmarshal(data, &valueStringUnknownMap); err == nil { + l.typ = "StringUnknownMap" + l.StringUnknownMap = valueStringUnknownMap + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, l) +} + +func (l LabResultsRawResults) MarshalJSON() ([]byte, error) { + if l.typ == "BiomarkerResultList" || l.BiomarkerResultList != nil { + return json.Marshal(l.BiomarkerResultList) + } + if l.typ == "StringUnknownMap" || l.StringUnknownMap != nil { + return json.Marshal(l.StringUnknownMap) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", l) +} + +type LabResultsRawResultsVisitor interface { + VisitBiomarkerResultList([]*BiomarkerResult) error + VisitStringUnknownMap(map[string]interface{}) error +} + +func (l *LabResultsRawResults) Accept(visitor LabResultsRawResultsVisitor) error { + if l.typ == "BiomarkerResultList" || l.BiomarkerResultList != nil { + return visitor.VisitBiomarkerResultList(l.BiomarkerResultList) + } + if l.typ == "StringUnknownMap" || l.StringUnknownMap != nil { + return visitor.VisitStringUnknownMap(l.StringUnknownMap) + } + return fmt.Errorf("type %T does not include a non-empty union type", l) } // The method used to perform a lab test. ℹ️ This enum is non-exhaustive. @@ -26721,6 +28412,7 @@ const ( LabsSpiriplex Labs = "spiriplex" LabsUssl Labs = "ussl" LabsQuest Labs = "quest" + LabsSonoraQuest Labs = "sonora_quest" LabsLabcorp Labs = "labcorp" LabsBioreference Labs = "bioreference" LabsUsBiotek Labs = "us_biotek" @@ -26741,6 +28433,8 @@ func NewLabsFromString(s string) (Labs, error) { return LabsUssl, nil case "quest": return LabsQuest, nil + case "sonora_quest": + return LabsSonoraQuest, nil case "labcorp": return LabsLabcorp, nil case "bioreference": @@ -26833,6 +28527,196 @@ func (m Minerals) Ptr() *Minerals { return &m } +var ( + missingBiomarkerResultFieldName = big.NewInt(1 << 0) + missingBiomarkerResultFieldSlug = big.NewInt(1 << 1) + missingBiomarkerResultFieldInferredFailureType = big.NewInt(1 << 2) + missingBiomarkerResultFieldNote = big.NewInt(1 << 3) + missingBiomarkerResultFieldLoinc = big.NewInt(1 << 4) + missingBiomarkerResultFieldLoincSlug = big.NewInt(1 << 5) + missingBiomarkerResultFieldProviderId = big.NewInt(1 << 6) + missingBiomarkerResultFieldSourceMarkers = big.NewInt(1 << 7) +) + +type MissingBiomarkerResult struct { + Name string `json:"name" url:"name"` + Slug string `json:"slug" url:"slug"` + InferredFailureType FailureType `json:"inferred_failure_type" url:"inferred_failure_type"` + Note *string `json:"note,omitempty" url:"note,omitempty"` + Loinc *string `json:"loinc,omitempty" url:"loinc,omitempty"` + LoincSlug *string `json:"loinc_slug,omitempty" url:"loinc_slug,omitempty"` + ProviderId *string `json:"provider_id,omitempty" url:"provider_id,omitempty"` + SourceMarkers []*ParentBiomarkerData `json:"source_markers,omitempty" url:"source_markers,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (m *MissingBiomarkerResult) GetName() string { + if m == nil { + return "" + } + return m.Name +} + +func (m *MissingBiomarkerResult) GetSlug() string { + if m == nil { + return "" + } + return m.Slug +} + +func (m *MissingBiomarkerResult) GetInferredFailureType() FailureType { + if m == nil { + return "" + } + return m.InferredFailureType +} + +func (m *MissingBiomarkerResult) GetNote() *string { + if m == nil { + return nil + } + return m.Note +} + +func (m *MissingBiomarkerResult) GetLoinc() *string { + if m == nil { + return nil + } + return m.Loinc +} + +func (m *MissingBiomarkerResult) GetLoincSlug() *string { + if m == nil { + return nil + } + return m.LoincSlug +} + +func (m *MissingBiomarkerResult) GetProviderId() *string { + if m == nil { + return nil + } + return m.ProviderId +} + +func (m *MissingBiomarkerResult) GetSourceMarkers() []*ParentBiomarkerData { + if m == nil { + return nil + } + return m.SourceMarkers +} + +func (m *MissingBiomarkerResult) GetExtraProperties() map[string]interface{} { + return m.extraProperties +} + +func (m *MissingBiomarkerResult) require(field *big.Int) { + if m.explicitFields == nil { + m.explicitFields = big.NewInt(0) + } + m.explicitFields.Or(m.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MissingBiomarkerResult) SetName(name string) { + m.Name = name + m.require(missingBiomarkerResultFieldName) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MissingBiomarkerResult) SetSlug(slug string) { + m.Slug = slug + m.require(missingBiomarkerResultFieldSlug) +} + +// SetInferredFailureType sets the InferredFailureType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MissingBiomarkerResult) SetInferredFailureType(inferredFailureType FailureType) { + m.InferredFailureType = inferredFailureType + m.require(missingBiomarkerResultFieldInferredFailureType) +} + +// SetNote sets the Note field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MissingBiomarkerResult) SetNote(note *string) { + m.Note = note + m.require(missingBiomarkerResultFieldNote) +} + +// SetLoinc sets the Loinc field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MissingBiomarkerResult) SetLoinc(loinc *string) { + m.Loinc = loinc + m.require(missingBiomarkerResultFieldLoinc) +} + +// SetLoincSlug sets the LoincSlug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MissingBiomarkerResult) SetLoincSlug(loincSlug *string) { + m.LoincSlug = loincSlug + m.require(missingBiomarkerResultFieldLoincSlug) +} + +// SetProviderId sets the ProviderId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MissingBiomarkerResult) SetProviderId(providerId *string) { + m.ProviderId = providerId + m.require(missingBiomarkerResultFieldProviderId) +} + +// SetSourceMarkers sets the SourceMarkers field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (m *MissingBiomarkerResult) SetSourceMarkers(sourceMarkers []*ParentBiomarkerData) { + m.SourceMarkers = sourceMarkers + m.require(missingBiomarkerResultFieldSourceMarkers) +} + +func (m *MissingBiomarkerResult) UnmarshalJSON(data []byte) error { + type unmarshaler MissingBiomarkerResult + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *m = MissingBiomarkerResult(value) + extraProperties, err := internal.ExtractExtraProperties(data, *m) + if err != nil { + return err + } + m.extraProperties = extraProperties + m.rawJSON = json.RawMessage(data) + return nil +} + +func (m *MissingBiomarkerResult) MarshalJSON() ([]byte, error) { + type embed MissingBiomarkerResult + var marshaler = struct { + embed + }{ + embed: embed(*m), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, m.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (m *MissingBiomarkerResult) String() string { + if len(m.rawJSON) > 0 { + if value, err := internal.StringifyJSON(m.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(m); err == nil { + return value + } + return fmt.Sprintf("%#v", m) +} + var ( notFoundErrorBodyFieldDetail = big.NewInt(1 << 0) ) @@ -26899,16 +28783,134 @@ func (n *NotFoundErrorBody) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (n *NotFoundErrorBody) String() string { - if len(n.rawJSON) > 0 { - if value, err := internal.StringifyJSON(n.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(n); err == nil { - return value - } - return fmt.Sprintf("%#v", n) +func (n *NotFoundErrorBody) String() string { + if len(n.rawJSON) > 0 { + if value, err := internal.StringifyJSON(n.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(n); err == nil { + return value + } + return fmt.Sprintf("%#v", n) +} + +// ℹ️ This enum is non-exhaustive. +type OrderLowLevelStatus string + +const ( + OrderLowLevelStatusOrdered OrderLowLevelStatus = "ordered" + OrderLowLevelStatusRequisitionCreated OrderLowLevelStatus = "requisition_created" + OrderLowLevelStatusRequisitionBypassed OrderLowLevelStatus = "requisition_bypassed" + OrderLowLevelStatusTransitCustomer OrderLowLevelStatus = "transit_customer" + OrderLowLevelStatusOutForDelivery OrderLowLevelStatus = "out_for_delivery" + OrderLowLevelStatusWithCustomer OrderLowLevelStatus = "with_customer" + OrderLowLevelStatusTransitLab OrderLowLevelStatus = "transit_lab" + OrderLowLevelStatusDeliveredToLab OrderLowLevelStatus = "delivered_to_lab" + OrderLowLevelStatusCompleted OrderLowLevelStatus = "completed" + OrderLowLevelStatusFailureToDeliverToLab OrderLowLevelStatus = "failure_to_deliver_to_lab" + OrderLowLevelStatusFailureToDeliverToCustomer OrderLowLevelStatus = "failure_to_deliver_to_customer" + OrderLowLevelStatusProblemInTransitLab OrderLowLevelStatus = "problem_in_transit_lab" + OrderLowLevelStatusProblemInTransitCustomer OrderLowLevelStatus = "problem_in_transit_customer" + OrderLowLevelStatusSampleError OrderLowLevelStatus = "sample_error" + OrderLowLevelStatusAppointmentScheduled OrderLowLevelStatus = "appointment_scheduled" + OrderLowLevelStatusAppointmentCancelled OrderLowLevelStatus = "appointment_cancelled" + OrderLowLevelStatusAppointmentPending OrderLowLevelStatus = "appointment_pending" + OrderLowLevelStatusDrawCompleted OrderLowLevelStatus = "draw_completed" + OrderLowLevelStatusCancelled OrderLowLevelStatus = "cancelled" + OrderLowLevelStatusLost OrderLowLevelStatus = "lost" + OrderLowLevelStatusDoNotProcess OrderLowLevelStatus = "do_not_process" + OrderLowLevelStatusPartialResults OrderLowLevelStatus = "partial_results" + OrderLowLevelStatusAwaitingRegistration OrderLowLevelStatus = "awaiting_registration" + OrderLowLevelStatusRegistered OrderLowLevelStatus = "registered" + OrderLowLevelStatusRedrawAvailable OrderLowLevelStatus = "redraw_available" +) + +func NewOrderLowLevelStatusFromString(s string) (OrderLowLevelStatus, error) { + switch s { + case "ordered": + return OrderLowLevelStatusOrdered, nil + case "requisition_created": + return OrderLowLevelStatusRequisitionCreated, nil + case "requisition_bypassed": + return OrderLowLevelStatusRequisitionBypassed, nil + case "transit_customer": + return OrderLowLevelStatusTransitCustomer, nil + case "out_for_delivery": + return OrderLowLevelStatusOutForDelivery, nil + case "with_customer": + return OrderLowLevelStatusWithCustomer, nil + case "transit_lab": + return OrderLowLevelStatusTransitLab, nil + case "delivered_to_lab": + return OrderLowLevelStatusDeliveredToLab, nil + case "completed": + return OrderLowLevelStatusCompleted, nil + case "failure_to_deliver_to_lab": + return OrderLowLevelStatusFailureToDeliverToLab, nil + case "failure_to_deliver_to_customer": + return OrderLowLevelStatusFailureToDeliverToCustomer, nil + case "problem_in_transit_lab": + return OrderLowLevelStatusProblemInTransitLab, nil + case "problem_in_transit_customer": + return OrderLowLevelStatusProblemInTransitCustomer, nil + case "sample_error": + return OrderLowLevelStatusSampleError, nil + case "appointment_scheduled": + return OrderLowLevelStatusAppointmentScheduled, nil + case "appointment_cancelled": + return OrderLowLevelStatusAppointmentCancelled, nil + case "appointment_pending": + return OrderLowLevelStatusAppointmentPending, nil + case "draw_completed": + return OrderLowLevelStatusDrawCompleted, nil + case "cancelled": + return OrderLowLevelStatusCancelled, nil + case "lost": + return OrderLowLevelStatusLost, nil + case "do_not_process": + return OrderLowLevelStatusDoNotProcess, nil + case "partial_results": + return OrderLowLevelStatusPartialResults, nil + case "awaiting_registration": + return OrderLowLevelStatusAwaitingRegistration, nil + case "registered": + return OrderLowLevelStatusRegistered, nil + case "redraw_available": + return OrderLowLevelStatusRedrawAvailable, nil + } + var t OrderLowLevelStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (o OrderLowLevelStatus) Ptr() *OrderLowLevelStatus { + return &o +} + +// ℹ️ This enum is non-exhaustive. +type OrderOrigin string + +const ( + OrderOriginInitial OrderOrigin = "initial" + OrderOriginRedraw OrderOrigin = "redraw" + OrderOriginRecreation OrderOrigin = "recreation" +) + +func NewOrderOriginFromString(s string) (OrderOrigin, error) { + switch s { + case "initial": + return OrderOriginInitial, nil + case "redraw": + return OrderOriginRedraw, nil + case "recreation": + return OrderOriginRecreation, nil + } + var t OrderOrigin + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (o OrderOrigin) Ptr() *OrderOrigin { + return &o } // ℹ️ This enum is non-exhaustive. @@ -27110,6 +29112,158 @@ func (o OrderTopLevelStatus) Ptr() *OrderTopLevelStatus { return &o } +// ℹ️ This enum is non-exhaustive. +type OrderTransactionStatus string + +const ( + OrderTransactionStatusActive OrderTransactionStatus = "active" + OrderTransactionStatusCompleted OrderTransactionStatus = "completed" + OrderTransactionStatusCancelled OrderTransactionStatus = "cancelled" +) + +func NewOrderTransactionStatusFromString(s string) (OrderTransactionStatus, error) { + switch s { + case "active": + return OrderTransactionStatusActive, nil + case "completed": + return OrderTransactionStatusCompleted, nil + case "cancelled": + return OrderTransactionStatusCancelled, nil + } + var t OrderTransactionStatus + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (o OrderTransactionStatus) Ptr() *OrderTransactionStatus { + return &o +} + +var ( + parentBiomarkerDataFieldMarkerId = big.NewInt(1 << 0) + parentBiomarkerDataFieldName = big.NewInt(1 << 1) + parentBiomarkerDataFieldSlug = big.NewInt(1 << 2) + parentBiomarkerDataFieldProviderId = big.NewInt(1 << 3) +) + +type ParentBiomarkerData struct { + MarkerId int `json:"marker_id" url:"marker_id"` + Name string `json:"name" url:"name"` + Slug string `json:"slug" url:"slug"` + ProviderId *string `json:"provider_id,omitempty" url:"provider_id,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (p *ParentBiomarkerData) GetMarkerId() int { + if p == nil { + return 0 + } + return p.MarkerId +} + +func (p *ParentBiomarkerData) GetName() string { + if p == nil { + return "" + } + return p.Name +} + +func (p *ParentBiomarkerData) GetSlug() string { + if p == nil { + return "" + } + return p.Slug +} + +func (p *ParentBiomarkerData) GetProviderId() *string { + if p == nil { + return nil + } + return p.ProviderId +} + +func (p *ParentBiomarkerData) GetExtraProperties() map[string]interface{} { + return p.extraProperties +} + +func (p *ParentBiomarkerData) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetMarkerId sets the MarkerId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ParentBiomarkerData) SetMarkerId(markerId int) { + p.MarkerId = markerId + p.require(parentBiomarkerDataFieldMarkerId) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ParentBiomarkerData) SetName(name string) { + p.Name = name + p.require(parentBiomarkerDataFieldName) +} + +// SetSlug sets the Slug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ParentBiomarkerData) SetSlug(slug string) { + p.Slug = slug + p.require(parentBiomarkerDataFieldSlug) +} + +// SetProviderId sets the ProviderId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *ParentBiomarkerData) SetProviderId(providerId *string) { + p.ProviderId = providerId + p.require(parentBiomarkerDataFieldProviderId) +} + +func (p *ParentBiomarkerData) UnmarshalJSON(data []byte) error { + type unmarshaler ParentBiomarkerData + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *p = ParentBiomarkerData(value) + extraProperties, err := internal.ExtractExtraProperties(data, *p) + if err != nil { + return err + } + p.extraProperties = extraProperties + p.rawJSON = json.RawMessage(data) + return nil +} + +func (p *ParentBiomarkerData) MarshalJSON() ([]byte, error) { + type embed ParentBiomarkerData + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (p *ParentBiomarkerData) String() string { + if len(p.rawJSON) > 0 { + if value, err := internal.StringifyJSON(p.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(p); err == nil { + return value + } + return fmt.Sprintf("%#v", p) +} + var ( patientAddressCompatibleFieldReceiverName = big.NewInt(1 << 0) patientAddressCompatibleFieldFirstLine = big.NewInt(1 << 1) @@ -27118,7 +29272,8 @@ var ( patientAddressCompatibleFieldState = big.NewInt(1 << 4) patientAddressCompatibleFieldZip = big.NewInt(1 << 5) patientAddressCompatibleFieldCountry = big.NewInt(1 << 6) - patientAddressCompatibleFieldPhoneNumber = big.NewInt(1 << 7) + patientAddressCompatibleFieldAccessNotes = big.NewInt(1 << 7) + patientAddressCompatibleFieldPhoneNumber = big.NewInt(1 << 8) ) type PatientAddressCompatible struct { @@ -27129,6 +29284,7 @@ type PatientAddressCompatible struct { State string `json:"state" url:"state"` Zip string `json:"zip" url:"zip"` Country string `json:"country" url:"country"` + AccessNotes *string `json:"access_notes,omitempty" url:"access_notes,omitempty"` PhoneNumber *string `json:"phone_number,omitempty" url:"phone_number,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted @@ -27187,6 +29343,13 @@ func (p *PatientAddressCompatible) GetCountry() string { return p.Country } +func (p *PatientAddressCompatible) GetAccessNotes() *string { + if p == nil { + return nil + } + return p.AccessNotes +} + func (p *PatientAddressCompatible) GetPhoneNumber() *string { if p == nil { return nil @@ -27254,6 +29417,13 @@ func (p *PatientAddressCompatible) SetCountry(country string) { p.require(patientAddressCompatibleFieldCountry) } +// SetAccessNotes sets the AccessNotes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatientAddressCompatible) SetAccessNotes(accessNotes *string) { + p.AccessNotes = accessNotes + p.require(patientAddressCompatibleFieldAccessNotes) +} + // SetPhoneNumber sets the PhoneNumber field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (p *PatientAddressCompatible) SetPhoneNumber(phoneNumber *string) { @@ -27308,7 +29478,8 @@ var ( patientAddressWithValidationFieldState = big.NewInt(1 << 4) patientAddressWithValidationFieldZip = big.NewInt(1 << 5) patientAddressWithValidationFieldCountry = big.NewInt(1 << 6) - patientAddressWithValidationFieldPhoneNumber = big.NewInt(1 << 7) + patientAddressWithValidationFieldAccessNotes = big.NewInt(1 << 7) + patientAddressWithValidationFieldPhoneNumber = big.NewInt(1 << 8) ) type PatientAddressWithValidation struct { @@ -27319,6 +29490,7 @@ type PatientAddressWithValidation struct { State string `json:"state" url:"state"` Zip string `json:"zip" url:"zip"` Country string `json:"country" url:"country"` + AccessNotes *string `json:"access_notes,omitempty" url:"access_notes,omitempty"` PhoneNumber *string `json:"phone_number,omitempty" url:"phone_number,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted @@ -27377,6 +29549,13 @@ func (p *PatientAddressWithValidation) GetCountry() string { return p.Country } +func (p *PatientAddressWithValidation) GetAccessNotes() *string { + if p == nil { + return nil + } + return p.AccessNotes +} + func (p *PatientAddressWithValidation) GetPhoneNumber() *string { if p == nil { return nil @@ -27444,6 +29623,13 @@ func (p *PatientAddressWithValidation) SetCountry(country string) { p.require(patientAddressWithValidationFieldCountry) } +// SetAccessNotes sets the AccessNotes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PatientAddressWithValidation) SetAccessNotes(accessNotes *string) { + p.AccessNotes = accessNotes + p.require(patientAddressWithValidationFieldAccessNotes) +} + // SetPhoneNumber sets the PhoneNumber field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (p *PatientAddressWithValidation) SetPhoneNumber(phoneNumber *string) { @@ -27768,38 +29954,170 @@ func (p *PatientDetailsWithValidation) String() string { return fmt.Sprintf("%#v", p) } -// ℹ️ This enum is non-exhaustive. -type PayorCodeExternalProvider string - -const ( - PayorCodeExternalProviderChangeHealthcare PayorCodeExternalProvider = "change_healthcare" - PayorCodeExternalProviderAvaility PayorCodeExternalProvider = "availity" - PayorCodeExternalProviderStedi PayorCodeExternalProvider = "stedi" - PayorCodeExternalProviderWaystar PayorCodeExternalProvider = "waystar" - PayorCodeExternalProviderClaimMd PayorCodeExternalProvider = "claim_md" -) - -func NewPayorCodeExternalProviderFromString(s string) (PayorCodeExternalProvider, error) { - switch s { - case "change_healthcare": - return PayorCodeExternalProviderChangeHealthcare, nil - case "availity": - return PayorCodeExternalProviderAvaility, nil - case "stedi": - return PayorCodeExternalProviderStedi, nil - case "waystar": - return PayorCodeExternalProviderWaystar, nil - case "claim_md": - return PayorCodeExternalProviderClaimMd, nil - } - var t PayorCodeExternalProvider - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (p PayorCodeExternalProvider) Ptr() *PayorCodeExternalProvider { - return &p -} - +// ℹ️ This enum is non-exhaustive. +type PayorCodeExternalProvider string + +const ( + PayorCodeExternalProviderChangeHealthcare PayorCodeExternalProvider = "change_healthcare" + PayorCodeExternalProviderAvaility PayorCodeExternalProvider = "availity" + PayorCodeExternalProviderStedi PayorCodeExternalProvider = "stedi" + PayorCodeExternalProviderWaystar PayorCodeExternalProvider = "waystar" + PayorCodeExternalProviderClaimMd PayorCodeExternalProvider = "claim_md" + PayorCodeExternalProviderApero PayorCodeExternalProvider = "apero" + PayorCodeExternalProviderPverify PayorCodeExternalProvider = "pverify" +) + +func NewPayorCodeExternalProviderFromString(s string) (PayorCodeExternalProvider, error) { + switch s { + case "change_healthcare": + return PayorCodeExternalProviderChangeHealthcare, nil + case "availity": + return PayorCodeExternalProviderAvaility, nil + case "stedi": + return PayorCodeExternalProviderStedi, nil + case "waystar": + return PayorCodeExternalProviderWaystar, nil + case "claim_md": + return PayorCodeExternalProviderClaimMd, nil + case "apero": + return PayorCodeExternalProviderApero, nil + case "pverify": + return PayorCodeExternalProviderPverify, nil + } + var t PayorCodeExternalProvider + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (p PayorCodeExternalProvider) Ptr() *PayorCodeExternalProvider { + return &p +} + +var ( + performingLaboratoryFieldName = big.NewInt(1 << 0) + performingLaboratoryFieldPhoneNumber = big.NewInt(1 << 1) + performingLaboratoryFieldMedicalDirector = big.NewInt(1 << 2) + performingLaboratoryFieldAddress = big.NewInt(1 << 3) +) + +type PerformingLaboratory struct { + Name string `json:"name" url:"name"` + PhoneNumber *string `json:"phone_number,omitempty" url:"phone_number,omitempty"` + MedicalDirector *string `json:"medical_director,omitempty" url:"medical_director,omitempty"` + Address *Address `json:"address,omitempty" url:"address,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (p *PerformingLaboratory) GetName() string { + if p == nil { + return "" + } + return p.Name +} + +func (p *PerformingLaboratory) GetPhoneNumber() *string { + if p == nil { + return nil + } + return p.PhoneNumber +} + +func (p *PerformingLaboratory) GetMedicalDirector() *string { + if p == nil { + return nil + } + return p.MedicalDirector +} + +func (p *PerformingLaboratory) GetAddress() *Address { + if p == nil { + return nil + } + return p.Address +} + +func (p *PerformingLaboratory) GetExtraProperties() map[string]interface{} { + return p.extraProperties +} + +func (p *PerformingLaboratory) require(field *big.Int) { + if p.explicitFields == nil { + p.explicitFields = big.NewInt(0) + } + p.explicitFields.Or(p.explicitFields, field) +} + +// SetName sets the Name field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerformingLaboratory) SetName(name string) { + p.Name = name + p.require(performingLaboratoryFieldName) +} + +// SetPhoneNumber sets the PhoneNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerformingLaboratory) SetPhoneNumber(phoneNumber *string) { + p.PhoneNumber = phoneNumber + p.require(performingLaboratoryFieldPhoneNumber) +} + +// SetMedicalDirector sets the MedicalDirector field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerformingLaboratory) SetMedicalDirector(medicalDirector *string) { + p.MedicalDirector = medicalDirector + p.require(performingLaboratoryFieldMedicalDirector) +} + +// SetAddress sets the Address field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (p *PerformingLaboratory) SetAddress(address *Address) { + p.Address = address + p.require(performingLaboratoryFieldAddress) +} + +func (p *PerformingLaboratory) UnmarshalJSON(data []byte) error { + type unmarshaler PerformingLaboratory + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *p = PerformingLaboratory(value) + extraProperties, err := internal.ExtractExtraProperties(data, *p) + if err != nil { + return err + } + p.extraProperties = extraProperties + p.rawJSON = json.RawMessage(data) + return nil +} + +func (p *PerformingLaboratory) MarshalJSON() ([]byte, error) { + type embed PerformingLaboratory + var marshaler = struct { + embed + }{ + embed: embed(*p), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, p.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (p *PerformingLaboratory) String() string { + if len(p.rawJSON) > 0 { + if value, err := internal.StringifyJSON(p.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(p); err == nil { + return value + } + return fmt.Sprintf("%#v", p) +} + var ( pngFieldContent = big.NewInt(1 << 0) ) @@ -28371,6 +30689,7 @@ const ( ProvidersHammerhead Providers = "hammerhead" ProvidersMyFitnessPal Providers = "my_fitness_pal" ProvidersHealthConnect Providers = "health_connect" + ProvidersSamsungHealth Providers = "samsung_health" ProvidersPolar Providers = "polar" ProvidersCronometer Providers = "cronometer" ProvidersKardia Providers = "kardia" @@ -28443,6 +30762,8 @@ func NewProvidersFromString(s string) (Providers, error) { return ProvidersMyFitnessPal, nil case "health_connect": return ProvidersHealthConnect, nil + case "samsung_health": + return ProvidersSamsungHealth, nil case "polar": return ProvidersPolar, nil case "cronometer": @@ -28621,147 +30942,536 @@ func (q *Question) SetAnswers(answers []*Answer) { q.require(questionFieldAnswers) } -// SetConstraint sets the Constraint field and marks it as non-optional; +// SetConstraint sets the Constraint field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (q *Question) SetConstraint(constraint *string) { + q.Constraint = constraint + q.require(questionFieldConstraint) +} + +// SetDefault sets the Default field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (q *Question) SetDefault(default_ *string) { + q.Default = default_ + q.require(questionFieldDefault) +} + +func (q *Question) UnmarshalJSON(data []byte) error { + type unmarshaler Question + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *q = Question(value) + extraProperties, err := internal.ExtractExtraProperties(data, *q) + if err != nil { + return err + } + q.extraProperties = extraProperties + q.rawJSON = json.RawMessage(data) + return nil +} + +func (q *Question) MarshalJSON() ([]byte, error) { + type embed Question + var marshaler = struct { + embed + }{ + embed: embed(*q), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, q.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (q *Question) String() string { + if len(q.rawJSON) > 0 { + if value, err := internal.StringifyJSON(q.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(q); err == nil { + return value + } + return fmt.Sprintf("%#v", q) +} + +// ℹ️ This enum is non-exhaustive. +type QuestionType string + +const ( + QuestionTypeChoice QuestionType = "choice" + QuestionTypeText QuestionType = "text" + QuestionTypeNumeric QuestionType = "numeric" + QuestionTypeMultiChoice QuestionType = "multi_choice" +) + +func NewQuestionTypeFromString(s string) (QuestionType, error) { + switch s { + case "choice": + return QuestionTypeChoice, nil + case "text": + return QuestionTypeText, nil + case "numeric": + return QuestionTypeNumeric, nil + case "multi_choice": + return QuestionTypeMultiChoice, nil + } + var t QuestionType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (q QuestionType) Ptr() *QuestionType { + return &q +} + +// ℹ️ This enum is non-exhaustive. +type Race string + +const ( + RaceAfricanAmericanOrBlack Race = "african_american_or_black" + RaceAsian Race = "asian" + RaceIndigenousNativeAmericanAlaskaNative Race = "indigenous_native_american_alaska_native" + RaceOther Race = "other" + RacePacificIslanderOrHawaiian Race = "pacific_islander_or_hawaiian" + RaceWhiteCaucasian Race = "white_caucasian" +) + +func NewRaceFromString(s string) (Race, error) { + switch s { + case "african_american_or_black": + return RaceAfricanAmericanOrBlack, nil + case "asian": + return RaceAsian, nil + case "indigenous_native_american_alaska_native": + return RaceIndigenousNativeAmericanAlaskaNative, nil + case "other": + return RaceOther, nil + case "pacific_islander_or_hawaiian": + return RacePacificIslanderOrHawaiian, nil + case "white_caucasian": + return RaceWhiteCaucasian, nil + } + var t Race + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (r Race) Ptr() *Race { + return &r +} + +// ℹ️ This enum is non-exhaustive. +type ResponsibleRelationship string + +const ( + ResponsibleRelationshipSelf ResponsibleRelationship = "Self" + ResponsibleRelationshipSpouse ResponsibleRelationship = "Spouse" + ResponsibleRelationshipOther ResponsibleRelationship = "Other" +) + +func NewResponsibleRelationshipFromString(s string) (ResponsibleRelationship, error) { + switch s { + case "Self": + return ResponsibleRelationshipSelf, nil + case "Spouse": + return ResponsibleRelationshipSpouse, nil + case "Other": + return ResponsibleRelationshipOther, nil + } + var t ResponsibleRelationship + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (r ResponsibleRelationship) Ptr() *ResponsibleRelationship { + return &r +} + +// ℹ️ This enum is non-exhaustive. +type ResultType string + +const ( + ResultTypeNumeric ResultType = "numeric" + ResultTypeRange ResultType = "range" + ResultTypeComment ResultType = "comment" + ResultTypeCodedValue ResultType = "coded_value" +) + +func NewResultTypeFromString(s string) (ResultType, error) { + switch s { + case "numeric": + return ResultTypeNumeric, nil + case "range": + return ResultTypeRange, nil + case "comment": + return ResultTypeComment, nil + case "coded_value": + return ResultTypeCodedValue, nil + } + var t ResultType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (r ResultType) Ptr() *ResultType { + return &r +} + +var ( + sampleDataFieldSampleId = big.NewInt(1 << 0) + sampleDataFieldControlNumber = big.NewInt(1 << 1) + sampleDataFieldDateCollected = big.NewInt(1 << 2) + sampleDataFieldDateReceived = big.NewInt(1 << 3) + sampleDataFieldDateReported = big.NewInt(1 << 4) + sampleDataFieldPerformingLaboratories = big.NewInt(1 << 5) + sampleDataFieldClinicalInformation = big.NewInt(1 << 6) +) + +type SampleData struct { + SampleId *string `json:"sample_id,omitempty" url:"sample_id,omitempty"` + ControlNumber *string `json:"control_number,omitempty" url:"control_number,omitempty"` + DateCollected *SampleDataDateCollected `json:"date_collected,omitempty" url:"date_collected,omitempty"` + DateReceived *SampleDataDateReceived `json:"date_received,omitempty" url:"date_received,omitempty"` + DateReported *SampleDataDateReported `json:"date_reported,omitempty" url:"date_reported,omitempty"` + PerformingLaboratories map[string]*PerformingLaboratory `json:"performing_laboratories,omitempty" url:"performing_laboratories,omitempty"` + ClinicalInformation *ClinicalInformation `json:"clinical_information,omitempty" url:"clinical_information,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (s *SampleData) GetSampleId() *string { + if s == nil { + return nil + } + return s.SampleId +} + +func (s *SampleData) GetControlNumber() *string { + if s == nil { + return nil + } + return s.ControlNumber +} + +func (s *SampleData) GetDateCollected() *SampleDataDateCollected { + if s == nil { + return nil + } + return s.DateCollected +} + +func (s *SampleData) GetDateReceived() *SampleDataDateReceived { + if s == nil { + return nil + } + return s.DateReceived +} + +func (s *SampleData) GetDateReported() *SampleDataDateReported { + if s == nil { + return nil + } + return s.DateReported +} + +func (s *SampleData) GetPerformingLaboratories() map[string]*PerformingLaboratory { + if s == nil { + return nil + } + return s.PerformingLaboratories +} + +func (s *SampleData) GetClinicalInformation() *ClinicalInformation { + if s == nil { + return nil + } + return s.ClinicalInformation +} + +func (s *SampleData) GetExtraProperties() map[string]interface{} { + return s.extraProperties +} + +func (s *SampleData) require(field *big.Int) { + if s.explicitFields == nil { + s.explicitFields = big.NewInt(0) + } + s.explicitFields.Or(s.explicitFields, field) +} + +// SetSampleId sets the SampleId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SampleData) SetSampleId(sampleId *string) { + s.SampleId = sampleId + s.require(sampleDataFieldSampleId) +} + +// SetControlNumber sets the ControlNumber field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SampleData) SetControlNumber(controlNumber *string) { + s.ControlNumber = controlNumber + s.require(sampleDataFieldControlNumber) +} + +// SetDateCollected sets the DateCollected field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SampleData) SetDateCollected(dateCollected *SampleDataDateCollected) { + s.DateCollected = dateCollected + s.require(sampleDataFieldDateCollected) +} + +// SetDateReceived sets the DateReceived field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SampleData) SetDateReceived(dateReceived *SampleDataDateReceived) { + s.DateReceived = dateReceived + s.require(sampleDataFieldDateReceived) +} + +// SetDateReported sets the DateReported field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (s *SampleData) SetDateReported(dateReported *SampleDataDateReported) { + s.DateReported = dateReported + s.require(sampleDataFieldDateReported) +} + +// SetPerformingLaboratories sets the PerformingLaboratories field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (q *Question) SetConstraint(constraint *string) { - q.Constraint = constraint - q.require(questionFieldConstraint) +func (s *SampleData) SetPerformingLaboratories(performingLaboratories map[string]*PerformingLaboratory) { + s.PerformingLaboratories = performingLaboratories + s.require(sampleDataFieldPerformingLaboratories) } -// SetDefault sets the Default field and marks it as non-optional; +// SetClinicalInformation sets the ClinicalInformation field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (q *Question) SetDefault(default_ *string) { - q.Default = default_ - q.require(questionFieldDefault) +func (s *SampleData) SetClinicalInformation(clinicalInformation *ClinicalInformation) { + s.ClinicalInformation = clinicalInformation + s.require(sampleDataFieldClinicalInformation) } -func (q *Question) UnmarshalJSON(data []byte) error { - type unmarshaler Question +func (s *SampleData) UnmarshalJSON(data []byte) error { + type unmarshaler SampleData var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *q = Question(value) - extraProperties, err := internal.ExtractExtraProperties(data, *q) + *s = SampleData(value) + extraProperties, err := internal.ExtractExtraProperties(data, *s) if err != nil { return err } - q.extraProperties = extraProperties - q.rawJSON = json.RawMessage(data) + s.extraProperties = extraProperties + s.rawJSON = json.RawMessage(data) return nil } -func (q *Question) MarshalJSON() ([]byte, error) { - type embed Question +func (s *SampleData) MarshalJSON() ([]byte, error) { + type embed SampleData var marshaler = struct { embed }{ - embed: embed(*q), + embed: embed(*s), } - explicitMarshaler := internal.HandleExplicitFields(marshaler, q.explicitFields) + explicitMarshaler := internal.HandleExplicitFields(marshaler, s.explicitFields) return json.Marshal(explicitMarshaler) } -func (q *Question) String() string { - if len(q.rawJSON) > 0 { - if value, err := internal.StringifyJSON(q.rawJSON); err == nil { +func (s *SampleData) String() string { + if len(s.rawJSON) > 0 { + if value, err := internal.StringifyJSON(s.rawJSON); err == nil { return value } } - if value, err := internal.StringifyJSON(q); err == nil { + if value, err := internal.StringifyJSON(s); err == nil { return value } - return fmt.Sprintf("%#v", q) + return fmt.Sprintf("%#v", s) } -// ℹ️ This enum is non-exhaustive. -type QuestionType string +type SampleDataDateCollected struct { + UtcTimestampWithTimezoneOffset *UtcTimestampWithTimezoneOffset + String string -const ( - QuestionTypeChoice QuestionType = "choice" - QuestionTypeText QuestionType = "text" - QuestionTypeNumeric QuestionType = "numeric" - QuestionTypeMultiChoice QuestionType = "multi_choice" -) + typ string +} -func NewQuestionTypeFromString(s string) (QuestionType, error) { - switch s { - case "choice": - return QuestionTypeChoice, nil - case "text": - return QuestionTypeText, nil - case "numeric": - return QuestionTypeNumeric, nil - case "multi_choice": - return QuestionTypeMultiChoice, nil +func (s *SampleDataDateCollected) GetUtcTimestampWithTimezoneOffset() *UtcTimestampWithTimezoneOffset { + if s == nil { + return nil } - var t QuestionType - return "", fmt.Errorf("%s is not a valid %T", s, t) + return s.UtcTimestampWithTimezoneOffset } -func (q QuestionType) Ptr() *QuestionType { - return &q +func (s *SampleDataDateCollected) GetString() string { + if s == nil { + return "" + } + return s.String } -// ℹ️ This enum is non-exhaustive. -type Race string +func (s *SampleDataDateCollected) UnmarshalJSON(data []byte) error { + valueUtcTimestampWithTimezoneOffset := new(UtcTimestampWithTimezoneOffset) + if err := json.Unmarshal(data, &valueUtcTimestampWithTimezoneOffset); err == nil { + s.typ = "UtcTimestampWithTimezoneOffset" + s.UtcTimestampWithTimezoneOffset = valueUtcTimestampWithTimezoneOffset + return nil + } + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + s.typ = "String" + s.String = valueString + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, s) +} -const ( - RaceAfricanAmericanOrBlack Race = "african_american_or_black" - RaceAsian Race = "asian" - RaceIndigenousNativeAmericanAlaskaNative Race = "indigenous_native_american_alaska_native" - RaceOther Race = "other" - RacePacificIslanderOrHawaiian Race = "pacific_islander_or_hawaiian" - RaceWhiteCaucasian Race = "white_caucasian" -) +func (s SampleDataDateCollected) MarshalJSON() ([]byte, error) { + if s.typ == "UtcTimestampWithTimezoneOffset" || s.UtcTimestampWithTimezoneOffset != nil { + return json.Marshal(s.UtcTimestampWithTimezoneOffset) + } + if s.typ == "String" || s.String != "" { + return json.Marshal(s.String) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", s) +} -func NewRaceFromString(s string) (Race, error) { - switch s { - case "african_american_or_black": - return RaceAfricanAmericanOrBlack, nil - case "asian": - return RaceAsian, nil - case "indigenous_native_american_alaska_native": - return RaceIndigenousNativeAmericanAlaskaNative, nil - case "other": - return RaceOther, nil - case "pacific_islander_or_hawaiian": - return RacePacificIslanderOrHawaiian, nil - case "white_caucasian": - return RaceWhiteCaucasian, nil +type SampleDataDateCollectedVisitor interface { + VisitUtcTimestampWithTimezoneOffset(*UtcTimestampWithTimezoneOffset) error + VisitString(string) error +} + +func (s *SampleDataDateCollected) Accept(visitor SampleDataDateCollectedVisitor) error { + if s.typ == "UtcTimestampWithTimezoneOffset" || s.UtcTimestampWithTimezoneOffset != nil { + return visitor.VisitUtcTimestampWithTimezoneOffset(s.UtcTimestampWithTimezoneOffset) } - var t Race - return "", fmt.Errorf("%s is not a valid %T", s, t) + if s.typ == "String" || s.String != "" { + return visitor.VisitString(s.String) + } + return fmt.Errorf("type %T does not include a non-empty union type", s) } -func (r Race) Ptr() *Race { - return &r +type SampleDataDateReceived struct { + UtcTimestampWithTimezoneOffset *UtcTimestampWithTimezoneOffset + String string + + typ string } -// ℹ️ This enum is non-exhaustive. -type ResponsibleRelationship string +func (s *SampleDataDateReceived) GetUtcTimestampWithTimezoneOffset() *UtcTimestampWithTimezoneOffset { + if s == nil { + return nil + } + return s.UtcTimestampWithTimezoneOffset +} -const ( - ResponsibleRelationshipSelf ResponsibleRelationship = "Self" - ResponsibleRelationshipSpouse ResponsibleRelationship = "Spouse" - ResponsibleRelationshipOther ResponsibleRelationship = "Other" -) +func (s *SampleDataDateReceived) GetString() string { + if s == nil { + return "" + } + return s.String +} -func NewResponsibleRelationshipFromString(s string) (ResponsibleRelationship, error) { - switch s { - case "Self": - return ResponsibleRelationshipSelf, nil - case "Spouse": - return ResponsibleRelationshipSpouse, nil - case "Other": - return ResponsibleRelationshipOther, nil +func (s *SampleDataDateReceived) UnmarshalJSON(data []byte) error { + valueUtcTimestampWithTimezoneOffset := new(UtcTimestampWithTimezoneOffset) + if err := json.Unmarshal(data, &valueUtcTimestampWithTimezoneOffset); err == nil { + s.typ = "UtcTimestampWithTimezoneOffset" + s.UtcTimestampWithTimezoneOffset = valueUtcTimestampWithTimezoneOffset + return nil } - var t ResponsibleRelationship - return "", fmt.Errorf("%s is not a valid %T", s, t) + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + s.typ = "String" + s.String = valueString + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, s) } -func (r ResponsibleRelationship) Ptr() *ResponsibleRelationship { - return &r +func (s SampleDataDateReceived) MarshalJSON() ([]byte, error) { + if s.typ == "UtcTimestampWithTimezoneOffset" || s.UtcTimestampWithTimezoneOffset != nil { + return json.Marshal(s.UtcTimestampWithTimezoneOffset) + } + if s.typ == "String" || s.String != "" { + return json.Marshal(s.String) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", s) +} + +type SampleDataDateReceivedVisitor interface { + VisitUtcTimestampWithTimezoneOffset(*UtcTimestampWithTimezoneOffset) error + VisitString(string) error +} + +func (s *SampleDataDateReceived) Accept(visitor SampleDataDateReceivedVisitor) error { + if s.typ == "UtcTimestampWithTimezoneOffset" || s.UtcTimestampWithTimezoneOffset != nil { + return visitor.VisitUtcTimestampWithTimezoneOffset(s.UtcTimestampWithTimezoneOffset) + } + if s.typ == "String" || s.String != "" { + return visitor.VisitString(s.String) + } + return fmt.Errorf("type %T does not include a non-empty union type", s) +} + +type SampleDataDateReported struct { + UtcTimestampWithTimezoneOffset *UtcTimestampWithTimezoneOffset + String string + + typ string +} + +func (s *SampleDataDateReported) GetUtcTimestampWithTimezoneOffset() *UtcTimestampWithTimezoneOffset { + if s == nil { + return nil + } + return s.UtcTimestampWithTimezoneOffset +} + +func (s *SampleDataDateReported) GetString() string { + if s == nil { + return "" + } + return s.String +} + +func (s *SampleDataDateReported) UnmarshalJSON(data []byte) error { + valueUtcTimestampWithTimezoneOffset := new(UtcTimestampWithTimezoneOffset) + if err := json.Unmarshal(data, &valueUtcTimestampWithTimezoneOffset); err == nil { + s.typ = "UtcTimestampWithTimezoneOffset" + s.UtcTimestampWithTimezoneOffset = valueUtcTimestampWithTimezoneOffset + return nil + } + var valueString string + if err := json.Unmarshal(data, &valueString); err == nil { + s.typ = "String" + s.String = valueString + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, s) +} + +func (s SampleDataDateReported) MarshalJSON() ([]byte, error) { + if s.typ == "UtcTimestampWithTimezoneOffset" || s.UtcTimestampWithTimezoneOffset != nil { + return json.Marshal(s.UtcTimestampWithTimezoneOffset) + } + if s.typ == "String" || s.String != "" { + return json.Marshal(s.String) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", s) +} + +type SampleDataDateReportedVisitor interface { + VisitUtcTimestampWithTimezoneOffset(*UtcTimestampWithTimezoneOffset) error + VisitString(string) error +} + +func (s *SampleDataDateReported) Accept(visitor SampleDataDateReportedVisitor) error { + if s.typ == "UtcTimestampWithTimezoneOffset" || s.UtcTimestampWithTimezoneOffset != nil { + return visitor.VisitUtcTimestampWithTimezoneOffset(s.UtcTimestampWithTimezoneOffset) + } + if s.typ == "String" || s.String != "" { + return visitor.VisitString(s.String) + } + return fmt.Errorf("type %T does not include a non-empty union type", s) } // ℹ️ This enum is non-exhaustive. @@ -29369,6 +32079,108 @@ func (u *UserRefreshErrorResponse) String() string { return fmt.Sprintf("%#v", u) } +var ( + utcTimestampWithTimezoneOffsetFieldTimestamp = big.NewInt(1 << 0) + utcTimestampWithTimezoneOffsetFieldTimezoneOffset = big.NewInt(1 << 1) +) + +type UtcTimestampWithTimezoneOffset struct { + Timestamp time.Time `json:"timestamp" url:"timestamp"` + TimezoneOffset int `json:"timezone_offset" url:"timezone_offset"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (u *UtcTimestampWithTimezoneOffset) GetTimestamp() time.Time { + if u == nil { + return time.Time{} + } + return u.Timestamp +} + +func (u *UtcTimestampWithTimezoneOffset) GetTimezoneOffset() int { + if u == nil { + return 0 + } + return u.TimezoneOffset +} + +func (u *UtcTimestampWithTimezoneOffset) GetExtraProperties() map[string]interface{} { + return u.extraProperties +} + +func (u *UtcTimestampWithTimezoneOffset) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetTimestamp sets the Timestamp field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UtcTimestampWithTimezoneOffset) SetTimestamp(timestamp time.Time) { + u.Timestamp = timestamp + u.require(utcTimestampWithTimezoneOffsetFieldTimestamp) +} + +// SetTimezoneOffset sets the TimezoneOffset field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UtcTimestampWithTimezoneOffset) SetTimezoneOffset(timezoneOffset int) { + u.TimezoneOffset = timezoneOffset + u.require(utcTimestampWithTimezoneOffsetFieldTimezoneOffset) +} + +func (u *UtcTimestampWithTimezoneOffset) UnmarshalJSON(data []byte) error { + type embed UtcTimestampWithTimezoneOffset + var unmarshaler = struct { + embed + Timestamp *internal.DateTime `json:"timestamp"` + }{ + embed: embed(*u), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *u = UtcTimestampWithTimezoneOffset(unmarshaler.embed) + u.Timestamp = unmarshaler.Timestamp.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *u) + if err != nil { + return err + } + u.extraProperties = extraProperties + u.rawJSON = json.RawMessage(data) + return nil +} + +func (u *UtcTimestampWithTimezoneOffset) MarshalJSON() ([]byte, error) { + type embed UtcTimestampWithTimezoneOffset + var marshaler = struct { + embed + Timestamp *internal.DateTime `json:"timestamp"` + }{ + embed: embed(*u), + Timestamp: internal.NewDateTime(u.Timestamp), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (u *UtcTimestampWithTimezoneOffset) String() string { + if len(u.rawJSON) > 0 { + if value, err := internal.StringifyJSON(u.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(u); err == nil { + return value + } + return fmt.Sprintf("%#v", u) +} + var ( validationErrorFieldLoc = big.NewInt(1 << 0) validationErrorFieldMsg = big.NewInt(1 << 1) diff --git a/user.go b/user.go index 0363a10..f9e7e39 100644 --- a/user.go +++ b/user.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) @@ -77,6 +77,27 @@ func (u *UserCreateBody) SetIngestionEnd(ingestionEnd *string) { u.require(userCreateBodyFieldIngestionEnd) } +func (u *UserCreateBody) UnmarshalJSON(data []byte) error { + type unmarshaler UserCreateBody + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *u = UserCreateBody(body) + return nil +} + +func (u *UserCreateBody) MarshalJSON() ([]byte, error) { + type embed UserCreateBody + var marshaler = struct { + embed + }{ + embed: embed(*u), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( createInsuranceRequestFieldPayorCode = big.NewInt(1 << 0) createInsuranceRequestFieldMemberId = big.NewInt(1 << 1) @@ -92,7 +113,7 @@ type CreateInsuranceRequest struct { MemberId string `json:"member_id" url:"-"` GroupId *string `json:"group_id,omitempty" url:"-"` Relationship ResponsibleRelationship `json:"relationship" url:"-"` - Insured *VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails `json:"insured,omitempty" url:"-"` + Insured *VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails `json:"insured" url:"-"` Guarantor *GuarantorDetails `json:"guarantor,omitempty" url:"-"` IsPrimary *bool `json:"is_primary,omitempty" url:"-"` @@ -156,6 +177,27 @@ func (c *CreateInsuranceRequest) SetIsPrimary(isPrimary *bool) { c.require(createInsuranceRequestFieldIsPrimary) } +func (c *CreateInsuranceRequest) UnmarshalJSON(data []byte) error { + type unmarshaler CreateInsuranceRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *c = CreateInsuranceRequest(body) + return nil +} + +func (c *CreateInsuranceRequest) MarshalJSON() ([]byte, error) { + type embed CreateInsuranceRequest + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( createUserPortalUrlBodyFieldContext = big.NewInt(1 << 0) createUserPortalUrlBodyFieldOrderId = big.NewInt(1 << 1) @@ -198,6 +240,27 @@ func (c *CreateUserPortalUrlBody) SetOrderId(orderId *string) { c.require(createUserPortalUrlBodyFieldOrderId) } +func (c *CreateUserPortalUrlBody) UnmarshalJSON(data []byte) error { + type unmarshaler CreateUserPortalUrlBody + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *c = CreateUserPortalUrlBody(body) + return nil +} + +func (c *CreateUserPortalUrlBody) MarshalJSON() ([]byte, error) { + type embed CreateUserPortalUrlBody + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( userGetAllRequestFieldOffset = big.NewInt(1 << 0) userGetAllRequestFieldLimit = big.NewInt(1 << 1) @@ -324,6 +387,27 @@ func (u *UserPatchBody) SetClientUserId(clientUserId *string) { u.require(userPatchBodyFieldClientUserId) } +func (u *UserPatchBody) UnmarshalJSON(data []byte) error { + type unmarshaler UserPatchBody + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *u = UserPatchBody(body) + return nil +} + +func (u *UserPatchBody) MarshalJSON() ([]byte, error) { + type embed UserPatchBody + var marshaler = struct { + embed + }{ + embed: embed(*u), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} + var ( userRefreshRequestFieldTimeout = big.NewInt(1 << 0) ) @@ -2168,6 +2252,180 @@ func (t *TimeseriesMetricPoint) String() string { return fmt.Sprintf("%#v", t) } +var ( + userAddressFieldFirstLine = big.NewInt(1 << 0) + userAddressFieldSecondLine = big.NewInt(1 << 1) + userAddressFieldCountry = big.NewInt(1 << 2) + userAddressFieldZip = big.NewInt(1 << 3) + userAddressFieldCity = big.NewInt(1 << 4) + userAddressFieldState = big.NewInt(1 << 5) + userAddressFieldAccessNotes = big.NewInt(1 << 6) +) + +type UserAddress struct { + FirstLine string `json:"first_line" url:"first_line"` + SecondLine *string `json:"second_line,omitempty" url:"second_line,omitempty"` + Country string `json:"country" url:"country"` + Zip string `json:"zip" url:"zip"` + City string `json:"city" url:"city"` + State string `json:"state" url:"state"` + AccessNotes *string `json:"access_notes,omitempty" url:"access_notes,omitempty"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (u *UserAddress) GetFirstLine() string { + if u == nil { + return "" + } + return u.FirstLine +} + +func (u *UserAddress) GetSecondLine() *string { + if u == nil { + return nil + } + return u.SecondLine +} + +func (u *UserAddress) GetCountry() string { + if u == nil { + return "" + } + return u.Country +} + +func (u *UserAddress) GetZip() string { + if u == nil { + return "" + } + return u.Zip +} + +func (u *UserAddress) GetCity() string { + if u == nil { + return "" + } + return u.City +} + +func (u *UserAddress) GetState() string { + if u == nil { + return "" + } + return u.State +} + +func (u *UserAddress) GetAccessNotes() *string { + if u == nil { + return nil + } + return u.AccessNotes +} + +func (u *UserAddress) GetExtraProperties() map[string]interface{} { + return u.extraProperties +} + +func (u *UserAddress) require(field *big.Int) { + if u.explicitFields == nil { + u.explicitFields = big.NewInt(0) + } + u.explicitFields.Or(u.explicitFields, field) +} + +// SetFirstLine sets the FirstLine field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UserAddress) SetFirstLine(firstLine string) { + u.FirstLine = firstLine + u.require(userAddressFieldFirstLine) +} + +// SetSecondLine sets the SecondLine field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UserAddress) SetSecondLine(secondLine *string) { + u.SecondLine = secondLine + u.require(userAddressFieldSecondLine) +} + +// SetCountry sets the Country field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UserAddress) SetCountry(country string) { + u.Country = country + u.require(userAddressFieldCountry) +} + +// SetZip sets the Zip field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UserAddress) SetZip(zip string) { + u.Zip = zip + u.require(userAddressFieldZip) +} + +// SetCity sets the City field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UserAddress) SetCity(city string) { + u.City = city + u.require(userAddressFieldCity) +} + +// SetState sets the State field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UserAddress) SetState(state string) { + u.State = state + u.require(userAddressFieldState) +} + +// SetAccessNotes sets the AccessNotes field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (u *UserAddress) SetAccessNotes(accessNotes *string) { + u.AccessNotes = accessNotes + u.require(userAddressFieldAccessNotes) +} + +func (u *UserAddress) UnmarshalJSON(data []byte) error { + type unmarshaler UserAddress + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *u = UserAddress(value) + extraProperties, err := internal.ExtractExtraProperties(data, *u) + if err != nil { + return err + } + u.extraProperties = extraProperties + u.rawJSON = json.RawMessage(data) + return nil +} + +func (u *UserAddress) MarshalJSON() ([]byte, error) { + type embed UserAddress + var marshaler = struct { + embed + }{ + embed: embed(*u), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (u *UserAddress) String() string { + if len(u.rawJSON) > 0 { + if value, err := internal.StringifyJSON(u.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(u); err == nil { + return value + } + return fmt.Sprintf("%#v", u) +} + var ( userInfoFieldFirstName = big.NewInt(1 << 0) userInfoFieldLastName = big.NewInt(1 << 1) @@ -2190,7 +2448,7 @@ type UserInfo struct { PhoneNumber string `json:"phone_number" url:"phone_number"` Gender string `json:"gender" url:"gender"` Dob string `json:"dob" url:"dob"` - Address *Address `json:"address" url:"address"` + Address *UserAddress `json:"address" url:"address"` MedicalProxy *GuarantorDetails `json:"medical_proxy,omitempty" url:"medical_proxy,omitempty"` Race *Race `json:"race,omitempty" url:"race,omitempty"` Ethnicity *Ethnicity `json:"ethnicity,omitempty" url:"ethnicity,omitempty"` @@ -2246,7 +2504,7 @@ func (u *UserInfo) GetDob() string { return u.Dob } -func (u *UserInfo) GetAddress() *Address { +func (u *UserInfo) GetAddress() *UserAddress { if u == nil { return nil } @@ -2343,7 +2601,7 @@ func (u *UserInfo) SetDob(dob string) { // SetAddress sets the Address field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (u *UserInfo) SetAddress(address *Address) { +func (u *UserInfo) SetAddress(address *UserAddress) { u.Address = address u.require(userInfoFieldAddress) } @@ -3000,7 +3258,7 @@ type UserInfoCreateRequest struct { PhoneNumber string `json:"phone_number" url:"-"` Gender string `json:"gender" url:"-"` Dob string `json:"dob" url:"-"` - Address *Address `json:"address,omitempty" url:"-"` + Address *UserAddress `json:"address" url:"-"` MedicalProxy *GuarantorDetails `json:"medical_proxy,omitempty" url:"-"` Race *Race `json:"race,omitempty" url:"-"` Ethnicity *Ethnicity `json:"ethnicity,omitempty" url:"-"` @@ -3062,7 +3320,7 @@ func (u *UserInfoCreateRequest) SetDob(dob string) { // SetAddress sets the Address field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (u *UserInfoCreateRequest) SetAddress(address *Address) { +func (u *UserInfoCreateRequest) SetAddress(address *UserAddress) { u.Address = address u.require(userInfoCreateRequestFieldAddress) } @@ -3101,3 +3359,24 @@ func (u *UserInfoCreateRequest) SetGenderIdentity(genderIdentity *GenderIdentity u.GenderIdentity = genderIdentity u.require(userInfoCreateRequestFieldGenderIdentity) } + +func (u *UserInfoCreateRequest) UnmarshalJSON(data []byte) error { + type unmarshaler UserInfoCreateRequest + var body unmarshaler + if err := json.Unmarshal(data, &body); err != nil { + return err + } + *u = UserInfoCreateRequest(body) + return nil +} + +func (u *UserInfoCreateRequest) MarshalJSON() ([]byte, error) { + type embed UserInfoCreateRequest + var marshaler = struct { + embed + }{ + embed: embed(*u), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, u.explicitFields) + return json.Marshal(explicitMarshaler) +} diff --git a/user/client.go b/user/client.go index 5e8cdbd..1315544 100644 --- a/user/client.go +++ b/user/client.go @@ -4,10 +4,10 @@ package user import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -35,9 +35,9 @@ func NewClient(options *core.RequestOptions) *Client { // GET All users for team. func (c *Client) GetAll( ctx context.Context, - request *vitalgo.UserGetAllRequest, + request *v505.UserGetAllRequest, opts ...option.RequestOption, -) (*vitalgo.PaginatedUsersResponse, error) { +) (*v505.PaginatedUsersResponse, error) { response, err := c.WithRawResponse.GetAll( ctx, request, @@ -52,9 +52,9 @@ func (c *Client) GetAll( // POST Create a Vital user given a client_user_id and returns the user_id. func (c *Client) Create( ctx context.Context, - request *vitalgo.UserCreateBody, + request *v505.UserCreateBody, opts ...option.RequestOption, -) (*vitalgo.ClientFacingUserKey, error) { +) (*v505.ClientFacingUserKey, error) { response, err := c.WithRawResponse.Create( ctx, request, @@ -70,7 +70,7 @@ func (c *Client) Create( func (c *Client) GetTeamMetrics( ctx context.Context, opts ...option.RequestOption, -) (*vitalgo.MetricsResult, error) { +) (*v505.MetricsResult, error) { response, err := c.WithRawResponse.GetTeamMetrics( ctx, opts..., @@ -86,7 +86,7 @@ func (c *Client) GetConnectedProviders( ctx context.Context, userId string, opts ...option.RequestOption, -) (map[string][]*vitalgo.ClientFacingProviderWithStatus, error) { +) (map[string][]*v505.ClientFacingProviderWithStatus, error) { response, err := c.WithRawResponse.GetConnectedProviders( ctx, userId, @@ -102,7 +102,7 @@ func (c *Client) GetLatestUserInfo( ctx context.Context, userId string, opts ...option.RequestOption, -) (*vitalgo.UserInfo, error) { +) (*v505.UserInfo, error) { response, err := c.WithRawResponse.GetLatestUserInfo( ctx, userId, @@ -117,9 +117,9 @@ func (c *Client) GetLatestUserInfo( func (c *Client) CreateInsurance( ctx context.Context, userId string, - request *vitalgo.CreateInsuranceRequest, + request *v505.CreateInsuranceRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingInsurance, error) { +) (*v505.ClientFacingInsurance, error) { response, err := c.WithRawResponse.CreateInsurance( ctx, userId, @@ -135,9 +135,9 @@ func (c *Client) CreateInsurance( func (c *Client) GetLatestInsurance( ctx context.Context, userId string, - request *vitalgo.UserGetLatestInsuranceRequest, + request *v505.UserGetLatestInsuranceRequest, opts ...option.RequestOption, -) (*vitalgo.ClientFacingInsurance, error) { +) (*v505.ClientFacingInsurance, error) { response, err := c.WithRawResponse.GetLatestInsurance( ctx, userId, @@ -153,9 +153,9 @@ func (c *Client) GetLatestInsurance( func (c *Client) UpsertUserInfo( ctx context.Context, userId string, - request *vitalgo.UserInfoCreateRequest, + request *v505.UserInfoCreateRequest, opts ...option.RequestOption, -) (*vitalgo.UserInfo, error) { +) (*v505.UserInfo, error) { response, err := c.WithRawResponse.UpsertUserInfo( ctx, userId, @@ -174,7 +174,7 @@ func (c *Client) GetByClientUserId( // A unique ID representing the end user. Typically this will be a user ID number from your application. Personally identifiable information, such as an email address or phone number, should not be used in the client_user_id. clientUserId string, opts ...option.RequestOption, -) (*vitalgo.ClientFacingUser, error) { +) (*v505.ClientFacingUser, error) { response, err := c.WithRawResponse.GetByClientUserId( ctx, clientUserId, @@ -190,9 +190,9 @@ func (c *Client) DeregisterProvider( ctx context.Context, userId string, // Provider slug. e.g., `oura`, `fitbit`, `garmin`. - provider *vitalgo.Providers, + provider *v505.Providers, opts ...option.RequestOption, -) (*vitalgo.UserSuccessResponse, error) { +) (*v505.UserSuccessResponse, error) { response, err := c.WithRawResponse.DeregisterProvider( ctx, userId, @@ -209,7 +209,7 @@ func (c *Client) Get( ctx context.Context, userId string, opts ...option.RequestOption, -) (*vitalgo.ClientFacingUser, error) { +) (*v505.ClientFacingUser, error) { response, err := c.WithRawResponse.Get( ctx, userId, @@ -225,7 +225,7 @@ func (c *Client) Delete( ctx context.Context, userId string, opts ...option.RequestOption, -) (*vitalgo.UserSuccessResponse, error) { +) (*v505.UserSuccessResponse, error) { response, err := c.WithRawResponse.Delete( ctx, userId, @@ -240,7 +240,7 @@ func (c *Client) Delete( func (c *Client) Patch( ctx context.Context, userId string, - request *vitalgo.UserPatchBody, + request *v505.UserPatchBody, opts ...option.RequestOption, ) error { _, err := c.WithRawResponse.Patch( @@ -257,9 +257,9 @@ func (c *Client) Patch( func (c *Client) UndoDelete( ctx context.Context, - request *vitalgo.UserUndoDeleteRequest, + request *v505.UserUndoDeleteRequest, opts ...option.RequestOption, -) (*vitalgo.UserSuccessResponse, error) { +) (*v505.UserSuccessResponse, error) { response, err := c.WithRawResponse.UndoDelete( ctx, request, @@ -275,9 +275,9 @@ func (c *Client) UndoDelete( func (c *Client) Refresh( ctx context.Context, userId string, - request *vitalgo.UserRefreshRequest, + request *v505.UserRefreshRequest, opts ...option.RequestOption, -) (*vitalgo.UserRefreshSuccessResponse, error) { +) (*v505.UserRefreshSuccessResponse, error) { response, err := c.WithRawResponse.Refresh( ctx, userId, @@ -294,7 +294,7 @@ func (c *Client) GetDevices( ctx context.Context, userId string, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingDevice, error) { +) ([]*v505.ClientFacingDevice, error) { response, err := c.WithRawResponse.GetDevices( ctx, userId, @@ -311,7 +311,7 @@ func (c *Client) GetDevice( userId string, deviceId string, opts ...option.RequestOption, -) (*vitalgo.ClientFacingDevice, error) { +) (*v505.ClientFacingDevice, error) { response, err := c.WithRawResponse.GetDevice( ctx, userId, @@ -328,7 +328,7 @@ func (c *Client) GetUserSignInToken( ctx context.Context, userId string, opts ...option.RequestOption, -) (*vitalgo.UserSignInTokenResponse, error) { +) (*v505.UserSignInTokenResponse, error) { response, err := c.WithRawResponse.GetUserSignInToken( ctx, userId, @@ -343,9 +343,9 @@ func (c *Client) GetUserSignInToken( func (c *Client) CreatePortalUrl( ctx context.Context, userId string, - request *vitalgo.CreateUserPortalUrlBody, + request *v505.CreateUserPortalUrlBody, opts ...option.RequestOption, -) (*vitalgo.CreateUserPortalUrlResponse, error) { +) (*v505.CreateUserPortalUrlResponse, error) { response, err := c.WithRawResponse.CreatePortalUrl( ctx, userId, diff --git a/user/raw_client.go b/user/raw_client.go index 901a688..4fead44 100644 --- a/user/raw_client.go +++ b/user/raw_client.go @@ -4,10 +4,10 @@ package user import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -32,9 +32,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) GetAll( ctx context.Context, - request *vitalgo.UserGetAllRequest, + request *v505.UserGetAllRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.PaginatedUsersResponse], error) { +) (*core.Response[*v505.PaginatedUsersResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -53,7 +53,7 @@ func (r *RawClient) GetAll( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.PaginatedUsersResponse + var response *v505.PaginatedUsersResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -65,13 +65,13 @@ func (r *RawClient) GetAll( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.PaginatedUsersResponse]{ + return &core.Response[*v505.PaginatedUsersResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -80,9 +80,9 @@ func (r *RawClient) GetAll( func (r *RawClient) Create( ctx context.Context, - request *vitalgo.UserCreateBody, + request *v505.UserCreateBody, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingUserKey], error) { +) (*core.Response[*v505.ClientFacingUserKey], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -95,7 +95,7 @@ func (r *RawClient) Create( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.ClientFacingUserKey + var response *v505.ClientFacingUserKey raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -108,13 +108,13 @@ func (r *RawClient) Create( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingUserKey]{ + return &core.Response[*v505.ClientFacingUserKey]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -124,7 +124,7 @@ func (r *RawClient) Create( func (r *RawClient) GetTeamMetrics( ctx context.Context, opts ...option.RequestOption, -) (*core.Response[*vitalgo.MetricsResult], error) { +) (*core.Response[*v505.MetricsResult], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -136,7 +136,7 @@ func (r *RawClient) GetTeamMetrics( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.MetricsResult + var response *v505.MetricsResult raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -153,7 +153,7 @@ func (r *RawClient) GetTeamMetrics( if err != nil { return nil, err } - return &core.Response[*vitalgo.MetricsResult]{ + return &core.Response[*v505.MetricsResult]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -164,7 +164,7 @@ func (r *RawClient) GetConnectedProviders( ctx context.Context, userId string, opts ...option.RequestOption, -) (*core.Response[map[string][]*vitalgo.ClientFacingProviderWithStatus], error) { +) (*core.Response[map[string][]*v505.ClientFacingProviderWithStatus], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -179,7 +179,7 @@ func (r *RawClient) GetConnectedProviders( r.options.ToHeader(), options.ToHeader(), ) - var response map[string][]*vitalgo.ClientFacingProviderWithStatus + var response map[string][]*v505.ClientFacingProviderWithStatus raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -191,13 +191,13 @@ func (r *RawClient) GetConnectedProviders( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[map[string][]*vitalgo.ClientFacingProviderWithStatus]{ + return &core.Response[map[string][]*v505.ClientFacingProviderWithStatus]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -208,7 +208,7 @@ func (r *RawClient) GetLatestUserInfo( ctx context.Context, userId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.UserInfo], error) { +) (*core.Response[*v505.UserInfo], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -223,7 +223,7 @@ func (r *RawClient) GetLatestUserInfo( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.UserInfo + var response *v505.UserInfo raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -235,13 +235,13 @@ func (r *RawClient) GetLatestUserInfo( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.UserInfo]{ + return &core.Response[*v505.UserInfo]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -251,9 +251,9 @@ func (r *RawClient) GetLatestUserInfo( func (r *RawClient) CreateInsurance( ctx context.Context, userId string, - request *vitalgo.CreateInsuranceRequest, + request *v505.CreateInsuranceRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingInsurance], error) { +) (*core.Response[*v505.ClientFacingInsurance], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -269,7 +269,7 @@ func (r *RawClient) CreateInsurance( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.ClientFacingInsurance + var response *v505.ClientFacingInsurance raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -282,13 +282,13 @@ func (r *RawClient) CreateInsurance( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingInsurance]{ + return &core.Response[*v505.ClientFacingInsurance]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -298,9 +298,9 @@ func (r *RawClient) CreateInsurance( func (r *RawClient) GetLatestInsurance( ctx context.Context, userId string, - request *vitalgo.UserGetLatestInsuranceRequest, + request *v505.UserGetLatestInsuranceRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingInsurance], error) { +) (*core.Response[*v505.ClientFacingInsurance], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -322,7 +322,7 @@ func (r *RawClient) GetLatestInsurance( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingInsurance + var response *v505.ClientFacingInsurance raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -334,13 +334,13 @@ func (r *RawClient) GetLatestInsurance( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingInsurance]{ + return &core.Response[*v505.ClientFacingInsurance]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -350,9 +350,9 @@ func (r *RawClient) GetLatestInsurance( func (r *RawClient) UpsertUserInfo( ctx context.Context, userId string, - request *vitalgo.UserInfoCreateRequest, + request *v505.UserInfoCreateRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.UserInfo], error) { +) (*core.Response[*v505.UserInfo], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -368,7 +368,7 @@ func (r *RawClient) UpsertUserInfo( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.UserInfo + var response *v505.UserInfo raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -381,13 +381,13 @@ func (r *RawClient) UpsertUserInfo( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.UserInfo]{ + return &core.Response[*v505.UserInfo]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -399,7 +399,7 @@ func (r *RawClient) GetByClientUserId( // A unique ID representing the end user. Typically this will be a user ID number from your application. Personally identifiable information, such as an email address or phone number, should not be used in the client_user_id. clientUserId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingUser], error) { +) (*core.Response[*v505.ClientFacingUser], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -414,7 +414,7 @@ func (r *RawClient) GetByClientUserId( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingUser + var response *v505.ClientFacingUser raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -426,13 +426,13 @@ func (r *RawClient) GetByClientUserId( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingUser]{ + return &core.Response[*v505.ClientFacingUser]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -443,9 +443,9 @@ func (r *RawClient) DeregisterProvider( ctx context.Context, userId string, // Provider slug. e.g., `oura`, `fitbit`, `garmin`. - provider *vitalgo.Providers, + provider *v505.Providers, opts ...option.RequestOption, -) (*core.Response[*vitalgo.UserSuccessResponse], error) { +) (*core.Response[*v505.UserSuccessResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -461,7 +461,7 @@ func (r *RawClient) DeregisterProvider( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.UserSuccessResponse + var response *v505.UserSuccessResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -473,13 +473,13 @@ func (r *RawClient) DeregisterProvider( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.UserSuccessResponse]{ + return &core.Response[*v505.UserSuccessResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -490,7 +490,7 @@ func (r *RawClient) Get( ctx context.Context, userId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingUser], error) { +) (*core.Response[*v505.ClientFacingUser], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -505,7 +505,7 @@ func (r *RawClient) Get( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingUser + var response *v505.ClientFacingUser raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -517,13 +517,13 @@ func (r *RawClient) Get( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingUser]{ + return &core.Response[*v505.ClientFacingUser]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -534,7 +534,7 @@ func (r *RawClient) Delete( ctx context.Context, userId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.UserSuccessResponse], error) { +) (*core.Response[*v505.UserSuccessResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -549,7 +549,7 @@ func (r *RawClient) Delete( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.UserSuccessResponse + var response *v505.UserSuccessResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -561,13 +561,13 @@ func (r *RawClient) Delete( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.UserSuccessResponse]{ + return &core.Response[*v505.UserSuccessResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -577,7 +577,7 @@ func (r *RawClient) Delete( func (r *RawClient) Patch( ctx context.Context, userId string, - request *vitalgo.UserPatchBody, + request *v505.UserPatchBody, opts ...option.RequestOption, ) (*core.Response[any], error) { options := core.NewRequestOptions(opts...) @@ -606,7 +606,7 @@ func (r *RawClient) Patch( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Request: request, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { @@ -621,9 +621,9 @@ func (r *RawClient) Patch( func (r *RawClient) UndoDelete( ctx context.Context, - request *vitalgo.UserUndoDeleteRequest, + request *v505.UserUndoDeleteRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.UserSuccessResponse], error) { +) (*core.Response[*v505.UserSuccessResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -642,7 +642,7 @@ func (r *RawClient) UndoDelete( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.UserSuccessResponse + var response *v505.UserSuccessResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -654,13 +654,13 @@ func (r *RawClient) UndoDelete( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.UserSuccessResponse]{ + return &core.Response[*v505.UserSuccessResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -670,9 +670,9 @@ func (r *RawClient) UndoDelete( func (r *RawClient) Refresh( ctx context.Context, userId string, - request *vitalgo.UserRefreshRequest, + request *v505.UserRefreshRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.UserRefreshSuccessResponse], error) { +) (*core.Response[*v505.UserRefreshSuccessResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -694,7 +694,7 @@ func (r *RawClient) Refresh( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.UserRefreshSuccessResponse + var response *v505.UserRefreshSuccessResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -706,13 +706,13 @@ func (r *RawClient) Refresh( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.UserRefreshSuccessResponse]{ + return &core.Response[*v505.UserRefreshSuccessResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -723,7 +723,7 @@ func (r *RawClient) GetDevices( ctx context.Context, userId string, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingDevice], error) { +) (*core.Response[[]*v505.ClientFacingDevice], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -738,7 +738,7 @@ func (r *RawClient) GetDevices( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingDevice + var response []*v505.ClientFacingDevice raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -750,13 +750,13 @@ func (r *RawClient) GetDevices( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingDevice]{ + return &core.Response[[]*v505.ClientFacingDevice]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -768,7 +768,7 @@ func (r *RawClient) GetDevice( userId string, deviceId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingDevice], error) { +) (*core.Response[*v505.ClientFacingDevice], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -784,7 +784,7 @@ func (r *RawClient) GetDevice( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingDevice + var response *v505.ClientFacingDevice raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -796,13 +796,13 @@ func (r *RawClient) GetDevice( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingDevice]{ + return &core.Response[*v505.ClientFacingDevice]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -813,7 +813,7 @@ func (r *RawClient) GetUserSignInToken( ctx context.Context, userId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.UserSignInTokenResponse], error) { +) (*core.Response[*v505.UserSignInTokenResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -828,7 +828,7 @@ func (r *RawClient) GetUserSignInToken( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.UserSignInTokenResponse + var response *v505.UserSignInTokenResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -840,13 +840,13 @@ func (r *RawClient) GetUserSignInToken( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.UserSignInTokenResponse]{ + return &core.Response[*v505.UserSignInTokenResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -856,9 +856,9 @@ func (r *RawClient) GetUserSignInToken( func (r *RawClient) CreatePortalUrl( ctx context.Context, userId string, - request *vitalgo.CreateUserPortalUrlBody, + request *v505.CreateUserPortalUrlBody, opts ...option.RequestOption, -) (*core.Response[*vitalgo.CreateUserPortalUrlResponse], error) { +) (*core.Response[*v505.CreateUserPortalUrlResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -874,7 +874,7 @@ func (r *RawClient) CreatePortalUrl( options.ToHeader(), ) headers.Add("Content-Type", "application/json") - var response *vitalgo.CreateUserPortalUrlResponse + var response *v505.CreateUserPortalUrlResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -887,13 +887,13 @@ func (r *RawClient) CreatePortalUrl( Client: options.HTTPClient, Request: request, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.CreateUserPortalUrlResponse]{ + return &core.Response[*v505.CreateUserPortalUrlResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/vitals.go b/vitals.go index d23f979..d4a7f98 100644 --- a/vitals.go +++ b/vitals.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) diff --git a/vitals/client.go b/vitals/client.go index e1037bc..0ccaa54 100644 --- a/vitals/client.go +++ b/vitals/client.go @@ -4,10 +4,10 @@ package vitals import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -35,9 +35,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) WorkoutSwimmingStrokeGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsWorkoutSwimmingStrokeGroupedRequest, + request *v505.VitalsWorkoutSwimmingStrokeGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedWorkoutSwimmingStrokeResponse, error) { +) (*v505.GroupedWorkoutSwimmingStrokeResponse, error) { response, err := c.WithRawResponse.WorkoutSwimmingStrokeGrouped( ctx, userId, @@ -53,9 +53,9 @@ func (c *Client) WorkoutSwimmingStrokeGrouped( func (c *Client) WorkoutDistanceGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsWorkoutDistanceGroupedRequest, + request *v505.VitalsWorkoutDistanceGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedWorkoutDistanceResponse, error) { +) (*v505.GroupedWorkoutDistanceResponse, error) { response, err := c.WithRawResponse.WorkoutDistanceGrouped( ctx, userId, @@ -71,9 +71,9 @@ func (c *Client) WorkoutDistanceGrouped( func (c *Client) HeartRateRecoveryOneMinuteGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsHeartRateRecoveryOneMinuteGroupedRequest, + request *v505.VitalsHeartRateRecoveryOneMinuteGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedHeartRateRecoveryOneMinuteResponse, error) { +) (*v505.GroupedHeartRateRecoveryOneMinuteResponse, error) { response, err := c.WithRawResponse.HeartRateRecoveryOneMinuteGrouped( ctx, userId, @@ -89,9 +89,9 @@ func (c *Client) HeartRateRecoveryOneMinuteGrouped( func (c *Client) WaistCircumferenceGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsWaistCircumferenceGroupedRequest, + request *v505.VitalsWaistCircumferenceGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedWaistCircumferenceResponse, error) { +) (*v505.GroupedWaistCircumferenceResponse, error) { response, err := c.WithRawResponse.WaistCircumferenceGrouped( ctx, userId, @@ -107,9 +107,9 @@ func (c *Client) WaistCircumferenceGrouped( func (c *Client) LeanBodyMassGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsLeanBodyMassGroupedRequest, + request *v505.VitalsLeanBodyMassGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedLeanBodyMassResponse, error) { +) (*v505.GroupedLeanBodyMassResponse, error) { response, err := c.WithRawResponse.LeanBodyMassGrouped( ctx, userId, @@ -125,9 +125,9 @@ func (c *Client) LeanBodyMassGrouped( func (c *Client) BodyMassIndexGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBodyMassIndexGroupedRequest, + request *v505.VitalsBodyMassIndexGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedBodyMassIndexResponse, error) { +) (*v505.GroupedBodyMassIndexResponse, error) { response, err := c.WithRawResponse.BodyMassIndexGrouped( ctx, userId, @@ -143,9 +143,9 @@ func (c *Client) BodyMassIndexGrouped( func (c *Client) BasalBodyTemperatureGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBasalBodyTemperatureGroupedRequest, + request *v505.VitalsBasalBodyTemperatureGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedBasalBodyTemperatureResponse, error) { +) (*v505.GroupedBasalBodyTemperatureResponse, error) { response, err := c.WithRawResponse.BasalBodyTemperatureGrouped( ctx, userId, @@ -161,9 +161,9 @@ func (c *Client) BasalBodyTemperatureGrouped( func (c *Client) HandwashingGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsHandwashingGroupedRequest, + request *v505.VitalsHandwashingGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedHandwashingResponse, error) { +) (*v505.GroupedHandwashingResponse, error) { response, err := c.WithRawResponse.HandwashingGrouped( ctx, userId, @@ -179,9 +179,9 @@ func (c *Client) HandwashingGrouped( func (c *Client) DaylightExposureGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsDaylightExposureGroupedRequest, + request *v505.VitalsDaylightExposureGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedDaylightExposureResponse, error) { +) (*v505.GroupedDaylightExposureResponse, error) { response, err := c.WithRawResponse.DaylightExposureGrouped( ctx, userId, @@ -197,9 +197,9 @@ func (c *Client) DaylightExposureGrouped( func (c *Client) UvExposureGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsUvExposureGroupedRequest, + request *v505.VitalsUvExposureGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedUvExposureResponse, error) { +) (*v505.GroupedUvExposureResponse, error) { response, err := c.WithRawResponse.UvExposureGrouped( ctx, userId, @@ -215,9 +215,9 @@ func (c *Client) UvExposureGrouped( func (c *Client) FallGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsFallGroupedRequest, + request *v505.VitalsFallGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedFallResponse, error) { +) (*v505.GroupedFallResponse, error) { response, err := c.WithRawResponse.FallGrouped( ctx, userId, @@ -233,9 +233,9 @@ func (c *Client) FallGrouped( func (c *Client) InhalerUsageGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsInhalerUsageGroupedRequest, + request *v505.VitalsInhalerUsageGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedInhalerUsageResponse, error) { +) (*v505.GroupedInhalerUsageResponse, error) { response, err := c.WithRawResponse.InhalerUsageGrouped( ctx, userId, @@ -251,9 +251,9 @@ func (c *Client) InhalerUsageGrouped( func (c *Client) PeakExpiratoryFlowRateGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsPeakExpiratoryFlowRateGroupedRequest, + request *v505.VitalsPeakExpiratoryFlowRateGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedPeakExpiratoryFlowRateResponse, error) { +) (*v505.GroupedPeakExpiratoryFlowRateResponse, error) { response, err := c.WithRawResponse.PeakExpiratoryFlowRateGrouped( ctx, userId, @@ -269,9 +269,9 @@ func (c *Client) PeakExpiratoryFlowRateGrouped( func (c *Client) ForcedVitalCapacityGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsForcedVitalCapacityGroupedRequest, + request *v505.VitalsForcedVitalCapacityGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedForcedVitalCapacityResponse, error) { +) (*v505.GroupedForcedVitalCapacityResponse, error) { response, err := c.WithRawResponse.ForcedVitalCapacityGrouped( ctx, userId, @@ -287,9 +287,9 @@ func (c *Client) ForcedVitalCapacityGrouped( func (c *Client) ForcedExpiratoryVolume1Grouped( ctx context.Context, userId string, - request *vitalgo.VitalsForcedExpiratoryVolume1GroupedRequest, + request *v505.VitalsForcedExpiratoryVolume1GroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedForcedExpiratoryVolume1Response, error) { +) (*v505.GroupedForcedExpiratoryVolume1Response, error) { response, err := c.WithRawResponse.ForcedExpiratoryVolume1Grouped( ctx, userId, @@ -305,9 +305,9 @@ func (c *Client) ForcedExpiratoryVolume1Grouped( func (c *Client) WheelchairPushGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsWheelchairPushGroupedRequest, + request *v505.VitalsWheelchairPushGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedWheelchairPushResponse, error) { +) (*v505.GroupedWheelchairPushResponse, error) { response, err := c.WithRawResponse.WheelchairPushGrouped( ctx, userId, @@ -323,9 +323,9 @@ func (c *Client) WheelchairPushGrouped( func (c *Client) SleepBreathingDisturbanceGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsSleepBreathingDisturbanceGroupedRequest, + request *v505.VitalsSleepBreathingDisturbanceGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedSleepBreathingDisturbanceResponse, error) { +) (*v505.GroupedSleepBreathingDisturbanceResponse, error) { response, err := c.WithRawResponse.SleepBreathingDisturbanceGrouped( ctx, userId, @@ -341,9 +341,9 @@ func (c *Client) SleepBreathingDisturbanceGrouped( func (c *Client) SleepApneaAlertGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsSleepApneaAlertGroupedRequest, + request *v505.VitalsSleepApneaAlertGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedSleepApneaAlertResponse, error) { +) (*v505.GroupedSleepApneaAlertResponse, error) { response, err := c.WithRawResponse.SleepApneaAlertGrouped( ctx, userId, @@ -359,9 +359,9 @@ func (c *Client) SleepApneaAlertGrouped( func (c *Client) StandDurationGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsStandDurationGroupedRequest, + request *v505.VitalsStandDurationGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedStandDurationResponse, error) { +) (*v505.GroupedStandDurationResponse, error) { response, err := c.WithRawResponse.StandDurationGrouped( ctx, userId, @@ -377,9 +377,9 @@ func (c *Client) StandDurationGrouped( func (c *Client) StandHourGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsStandHourGroupedRequest, + request *v505.VitalsStandHourGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedStandHourResponse, error) { +) (*v505.GroupedStandHourResponse, error) { response, err := c.WithRawResponse.StandHourGrouped( ctx, userId, @@ -395,9 +395,9 @@ func (c *Client) StandHourGrouped( func (c *Client) HeartRateAlertGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsHeartRateAlertGroupedRequest, + request *v505.VitalsHeartRateAlertGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedHeartRateAlertResponse, error) { +) (*v505.GroupedHeartRateAlertResponse, error) { response, err := c.WithRawResponse.HeartRateAlertGrouped( ctx, userId, @@ -413,9 +413,9 @@ func (c *Client) HeartRateAlertGrouped( func (c *Client) AfibBurdenGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsAfibBurdenGroupedRequest, + request *v505.VitalsAfibBurdenGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedAFibBurdenResponse, error) { +) (*v505.GroupedAFibBurdenResponse, error) { response, err := c.WithRawResponse.AfibBurdenGrouped( ctx, userId, @@ -431,9 +431,9 @@ func (c *Client) AfibBurdenGrouped( func (c *Client) WorkoutDurationGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsWorkoutDurationGroupedRequest, + request *v505.VitalsWorkoutDurationGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedWorkoutDurationResponse, error) { +) (*v505.GroupedWorkoutDurationResponse, error) { response, err := c.WithRawResponse.WorkoutDurationGrouped( ctx, userId, @@ -449,9 +449,9 @@ func (c *Client) WorkoutDurationGrouped( func (c *Client) Vo2MaxGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsVo2MaxGroupedRequest, + request *v505.VitalsVo2MaxGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedVo2MaxResponse, error) { +) (*v505.GroupedVo2MaxResponse, error) { response, err := c.WithRawResponse.Vo2MaxGrouped( ctx, userId, @@ -467,9 +467,9 @@ func (c *Client) Vo2MaxGrouped( func (c *Client) StressLevelGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsStressLevelGroupedRequest, + request *v505.VitalsStressLevelGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedStressLevelResponse, error) { +) (*v505.GroupedStressLevelResponse, error) { response, err := c.WithRawResponse.StressLevelGrouped( ctx, userId, @@ -485,9 +485,9 @@ func (c *Client) StressLevelGrouped( func (c *Client) MindfulnessMinutesGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsMindfulnessMinutesGroupedRequest, + request *v505.VitalsMindfulnessMinutesGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedMindfulnessMinutesResponse, error) { +) (*v505.GroupedMindfulnessMinutesResponse, error) { response, err := c.WithRawResponse.MindfulnessMinutesGrouped( ctx, userId, @@ -503,9 +503,9 @@ func (c *Client) MindfulnessMinutesGrouped( func (c *Client) CaffeineGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsCaffeineGroupedRequest, + request *v505.VitalsCaffeineGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedCaffeineResponse, error) { +) (*v505.GroupedCaffeineResponse, error) { response, err := c.WithRawResponse.CaffeineGrouped( ctx, userId, @@ -521,9 +521,9 @@ func (c *Client) CaffeineGrouped( func (c *Client) WaterGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsWaterGroupedRequest, + request *v505.VitalsWaterGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedWaterResponse, error) { +) (*v505.GroupedWaterResponse, error) { response, err := c.WithRawResponse.WaterGrouped( ctx, userId, @@ -539,9 +539,9 @@ func (c *Client) WaterGrouped( func (c *Client) StepsGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsStepsGroupedRequest, + request *v505.VitalsStepsGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedStepsResponse, error) { +) (*v505.GroupedStepsResponse, error) { response, err := c.WithRawResponse.StepsGrouped( ctx, userId, @@ -557,9 +557,9 @@ func (c *Client) StepsGrouped( func (c *Client) FloorsClimbedGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsFloorsClimbedGroupedRequest, + request *v505.VitalsFloorsClimbedGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedFloorsClimbedResponse, error) { +) (*v505.GroupedFloorsClimbedResponse, error) { response, err := c.WithRawResponse.FloorsClimbedGrouped( ctx, userId, @@ -575,9 +575,9 @@ func (c *Client) FloorsClimbedGrouped( func (c *Client) DistanceGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsDistanceGroupedRequest, + request *v505.VitalsDistanceGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedDistanceResponse, error) { +) (*v505.GroupedDistanceResponse, error) { response, err := c.WithRawResponse.DistanceGrouped( ctx, userId, @@ -593,9 +593,9 @@ func (c *Client) DistanceGrouped( func (c *Client) CaloriesBasalGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsCaloriesBasalGroupedRequest, + request *v505.VitalsCaloriesBasalGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedCaloriesBasalResponse, error) { +) (*v505.GroupedCaloriesBasalResponse, error) { response, err := c.WithRawResponse.CaloriesBasalGrouped( ctx, userId, @@ -611,9 +611,9 @@ func (c *Client) CaloriesBasalGrouped( func (c *Client) CaloriesActiveGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsCaloriesActiveGroupedRequest, + request *v505.VitalsCaloriesActiveGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedCaloriesActiveResponse, error) { +) (*v505.GroupedCaloriesActiveResponse, error) { response, err := c.WithRawResponse.CaloriesActiveGrouped( ctx, userId, @@ -629,9 +629,9 @@ func (c *Client) CaloriesActiveGrouped( func (c *Client) RespiratoryRateGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsRespiratoryRateGroupedRequest, + request *v505.VitalsRespiratoryRateGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedRespiratoryRateResponse, error) { +) (*v505.GroupedRespiratoryRateResponse, error) { response, err := c.WithRawResponse.RespiratoryRateGrouped( ctx, userId, @@ -647,9 +647,9 @@ func (c *Client) RespiratoryRateGrouped( func (c *Client) NoteGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsNoteGroupedRequest, + request *v505.VitalsNoteGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedNoteResponse, error) { +) (*v505.GroupedNoteResponse, error) { response, err := c.WithRawResponse.NoteGrouped( ctx, userId, @@ -665,9 +665,9 @@ func (c *Client) NoteGrouped( func (c *Client) InsulinInjectionGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsInsulinInjectionGroupedRequest, + request *v505.VitalsInsulinInjectionGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedInsulinInjectionResponse, error) { +) (*v505.GroupedInsulinInjectionResponse, error) { response, err := c.WithRawResponse.InsulinInjectionGrouped( ctx, userId, @@ -683,9 +683,9 @@ func (c *Client) InsulinInjectionGrouped( func (c *Client) IgeGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsIgeGroupedRequest, + request *v505.VitalsIgeGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedIgeResponse, error) { +) (*v505.GroupedIgeResponse, error) { response, err := c.WithRawResponse.IgeGrouped( ctx, userId, @@ -701,9 +701,9 @@ func (c *Client) IgeGrouped( func (c *Client) IggGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsIggGroupedRequest, + request *v505.VitalsIggGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedIggResponse, error) { +) (*v505.GroupedIggResponse, error) { response, err := c.WithRawResponse.IggGrouped( ctx, userId, @@ -719,9 +719,9 @@ func (c *Client) IggGrouped( func (c *Client) HypnogramGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsHypnogramGroupedRequest, + request *v505.VitalsHypnogramGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedHypnogramResponse, error) { +) (*v505.GroupedHypnogramResponse, error) { response, err := c.WithRawResponse.HypnogramGrouped( ctx, userId, @@ -737,9 +737,9 @@ func (c *Client) HypnogramGrouped( func (c *Client) HrvGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsHrvGroupedRequest, + request *v505.VitalsHrvGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedHrvResponse, error) { +) (*v505.GroupedHrvResponse, error) { response, err := c.WithRawResponse.HrvGrouped( ctx, userId, @@ -755,9 +755,9 @@ func (c *Client) HrvGrouped( func (c *Client) HeartrateGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsHeartrateGroupedRequest, + request *v505.VitalsHeartrateGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedHeartRateResponse, error) { +) (*v505.GroupedHeartRateResponse, error) { response, err := c.WithRawResponse.HeartrateGrouped( ctx, userId, @@ -773,9 +773,9 @@ func (c *Client) HeartrateGrouped( func (c *Client) GlucoseGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsGlucoseGroupedRequest, + request *v505.VitalsGlucoseGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedGlucoseResponse, error) { +) (*v505.GroupedGlucoseResponse, error) { response, err := c.WithRawResponse.GlucoseGrouped( ctx, userId, @@ -791,9 +791,9 @@ func (c *Client) GlucoseGrouped( func (c *Client) CholesterolGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsCholesterolGroupedRequest, + request *v505.VitalsCholesterolGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedCholesterolResponse, error) { +) (*v505.GroupedCholesterolResponse, error) { response, err := c.WithRawResponse.CholesterolGrouped( ctx, userId, @@ -809,9 +809,9 @@ func (c *Client) CholesterolGrouped( func (c *Client) CarbohydratesGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsCarbohydratesGroupedRequest, + request *v505.VitalsCarbohydratesGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedCarbohydratesResponse, error) { +) (*v505.GroupedCarbohydratesResponse, error) { response, err := c.WithRawResponse.CarbohydratesGrouped( ctx, userId, @@ -827,9 +827,9 @@ func (c *Client) CarbohydratesGrouped( func (c *Client) BodyTemperatureDeltaGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBodyTemperatureDeltaGroupedRequest, + request *v505.VitalsBodyTemperatureDeltaGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedBodyTemperatureDeltaResponse, error) { +) (*v505.GroupedBodyTemperatureDeltaResponse, error) { response, err := c.WithRawResponse.BodyTemperatureDeltaGrouped( ctx, userId, @@ -845,9 +845,9 @@ func (c *Client) BodyTemperatureDeltaGrouped( func (c *Client) BodyTemperatureGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBodyTemperatureGroupedRequest, + request *v505.VitalsBodyTemperatureGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedBodyTemperatureResponse, error) { +) (*v505.GroupedBodyTemperatureResponse, error) { response, err := c.WithRawResponse.BodyTemperatureGrouped( ctx, userId, @@ -863,9 +863,9 @@ func (c *Client) BodyTemperatureGrouped( func (c *Client) BodyWeightGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBodyWeightGroupedRequest, + request *v505.VitalsBodyWeightGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedBodyWeightResponse, error) { +) (*v505.GroupedBodyWeightResponse, error) { response, err := c.WithRawResponse.BodyWeightGrouped( ctx, userId, @@ -881,9 +881,9 @@ func (c *Client) BodyWeightGrouped( func (c *Client) BodyFatGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBodyFatGroupedRequest, + request *v505.VitalsBodyFatGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedBodyFatResponse, error) { +) (*v505.GroupedBodyFatResponse, error) { response, err := c.WithRawResponse.BodyFatGrouped( ctx, userId, @@ -899,9 +899,9 @@ func (c *Client) BodyFatGrouped( func (c *Client) BloodOxygenGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBloodOxygenGroupedRequest, + request *v505.VitalsBloodOxygenGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedBloodOxygenResponse, error) { +) (*v505.GroupedBloodOxygenResponse, error) { response, err := c.WithRawResponse.BloodOxygenGrouped( ctx, userId, @@ -917,9 +917,9 @@ func (c *Client) BloodOxygenGrouped( func (c *Client) ElectrocardiogramVoltageGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsElectrocardiogramVoltageGroupedRequest, + request *v505.VitalsElectrocardiogramVoltageGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedElectrocardiogramVoltageResponse, error) { +) (*v505.GroupedElectrocardiogramVoltageResponse, error) { response, err := c.WithRawResponse.ElectrocardiogramVoltageGrouped( ctx, userId, @@ -935,9 +935,9 @@ func (c *Client) ElectrocardiogramVoltageGrouped( func (c *Client) BloodPressureGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBloodPressureGroupedRequest, + request *v505.VitalsBloodPressureGroupedRequest, opts ...option.RequestOption, -) (*vitalgo.GroupedBloodPressureResponse, error) { +) (*v505.GroupedBloodPressureResponse, error) { response, err := c.WithRawResponse.BloodPressureGrouped( ctx, userId, @@ -953,9 +953,9 @@ func (c *Client) BloodPressureGrouped( func (c *Client) Vo2Max( ctx context.Context, userId string, - request *vitalgo.VitalsVo2MaxRequest, + request *v505.VitalsVo2MaxRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingVo2MaxTimeseries, error) { +) ([]*v505.ClientFacingVo2MaxTimeseries, error) { response, err := c.WithRawResponse.Vo2Max( ctx, userId, @@ -971,9 +971,9 @@ func (c *Client) Vo2Max( func (c *Client) StressLevel( ctx context.Context, userId string, - request *vitalgo.VitalsStressLevelRequest, + request *v505.VitalsStressLevelRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingStressLevelTimeseries, error) { +) ([]*v505.ClientFacingStressLevelTimeseries, error) { response, err := c.WithRawResponse.StressLevel( ctx, userId, @@ -989,9 +989,9 @@ func (c *Client) StressLevel( func (c *Client) MindfulnessMinutes( ctx context.Context, userId string, - request *vitalgo.VitalsMindfulnessMinutesRequest, + request *v505.VitalsMindfulnessMinutesRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingMindfulnessMinutesTimeseries, error) { +) ([]*v505.ClientFacingMindfulnessMinutesTimeseries, error) { response, err := c.WithRawResponse.MindfulnessMinutes( ctx, userId, @@ -1007,9 +1007,9 @@ func (c *Client) MindfulnessMinutes( func (c *Client) Caffeine( ctx context.Context, userId string, - request *vitalgo.VitalsCaffeineRequest, + request *v505.VitalsCaffeineRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingCaffeineTimeseries, error) { +) ([]*v505.ClientFacingCaffeineTimeseries, error) { response, err := c.WithRawResponse.Caffeine( ctx, userId, @@ -1025,9 +1025,9 @@ func (c *Client) Caffeine( func (c *Client) Water( ctx context.Context, userId string, - request *vitalgo.VitalsWaterRequest, + request *v505.VitalsWaterRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingWaterTimeseries, error) { +) ([]*v505.ClientFacingWaterTimeseries, error) { response, err := c.WithRawResponse.Water( ctx, userId, @@ -1043,9 +1043,9 @@ func (c *Client) Water( func (c *Client) Steps( ctx context.Context, userId string, - request *vitalgo.VitalsStepsRequest, + request *v505.VitalsStepsRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingStepsTimeseries, error) { +) ([]*v505.ClientFacingStepsTimeseries, error) { response, err := c.WithRawResponse.Steps( ctx, userId, @@ -1061,9 +1061,9 @@ func (c *Client) Steps( func (c *Client) FloorsClimbed( ctx context.Context, userId string, - request *vitalgo.VitalsFloorsClimbedRequest, + request *v505.VitalsFloorsClimbedRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingFloorsClimbedTimeseries, error) { +) ([]*v505.ClientFacingFloorsClimbedTimeseries, error) { response, err := c.WithRawResponse.FloorsClimbed( ctx, userId, @@ -1079,9 +1079,9 @@ func (c *Client) FloorsClimbed( func (c *Client) Distance( ctx context.Context, userId string, - request *vitalgo.VitalsDistanceRequest, + request *v505.VitalsDistanceRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingDistanceTimeseries, error) { +) ([]*v505.ClientFacingDistanceTimeseries, error) { response, err := c.WithRawResponse.Distance( ctx, userId, @@ -1097,9 +1097,9 @@ func (c *Client) Distance( func (c *Client) CaloriesBasal( ctx context.Context, userId string, - request *vitalgo.VitalsCaloriesBasalRequest, + request *v505.VitalsCaloriesBasalRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingCaloriesBasalTimeseries, error) { +) ([]*v505.ClientFacingCaloriesBasalTimeseries, error) { response, err := c.WithRawResponse.CaloriesBasal( ctx, userId, @@ -1115,9 +1115,9 @@ func (c *Client) CaloriesBasal( func (c *Client) CaloriesActive( ctx context.Context, userId string, - request *vitalgo.VitalsCaloriesActiveRequest, + request *v505.VitalsCaloriesActiveRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingCaloriesActiveTimeseries, error) { +) ([]*v505.ClientFacingCaloriesActiveTimeseries, error) { response, err := c.WithRawResponse.CaloriesActive( ctx, userId, @@ -1133,9 +1133,9 @@ func (c *Client) CaloriesActive( func (c *Client) RespiratoryRate( ctx context.Context, userId string, - request *vitalgo.VitalsRespiratoryRateRequest, + request *v505.VitalsRespiratoryRateRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingRespiratoryRateTimeseries, error) { +) ([]*v505.ClientFacingRespiratoryRateTimeseries, error) { response, err := c.WithRawResponse.RespiratoryRate( ctx, userId, @@ -1151,9 +1151,9 @@ func (c *Client) RespiratoryRate( func (c *Client) Ige( ctx context.Context, userId string, - request *vitalgo.VitalsIgeRequest, + request *v505.VitalsIgeRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingIgeTimeseries, error) { +) ([]*v505.ClientFacingIgeTimeseries, error) { response, err := c.WithRawResponse.Ige( ctx, userId, @@ -1169,9 +1169,9 @@ func (c *Client) Ige( func (c *Client) Igg( ctx context.Context, userId string, - request *vitalgo.VitalsIggRequest, + request *v505.VitalsIggRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingIggTimeseries, error) { +) ([]*v505.ClientFacingIggTimeseries, error) { response, err := c.WithRawResponse.Igg( ctx, userId, @@ -1187,9 +1187,9 @@ func (c *Client) Igg( func (c *Client) Hypnogram( ctx context.Context, userId string, - request *vitalgo.VitalsHypnogramRequest, + request *v505.VitalsHypnogramRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingHypnogramTimeseries, error) { +) ([]*v505.ClientFacingHypnogramTimeseries, error) { response, err := c.WithRawResponse.Hypnogram( ctx, userId, @@ -1205,9 +1205,9 @@ func (c *Client) Hypnogram( func (c *Client) Hrv( ctx context.Context, userId string, - request *vitalgo.VitalsHrvRequest, + request *v505.VitalsHrvRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingHrvTimeseries, error) { +) ([]*v505.ClientFacingHrvTimeseries, error) { response, err := c.WithRawResponse.Hrv( ctx, userId, @@ -1223,9 +1223,9 @@ func (c *Client) Hrv( func (c *Client) Heartrate( ctx context.Context, userId string, - request *vitalgo.VitalsHeartrateRequest, + request *v505.VitalsHeartrateRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingHeartRateTimeseries, error) { +) ([]*v505.ClientFacingHeartRateTimeseries, error) { response, err := c.WithRawResponse.Heartrate( ctx, userId, @@ -1241,9 +1241,9 @@ func (c *Client) Heartrate( func (c *Client) Glucose( ctx context.Context, userId string, - request *vitalgo.VitalsGlucoseRequest, + request *v505.VitalsGlucoseRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingGlucoseTimeseries, error) { +) ([]*v505.ClientFacingGlucoseTimeseries, error) { response, err := c.WithRawResponse.Glucose( ctx, userId, @@ -1259,9 +1259,9 @@ func (c *Client) Glucose( func (c *Client) CholesterolTriglycerides( ctx context.Context, userId string, - request *vitalgo.VitalsCholesterolTriglyceridesRequest, + request *v505.VitalsCholesterolTriglyceridesRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingCholesterolTimeseries, error) { +) ([]*v505.ClientFacingCholesterolTimeseries, error) { response, err := c.WithRawResponse.CholesterolTriglycerides( ctx, userId, @@ -1277,9 +1277,9 @@ func (c *Client) CholesterolTriglycerides( func (c *Client) CholesterolTotal( ctx context.Context, userId string, - request *vitalgo.VitalsCholesterolTotalRequest, + request *v505.VitalsCholesterolTotalRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingCholesterolTimeseries, error) { +) ([]*v505.ClientFacingCholesterolTimeseries, error) { response, err := c.WithRawResponse.CholesterolTotal( ctx, userId, @@ -1295,9 +1295,9 @@ func (c *Client) CholesterolTotal( func (c *Client) CholesterolLdl( ctx context.Context, userId string, - request *vitalgo.VitalsCholesterolLdlRequest, + request *v505.VitalsCholesterolLdlRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingCholesterolTimeseries, error) { +) ([]*v505.ClientFacingCholesterolTimeseries, error) { response, err := c.WithRawResponse.CholesterolLdl( ctx, userId, @@ -1313,9 +1313,9 @@ func (c *Client) CholesterolLdl( func (c *Client) CholesterolHdl( ctx context.Context, userId string, - request *vitalgo.VitalsCholesterolHdlRequest, + request *v505.VitalsCholesterolHdlRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingCholesterolTimeseries, error) { +) ([]*v505.ClientFacingCholesterolTimeseries, error) { response, err := c.WithRawResponse.CholesterolHdl( ctx, userId, @@ -1331,9 +1331,9 @@ func (c *Client) CholesterolHdl( func (c *Client) Cholesterol( ctx context.Context, userId string, - request *vitalgo.VitalsCholesterolRequest, + request *v505.VitalsCholesterolRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingCholesterolTimeseries, error) { +) ([]*v505.ClientFacingCholesterolTimeseries, error) { response, err := c.WithRawResponse.Cholesterol( ctx, userId, @@ -1349,9 +1349,9 @@ func (c *Client) Cholesterol( func (c *Client) BodyWeight( ctx context.Context, userId string, - request *vitalgo.VitalsBodyWeightRequest, + request *v505.VitalsBodyWeightRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingBodyWeightTimeseries, error) { +) ([]*v505.ClientFacingBodyWeightTimeseries, error) { response, err := c.WithRawResponse.BodyWeight( ctx, userId, @@ -1367,9 +1367,9 @@ func (c *Client) BodyWeight( func (c *Client) BodyFat( ctx context.Context, userId string, - request *vitalgo.VitalsBodyFatRequest, + request *v505.VitalsBodyFatRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingBodyFatTimeseries, error) { +) ([]*v505.ClientFacingBodyFatTimeseries, error) { response, err := c.WithRawResponse.BodyFat( ctx, userId, @@ -1385,9 +1385,9 @@ func (c *Client) BodyFat( func (c *Client) BloodOxygen( ctx context.Context, userId string, - request *vitalgo.VitalsBloodOxygenRequest, + request *v505.VitalsBloodOxygenRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingBloodOxygenTimeseries, error) { +) ([]*v505.ClientFacingBloodOxygenTimeseries, error) { response, err := c.WithRawResponse.BloodOxygen( ctx, userId, @@ -1403,9 +1403,9 @@ func (c *Client) BloodOxygen( func (c *Client) ElectrocardiogramVoltage( ctx context.Context, userId string, - request *vitalgo.VitalsElectrocardiogramVoltageRequest, + request *v505.VitalsElectrocardiogramVoltageRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingElectrocardiogramVoltageTimeseries, error) { +) ([]*v505.ClientFacingElectrocardiogramVoltageTimeseries, error) { response, err := c.WithRawResponse.ElectrocardiogramVoltage( ctx, userId, @@ -1421,9 +1421,9 @@ func (c *Client) ElectrocardiogramVoltage( func (c *Client) BloodPressure( ctx context.Context, userId string, - request *vitalgo.VitalsBloodPressureRequest, + request *v505.VitalsBloodPressureRequest, opts ...option.RequestOption, -) ([]*vitalgo.ClientFacingBloodPressureTimeseries, error) { +) ([]*v505.ClientFacingBloodPressureTimeseries, error) { response, err := c.WithRawResponse.BloodPressure( ctx, userId, diff --git a/vitals/raw_client.go b/vitals/raw_client.go index 4d46628..e7d7825 100644 --- a/vitals/raw_client.go +++ b/vitals/raw_client.go @@ -4,10 +4,10 @@ package vitals import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -33,9 +33,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) WorkoutSwimmingStrokeGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsWorkoutSwimmingStrokeGroupedRequest, + request *v505.VitalsWorkoutSwimmingStrokeGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedWorkoutSwimmingStrokeResponse], error) { +) (*core.Response[*v505.GroupedWorkoutSwimmingStrokeResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -57,7 +57,7 @@ func (r *RawClient) WorkoutSwimmingStrokeGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedWorkoutSwimmingStrokeResponse + var response *v505.GroupedWorkoutSwimmingStrokeResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -69,13 +69,13 @@ func (r *RawClient) WorkoutSwimmingStrokeGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedWorkoutSwimmingStrokeResponse]{ + return &core.Response[*v505.GroupedWorkoutSwimmingStrokeResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -85,9 +85,9 @@ func (r *RawClient) WorkoutSwimmingStrokeGrouped( func (r *RawClient) WorkoutDistanceGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsWorkoutDistanceGroupedRequest, + request *v505.VitalsWorkoutDistanceGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedWorkoutDistanceResponse], error) { +) (*core.Response[*v505.GroupedWorkoutDistanceResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -109,7 +109,7 @@ func (r *RawClient) WorkoutDistanceGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedWorkoutDistanceResponse + var response *v505.GroupedWorkoutDistanceResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -121,13 +121,13 @@ func (r *RawClient) WorkoutDistanceGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedWorkoutDistanceResponse]{ + return &core.Response[*v505.GroupedWorkoutDistanceResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -137,9 +137,9 @@ func (r *RawClient) WorkoutDistanceGrouped( func (r *RawClient) HeartRateRecoveryOneMinuteGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsHeartRateRecoveryOneMinuteGroupedRequest, + request *v505.VitalsHeartRateRecoveryOneMinuteGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedHeartRateRecoveryOneMinuteResponse], error) { +) (*core.Response[*v505.GroupedHeartRateRecoveryOneMinuteResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -161,7 +161,7 @@ func (r *RawClient) HeartRateRecoveryOneMinuteGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedHeartRateRecoveryOneMinuteResponse + var response *v505.GroupedHeartRateRecoveryOneMinuteResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -173,13 +173,13 @@ func (r *RawClient) HeartRateRecoveryOneMinuteGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedHeartRateRecoveryOneMinuteResponse]{ + return &core.Response[*v505.GroupedHeartRateRecoveryOneMinuteResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -189,9 +189,9 @@ func (r *RawClient) HeartRateRecoveryOneMinuteGrouped( func (r *RawClient) WaistCircumferenceGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsWaistCircumferenceGroupedRequest, + request *v505.VitalsWaistCircumferenceGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedWaistCircumferenceResponse], error) { +) (*core.Response[*v505.GroupedWaistCircumferenceResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -213,7 +213,7 @@ func (r *RawClient) WaistCircumferenceGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedWaistCircumferenceResponse + var response *v505.GroupedWaistCircumferenceResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -225,13 +225,13 @@ func (r *RawClient) WaistCircumferenceGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedWaistCircumferenceResponse]{ + return &core.Response[*v505.GroupedWaistCircumferenceResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -241,9 +241,9 @@ func (r *RawClient) WaistCircumferenceGrouped( func (r *RawClient) LeanBodyMassGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsLeanBodyMassGroupedRequest, + request *v505.VitalsLeanBodyMassGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedLeanBodyMassResponse], error) { +) (*core.Response[*v505.GroupedLeanBodyMassResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -265,7 +265,7 @@ func (r *RawClient) LeanBodyMassGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedLeanBodyMassResponse + var response *v505.GroupedLeanBodyMassResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -277,13 +277,13 @@ func (r *RawClient) LeanBodyMassGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedLeanBodyMassResponse]{ + return &core.Response[*v505.GroupedLeanBodyMassResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -293,9 +293,9 @@ func (r *RawClient) LeanBodyMassGrouped( func (r *RawClient) BodyMassIndexGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBodyMassIndexGroupedRequest, + request *v505.VitalsBodyMassIndexGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedBodyMassIndexResponse], error) { +) (*core.Response[*v505.GroupedBodyMassIndexResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -317,7 +317,7 @@ func (r *RawClient) BodyMassIndexGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedBodyMassIndexResponse + var response *v505.GroupedBodyMassIndexResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -329,13 +329,13 @@ func (r *RawClient) BodyMassIndexGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedBodyMassIndexResponse]{ + return &core.Response[*v505.GroupedBodyMassIndexResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -345,9 +345,9 @@ func (r *RawClient) BodyMassIndexGrouped( func (r *RawClient) BasalBodyTemperatureGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBasalBodyTemperatureGroupedRequest, + request *v505.VitalsBasalBodyTemperatureGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedBasalBodyTemperatureResponse], error) { +) (*core.Response[*v505.GroupedBasalBodyTemperatureResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -369,7 +369,7 @@ func (r *RawClient) BasalBodyTemperatureGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedBasalBodyTemperatureResponse + var response *v505.GroupedBasalBodyTemperatureResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -381,13 +381,13 @@ func (r *RawClient) BasalBodyTemperatureGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedBasalBodyTemperatureResponse]{ + return &core.Response[*v505.GroupedBasalBodyTemperatureResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -397,9 +397,9 @@ func (r *RawClient) BasalBodyTemperatureGrouped( func (r *RawClient) HandwashingGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsHandwashingGroupedRequest, + request *v505.VitalsHandwashingGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedHandwashingResponse], error) { +) (*core.Response[*v505.GroupedHandwashingResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -421,7 +421,7 @@ func (r *RawClient) HandwashingGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedHandwashingResponse + var response *v505.GroupedHandwashingResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -433,13 +433,13 @@ func (r *RawClient) HandwashingGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedHandwashingResponse]{ + return &core.Response[*v505.GroupedHandwashingResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -449,9 +449,9 @@ func (r *RawClient) HandwashingGrouped( func (r *RawClient) DaylightExposureGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsDaylightExposureGroupedRequest, + request *v505.VitalsDaylightExposureGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedDaylightExposureResponse], error) { +) (*core.Response[*v505.GroupedDaylightExposureResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -473,7 +473,7 @@ func (r *RawClient) DaylightExposureGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedDaylightExposureResponse + var response *v505.GroupedDaylightExposureResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -485,13 +485,13 @@ func (r *RawClient) DaylightExposureGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedDaylightExposureResponse]{ + return &core.Response[*v505.GroupedDaylightExposureResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -501,9 +501,9 @@ func (r *RawClient) DaylightExposureGrouped( func (r *RawClient) UvExposureGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsUvExposureGroupedRequest, + request *v505.VitalsUvExposureGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedUvExposureResponse], error) { +) (*core.Response[*v505.GroupedUvExposureResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -525,7 +525,7 @@ func (r *RawClient) UvExposureGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedUvExposureResponse + var response *v505.GroupedUvExposureResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -537,13 +537,13 @@ func (r *RawClient) UvExposureGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedUvExposureResponse]{ + return &core.Response[*v505.GroupedUvExposureResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -553,9 +553,9 @@ func (r *RawClient) UvExposureGrouped( func (r *RawClient) FallGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsFallGroupedRequest, + request *v505.VitalsFallGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedFallResponse], error) { +) (*core.Response[*v505.GroupedFallResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -577,7 +577,7 @@ func (r *RawClient) FallGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedFallResponse + var response *v505.GroupedFallResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -589,13 +589,13 @@ func (r *RawClient) FallGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedFallResponse]{ + return &core.Response[*v505.GroupedFallResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -605,9 +605,9 @@ func (r *RawClient) FallGrouped( func (r *RawClient) InhalerUsageGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsInhalerUsageGroupedRequest, + request *v505.VitalsInhalerUsageGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedInhalerUsageResponse], error) { +) (*core.Response[*v505.GroupedInhalerUsageResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -629,7 +629,7 @@ func (r *RawClient) InhalerUsageGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedInhalerUsageResponse + var response *v505.GroupedInhalerUsageResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -641,13 +641,13 @@ func (r *RawClient) InhalerUsageGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedInhalerUsageResponse]{ + return &core.Response[*v505.GroupedInhalerUsageResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -657,9 +657,9 @@ func (r *RawClient) InhalerUsageGrouped( func (r *RawClient) PeakExpiratoryFlowRateGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsPeakExpiratoryFlowRateGroupedRequest, + request *v505.VitalsPeakExpiratoryFlowRateGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedPeakExpiratoryFlowRateResponse], error) { +) (*core.Response[*v505.GroupedPeakExpiratoryFlowRateResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -681,7 +681,7 @@ func (r *RawClient) PeakExpiratoryFlowRateGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedPeakExpiratoryFlowRateResponse + var response *v505.GroupedPeakExpiratoryFlowRateResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -693,13 +693,13 @@ func (r *RawClient) PeakExpiratoryFlowRateGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedPeakExpiratoryFlowRateResponse]{ + return &core.Response[*v505.GroupedPeakExpiratoryFlowRateResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -709,9 +709,9 @@ func (r *RawClient) PeakExpiratoryFlowRateGrouped( func (r *RawClient) ForcedVitalCapacityGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsForcedVitalCapacityGroupedRequest, + request *v505.VitalsForcedVitalCapacityGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedForcedVitalCapacityResponse], error) { +) (*core.Response[*v505.GroupedForcedVitalCapacityResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -733,7 +733,7 @@ func (r *RawClient) ForcedVitalCapacityGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedForcedVitalCapacityResponse + var response *v505.GroupedForcedVitalCapacityResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -745,13 +745,13 @@ func (r *RawClient) ForcedVitalCapacityGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedForcedVitalCapacityResponse]{ + return &core.Response[*v505.GroupedForcedVitalCapacityResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -761,9 +761,9 @@ func (r *RawClient) ForcedVitalCapacityGrouped( func (r *RawClient) ForcedExpiratoryVolume1Grouped( ctx context.Context, userId string, - request *vitalgo.VitalsForcedExpiratoryVolume1GroupedRequest, + request *v505.VitalsForcedExpiratoryVolume1GroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedForcedExpiratoryVolume1Response], error) { +) (*core.Response[*v505.GroupedForcedExpiratoryVolume1Response], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -785,7 +785,7 @@ func (r *RawClient) ForcedExpiratoryVolume1Grouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedForcedExpiratoryVolume1Response + var response *v505.GroupedForcedExpiratoryVolume1Response raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -797,13 +797,13 @@ func (r *RawClient) ForcedExpiratoryVolume1Grouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedForcedExpiratoryVolume1Response]{ + return &core.Response[*v505.GroupedForcedExpiratoryVolume1Response]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -813,9 +813,9 @@ func (r *RawClient) ForcedExpiratoryVolume1Grouped( func (r *RawClient) WheelchairPushGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsWheelchairPushGroupedRequest, + request *v505.VitalsWheelchairPushGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedWheelchairPushResponse], error) { +) (*core.Response[*v505.GroupedWheelchairPushResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -837,7 +837,7 @@ func (r *RawClient) WheelchairPushGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedWheelchairPushResponse + var response *v505.GroupedWheelchairPushResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -849,13 +849,13 @@ func (r *RawClient) WheelchairPushGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedWheelchairPushResponse]{ + return &core.Response[*v505.GroupedWheelchairPushResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -865,9 +865,9 @@ func (r *RawClient) WheelchairPushGrouped( func (r *RawClient) SleepBreathingDisturbanceGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsSleepBreathingDisturbanceGroupedRequest, + request *v505.VitalsSleepBreathingDisturbanceGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedSleepBreathingDisturbanceResponse], error) { +) (*core.Response[*v505.GroupedSleepBreathingDisturbanceResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -889,7 +889,7 @@ func (r *RawClient) SleepBreathingDisturbanceGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedSleepBreathingDisturbanceResponse + var response *v505.GroupedSleepBreathingDisturbanceResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -901,13 +901,13 @@ func (r *RawClient) SleepBreathingDisturbanceGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedSleepBreathingDisturbanceResponse]{ + return &core.Response[*v505.GroupedSleepBreathingDisturbanceResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -917,9 +917,9 @@ func (r *RawClient) SleepBreathingDisturbanceGrouped( func (r *RawClient) SleepApneaAlertGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsSleepApneaAlertGroupedRequest, + request *v505.VitalsSleepApneaAlertGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedSleepApneaAlertResponse], error) { +) (*core.Response[*v505.GroupedSleepApneaAlertResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -941,7 +941,7 @@ func (r *RawClient) SleepApneaAlertGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedSleepApneaAlertResponse + var response *v505.GroupedSleepApneaAlertResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -953,13 +953,13 @@ func (r *RawClient) SleepApneaAlertGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedSleepApneaAlertResponse]{ + return &core.Response[*v505.GroupedSleepApneaAlertResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -969,9 +969,9 @@ func (r *RawClient) SleepApneaAlertGrouped( func (r *RawClient) StandDurationGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsStandDurationGroupedRequest, + request *v505.VitalsStandDurationGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedStandDurationResponse], error) { +) (*core.Response[*v505.GroupedStandDurationResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -993,7 +993,7 @@ func (r *RawClient) StandDurationGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedStandDurationResponse + var response *v505.GroupedStandDurationResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1005,13 +1005,13 @@ func (r *RawClient) StandDurationGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedStandDurationResponse]{ + return &core.Response[*v505.GroupedStandDurationResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1021,9 +1021,9 @@ func (r *RawClient) StandDurationGrouped( func (r *RawClient) StandHourGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsStandHourGroupedRequest, + request *v505.VitalsStandHourGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedStandHourResponse], error) { +) (*core.Response[*v505.GroupedStandHourResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1045,7 +1045,7 @@ func (r *RawClient) StandHourGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedStandHourResponse + var response *v505.GroupedStandHourResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1057,13 +1057,13 @@ func (r *RawClient) StandHourGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedStandHourResponse]{ + return &core.Response[*v505.GroupedStandHourResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1073,9 +1073,9 @@ func (r *RawClient) StandHourGrouped( func (r *RawClient) HeartRateAlertGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsHeartRateAlertGroupedRequest, + request *v505.VitalsHeartRateAlertGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedHeartRateAlertResponse], error) { +) (*core.Response[*v505.GroupedHeartRateAlertResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1097,7 +1097,7 @@ func (r *RawClient) HeartRateAlertGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedHeartRateAlertResponse + var response *v505.GroupedHeartRateAlertResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1109,13 +1109,13 @@ func (r *RawClient) HeartRateAlertGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedHeartRateAlertResponse]{ + return &core.Response[*v505.GroupedHeartRateAlertResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1125,9 +1125,9 @@ func (r *RawClient) HeartRateAlertGrouped( func (r *RawClient) AfibBurdenGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsAfibBurdenGroupedRequest, + request *v505.VitalsAfibBurdenGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedAFibBurdenResponse], error) { +) (*core.Response[*v505.GroupedAFibBurdenResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1149,7 +1149,7 @@ func (r *RawClient) AfibBurdenGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedAFibBurdenResponse + var response *v505.GroupedAFibBurdenResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1161,13 +1161,13 @@ func (r *RawClient) AfibBurdenGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedAFibBurdenResponse]{ + return &core.Response[*v505.GroupedAFibBurdenResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1177,9 +1177,9 @@ func (r *RawClient) AfibBurdenGrouped( func (r *RawClient) WorkoutDurationGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsWorkoutDurationGroupedRequest, + request *v505.VitalsWorkoutDurationGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedWorkoutDurationResponse], error) { +) (*core.Response[*v505.GroupedWorkoutDurationResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1201,7 +1201,7 @@ func (r *RawClient) WorkoutDurationGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedWorkoutDurationResponse + var response *v505.GroupedWorkoutDurationResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1213,13 +1213,13 @@ func (r *RawClient) WorkoutDurationGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedWorkoutDurationResponse]{ + return &core.Response[*v505.GroupedWorkoutDurationResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1229,9 +1229,9 @@ func (r *RawClient) WorkoutDurationGrouped( func (r *RawClient) Vo2MaxGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsVo2MaxGroupedRequest, + request *v505.VitalsVo2MaxGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedVo2MaxResponse], error) { +) (*core.Response[*v505.GroupedVo2MaxResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1253,7 +1253,7 @@ func (r *RawClient) Vo2MaxGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedVo2MaxResponse + var response *v505.GroupedVo2MaxResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1265,13 +1265,13 @@ func (r *RawClient) Vo2MaxGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedVo2MaxResponse]{ + return &core.Response[*v505.GroupedVo2MaxResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1281,9 +1281,9 @@ func (r *RawClient) Vo2MaxGrouped( func (r *RawClient) StressLevelGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsStressLevelGroupedRequest, + request *v505.VitalsStressLevelGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedStressLevelResponse], error) { +) (*core.Response[*v505.GroupedStressLevelResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1305,7 +1305,7 @@ func (r *RawClient) StressLevelGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedStressLevelResponse + var response *v505.GroupedStressLevelResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1317,13 +1317,13 @@ func (r *RawClient) StressLevelGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedStressLevelResponse]{ + return &core.Response[*v505.GroupedStressLevelResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1333,9 +1333,9 @@ func (r *RawClient) StressLevelGrouped( func (r *RawClient) MindfulnessMinutesGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsMindfulnessMinutesGroupedRequest, + request *v505.VitalsMindfulnessMinutesGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedMindfulnessMinutesResponse], error) { +) (*core.Response[*v505.GroupedMindfulnessMinutesResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1357,7 +1357,7 @@ func (r *RawClient) MindfulnessMinutesGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedMindfulnessMinutesResponse + var response *v505.GroupedMindfulnessMinutesResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1369,13 +1369,13 @@ func (r *RawClient) MindfulnessMinutesGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedMindfulnessMinutesResponse]{ + return &core.Response[*v505.GroupedMindfulnessMinutesResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1385,9 +1385,9 @@ func (r *RawClient) MindfulnessMinutesGrouped( func (r *RawClient) CaffeineGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsCaffeineGroupedRequest, + request *v505.VitalsCaffeineGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedCaffeineResponse], error) { +) (*core.Response[*v505.GroupedCaffeineResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1409,7 +1409,7 @@ func (r *RawClient) CaffeineGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedCaffeineResponse + var response *v505.GroupedCaffeineResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1421,13 +1421,13 @@ func (r *RawClient) CaffeineGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedCaffeineResponse]{ + return &core.Response[*v505.GroupedCaffeineResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1437,9 +1437,9 @@ func (r *RawClient) CaffeineGrouped( func (r *RawClient) WaterGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsWaterGroupedRequest, + request *v505.VitalsWaterGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedWaterResponse], error) { +) (*core.Response[*v505.GroupedWaterResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1461,7 +1461,7 @@ func (r *RawClient) WaterGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedWaterResponse + var response *v505.GroupedWaterResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1473,13 +1473,13 @@ func (r *RawClient) WaterGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedWaterResponse]{ + return &core.Response[*v505.GroupedWaterResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1489,9 +1489,9 @@ func (r *RawClient) WaterGrouped( func (r *RawClient) StepsGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsStepsGroupedRequest, + request *v505.VitalsStepsGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedStepsResponse], error) { +) (*core.Response[*v505.GroupedStepsResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1513,7 +1513,7 @@ func (r *RawClient) StepsGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedStepsResponse + var response *v505.GroupedStepsResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1525,13 +1525,13 @@ func (r *RawClient) StepsGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedStepsResponse]{ + return &core.Response[*v505.GroupedStepsResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1541,9 +1541,9 @@ func (r *RawClient) StepsGrouped( func (r *RawClient) FloorsClimbedGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsFloorsClimbedGroupedRequest, + request *v505.VitalsFloorsClimbedGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedFloorsClimbedResponse], error) { +) (*core.Response[*v505.GroupedFloorsClimbedResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1565,7 +1565,7 @@ func (r *RawClient) FloorsClimbedGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedFloorsClimbedResponse + var response *v505.GroupedFloorsClimbedResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1577,13 +1577,13 @@ func (r *RawClient) FloorsClimbedGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedFloorsClimbedResponse]{ + return &core.Response[*v505.GroupedFloorsClimbedResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1593,9 +1593,9 @@ func (r *RawClient) FloorsClimbedGrouped( func (r *RawClient) DistanceGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsDistanceGroupedRequest, + request *v505.VitalsDistanceGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedDistanceResponse], error) { +) (*core.Response[*v505.GroupedDistanceResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1617,7 +1617,7 @@ func (r *RawClient) DistanceGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedDistanceResponse + var response *v505.GroupedDistanceResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1629,13 +1629,13 @@ func (r *RawClient) DistanceGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedDistanceResponse]{ + return &core.Response[*v505.GroupedDistanceResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1645,9 +1645,9 @@ func (r *RawClient) DistanceGrouped( func (r *RawClient) CaloriesBasalGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsCaloriesBasalGroupedRequest, + request *v505.VitalsCaloriesBasalGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedCaloriesBasalResponse], error) { +) (*core.Response[*v505.GroupedCaloriesBasalResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1669,7 +1669,7 @@ func (r *RawClient) CaloriesBasalGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedCaloriesBasalResponse + var response *v505.GroupedCaloriesBasalResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1681,13 +1681,13 @@ func (r *RawClient) CaloriesBasalGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedCaloriesBasalResponse]{ + return &core.Response[*v505.GroupedCaloriesBasalResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1697,9 +1697,9 @@ func (r *RawClient) CaloriesBasalGrouped( func (r *RawClient) CaloriesActiveGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsCaloriesActiveGroupedRequest, + request *v505.VitalsCaloriesActiveGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedCaloriesActiveResponse], error) { +) (*core.Response[*v505.GroupedCaloriesActiveResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1721,7 +1721,7 @@ func (r *RawClient) CaloriesActiveGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedCaloriesActiveResponse + var response *v505.GroupedCaloriesActiveResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1733,13 +1733,13 @@ func (r *RawClient) CaloriesActiveGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedCaloriesActiveResponse]{ + return &core.Response[*v505.GroupedCaloriesActiveResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1749,9 +1749,9 @@ func (r *RawClient) CaloriesActiveGrouped( func (r *RawClient) RespiratoryRateGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsRespiratoryRateGroupedRequest, + request *v505.VitalsRespiratoryRateGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedRespiratoryRateResponse], error) { +) (*core.Response[*v505.GroupedRespiratoryRateResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1773,7 +1773,7 @@ func (r *RawClient) RespiratoryRateGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedRespiratoryRateResponse + var response *v505.GroupedRespiratoryRateResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1785,13 +1785,13 @@ func (r *RawClient) RespiratoryRateGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedRespiratoryRateResponse]{ + return &core.Response[*v505.GroupedRespiratoryRateResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1801,9 +1801,9 @@ func (r *RawClient) RespiratoryRateGrouped( func (r *RawClient) NoteGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsNoteGroupedRequest, + request *v505.VitalsNoteGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedNoteResponse], error) { +) (*core.Response[*v505.GroupedNoteResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1825,7 +1825,7 @@ func (r *RawClient) NoteGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedNoteResponse + var response *v505.GroupedNoteResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1837,13 +1837,13 @@ func (r *RawClient) NoteGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedNoteResponse]{ + return &core.Response[*v505.GroupedNoteResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1853,9 +1853,9 @@ func (r *RawClient) NoteGrouped( func (r *RawClient) InsulinInjectionGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsInsulinInjectionGroupedRequest, + request *v505.VitalsInsulinInjectionGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedInsulinInjectionResponse], error) { +) (*core.Response[*v505.GroupedInsulinInjectionResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1877,7 +1877,7 @@ func (r *RawClient) InsulinInjectionGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedInsulinInjectionResponse + var response *v505.GroupedInsulinInjectionResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1889,13 +1889,13 @@ func (r *RawClient) InsulinInjectionGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedInsulinInjectionResponse]{ + return &core.Response[*v505.GroupedInsulinInjectionResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1905,9 +1905,9 @@ func (r *RawClient) InsulinInjectionGrouped( func (r *RawClient) IgeGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsIgeGroupedRequest, + request *v505.VitalsIgeGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedIgeResponse], error) { +) (*core.Response[*v505.GroupedIgeResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1929,7 +1929,7 @@ func (r *RawClient) IgeGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedIgeResponse + var response *v505.GroupedIgeResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1941,13 +1941,13 @@ func (r *RawClient) IgeGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedIgeResponse]{ + return &core.Response[*v505.GroupedIgeResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -1957,9 +1957,9 @@ func (r *RawClient) IgeGrouped( func (r *RawClient) IggGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsIggGroupedRequest, + request *v505.VitalsIggGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedIggResponse], error) { +) (*core.Response[*v505.GroupedIggResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -1981,7 +1981,7 @@ func (r *RawClient) IggGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedIggResponse + var response *v505.GroupedIggResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -1993,13 +1993,13 @@ func (r *RawClient) IggGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedIggResponse]{ + return &core.Response[*v505.GroupedIggResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2009,9 +2009,9 @@ func (r *RawClient) IggGrouped( func (r *RawClient) HypnogramGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsHypnogramGroupedRequest, + request *v505.VitalsHypnogramGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedHypnogramResponse], error) { +) (*core.Response[*v505.GroupedHypnogramResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2033,7 +2033,7 @@ func (r *RawClient) HypnogramGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedHypnogramResponse + var response *v505.GroupedHypnogramResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2045,13 +2045,13 @@ func (r *RawClient) HypnogramGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedHypnogramResponse]{ + return &core.Response[*v505.GroupedHypnogramResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2061,9 +2061,9 @@ func (r *RawClient) HypnogramGrouped( func (r *RawClient) HrvGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsHrvGroupedRequest, + request *v505.VitalsHrvGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedHrvResponse], error) { +) (*core.Response[*v505.GroupedHrvResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2085,7 +2085,7 @@ func (r *RawClient) HrvGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedHrvResponse + var response *v505.GroupedHrvResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2097,13 +2097,13 @@ func (r *RawClient) HrvGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedHrvResponse]{ + return &core.Response[*v505.GroupedHrvResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2113,9 +2113,9 @@ func (r *RawClient) HrvGrouped( func (r *RawClient) HeartrateGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsHeartrateGroupedRequest, + request *v505.VitalsHeartrateGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedHeartRateResponse], error) { +) (*core.Response[*v505.GroupedHeartRateResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2137,7 +2137,7 @@ func (r *RawClient) HeartrateGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedHeartRateResponse + var response *v505.GroupedHeartRateResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2149,13 +2149,13 @@ func (r *RawClient) HeartrateGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedHeartRateResponse]{ + return &core.Response[*v505.GroupedHeartRateResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2165,9 +2165,9 @@ func (r *RawClient) HeartrateGrouped( func (r *RawClient) GlucoseGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsGlucoseGroupedRequest, + request *v505.VitalsGlucoseGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedGlucoseResponse], error) { +) (*core.Response[*v505.GroupedGlucoseResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2189,7 +2189,7 @@ func (r *RawClient) GlucoseGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedGlucoseResponse + var response *v505.GroupedGlucoseResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2201,13 +2201,13 @@ func (r *RawClient) GlucoseGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedGlucoseResponse]{ + return &core.Response[*v505.GroupedGlucoseResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2217,9 +2217,9 @@ func (r *RawClient) GlucoseGrouped( func (r *RawClient) CholesterolGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsCholesterolGroupedRequest, + request *v505.VitalsCholesterolGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedCholesterolResponse], error) { +) (*core.Response[*v505.GroupedCholesterolResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2241,7 +2241,7 @@ func (r *RawClient) CholesterolGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedCholesterolResponse + var response *v505.GroupedCholesterolResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2253,13 +2253,13 @@ func (r *RawClient) CholesterolGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedCholesterolResponse]{ + return &core.Response[*v505.GroupedCholesterolResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2269,9 +2269,9 @@ func (r *RawClient) CholesterolGrouped( func (r *RawClient) CarbohydratesGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsCarbohydratesGroupedRequest, + request *v505.VitalsCarbohydratesGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedCarbohydratesResponse], error) { +) (*core.Response[*v505.GroupedCarbohydratesResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2293,7 +2293,7 @@ func (r *RawClient) CarbohydratesGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedCarbohydratesResponse + var response *v505.GroupedCarbohydratesResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2305,13 +2305,13 @@ func (r *RawClient) CarbohydratesGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedCarbohydratesResponse]{ + return &core.Response[*v505.GroupedCarbohydratesResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2321,9 +2321,9 @@ func (r *RawClient) CarbohydratesGrouped( func (r *RawClient) BodyTemperatureDeltaGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBodyTemperatureDeltaGroupedRequest, + request *v505.VitalsBodyTemperatureDeltaGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedBodyTemperatureDeltaResponse], error) { +) (*core.Response[*v505.GroupedBodyTemperatureDeltaResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2345,7 +2345,7 @@ func (r *RawClient) BodyTemperatureDeltaGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedBodyTemperatureDeltaResponse + var response *v505.GroupedBodyTemperatureDeltaResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2357,13 +2357,13 @@ func (r *RawClient) BodyTemperatureDeltaGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedBodyTemperatureDeltaResponse]{ + return &core.Response[*v505.GroupedBodyTemperatureDeltaResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2373,9 +2373,9 @@ func (r *RawClient) BodyTemperatureDeltaGrouped( func (r *RawClient) BodyTemperatureGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBodyTemperatureGroupedRequest, + request *v505.VitalsBodyTemperatureGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedBodyTemperatureResponse], error) { +) (*core.Response[*v505.GroupedBodyTemperatureResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2397,7 +2397,7 @@ func (r *RawClient) BodyTemperatureGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedBodyTemperatureResponse + var response *v505.GroupedBodyTemperatureResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2409,13 +2409,13 @@ func (r *RawClient) BodyTemperatureGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedBodyTemperatureResponse]{ + return &core.Response[*v505.GroupedBodyTemperatureResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2425,9 +2425,9 @@ func (r *RawClient) BodyTemperatureGrouped( func (r *RawClient) BodyWeightGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBodyWeightGroupedRequest, + request *v505.VitalsBodyWeightGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedBodyWeightResponse], error) { +) (*core.Response[*v505.GroupedBodyWeightResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2449,7 +2449,7 @@ func (r *RawClient) BodyWeightGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedBodyWeightResponse + var response *v505.GroupedBodyWeightResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2461,13 +2461,13 @@ func (r *RawClient) BodyWeightGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedBodyWeightResponse]{ + return &core.Response[*v505.GroupedBodyWeightResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2477,9 +2477,9 @@ func (r *RawClient) BodyWeightGrouped( func (r *RawClient) BodyFatGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBodyFatGroupedRequest, + request *v505.VitalsBodyFatGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedBodyFatResponse], error) { +) (*core.Response[*v505.GroupedBodyFatResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2501,7 +2501,7 @@ func (r *RawClient) BodyFatGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedBodyFatResponse + var response *v505.GroupedBodyFatResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2513,13 +2513,13 @@ func (r *RawClient) BodyFatGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedBodyFatResponse]{ + return &core.Response[*v505.GroupedBodyFatResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2529,9 +2529,9 @@ func (r *RawClient) BodyFatGrouped( func (r *RawClient) BloodOxygenGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBloodOxygenGroupedRequest, + request *v505.VitalsBloodOxygenGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedBloodOxygenResponse], error) { +) (*core.Response[*v505.GroupedBloodOxygenResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2553,7 +2553,7 @@ func (r *RawClient) BloodOxygenGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedBloodOxygenResponse + var response *v505.GroupedBloodOxygenResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2565,13 +2565,13 @@ func (r *RawClient) BloodOxygenGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedBloodOxygenResponse]{ + return &core.Response[*v505.GroupedBloodOxygenResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2581,9 +2581,9 @@ func (r *RawClient) BloodOxygenGrouped( func (r *RawClient) ElectrocardiogramVoltageGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsElectrocardiogramVoltageGroupedRequest, + request *v505.VitalsElectrocardiogramVoltageGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedElectrocardiogramVoltageResponse], error) { +) (*core.Response[*v505.GroupedElectrocardiogramVoltageResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2605,7 +2605,7 @@ func (r *RawClient) ElectrocardiogramVoltageGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedElectrocardiogramVoltageResponse + var response *v505.GroupedElectrocardiogramVoltageResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2617,13 +2617,13 @@ func (r *RawClient) ElectrocardiogramVoltageGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedElectrocardiogramVoltageResponse]{ + return &core.Response[*v505.GroupedElectrocardiogramVoltageResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2633,9 +2633,9 @@ func (r *RawClient) ElectrocardiogramVoltageGrouped( func (r *RawClient) BloodPressureGrouped( ctx context.Context, userId string, - request *vitalgo.VitalsBloodPressureGroupedRequest, + request *v505.VitalsBloodPressureGroupedRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.GroupedBloodPressureResponse], error) { +) (*core.Response[*v505.GroupedBloodPressureResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2657,7 +2657,7 @@ func (r *RawClient) BloodPressureGrouped( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.GroupedBloodPressureResponse + var response *v505.GroupedBloodPressureResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2669,13 +2669,13 @@ func (r *RawClient) BloodPressureGrouped( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.GroupedBloodPressureResponse]{ + return &core.Response[*v505.GroupedBloodPressureResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2685,9 +2685,9 @@ func (r *RawClient) BloodPressureGrouped( func (r *RawClient) Vo2Max( ctx context.Context, userId string, - request *vitalgo.VitalsVo2MaxRequest, + request *v505.VitalsVo2MaxRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingVo2MaxTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingVo2MaxTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2709,7 +2709,7 @@ func (r *RawClient) Vo2Max( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingVo2MaxTimeseries + var response []*v505.ClientFacingVo2MaxTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2721,13 +2721,13 @@ func (r *RawClient) Vo2Max( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingVo2MaxTimeseries]{ + return &core.Response[[]*v505.ClientFacingVo2MaxTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2737,9 +2737,9 @@ func (r *RawClient) Vo2Max( func (r *RawClient) StressLevel( ctx context.Context, userId string, - request *vitalgo.VitalsStressLevelRequest, + request *v505.VitalsStressLevelRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingStressLevelTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingStressLevelTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2761,7 +2761,7 @@ func (r *RawClient) StressLevel( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingStressLevelTimeseries + var response []*v505.ClientFacingStressLevelTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2773,13 +2773,13 @@ func (r *RawClient) StressLevel( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingStressLevelTimeseries]{ + return &core.Response[[]*v505.ClientFacingStressLevelTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2789,9 +2789,9 @@ func (r *RawClient) StressLevel( func (r *RawClient) MindfulnessMinutes( ctx context.Context, userId string, - request *vitalgo.VitalsMindfulnessMinutesRequest, + request *v505.VitalsMindfulnessMinutesRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingMindfulnessMinutesTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingMindfulnessMinutesTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2813,7 +2813,7 @@ func (r *RawClient) MindfulnessMinutes( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingMindfulnessMinutesTimeseries + var response []*v505.ClientFacingMindfulnessMinutesTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2825,13 +2825,13 @@ func (r *RawClient) MindfulnessMinutes( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingMindfulnessMinutesTimeseries]{ + return &core.Response[[]*v505.ClientFacingMindfulnessMinutesTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2841,9 +2841,9 @@ func (r *RawClient) MindfulnessMinutes( func (r *RawClient) Caffeine( ctx context.Context, userId string, - request *vitalgo.VitalsCaffeineRequest, + request *v505.VitalsCaffeineRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingCaffeineTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingCaffeineTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2865,7 +2865,7 @@ func (r *RawClient) Caffeine( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingCaffeineTimeseries + var response []*v505.ClientFacingCaffeineTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2877,13 +2877,13 @@ func (r *RawClient) Caffeine( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingCaffeineTimeseries]{ + return &core.Response[[]*v505.ClientFacingCaffeineTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2893,9 +2893,9 @@ func (r *RawClient) Caffeine( func (r *RawClient) Water( ctx context.Context, userId string, - request *vitalgo.VitalsWaterRequest, + request *v505.VitalsWaterRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingWaterTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingWaterTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2917,7 +2917,7 @@ func (r *RawClient) Water( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingWaterTimeseries + var response []*v505.ClientFacingWaterTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2929,13 +2929,13 @@ func (r *RawClient) Water( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingWaterTimeseries]{ + return &core.Response[[]*v505.ClientFacingWaterTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2945,9 +2945,9 @@ func (r *RawClient) Water( func (r *RawClient) Steps( ctx context.Context, userId string, - request *vitalgo.VitalsStepsRequest, + request *v505.VitalsStepsRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingStepsTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingStepsTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -2969,7 +2969,7 @@ func (r *RawClient) Steps( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingStepsTimeseries + var response []*v505.ClientFacingStepsTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -2981,13 +2981,13 @@ func (r *RawClient) Steps( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingStepsTimeseries]{ + return &core.Response[[]*v505.ClientFacingStepsTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -2997,9 +2997,9 @@ func (r *RawClient) Steps( func (r *RawClient) FloorsClimbed( ctx context.Context, userId string, - request *vitalgo.VitalsFloorsClimbedRequest, + request *v505.VitalsFloorsClimbedRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingFloorsClimbedTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingFloorsClimbedTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3021,7 +3021,7 @@ func (r *RawClient) FloorsClimbed( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingFloorsClimbedTimeseries + var response []*v505.ClientFacingFloorsClimbedTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3033,13 +3033,13 @@ func (r *RawClient) FloorsClimbed( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingFloorsClimbedTimeseries]{ + return &core.Response[[]*v505.ClientFacingFloorsClimbedTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3049,9 +3049,9 @@ func (r *RawClient) FloorsClimbed( func (r *RawClient) Distance( ctx context.Context, userId string, - request *vitalgo.VitalsDistanceRequest, + request *v505.VitalsDistanceRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingDistanceTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingDistanceTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3073,7 +3073,7 @@ func (r *RawClient) Distance( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingDistanceTimeseries + var response []*v505.ClientFacingDistanceTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3085,13 +3085,13 @@ func (r *RawClient) Distance( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingDistanceTimeseries]{ + return &core.Response[[]*v505.ClientFacingDistanceTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3101,9 +3101,9 @@ func (r *RawClient) Distance( func (r *RawClient) CaloriesBasal( ctx context.Context, userId string, - request *vitalgo.VitalsCaloriesBasalRequest, + request *v505.VitalsCaloriesBasalRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingCaloriesBasalTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingCaloriesBasalTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3125,7 +3125,7 @@ func (r *RawClient) CaloriesBasal( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingCaloriesBasalTimeseries + var response []*v505.ClientFacingCaloriesBasalTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3137,13 +3137,13 @@ func (r *RawClient) CaloriesBasal( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingCaloriesBasalTimeseries]{ + return &core.Response[[]*v505.ClientFacingCaloriesBasalTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3153,9 +3153,9 @@ func (r *RawClient) CaloriesBasal( func (r *RawClient) CaloriesActive( ctx context.Context, userId string, - request *vitalgo.VitalsCaloriesActiveRequest, + request *v505.VitalsCaloriesActiveRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingCaloriesActiveTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingCaloriesActiveTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3177,7 +3177,7 @@ func (r *RawClient) CaloriesActive( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingCaloriesActiveTimeseries + var response []*v505.ClientFacingCaloriesActiveTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3189,13 +3189,13 @@ func (r *RawClient) CaloriesActive( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingCaloriesActiveTimeseries]{ + return &core.Response[[]*v505.ClientFacingCaloriesActiveTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3205,9 +3205,9 @@ func (r *RawClient) CaloriesActive( func (r *RawClient) RespiratoryRate( ctx context.Context, userId string, - request *vitalgo.VitalsRespiratoryRateRequest, + request *v505.VitalsRespiratoryRateRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingRespiratoryRateTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingRespiratoryRateTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3229,7 +3229,7 @@ func (r *RawClient) RespiratoryRate( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingRespiratoryRateTimeseries + var response []*v505.ClientFacingRespiratoryRateTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3241,13 +3241,13 @@ func (r *RawClient) RespiratoryRate( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingRespiratoryRateTimeseries]{ + return &core.Response[[]*v505.ClientFacingRespiratoryRateTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3257,9 +3257,9 @@ func (r *RawClient) RespiratoryRate( func (r *RawClient) Ige( ctx context.Context, userId string, - request *vitalgo.VitalsIgeRequest, + request *v505.VitalsIgeRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingIgeTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingIgeTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3281,7 +3281,7 @@ func (r *RawClient) Ige( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingIgeTimeseries + var response []*v505.ClientFacingIgeTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3293,13 +3293,13 @@ func (r *RawClient) Ige( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingIgeTimeseries]{ + return &core.Response[[]*v505.ClientFacingIgeTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3309,9 +3309,9 @@ func (r *RawClient) Ige( func (r *RawClient) Igg( ctx context.Context, userId string, - request *vitalgo.VitalsIggRequest, + request *v505.VitalsIggRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingIggTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingIggTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3333,7 +3333,7 @@ func (r *RawClient) Igg( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingIggTimeseries + var response []*v505.ClientFacingIggTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3345,13 +3345,13 @@ func (r *RawClient) Igg( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingIggTimeseries]{ + return &core.Response[[]*v505.ClientFacingIggTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3361,9 +3361,9 @@ func (r *RawClient) Igg( func (r *RawClient) Hypnogram( ctx context.Context, userId string, - request *vitalgo.VitalsHypnogramRequest, + request *v505.VitalsHypnogramRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingHypnogramTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingHypnogramTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3385,7 +3385,7 @@ func (r *RawClient) Hypnogram( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingHypnogramTimeseries + var response []*v505.ClientFacingHypnogramTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3397,13 +3397,13 @@ func (r *RawClient) Hypnogram( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingHypnogramTimeseries]{ + return &core.Response[[]*v505.ClientFacingHypnogramTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3413,9 +3413,9 @@ func (r *RawClient) Hypnogram( func (r *RawClient) Hrv( ctx context.Context, userId string, - request *vitalgo.VitalsHrvRequest, + request *v505.VitalsHrvRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingHrvTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingHrvTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3437,7 +3437,7 @@ func (r *RawClient) Hrv( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingHrvTimeseries + var response []*v505.ClientFacingHrvTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3449,13 +3449,13 @@ func (r *RawClient) Hrv( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingHrvTimeseries]{ + return &core.Response[[]*v505.ClientFacingHrvTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3465,9 +3465,9 @@ func (r *RawClient) Hrv( func (r *RawClient) Heartrate( ctx context.Context, userId string, - request *vitalgo.VitalsHeartrateRequest, + request *v505.VitalsHeartrateRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingHeartRateTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingHeartRateTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3489,7 +3489,7 @@ func (r *RawClient) Heartrate( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingHeartRateTimeseries + var response []*v505.ClientFacingHeartRateTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3501,13 +3501,13 @@ func (r *RawClient) Heartrate( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingHeartRateTimeseries]{ + return &core.Response[[]*v505.ClientFacingHeartRateTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3517,9 +3517,9 @@ func (r *RawClient) Heartrate( func (r *RawClient) Glucose( ctx context.Context, userId string, - request *vitalgo.VitalsGlucoseRequest, + request *v505.VitalsGlucoseRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingGlucoseTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingGlucoseTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3541,7 +3541,7 @@ func (r *RawClient) Glucose( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingGlucoseTimeseries + var response []*v505.ClientFacingGlucoseTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3553,13 +3553,13 @@ func (r *RawClient) Glucose( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingGlucoseTimeseries]{ + return &core.Response[[]*v505.ClientFacingGlucoseTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3569,9 +3569,9 @@ func (r *RawClient) Glucose( func (r *RawClient) CholesterolTriglycerides( ctx context.Context, userId string, - request *vitalgo.VitalsCholesterolTriglyceridesRequest, + request *v505.VitalsCholesterolTriglyceridesRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingCholesterolTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingCholesterolTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3593,7 +3593,7 @@ func (r *RawClient) CholesterolTriglycerides( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingCholesterolTimeseries + var response []*v505.ClientFacingCholesterolTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3605,13 +3605,13 @@ func (r *RawClient) CholesterolTriglycerides( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingCholesterolTimeseries]{ + return &core.Response[[]*v505.ClientFacingCholesterolTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3621,9 +3621,9 @@ func (r *RawClient) CholesterolTriglycerides( func (r *RawClient) CholesterolTotal( ctx context.Context, userId string, - request *vitalgo.VitalsCholesterolTotalRequest, + request *v505.VitalsCholesterolTotalRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingCholesterolTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingCholesterolTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3645,7 +3645,7 @@ func (r *RawClient) CholesterolTotal( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingCholesterolTimeseries + var response []*v505.ClientFacingCholesterolTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3657,13 +3657,13 @@ func (r *RawClient) CholesterolTotal( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingCholesterolTimeseries]{ + return &core.Response[[]*v505.ClientFacingCholesterolTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3673,9 +3673,9 @@ func (r *RawClient) CholesterolTotal( func (r *RawClient) CholesterolLdl( ctx context.Context, userId string, - request *vitalgo.VitalsCholesterolLdlRequest, + request *v505.VitalsCholesterolLdlRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingCholesterolTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingCholesterolTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3697,7 +3697,7 @@ func (r *RawClient) CholesterolLdl( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingCholesterolTimeseries + var response []*v505.ClientFacingCholesterolTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3709,13 +3709,13 @@ func (r *RawClient) CholesterolLdl( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingCholesterolTimeseries]{ + return &core.Response[[]*v505.ClientFacingCholesterolTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3725,9 +3725,9 @@ func (r *RawClient) CholesterolLdl( func (r *RawClient) CholesterolHdl( ctx context.Context, userId string, - request *vitalgo.VitalsCholesterolHdlRequest, + request *v505.VitalsCholesterolHdlRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingCholesterolTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingCholesterolTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3749,7 +3749,7 @@ func (r *RawClient) CholesterolHdl( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingCholesterolTimeseries + var response []*v505.ClientFacingCholesterolTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3761,13 +3761,13 @@ func (r *RawClient) CholesterolHdl( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingCholesterolTimeseries]{ + return &core.Response[[]*v505.ClientFacingCholesterolTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3777,9 +3777,9 @@ func (r *RawClient) CholesterolHdl( func (r *RawClient) Cholesterol( ctx context.Context, userId string, - request *vitalgo.VitalsCholesterolRequest, + request *v505.VitalsCholesterolRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingCholesterolTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingCholesterolTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3801,7 +3801,7 @@ func (r *RawClient) Cholesterol( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingCholesterolTimeseries + var response []*v505.ClientFacingCholesterolTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3813,13 +3813,13 @@ func (r *RawClient) Cholesterol( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingCholesterolTimeseries]{ + return &core.Response[[]*v505.ClientFacingCholesterolTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3829,9 +3829,9 @@ func (r *RawClient) Cholesterol( func (r *RawClient) BodyWeight( ctx context.Context, userId string, - request *vitalgo.VitalsBodyWeightRequest, + request *v505.VitalsBodyWeightRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingBodyWeightTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingBodyWeightTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3853,7 +3853,7 @@ func (r *RawClient) BodyWeight( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingBodyWeightTimeseries + var response []*v505.ClientFacingBodyWeightTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3865,13 +3865,13 @@ func (r *RawClient) BodyWeight( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingBodyWeightTimeseries]{ + return &core.Response[[]*v505.ClientFacingBodyWeightTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3881,9 +3881,9 @@ func (r *RawClient) BodyWeight( func (r *RawClient) BodyFat( ctx context.Context, userId string, - request *vitalgo.VitalsBodyFatRequest, + request *v505.VitalsBodyFatRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingBodyFatTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingBodyFatTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3905,7 +3905,7 @@ func (r *RawClient) BodyFat( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingBodyFatTimeseries + var response []*v505.ClientFacingBodyFatTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3917,13 +3917,13 @@ func (r *RawClient) BodyFat( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingBodyFatTimeseries]{ + return &core.Response[[]*v505.ClientFacingBodyFatTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3933,9 +3933,9 @@ func (r *RawClient) BodyFat( func (r *RawClient) BloodOxygen( ctx context.Context, userId string, - request *vitalgo.VitalsBloodOxygenRequest, + request *v505.VitalsBloodOxygenRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingBloodOxygenTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingBloodOxygenTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -3957,7 +3957,7 @@ func (r *RawClient) BloodOxygen( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingBloodOxygenTimeseries + var response []*v505.ClientFacingBloodOxygenTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -3969,13 +3969,13 @@ func (r *RawClient) BloodOxygen( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingBloodOxygenTimeseries]{ + return &core.Response[[]*v505.ClientFacingBloodOxygenTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -3985,9 +3985,9 @@ func (r *RawClient) BloodOxygen( func (r *RawClient) ElectrocardiogramVoltage( ctx context.Context, userId string, - request *vitalgo.VitalsElectrocardiogramVoltageRequest, + request *v505.VitalsElectrocardiogramVoltageRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingElectrocardiogramVoltageTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingElectrocardiogramVoltageTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -4009,7 +4009,7 @@ func (r *RawClient) ElectrocardiogramVoltage( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingElectrocardiogramVoltageTimeseries + var response []*v505.ClientFacingElectrocardiogramVoltageTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -4021,13 +4021,13 @@ func (r *RawClient) ElectrocardiogramVoltage( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingElectrocardiogramVoltageTimeseries]{ + return &core.Response[[]*v505.ClientFacingElectrocardiogramVoltageTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -4037,9 +4037,9 @@ func (r *RawClient) ElectrocardiogramVoltage( func (r *RawClient) BloodPressure( ctx context.Context, userId string, - request *vitalgo.VitalsBloodPressureRequest, + request *v505.VitalsBloodPressureRequest, opts ...option.RequestOption, -) (*core.Response[[]*vitalgo.ClientFacingBloodPressureTimeseries], error) { +) (*core.Response[[]*v505.ClientFacingBloodPressureTimeseries], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -4061,7 +4061,7 @@ func (r *RawClient) BloodPressure( r.options.ToHeader(), options.ToHeader(), ) - var response []*vitalgo.ClientFacingBloodPressureTimeseries + var response []*v505.ClientFacingBloodPressureTimeseries raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -4073,13 +4073,13 @@ func (r *RawClient) BloodPressure( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[[]*vitalgo.ClientFacingBloodPressureTimeseries]{ + return &core.Response[[]*v505.ClientFacingBloodPressureTimeseries]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, diff --git a/workouts.go b/workouts.go index 25eacf9..12d3902 100644 --- a/workouts.go +++ b/workouts.go @@ -5,7 +5,7 @@ package api import ( json "encoding/json" fmt "fmt" - internal "github.com/tryVital/vital-go/internal" + internal "github.com/tryVital/vital-go/v2/internal" big "math/big" time "time" ) diff --git a/workouts/client.go b/workouts/client.go index 52e93ef..3a7f876 100644 --- a/workouts/client.go +++ b/workouts/client.go @@ -4,10 +4,10 @@ package workouts import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" ) type Client struct { @@ -36,9 +36,9 @@ func NewClient(options *core.RequestOptions) *Client { func (c *Client) Get( ctx context.Context, userId string, - request *vitalgo.WorkoutsGetRequest, + request *v505.WorkoutsGetRequest, opts ...option.RequestOption, -) (*vitalgo.ClientWorkoutResponse, error) { +) (*v505.ClientWorkoutResponse, error) { response, err := c.WithRawResponse.Get( ctx, userId, @@ -55,9 +55,9 @@ func (c *Client) Get( func (c *Client) GetRaw( ctx context.Context, userId string, - request *vitalgo.WorkoutsGetRawRequest, + request *v505.WorkoutsGetRawRequest, opts ...option.RequestOption, -) (*vitalgo.RawWorkout, error) { +) (*v505.RawWorkout, error) { response, err := c.WithRawResponse.GetRaw( ctx, userId, @@ -75,7 +75,7 @@ func (c *Client) GetByWorkoutId( // The Vital ID for the workout workoutId string, opts ...option.RequestOption, -) (*vitalgo.ClientFacingStream, error) { +) (*v505.ClientFacingStream, error) { response, err := c.WithRawResponse.GetByWorkoutId( ctx, workoutId, diff --git a/workouts/raw_client.go b/workouts/raw_client.go index 00b8d09..753efd3 100644 --- a/workouts/raw_client.go +++ b/workouts/raw_client.go @@ -4,10 +4,10 @@ package workouts import ( context "context" - vitalgo "github.com/tryVital/vital-go" - core "github.com/tryVital/vital-go/core" - internal "github.com/tryVital/vital-go/internal" - option "github.com/tryVital/vital-go/option" + v505 "github.com/tryVital/vital-go/v2" + core "github.com/tryVital/vital-go/v2/core" + internal "github.com/tryVital/vital-go/v2/internal" + option "github.com/tryVital/vital-go/v2/option" http "net/http" ) @@ -33,9 +33,9 @@ func NewRawClient(options *core.RequestOptions) *RawClient { func (r *RawClient) Get( ctx context.Context, userId string, - request *vitalgo.WorkoutsGetRequest, + request *v505.WorkoutsGetRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientWorkoutResponse], error) { +) (*core.Response[*v505.ClientWorkoutResponse], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -57,7 +57,7 @@ func (r *RawClient) Get( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientWorkoutResponse + var response *v505.ClientWorkoutResponse raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -69,13 +69,13 @@ func (r *RawClient) Get( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientWorkoutResponse]{ + return &core.Response[*v505.ClientWorkoutResponse]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -85,9 +85,9 @@ func (r *RawClient) Get( func (r *RawClient) GetRaw( ctx context.Context, userId string, - request *vitalgo.WorkoutsGetRawRequest, + request *v505.WorkoutsGetRawRequest, opts ...option.RequestOption, -) (*core.Response[*vitalgo.RawWorkout], error) { +) (*core.Response[*v505.RawWorkout], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -109,7 +109,7 @@ func (r *RawClient) GetRaw( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.RawWorkout + var response *v505.RawWorkout raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -121,13 +121,13 @@ func (r *RawClient) GetRaw( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.RawWorkout]{ + return &core.Response[*v505.RawWorkout]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response, @@ -139,7 +139,7 @@ func (r *RawClient) GetByWorkoutId( // The Vital ID for the workout workoutId string, opts ...option.RequestOption, -) (*core.Response[*vitalgo.ClientFacingStream], error) { +) (*core.Response[*v505.ClientFacingStream], error) { options := core.NewRequestOptions(opts...) baseURL := internal.ResolveBaseURL( options.BaseURL, @@ -154,7 +154,7 @@ func (r *RawClient) GetByWorkoutId( r.options.ToHeader(), options.ToHeader(), ) - var response *vitalgo.ClientFacingStream + var response *v505.ClientFacingStream raw, err := r.caller.Call( ctx, &internal.CallParams{ @@ -166,13 +166,13 @@ func (r *RawClient) GetByWorkoutId( QueryParameters: options.QueryParameters, Client: options.HTTPClient, Response: &response, - ErrorDecoder: internal.NewErrorDecoder(vitalgo.ErrorCodes), + ErrorDecoder: internal.NewErrorDecoder(v505.ErrorCodes), }, ) if err != nil { return nil, err } - return &core.Response[*vitalgo.ClientFacingStream]{ + return &core.Response[*v505.ClientFacingStream]{ StatusCode: raw.StatusCode, Header: raw.Header, Body: response,