diff --git a/.fern/metadata.json b/.fern/metadata.json index c85f405..31645b3 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,9 +1,9 @@ { - "cliVersion": "3.35.1", + "cliVersion": "4.20.1", "generatorName": "fernapi/fern-go-sdk", - "generatorVersion": "1.21.8", + "generatorVersion": "1.24.0", "generatorConfig": { "enableWireTests": false }, - "sdkVersion": "v1.1.575" + "sdkVersion": "v1.1.576" } \ 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/client.go b/activity/client.go index 4244b06..a3b38d9 100644 --- a/activity/client.go +++ b/activity/client.go @@ -4,7 +4,7 @@ package activity import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..ea49d5d 100644 --- a/activity/raw_client.go +++ b/activity/raw_client.go @@ -4,7 +4,7 @@ package activity import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..1958614 100644 --- a/aggregate.go +++ b/aggregate.go @@ -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 diff --git a/aggregate/client.go b/aggregate/client.go index 61f01d4..aa71bf6 100644 --- a/aggregate/client.go +++ b/aggregate/client.go @@ -4,7 +4,7 @@ package aggregate import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..a9f01ea 100644 --- a/aggregate/raw_client.go +++ b/aggregate/raw_client.go @@ -4,7 +4,7 @@ package aggregate import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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/client.go b/body/client.go index ced0615..481652b 100644 --- a/body/client.go +++ b/body/client.go @@ -4,7 +4,7 @@ package body import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..73a90eb 100644 --- a/body/raw_client.go +++ b/body/raw_client.go @@ -4,7 +4,7 @@ package body import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..e7ac182 --- /dev/null +++ b/changelog.md @@ -0,0 +1,4 @@ +## v1.1.576 - 2026-03-09 +* SDK regeneration +* Unable to analyze changes with AI, incrementing PATCH version. + diff --git a/client/client.go b/client/client.go index d3a41bb..d3f51c9 100644 --- a/client/client.go +++ b/client/client.go @@ -6,12 +6,14 @@ import ( activity "github.com/tryVital/vital-go/activity" aggregate "github.com/tryVital/vital-go/aggregate" body "github.com/tryVital/vital-go/body" + compendium "github.com/tryVital/vital-go/compendium" 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" + labaccount "github.com/tryVital/vital-go/labaccount" labreport "github.com/tryVital/vital-go/labreport" labtests "github.com/tryVital/vital-go/labtests" link "github.com/tryVital/vital-go/link" @@ -19,6 +21,7 @@ import ( menstrualcycle "github.com/tryVital/vital-go/menstrualcycle" option "github.com/tryVital/vital-go/option" order "github.com/tryVital/vital-go/order" + ordertransaction "github.com/tryVital/vital-go/ordertransaction" payor "github.com/tryVital/vital-go/payor" profile "github.com/tryVital/vital-go/profile" providers "github.com/tryVital/vital-go/providers" @@ -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/compendium.go b/compendium.go new file mode 100644 index 0000000..17e352b --- /dev/null +++ b/compendium.go @@ -0,0 +1,1326 @@ +// Code generated by Fern. DO NOT EDIT. + +package api + +import ( + json "encoding/json" + fmt "fmt" + internal "github.com/tryVital/vital-go/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) + searchCompendiumBodyFieldLoincSetHash = big.NewInt(1 << 3) + searchCompendiumBodyFieldLabs = big.NewInt(1 << 4) + searchCompendiumBodyFieldIncludeRelated = big.NewInt(1 << 5) + searchCompendiumBodyFieldLimit = big.NewInt(1 << 6) +) + +type SearchCompendiumBody struct { + TeamId *CompendiumSearchRequestTeamId `json:"-" url:"team_id,omitempty"` + Mode SearchMode `json:"mode" url:"-"` + Query *string `json:"query,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) +} + +// 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) + canonicalCandidateFieldPopularityScore = big.NewInt(1 << 7) + canonicalCandidateFieldConfidence = big.NewInt(1 << 8) +) + +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"` + 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) 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) +} + +// 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) + perLabCandidateFieldRelation = big.NewInt(1 << 10) + perLabCandidateFieldConfidence = big.NewInt(1 << 11) + perLabCandidateFieldReasonCodes = big.NewInt(1 << 12) + perLabCandidateFieldMarkerPopularityScore = big.NewInt(1 << 13) +) + +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"` + 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) 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) +} + +// 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..a11fa51 --- /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" + core "github.com/tryVital/vital-go/core" + internal "github.com/tryVital/vital-go/internal" + option "github.com/tryVital/vital-go/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..2ed2dbf --- /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" + core "github.com/tryVital/vital-go/core" + internal "github.com/tryVital/vital-go/internal" + option "github.com/tryVital/vital-go/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..fe73a49 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", "v1.1.576") + headers.Set("User-Agent", "github.com/tryVital/vital-go/v1.1.576") return headers } diff --git a/devices/client.go b/devices/client.go index e015b36..798bf8c 100644 --- a/devices/client.go +++ b/devices/client.go @@ -4,7 +4,7 @@ package devices import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..671c25e 100644 --- a/devices/raw_client.go +++ b/devices/raw_client.go @@ -4,7 +4,7 @@ package devices import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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/client.go b/electrocardiogram/client.go index 0e5dda9..09af5b5 100644 --- a/electrocardiogram/client.go +++ b/electrocardiogram/client.go @@ -4,7 +4,7 @@ package electrocardiogram import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..18fb6f8 100644 --- a/electrocardiogram/raw_client.go +++ b/electrocardiogram/raw_client.go @@ -4,7 +4,7 @@ package electrocardiogram import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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/insurance.go b/insurance.go index d03c6ff..33152b8 100644 --- a/insurance.go +++ b/insurance.go @@ -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..364af70 100644 --- a/insurance/client.go +++ b/insurance/client.go @@ -4,7 +4,7 @@ package insurance import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..973f33c 100644 --- a/insurance/raw_client.go +++ b/insurance/raw_client.go @@ -4,7 +4,7 @@ package insurance import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..980ec2f 100644 --- a/internal/caller.go +++ b/internal/caller.go @@ -17,8 +17,9 @@ import ( 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..911a76d 100644 --- a/internal/caller_test.go +++ b/internal/caller_test.go @@ -11,6 +11,7 @@ import ( "net/http/httptest" "net/url" "strconv" + "strings" "testing" "github.com/stretchr/testify/assert" @@ -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/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/introspect/client.go b/introspect/client.go index af5e38a..9465de7 100644 --- a/introspect/client.go +++ b/introspect/client.go @@ -4,7 +4,7 @@ package introspect import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..96a99fd 100644 --- a/introspect/raw_client.go +++ b/introspect/raw_client.go @@ -4,7 +4,7 @@ package introspect import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..18f0db9 --- /dev/null +++ b/lab_account.go @@ -0,0 +1,571 @@ +// Code generated by Fern. DO NOT EDIT. + +package api + +import ( + json "encoding/json" + fmt "fmt" + internal "github.com/tryVital/vital-go/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) + clientFacingLabAccountFieldBusinessUnits = big.NewInt(1 << 7) + clientFacingLabAccountFieldAllowedBilling = big.NewInt(1 << 8) + clientFacingLabAccountFieldTeamIdAllowlist = big.NewInt(1 << 9) +) + +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"` + 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) 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) +} + +// 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..f09c816 100644 --- a/lab_report.go +++ b/lab_report.go @@ -11,9 +11,9 @@ import ( ) 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..6d07dd0 100644 --- a/lab_tests.go +++ b/lab_tests.go @@ -10,6 +10,56 @@ import ( 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,45 @@ 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) ) 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:"-"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -148,6 +242,34 @@ 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) +} + +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) @@ -190,8 +312,8 @@ type CreateOrderRequestCompatible struct { Passthrough *string `json:"passthrough,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:"-"` @@ -337,6 +459,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 +714,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 +753,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 +966,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 +1004,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 +1132,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 +1316,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 +1335,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 +1384,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 +1472,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,6 +1554,27 @@ 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) @@ -1388,7 +1582,7 @@ var ( type RequestAppointmentRequest struct { // At-home phlebotomy appointment address. - Address *UsAddress `json:"address,omitempty" url:"-"` + Address *UsAddress `json:"address" url:"-"` Provider AppointmentProvider `json:"provider" url:"-"` // Private bitmask of fields set to an explicit value and therefore not to be omitted @@ -1416,6 +1610,27 @@ func (r *RequestAppointmentRequest) SetProvider(provider AppointmentProvider) { r.require(requestAppointmentRequestFieldProvider) } +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 +2010,20 @@ func (a *AppointmentAvailabilitySlots) String() string { } var ( - appointmentBookingRequestFieldBookingKey = big.NewInt(1 << 0) + appointmentBookingRequestFieldBookingKey = big.NewInt(1 << 0) + appointmentBookingRequestFieldAsyncConfirmation = big.NewInt(1 << 1) + appointmentBookingRequestFieldSyncConfirmationTimeoutMillisecond = big.NewInt(1 << 2) + appointmentBookingRequestFieldAsyncConfirmationTimeoutMillisecond = big.NewInt(1 << 3) ) type AppointmentBookingRequest struct { BookingKey string `json:"booking_key" url:"booking_key"` + // 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 +2039,27 @@ func (a *AppointmentBookingRequest) GetBookingKey() string { return a.BookingKey } +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 +2078,27 @@ func (a *AppointmentBookingRequest) SetBookingKey(bookingKey string) { a.require(appointmentBookingRequestFieldBookingKey) } +// 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 +2338,7 @@ const ( AppointmentProviderGetlabs AppointmentProvider = "getlabs" AppointmentProviderPhlebfinders AppointmentProvider = "phlebfinders" AppointmentProviderQuest AppointmentProvider = "quest" + AppointmentProviderSonoraQuest AppointmentProvider = "sonora_quest" ) func NewAppointmentProviderFromString(s string) (AppointmentProvider, error) { @@ -2082,6 +2349,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,7 +2361,27 @@ 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) @@ -2363,49 +2652,48 @@ 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) + clientFacingAppointmentFieldEventStatus = big.NewInt(1 << 15) + clientFacingAppointmentFieldEventData = big.NewInt(1 << 16) + clientFacingAppointmentFieldEvents = big.NewInt(1 << 17) ) -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"` + 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,492 +2702,127 @@ 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 +func (c *ClientFacingAppointment) GetCanReschedule() bool { + if c == nil { + return false } - return b.ProviderId + return c.CanReschedule } -func (b *BiomarkerResult) GetSourceMarkers() []*ParentBiomarkerData { - if b == nil { - return nil +func (c *ClientFacingAppointment) GetEventStatus() AppointmentEventStatus { + if c == nil { + return "" } - return b.SourceMarkers + return c.EventStatus } -func (b *BiomarkerResult) GetPerformingLaboratory() *string { - if b == nil { +func (c *ClientFacingAppointment) GetEventData() map[string]interface{} { + if c == nil { return nil } - return b.PerformingLaboratory + return c.EventData } -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 { - if c == nil { - return "" - } - return c.ProviderId -} - -func (c *ClientFacingAppointment) GetExternalId() *string { - if c == nil { - return nil - } - return c.ExternalId -} - -func (c *ClientFacingAppointment) GetCanReschedule() bool { - if c == nil { - return false - } - return c.CanReschedule -} - -func (c *ClientFacingAppointment) GetEventStatus() AppointmentEventStatus { - if c == nil { - return "" - } - return c.EventStatus -} - -func (c *ClientFacingAppointment) GetEventData() map[string]interface{} { - if c == nil { - return nil - } - return c.EventData -} - -func (c *ClientFacingAppointment) GetEvents() []*ClientFacingAppointmentEvent { - if c == nil { +func (c *ClientFacingAppointment) GetEvents() []*ClientFacingAppointmentEvent { + if c == nil { return nil } return c.Events @@ -2937,6 +2860,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) { @@ -3479,6 +3409,7 @@ const ( ClientFacingLabsQuest ClientFacingLabs = "quest" ClientFacingLabsLabcorp ClientFacingLabs = "labcorp" ClientFacingLabsBioreference ClientFacingLabs = "bioreference" + ClientFacingLabsSonoraQuest ClientFacingLabs = "sonora_quest" ) func NewClientFacingLabsFromString(s string) (ClientFacingLabs, error) { @@ -3489,6 +3420,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 +4050,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,135 +4067,11 @@ type ClinicalInformation struct { rawJSON json.RawMessage } -func (c *ClinicalInformation) GetFasting() *bool { - if c == nil { +func (d *DaySlots) GetLocation() *AppointmentLocation { + if d == 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 *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 + return d.Location } func (d *DaySlots) GetDate() string { @@ -4352,56 +4159,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 +4879,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 +4922,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 +5117,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 +5227,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) @@ -6476,150 +5351,24 @@ func (p *PatientAddress) SetState(state string) { // 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) -} - -// 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) + p.Zip = zip + p.require(patientAddressFieldZip) } -// SetAddress sets the Address 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) SetAddress(address *Address) { - p.Address = address - p.require(performingLaboratoryFieldAddress) +func (p *PatientAddress) SetCountry(country string) { + p.Country = country + p.require(patientAddressFieldCountry) } -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 +5378,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 +5389,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 @@ -7248,553 +5997,164 @@ func (p *PscAreaInfoDetails) SetWithinRadius(withinRadius int) { // SetRadius sets the Radius field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. func (p *PscAreaInfoDetails) SetRadius(radius string) { - p.Radius = radius - p.require(pscAreaInfoDetailsFieldRadius) -} - -// SetCapabilities sets the Capabilities field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (p *PscAreaInfoDetails) SetCapabilities(capabilities []LabLocationCapability) { - p.Capabilities = capabilities - p.require(pscAreaInfoDetailsFieldCapabilities) -} - -func (p *PscAreaInfoDetails) UnmarshalJSON(data []byte) error { - type unmarshaler PscAreaInfoDetails - var value unmarshaler - 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) + p.Radius = radius + p.require(pscAreaInfoDetailsFieldRadius) } -// SetClinicalInformation sets the ClinicalInformation field and marks it as non-optional; +// SetCapabilities sets the Capabilities 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 (p *PscAreaInfoDetails) SetCapabilities(capabilities []LabLocationCapability) { + p.Capabilities = capabilities + p.require(pscAreaInfoDetailsFieldCapabilities) } -func (s *SampleData) UnmarshalJSON(data []byte) error { - type unmarshaler SampleData +func (p *PscAreaInfoDetails) UnmarshalJSON(data []byte) error { + type unmarshaler PscAreaInfoDetails 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 ( @@ -8258,108 +6618,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 +6919,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 +6964,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..868c313 --- /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" + core "github.com/tryVital/vital-go/core" + internal "github.com/tryVital/vital-go/internal" + option "github.com/tryVital/vital-go/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..b350231 --- /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" + core "github.com/tryVital/vital-go/core" + internal "github.com/tryVital/vital-go/internal" + option "github.com/tryVital/vital-go/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..675a66b 100644 --- a/labreport/client.go +++ b/labreport/client.go @@ -4,7 +4,7 @@ package labreport import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..a962032 100644 --- a/labreport/raw_client.go +++ b/labreport/raw_client.go @@ -5,7 +5,7 @@ package labreport import ( context "context" fmt "fmt" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..8328378 100644 --- a/labtests/client.go +++ b/labtests/client.go @@ -4,7 +4,7 @@ package labtests import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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, @@ -106,9 +106,9 @@ func (c *Client) UpdateLabTest( // GET all the markers for the given lab. 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, @@ -139,9 +139,9 @@ func (c *Client) GetMarkersForOrderSet( 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 +159,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 +179,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 +193,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 +226,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 +244,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 +263,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 +283,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 +303,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 +323,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 +342,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 +359,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 +378,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 +394,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 +412,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 +450,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 +467,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 +483,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 +500,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 +518,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 +537,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 +556,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 +574,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 +591,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 +663,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 +677,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 +693,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 +713,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 +729,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 +750,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 +764,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..f3a862b 100644 --- a/labtests/raw_client.go +++ b/labtests/raw_client.go @@ -5,7 +5,7 @@ package labtests import ( bytes "bytes" context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..b18b83b 100644 --- a/link.go +++ b/link.go @@ -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,6 +504,27 @@ 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) @@ -412,6 +559,27 @@ func (m *ManualConnectionData) SetProviderId(providerId *string) { m.require(manualConnectionDataFieldProviderId) } +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 +635,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 +717,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 +813,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 +938,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 +993,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 +1102,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 +2107,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 +2130,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..33d0dea 100644 --- a/link/client.go +++ b/link/client.go @@ -4,7 +4,7 @@ package link import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..c8daa90 100644 --- a/link/raw_client.go +++ b/link/raw_client.go @@ -4,7 +4,7 @@ package link import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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...) @@ -870,7 +870,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 +885,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 +900,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 +913,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/client.go b/meal/client.go index 93417b1..94ce192 100644 --- a/meal/client.go +++ b/meal/client.go @@ -4,7 +4,7 @@ package meal import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..1212937 100644 --- a/meal/raw_client.go +++ b/meal/raw_client.go @@ -4,7 +4,7 @@ package meal import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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/menstrualcycle/client.go b/menstrualcycle/client.go index b45e6c4..e7fd859 100644 --- a/menstrualcycle/client.go +++ b/menstrualcycle/client.go @@ -4,7 +4,7 @@ package menstrualcycle import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..0975933 100644 --- a/menstrualcycle/raw_client.go +++ b/menstrualcycle/raw_client.go @@ -4,7 +4,7 @@ package menstrualcycle import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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/order/client.go b/order/client.go index 252ad29..abc04cb 100644 --- a/order/client.go +++ b/order/client.go @@ -4,7 +4,7 @@ package order import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..068675b 100644 --- a/order/raw_client.go +++ b/order/raw_client.go @@ -4,7 +4,7 @@ package order import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..4dde70c --- /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/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..57d3745 --- /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" + core "github.com/tryVital/vital-go/core" + internal "github.com/tryVital/vital-go/internal" + option "github.com/tryVital/vital-go/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..92d3c42 --- /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" + core "github.com/tryVital/vital-go/core" + internal "github.com/tryVital/vital-go/internal" + option "github.com/tryVital/vital-go/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..e793093 100644 --- a/payor.go +++ b/payor.go @@ -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..fe74f0e 100644 --- a/payor/client.go +++ b/payor/client.go @@ -4,7 +4,7 @@ package payor import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..a42be1a 100644 --- a/payor/raw_client.go +++ b/payor/raw_client.go @@ -4,7 +4,7 @@ package payor import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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/client.go b/profile/client.go index 836291f..64eda2a 100644 --- a/profile/client.go +++ b/profile/client.go @@ -4,7 +4,7 @@ package profile import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..42a16d2 100644 --- a/profile/raw_client.go +++ b/profile/raw_client.go @@ -4,7 +4,7 @@ package profile import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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/client.go b/providers/client.go index 8a3d6cd..cbea441 100644 --- a/providers/client.go +++ b/providers/client.go @@ -4,7 +4,7 @@ package providers import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..593f9b1 100644 --- a/providers/raw_client.go +++ b/providers/raw_client.go @@ -4,7 +4,7 @@ package providers import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..3dede45 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,7 @@ client.Link.ConnectManualProvider(
-**provider:** `*vitalgo.ManualProviders` +**provider:** `*v505.ManualProviders`
@@ -1436,7 +1409,7 @@ client.Link.ConnectManualProvider(
-
client.Link.ConnectDemoProvider(request) -> *vitalgo.DemoConnectionStatus +
client.Link.ConnectDemoProvider(request) -> *v505.DemoConnectionStatus
@@ -1463,9 +1436,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 +1467,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 +1480,7 @@ client.Link.ConnectDemoProvider(
## Electrocardiogram -
client.Electrocardiogram.Get(UserId) -> *vitalgo.ClientFacingElectrocardiogramResponse +
client.Electrocardiogram.Get(UserId) -> *v505.ClientFacingElectrocardiogramResponse
@@ -1534,12 +1507,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 +1573,7 @@ client.Electrocardiogram.Get(
## SleepCycle -
client.SleepCycle.Get(UserId) -> *vitalgo.ClientSleepCycleResponse +
client.SleepCycle.Get(UserId) -> *v505.ClientSleepCycleResponse
@@ -1627,12 +1600,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 +1666,7 @@ client.SleepCycle.Get(
## Profile -
client.Profile.Get(UserId) -> *vitalgo.ClientFacingProfile +
client.Profile.Get(UserId) -> *v505.ClientFacingProfile
@@ -1720,8 +1693,8 @@ Get profile for user_id
```go -request := &vitalgo.ProfileGetRequest{ - Provider: vitalgo.String( +request := &v505.ProfileGetRequest{ + Provider: v505.String( "provider", ), } @@ -1765,7 +1738,7 @@ client.Profile.Get(
-
client.Profile.GetRaw(UserId) -> *vitalgo.RawProfile +
client.Profile.GetRaw(UserId) -> *v505.RawProfile
@@ -1792,8 +1765,8 @@ Get raw profile for user_id
```go -request := &vitalgo.ProfileGetRawRequest{ - Provider: vitalgo.String( +request := &v505.ProfileGetRawRequest{ + Provider: v505.String( "provider", ), } @@ -1838,7 +1811,7 @@ client.Profile.GetRaw(
## Devices -
client.Devices.GetRaw(UserId) -> *vitalgo.RawDevices +
client.Devices.GetRaw(UserId) -> *v505.RawDevices
@@ -1865,8 +1838,8 @@ Get Devices for user_id
```go -request := &vitalgo.DevicesGetRawRequest{ - Provider: vitalgo.String( +request := &v505.DevicesGetRawRequest{ + Provider: v505.String( "provider", ), } @@ -1911,7 +1884,7 @@ client.Devices.GetRaw(
## Activity -
client.Activity.Get(UserId) -> *vitalgo.ClientActivityResponse +
client.Activity.Get(UserId) -> *v505.ClientActivityResponse
@@ -1938,12 +1911,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 +1976,7 @@ client.Activity.Get(
-
client.Activity.GetRaw(UserId) -> *vitalgo.RawActivity +
client.Activity.GetRaw(UserId) -> *v505.RawActivity
@@ -2030,12 +2003,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 +2069,7 @@ client.Activity.GetRaw(
## Workouts -
client.Workouts.Get(UserId) -> *vitalgo.ClientWorkoutResponse +
client.Workouts.Get(UserId) -> *v505.ClientWorkoutResponse
@@ -2123,12 +2096,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 +2161,7 @@ client.Workouts.Get(
-
client.Workouts.GetRaw(UserId) -> *vitalgo.RawWorkout +
client.Workouts.GetRaw(UserId) -> *v505.RawWorkout
@@ -2215,12 +2188,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 +2253,7 @@ client.Workouts.GetRaw(
-
client.Workouts.GetByWorkoutId(WorkoutId) -> *vitalgo.ClientFacingStream +
client.Workouts.GetByWorkoutId(WorkoutId) -> *v505.ClientFacingStream
@@ -2325,7 +2298,7 @@ client.Workouts.GetByWorkoutId(
## Sleep -
client.Sleep.Get(UserId) -> *vitalgo.ClientSleepResponse +
client.Sleep.Get(UserId) -> *v505.ClientSleepResponse
@@ -2352,12 +2325,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 +2390,7 @@ client.Sleep.Get(
-
client.Sleep.GetRaw(UserId) -> *vitalgo.RawSleep +
client.Sleep.GetRaw(UserId) -> *v505.RawSleep
@@ -2444,12 +2417,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 +2482,7 @@ client.Sleep.GetRaw(
-
client.Sleep.GetStreamBySleepId(SleepId) -> *vitalgo.ClientFacingSleepStream +
client.Sleep.GetStreamBySleepId(SleepId) -> *v505.ClientFacingSleepStream
@@ -2568,7 +2541,7 @@ client.Sleep.GetStreamBySleepId(
## Body -
client.Body.Get(UserId) -> *vitalgo.ClientBodyResponse +
client.Body.Get(UserId) -> *v505.ClientBodyResponse
@@ -2595,12 +2568,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 +2633,7 @@ client.Body.Get(
-
client.Body.GetRaw(UserId) -> *vitalgo.RawBody +
client.Body.GetRaw(UserId) -> *v505.RawBody
@@ -2687,12 +2660,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 +2726,7 @@ client.Body.GetRaw(
## Meal -
client.Meal.Get(UserId) -> *vitalgo.ClientFacingMealResponse +
client.Meal.Get(UserId) -> *v505.ClientFacingMealResponse
@@ -2780,12 +2753,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 +2819,7 @@ client.Meal.Get(
## MenstrualCycle -
client.MenstrualCycle.Get(UserId) -> *vitalgo.MenstrualCycleResponse +
client.MenstrualCycle.Get(UserId) -> *v505.MenstrualCycleResponse
@@ -2859,12 +2832,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 +2898,7 @@ client.MenstrualCycle.Get(
## Vitals -
client.Vitals.WorkoutSwimmingStrokeGrouped(UserId) -> *vitalgo.GroupedWorkoutSwimmingStrokeResponse +
client.Vitals.WorkoutSwimmingStrokeGrouped(UserId) -> *v505.GroupedWorkoutSwimmingStrokeResponse
@@ -2938,18 +2911,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 +2998,7 @@ client.Vitals.WorkoutSwimmingStrokeGrouped(
-
client.Vitals.WorkoutDistanceGrouped(UserId) -> *vitalgo.GroupedWorkoutDistanceResponse +
client.Vitals.WorkoutDistanceGrouped(UserId) -> *v505.GroupedWorkoutDistanceResponse
@@ -3038,18 +3011,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 +3098,7 @@ client.Vitals.WorkoutDistanceGrouped(
-
client.Vitals.HeartRateRecoveryOneMinuteGrouped(UserId) -> *vitalgo.GroupedHeartRateRecoveryOneMinuteResponse +
client.Vitals.HeartRateRecoveryOneMinuteGrouped(UserId) -> *v505.GroupedHeartRateRecoveryOneMinuteResponse
@@ -3138,18 +3111,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 +3198,7 @@ client.Vitals.HeartRateRecoveryOneMinuteGrouped(
-
client.Vitals.WaistCircumferenceGrouped(UserId) -> *vitalgo.GroupedWaistCircumferenceResponse +
client.Vitals.WaistCircumferenceGrouped(UserId) -> *v505.GroupedWaistCircumferenceResponse
@@ -3238,18 +3211,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 +3298,7 @@ client.Vitals.WaistCircumferenceGrouped(
-
client.Vitals.LeanBodyMassGrouped(UserId) -> *vitalgo.GroupedLeanBodyMassResponse +
client.Vitals.LeanBodyMassGrouped(UserId) -> *v505.GroupedLeanBodyMassResponse
@@ -3338,18 +3311,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 +3398,7 @@ client.Vitals.LeanBodyMassGrouped(
-
client.Vitals.BodyMassIndexGrouped(UserId) -> *vitalgo.GroupedBodyMassIndexResponse +
client.Vitals.BodyMassIndexGrouped(UserId) -> *v505.GroupedBodyMassIndexResponse
@@ -3438,18 +3411,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 +3498,7 @@ client.Vitals.BodyMassIndexGrouped(
-
client.Vitals.BasalBodyTemperatureGrouped(UserId) -> *vitalgo.GroupedBasalBodyTemperatureResponse +
client.Vitals.BasalBodyTemperatureGrouped(UserId) -> *v505.GroupedBasalBodyTemperatureResponse
@@ -3538,18 +3511,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 +3598,7 @@ client.Vitals.BasalBodyTemperatureGrouped(
-
client.Vitals.HandwashingGrouped(UserId) -> *vitalgo.GroupedHandwashingResponse +
client.Vitals.HandwashingGrouped(UserId) -> *v505.GroupedHandwashingResponse
@@ -3638,18 +3611,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 +3698,7 @@ client.Vitals.HandwashingGrouped(
-
client.Vitals.DaylightExposureGrouped(UserId) -> *vitalgo.GroupedDaylightExposureResponse +
client.Vitals.DaylightExposureGrouped(UserId) -> *v505.GroupedDaylightExposureResponse
@@ -3738,18 +3711,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 +3798,7 @@ client.Vitals.DaylightExposureGrouped(
-
client.Vitals.UvExposureGrouped(UserId) -> *vitalgo.GroupedUvExposureResponse +
client.Vitals.UvExposureGrouped(UserId) -> *v505.GroupedUvExposureResponse
@@ -3838,18 +3811,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 +3898,7 @@ client.Vitals.UvExposureGrouped(
-
client.Vitals.FallGrouped(UserId) -> *vitalgo.GroupedFallResponse +
client.Vitals.FallGrouped(UserId) -> *v505.GroupedFallResponse
@@ -3938,18 +3911,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 +3998,7 @@ client.Vitals.FallGrouped(
-
client.Vitals.InhalerUsageGrouped(UserId) -> *vitalgo.GroupedInhalerUsageResponse +
client.Vitals.InhalerUsageGrouped(UserId) -> *v505.GroupedInhalerUsageResponse
@@ -4038,18 +4011,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 +4098,7 @@ client.Vitals.InhalerUsageGrouped(
-
client.Vitals.PeakExpiratoryFlowRateGrouped(UserId) -> *vitalgo.GroupedPeakExpiratoryFlowRateResponse +
client.Vitals.PeakExpiratoryFlowRateGrouped(UserId) -> *v505.GroupedPeakExpiratoryFlowRateResponse
@@ -4138,18 +4111,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 +4198,7 @@ client.Vitals.PeakExpiratoryFlowRateGrouped(
-
client.Vitals.ForcedVitalCapacityGrouped(UserId) -> *vitalgo.GroupedForcedVitalCapacityResponse +
client.Vitals.ForcedVitalCapacityGrouped(UserId) -> *v505.GroupedForcedVitalCapacityResponse
@@ -4238,18 +4211,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 +4298,7 @@ client.Vitals.ForcedVitalCapacityGrouped(
-
client.Vitals.ForcedExpiratoryVolume1Grouped(UserId) -> *vitalgo.GroupedForcedExpiratoryVolume1Response +
client.Vitals.ForcedExpiratoryVolume1Grouped(UserId) -> *v505.GroupedForcedExpiratoryVolume1Response
@@ -4338,18 +4311,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 +4398,7 @@ client.Vitals.ForcedExpiratoryVolume1Grouped(
-
client.Vitals.WheelchairPushGrouped(UserId) -> *vitalgo.GroupedWheelchairPushResponse +
client.Vitals.WheelchairPushGrouped(UserId) -> *v505.GroupedWheelchairPushResponse
@@ -4438,18 +4411,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 +4498,7 @@ client.Vitals.WheelchairPushGrouped(
-
client.Vitals.SleepBreathingDisturbanceGrouped(UserId) -> *vitalgo.GroupedSleepBreathingDisturbanceResponse +
client.Vitals.SleepBreathingDisturbanceGrouped(UserId) -> *v505.GroupedSleepBreathingDisturbanceResponse
@@ -4538,18 +4511,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 +4598,7 @@ client.Vitals.SleepBreathingDisturbanceGrouped(
-
client.Vitals.SleepApneaAlertGrouped(UserId) -> *vitalgo.GroupedSleepApneaAlertResponse +
client.Vitals.SleepApneaAlertGrouped(UserId) -> *v505.GroupedSleepApneaAlertResponse
@@ -4638,18 +4611,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 +4698,7 @@ client.Vitals.SleepApneaAlertGrouped(
-
client.Vitals.StandDurationGrouped(UserId) -> *vitalgo.GroupedStandDurationResponse +
client.Vitals.StandDurationGrouped(UserId) -> *v505.GroupedStandDurationResponse
@@ -4738,18 +4711,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 +4798,7 @@ client.Vitals.StandDurationGrouped(
-
client.Vitals.StandHourGrouped(UserId) -> *vitalgo.GroupedStandHourResponse +
client.Vitals.StandHourGrouped(UserId) -> *v505.GroupedStandHourResponse
@@ -4838,18 +4811,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 +4898,7 @@ client.Vitals.StandHourGrouped(
-
client.Vitals.HeartRateAlertGrouped(UserId) -> *vitalgo.GroupedHeartRateAlertResponse +
client.Vitals.HeartRateAlertGrouped(UserId) -> *v505.GroupedHeartRateAlertResponse
@@ -4938,18 +4911,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 +4998,7 @@ client.Vitals.HeartRateAlertGrouped(
-
client.Vitals.AfibBurdenGrouped(UserId) -> *vitalgo.GroupedAFibBurdenResponse +
client.Vitals.AfibBurdenGrouped(UserId) -> *v505.GroupedAFibBurdenResponse
@@ -5038,18 +5011,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 +5098,7 @@ client.Vitals.AfibBurdenGrouped(
-
client.Vitals.WorkoutDurationGrouped(UserId) -> *vitalgo.GroupedWorkoutDurationResponse +
client.Vitals.WorkoutDurationGrouped(UserId) -> *v505.GroupedWorkoutDurationResponse
@@ -5138,18 +5111,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 +5198,7 @@ client.Vitals.WorkoutDurationGrouped(
-
client.Vitals.Vo2MaxGrouped(UserId) -> *vitalgo.GroupedVo2MaxResponse +
client.Vitals.Vo2MaxGrouped(UserId) -> *v505.GroupedVo2MaxResponse
@@ -5238,18 +5211,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 +5298,7 @@ client.Vitals.Vo2MaxGrouped(
-
client.Vitals.StressLevelGrouped(UserId) -> *vitalgo.GroupedStressLevelResponse +
client.Vitals.StressLevelGrouped(UserId) -> *v505.GroupedStressLevelResponse
@@ -5338,18 +5311,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 +5398,7 @@ client.Vitals.StressLevelGrouped(
-
client.Vitals.MindfulnessMinutesGrouped(UserId) -> *vitalgo.GroupedMindfulnessMinutesResponse +
client.Vitals.MindfulnessMinutesGrouped(UserId) -> *v505.GroupedMindfulnessMinutesResponse
@@ -5438,18 +5411,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 +5498,7 @@ client.Vitals.MindfulnessMinutesGrouped(
-
client.Vitals.CaffeineGrouped(UserId) -> *vitalgo.GroupedCaffeineResponse +
client.Vitals.CaffeineGrouped(UserId) -> *v505.GroupedCaffeineResponse
@@ -5538,18 +5511,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 +5598,7 @@ client.Vitals.CaffeineGrouped(
-
client.Vitals.WaterGrouped(UserId) -> *vitalgo.GroupedWaterResponse +
client.Vitals.WaterGrouped(UserId) -> *v505.GroupedWaterResponse
@@ -5638,18 +5611,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 +5698,7 @@ client.Vitals.WaterGrouped(
-
client.Vitals.StepsGrouped(UserId) -> *vitalgo.GroupedStepsResponse +
client.Vitals.StepsGrouped(UserId) -> *v505.GroupedStepsResponse
@@ -5738,18 +5711,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 +5798,7 @@ client.Vitals.StepsGrouped(
-
client.Vitals.FloorsClimbedGrouped(UserId) -> *vitalgo.GroupedFloorsClimbedResponse +
client.Vitals.FloorsClimbedGrouped(UserId) -> *v505.GroupedFloorsClimbedResponse
@@ -5838,18 +5811,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 +5898,7 @@ client.Vitals.FloorsClimbedGrouped(
-
client.Vitals.DistanceGrouped(UserId) -> *vitalgo.GroupedDistanceResponse +
client.Vitals.DistanceGrouped(UserId) -> *v505.GroupedDistanceResponse
@@ -5938,18 +5911,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 +5998,7 @@ client.Vitals.DistanceGrouped(
-
client.Vitals.CaloriesBasalGrouped(UserId) -> *vitalgo.GroupedCaloriesBasalResponse +
client.Vitals.CaloriesBasalGrouped(UserId) -> *v505.GroupedCaloriesBasalResponse
@@ -6038,18 +6011,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 +6098,7 @@ client.Vitals.CaloriesBasalGrouped(
-
client.Vitals.CaloriesActiveGrouped(UserId) -> *vitalgo.GroupedCaloriesActiveResponse +
client.Vitals.CaloriesActiveGrouped(UserId) -> *v505.GroupedCaloriesActiveResponse
@@ -6138,18 +6111,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 +6198,7 @@ client.Vitals.CaloriesActiveGrouped(
-
client.Vitals.RespiratoryRateGrouped(UserId) -> *vitalgo.GroupedRespiratoryRateResponse +
client.Vitals.RespiratoryRateGrouped(UserId) -> *v505.GroupedRespiratoryRateResponse
@@ -6238,18 +6211,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 +6298,7 @@ client.Vitals.RespiratoryRateGrouped(
-
client.Vitals.NoteGrouped(UserId) -> *vitalgo.GroupedNoteResponse +
client.Vitals.NoteGrouped(UserId) -> *v505.GroupedNoteResponse
@@ -6338,18 +6311,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 +6398,7 @@ client.Vitals.NoteGrouped(
-
client.Vitals.InsulinInjectionGrouped(UserId) -> *vitalgo.GroupedInsulinInjectionResponse +
client.Vitals.InsulinInjectionGrouped(UserId) -> *v505.GroupedInsulinInjectionResponse
@@ -6438,18 +6411,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 +6498,7 @@ client.Vitals.InsulinInjectionGrouped(
-
client.Vitals.IgeGrouped(UserId) -> *vitalgo.GroupedIgeResponse +
client.Vitals.IgeGrouped(UserId) -> *v505.GroupedIgeResponse
@@ -6538,18 +6511,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 +6598,7 @@ client.Vitals.IgeGrouped(
-
client.Vitals.IggGrouped(UserId) -> *vitalgo.GroupedIggResponse +
client.Vitals.IggGrouped(UserId) -> *v505.GroupedIggResponse
@@ -6638,18 +6611,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 +6698,7 @@ client.Vitals.IggGrouped(
-
client.Vitals.HypnogramGrouped(UserId) -> *vitalgo.GroupedHypnogramResponse +
client.Vitals.HypnogramGrouped(UserId) -> *v505.GroupedHypnogramResponse
@@ -6738,18 +6711,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 +6798,7 @@ client.Vitals.HypnogramGrouped(
-
client.Vitals.HrvGrouped(UserId) -> *vitalgo.GroupedHrvResponse +
client.Vitals.HrvGrouped(UserId) -> *v505.GroupedHrvResponse
@@ -6838,18 +6811,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 +6898,7 @@ client.Vitals.HrvGrouped(
-
client.Vitals.HeartrateGrouped(UserId) -> *vitalgo.GroupedHeartRateResponse +
client.Vitals.HeartrateGrouped(UserId) -> *v505.GroupedHeartRateResponse
@@ -6938,18 +6911,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 +6998,7 @@ client.Vitals.HeartrateGrouped(
-
client.Vitals.GlucoseGrouped(UserId) -> *vitalgo.GroupedGlucoseResponse +
client.Vitals.GlucoseGrouped(UserId) -> *v505.GroupedGlucoseResponse
@@ -7038,18 +7011,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 +7098,7 @@ client.Vitals.GlucoseGrouped(
-
client.Vitals.CholesterolGrouped(UserId) -> *vitalgo.GroupedCholesterolResponse +
client.Vitals.CholesterolGrouped(UserId) -> *v505.GroupedCholesterolResponse
@@ -7138,18 +7111,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 +7198,7 @@ client.Vitals.CholesterolGrouped(
-
client.Vitals.CarbohydratesGrouped(UserId) -> *vitalgo.GroupedCarbohydratesResponse +
client.Vitals.CarbohydratesGrouped(UserId) -> *v505.GroupedCarbohydratesResponse
@@ -7238,18 +7211,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 +7298,7 @@ client.Vitals.CarbohydratesGrouped(
-
client.Vitals.BodyTemperatureDeltaGrouped(UserId) -> *vitalgo.GroupedBodyTemperatureDeltaResponse +
client.Vitals.BodyTemperatureDeltaGrouped(UserId) -> *v505.GroupedBodyTemperatureDeltaResponse
@@ -7338,18 +7311,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 +7398,7 @@ client.Vitals.BodyTemperatureDeltaGrouped(
-
client.Vitals.BodyTemperatureGrouped(UserId) -> *vitalgo.GroupedBodyTemperatureResponse +
client.Vitals.BodyTemperatureGrouped(UserId) -> *v505.GroupedBodyTemperatureResponse
@@ -7438,18 +7411,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 +7498,7 @@ client.Vitals.BodyTemperatureGrouped(
-
client.Vitals.BodyWeightGrouped(UserId) -> *vitalgo.GroupedBodyWeightResponse +
client.Vitals.BodyWeightGrouped(UserId) -> *v505.GroupedBodyWeightResponse
@@ -7538,18 +7511,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 +7598,7 @@ client.Vitals.BodyWeightGrouped(
-
client.Vitals.BodyFatGrouped(UserId) -> *vitalgo.GroupedBodyFatResponse +
client.Vitals.BodyFatGrouped(UserId) -> *v505.GroupedBodyFatResponse
@@ -7638,18 +7611,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 +7698,7 @@ client.Vitals.BodyFatGrouped(
-
client.Vitals.BloodOxygenGrouped(UserId) -> *vitalgo.GroupedBloodOxygenResponse +
client.Vitals.BloodOxygenGrouped(UserId) -> *v505.GroupedBloodOxygenResponse
@@ -7738,18 +7711,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 +7798,7 @@ client.Vitals.BloodOxygenGrouped(
-
client.Vitals.ElectrocardiogramVoltageGrouped(UserId) -> *vitalgo.GroupedElectrocardiogramVoltageResponse +
client.Vitals.ElectrocardiogramVoltageGrouped(UserId) -> *v505.GroupedElectrocardiogramVoltageResponse
@@ -7838,18 +7811,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 +7898,7 @@ client.Vitals.ElectrocardiogramVoltageGrouped(
-
client.Vitals.BloodPressureGrouped(UserId) -> *vitalgo.GroupedBloodPressureResponse +
client.Vitals.BloodPressureGrouped(UserId) -> *v505.GroupedBloodPressureResponse
@@ -7938,18 +7911,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 +7998,7 @@ client.Vitals.BloodPressureGrouped(
-
client.Vitals.Vo2Max(UserId) -> []*vitalgo.ClientFacingVo2MaxTimeseries +
client.Vitals.Vo2Max(UserId) -> []*v505.ClientFacingVo2MaxTimeseries
@@ -8038,12 +8011,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 +8076,7 @@ client.Vitals.Vo2Max(
-
client.Vitals.StressLevel(UserId) -> []*vitalgo.ClientFacingStressLevelTimeseries +
client.Vitals.StressLevel(UserId) -> []*v505.ClientFacingStressLevelTimeseries
@@ -8116,12 +8089,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 +8154,7 @@ client.Vitals.StressLevel(
-
client.Vitals.MindfulnessMinutes(UserId) -> []*vitalgo.ClientFacingMindfulnessMinutesTimeseries +
client.Vitals.MindfulnessMinutes(UserId) -> []*v505.ClientFacingMindfulnessMinutesTimeseries
@@ -8194,12 +8167,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 +8232,7 @@ client.Vitals.MindfulnessMinutes(
-
client.Vitals.Caffeine(UserId) -> []*vitalgo.ClientFacingCaffeineTimeseries +
client.Vitals.Caffeine(UserId) -> []*v505.ClientFacingCaffeineTimeseries
@@ -8272,12 +8245,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 +8310,7 @@ client.Vitals.Caffeine(
-
client.Vitals.Water(UserId) -> []*vitalgo.ClientFacingWaterTimeseries +
client.Vitals.Water(UserId) -> []*v505.ClientFacingWaterTimeseries
@@ -8350,12 +8323,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 +8388,7 @@ client.Vitals.Water(
-
client.Vitals.Steps(UserId) -> []*vitalgo.ClientFacingStepsTimeseries +
client.Vitals.Steps(UserId) -> []*v505.ClientFacingStepsTimeseries
@@ -8428,12 +8401,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 +8466,7 @@ client.Vitals.Steps(
-
client.Vitals.FloorsClimbed(UserId) -> []*vitalgo.ClientFacingFloorsClimbedTimeseries +
client.Vitals.FloorsClimbed(UserId) -> []*v505.ClientFacingFloorsClimbedTimeseries
@@ -8506,12 +8479,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 +8544,7 @@ client.Vitals.FloorsClimbed(
-
client.Vitals.Distance(UserId) -> []*vitalgo.ClientFacingDistanceTimeseries +
client.Vitals.Distance(UserId) -> []*v505.ClientFacingDistanceTimeseries
@@ -8584,12 +8557,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 +8622,7 @@ client.Vitals.Distance(
-
client.Vitals.CaloriesBasal(UserId) -> []*vitalgo.ClientFacingCaloriesBasalTimeseries +
client.Vitals.CaloriesBasal(UserId) -> []*v505.ClientFacingCaloriesBasalTimeseries
@@ -8662,12 +8635,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 +8700,7 @@ client.Vitals.CaloriesBasal(
-
client.Vitals.CaloriesActive(UserId) -> []*vitalgo.ClientFacingCaloriesActiveTimeseries +
client.Vitals.CaloriesActive(UserId) -> []*v505.ClientFacingCaloriesActiveTimeseries
@@ -8740,12 +8713,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 +8778,7 @@ client.Vitals.CaloriesActive(
-
client.Vitals.RespiratoryRate(UserId) -> []*vitalgo.ClientFacingRespiratoryRateTimeseries +
client.Vitals.RespiratoryRate(UserId) -> []*v505.ClientFacingRespiratoryRateTimeseries
@@ -8818,12 +8791,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 +8856,7 @@ client.Vitals.RespiratoryRate(
-
client.Vitals.Ige(UserId) -> []*vitalgo.ClientFacingIgeTimeseries +
client.Vitals.Ige(UserId) -> []*v505.ClientFacingIgeTimeseries
@@ -8896,12 +8869,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 +8934,7 @@ client.Vitals.Ige(
-
client.Vitals.Igg(UserId) -> []*vitalgo.ClientFacingIggTimeseries +
client.Vitals.Igg(UserId) -> []*v505.ClientFacingIggTimeseries
@@ -8974,12 +8947,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 +9012,7 @@ client.Vitals.Igg(
-
client.Vitals.Hypnogram(UserId) -> []*vitalgo.ClientFacingHypnogramTimeseries +
client.Vitals.Hypnogram(UserId) -> []*v505.ClientFacingHypnogramTimeseries
@@ -9052,12 +9025,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 +9090,7 @@ client.Vitals.Hypnogram(
-
client.Vitals.Hrv(UserId) -> []*vitalgo.ClientFacingHrvTimeseries +
client.Vitals.Hrv(UserId) -> []*v505.ClientFacingHrvTimeseries
@@ -9130,12 +9103,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 +9168,7 @@ client.Vitals.Hrv(
-
client.Vitals.Heartrate(UserId) -> []*vitalgo.ClientFacingHeartRateTimeseries +
client.Vitals.Heartrate(UserId) -> []*v505.ClientFacingHeartRateTimeseries
@@ -9208,12 +9181,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 +9246,7 @@ client.Vitals.Heartrate(
-
client.Vitals.Glucose(UserId) -> []*vitalgo.ClientFacingGlucoseTimeseries +
client.Vitals.Glucose(UserId) -> []*v505.ClientFacingGlucoseTimeseries
@@ -9286,12 +9259,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 +9324,7 @@ client.Vitals.Glucose(
-
client.Vitals.CholesterolTriglycerides(UserId) -> []*vitalgo.ClientFacingCholesterolTimeseries +
client.Vitals.CholesterolTriglycerides(UserId) -> []*v505.ClientFacingCholesterolTimeseries
@@ -9364,12 +9337,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 +9402,7 @@ client.Vitals.CholesterolTriglycerides(
-
client.Vitals.CholesterolTotal(UserId) -> []*vitalgo.ClientFacingCholesterolTimeseries +
client.Vitals.CholesterolTotal(UserId) -> []*v505.ClientFacingCholesterolTimeseries
@@ -9442,12 +9415,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 +9480,7 @@ client.Vitals.CholesterolTotal(
-
client.Vitals.CholesterolLdl(UserId) -> []*vitalgo.ClientFacingCholesterolTimeseries +
client.Vitals.CholesterolLdl(UserId) -> []*v505.ClientFacingCholesterolTimeseries
@@ -9520,12 +9493,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 +9558,7 @@ client.Vitals.CholesterolLdl(
-
client.Vitals.CholesterolHdl(UserId) -> []*vitalgo.ClientFacingCholesterolTimeseries +
client.Vitals.CholesterolHdl(UserId) -> []*v505.ClientFacingCholesterolTimeseries
@@ -9598,12 +9571,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 +9636,7 @@ client.Vitals.CholesterolHdl(
-
client.Vitals.Cholesterol(UserId) -> []*vitalgo.ClientFacingCholesterolTimeseries +
client.Vitals.Cholesterol(UserId) -> []*v505.ClientFacingCholesterolTimeseries
@@ -9676,12 +9649,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 +9714,7 @@ client.Vitals.Cholesterol(
-
client.Vitals.BodyWeight(UserId) -> []*vitalgo.ClientFacingBodyWeightTimeseries +
client.Vitals.BodyWeight(UserId) -> []*v505.ClientFacingBodyWeightTimeseries
@@ -9754,12 +9727,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 +9792,7 @@ client.Vitals.BodyWeight(
-
client.Vitals.BodyFat(UserId) -> []*vitalgo.ClientFacingBodyFatTimeseries +
client.Vitals.BodyFat(UserId) -> []*v505.ClientFacingBodyFatTimeseries
@@ -9832,12 +9805,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 +9870,7 @@ client.Vitals.BodyFat(
-
client.Vitals.BloodOxygen(UserId) -> []*vitalgo.ClientFacingBloodOxygenTimeseries +
client.Vitals.BloodOxygen(UserId) -> []*v505.ClientFacingBloodOxygenTimeseries
@@ -9910,12 +9883,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 +9948,7 @@ client.Vitals.BloodOxygen(
-
client.Vitals.ElectrocardiogramVoltage(UserId) -> []*vitalgo.ClientFacingElectrocardiogramVoltageTimeseries +
client.Vitals.ElectrocardiogramVoltage(UserId) -> []*v505.ClientFacingElectrocardiogramVoltageTimeseries
@@ -9988,12 +9961,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 +10026,7 @@ client.Vitals.ElectrocardiogramVoltage(
-
client.Vitals.BloodPressure(UserId) -> []*vitalgo.ClientFacingBloodPressureTimeseries +
client.Vitals.BloodPressure(UserId) -> []*v505.ClientFacingBloodPressureTimeseries
@@ -10066,12 +10039,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 +10105,7 @@ client.Vitals.BloodPressure(
## User -
client.User.GetAll() -> *vitalgo.PaginatedUsersResponse +
client.User.GetAll() -> *v505.PaginatedUsersResponse
@@ -10159,11 +10132,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 +10179,7 @@ client.User.GetAll(
-
client.User.Create(request) -> *vitalgo.ClientFacingUserKey +
client.User.Create(request) -> *v505.ClientFacingUserKey
@@ -10233,7 +10206,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 +10277,7 @@ client.User.Create(
-
client.User.GetTeamMetrics() -> *vitalgo.MetricsResult +
client.User.GetTeamMetrics() -> *v505.MetricsResult
@@ -10346,7 +10319,7 @@ client.User.GetTeamMetrics(
-
client.User.GetConnectedProviders(UserId) -> map[string][]*vitalgo.ClientFacingProviderWithStatus +
client.User.GetConnectedProviders(UserId) -> map[string][]*v505.ClientFacingProviderWithStatus
@@ -10404,7 +10377,7 @@ client.User.GetConnectedProviders(
-
client.User.GetLatestUserInfo(UserId) -> *vitalgo.UserInfo +
client.User.GetLatestUserInfo(UserId) -> *v505.UserInfo
@@ -10448,7 +10421,7 @@ client.User.GetLatestUserInfo(
-
client.User.CreateInsurance(UserId, request) -> *vitalgo.ClientFacingInsurance +
client.User.CreateInsurance(UserId, request) -> *v505.ClientFacingInsurance
@@ -10461,15 +10434,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 +10506,7 @@ client.User.CreateInsurance(
-**relationship:** `*vitalgo.ResponsibleRelationship` +**relationship:** `*v505.ResponsibleRelationship`
@@ -10541,7 +10514,7 @@ client.User.CreateInsurance(
-**insured:** `*vitalgo.VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails` +**insured:** `*v505.VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails`
@@ -10549,7 +10522,7 @@ client.User.CreateInsurance(
-**guarantor:** `*vitalgo.GuarantorDetails` +**guarantor:** `*v505.GuarantorDetails`
@@ -10569,7 +10542,7 @@ client.User.CreateInsurance(
-
client.User.GetLatestInsurance(UserId) -> *vitalgo.ClientFacingInsurance +
client.User.GetLatestInsurance(UserId) -> *v505.ClientFacingInsurance
@@ -10582,8 +10555,8 @@ client.User.CreateInsurance(
```go -request := &vitalgo.UserGetLatestInsuranceRequest{ - IsPrimary: vitalgo.Bool( +request := &v505.UserGetLatestInsuranceRequest{ + IsPrimary: v505.Bool( true, ), } @@ -10627,7 +10600,7 @@ client.User.GetLatestInsurance(
-
client.User.UpsertUserInfo(UserId, request) -> *vitalgo.UserInfo +
client.User.UpsertUserInfo(UserId, request) -> *v505.UserInfo
@@ -10640,14 +10613,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.Address{ FirstLine: "first_line", Country: "country", Zip: "zip", @@ -10731,7 +10704,7 @@ client.User.UpsertUserInfo(
-**address:** `*vitalgo.Address` +**address:** `*v505.Address`
@@ -10739,7 +10712,7 @@ client.User.UpsertUserInfo(
-**medicalProxy:** `*vitalgo.GuarantorDetails` +**medicalProxy:** `*v505.GuarantorDetails`
@@ -10747,7 +10720,7 @@ client.User.UpsertUserInfo(
-**race:** `*vitalgo.Race` +**race:** `*v505.Race`
@@ -10755,7 +10728,7 @@ client.User.UpsertUserInfo(
-**ethnicity:** `*vitalgo.Ethnicity` +**ethnicity:** `*v505.Ethnicity`
@@ -10763,7 +10736,7 @@ client.User.UpsertUserInfo(
-**sexualOrientation:** `*vitalgo.SexualOrientation` +**sexualOrientation:** `*v505.SexualOrientation`
@@ -10771,7 +10744,7 @@ client.User.UpsertUserInfo(
-**genderIdentity:** `*vitalgo.GenderIdentity` +**genderIdentity:** `*v505.GenderIdentity`
@@ -10783,7 +10756,7 @@ client.User.UpsertUserInfo(
-
client.User.GetByClientUserId(ClientUserId) -> *vitalgo.ClientFacingUser +
client.User.GetByClientUserId(ClientUserId) -> *v505.ClientFacingUser
@@ -10841,7 +10814,7 @@ client.User.GetByClientUserId(
-
client.User.DeregisterProvider(UserId, Provider) -> *vitalgo.UserSuccessResponse +
client.User.DeregisterProvider(UserId, Provider) -> *v505.UserSuccessResponse
@@ -10857,7 +10830,7 @@ client.User.GetByClientUserId( client.User.DeregisterProvider( context.TODO(), "user_id", - vitalgo.ProvidersOura.Ptr(), + v505.ProvidersOura.Ptr(), ) } ``` @@ -10882,7 +10855,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 +10867,7 @@ client.User.DeregisterProvider(
-
client.User.Get(UserId) -> *vitalgo.ClientFacingUser +
client.User.Get(UserId) -> *v505.ClientFacingUser
@@ -10938,7 +10911,7 @@ client.User.Get(
-
client.User.Delete(UserId) -> *vitalgo.UserSuccessResponse +
client.User.Delete(UserId) -> *v505.UserSuccessResponse
@@ -10995,7 +10968,7 @@ client.User.Delete(
```go -request := &vitalgo.UserPatchBody{} +request := &v505.UserPatchBody{} client.User.Patch( context.TODO(), "user_id", @@ -11073,7 +11046,7 @@ client.User.Patch(
-
client.User.UndoDelete() -> *vitalgo.UserSuccessResponse +
client.User.UndoDelete() -> *v505.UserSuccessResponse
@@ -11086,11 +11059,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 +11106,7 @@ client.User.UndoDelete(
-
client.User.Refresh(UserId) -> *vitalgo.UserRefreshSuccessResponse +
client.User.Refresh(UserId) -> *v505.UserRefreshSuccessResponse
@@ -11160,8 +11133,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 +11178,7 @@ client.User.Refresh(
-
client.User.GetDevices(UserId) -> []*vitalgo.ClientFacingDevice +
client.User.GetDevices(UserId) -> []*v505.ClientFacingDevice
@@ -11249,7 +11222,7 @@ client.User.GetDevices(
-
client.User.GetDevice(UserId, DeviceId) -> *vitalgo.ClientFacingDevice +
client.User.GetDevice(UserId, DeviceId) -> *v505.ClientFacingDevice
@@ -11302,7 +11275,7 @@ client.User.GetDevice(
-
client.User.GetUserSignInToken(UserId) -> *vitalgo.UserSignInTokenResponse +
client.User.GetUserSignInToken(UserId) -> *v505.UserSignInTokenResponse
@@ -11346,7 +11319,7 @@ client.User.GetUserSignInToken(
-
client.User.CreatePortalUrl(UserId, request) -> *vitalgo.CreateUserPortalUrlResponse +
client.User.CreatePortalUrl(UserId, request) -> *v505.CreateUserPortalUrlResponse
@@ -11359,8 +11332,8 @@ client.User.GetUserSignInToken(
```go -request := &vitalgo.CreateUserPortalUrlBody{ - Context: vitalgo.CreateUserPortalUrlBodyContextLaunch, +request := &v505.CreateUserPortalUrlBody{ + Context: v505.CreateUserPortalUrlBodyContextLaunch, } client.User.CreatePortalUrl( context.TODO(), @@ -11390,7 +11363,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 +11419,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 +11451,7 @@ client.Team.GetLinkConfig(
-
client.Team.Get(TeamId) -> *vitalgo.ClientFacingTeam +
client.Team.Get(TeamId) -> *v505.ClientFacingTeam
@@ -11540,7 +11509,7 @@ client.Team.Get(
-
client.Team.GetUserById() -> []*vitalgo.ClientFacingUser +
client.Team.GetUserById() -> []*v505.ClientFacingUser
@@ -11567,8 +11536,8 @@ Search team users by user_id
```go -request := &vitalgo.TeamGetUserByIdRequest{ - QueryId: vitalgo.String( +request := &v505.TeamGetUserByIdRequest{ + QueryId: v505.String( "query_id", ), } @@ -11658,8 +11627,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 +11649,7 @@ client.Team.GetSourcePriorities(
-**dataType:** `*vitalgo.PriorityResource` +**dataType:** `*v505.PriorityResource`
@@ -11734,7 +11703,7 @@ client.Team.UpdateSourcePriorities(
-
client.Team.GetPhysicians(TeamId) -> []*vitalgo.ClientFacingPhysician +
client.Team.GetPhysicians(TeamId) -> []*v505.ClientFacingPhysician
@@ -11779,7 +11748,7 @@ client.Team.GetPhysicians(
## Providers -
client.Providers.GetAll() -> []*vitalgo.ClientFacingProviderDetailed +
client.Providers.GetAll() -> []*v505.ClientFacingProviderDetailed
@@ -11806,8 +11775,8 @@ Get Provider list
```go -request := &vitalgo.ProvidersGetAllRequest{ - SourceType: vitalgo.String( +request := &v505.ProvidersGetAllRequest{ + SourceType: v505.String( "source_type", ), } @@ -11843,7 +11812,7 @@ client.Providers.GetAll(
## Introspect -
client.Introspect.GetUserResources() -> *vitalgo.UserResourcesResponse +
client.Introspect.GetUserResources() -> *v505.UserResourcesResponse
@@ -11856,18 +11825,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 +11867,7 @@ client.Introspect.GetUserResources(
-**provider:** `*vitalgo.Providers` +**provider:** `*v505.Providers`
@@ -11934,7 +11903,7 @@ client.Introspect.GetUserResources(
-
client.Introspect.GetUserHistoricalPulls() -> *vitalgo.UserHistoricalPullsResponse +
client.Introspect.GetUserHistoricalPulls() -> *v505.UserHistoricalPullsResponse
@@ -11947,18 +11916,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 +11958,7 @@ client.Introspect.GetUserHistoricalPulls(
-**provider:** `*vitalgo.Providers` +**provider:** `*v505.Providers`
@@ -12026,7 +11995,7 @@ client.Introspect.GetUserHistoricalPulls(
## LabTests -
client.LabTests.Get() -> []*vitalgo.ClientFacingLabTest +
client.LabTests.Get() -> []*v505.ClientFacingLabTest
@@ -12053,18 +12022,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 +12054,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 +12070,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 +12078,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 +12110,7 @@ client.LabTests.Get(
-**orderKey:** `*vitalgo.LabTestsGetRequestOrderKey` +**orderKey:** `*v505.LabTestsGetRequestOrderKey`
@@ -12149,7 +12118,7 @@ client.LabTests.Get(
-**orderDirection:** `*vitalgo.LabTestsGetRequestOrderDirection` +**orderDirection:** `*v505.LabTestsGetRequestOrderDirection`
@@ -12161,7 +12130,7 @@ client.LabTests.Get(
-
client.LabTests.Create(request) -> *vitalgo.ClientFacingLabTest +
client.LabTests.Create(request) -> *v505.ClientFacingLabTest
@@ -12174,9 +12143,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 +12191,7 @@ client.LabTests.Create(
-**method:** `*vitalgo.LabTestCollectionMethod` +**method:** `*v505.LabTestCollectionMethod`
@@ -12240,6 +12209,14 @@ client.LabTests.Create( **fasting:** `*bool` +
+
+ +
+
+ +**labAccountId:** `*string` +
@@ -12250,7 +12227,7 @@ client.LabTests.Create(
-
client.LabTests.GetById(LabTestId) -> *vitalgo.ClientFacingLabTest +
client.LabTests.GetById(LabTestId) -> *v505.ClientFacingLabTest
@@ -12277,8 +12254,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 +12299,7 @@ client.LabTests.GetById(
-
client.LabTests.UpdateLabTest(LabTestId, request) -> *vitalgo.ClientFacingLabTest +
client.LabTests.UpdateLabTest(LabTestId, request) -> *v505.ClientFacingLabTest
@@ -12335,7 +12312,7 @@ client.LabTests.GetById(
```go -request := &vitalgo.UpdateLabTestRequest{} +request := &v505.UpdateLabTestRequest{} client.LabTests.UpdateLabTest( context.TODO(), "lab_test_id", @@ -12384,7 +12361,7 @@ client.LabTests.UpdateLabTest(
-
client.LabTests.GetMarkers() -> *vitalgo.GetMarkersResponse +
client.LabTests.GetMarkers() -> *v505.GetMarkersResponse
@@ -12411,20 +12388,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 +12435,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 +12487,7 @@ client.LabTests.GetMarkers(
-
client.LabTests.GetMarkersForOrderSet(request) -> *vitalgo.GetMarkersResponse +
client.LabTests.GetMarkersForOrderSet(request) -> *v505.GetMarkersResponse
@@ -12512,14 +12500,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 +12544,7 @@ client.LabTests.GetMarkersForOrderSet(
-**request:** `*vitalgo.OrderSetRequest` +**request:** `*v505.OrderSetRequest`
@@ -12568,7 +12556,7 @@ client.LabTests.GetMarkersForOrderSet(
-
client.LabTests.GetMarkersForLabTest(LabTestId) -> *vitalgo.GetMarkersResponse +
client.LabTests.GetMarkersForLabTest(LabTestId) -> *v505.GetMarkersResponse
@@ -12581,14 +12569,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 +12636,7 @@ client.LabTests.GetMarkersForLabTest(
-
client.LabTests.GetMarkersByLabAndProviderId(ProviderId, LabId) -> *vitalgo.ClientFacingMarker +
client.LabTests.GetMarkersByLabAndProviderId(ProviderId, LabId) -> *v505.ClientFacingMarker
@@ -12675,8 +12663,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 +12717,7 @@ client.LabTests.GetMarkersByLabAndProviderId(
-
client.LabTests.GetLabs() -> []*vitalgo.ClientFacingLab +
client.LabTests.GetLabs() -> []*v505.ClientFacingLab
@@ -12771,7 +12759,7 @@ client.LabTests.GetLabs(
-
client.LabTests.GetPaginated() -> *vitalgo.LabTestResourcesResponse +
client.LabTests.GetPaginated() -> *v505.LabTestResourcesResponse
@@ -12798,24 +12786,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 +12840,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 +12856,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 +12864,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 +12896,7 @@ client.LabTests.GetPaginated(
-**orderKey:** `*vitalgo.LabTestsGetPaginatedRequestOrderKey` +**orderKey:** `*v505.LabTestsGetPaginatedRequestOrderKey`
@@ -12916,7 +12904,7 @@ client.LabTests.GetPaginated(
-**orderDirection:** `*vitalgo.LabTestsGetPaginatedRequestOrderDirection` +**orderDirection:** `*v505.LabTestsGetPaginatedRequestOrderDirection`
@@ -12972,7 +12960,7 @@ client.LabTests.GetLabTestCollectionInstructionPdf(
-
client.LabTests.GetOrders() -> *vitalgo.GetOrdersResponse +
client.LabTests.GetOrders() -> *v505.GetOrdersResponse
@@ -12999,49 +12987,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 +13095,7 @@ client.LabTests.GetOrders(
-**status:** `*vitalgo.OrderLowLevelStatus` — Filter by low level status. +**status:** `*v505.OrderLowLevelStatus` — Filter by low level status.
@@ -13112,7 +13103,7 @@ client.LabTests.GetOrders(
-**orderKey:** `*vitalgo.LabTestsGetOrdersRequestOrderKey` — Order key to sort by. +**orderKey:** `*v505.LabTestsGetOrdersRequestOrderKey` — Order key to sort by.
@@ -13120,7 +13111,7 @@ client.LabTests.GetOrders(
-**orderDirection:** `*vitalgo.LabTestsGetOrdersRequestOrderDirection` — Order direction to sort by. +**orderDirection:** `*v505.LabTestsGetOrdersRequestOrderDirection` — Order direction to sort by.
@@ -13128,7 +13119,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 +13135,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 +13143,7 @@ client.LabTests.GetOrders(
-**orderActivationTypes:** `*vitalgo.OrderActivationType` — Filter by activation type. +**orderActivationTypes:** `*v505.OrderActivationType` — Filter by activation type.
@@ -13192,6 +13183,14 @@ client.LabTests.GetOrders(
+**orderTransactionId:** `*string` — Filter by order transaction ID + +
+
+ +
+
+ **page:** `*int`
@@ -13212,7 +13211,7 @@ client.LabTests.GetOrders(
-
client.LabTests.GetPhlebotomyAppointmentAvailability(request) -> *vitalgo.AppointmentAvailabilitySlots +
client.LabTests.GetPhlebotomyAppointmentAvailability(request) -> *v505.AppointmentAvailabilitySlots
@@ -13240,11 +13239,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 +13277,7 @@ client.LabTests.GetPhlebotomyAppointmentAvailability(
-**request:** `*vitalgo.UsAddress` — At-home phlebotomy appointment address. +**request:** `*v505.UsAddress` — At-home phlebotomy appointment address.
@@ -13290,7 +13289,7 @@ client.LabTests.GetPhlebotomyAppointmentAvailability(
-
client.LabTests.BookPhlebotomyAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.BookPhlebotomyAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -13317,7 +13316,7 @@ Book an at-home phlebotomy appointment.
```go -request := &vitalgo.AppointmentBookingRequest{ +request := &v505.AppointmentBookingRequest{ BookingKey: "booking_key", } client.LabTests.BookPhlebotomyAppointment( @@ -13348,7 +13347,7 @@ client.LabTests.BookPhlebotomyAppointment(
-**request:** `*vitalgo.AppointmentBookingRequest` +**request:** `*v505.AppointmentBookingRequest`
@@ -13360,7 +13359,7 @@ client.LabTests.BookPhlebotomyAppointment(
-
client.LabTests.RequestPhlebotomyAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.RequestPhlebotomyAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -13387,14 +13386,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 +13423,7 @@ client.LabTests.RequestPhlebotomyAppointment(
-**address:** `*vitalgo.UsAddress` — At-home phlebotomy appointment address. +**address:** `*v505.UsAddress` — At-home phlebotomy appointment address.
@@ -13432,7 +13431,7 @@ client.LabTests.RequestPhlebotomyAppointment(
-**provider:** `*vitalgo.AppointmentProvider` +**provider:** `*v505.AppointmentProvider`
@@ -13444,7 +13443,7 @@ client.LabTests.RequestPhlebotomyAppointment(
-
client.LabTests.ReschedulePhlebotomyAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.ReschedulePhlebotomyAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -13471,7 +13470,7 @@ Reschedule a previously booked at-home phlebotomy appointment.
```go -request := &vitalgo.AppointmentRescheduleRequest{ +request := &v505.AppointmentRescheduleRequest{ BookingKey: "booking_key", } client.LabTests.ReschedulePhlebotomyAppointment( @@ -13502,7 +13501,7 @@ client.LabTests.ReschedulePhlebotomyAppointment(
-**request:** `*vitalgo.AppointmentRescheduleRequest` +**request:** `*v505.AppointmentRescheduleRequest`
@@ -13514,7 +13513,7 @@ client.LabTests.ReschedulePhlebotomyAppointment(
-
client.LabTests.CancelPhlebotomyAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.CancelPhlebotomyAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -13541,7 +13540,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 +13591,7 @@ client.LabTests.CancelPhlebotomyAppointment(
-
client.LabTests.GetPhlebotomyAppointmentCancellationReason() -> []*vitalgo.ClientFacingAppointmentCancellationReason +
client.LabTests.GetPhlebotomyAppointmentCancellationReason() -> []*v505.ClientFacingAppointmentCancellationReason
@@ -13634,7 +13633,7 @@ client.LabTests.GetPhlebotomyAppointmentCancellationReason(
-
client.LabTests.GetPhlebotomyAppointment(OrderId) -> *vitalgo.ClientFacingAppointment +
client.LabTests.GetPhlebotomyAppointment(OrderId) -> *v505.ClientFacingAppointment
@@ -13692,7 +13691,7 @@ client.LabTests.GetPhlebotomyAppointment(
-
client.LabTests.GetAreaInfo() -> *vitalgo.AreaInfo +
client.LabTests.GetAreaInfo() -> *v505.AreaInfo
@@ -13723,11 +13722,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 +13757,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 +13765,7 @@ client.LabTests.GetAreaInfo(
-**lab:** `*vitalgo.ClientFacingLabs` — Lab to check for PSCs +**lab:** `*v505.ClientFacingLabs` — Lab to check for PSCs
@@ -13774,7 +13773,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 +13793,7 @@ client.LabTests.GetAreaInfo(
-
client.LabTests.GetPscInfo() -> *vitalgo.PscInfo +
client.LabTests.GetPscInfo() -> *v505.PscInfo
@@ -13807,11 +13806,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 +13849,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 +13857,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 +13877,7 @@ client.LabTests.GetPscInfo(
-
client.LabTests.GetOrderPscInfo(OrderId) -> *vitalgo.PscInfo +
client.LabTests.GetOrderPscInfo(OrderId) -> *v505.PscInfo
@@ -13891,8 +13890,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 +13921,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 +13929,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 +13999,7 @@ client.LabTests.GetResultPdf(
-
client.LabTests.GetResultMetadata(OrderId) -> *vitalgo.LabResultsMetadata +
client.LabTests.GetResultMetadata(OrderId) -> *v505.LabResultsMetadata
@@ -14059,7 +14058,7 @@ client.LabTests.GetResultMetadata(
-
client.LabTests.GetResultRaw(OrderId) -> *vitalgo.LabResultsRaw +
client.LabTests.GetResultRaw(OrderId) -> *v505.LabResultsRaw
@@ -14144,8 +14143,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 +14196,7 @@ client.LabTests.GetLabelsPdf(
-
client.LabTests.GetPscAppointmentAvailability() -> *vitalgo.AppointmentAvailabilitySlots +
client.LabTests.GetPscAppointmentAvailability() -> *v505.AppointmentAvailabilitySlots
@@ -14210,17 +14209,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 +14241,7 @@ client.LabTests.GetPscAppointmentAvailability(
-**lab:** `vitalgo.AppointmentPscLabs` — Lab to check for availability +**lab:** `*v505.AppointmentPscLabs` — Lab to check for availability
@@ -14273,7 +14273,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 +14293,7 @@ client.LabTests.GetPscAppointmentAvailability(
-
client.LabTests.BookPscAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.BookPscAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -14298,8 +14306,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 +14339,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 +14367,7 @@ client.LabTests.BookPscAppointment(
-
client.LabTests.ReschedulePscAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.ReschedulePscAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -14354,7 +14380,7 @@ client.LabTests.BookPscAppointment(
```go -request := &vitalgo.AppointmentRescheduleRequest{ +request := &v505.AppointmentRescheduleRequest{ BookingKey: "booking_key", } client.LabTests.ReschedulePscAppointment( @@ -14385,7 +14411,7 @@ client.LabTests.ReschedulePscAppointment(
-**request:** `*vitalgo.AppointmentRescheduleRequest` +**request:** `*v505.AppointmentRescheduleRequest`
@@ -14397,7 +14423,7 @@ client.LabTests.ReschedulePscAppointment(
-
client.LabTests.CancelPscAppointment(OrderId, request) -> *vitalgo.ClientFacingAppointment +
client.LabTests.CancelPscAppointment(OrderId, request) -> *v505.ClientFacingAppointment
@@ -14410,7 +14436,7 @@ client.LabTests.ReschedulePscAppointment(
```go -request := &vitalgo.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest{ +request := &v505.VitalCoreClientsLabTestGetlabsSchemaAppointmentCancelRequest{ CancellationReasonId: "cancellationReasonId", } client.LabTests.CancelPscAppointment( @@ -14461,7 +14487,7 @@ client.LabTests.CancelPscAppointment(
-
client.LabTests.GetPscAppointmentCancellationReason() -> []*vitalgo.ClientFacingAppointmentCancellationReason +
client.LabTests.GetPscAppointmentCancellationReason() -> []*v505.ClientFacingAppointmentCancellationReason
@@ -14489,7 +14515,7 @@ client.LabTests.GetPscAppointmentCancellationReason(
-
client.LabTests.GetPscAppointment(OrderId) -> *vitalgo.ClientFacingAppointment +
client.LabTests.GetPscAppointment(OrderId) -> *v505.ClientFacingAppointment
@@ -14721,7 +14747,7 @@ client.LabTests.GetOrderAbnPdf(
-
client.LabTests.GetOrder(OrderId) -> *vitalgo.ClientFacingOrder +
client.LabTests.GetOrder(OrderId) -> *v505.ClientFacingOrder
@@ -14779,7 +14805,7 @@ client.LabTests.GetOrder(
-
client.LabTests.CreateOrder(request) -> *vitalgo.PostOrderResponse +
client.LabTests.CreateOrder(request) -> *v505.PostOrderResponse
@@ -14792,20 +14818,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 +14887,7 @@ client.LabTests.CreateOrder(
-**orderSet:** `*vitalgo.OrderSetRequest` +**orderSet:** `*v505.OrderSetRequest`
@@ -14872,7 +14895,7 @@ client.LabTests.CreateOrder(
-**collectionMethod:** `*vitalgo.LabTestCollectionMethod` +**collectionMethod:** `*v505.LabTestCollectionMethod`
@@ -14880,7 +14903,7 @@ client.LabTests.CreateOrder(
-**physician:** `*vitalgo.PhysicianCreateRequest` +**physician:** `*v505.PhysicianCreateRequest`
@@ -14888,7 +14911,7 @@ client.LabTests.CreateOrder(
-**healthInsurance:** `*vitalgo.HealthInsuranceCreateRequest` +**healthInsurance:** `*v505.HealthInsuranceCreateRequest`
@@ -14904,7 +14927,7 @@ client.LabTests.CreateOrder(
-**billingType:** `*vitalgo.Billing` +**billingType:** `*v505.Billing`
@@ -14920,7 +14943,7 @@ client.LabTests.CreateOrder(
-**consents:** `[]*vitalgo.Consent` +**consents:** `[]*v505.Consent`
@@ -14936,7 +14959,7 @@ client.LabTests.CreateOrder(
-**aoeAnswers:** `[]*vitalgo.AoEAnswer` +**aoeAnswers:** `[]*v505.AoEAnswer`
@@ -14968,7 +14991,7 @@ client.LabTests.CreateOrder(
-**patientDetails:** `*vitalgo.PatientDetailsWithValidation` +**patientDetails:** `*v505.PatientDetailsWithValidation`
@@ -14976,7 +14999,7 @@ client.LabTests.CreateOrder(
-**patientAddress:** `*vitalgo.PatientAddressWithValidation` +**patientAddress:** `*v505.PatientAddressWithValidation`
@@ -14988,7 +15011,7 @@ client.LabTests.CreateOrder(
-
client.LabTests.ImportOrder(request) -> *vitalgo.PostOrderResponse +
client.LabTests.ImportOrder(request) -> *v505.PostOrderResponse
@@ -15001,20 +15024,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 +15074,7 @@ client.LabTests.ImportOrder(
-**billingType:** `*vitalgo.Billing` +**billingType:** `*v505.Billing`
@@ -15059,7 +15082,7 @@ client.LabTests.ImportOrder(
-**orderSet:** `*vitalgo.OrderSetRequest` +**orderSet:** `*v505.OrderSetRequest`
@@ -15067,7 +15090,7 @@ client.LabTests.ImportOrder(
-**collectionMethod:** `*vitalgo.LabTestCollectionMethod` +**collectionMethod:** `*v505.LabTestCollectionMethod`
@@ -15075,7 +15098,7 @@ client.LabTests.ImportOrder(
-**physician:** `*vitalgo.PhysicianCreateRequest` +**physician:** `*v505.PhysicianCreateRequest`
@@ -15083,7 +15106,7 @@ client.LabTests.ImportOrder(
-**patientDetails:** `*vitalgo.PatientDetailsWithValidation` +**patientDetails:** `*v505.PatientDetailsWithValidation`
@@ -15091,7 +15114,7 @@ client.LabTests.ImportOrder(
-**patientAddress:** `*vitalgo.PatientAddress` +**patientAddress:** `*v505.PatientAddress`
@@ -15119,7 +15142,7 @@ client.LabTests.ImportOrder(
-
client.LabTests.CancelOrder(OrderId) -> *vitalgo.PostOrderResponse +
client.LabTests.CancelOrder(OrderId) -> *v505.PostOrderResponse
@@ -15204,12 +15227,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 +15262,7 @@ client.LabTests.SimulateOrderProcess(
-**finalStatus:** `*vitalgo.OrderStatus` +**finalStatus:** `*v505.OrderStatus`
@@ -15255,7 +15278,7 @@ client.LabTests.SimulateOrderProcess(
-**request:** `*vitalgo.SimulationFlags` +**request:** `*v505.SimulationFlags`
@@ -15267,7 +15290,7 @@ client.LabTests.SimulateOrderProcess(
-
client.LabTests.UpdateOnSiteCollectionOrderDrawCompleted(OrderId) -> *vitalgo.PostOrderResponse +
client.LabTests.UpdateOnSiteCollectionOrderDrawCompleted(OrderId) -> *v505.PostOrderResponse
@@ -15325,7 +15348,7 @@ client.LabTests.UpdateOnSiteCollectionOrderDrawCompleted(
-
client.LabTests.ValidateIcdCodes(request) -> *vitalgo.ValidateIcdCodesResponse +
client.LabTests.ValidateIcdCodes(request) -> *v505.ValidateIcdCodesResponse
@@ -15338,7 +15361,7 @@ client.LabTests.UpdateOnSiteCollectionOrderDrawCompleted(
```go -request := &vitalgo.ValidateIcdCodesBody{ +request := &v505.ValidateIcdCodesBody{ Codes: []string{ "codes", }, @@ -15370,12 +15393,381 @@ 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` + +
+
+ +
+
+ +**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 +15780,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 +15833,7 @@ client.Testkit.Register(
-**patientDetails:** `*vitalgo.PatientDetailsWithValidation` +**patientDetails:** `*v505.PatientDetailsWithValidation`
@@ -15449,7 +15841,7 @@ client.Testkit.Register(
-**patientAddress:** `*vitalgo.PatientAddressWithValidation` +**patientAddress:** `*v505.PatientAddressWithValidation`
@@ -15457,7 +15849,7 @@ client.Testkit.Register(
-**physician:** `*vitalgo.PhysicianCreateRequestBase` +**physician:** `*v505.PhysicianCreateRequestBase`
@@ -15465,7 +15857,7 @@ client.Testkit.Register(
-**healthInsurance:** `*vitalgo.HealthInsuranceCreateRequest` +**healthInsurance:** `*v505.HealthInsuranceCreateRequest`
@@ -15473,7 +15865,7 @@ client.Testkit.Register(
-**consents:** `[]*vitalgo.Consent` +**consents:** `[]*v505.Consent`
@@ -15485,7 +15877,7 @@ client.Testkit.Register(
-
client.Testkit.CreateOrder(request) -> *vitalgo.PostOrderResponse +
client.Testkit.CreateOrder(request) -> *v505.PostOrderResponse
@@ -15512,10 +15904,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 +15952,7 @@ client.Testkit.CreateOrder(
-**shippingDetails:** `*vitalgo.ShippingAddressWithValidation` +**shippingDetails:** `*v505.ShippingAddressWithValidation`
@@ -15589,7 +15981,7 @@ client.Testkit.CreateOrder(
## Order -
client.Order.ResendEvents(request) -> *vitalgo.ResendWebhookResponse +
client.Order.ResendEvents(request) -> *v505.ResendWebhookResponse
@@ -15616,7 +16008,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 +16057,7 @@ client.Order.ResendEvents(
## Insurance -
client.Insurance.SearchGetPayorInfo() -> []*vitalgo.ClientFacingPayorSearchResponse +
client.Insurance.SearchGetPayorInfo() -> []*v505.ClientFacingPayorSearchResponse
@@ -15678,12 +16070,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 +16106,7 @@ client.Insurance.SearchGetPayorInfo(
-**provider:** `*vitalgo.PayorCodeExternalProvider` +**provider:** `*v505.PayorCodeExternalProvider`
@@ -15734,7 +16126,7 @@ client.Insurance.SearchGetPayorInfo(
-
client.Insurance.SearchPayorInfo(request) -> []*vitalgo.ClientFacingPayorSearchResponseDeprecated +
client.Insurance.SearchPayorInfo(request) -> []*v505.ClientFacingPayorSearchResponseDeprecated
@@ -15747,7 +16139,7 @@ client.Insurance.SearchGetPayorInfo(
```go -request := &vitalgo.PayorSearchRequest{} +request := &v505.PayorSearchRequest{} client.Insurance.SearchPayorInfo( context.TODO(), request, @@ -15775,7 +16167,7 @@ client.Insurance.SearchPayorInfo(
-**provider:** `*vitalgo.PayorCodeExternalProvider` +**provider:** `*v505.PayorCodeExternalProvider`
@@ -15795,7 +16187,7 @@ client.Insurance.SearchPayorInfo(
-
client.Insurance.SearchDiagnosis() -> []*vitalgo.ClientFacingDiagnosisInformation +
client.Insurance.SearchDiagnosis() -> []*v505.ClientFacingDiagnosisInformation
@@ -15808,7 +16200,7 @@ client.Insurance.SearchPayorInfo(
```go -request := &vitalgo.InsuranceSearchDiagnosisRequest{ +request := &v505.InsuranceSearchDiagnosisRequest{ DiagnosisQuery: "diagnosis_query", } client.Insurance.SearchDiagnosis( @@ -15843,7 +16235,7 @@ client.Insurance.SearchDiagnosis(
## Payor -
client.Payor.CreatePayor(request) -> *vitalgo.ClientFacingPayor +
client.Payor.CreatePayor(request) -> *v505.ClientFacingPayor
@@ -15856,9 +16248,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 +16285,7 @@ client.Payor.CreatePayor(
-**address:** `*vitalgo.Address` +**address:** `*v505.Address`
@@ -15901,7 +16293,7 @@ client.Payor.CreatePayor(
-**provider:** `*vitalgo.PayorCodeExternalProvider` +**provider:** `*v505.PayorCodeExternalProvider`
@@ -15922,7 +16314,7 @@ client.Payor.CreatePayor(
## LabReport -
client.LabReport.ParserCreateJob(request) -> *vitalgo.ParsingJob +
client.LabReport.ParserCreateJob(request) -> *v505.ParsingJob
@@ -15934,7 +16326,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 +16342,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 +16361,7 @@ client.LabReport.ParserCreateJob(
-
client.LabReport.ParserGetJob(JobId) -> *vitalgo.ParsingJob +
client.LabReport.ParserGetJob(JobId) -> *v505.ParsingJob
@@ -16031,7 +16423,7 @@ client.LabReport.ParserGetJob(
## Aggregate -
client.Aggregate.QueryOne(UserId, request) -> *vitalgo.AggregationResponse +
client.Aggregate.QueryOne(UserId, request) -> *v505.AggregationResponse
@@ -16044,26 +16436,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 +16498,7 @@ client.Aggregate.QueryOne(
-**timeframe:** `*vitalgo.QueryBatchTimeframe` +**timeframe:** `*v505.QueryBatchTimeframe`
@@ -16114,7 +16506,7 @@ client.Aggregate.QueryOne(
-**queries:** `[]*vitalgo.Query` +**queries:** `[]*v505.Query`
@@ -16122,7 +16514,7 @@ client.Aggregate.QueryOne(
-**config:** `*vitalgo.QueryConfig` +**config:** `*v505.QueryConfig`
@@ -16134,7 +16526,7 @@ client.Aggregate.QueryOne(
-
client.Aggregate.GetResultTableForContinuousQuery(UserId, QueryIdOrSlug) -> *vitalgo.AggregationResult +
client.Aggregate.GetResultTableForContinuousQuery(UserId, QueryIdOrSlug) -> *v505.AggregationResult
@@ -16195,7 +16587,7 @@ client.Aggregate.GetResultTableForContinuousQuery(
-
client.Aggregate.GetTaskHistoryForContinuousQuery(UserId, QueryIdOrSlug) -> *vitalgo.ContinuousQueryTaskHistoryResponse +
client.Aggregate.GetTaskHistoryForContinuousQuery(UserId, QueryIdOrSlug) -> *v505.ContinuousQueryTaskHistoryResponse
@@ -16208,11 +16600,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/client.go b/sleep/client.go index 60fbd29..f882d5c 100644 --- a/sleep/client.go +++ b/sleep/client.go @@ -4,7 +4,7 @@ package sleep import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..e6f973c 100644 --- a/sleep/raw_client.go +++ b/sleep/raw_client.go @@ -4,7 +4,7 @@ package sleep import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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/sleepcycle/client.go b/sleepcycle/client.go index 8899d76..1a01a80 100644 --- a/sleepcycle/client.go +++ b/sleepcycle/client.go @@ -4,7 +4,7 @@ package sleepcycle import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..a05c1d5 100644 --- a/sleepcycle/raw_client.go +++ b/sleepcycle/raw_client.go @@ -4,7 +4,7 @@ package sleepcycle import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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/client.go b/team/client.go index 558e9e8..f42d41a 100644 --- a/team/client.go +++ b/team/client.go @@ -4,7 +4,7 @@ package team import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..0af2f01 100644 --- a/team/raw_client.go +++ b/team/raw_client.go @@ -4,7 +4,7 @@ package team import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..c60aab4 100644 --- a/testkit.go +++ b/testkit.go @@ -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..90459d1 100644 --- a/testkit/client.go +++ b/testkit/client.go @@ -4,7 +4,7 @@ package testkit import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..b564e80 100644 --- a/testkit/raw_client.go +++ b/testkit/raw_client.go @@ -4,7 +4,7 @@ package testkit import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..c9792f5 100644 --- a/types.go +++ b/types.go @@ -385,6 +385,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 +12648,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 *ClientFacingLabReportParsingJobCreatedEvent) GetExtraProperties() map[string]interface{} { + return c.extraProperties } -func (c *ClientFacingLabTest) GetIsActive() bool { - if c == nil { - return false +func (c *ClientFacingLabReportParsingJobCreatedEvent) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) } - return c.IsActive + c.explicitFields.Or(c.explicitFields, field) } -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{} { - return c.extraProperties -} - -func (c *ClientFacingLabTest) 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 +12764,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 +12790,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 +12906,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 +12931,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 +13107,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 +13233,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 +13244,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 +13257,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 +13278,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 +13326,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 +13375,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 +13386,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 +13398,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 +13441,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 +13486,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 +13523,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 +13537,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 +13563,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 +13602,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 +13825,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 +13836,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 +13848,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 +13967,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 +13990,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 +14129,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 +14154,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 +14273,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 +14296,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 +14435,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 +14460,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 +14579,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 +14602,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 +14741,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 +14767,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 +14788,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 +14885,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 +14896,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 +14908,246 @@ func (c *ClientFacingOnSiteCollectionOrderDetails) String() string { 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) - 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) +type ClientFacingNoteChangedEventType string + +const ( + ClientFacingNoteChangedEventTypeDailyDataNoteCreated ClientFacingNoteChangedEventType = "daily.data.note.created" + ClientFacingNoteChangedEventTypeDailyDataNoteUpdated ClientFacingNoteChangedEventType = "daily.data.note.updated" ) -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"` +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) +) + +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 + *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") + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil } -func (c *ClientFacingOrder) GetPhysician() *ClientFacingPhysician { - 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.Physician + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) } -func (c *ClientFacingOrder) GetHealthInsuranceId() *string { - 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.HealthInsuranceId + if value, err := internal.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) } -func (c *ClientFacingOrder) GetRequisitionFormUrl() *string { - if c == nil { - return nil - } - return c.RequisitionFormUrl +// 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 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) GetPriority() *bool { +func (c *ClientFacingOnSiteCollectionOrder) GetId() string { if c == nil { - return nil + return "" } - return c.Priority + return c.Id } -func (c *ClientFacingOrder) GetShippingDetails() *ShippingAddress { +func (c *ClientFacingOnSiteCollectionOrder) GetCreatedAt() time.Time { if c == nil { - return nil + return time.Time{} } - return c.ShippingDetails + return c.CreatedAt } -func (c *ClientFacingOrder) GetActivateBy() *string { +func (c *ClientFacingOnSiteCollectionOrder) GetUpdatedAt() time.Time { if c == nil { - return nil + return time.Time{} } - return c.ActivateBy + return c.UpdatedAt } -func (c *ClientFacingOrder) GetPassthrough() *string { - if c == nil { - return nil - } - return c.Passthrough +func (c *ClientFacingOnSiteCollectionOrder) GetExtraProperties() map[string]interface{} { + return c.extraProperties } -func (c *ClientFacingOrder) GetBillingType() *Billing { - if c == nil { - return nil +func (c *ClientFacingOnSiteCollectionOrder) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) } - 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) 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 +15158,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 +15170,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"` @@ -15130,7 +15185,7 @@ func (c *ClientFacingOrder) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingOrder) String() string { +func (c *ClientFacingOnSiteCollectionOrder) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -15143,19 +15198,11 @@ func (c *ClientFacingOrder) String() string { } 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) + clientFacingOnSiteCollectionOrderDetailsFieldData = big.NewInt(1 << 0) ) -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 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:"-"` @@ -15164,94 +15211,38 @@ type ClientFacingOrderChanged struct { 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 { +func (c *ClientFacingOnSiteCollectionOrderDetails) GetData() *ClientFacingOnSiteCollectionOrder { if c == nil { return nil } return c.Data } -func (c *ClientFacingOrderChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingOnSiteCollectionOrderDetails) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingOrderChanged) require(field *big.Int) { +func (c *ClientFacingOnSiteCollectionOrderDetails) 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) { +func (c *ClientFacingOnSiteCollectionOrderDetails) SetData(data *ClientFacingOnSiteCollectionOrder) { c.Data = data - c.require(clientFacingOrderChangedFieldData) + c.require(clientFacingOnSiteCollectionOrderDetailsFieldData) } -func (c *ClientFacingOrderChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingOrderChanged +func (c *ClientFacingOnSiteCollectionOrderDetails) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingOnSiteCollectionOrderDetails var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingOrderChanged(value) + *c = ClientFacingOnSiteCollectionOrderDetails(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -15261,8 +15252,8 @@ func (c *ClientFacingOrderChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingOrderChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingOrderChanged +func (c *ClientFacingOnSiteCollectionOrderDetails) MarshalJSON() ([]byte, error) { + type embed ClientFacingOnSiteCollectionOrderDetails var marshaler = struct { embed }{ @@ -15272,7 +15263,7 @@ func (c *ClientFacingOrderChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingOrderChanged) String() string { +func (c *ClientFacingOnSiteCollectionOrderDetails) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -15284,528 +15275,528 @@ func (c *ClientFacingOrderChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingOrderChangedEventType string - -const ( - ClientFacingOrderChangedEventTypeLabtestOrderCreated ClientFacingOrderChangedEventType = "labtest.order.created" - ClientFacingOrderChangedEventTypeLabtestOrderUpdated ClientFacingOrderChangedEventType = "labtest.order.updated" +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) + clientFacingOrderFieldOrigin = big.NewInt(1 << 27) + clientFacingOrderFieldOrderTransaction = big.NewInt(1 << 28) ) -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) +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"` + 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 ClientFacingOrderChangedEventType) Ptr() *ClientFacingOrderChangedEventType { - return &c +func (c *ClientFacingOrder) GetUserId() string { + if c == nil { + return "" + } + return c.UserId } -type ClientFacingOrderDetails struct { - Type string - WalkInTest *ClientFacingWalkInOrderDetails - Testkit *ClientFacingTestKitOrderDetails - AtHomePhlebotomy *ClientFacingAtHomePhlebotomyOrderDetails - OnSiteCollection *ClientFacingOnSiteCollectionOrderDetails +func (c *ClientFacingOrder) GetId() string { + if c == nil { + return "" + } + return c.Id } -func (c *ClientFacingOrderDetails) GetType() string { +func (c *ClientFacingOrder) GetTeamId() string { if c == nil { return "" } - return c.Type + return c.TeamId } -func (c *ClientFacingOrderDetails) GetWalkInTest() *ClientFacingWalkInOrderDetails { +func (c *ClientFacingOrder) GetPatientDetails() *ClientFacingPatientDetailsCompatible { if c == nil { return nil } - return c.WalkInTest + return c.PatientDetails } -func (c *ClientFacingOrderDetails) GetTestkit() *ClientFacingTestKitOrderDetails { +func (c *ClientFacingOrder) GetPatientAddress() *PatientAddressCompatible { if c == nil { return nil } - return c.Testkit + return c.PatientAddress } -func (c *ClientFacingOrderDetails) GetAtHomePhlebotomy() *ClientFacingAtHomePhlebotomyOrderDetails { +func (c *ClientFacingOrder) GetLabTest() *ClientFacingLabTest { if c == nil { return nil } - return c.AtHomePhlebotomy + return c.LabTest } -func (c *ClientFacingOrderDetails) GetOnSiteCollection() *ClientFacingOnSiteCollectionOrderDetails { +func (c *ClientFacingOrder) GetDetails() *ClientFacingOrderDetails { if c == nil { return nil } - return c.OnSiteCollection + return c.Details } -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) +func (c *ClientFacingOrder) GetSampleId() *string { + if c == nil { + return nil } - 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.SampleId +} + +func (c *ClientFacingOrder) GetNotes() *string { + if c == nil { + return nil } - return nil + return c.Notes } -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") +func (c *ClientFacingOrder) GetCreatedAt() time.Time { + if c == nil { + return time.Time{} } - return nil, fmt.Errorf("type %T does not define a non-empty union type", c) + return c.CreatedAt } -type ClientFacingOrderDetailsVisitor interface { - VisitWalkInTest(*ClientFacingWalkInOrderDetails) error - VisitTestkit(*ClientFacingTestKitOrderDetails) error - VisitAtHomePhlebotomy(*ClientFacingAtHomePhlebotomyOrderDetails) error - VisitOnSiteCollection(*ClientFacingOnSiteCollectionOrderDetails) error +func (c *ClientFacingOrder) GetUpdatedAt() time.Time { + if c == nil { + return time.Time{} + } + return c.UpdatedAt } -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) +func (c *ClientFacingOrder) GetEvents() []*ClientFacingOrderEvent { + if c == nil { + return nil } - if c.AtHomePhlebotomy != nil { - return visitor.VisitAtHomePhlebotomy(c.AtHomePhlebotomy) + return c.Events +} + +func (c *ClientFacingOrder) GetStatus() *OrderTopLevelStatus { + if c == nil { + return nil } - if c.OnSiteCollection != nil { - return visitor.VisitOnSiteCollection(c.OnSiteCollection) + return c.Status +} + +func (c *ClientFacingOrder) GetPhysician() *ClientFacingPhysician { + if c == nil { + return nil } - return fmt.Errorf("type %T does not define a non-empty union type", c) + return c.Physician } -func (c *ClientFacingOrderDetails) validate() error { +func (c *ClientFacingOrder) GetHealthInsuranceId() *string { if c == nil { - return fmt.Errorf("type %T is nil", c) + return nil } - var fields []string - if c.WalkInTest != nil { - fields = append(fields, "walk_in_test") + return c.HealthInsuranceId +} + +func (c *ClientFacingOrder) GetRequisitionFormUrl() *string { + if c == nil { + return nil } - if c.Testkit != nil { - fields = append(fields, "testkit") + return c.RequisitionFormUrl +} + +func (c *ClientFacingOrder) GetPriority() *bool { + if c == nil { + return nil } - if c.AtHomePhlebotomy != nil { - fields = append(fields, "at_home_phlebotomy") + return c.Priority +} + +func (c *ClientFacingOrder) GetShippingDetails() *ShippingAddress { + if c == nil { + return nil } - if c.OnSiteCollection != nil { - fields = append(fields, "on_site_collection") + return c.ShippingDetails +} + +func (c *ClientFacingOrder) GetActivateBy() *string { + if c == nil { + return nil } - 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) + return c.ActivateBy +} + +func (c *ClientFacingOrder) GetPassthrough() *string { + if c == nil { + return nil } - if len(fields) > 1 { - return fmt.Errorf("type %T defines values for %s, but only one value is allowed", c, fields) + return c.Passthrough +} + +func (c *ClientFacingOrder) GetBillingType() *Billing { + if c == nil { + return nil } - 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 c.BillingType +} + +func (c *ClientFacingOrder) GetIcdCodes() []string { + if c == nil { + return nil } - return nil + return c.IcdCodes } -var ( - clientFacingOrderEventFieldId = big.NewInt(1 << 0) - clientFacingOrderEventFieldCreatedAt = big.NewInt(1 << 1) - clientFacingOrderEventFieldStatus = big.NewInt(1 << 2) -) +func (c *ClientFacingOrder) GetHasAbn() bool { + if c == nil { + return false + } + return c.HasAbn +} -type ClientFacingOrderEvent struct { - Id int `json:"id" url:"id"` - CreatedAt time.Time `json:"created_at" url:"created_at"` - Status OrderStatus `json:"status" url:"status"` +func (c *ClientFacingOrder) GetInterpretation() *Interpretation { + if c == nil { + return nil + } + return c.Interpretation +} - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` +func (c *ClientFacingOrder) GetHasMissingResults() *bool { + if c == nil { + return nil + } + return c.HasMissingResults +} - extraProperties map[string]interface{} - rawJSON json.RawMessage +func (c *ClientFacingOrder) GetExpectedResultByDate() *string { + if c == nil { + return nil + } + return c.ExpectedResultByDate } -func (c *ClientFacingOrderEvent) GetId() int { +func (c *ClientFacingOrder) GetWorstCaseResultByDate() *string { if c == nil { - return 0 + return nil } - return c.Id + return c.WorstCaseResultByDate } -func (c *ClientFacingOrderEvent) GetCreatedAt() time.Time { +func (c *ClientFacingOrder) GetOrigin() *OrderOrigin { if c == nil { - return time.Time{} + return nil } - return c.CreatedAt + return c.Origin } -func (c *ClientFacingOrderEvent) GetStatus() OrderStatus { +func (c *ClientFacingOrder) GetOrderTransaction() *ClientFacingOrderTransaction { if c == nil { - return "" + return nil } - return c.Status + return c.OrderTransaction } -func (c *ClientFacingOrderEvent) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingOrder) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingOrderEvent) require(field *big.Int) { +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 *ClientFacingOrderEvent) SetId(id int) { +func (c *ClientFacingOrder) SetId(id string) { c.Id = id - c.require(clientFacingOrderEventFieldId) + c.require(clientFacingOrderFieldId) } -// SetCreatedAt sets the CreatedAt 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 *ClientFacingOrderEvent) SetCreatedAt(createdAt time.Time) { - c.CreatedAt = createdAt - c.require(clientFacingOrderEventFieldCreatedAt) +func (c *ClientFacingOrder) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingOrderFieldTeamId) } -// SetStatus sets the Status field and marks it as non-optional; +// 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 *ClientFacingOrderEvent) SetStatus(status OrderStatus) { - c.Status = status - c.require(clientFacingOrderEventFieldStatus) +func (c *ClientFacingOrder) SetPatientDetails(patientDetails *ClientFacingPatientDetailsCompatible) { + c.PatientDetails = patientDetails + c.require(clientFacingOrderFieldPatientDetails) } -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 = ClientFacingOrderEvent(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - extraProperties, err := internal.ExtractExtraProperties(data, *c) - if err != nil { - return err - } - c.extraProperties = extraProperties - c.rawJSON = json.RawMessage(data) - return nil +// 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) } -func (c *ClientFacingOrderEvent) MarshalJSON() ([]byte, error) { - type embed ClientFacingOrderEvent - var marshaler = struct { - embed - CreatedAt *internal.DateTime `json:"created_at"` - }{ - embed: embed(*c), - CreatedAt: internal.NewDateTime(c.CreatedAt), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) - return json.Marshal(explicitMarshaler) +// 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) } -func (c *ClientFacingOrderEvent) 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 ( - clientFacingPatientDetailsCompatibleFieldFirstName = big.NewInt(1 << 0) - clientFacingPatientDetailsCompatibleFieldLastName = big.NewInt(1 << 1) - clientFacingPatientDetailsCompatibleFieldDob = big.NewInt(1 << 2) - clientFacingPatientDetailsCompatibleFieldGender = big.NewInt(1 << 3) - clientFacingPatientDetailsCompatibleFieldPhoneNumber = big.NewInt(1 << 4) - clientFacingPatientDetailsCompatibleFieldEmail = big.NewInt(1 << 5) - clientFacingPatientDetailsCompatibleFieldMedicalProxy = big.NewInt(1 << 6) - clientFacingPatientDetailsCompatibleFieldRace = big.NewInt(1 << 7) - clientFacingPatientDetailsCompatibleFieldEthnicity = big.NewInt(1 << 8) - clientFacingPatientDetailsCompatibleFieldSexualOrientation = big.NewInt(1 << 9) - clientFacingPatientDetailsCompatibleFieldGenderIdentity = big.NewInt(1 << 10) -) - -type ClientFacingPatientDetailsCompatible struct { - FirstName *string `json:"first_name,omitempty" url:"first_name,omitempty"` - LastName *string `json:"last_name,omitempty" url:"last_name,omitempty"` - Dob time.Time `json:"dob" url:"dob"` - Gender string `json:"gender" url:"gender"` - PhoneNumber *string `json:"phone_number,omitempty" url:"phone_number,omitempty"` - Email *string `json:"email,omitempty" url:"email,omitempty"` - // Parent/medical_proxy details. Required if patient is a minor. - MedicalProxy *GuarantorDetails `json:"medical_proxy,omitempty" url:"medical_proxy,omitempty"` - // If not provided, will be set to 'Not Specified' - Race *Race `json:"race,omitempty" url:"race,omitempty"` - // If not provided, will be set to 'Not Specified' - Ethnicity *Ethnicity `json:"ethnicity,omitempty" url:"ethnicity,omitempty"` - // If not provided, will be set to 'Not Specified' - SexualOrientation *SexualOrientation `json:"sexual_orientation,omitempty" url:"sexual_orientation,omitempty"` - // If not provided, will be set to 'Not Specified' - GenderIdentity *GenderIdentity `json:"gender_identity,omitempty" url:"gender_identity,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 *ClientFacingPatientDetailsCompatible) GetFirstName() *string { - if c == nil { - return nil - } - return c.FirstName -} - -func (c *ClientFacingPatientDetailsCompatible) GetLastName() *string { - if c == nil { - return nil - } - return c.LastName +// 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) } -func (c *ClientFacingPatientDetailsCompatible) GetDob() time.Time { - if c == nil { - return time.Time{} - } - return c.Dob +// 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) } -func (c *ClientFacingPatientDetailsCompatible) GetGender() string { - if c == nil { - return "" - } - return c.Gender +// 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) } -func (c *ClientFacingPatientDetailsCompatible) GetPhoneNumber() *string { - if c == nil { - return nil - } - return c.PhoneNumber +// 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) } -func (c *ClientFacingPatientDetailsCompatible) GetEmail() *string { - if c == nil { - return nil - } - return c.Email +// 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) } -func (c *ClientFacingPatientDetailsCompatible) GetMedicalProxy() *GuarantorDetails { - if c == nil { - return nil - } - return c.MedicalProxy +// 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) } -func (c *ClientFacingPatientDetailsCompatible) GetRace() *Race { - if c == nil { - return nil - } - return c.Race +// 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) } -func (c *ClientFacingPatientDetailsCompatible) GetEthnicity() *Ethnicity { - if c == nil { - return nil - } - return c.Ethnicity +// 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) } -func (c *ClientFacingPatientDetailsCompatible) GetSexualOrientation() *SexualOrientation { - if c == nil { - return nil - } - return c.SexualOrientation +// 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) } -func (c *ClientFacingPatientDetailsCompatible) GetGenderIdentity() *GenderIdentity { - if c == nil { - return nil - } - return c.GenderIdentity +// 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) } -func (c *ClientFacingPatientDetailsCompatible) GetExtraProperties() map[string]interface{} { - return c.extraProperties +// 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) } -func (c *ClientFacingPatientDetailsCompatible) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) - } - c.explicitFields.Or(c.explicitFields, field) +// 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) } -// SetFirstName sets the FirstName field and marks it as non-optional; +// 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 *ClientFacingPatientDetailsCompatible) SetFirstName(firstName *string) { - c.FirstName = firstName - c.require(clientFacingPatientDetailsCompatibleFieldFirstName) +func (c *ClientFacingOrder) SetActivateBy(activateBy *string) { + c.ActivateBy = activateBy + c.require(clientFacingOrderFieldActivateBy) } -// SetLastName sets the LastName field and marks it as non-optional; +// 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 *ClientFacingPatientDetailsCompatible) SetLastName(lastName *string) { - c.LastName = lastName - c.require(clientFacingPatientDetailsCompatibleFieldLastName) +func (c *ClientFacingOrder) SetPassthrough(passthrough *string) { + c.Passthrough = passthrough + c.require(clientFacingOrderFieldPassthrough) } -// SetDob sets the Dob field and marks it as non-optional; +// 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 *ClientFacingPatientDetailsCompatible) SetDob(dob time.Time) { - c.Dob = dob - c.require(clientFacingPatientDetailsCompatibleFieldDob) +func (c *ClientFacingOrder) SetBillingType(billingType *Billing) { + c.BillingType = billingType + c.require(clientFacingOrderFieldBillingType) } -// SetGender sets the Gender field and marks it as non-optional; +// 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 *ClientFacingPatientDetailsCompatible) SetGender(gender string) { - c.Gender = gender - c.require(clientFacingPatientDetailsCompatibleFieldGender) +func (c *ClientFacingOrder) SetIcdCodes(icdCodes []string) { + c.IcdCodes = icdCodes + c.require(clientFacingOrderFieldIcdCodes) } -// SetPhoneNumber sets the PhoneNumber field and marks it as non-optional; +// 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 *ClientFacingPatientDetailsCompatible) SetPhoneNumber(phoneNumber *string) { - c.PhoneNumber = phoneNumber - c.require(clientFacingPatientDetailsCompatibleFieldPhoneNumber) +func (c *ClientFacingOrder) SetHasAbn(hasAbn bool) { + c.HasAbn = hasAbn + c.require(clientFacingOrderFieldHasAbn) } -// SetEmail sets the Email field and marks it as non-optional; +// 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 *ClientFacingPatientDetailsCompatible) SetEmail(email *string) { - c.Email = email - c.require(clientFacingPatientDetailsCompatibleFieldEmail) +func (c *ClientFacingOrder) SetInterpretation(interpretation *Interpretation) { + c.Interpretation = interpretation + c.require(clientFacingOrderFieldInterpretation) } -// SetMedicalProxy sets the MedicalProxy field and marks it as non-optional; +// 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 *ClientFacingPatientDetailsCompatible) SetMedicalProxy(medicalProxy *GuarantorDetails) { - c.MedicalProxy = medicalProxy - c.require(clientFacingPatientDetailsCompatibleFieldMedicalProxy) +func (c *ClientFacingOrder) SetHasMissingResults(hasMissingResults *bool) { + c.HasMissingResults = hasMissingResults + c.require(clientFacingOrderFieldHasMissingResults) } -// SetRace sets the Race field and marks it as non-optional; +// 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 *ClientFacingPatientDetailsCompatible) SetRace(race *Race) { - c.Race = race - c.require(clientFacingPatientDetailsCompatibleFieldRace) +func (c *ClientFacingOrder) SetExpectedResultByDate(expectedResultByDate *string) { + c.ExpectedResultByDate = expectedResultByDate + c.require(clientFacingOrderFieldExpectedResultByDate) } -// SetEthnicity sets the Ethnicity field and marks it as non-optional; +// 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 *ClientFacingPatientDetailsCompatible) SetEthnicity(ethnicity *Ethnicity) { - c.Ethnicity = ethnicity - c.require(clientFacingPatientDetailsCompatibleFieldEthnicity) +func (c *ClientFacingOrder) SetWorstCaseResultByDate(worstCaseResultByDate *string) { + c.WorstCaseResultByDate = worstCaseResultByDate + c.require(clientFacingOrderFieldWorstCaseResultByDate) } -// SetSexualOrientation sets the SexualOrientation field and marks it as non-optional; +// 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 *ClientFacingPatientDetailsCompatible) SetSexualOrientation(sexualOrientation *SexualOrientation) { - c.SexualOrientation = sexualOrientation - c.require(clientFacingPatientDetailsCompatibleFieldSexualOrientation) +func (c *ClientFacingOrder) SetOrigin(origin *OrderOrigin) { + c.Origin = origin + c.require(clientFacingOrderFieldOrigin) } -// SetGenderIdentity sets the GenderIdentity field and marks it as non-optional; +// 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 *ClientFacingPatientDetailsCompatible) SetGenderIdentity(genderIdentity *GenderIdentity) { - c.GenderIdentity = genderIdentity - c.require(clientFacingPatientDetailsCompatibleFieldGenderIdentity) +func (c *ClientFacingOrder) SetOrderTransaction(orderTransaction *ClientFacingOrderTransaction) { + c.OrderTransaction = orderTransaction + c.require(clientFacingOrderFieldOrderTransaction) } -func (c *ClientFacingPatientDetailsCompatible) UnmarshalJSON(data []byte) error { - type embed ClientFacingPatientDetailsCompatible +func (c *ClientFacingOrder) UnmarshalJSON(data []byte) error { + type embed ClientFacingOrder var unmarshaler = struct { embed - Dob *internal.DateTime `json:"dob"` + 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 = ClientFacingPatientDetailsCompatible(unmarshaler.embed) - c.Dob = unmarshaler.Dob.Time() + *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 @@ -15815,20 +15806,22 @@ func (c *ClientFacingPatientDetailsCompatible) UnmarshalJSON(data []byte) error return nil } -func (c *ClientFacingPatientDetailsCompatible) MarshalJSON() ([]byte, error) { - type embed ClientFacingPatientDetailsCompatible +func (c *ClientFacingOrder) MarshalJSON() ([]byte, error) { + type embed ClientFacingOrder var marshaler = struct { embed - Dob *internal.DateTime `json:"dob"` + CreatedAt *internal.DateTime `json:"created_at"` + UpdatedAt *internal.DateTime `json:"updated_at"` }{ - embed: embed(*c), - Dob: internal.NewDateTime(c.Dob), + 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 *ClientFacingPatientDetailsCompatible) String() string { +func (c *ClientFacingOrder) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -15840,43 +15833,20 @@ func (c *ClientFacingPatientDetailsCompatible) String() string { return fmt.Sprintf("%#v", c) } -// ℹ️ This enum is non-exhaustive. -type ClientFacingPayorCodeSource string - -const ( - ClientFacingPayorCodeSourcePlatform ClientFacingPayorCodeSource = "platform" - ClientFacingPayorCodeSourceTeam ClientFacingPayorCodeSource = "team" -) - -func NewClientFacingPayorCodeSourceFromString(s string) (ClientFacingPayorCodeSource, error) { - switch s { - case "platform": - return ClientFacingPayorCodeSourcePlatform, nil - case "team": - return ClientFacingPayorCodeSourceTeam, nil - } - var t ClientFacingPayorCodeSource - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ClientFacingPayorCodeSource) Ptr() *ClientFacingPayorCodeSource { - return &c -} - var ( - clientFacingPeakExpiratoryFlowRateChangedFieldEventType = big.NewInt(1 << 0) - clientFacingPeakExpiratoryFlowRateChangedFieldUserId = big.NewInt(1 << 1) - clientFacingPeakExpiratoryFlowRateChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingPeakExpiratoryFlowRateChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingPeakExpiratoryFlowRateChangedFieldData = big.NewInt(1 << 4) + 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 ClientFacingPeakExpiratoryFlowRateChanged struct { - EventType ClientFacingPeakExpiratoryFlowRateChangedEventType `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 *GroupedPeakExpiratoryFlowRate `json:"data" url:"data"` +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:"-"` @@ -15885,46 +15855,46 @@ type ClientFacingPeakExpiratoryFlowRateChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingPeakExpiratoryFlowRateChanged) GetEventType() ClientFacingPeakExpiratoryFlowRateChangedEventType { +func (c *ClientFacingOrderChanged) GetEventType() ClientFacingOrderChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingPeakExpiratoryFlowRateChanged) GetUserId() string { +func (c *ClientFacingOrderChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingPeakExpiratoryFlowRateChanged) GetClientUserId() string { +func (c *ClientFacingOrderChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingPeakExpiratoryFlowRateChanged) GetTeamId() string { +func (c *ClientFacingOrderChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingPeakExpiratoryFlowRateChanged) GetData() *GroupedPeakExpiratoryFlowRate { +func (c *ClientFacingOrderChanged) GetData() *ClientFacingOrder { if c == nil { return nil } return c.Data } -func (c *ClientFacingPeakExpiratoryFlowRateChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingOrderChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingPeakExpiratoryFlowRateChanged) require(field *big.Int) { +func (c *ClientFacingOrderChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -15933,46 +15903,46 @@ func (c *ClientFacingPeakExpiratoryFlowRateChanged) 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 *ClientFacingPeakExpiratoryFlowRateChanged) SetEventType(eventType ClientFacingPeakExpiratoryFlowRateChangedEventType) { +func (c *ClientFacingOrderChanged) SetEventType(eventType ClientFacingOrderChangedEventType) { c.EventType = eventType - c.require(clientFacingPeakExpiratoryFlowRateChangedFieldEventType) + 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 *ClientFacingPeakExpiratoryFlowRateChanged) SetUserId(userId string) { +func (c *ClientFacingOrderChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingPeakExpiratoryFlowRateChangedFieldUserId) + 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 *ClientFacingPeakExpiratoryFlowRateChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingOrderChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingPeakExpiratoryFlowRateChangedFieldClientUserId) + 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 *ClientFacingPeakExpiratoryFlowRateChanged) SetTeamId(teamId string) { +func (c *ClientFacingOrderChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingPeakExpiratoryFlowRateChangedFieldTeamId) + 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 *ClientFacingPeakExpiratoryFlowRateChanged) SetData(data *GroupedPeakExpiratoryFlowRate) { +func (c *ClientFacingOrderChanged) SetData(data *ClientFacingOrder) { c.Data = data - c.require(clientFacingPeakExpiratoryFlowRateChangedFieldData) + c.require(clientFacingOrderChangedFieldData) } -func (c *ClientFacingPeakExpiratoryFlowRateChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingPeakExpiratoryFlowRateChanged +func (c *ClientFacingOrderChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingOrderChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingPeakExpiratoryFlowRateChanged(value) + *c = ClientFacingOrderChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -15982,8 +15952,8 @@ func (c *ClientFacingPeakExpiratoryFlowRateChanged) UnmarshalJSON(data []byte) e return nil } -func (c *ClientFacingPeakExpiratoryFlowRateChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingPeakExpiratoryFlowRateChanged +func (c *ClientFacingOrderChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingOrderChanged var marshaler = struct { embed }{ @@ -15993,7 +15963,7 @@ func (c *ClientFacingPeakExpiratoryFlowRateChanged) MarshalJSON() ([]byte, error return json.Marshal(explicitMarshaler) } -func (c *ClientFacingPeakExpiratoryFlowRateChanged) String() string { +func (c *ClientFacingOrderChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -16005,180 +15975,203 @@ func (c *ClientFacingPeakExpiratoryFlowRateChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingPeakExpiratoryFlowRateChangedEventType string +type ClientFacingOrderChangedEventType string const ( - ClientFacingPeakExpiratoryFlowRateChangedEventTypeDailyDataPeakExpiratoryFlowRateCreated ClientFacingPeakExpiratoryFlowRateChangedEventType = "daily.data.peak_expiratory_flow_rate.created" - ClientFacingPeakExpiratoryFlowRateChangedEventTypeDailyDataPeakExpiratoryFlowRateUpdated ClientFacingPeakExpiratoryFlowRateChangedEventType = "daily.data.peak_expiratory_flow_rate.updated" + ClientFacingOrderChangedEventTypeLabtestOrderCreated ClientFacingOrderChangedEventType = "labtest.order.created" + ClientFacingOrderChangedEventTypeLabtestOrderUpdated ClientFacingOrderChangedEventType = "labtest.order.updated" ) -func NewClientFacingPeakExpiratoryFlowRateChangedEventTypeFromString(s string) (ClientFacingPeakExpiratoryFlowRateChangedEventType, error) { +func NewClientFacingOrderChangedEventTypeFromString(s string) (ClientFacingOrderChangedEventType, error) { switch s { - case "daily.data.peak_expiratory_flow_rate.created": - return ClientFacingPeakExpiratoryFlowRateChangedEventTypeDailyDataPeakExpiratoryFlowRateCreated, nil - case "daily.data.peak_expiratory_flow_rate.updated": - return ClientFacingPeakExpiratoryFlowRateChangedEventTypeDailyDataPeakExpiratoryFlowRateUpdated, nil + case "labtest.order.created": + return ClientFacingOrderChangedEventTypeLabtestOrderCreated, nil + case "labtest.order.updated": + return ClientFacingOrderChangedEventTypeLabtestOrderUpdated, nil } - var t ClientFacingPeakExpiratoryFlowRateChangedEventType + var t ClientFacingOrderChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingPeakExpiratoryFlowRateChangedEventType) Ptr() *ClientFacingPeakExpiratoryFlowRateChangedEventType { +func (c ClientFacingOrderChangedEventType) Ptr() *ClientFacingOrderChangedEventType { return &c } -var ( - clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldData = big.NewInt(1 << 3) -) - -type ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted 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 +type ClientFacingOrderDetails struct { + Type string + WalkInTest *ClientFacingWalkInOrderDetails + Testkit *ClientFacingTestKitOrderDetails + AtHomePhlebotomy *ClientFacingAtHomePhlebotomyOrderDetails + OnSiteCollection *ClientFacingOnSiteCollectionOrderDetails } -func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingOrderDetails) GetType() string { if c == nil { return "" } - return c.UserId + return c.Type } -func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingOrderDetails) GetWalkInTest() *ClientFacingWalkInOrderDetails { if c == nil { - return "" + return nil } - return c.ClientUserId + return c.WalkInTest } -func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingOrderDetails) GetTestkit() *ClientFacingTestKitOrderDetails { if c == nil { - return "" + return nil } - return c.TeamId + return c.Testkit } -func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingOrderDetails) GetAtHomePhlebotomy() *ClientFacingAtHomePhlebotomyOrderDetails { if c == nil { return nil } - return c.Data + return c.AtHomePhlebotomy } -func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) EventType() string { - return c.eventType +func (c *ClientFacingOrderDetails) GetOnSiteCollection() *ClientFacingOnSiteCollectionOrderDetails { + if c == nil { + return nil + } + return c.OnSiteCollection } -func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { - return c.extraProperties +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 *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) +func (c ClientFacingOrderDetails) MarshalJSON() ([]byte, error) { + if err := c.validate(); err != nil { + return nil, err } - c.explicitFields.Or(c.explicitFields, field) + 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) } -// 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 *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldUserId) +type ClientFacingOrderDetailsVisitor interface { + VisitWalkInTest(*ClientFacingWalkInOrderDetails) error + VisitTestkit(*ClientFacingTestKitOrderDetails) error + VisitAtHomePhlebotomy(*ClientFacingAtHomePhlebotomyOrderDetails) error + VisitOnSiteCollection(*ClientFacingOnSiteCollectionOrderDetails) error } -// 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 *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldClientUserId) -} - -// 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 *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldTeamId) -} - -// 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 *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { - c.Data = data - c.require(clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldData) -} - -func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted - var unmarshaler = struct { - embed - EventType string `json:"event_type"` - }{ - embed: embed(*c), +func (c *ClientFacingOrderDetails) Accept(visitor ClientFacingOrderDetailsVisitor) error { + if c.WalkInTest != nil { + return visitor.VisitWalkInTest(c.WalkInTest) } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err + if c.Testkit != nil { + return visitor.VisitTestkit(c.Testkit) } - *c = ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.peak_expiratory_flow_rate.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.peak_expiratory_flow_rate.created", unmarshaler.EventType) + if c.AtHomePhlebotomy != nil { + return visitor.VisitAtHomePhlebotomy(c.AtHomePhlebotomy) } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") - if err != nil { - return err + if c.OnSiteCollection != nil { + return visitor.VisitOnSiteCollection(c.OnSiteCollection) } - c.extraProperties = extraProperties - c.rawJSON = json.RawMessage(data) - return nil + return fmt.Errorf("type %T does not define a non-empty union type", c) } -func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted - var marshaler = struct { - embed - EventType string `json:"event_type"` - }{ - embed: embed(*c), - EventType: "historical.data.peak_expiratory_flow_rate.created", +func (c *ClientFacingOrderDetails) validate() error { + if c == nil { + return fmt.Errorf("type %T is nil", c) } - explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) String() string { - if len(c.rawJSON) > 0 { - if value, err := internal.StringifyJSON(c.rawJSON); err == nil { - return value + 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 ( - clientFacingPhysicianFieldFirstName = big.NewInt(1 << 0) - clientFacingPhysicianFieldLastName = big.NewInt(1 << 1) - clientFacingPhysicianFieldNpi = big.NewInt(1 << 2) + clientFacingOrderEventFieldId = big.NewInt(1 << 0) + clientFacingOrderEventFieldCreatedAt = big.NewInt(1 << 1) + clientFacingOrderEventFieldStatus = big.NewInt(1 << 2) ) -type ClientFacingPhysician struct { - FirstName string `json:"first_name" url:"first_name"` - LastName string `json:"last_name" url:"last_name"` - Npi string `json:"npi" url:"npi"` +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:"-"` @@ -16187,66 +16180,72 @@ type ClientFacingPhysician struct { rawJSON json.RawMessage } -func (c *ClientFacingPhysician) GetFirstName() string { +func (c *ClientFacingOrderEvent) GetId() int { if c == nil { - return "" + return 0 } - return c.FirstName + return c.Id } -func (c *ClientFacingPhysician) GetLastName() string { +func (c *ClientFacingOrderEvent) GetCreatedAt() time.Time { if c == nil { - return "" + return time.Time{} } - return c.LastName + return c.CreatedAt } -func (c *ClientFacingPhysician) GetNpi() string { +func (c *ClientFacingOrderEvent) GetStatus() OrderStatus { if c == nil { return "" } - return c.Npi + return c.Status } -func (c *ClientFacingPhysician) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingOrderEvent) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingPhysician) 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) } -// SetFirstName sets the FirstName 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 *ClientFacingPhysician) SetFirstName(firstName string) { - c.FirstName = firstName - c.require(clientFacingPhysicianFieldFirstName) +func (c *ClientFacingOrderEvent) SetId(id int) { + c.Id = id + c.require(clientFacingOrderEventFieldId) } -// SetLastName sets the LastName 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 *ClientFacingPhysician) SetLastName(lastName string) { - c.LastName = lastName - c.require(clientFacingPhysicianFieldLastName) +func (c *ClientFacingOrderEvent) SetCreatedAt(createdAt time.Time) { + c.CreatedAt = createdAt + c.require(clientFacingOrderEventFieldCreatedAt) } -// SetNpi sets the Npi 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 *ClientFacingPhysician) SetNpi(npi string) { - c.Npi = npi - c.require(clientFacingPhysicianFieldNpi) +func (c *ClientFacingOrderEvent) SetStatus(status OrderStatus) { + c.Status = status + c.require(clientFacingOrderEventFieldStatus) } -func (c *ClientFacingPhysician) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingPhysician - 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 = ClientFacingPhysician(value) + *c = ClientFacingOrderEvent(unmarshaler.embed) + c.CreatedAt = unmarshaler.CreatedAt.Time() extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -16256,18 +16255,20 @@ func (c *ClientFacingPhysician) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingPhysician) MarshalJSON() ([]byte, error) { - type embed ClientFacingPhysician +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 *ClientFacingPhysician) String() string { +func (c *ClientFacingOrderEvent) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -16279,20 +16280,25 @@ func (c *ClientFacingPhysician) String() string { return fmt.Sprintf("%#v", c) } +// Minimal order info for embedding in order_transaction payload. var ( - clientFacingProfileChangedFieldEventType = big.NewInt(1 << 0) - clientFacingProfileChangedFieldUserId = big.NewInt(1 << 1) - clientFacingProfileChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingProfileChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingProfileChangedFieldData = big.NewInt(1 << 4) -) - -type ClientFacingProfileChanged struct { - EventType ClientFacingProfileChangedEventType `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 *ClientFacingProfile `json:"data" url:"data"` + 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"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -16301,94 +16307,132 @@ type ClientFacingProfileChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingProfileChanged) GetEventType() ClientFacingProfileChangedEventType { +func (c *ClientFacingOrderInTransaction) GetId() string { if c == nil { return "" } - return c.EventType + return c.Id } -func (c *ClientFacingProfileChanged) GetUserId() string { +func (c *ClientFacingOrderInTransaction) GetLowLevelStatus() *OrderLowLevelStatus { if c == nil { - return "" + return nil } - return c.UserId + return c.LowLevelStatus } -func (c *ClientFacingProfileChanged) GetClientUserId() string { +func (c *ClientFacingOrderInTransaction) GetLowLevelStatusCreatedAt() *time.Time { if c == nil { - return "" + return nil } - return c.ClientUserId + return c.LowLevelStatusCreatedAt } -func (c *ClientFacingProfileChanged) GetTeamId() string { +func (c *ClientFacingOrderInTransaction) GetOrigin() *OrderOrigin { if c == nil { - return "" + return nil } - return c.TeamId + return c.Origin } -func (c *ClientFacingProfileChanged) GetData() *ClientFacingProfile { +func (c *ClientFacingOrderInTransaction) GetParentId() *string { if c == nil { return nil } - return c.Data + return c.ParentId } -func (c *ClientFacingProfileChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingOrderInTransaction) GetCreatedAt() time.Time { + if c == nil { + return time.Time{} + } + return c.CreatedAt +} + +func (c *ClientFacingOrderInTransaction) GetUpdatedAt() time.Time { + if c == nil { + return time.Time{} + } + return c.UpdatedAt +} + +func (c *ClientFacingOrderInTransaction) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingProfileChanged) require(field *big.Int) { +func (c *ClientFacingOrderInTransaction) 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; +// 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 *ClientFacingProfileChanged) SetEventType(eventType ClientFacingProfileChangedEventType) { - c.EventType = eventType - c.require(clientFacingProfileChangedFieldEventType) +func (c *ClientFacingOrderInTransaction) SetId(id string) { + c.Id = id + c.require(clientFacingOrderInTransactionFieldId) } -// SetUserId sets the UserId field and marks it as non-optional; +// 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 *ClientFacingProfileChanged) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingProfileChangedFieldUserId) +func (c *ClientFacingOrderInTransaction) SetLowLevelStatus(lowLevelStatus *OrderLowLevelStatus) { + c.LowLevelStatus = lowLevelStatus + c.require(clientFacingOrderInTransactionFieldLowLevelStatus) } -// SetClientUserId sets the ClientUserId field and marks it as non-optional; +// 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 *ClientFacingProfileChanged) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingProfileChangedFieldClientUserId) +func (c *ClientFacingOrderInTransaction) SetLowLevelStatusCreatedAt(lowLevelStatusCreatedAt *time.Time) { + c.LowLevelStatusCreatedAt = lowLevelStatusCreatedAt + c.require(clientFacingOrderInTransactionFieldLowLevelStatusCreatedAt) } -// SetTeamId sets the TeamId field and marks it as non-optional; +// 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 *ClientFacingProfileChanged) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingProfileChangedFieldTeamId) +func (c *ClientFacingOrderInTransaction) SetOrigin(origin *OrderOrigin) { + c.Origin = origin + c.require(clientFacingOrderInTransactionFieldOrigin) } -// SetData sets the Data field and marks it as non-optional; +// 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 *ClientFacingProfileChanged) SetData(data *ClientFacingProfile) { - c.Data = data - c.require(clientFacingProfileChangedFieldData) +func (c *ClientFacingOrderInTransaction) SetParentId(parentId *string) { + c.ParentId = parentId + c.require(clientFacingOrderInTransactionFieldParentId) } -func (c *ClientFacingProfileChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingProfileChanged - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +// 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) +} + +// 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 *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 err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingProfileChanged(value) + *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 @@ -16398,18 +16442,24 @@ func (c *ClientFacingProfileChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingProfileChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingProfileChanged +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), + embed: embed(*c), + LowLevelStatusCreatedAt: internal.NewOptionalDateTime(c.LowLevelStatusCreatedAt), + CreatedAt: internal.NewDateTime(c.CreatedAt), + UpdatedAt: internal.NewDateTime(c.UpdatedAt), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingProfileChanged) String() string { +func (c *ClientFacingOrderInTransaction) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -16421,137 +16471,86 @@ func (c *ClientFacingProfileChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingProfileChangedEventType string - -const ( - ClientFacingProfileChangedEventTypeDailyDataProfileCreated ClientFacingProfileChangedEventType = "daily.data.profile.created" - ClientFacingProfileChangedEventTypeDailyDataProfileUpdated ClientFacingProfileChangedEventType = "daily.data.profile.updated" -) - -func NewClientFacingProfileChangedEventTypeFromString(s string) (ClientFacingProfileChangedEventType, error) { - switch s { - case "daily.data.profile.created": - return ClientFacingProfileChangedEventTypeDailyDataProfileCreated, nil - case "daily.data.profile.updated": - return ClientFacingProfileChangedEventTypeDailyDataProfileUpdated, nil - } - var t ClientFacingProfileChangedEventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ClientFacingProfileChangedEventType) Ptr() *ClientFacingProfileChangedEventType { - return &c -} - +// Order transaction info. var ( - clientFacingProfileHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingProfileHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingProfileHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingProfileHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingOrderTransactionFieldId = big.NewInt(1 << 0) + clientFacingOrderTransactionFieldStatus = big.NewInt(1 << 1) + clientFacingOrderTransactionFieldOrders = big.NewInt(1 << 2) ) -type ClientFacingProfileHistoricalPullCompleted 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 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:"-"` - eventType string extraProperties map[string]interface{} rawJSON json.RawMessage } -func (c *ClientFacingProfileHistoricalPullCompleted) GetUserId() string { - if c == nil { - return "" - } - return c.UserId -} - -func (c *ClientFacingProfileHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingOrderTransaction) GetId() string { if c == nil { return "" } - return c.ClientUserId + return c.Id } -func (c *ClientFacingProfileHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingOrderTransaction) GetStatus() OrderTransactionStatus { if c == nil { return "" } - return c.TeamId + return c.Status } -func (c *ClientFacingProfileHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingOrderTransaction) GetOrders() []*ClientFacingOrderInTransaction { if c == nil { return nil } - return c.Data -} - -func (c *ClientFacingProfileHistoricalPullCompleted) EventType() string { - return c.eventType + return c.Orders } -func (c *ClientFacingProfileHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingOrderTransaction) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingProfileHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingOrderTransaction) 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 *ClientFacingProfileHistoricalPullCompleted) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingProfileHistoricalPullCompletedFieldUserId) -} - -// 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 *ClientFacingProfileHistoricalPullCompleted) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingProfileHistoricalPullCompletedFieldClientUserId) +func (c *ClientFacingOrderTransaction) SetId(id string) { + c.Id = id + c.require(clientFacingOrderTransactionFieldId) } -// SetTeamId sets the TeamId 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 *ClientFacingProfileHistoricalPullCompleted) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingProfileHistoricalPullCompletedFieldTeamId) +func (c *ClientFacingOrderTransaction) SetStatus(status OrderTransactionStatus) { + c.Status = status + c.require(clientFacingOrderTransactionFieldStatus) } -// SetData sets the Data 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 *ClientFacingProfileHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { - c.Data = data - c.require(clientFacingProfileHistoricalPullCompletedFieldData) +func (c *ClientFacingOrderTransaction) SetOrders(orders []*ClientFacingOrderInTransaction) { + c.Orders = orders + c.require(clientFacingOrderTransactionFieldOrders) } -func (c *ClientFacingProfileHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingProfileHistoricalPullCompleted - var unmarshaler = struct { - embed - EventType string `json:"event_type"` - }{ - 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 = ClientFacingProfileHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.profile.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.profile.created", unmarshaler.EventType) - } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + *c = ClientFacingOrderTransaction(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } @@ -16560,20 +16559,18 @@ func (c *ClientFacingProfileHistoricalPullCompleted) UnmarshalJSON(data []byte) return nil } -func (c *ClientFacingProfileHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingProfileHistoricalPullCompleted +func (c *ClientFacingOrderTransaction) MarshalJSON() ([]byte, error) { + type embed ClientFacingOrderTransaction var marshaler = struct { embed - EventType string `json:"event_type"` }{ - embed: embed(*c), - EventType: "historical.data.profile.created", + embed: embed(*c), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingProfileHistoricalPullCompleted) String() string { +func (c *ClientFacingOrderTransaction) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -16585,20 +16582,37 @@ func (c *ClientFacingProfileHistoricalPullCompleted) String() string { return fmt.Sprintf("%#v", c) } -// A vendor, a service, or a platform which Vital can connect with. var ( - clientFacingProviderFieldName = big.NewInt(1 << 0) - clientFacingProviderFieldSlug = big.NewInt(1 << 1) - clientFacingProviderFieldLogo = big.NewInt(1 << 2) + clientFacingPatientDetailsCompatibleFieldFirstName = big.NewInt(1 << 0) + clientFacingPatientDetailsCompatibleFieldLastName = big.NewInt(1 << 1) + clientFacingPatientDetailsCompatibleFieldDob = big.NewInt(1 << 2) + clientFacingPatientDetailsCompatibleFieldGender = big.NewInt(1 << 3) + clientFacingPatientDetailsCompatibleFieldPhoneNumber = big.NewInt(1 << 4) + clientFacingPatientDetailsCompatibleFieldEmail = big.NewInt(1 << 5) + clientFacingPatientDetailsCompatibleFieldMedicalProxy = big.NewInt(1 << 6) + clientFacingPatientDetailsCompatibleFieldRace = big.NewInt(1 << 7) + clientFacingPatientDetailsCompatibleFieldEthnicity = big.NewInt(1 << 8) + clientFacingPatientDetailsCompatibleFieldSexualOrientation = big.NewInt(1 << 9) + clientFacingPatientDetailsCompatibleFieldGenderIdentity = big.NewInt(1 << 10) ) -type ClientFacingProvider struct { - // Name of source of information - Name string `json:"name" url:"name"` - // Slug for designated source - Slug string `json:"slug" url:"slug"` - // URL for source logo - Logo string `json:"logo" url:"logo"` +type ClientFacingPatientDetailsCompatible struct { + FirstName *string `json:"first_name,omitempty" url:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty" url:"last_name,omitempty"` + Dob time.Time `json:"dob" url:"dob"` + Gender string `json:"gender" url:"gender"` + PhoneNumber *string `json:"phone_number,omitempty" url:"phone_number,omitempty"` + Email *string `json:"email,omitempty" url:"email,omitempty"` + // Parent/medical_proxy details. Required if patient is a minor. + MedicalProxy *GuarantorDetails `json:"medical_proxy,omitempty" url:"medical_proxy,omitempty"` + // If not provided, will be set to 'Not Specified' + Race *Race `json:"race,omitempty" url:"race,omitempty"` + // If not provided, will be set to 'Not Specified' + Ethnicity *Ethnicity `json:"ethnicity,omitempty" url:"ethnicity,omitempty"` + // If not provided, will be set to 'Not Specified' + SexualOrientation *SexualOrientation `json:"sexual_orientation,omitempty" url:"sexual_orientation,omitempty"` + // If not provided, will be set to 'Not Specified' + GenderIdentity *GenderIdentity `json:"gender_identity,omitempty" url:"gender_identity,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -16607,207 +16621,185 @@ type ClientFacingProvider struct { rawJSON json.RawMessage } -func (c *ClientFacingProvider) GetName() string { +func (c *ClientFacingPatientDetailsCompatible) GetFirstName() *string { if c == nil { - return "" + return nil } - return c.Name + return c.FirstName } -func (c *ClientFacingProvider) GetSlug() string { +func (c *ClientFacingPatientDetailsCompatible) GetLastName() *string { if c == nil { - return "" + return nil } - return c.Slug + return c.LastName } -func (c *ClientFacingProvider) GetLogo() string { +func (c *ClientFacingPatientDetailsCompatible) GetDob() time.Time { if c == nil { - return "" + return time.Time{} } - return c.Logo + return c.Dob } -func (c *ClientFacingProvider) GetExtraProperties() map[string]interface{} { - return c.extraProperties +func (c *ClientFacingPatientDetailsCompatible) GetGender() string { + if c == nil { + return "" + } + return c.Gender } -func (c *ClientFacingProvider) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) +func (c *ClientFacingPatientDetailsCompatible) GetPhoneNumber() *string { + if c == nil { + return nil } - c.explicitFields.Or(c.explicitFields, field) + return c.PhoneNumber } -// 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 *ClientFacingProvider) SetName(name string) { - c.Name = name - c.require(clientFacingProviderFieldName) +func (c *ClientFacingPatientDetailsCompatible) GetEmail() *string { + if c == nil { + return nil + } + return c.Email } -// 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 *ClientFacingProvider) SetSlug(slug string) { - c.Slug = slug - c.require(clientFacingProviderFieldSlug) +func (c *ClientFacingPatientDetailsCompatible) GetMedicalProxy() *GuarantorDetails { + if c == nil { + return nil + } + return c.MedicalProxy } -// SetLogo sets the Logo field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingProvider) SetLogo(logo string) { - c.Logo = logo - c.require(clientFacingProviderFieldLogo) +func (c *ClientFacingPatientDetailsCompatible) GetRace() *Race { + if c == nil { + return nil + } + return c.Race } -func (c *ClientFacingProvider) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingProvider - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = ClientFacingProvider(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) - if err != nil { - return err +func (c *ClientFacingPatientDetailsCompatible) GetEthnicity() *Ethnicity { + if c == nil { + return nil } - c.extraProperties = extraProperties - c.rawJSON = json.RawMessage(data) - return nil + return c.Ethnicity } -func (c *ClientFacingProvider) MarshalJSON() ([]byte, error) { - type embed ClientFacingProvider - var marshaler = struct { - embed - }{ - embed: embed(*c), +func (c *ClientFacingPatientDetailsCompatible) GetSexualOrientation() *SexualOrientation { + if c == nil { + return nil } - explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) - return json.Marshal(explicitMarshaler) + return c.SexualOrientation } -func (c *ClientFacingProvider) 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 +func (c *ClientFacingPatientDetailsCompatible) GetGenderIdentity() *GenderIdentity { + if c == nil { + return nil } - return fmt.Sprintf("%#v", c) + return c.GenderIdentity } -var ( - clientFacingProviderConnectionCreatedEventFieldUserId = big.NewInt(1 << 0) - clientFacingProviderConnectionCreatedEventFieldClientUserId = big.NewInt(1 << 1) - clientFacingProviderConnectionCreatedEventFieldTeamId = big.NewInt(1 << 2) - clientFacingProviderConnectionCreatedEventFieldData = big.NewInt(1 << 3) -) - -type ClientFacingProviderConnectionCreatedEvent 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 *ProviderConnectionCreated `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 *ClientFacingPatientDetailsCompatible) GetExtraProperties() map[string]interface{} { + return c.extraProperties } -func (c *ClientFacingProviderConnectionCreatedEvent) GetUserId() string { - if c == nil { - return "" +func (c *ClientFacingPatientDetailsCompatible) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) } - return c.UserId + c.explicitFields.Or(c.explicitFields, field) } -func (c *ClientFacingProviderConnectionCreatedEvent) GetClientUserId() string { - if c == nil { - return "" - } - return c.ClientUserId +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingPatientDetailsCompatible) SetFirstName(firstName *string) { + c.FirstName = firstName + c.require(clientFacingPatientDetailsCompatibleFieldFirstName) } -func (c *ClientFacingProviderConnectionCreatedEvent) GetTeamId() string { - if c == nil { - return "" - } - return c.TeamId +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingPatientDetailsCompatible) SetLastName(lastName *string) { + c.LastName = lastName + c.require(clientFacingPatientDetailsCompatibleFieldLastName) } -func (c *ClientFacingProviderConnectionCreatedEvent) GetData() *ProviderConnectionCreated { - if c == nil { - return nil - } - return c.Data +// 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 (c *ClientFacingPatientDetailsCompatible) SetDob(dob time.Time) { + c.Dob = dob + c.require(clientFacingPatientDetailsCompatibleFieldDob) } -func (c *ClientFacingProviderConnectionCreatedEvent) EventType() string { - return c.eventType +// 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 (c *ClientFacingPatientDetailsCompatible) SetGender(gender string) { + c.Gender = gender + c.require(clientFacingPatientDetailsCompatibleFieldGender) } -func (c *ClientFacingProviderConnectionCreatedEvent) GetExtraProperties() map[string]interface{} { - return c.extraProperties +// 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 (c *ClientFacingPatientDetailsCompatible) SetPhoneNumber(phoneNumber *string) { + c.PhoneNumber = phoneNumber + c.require(clientFacingPatientDetailsCompatibleFieldPhoneNumber) } -func (c *ClientFacingProviderConnectionCreatedEvent) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) - } - c.explicitFields.Or(c.explicitFields, field) +// SetEmail sets the Email field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingPatientDetailsCompatible) SetEmail(email *string) { + c.Email = email + c.require(clientFacingPatientDetailsCompatibleFieldEmail) } -// SetUserId sets the UserId field and marks it as non-optional; +// SetMedicalProxy sets the MedicalProxy field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingProviderConnectionCreatedEvent) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingProviderConnectionCreatedEventFieldUserId) +func (c *ClientFacingPatientDetailsCompatible) SetMedicalProxy(medicalProxy *GuarantorDetails) { + c.MedicalProxy = medicalProxy + c.require(clientFacingPatientDetailsCompatibleFieldMedicalProxy) } -// SetClientUserId sets the ClientUserId field and marks it as non-optional; +// SetRace sets the Race field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingProviderConnectionCreatedEvent) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingProviderConnectionCreatedEventFieldClientUserId) +func (c *ClientFacingPatientDetailsCompatible) SetRace(race *Race) { + c.Race = race + c.require(clientFacingPatientDetailsCompatibleFieldRace) } -// SetTeamId sets the TeamId field and marks it as non-optional; +// SetEthnicity sets the Ethnicity field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingProviderConnectionCreatedEvent) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingProviderConnectionCreatedEventFieldTeamId) +func (c *ClientFacingPatientDetailsCompatible) SetEthnicity(ethnicity *Ethnicity) { + c.Ethnicity = ethnicity + c.require(clientFacingPatientDetailsCompatibleFieldEthnicity) } -// SetData sets the Data field and marks it as non-optional; +// SetSexualOrientation sets the SexualOrientation field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingProviderConnectionCreatedEvent) SetData(data *ProviderConnectionCreated) { - c.Data = data - c.require(clientFacingProviderConnectionCreatedEventFieldData) +func (c *ClientFacingPatientDetailsCompatible) SetSexualOrientation(sexualOrientation *SexualOrientation) { + c.SexualOrientation = sexualOrientation + c.require(clientFacingPatientDetailsCompatibleFieldSexualOrientation) } -func (c *ClientFacingProviderConnectionCreatedEvent) UnmarshalJSON(data []byte) error { - type embed ClientFacingProviderConnectionCreatedEvent +// SetGenderIdentity sets the GenderIdentity field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingPatientDetailsCompatible) SetGenderIdentity(genderIdentity *GenderIdentity) { + c.GenderIdentity = genderIdentity + c.require(clientFacingPatientDetailsCompatibleFieldGenderIdentity) +} + +func (c *ClientFacingPatientDetailsCompatible) UnmarshalJSON(data []byte) error { + type embed ClientFacingPatientDetailsCompatible var unmarshaler = struct { embed - EventType string `json:"event_type"` + Dob *internal.DateTime `json:"dob"` }{ embed: embed(*c), } if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingProviderConnectionCreatedEvent(unmarshaler.embed) - if unmarshaler.EventType != "provider.connection.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "provider.connection.created", unmarshaler.EventType) - } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + *c = ClientFacingPatientDetailsCompatible(unmarshaler.embed) + c.Dob = unmarshaler.Dob.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } @@ -16816,20 +16808,20 @@ func (c *ClientFacingProviderConnectionCreatedEvent) UnmarshalJSON(data []byte) return nil } -func (c *ClientFacingProviderConnectionCreatedEvent) MarshalJSON() ([]byte, error) { - type embed ClientFacingProviderConnectionCreatedEvent +func (c *ClientFacingPatientDetailsCompatible) MarshalJSON() ([]byte, error) { + type embed ClientFacingPatientDetailsCompatible var marshaler = struct { embed - EventType string `json:"event_type"` + Dob *internal.DateTime `json:"dob"` }{ - embed: embed(*c), - EventType: "provider.connection.created", + embed: embed(*c), + Dob: internal.NewDateTime(c.Dob), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingProviderConnectionCreatedEvent) String() string { +func (c *ClientFacingPatientDetailsCompatible) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -16841,112 +16833,299 @@ func (c *ClientFacingProviderConnectionCreatedEvent) String() string { return fmt.Sprintf("%#v", c) } +// ℹ️ This enum is non-exhaustive. +type ClientFacingPayorCodeSource string + +const ( + ClientFacingPayorCodeSourcePlatform ClientFacingPayorCodeSource = "platform" + ClientFacingPayorCodeSourceTeam ClientFacingPayorCodeSource = "team" +) + +func NewClientFacingPayorCodeSourceFromString(s string) (ClientFacingPayorCodeSource, error) { + switch s { + case "platform": + return ClientFacingPayorCodeSourcePlatform, nil + case "team": + return ClientFacingPayorCodeSourceTeam, nil + } + var t ClientFacingPayorCodeSource + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingPayorCodeSource) Ptr() *ClientFacingPayorCodeSource { + return &c +} + var ( - clientFacingProviderConnectionErrorEventFieldUserId = big.NewInt(1 << 0) - clientFacingProviderConnectionErrorEventFieldClientUserId = big.NewInt(1 << 1) - clientFacingProviderConnectionErrorEventFieldTeamId = big.NewInt(1 << 2) - clientFacingProviderConnectionErrorEventFieldData = big.NewInt(1 << 3) + clientFacingPeakExpiratoryFlowRateChangedFieldEventType = big.NewInt(1 << 0) + clientFacingPeakExpiratoryFlowRateChangedFieldUserId = big.NewInt(1 << 1) + clientFacingPeakExpiratoryFlowRateChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingPeakExpiratoryFlowRateChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingPeakExpiratoryFlowRateChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingProviderConnectionErrorEvent 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 *ProviderConnectionError `json:"data" url:"data"` +type ClientFacingPeakExpiratoryFlowRateChanged struct { + EventType ClientFacingPeakExpiratoryFlowRateChangedEventType `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 *GroupedPeakExpiratoryFlowRate `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 *ClientFacingProviderConnectionErrorEvent) GetUserId() string { +func (c *ClientFacingPeakExpiratoryFlowRateChanged) GetEventType() ClientFacingPeakExpiratoryFlowRateChangedEventType { + if c == nil { + return "" + } + return c.EventType +} + +func (c *ClientFacingPeakExpiratoryFlowRateChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingProviderConnectionErrorEvent) GetClientUserId() string { +func (c *ClientFacingPeakExpiratoryFlowRateChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingProviderConnectionErrorEvent) GetTeamId() string { +func (c *ClientFacingPeakExpiratoryFlowRateChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingProviderConnectionErrorEvent) GetData() *ProviderConnectionError { +func (c *ClientFacingPeakExpiratoryFlowRateChanged) GetData() *GroupedPeakExpiratoryFlowRate { if c == nil { return nil } return c.Data } -func (c *ClientFacingProviderConnectionErrorEvent) EventType() string { - return c.eventType -} - -func (c *ClientFacingProviderConnectionErrorEvent) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingPeakExpiratoryFlowRateChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingProviderConnectionErrorEvent) require(field *big.Int) { +func (c *ClientFacingPeakExpiratoryFlowRateChanged) 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 *ClientFacingPeakExpiratoryFlowRateChanged) SetEventType(eventType ClientFacingPeakExpiratoryFlowRateChangedEventType) { + c.EventType = eventType + c.require(clientFacingPeakExpiratoryFlowRateChangedFieldEventType) +} + // 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 *ClientFacingProviderConnectionErrorEvent) SetUserId(userId string) { +func (c *ClientFacingPeakExpiratoryFlowRateChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingProviderConnectionErrorEventFieldUserId) + c.require(clientFacingPeakExpiratoryFlowRateChangedFieldUserId) } // 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 *ClientFacingProviderConnectionErrorEvent) SetClientUserId(clientUserId string) { +func (c *ClientFacingPeakExpiratoryFlowRateChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingProviderConnectionErrorEventFieldClientUserId) + c.require(clientFacingPeakExpiratoryFlowRateChangedFieldClientUserId) } // 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 *ClientFacingProviderConnectionErrorEvent) SetTeamId(teamId string) { +func (c *ClientFacingPeakExpiratoryFlowRateChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingProviderConnectionErrorEventFieldTeamId) + c.require(clientFacingPeakExpiratoryFlowRateChangedFieldTeamId) } // 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 *ClientFacingProviderConnectionErrorEvent) SetData(data *ProviderConnectionError) { +func (c *ClientFacingPeakExpiratoryFlowRateChanged) SetData(data *GroupedPeakExpiratoryFlowRate) { c.Data = data - c.require(clientFacingProviderConnectionErrorEventFieldData) + c.require(clientFacingPeakExpiratoryFlowRateChangedFieldData) } -func (c *ClientFacingProviderConnectionErrorEvent) UnmarshalJSON(data []byte) error { - type embed ClientFacingProviderConnectionErrorEvent - var unmarshaler = struct { - embed - EventType string `json:"event_type"` +func (c *ClientFacingPeakExpiratoryFlowRateChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingPeakExpiratoryFlowRateChanged + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ClientFacingPeakExpiratoryFlowRateChanged(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingPeakExpiratoryFlowRateChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingPeakExpiratoryFlowRateChanged + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingPeakExpiratoryFlowRateChanged) 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 ClientFacingPeakExpiratoryFlowRateChangedEventType string + +const ( + ClientFacingPeakExpiratoryFlowRateChangedEventTypeDailyDataPeakExpiratoryFlowRateCreated ClientFacingPeakExpiratoryFlowRateChangedEventType = "daily.data.peak_expiratory_flow_rate.created" + ClientFacingPeakExpiratoryFlowRateChangedEventTypeDailyDataPeakExpiratoryFlowRateUpdated ClientFacingPeakExpiratoryFlowRateChangedEventType = "daily.data.peak_expiratory_flow_rate.updated" +) + +func NewClientFacingPeakExpiratoryFlowRateChangedEventTypeFromString(s string) (ClientFacingPeakExpiratoryFlowRateChangedEventType, error) { + switch s { + case "daily.data.peak_expiratory_flow_rate.created": + return ClientFacingPeakExpiratoryFlowRateChangedEventTypeDailyDataPeakExpiratoryFlowRateCreated, nil + case "daily.data.peak_expiratory_flow_rate.updated": + return ClientFacingPeakExpiratoryFlowRateChangedEventTypeDailyDataPeakExpiratoryFlowRateUpdated, nil + } + var t ClientFacingPeakExpiratoryFlowRateChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingPeakExpiratoryFlowRateChangedEventType) Ptr() *ClientFacingPeakExpiratoryFlowRateChangedEventType { + return &c +} + +var ( + clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldData = big.NewInt(1 << 3) +) + +type ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted 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 *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) GetUserId() string { + if c == nil { + return "" + } + return c.UserId +} + +func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) GetClientUserId() string { + if c == nil { + return "" + } + return c.ClientUserId +} + +func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) GetTeamId() string { + if c == nil { + return "" + } + return c.TeamId +} + +func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) GetData() *HistoricalPullCompleted { + if c == nil { + return nil + } + return c.Data +} + +func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) EventType() string { + return c.eventType +} + +func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) 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 *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldUserId) +} + +// 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 *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldClientUserId) +} + +// 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 *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldTeamId) +} + +// 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 *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { + c.Data = data + c.require(clientFacingPeakExpiratoryFlowRateHistoricalPullCompletedFieldData) +} + +func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted + var unmarshaler = struct { + embed + EventType string `json:"event_type"` }{ embed: embed(*c), } if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingProviderConnectionErrorEvent(unmarshaler.embed) - if unmarshaler.EventType != "provider.connection.error" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "provider.connection.error", unmarshaler.EventType) + *c = ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.peak_expiratory_flow_rate.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.peak_expiratory_flow_rate.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -16958,20 +17137,20 @@ func (c *ClientFacingProviderConnectionErrorEvent) UnmarshalJSON(data []byte) er return nil } -func (c *ClientFacingProviderConnectionErrorEvent) MarshalJSON() ([]byte, error) { - type embed ClientFacingProviderConnectionErrorEvent +func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "provider.connection.error", + EventType: "historical.data.peak_expiratory_flow_rate.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingProviderConnectionErrorEvent) String() string { +func (c *ClientFacingPeakExpiratoryFlowRateHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -16983,88 +17162,902 @@ func (c *ClientFacingProviderConnectionErrorEvent) String() string { return fmt.Sprintf("%#v", c) } -// ℹ️ This enum is non-exhaustive. -type ClientFacingResource string - -const ( - ClientFacingResourceProfile ClientFacingResource = "profile" - ClientFacingResourceActivity ClientFacingResource = "activity" - ClientFacingResourceSleep ClientFacingResource = "sleep" - ClientFacingResourceBody ClientFacingResource = "body" - ClientFacingResourceWorkouts ClientFacingResource = "workouts" - ClientFacingResourceWorkoutStream ClientFacingResource = "workout_stream" - ClientFacingResourceConnection ClientFacingResource = "connection" - ClientFacingResourceOrder ClientFacingResource = "order" - ClientFacingResourceResult ClientFacingResource = "result" - ClientFacingResourceAppointment ClientFacingResource = "appointment" - ClientFacingResourceGlucose ClientFacingResource = "glucose" - ClientFacingResourceHeartrate ClientFacingResource = "heartrate" - ClientFacingResourceHrv ClientFacingResource = "hrv" - ClientFacingResourceIge ClientFacingResource = "ige" - ClientFacingResourceIgg ClientFacingResource = "igg" - ClientFacingResourceBloodOxygen ClientFacingResource = "blood_oxygen" - ClientFacingResourceBloodPressure ClientFacingResource = "blood_pressure" - ClientFacingResourceCholesterol ClientFacingResource = "cholesterol" - ClientFacingResourceDevice ClientFacingResource = "device" - ClientFacingResourceDeviceLegacy ClientFacingResource = "device_legacy" - ClientFacingResourceWeight ClientFacingResource = "weight" - ClientFacingResourceFat ClientFacingResource = "fat" - ClientFacingResourceBodyTemperature ClientFacingResource = "body_temperature" - ClientFacingResourceBodyTemperatureDelta ClientFacingResource = "body_temperature_delta" - ClientFacingResourceMeal ClientFacingResource = "meal" - ClientFacingResourceWater ClientFacingResource = "water" - ClientFacingResourceCaffeine ClientFacingResource = "caffeine" - ClientFacingResourceMindfulnessMinutes ClientFacingResource = "mindfulness_minutes" - ClientFacingResourceSteps ClientFacingResource = "steps" - ClientFacingResourceCaloriesActive ClientFacingResource = "calories_active" - ClientFacingResourceDistance ClientFacingResource = "distance" - ClientFacingResourceFloorsClimbed ClientFacingResource = "floors_climbed" - ClientFacingResourceRespiratoryRate ClientFacingResource = "respiratory_rate" - ClientFacingResourceVo2Max ClientFacingResource = "vo2_max" - ClientFacingResourceCaloriesBasal ClientFacingResource = "calories_basal" - ClientFacingResourceStressLevel ClientFacingResource = "stress_level" - ClientFacingResourceMenstrualCycle ClientFacingResource = "menstrual_cycle" - ClientFacingResourceSleepCycle ClientFacingResource = "sleep_cycle" - ClientFacingResourceElectrocardiogram ClientFacingResource = "electrocardiogram" - ClientFacingResourceElectrocardiogramVoltage ClientFacingResource = "electrocardiogram_voltage" - ClientFacingResourceAfibBurden ClientFacingResource = "afib_burden" - ClientFacingResourceHeartRateAlert ClientFacingResource = "heart_rate_alert" - ClientFacingResourceStandHour ClientFacingResource = "stand_hour" - ClientFacingResourceStandDuration ClientFacingResource = "stand_duration" - ClientFacingResourceSleepApneaAlert ClientFacingResource = "sleep_apnea_alert" - ClientFacingResourceSleepBreathingDisturbance ClientFacingResource = "sleep_breathing_disturbance" - ClientFacingResourceWheelchairPush ClientFacingResource = "wheelchair_push" - ClientFacingResourceForcedExpiratoryVolume1 ClientFacingResource = "forced_expiratory_volume_1" - ClientFacingResourceForcedVitalCapacity ClientFacingResource = "forced_vital_capacity" - ClientFacingResourcePeakExpiratoryFlowRate ClientFacingResource = "peak_expiratory_flow_rate" - ClientFacingResourceInhalerUsage ClientFacingResource = "inhaler_usage" - ClientFacingResourceFall ClientFacingResource = "fall" - ClientFacingResourceUvExposure ClientFacingResource = "uv_exposure" - ClientFacingResourceDaylightExposure ClientFacingResource = "daylight_exposure" - ClientFacingResourceHandwashing ClientFacingResource = "handwashing" - ClientFacingResourceBasalBodyTemperature ClientFacingResource = "basal_body_temperature" - ClientFacingResourceHeartRateRecoveryOneMinute ClientFacingResource = "heart_rate_recovery_one_minute" - ClientFacingResourceBodyMassIndex ClientFacingResource = "body_mass_index" - ClientFacingResourceLeanBodyMass ClientFacingResource = "lean_body_mass" - ClientFacingResourceWaistCircumference ClientFacingResource = "waist_circumference" - ClientFacingResourceWorkoutDistance ClientFacingResource = "workout_distance" - ClientFacingResourceWorkoutSwimmingStroke ClientFacingResource = "workout_swimming_stroke" - ClientFacingResourceWorkoutDuration ClientFacingResource = "workout_duration" - ClientFacingResourceInsulinInjection ClientFacingResource = "insulin_injection" - ClientFacingResourceCarbohydrates ClientFacingResource = "carbohydrates" - ClientFacingResourceNote ClientFacingResource = "note" - ClientFacingResourceSleepStream ClientFacingResource = "sleep_stream" - ClientFacingResourceHypnogram ClientFacingResource = "hypnogram" +var ( + clientFacingPhysicianFieldFirstName = big.NewInt(1 << 0) + clientFacingPhysicianFieldLastName = big.NewInt(1 << 1) + clientFacingPhysicianFieldNpi = big.NewInt(1 << 2) ) -func NewClientFacingResourceFromString(s string) (ClientFacingResource, error) { - switch s { - case "profile": - return ClientFacingResourceProfile, nil - case "activity": - return ClientFacingResourceActivity, nil - case "sleep": - return ClientFacingResourceSleep, nil +type ClientFacingPhysician struct { + FirstName string `json:"first_name" url:"first_name"` + LastName string `json:"last_name" url:"last_name"` + Npi string `json:"npi" url:"npi"` + + // 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 *ClientFacingPhysician) GetFirstName() string { + if c == nil { + return "" + } + return c.FirstName +} + +func (c *ClientFacingPhysician) GetLastName() string { + if c == nil { + return "" + } + return c.LastName +} + +func (c *ClientFacingPhysician) GetNpi() string { + if c == nil { + return "" + } + return c.Npi +} + +func (c *ClientFacingPhysician) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingPhysician) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingPhysician) SetFirstName(firstName string) { + c.FirstName = firstName + c.require(clientFacingPhysicianFieldFirstName) +} + +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingPhysician) SetLastName(lastName string) { + c.LastName = lastName + c.require(clientFacingPhysicianFieldLastName) +} + +// SetNpi sets the Npi field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingPhysician) SetNpi(npi string) { + c.Npi = npi + c.require(clientFacingPhysicianFieldNpi) +} + +func (c *ClientFacingPhysician) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingPhysician + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ClientFacingPhysician(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingPhysician) MarshalJSON() ([]byte, error) { + type embed ClientFacingPhysician + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingPhysician) 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 ( + clientFacingProfileChangedFieldEventType = big.NewInt(1 << 0) + clientFacingProfileChangedFieldUserId = big.NewInt(1 << 1) + clientFacingProfileChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingProfileChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingProfileChangedFieldData = big.NewInt(1 << 4) +) + +type ClientFacingProfileChanged struct { + EventType ClientFacingProfileChangedEventType `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 *ClientFacingProfile `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 *ClientFacingProfileChanged) GetEventType() ClientFacingProfileChangedEventType { + if c == nil { + return "" + } + return c.EventType +} + +func (c *ClientFacingProfileChanged) GetUserId() string { + if c == nil { + return "" + } + return c.UserId +} + +func (c *ClientFacingProfileChanged) GetClientUserId() string { + if c == nil { + return "" + } + return c.ClientUserId +} + +func (c *ClientFacingProfileChanged) GetTeamId() string { + if c == nil { + return "" + } + return c.TeamId +} + +func (c *ClientFacingProfileChanged) GetData() *ClientFacingProfile { + if c == nil { + return nil + } + return c.Data +} + +func (c *ClientFacingProfileChanged) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingProfileChanged) 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 *ClientFacingProfileChanged) SetEventType(eventType ClientFacingProfileChangedEventType) { + c.EventType = eventType + c.require(clientFacingProfileChangedFieldEventType) +} + +// 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 *ClientFacingProfileChanged) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingProfileChangedFieldUserId) +} + +// 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 *ClientFacingProfileChanged) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingProfileChangedFieldClientUserId) +} + +// 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 *ClientFacingProfileChanged) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingProfileChangedFieldTeamId) +} + +// 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 *ClientFacingProfileChanged) SetData(data *ClientFacingProfile) { + c.Data = data + c.require(clientFacingProfileChangedFieldData) +} + +func (c *ClientFacingProfileChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingProfileChanged + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ClientFacingProfileChanged(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingProfileChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingProfileChanged + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingProfileChanged) 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 ClientFacingProfileChangedEventType string + +const ( + ClientFacingProfileChangedEventTypeDailyDataProfileCreated ClientFacingProfileChangedEventType = "daily.data.profile.created" + ClientFacingProfileChangedEventTypeDailyDataProfileUpdated ClientFacingProfileChangedEventType = "daily.data.profile.updated" +) + +func NewClientFacingProfileChangedEventTypeFromString(s string) (ClientFacingProfileChangedEventType, error) { + switch s { + case "daily.data.profile.created": + return ClientFacingProfileChangedEventTypeDailyDataProfileCreated, nil + case "daily.data.profile.updated": + return ClientFacingProfileChangedEventTypeDailyDataProfileUpdated, nil + } + var t ClientFacingProfileChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingProfileChangedEventType) Ptr() *ClientFacingProfileChangedEventType { + return &c +} + +var ( + clientFacingProfileHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingProfileHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingProfileHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingProfileHistoricalPullCompletedFieldData = big.NewInt(1 << 3) +) + +type ClientFacingProfileHistoricalPullCompleted 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 *ClientFacingProfileHistoricalPullCompleted) GetUserId() string { + if c == nil { + return "" + } + return c.UserId +} + +func (c *ClientFacingProfileHistoricalPullCompleted) GetClientUserId() string { + if c == nil { + return "" + } + return c.ClientUserId +} + +func (c *ClientFacingProfileHistoricalPullCompleted) GetTeamId() string { + if c == nil { + return "" + } + return c.TeamId +} + +func (c *ClientFacingProfileHistoricalPullCompleted) GetData() *HistoricalPullCompleted { + if c == nil { + return nil + } + return c.Data +} + +func (c *ClientFacingProfileHistoricalPullCompleted) EventType() string { + return c.eventType +} + +func (c *ClientFacingProfileHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingProfileHistoricalPullCompleted) 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 *ClientFacingProfileHistoricalPullCompleted) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingProfileHistoricalPullCompletedFieldUserId) +} + +// 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 *ClientFacingProfileHistoricalPullCompleted) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingProfileHistoricalPullCompletedFieldClientUserId) +} + +// 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 *ClientFacingProfileHistoricalPullCompleted) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingProfileHistoricalPullCompletedFieldTeamId) +} + +// 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 *ClientFacingProfileHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { + c.Data = data + c.require(clientFacingProfileHistoricalPullCompletedFieldData) +} + +func (c *ClientFacingProfileHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingProfileHistoricalPullCompleted + var unmarshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *c = ClientFacingProfileHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.profile.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.profile.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingProfileHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingProfileHistoricalPullCompleted + var marshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + EventType: "historical.data.profile.created", + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingProfileHistoricalPullCompleted) 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) +} + +// A vendor, a service, or a platform which Vital can connect with. +var ( + clientFacingProviderFieldName = big.NewInt(1 << 0) + clientFacingProviderFieldSlug = big.NewInt(1 << 1) + clientFacingProviderFieldLogo = big.NewInt(1 << 2) +) + +type ClientFacingProvider struct { + // Name of source of information + Name string `json:"name" url:"name"` + // Slug for designated source + Slug string `json:"slug" url:"slug"` + // URL for source logo + Logo string `json:"logo" url:"logo"` + + // 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 *ClientFacingProvider) GetName() string { + if c == nil { + return "" + } + return c.Name +} + +func (c *ClientFacingProvider) GetSlug() string { + if c == nil { + return "" + } + return c.Slug +} + +func (c *ClientFacingProvider) GetLogo() string { + if c == nil { + return "" + } + return c.Logo +} + +func (c *ClientFacingProvider) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingProvider) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.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 (c *ClientFacingProvider) SetName(name string) { + c.Name = name + c.require(clientFacingProviderFieldName) +} + +// 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 *ClientFacingProvider) SetSlug(slug string) { + c.Slug = slug + c.require(clientFacingProviderFieldSlug) +} + +// SetLogo sets the Logo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingProvider) SetLogo(logo string) { + c.Logo = logo + c.require(clientFacingProviderFieldLogo) +} + +func (c *ClientFacingProvider) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingProvider + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ClientFacingProvider(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingProvider) MarshalJSON() ([]byte, error) { + type embed ClientFacingProvider + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingProvider) 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 ( + clientFacingProviderConnectionCreatedEventFieldUserId = big.NewInt(1 << 0) + clientFacingProviderConnectionCreatedEventFieldClientUserId = big.NewInt(1 << 1) + clientFacingProviderConnectionCreatedEventFieldTeamId = big.NewInt(1 << 2) + clientFacingProviderConnectionCreatedEventFieldData = big.NewInt(1 << 3) +) + +type ClientFacingProviderConnectionCreatedEvent 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 *ProviderConnectionCreated `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 *ClientFacingProviderConnectionCreatedEvent) GetUserId() string { + if c == nil { + return "" + } + return c.UserId +} + +func (c *ClientFacingProviderConnectionCreatedEvent) GetClientUserId() string { + if c == nil { + return "" + } + return c.ClientUserId +} + +func (c *ClientFacingProviderConnectionCreatedEvent) GetTeamId() string { + if c == nil { + return "" + } + return c.TeamId +} + +func (c *ClientFacingProviderConnectionCreatedEvent) GetData() *ProviderConnectionCreated { + if c == nil { + return nil + } + return c.Data +} + +func (c *ClientFacingProviderConnectionCreatedEvent) EventType() string { + return c.eventType +} + +func (c *ClientFacingProviderConnectionCreatedEvent) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingProviderConnectionCreatedEvent) 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 *ClientFacingProviderConnectionCreatedEvent) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingProviderConnectionCreatedEventFieldUserId) +} + +// 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 *ClientFacingProviderConnectionCreatedEvent) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingProviderConnectionCreatedEventFieldClientUserId) +} + +// 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 *ClientFacingProviderConnectionCreatedEvent) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingProviderConnectionCreatedEventFieldTeamId) +} + +// 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 *ClientFacingProviderConnectionCreatedEvent) SetData(data *ProviderConnectionCreated) { + c.Data = data + c.require(clientFacingProviderConnectionCreatedEventFieldData) +} + +func (c *ClientFacingProviderConnectionCreatedEvent) UnmarshalJSON(data []byte) error { + type embed ClientFacingProviderConnectionCreatedEvent + var unmarshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *c = ClientFacingProviderConnectionCreatedEvent(unmarshaler.embed) + if unmarshaler.EventType != "provider.connection.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "provider.connection.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingProviderConnectionCreatedEvent) MarshalJSON() ([]byte, error) { + type embed ClientFacingProviderConnectionCreatedEvent + var marshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + EventType: "provider.connection.created", + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingProviderConnectionCreatedEvent) 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 ( + clientFacingProviderConnectionErrorEventFieldUserId = big.NewInt(1 << 0) + clientFacingProviderConnectionErrorEventFieldClientUserId = big.NewInt(1 << 1) + clientFacingProviderConnectionErrorEventFieldTeamId = big.NewInt(1 << 2) + clientFacingProviderConnectionErrorEventFieldData = big.NewInt(1 << 3) +) + +type ClientFacingProviderConnectionErrorEvent 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 *ProviderConnectionError `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 *ClientFacingProviderConnectionErrorEvent) GetUserId() string { + if c == nil { + return "" + } + return c.UserId +} + +func (c *ClientFacingProviderConnectionErrorEvent) GetClientUserId() string { + if c == nil { + return "" + } + return c.ClientUserId +} + +func (c *ClientFacingProviderConnectionErrorEvent) GetTeamId() string { + if c == nil { + return "" + } + return c.TeamId +} + +func (c *ClientFacingProviderConnectionErrorEvent) GetData() *ProviderConnectionError { + if c == nil { + return nil + } + return c.Data +} + +func (c *ClientFacingProviderConnectionErrorEvent) EventType() string { + return c.eventType +} + +func (c *ClientFacingProviderConnectionErrorEvent) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingProviderConnectionErrorEvent) 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 *ClientFacingProviderConnectionErrorEvent) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingProviderConnectionErrorEventFieldUserId) +} + +// 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 *ClientFacingProviderConnectionErrorEvent) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingProviderConnectionErrorEventFieldClientUserId) +} + +// 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 *ClientFacingProviderConnectionErrorEvent) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingProviderConnectionErrorEventFieldTeamId) +} + +// 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 *ClientFacingProviderConnectionErrorEvent) SetData(data *ProviderConnectionError) { + c.Data = data + c.require(clientFacingProviderConnectionErrorEventFieldData) +} + +func (c *ClientFacingProviderConnectionErrorEvent) UnmarshalJSON(data []byte) error { + type embed ClientFacingProviderConnectionErrorEvent + var unmarshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *c = ClientFacingProviderConnectionErrorEvent(unmarshaler.embed) + if unmarshaler.EventType != "provider.connection.error" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "provider.connection.error", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingProviderConnectionErrorEvent) MarshalJSON() ([]byte, error) { + type embed ClientFacingProviderConnectionErrorEvent + var marshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + EventType: "provider.connection.error", + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingProviderConnectionErrorEvent) 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 ClientFacingResource string + +const ( + ClientFacingResourceProfile ClientFacingResource = "profile" + ClientFacingResourceActivity ClientFacingResource = "activity" + ClientFacingResourceSleep ClientFacingResource = "sleep" + ClientFacingResourceBody ClientFacingResource = "body" + ClientFacingResourceWorkouts ClientFacingResource = "workouts" + ClientFacingResourceWorkoutStream ClientFacingResource = "workout_stream" + ClientFacingResourceConnection ClientFacingResource = "connection" + ClientFacingResourceOrder ClientFacingResource = "order" + ClientFacingResourceResult ClientFacingResource = "result" + ClientFacingResourceAppointment ClientFacingResource = "appointment" + ClientFacingResourceGlucose ClientFacingResource = "glucose" + ClientFacingResourceHeartrate ClientFacingResource = "heartrate" + ClientFacingResourceHrv ClientFacingResource = "hrv" + ClientFacingResourceIge ClientFacingResource = "ige" + ClientFacingResourceIgg ClientFacingResource = "igg" + ClientFacingResourceBloodOxygen ClientFacingResource = "blood_oxygen" + ClientFacingResourceBloodPressure ClientFacingResource = "blood_pressure" + ClientFacingResourceCholesterol ClientFacingResource = "cholesterol" + ClientFacingResourceDevice ClientFacingResource = "device" + ClientFacingResourceDeviceLegacy ClientFacingResource = "device_legacy" + ClientFacingResourceWeight ClientFacingResource = "weight" + ClientFacingResourceFat ClientFacingResource = "fat" + ClientFacingResourceBodyTemperature ClientFacingResource = "body_temperature" + ClientFacingResourceBodyTemperatureDelta ClientFacingResource = "body_temperature_delta" + ClientFacingResourceMeal ClientFacingResource = "meal" + ClientFacingResourceWater ClientFacingResource = "water" + ClientFacingResourceCaffeine ClientFacingResource = "caffeine" + ClientFacingResourceMindfulnessMinutes ClientFacingResource = "mindfulness_minutes" + ClientFacingResourceSteps ClientFacingResource = "steps" + ClientFacingResourceCaloriesActive ClientFacingResource = "calories_active" + ClientFacingResourceDistance ClientFacingResource = "distance" + ClientFacingResourceFloorsClimbed ClientFacingResource = "floors_climbed" + ClientFacingResourceRespiratoryRate ClientFacingResource = "respiratory_rate" + ClientFacingResourceVo2Max ClientFacingResource = "vo2_max" + ClientFacingResourceCaloriesBasal ClientFacingResource = "calories_basal" + ClientFacingResourceStressLevel ClientFacingResource = "stress_level" + ClientFacingResourceMenstrualCycle ClientFacingResource = "menstrual_cycle" + ClientFacingResourceSleepCycle ClientFacingResource = "sleep_cycle" + ClientFacingResourceElectrocardiogram ClientFacingResource = "electrocardiogram" + ClientFacingResourceElectrocardiogramVoltage ClientFacingResource = "electrocardiogram_voltage" + ClientFacingResourceAfibBurden ClientFacingResource = "afib_burden" + ClientFacingResourceHeartRateAlert ClientFacingResource = "heart_rate_alert" + ClientFacingResourceStandHour ClientFacingResource = "stand_hour" + ClientFacingResourceStandDuration ClientFacingResource = "stand_duration" + ClientFacingResourceSleepApneaAlert ClientFacingResource = "sleep_apnea_alert" + ClientFacingResourceSleepBreathingDisturbance ClientFacingResource = "sleep_breathing_disturbance" + ClientFacingResourceWheelchairPush ClientFacingResource = "wheelchair_push" + ClientFacingResourceForcedExpiratoryVolume1 ClientFacingResource = "forced_expiratory_volume_1" + ClientFacingResourceForcedVitalCapacity ClientFacingResource = "forced_vital_capacity" + ClientFacingResourcePeakExpiratoryFlowRate ClientFacingResource = "peak_expiratory_flow_rate" + ClientFacingResourceInhalerUsage ClientFacingResource = "inhaler_usage" + ClientFacingResourceFall ClientFacingResource = "fall" + ClientFacingResourceUvExposure ClientFacingResource = "uv_exposure" + ClientFacingResourceDaylightExposure ClientFacingResource = "daylight_exposure" + ClientFacingResourceHandwashing ClientFacingResource = "handwashing" + ClientFacingResourceBasalBodyTemperature ClientFacingResource = "basal_body_temperature" + ClientFacingResourceHeartRateRecoveryOneMinute ClientFacingResource = "heart_rate_recovery_one_minute" + ClientFacingResourceBodyMassIndex ClientFacingResource = "body_mass_index" + ClientFacingResourceLeanBodyMass ClientFacingResource = "lean_body_mass" + ClientFacingResourceWaistCircumference ClientFacingResource = "waist_circumference" + ClientFacingResourceWorkoutDistance ClientFacingResource = "workout_distance" + ClientFacingResourceWorkoutSwimmingStroke ClientFacingResource = "workout_swimming_stroke" + ClientFacingResourceWorkoutDuration ClientFacingResource = "workout_duration" + ClientFacingResourceInsulinInjection ClientFacingResource = "insulin_injection" + ClientFacingResourceCarbohydrates ClientFacingResource = "carbohydrates" + ClientFacingResourceNote ClientFacingResource = "note" + ClientFacingResourceSleepStream ClientFacingResource = "sleep_stream" + ClientFacingResourceHypnogram ClientFacingResource = "hypnogram" +) + +func NewClientFacingResourceFromString(s string) (ClientFacingResource, error) { + switch s { + case "profile": + return ClientFacingResourceProfile, nil + case "activity": + return ClientFacingResourceActivity, nil + case "sleep": + return ClientFacingResourceSleep, nil case "body": return ClientFacingResourceBody, nil case "workouts": @@ -17196,28 +18189,684 @@ func NewClientFacingResourceFromString(s string) (ClientFacingResource, error) { case "hypnogram": return ClientFacingResourceHypnogram, nil } - var t ClientFacingResource - return "", fmt.Errorf("%s is not a valid %T", s, t) + var t ClientFacingResource + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingResource) Ptr() *ClientFacingResource { + return &c +} + +var ( + clientFacingRespiratoryRateChangedFieldEventType = big.NewInt(1 << 0) + clientFacingRespiratoryRateChangedFieldUserId = big.NewInt(1 << 1) + clientFacingRespiratoryRateChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingRespiratoryRateChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingRespiratoryRateChangedFieldData = big.NewInt(1 << 4) +) + +type ClientFacingRespiratoryRateChanged struct { + EventType ClientFacingRespiratoryRateChangedEventType `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 *GroupedRespiratoryRate `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 *ClientFacingRespiratoryRateChanged) GetEventType() ClientFacingRespiratoryRateChangedEventType { + if c == nil { + return "" + } + return c.EventType +} + +func (c *ClientFacingRespiratoryRateChanged) GetUserId() string { + if c == nil { + return "" + } + return c.UserId +} + +func (c *ClientFacingRespiratoryRateChanged) GetClientUserId() string { + if c == nil { + return "" + } + return c.ClientUserId +} + +func (c *ClientFacingRespiratoryRateChanged) GetTeamId() string { + if c == nil { + return "" + } + return c.TeamId +} + +func (c *ClientFacingRespiratoryRateChanged) GetData() *GroupedRespiratoryRate { + if c == nil { + return nil + } + return c.Data +} + +func (c *ClientFacingRespiratoryRateChanged) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingRespiratoryRateChanged) 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 *ClientFacingRespiratoryRateChanged) SetEventType(eventType ClientFacingRespiratoryRateChangedEventType) { + c.EventType = eventType + c.require(clientFacingRespiratoryRateChangedFieldEventType) +} + +// 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 *ClientFacingRespiratoryRateChanged) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingRespiratoryRateChangedFieldUserId) +} + +// 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 *ClientFacingRespiratoryRateChanged) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingRespiratoryRateChangedFieldClientUserId) +} + +// 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 *ClientFacingRespiratoryRateChanged) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingRespiratoryRateChangedFieldTeamId) +} + +// 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 *ClientFacingRespiratoryRateChanged) SetData(data *GroupedRespiratoryRate) { + c.Data = data + c.require(clientFacingRespiratoryRateChangedFieldData) +} + +func (c *ClientFacingRespiratoryRateChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingRespiratoryRateChanged + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ClientFacingRespiratoryRateChanged(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingRespiratoryRateChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingRespiratoryRateChanged + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingRespiratoryRateChanged) 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 ClientFacingRespiratoryRateChangedEventType string + +const ( + ClientFacingRespiratoryRateChangedEventTypeDailyDataRespiratoryRateCreated ClientFacingRespiratoryRateChangedEventType = "daily.data.respiratory_rate.created" + ClientFacingRespiratoryRateChangedEventTypeDailyDataRespiratoryRateUpdated ClientFacingRespiratoryRateChangedEventType = "daily.data.respiratory_rate.updated" +) + +func NewClientFacingRespiratoryRateChangedEventTypeFromString(s string) (ClientFacingRespiratoryRateChangedEventType, error) { + switch s { + case "daily.data.respiratory_rate.created": + return ClientFacingRespiratoryRateChangedEventTypeDailyDataRespiratoryRateCreated, nil + case "daily.data.respiratory_rate.updated": + return ClientFacingRespiratoryRateChangedEventTypeDailyDataRespiratoryRateUpdated, nil + } + var t ClientFacingRespiratoryRateChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingRespiratoryRateChangedEventType) Ptr() *ClientFacingRespiratoryRateChangedEventType { + return &c +} + +var ( + clientFacingRespiratoryRateHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingRespiratoryRateHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingRespiratoryRateHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingRespiratoryRateHistoricalPullCompletedFieldData = big.NewInt(1 << 3) +) + +type ClientFacingRespiratoryRateHistoricalPullCompleted 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 *ClientFacingRespiratoryRateHistoricalPullCompleted) GetUserId() string { + if c == nil { + return "" + } + return c.UserId +} + +func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) GetClientUserId() string { + if c == nil { + return "" + } + return c.ClientUserId +} + +func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) GetTeamId() string { + if c == nil { + return "" + } + return c.TeamId +} + +func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) GetData() *HistoricalPullCompleted { + if c == nil { + return nil + } + return c.Data +} + +func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) EventType() string { + return c.eventType +} + +func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) 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 *ClientFacingRespiratoryRateHistoricalPullCompleted) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingRespiratoryRateHistoricalPullCompletedFieldUserId) +} + +// 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 *ClientFacingRespiratoryRateHistoricalPullCompleted) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingRespiratoryRateHistoricalPullCompletedFieldClientUserId) +} + +// 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 *ClientFacingRespiratoryRateHistoricalPullCompleted) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingRespiratoryRateHistoricalPullCompletedFieldTeamId) +} + +// 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 *ClientFacingRespiratoryRateHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { + c.Data = data + c.require(clientFacingRespiratoryRateHistoricalPullCompletedFieldData) +} + +func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingRespiratoryRateHistoricalPullCompleted + var unmarshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *c = ClientFacingRespiratoryRateHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.respiratory_rate.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.respiratory_rate.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingRespiratoryRateHistoricalPullCompleted + var marshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + EventType: "historical.data.respiratory_rate.created", + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) 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 ( + clientFacingRespiratoryRateTimeseriesFieldId = big.NewInt(1 << 0) + clientFacingRespiratoryRateTimeseriesFieldTimezoneOffset = big.NewInt(1 << 1) + clientFacingRespiratoryRateTimeseriesFieldType = big.NewInt(1 << 2) + clientFacingRespiratoryRateTimeseriesFieldUnit = big.NewInt(1 << 3) + clientFacingRespiratoryRateTimeseriesFieldTimestamp = big.NewInt(1 << 4) + clientFacingRespiratoryRateTimeseriesFieldValue = big.NewInt(1 << 5) +) + +type ClientFacingRespiratoryRateTimeseries struct { + // Deprecated + Id *int `json:"id,omitempty" url:"id,omitempty"` + // Time zone UTC offset in seconds. Positive offset indicates east of UTC; negative offset indicates west of UTC; and null indicates the time zone information is unavailable at source. + TimezoneOffset *int `json:"timezone_offset,omitempty" url:"timezone_offset,omitempty"` + // Type is always null for this resource. + Type *string `json:"type,omitempty" url:"type,omitempty"` + // Measured in bpm. + Unit string `json:"unit" url:"unit"` + // The timestamp of the measurement. + Timestamp time.Time `json:"timestamp" url:"timestamp"` + // Average respiratory rate::breaths per minute + Value float64 `json:"value" url:"value"` + + // 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 *ClientFacingRespiratoryRateTimeseries) GetId() *int { + if c == nil { + return nil + } + return c.Id +} + +func (c *ClientFacingRespiratoryRateTimeseries) GetTimezoneOffset() *int { + if c == nil { + return nil + } + return c.TimezoneOffset +} + +func (c *ClientFacingRespiratoryRateTimeseries) GetType() *string { + if c == nil { + return nil + } + return c.Type +} + +func (c *ClientFacingRespiratoryRateTimeseries) GetUnit() string { + if c == nil { + return "" + } + return c.Unit +} + +func (c *ClientFacingRespiratoryRateTimeseries) GetTimestamp() time.Time { + if c == nil { + return time.Time{} + } + return c.Timestamp +} + +func (c *ClientFacingRespiratoryRateTimeseries) GetValue() float64 { + if c == nil { + return 0 + } + return c.Value +} + +func (c *ClientFacingRespiratoryRateTimeseries) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingRespiratoryRateTimeseries) 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 *ClientFacingRespiratoryRateTimeseries) SetId(id *int) { + c.Id = id + c.require(clientFacingRespiratoryRateTimeseriesFieldId) +} + +// 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 (c *ClientFacingRespiratoryRateTimeseries) SetTimezoneOffset(timezoneOffset *int) { + c.TimezoneOffset = timezoneOffset + c.require(clientFacingRespiratoryRateTimeseriesFieldTimezoneOffset) +} + +// 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 *ClientFacingRespiratoryRateTimeseries) SetType(type_ *string) { + c.Type = type_ + c.require(clientFacingRespiratoryRateTimeseriesFieldType) +} + +// 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 *ClientFacingRespiratoryRateTimeseries) SetUnit(unit string) { + c.Unit = unit + c.require(clientFacingRespiratoryRateTimeseriesFieldUnit) +} + +// 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 (c *ClientFacingRespiratoryRateTimeseries) SetTimestamp(timestamp time.Time) { + c.Timestamp = timestamp + c.require(clientFacingRespiratoryRateTimeseriesFieldTimestamp) +} + +// SetValue sets the Value field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingRespiratoryRateTimeseries) SetValue(value float64) { + c.Value = value + c.require(clientFacingRespiratoryRateTimeseriesFieldValue) +} + +func (c *ClientFacingRespiratoryRateTimeseries) UnmarshalJSON(data []byte) error { + type embed ClientFacingRespiratoryRateTimeseries + var unmarshaler = struct { + embed + Timestamp *internal.DateTime `json:"timestamp"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *c = ClientFacingRespiratoryRateTimeseries(unmarshaler.embed) + c.Timestamp = unmarshaler.Timestamp.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingRespiratoryRateTimeseries) MarshalJSON() ([]byte, error) { + type embed ClientFacingRespiratoryRateTimeseries + var marshaler = struct { + embed + Timestamp *internal.DateTime `json:"timestamp"` + }{ + embed: embed(*c), + Timestamp: internal.NewDateTime(c.Timestamp), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingRespiratoryRateTimeseries) 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 ( + clientFacingShallowWorkoutStreamFieldUserId = big.NewInt(1 << 0) + clientFacingShallowWorkoutStreamFieldWorkoutId = big.NewInt(1 << 1) + clientFacingShallowWorkoutStreamFieldProviderId = big.NewInt(1 << 2) + clientFacingShallowWorkoutStreamFieldMessage = big.NewInt(1 << 3) + clientFacingShallowWorkoutStreamFieldSource = big.NewInt(1 << 4) + clientFacingShallowWorkoutStreamFieldSport = big.NewInt(1 << 5) +) + +type ClientFacingShallowWorkoutStream 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"` + WorkoutId string `json:"workout_id" url:"workout_id"` + ProviderId string `json:"provider_id" url:"provider_id"` + Message *string `json:"message,omitempty" url:"message,omitempty"` + // Source the data has come from. + Source *ClientFacingSource `json:"source" url:"source"` + // Sport's name + Sport *ClientFacingSport `json:"sport,omitempty" url:"sport,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 *ClientFacingShallowWorkoutStream) GetUserId() string { + if c == nil { + return "" + } + return c.UserId +} + +func (c *ClientFacingShallowWorkoutStream) GetWorkoutId() string { + if c == nil { + return "" + } + return c.WorkoutId +} + +func (c *ClientFacingShallowWorkoutStream) GetProviderId() string { + if c == nil { + return "" + } + return c.ProviderId +} + +func (c *ClientFacingShallowWorkoutStream) GetMessage() *string { + if c == nil { + return nil + } + return c.Message +} + +func (c *ClientFacingShallowWorkoutStream) GetSource() *ClientFacingSource { + if c == nil { + return nil + } + return c.Source +} + +func (c *ClientFacingShallowWorkoutStream) GetSport() *ClientFacingSport { + if c == nil { + return nil + } + return c.Sport +} + +func (c *ClientFacingShallowWorkoutStream) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingShallowWorkoutStream) 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 *ClientFacingShallowWorkoutStream) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingShallowWorkoutStreamFieldUserId) +} + +// SetWorkoutId sets the WorkoutId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingShallowWorkoutStream) SetWorkoutId(workoutId string) { + c.WorkoutId = workoutId + c.require(clientFacingShallowWorkoutStreamFieldWorkoutId) +} + +// 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 *ClientFacingShallowWorkoutStream) SetProviderId(providerId string) { + c.ProviderId = providerId + c.require(clientFacingShallowWorkoutStreamFieldProviderId) +} + +// SetMessage sets the Message field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingShallowWorkoutStream) SetMessage(message *string) { + c.Message = message + c.require(clientFacingShallowWorkoutStreamFieldMessage) +} + +// SetSource sets the Source field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingShallowWorkoutStream) SetSource(source *ClientFacingSource) { + c.Source = source + c.require(clientFacingShallowWorkoutStreamFieldSource) +} + +// SetSport sets the Sport field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingShallowWorkoutStream) SetSport(sport *ClientFacingSport) { + c.Sport = sport + c.require(clientFacingShallowWorkoutStreamFieldSport) +} + +func (c *ClientFacingShallowWorkoutStream) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingShallowWorkoutStream + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ClientFacingShallowWorkoutStream(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil } -func (c ClientFacingResource) Ptr() *ClientFacingResource { - return &c +func (c *ClientFacingShallowWorkoutStream) MarshalJSON() ([]byte, error) { + type embed ClientFacingShallowWorkoutStream + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingShallowWorkoutStream) 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) } +// Schema for a Shipment in the client facing API. +// +// To be used as part of a ClientFacingTestkitOrder. var ( - clientFacingRespiratoryRateChangedFieldEventType = big.NewInt(1 << 0) - clientFacingRespiratoryRateChangedFieldUserId = big.NewInt(1 << 1) - clientFacingRespiratoryRateChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingRespiratoryRateChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingRespiratoryRateChangedFieldData = big.NewInt(1 << 4) + clientFacingShipmentFieldId = big.NewInt(1 << 0) + clientFacingShipmentFieldOutboundTrackingNumber = big.NewInt(1 << 1) + clientFacingShipmentFieldOutboundTrackingUrl = big.NewInt(1 << 2) + clientFacingShipmentFieldInboundTrackingNumber = big.NewInt(1 << 3) + clientFacingShipmentFieldInboundTrackingUrl = big.NewInt(1 << 4) + clientFacingShipmentFieldOutboundCourier = big.NewInt(1 << 5) + clientFacingShipmentFieldInboundCourier = big.NewInt(1 << 6) + clientFacingShipmentFieldNotes = big.NewInt(1 << 7) ) -type ClientFacingRespiratoryRateChanged struct { - EventType ClientFacingRespiratoryRateChangedEventType `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 *GroupedRespiratoryRate `json:"data" url:"data"` +type ClientFacingShipment struct { + // The Vital Shipment ID + Id string `json:"id" url:"id"` + // Tracking number for delivery to customer + OutboundTrackingNumber *string `json:"outbound_tracking_number,omitempty" url:"outbound_tracking_number,omitempty"` + // Tracking url for delivery to customer + OutboundTrackingUrl *string `json:"outbound_tracking_url,omitempty" url:"outbound_tracking_url,omitempty"` + // Tracking number for delivery to lab + InboundTrackingNumber *string `json:"inbound_tracking_number,omitempty" url:"inbound_tracking_number,omitempty"` + // Tracking url for delivery to lab + InboundTrackingUrl *string `json:"inbound_tracking_url,omitempty" url:"inbound_tracking_url,omitempty"` + // Courier used for delivery to customer + OutboundCourier *string `json:"outbound_courier,omitempty" url:"outbound_courier,omitempty"` + // Courier used for delivery to lab + InboundCourier *string `json:"inbound_courier,omitempty" url:"inbound_courier,omitempty"` + // Notes associated to the Vital shipment + Notes *string `json:"notes,omitempty" url:"notes,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -17226,94 +18875,136 @@ type ClientFacingRespiratoryRateChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingRespiratoryRateChanged) GetEventType() ClientFacingRespiratoryRateChangedEventType { +func (c *ClientFacingShipment) GetId() string { if c == nil { return "" } - return c.EventType + return c.Id } -func (c *ClientFacingRespiratoryRateChanged) GetUserId() string { +func (c *ClientFacingShipment) GetOutboundTrackingNumber() *string { if c == nil { - return "" + return nil } - return c.UserId + return c.OutboundTrackingNumber } -func (c *ClientFacingRespiratoryRateChanged) GetClientUserId() string { +func (c *ClientFacingShipment) GetOutboundTrackingUrl() *string { if c == nil { - return "" + return nil } - return c.ClientUserId + return c.OutboundTrackingUrl } -func (c *ClientFacingRespiratoryRateChanged) GetTeamId() string { +func (c *ClientFacingShipment) GetInboundTrackingNumber() *string { if c == nil { - return "" + return nil } - return c.TeamId + return c.InboundTrackingNumber } -func (c *ClientFacingRespiratoryRateChanged) GetData() *GroupedRespiratoryRate { +func (c *ClientFacingShipment) GetInboundTrackingUrl() *string { if c == nil { return nil } - return c.Data + return c.InboundTrackingUrl } -func (c *ClientFacingRespiratoryRateChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingShipment) GetOutboundCourier() *string { + if c == nil { + return nil + } + return c.OutboundCourier +} + +func (c *ClientFacingShipment) GetInboundCourier() *string { + if c == nil { + return nil + } + return c.InboundCourier +} + +func (c *ClientFacingShipment) GetNotes() *string { + if c == nil { + return nil + } + return c.Notes +} + +func (c *ClientFacingShipment) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingRespiratoryRateChanged) require(field *big.Int) { +func (c *ClientFacingShipment) 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; +// 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 *ClientFacingRespiratoryRateChanged) SetEventType(eventType ClientFacingRespiratoryRateChangedEventType) { - c.EventType = eventType - c.require(clientFacingRespiratoryRateChangedFieldEventType) +func (c *ClientFacingShipment) SetId(id string) { + c.Id = id + c.require(clientFacingShipmentFieldId) } -// SetUserId sets the UserId field and marks it as non-optional; +// SetOutboundTrackingNumber sets the OutboundTrackingNumber field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingRespiratoryRateChanged) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingRespiratoryRateChangedFieldUserId) +func (c *ClientFacingShipment) SetOutboundTrackingNumber(outboundTrackingNumber *string) { + c.OutboundTrackingNumber = outboundTrackingNumber + c.require(clientFacingShipmentFieldOutboundTrackingNumber) } -// SetClientUserId sets the ClientUserId field and marks it as non-optional; +// SetOutboundTrackingUrl sets the OutboundTrackingUrl field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingRespiratoryRateChanged) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingRespiratoryRateChangedFieldClientUserId) +func (c *ClientFacingShipment) SetOutboundTrackingUrl(outboundTrackingUrl *string) { + c.OutboundTrackingUrl = outboundTrackingUrl + c.require(clientFacingShipmentFieldOutboundTrackingUrl) } -// SetTeamId sets the TeamId field and marks it as non-optional; +// SetInboundTrackingNumber sets the InboundTrackingNumber field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingRespiratoryRateChanged) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingRespiratoryRateChangedFieldTeamId) +func (c *ClientFacingShipment) SetInboundTrackingNumber(inboundTrackingNumber *string) { + c.InboundTrackingNumber = inboundTrackingNumber + c.require(clientFacingShipmentFieldInboundTrackingNumber) } -// SetData sets the Data field and marks it as non-optional; +// SetInboundTrackingUrl sets the InboundTrackingUrl field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingRespiratoryRateChanged) SetData(data *GroupedRespiratoryRate) { - c.Data = data - c.require(clientFacingRespiratoryRateChangedFieldData) +func (c *ClientFacingShipment) SetInboundTrackingUrl(inboundTrackingUrl *string) { + c.InboundTrackingUrl = inboundTrackingUrl + c.require(clientFacingShipmentFieldInboundTrackingUrl) } -func (c *ClientFacingRespiratoryRateChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingRespiratoryRateChanged +// SetOutboundCourier sets the OutboundCourier field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingShipment) SetOutboundCourier(outboundCourier *string) { + c.OutboundCourier = outboundCourier + c.require(clientFacingShipmentFieldOutboundCourier) +} + +// SetInboundCourier sets the InboundCourier field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingShipment) SetInboundCourier(inboundCourier *string) { + c.InboundCourier = inboundCourier + c.require(clientFacingShipmentFieldInboundCourier) +} + +// 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 *ClientFacingShipment) SetNotes(notes *string) { + c.Notes = notes + c.require(clientFacingShipmentFieldNotes) +} + +func (c *ClientFacingShipment) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingShipment var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingRespiratoryRateChanged(value) + *c = ClientFacingShipment(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -17323,8 +19014,8 @@ func (c *ClientFacingRespiratoryRateChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingRespiratoryRateChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingRespiratoryRateChanged +func (c *ClientFacingShipment) MarshalJSON() ([]byte, error) { + type embed ClientFacingShipment var marshaler = struct { embed }{ @@ -17334,7 +19025,7 @@ func (c *ClientFacingRespiratoryRateChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingRespiratoryRateChanged) String() string { +func (c *ClientFacingShipment) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -17346,137 +19037,117 @@ func (c *ClientFacingRespiratoryRateChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingRespiratoryRateChangedEventType string - -const ( - ClientFacingRespiratoryRateChangedEventTypeDailyDataRespiratoryRateCreated ClientFacingRespiratoryRateChangedEventType = "daily.data.respiratory_rate.created" - ClientFacingRespiratoryRateChangedEventTypeDailyDataRespiratoryRateUpdated ClientFacingRespiratoryRateChangedEventType = "daily.data.respiratory_rate.updated" -) - -func NewClientFacingRespiratoryRateChangedEventTypeFromString(s string) (ClientFacingRespiratoryRateChangedEventType, error) { - switch s { - case "daily.data.respiratory_rate.created": - return ClientFacingRespiratoryRateChangedEventTypeDailyDataRespiratoryRateCreated, nil - case "daily.data.respiratory_rate.updated": - return ClientFacingRespiratoryRateChangedEventTypeDailyDataRespiratoryRateUpdated, nil - } - var t ClientFacingRespiratoryRateChangedEventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ClientFacingRespiratoryRateChangedEventType) Ptr() *ClientFacingRespiratoryRateChangedEventType { - return &c -} - var ( - clientFacingRespiratoryRateHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingRespiratoryRateHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingRespiratoryRateHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingRespiratoryRateHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingSleepApneaAlertChangedFieldEventType = big.NewInt(1 << 0) + clientFacingSleepApneaAlertChangedFieldUserId = big.NewInt(1 << 1) + clientFacingSleepApneaAlertChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingSleepApneaAlertChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingSleepApneaAlertChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingRespiratoryRateHistoricalPullCompleted 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 ClientFacingSleepApneaAlertChanged struct { + EventType ClientFacingSleepApneaAlertChangedEventType `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 *GroupedSleepApneaAlert `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 *ClientFacingRespiratoryRateHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingSleepApneaAlertChanged) GetEventType() ClientFacingSleepApneaAlertChangedEventType { + if c == nil { + return "" + } + return c.EventType +} + +func (c *ClientFacingSleepApneaAlertChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingSleepApneaAlertChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingSleepApneaAlertChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingSleepApneaAlertChanged) GetData() *GroupedSleepApneaAlert { if c == nil { return nil } return c.Data } -func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) EventType() string { - return c.eventType -} - -func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingSleepApneaAlertChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingSleepApneaAlertChanged) 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 *ClientFacingSleepApneaAlertChanged) SetEventType(eventType ClientFacingSleepApneaAlertChangedEventType) { + c.EventType = eventType + c.require(clientFacingSleepApneaAlertChangedFieldEventType) +} + // 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 *ClientFacingRespiratoryRateHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingSleepApneaAlertChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingRespiratoryRateHistoricalPullCompletedFieldUserId) + c.require(clientFacingSleepApneaAlertChangedFieldUserId) } // 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 *ClientFacingRespiratoryRateHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingSleepApneaAlertChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingRespiratoryRateHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingSleepApneaAlertChangedFieldClientUserId) } // 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 *ClientFacingRespiratoryRateHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingSleepApneaAlertChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingRespiratoryRateHistoricalPullCompletedFieldTeamId) + c.require(clientFacingSleepApneaAlertChangedFieldTeamId) } // 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 *ClientFacingRespiratoryRateHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingSleepApneaAlertChanged) SetData(data *GroupedSleepApneaAlert) { c.Data = data - c.require(clientFacingRespiratoryRateHistoricalPullCompletedFieldData) + c.require(clientFacingSleepApneaAlertChangedFieldData) } -func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingRespiratoryRateHistoricalPullCompleted - var unmarshaler = struct { - embed - EventType string `json:"event_type"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { +func (c *ClientFacingSleepApneaAlertChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingSleepApneaAlertChanged + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingRespiratoryRateHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.respiratory_rate.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.respiratory_rate.created", unmarshaler.EventType) - } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + *c = ClientFacingSleepApneaAlertChanged(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } @@ -17485,20 +19156,18 @@ func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) UnmarshalJSON(data return nil } -func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingRespiratoryRateHistoricalPullCompleted +func (c *ClientFacingSleepApneaAlertChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingSleepApneaAlertChanged var marshaler = struct { embed - EventType string `json:"event_type"` }{ - embed: embed(*c), - EventType: "historical.data.respiratory_rate.created", + embed: embed(*c), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) String() string { +func (c *ClientFacingSleepApneaAlertChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -17510,145 +19179,137 @@ func (c *ClientFacingRespiratoryRateHistoricalPullCompleted) String() string { return fmt.Sprintf("%#v", c) } +type ClientFacingSleepApneaAlertChangedEventType string + +const ( + ClientFacingSleepApneaAlertChangedEventTypeDailyDataSleepApneaAlertCreated ClientFacingSleepApneaAlertChangedEventType = "daily.data.sleep_apnea_alert.created" + ClientFacingSleepApneaAlertChangedEventTypeDailyDataSleepApneaAlertUpdated ClientFacingSleepApneaAlertChangedEventType = "daily.data.sleep_apnea_alert.updated" +) + +func NewClientFacingSleepApneaAlertChangedEventTypeFromString(s string) (ClientFacingSleepApneaAlertChangedEventType, error) { + switch s { + case "daily.data.sleep_apnea_alert.created": + return ClientFacingSleepApneaAlertChangedEventTypeDailyDataSleepApneaAlertCreated, nil + case "daily.data.sleep_apnea_alert.updated": + return ClientFacingSleepApneaAlertChangedEventTypeDailyDataSleepApneaAlertUpdated, nil + } + var t ClientFacingSleepApneaAlertChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingSleepApneaAlertChangedEventType) Ptr() *ClientFacingSleepApneaAlertChangedEventType { + return &c +} + var ( - clientFacingRespiratoryRateTimeseriesFieldId = big.NewInt(1 << 0) - clientFacingRespiratoryRateTimeseriesFieldTimezoneOffset = big.NewInt(1 << 1) - clientFacingRespiratoryRateTimeseriesFieldType = big.NewInt(1 << 2) - clientFacingRespiratoryRateTimeseriesFieldUnit = big.NewInt(1 << 3) - clientFacingRespiratoryRateTimeseriesFieldTimestamp = big.NewInt(1 << 4) - clientFacingRespiratoryRateTimeseriesFieldValue = big.NewInt(1 << 5) + clientFacingSleepApneaAlertHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingSleepApneaAlertHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingSleepApneaAlertHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingSleepApneaAlertHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingRespiratoryRateTimeseries struct { - // Deprecated - Id *int `json:"id,omitempty" url:"id,omitempty"` - // Time zone UTC offset in seconds. Positive offset indicates east of UTC; negative offset indicates west of UTC; and null indicates the time zone information is unavailable at source. - TimezoneOffset *int `json:"timezone_offset,omitempty" url:"timezone_offset,omitempty"` - // Type is always null for this resource. - Type *string `json:"type,omitempty" url:"type,omitempty"` - // Measured in bpm. - Unit string `json:"unit" url:"unit"` - // The timestamp of the measurement. - Timestamp time.Time `json:"timestamp" url:"timestamp"` - // Average respiratory rate::breaths per minute - Value float64 `json:"value" url:"value"` +type ClientFacingSleepApneaAlertHistoricalPullCompleted 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 *ClientFacingRespiratoryRateTimeseries) GetId() *int { - if c == nil { - return nil - } - return c.Id -} - -func (c *ClientFacingRespiratoryRateTimeseries) GetTimezoneOffset() *int { +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) GetUserId() string { if c == nil { - return nil + return "" } - return c.TimezoneOffset + return c.UserId } -func (c *ClientFacingRespiratoryRateTimeseries) GetType() *string { +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) GetClientUserId() string { if c == nil { - return nil + return "" } - return c.Type + return c.ClientUserId } -func (c *ClientFacingRespiratoryRateTimeseries) GetUnit() string { +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } - return c.Unit + return c.TeamId } -func (c *ClientFacingRespiratoryRateTimeseries) GetTimestamp() time.Time { +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { - return time.Time{} + return nil } - return c.Timestamp + return c.Data } -func (c *ClientFacingRespiratoryRateTimeseries) GetValue() float64 { - if c == nil { - return 0 - } - return c.Value +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) EventType() string { + return c.eventType } -func (c *ClientFacingRespiratoryRateTimeseries) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingRespiratoryRateTimeseries) require(field *big.Int) { +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) 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 *ClientFacingRespiratoryRateTimeseries) SetId(id *int) { - c.Id = id - c.require(clientFacingRespiratoryRateTimeseriesFieldId) -} - -// 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 (c *ClientFacingRespiratoryRateTimeseries) SetTimezoneOffset(timezoneOffset *int) { - c.TimezoneOffset = timezoneOffset - c.require(clientFacingRespiratoryRateTimeseriesFieldTimezoneOffset) -} - -// SetType sets the Type 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 *ClientFacingRespiratoryRateTimeseries) SetType(type_ *string) { - c.Type = type_ - c.require(clientFacingRespiratoryRateTimeseriesFieldType) +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingSleepApneaAlertHistoricalPullCompletedFieldUserId) } -// SetUnit sets the Unit 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 *ClientFacingRespiratoryRateTimeseries) SetUnit(unit string) { - c.Unit = unit - c.require(clientFacingRespiratoryRateTimeseriesFieldUnit) +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingSleepApneaAlertHistoricalPullCompletedFieldClientUserId) } -// SetTimestamp sets the Timestamp 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 *ClientFacingRespiratoryRateTimeseries) SetTimestamp(timestamp time.Time) { - c.Timestamp = timestamp - c.require(clientFacingRespiratoryRateTimeseriesFieldTimestamp) +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingSleepApneaAlertHistoricalPullCompletedFieldTeamId) } -// SetValue sets the Value 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 *ClientFacingRespiratoryRateTimeseries) SetValue(value float64) { - c.Value = value - c.require(clientFacingRespiratoryRateTimeseriesFieldValue) +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { + c.Data = data + c.require(clientFacingSleepApneaAlertHistoricalPullCompletedFieldData) } -func (c *ClientFacingRespiratoryRateTimeseries) UnmarshalJSON(data []byte) error { - type embed ClientFacingRespiratoryRateTimeseries +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingSleepApneaAlertHistoricalPullCompleted var unmarshaler = struct { embed - Timestamp *internal.DateTime `json:"timestamp"` + EventType string `json:"event_type"` }{ embed: embed(*c), } if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingRespiratoryRateTimeseries(unmarshaler.embed) - c.Timestamp = unmarshaler.Timestamp.Time() - extraProperties, err := internal.ExtractExtraProperties(data, *c) + *c = ClientFacingSleepApneaAlertHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.sleep_apnea_alert.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.sleep_apnea_alert.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") if err != nil { return err } @@ -17657,20 +19318,20 @@ func (c *ClientFacingRespiratoryRateTimeseries) UnmarshalJSON(data []byte) error return nil } -func (c *ClientFacingRespiratoryRateTimeseries) MarshalJSON() ([]byte, error) { - type embed ClientFacingRespiratoryRateTimeseries +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingSleepApneaAlertHistoricalPullCompleted var marshaler = struct { embed - Timestamp *internal.DateTime `json:"timestamp"` + EventType string `json:"event_type"` }{ embed: embed(*c), - Timestamp: internal.NewDateTime(c.Timestamp), + EventType: "historical.data.sleep_apnea_alert.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingRespiratoryRateTimeseries) String() string { +func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -17683,24 +19344,19 @@ func (c *ClientFacingRespiratoryRateTimeseries) String() string { } var ( - clientFacingShallowWorkoutStreamFieldUserId = big.NewInt(1 << 0) - clientFacingShallowWorkoutStreamFieldWorkoutId = big.NewInt(1 << 1) - clientFacingShallowWorkoutStreamFieldProviderId = big.NewInt(1 << 2) - clientFacingShallowWorkoutStreamFieldMessage = big.NewInt(1 << 3) - clientFacingShallowWorkoutStreamFieldSource = big.NewInt(1 << 4) - clientFacingShallowWorkoutStreamFieldSport = big.NewInt(1 << 5) + clientFacingSleepBreathingDisturbanceChangedFieldEventType = big.NewInt(1 << 0) + clientFacingSleepBreathingDisturbanceChangedFieldUserId = big.NewInt(1 << 1) + clientFacingSleepBreathingDisturbanceChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingSleepBreathingDisturbanceChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingSleepBreathingDisturbanceChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingShallowWorkoutStream 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"` - WorkoutId string `json:"workout_id" url:"workout_id"` - ProviderId string `json:"provider_id" url:"provider_id"` - Message *string `json:"message,omitempty" url:"message,omitempty"` - // Source the data has come from. - Source *ClientFacingSource `json:"source" url:"source"` - // Sport's name - Sport *ClientFacingSport `json:"sport,omitempty" url:"sport,omitempty"` +type ClientFacingSleepBreathingDisturbanceChanged struct { + EventType ClientFacingSleepBreathingDisturbanceChangedEventType `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 *GroupedSleepBreathingDisturbance `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -17709,108 +19365,94 @@ type ClientFacingShallowWorkoutStream struct { rawJSON json.RawMessage } -func (c *ClientFacingShallowWorkoutStream) GetUserId() string { - if c == nil { - return "" - } - return c.UserId -} - -func (c *ClientFacingShallowWorkoutStream) GetWorkoutId() string { +func (c *ClientFacingSleepBreathingDisturbanceChanged) GetEventType() ClientFacingSleepBreathingDisturbanceChangedEventType { if c == nil { return "" } - return c.WorkoutId + return c.EventType } -func (c *ClientFacingShallowWorkoutStream) GetProviderId() string { +func (c *ClientFacingSleepBreathingDisturbanceChanged) GetUserId() string { if c == nil { return "" } - return c.ProviderId + return c.UserId } -func (c *ClientFacingShallowWorkoutStream) GetMessage() *string { +func (c *ClientFacingSleepBreathingDisturbanceChanged) GetClientUserId() string { if c == nil { - return nil + return "" } - return c.Message + return c.ClientUserId } -func (c *ClientFacingShallowWorkoutStream) GetSource() *ClientFacingSource { +func (c *ClientFacingSleepBreathingDisturbanceChanged) GetTeamId() string { if c == nil { - return nil + return "" } - return c.Source + return c.TeamId } -func (c *ClientFacingShallowWorkoutStream) GetSport() *ClientFacingSport { +func (c *ClientFacingSleepBreathingDisturbanceChanged) GetData() *GroupedSleepBreathingDisturbance { if c == nil { return nil } - return c.Sport + return c.Data } -func (c *ClientFacingShallowWorkoutStream) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingSleepBreathingDisturbanceChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingShallowWorkoutStream) require(field *big.Int) { +func (c *ClientFacingSleepBreathingDisturbanceChanged) 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 *ClientFacingShallowWorkoutStream) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingShallowWorkoutStreamFieldUserId) -} - -// SetWorkoutId sets the WorkoutId field and marks it as non-optional; +// 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 *ClientFacingShallowWorkoutStream) SetWorkoutId(workoutId string) { - c.WorkoutId = workoutId - c.require(clientFacingShallowWorkoutStreamFieldWorkoutId) +func (c *ClientFacingSleepBreathingDisturbanceChanged) SetEventType(eventType ClientFacingSleepBreathingDisturbanceChangedEventType) { + c.EventType = eventType + c.require(clientFacingSleepBreathingDisturbanceChangedFieldEventType) } -// SetProviderId sets the ProviderId 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 *ClientFacingShallowWorkoutStream) SetProviderId(providerId string) { - c.ProviderId = providerId - c.require(clientFacingShallowWorkoutStreamFieldProviderId) +func (c *ClientFacingSleepBreathingDisturbanceChanged) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingSleepBreathingDisturbanceChangedFieldUserId) } -// SetMessage sets the Message 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 *ClientFacingShallowWorkoutStream) SetMessage(message *string) { - c.Message = message - c.require(clientFacingShallowWorkoutStreamFieldMessage) +func (c *ClientFacingSleepBreathingDisturbanceChanged) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingSleepBreathingDisturbanceChangedFieldClientUserId) } -// SetSource sets the Source 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 *ClientFacingShallowWorkoutStream) SetSource(source *ClientFacingSource) { - c.Source = source - c.require(clientFacingShallowWorkoutStreamFieldSource) +func (c *ClientFacingSleepBreathingDisturbanceChanged) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingSleepBreathingDisturbanceChangedFieldTeamId) } -// SetSport sets the Sport 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 *ClientFacingShallowWorkoutStream) SetSport(sport *ClientFacingSport) { - c.Sport = sport - c.require(clientFacingShallowWorkoutStreamFieldSport) +func (c *ClientFacingSleepBreathingDisturbanceChanged) SetData(data *GroupedSleepBreathingDisturbance) { + c.Data = data + c.require(clientFacingSleepBreathingDisturbanceChangedFieldData) } -func (c *ClientFacingShallowWorkoutStream) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingShallowWorkoutStream +func (c *ClientFacingSleepBreathingDisturbanceChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingSleepBreathingDisturbanceChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingShallowWorkoutStream(value) + *c = ClientFacingSleepBreathingDisturbanceChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -17820,8 +19462,8 @@ func (c *ClientFacingShallowWorkoutStream) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingShallowWorkoutStream) MarshalJSON() ([]byte, error) { - type embed ClientFacingShallowWorkoutStream +func (c *ClientFacingSleepBreathingDisturbanceChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingSleepBreathingDisturbanceChanged var marshaler = struct { embed }{ @@ -17831,7 +19473,7 @@ func (c *ClientFacingShallowWorkoutStream) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingShallowWorkoutStream) String() string { +func (c *ClientFacingSleepBreathingDisturbanceChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -17843,176 +19485,137 @@ func (c *ClientFacingShallowWorkoutStream) String() string { return fmt.Sprintf("%#v", c) } -// Schema for a Shipment in the client facing API. -// -// To be used as part of a ClientFacingTestkitOrder. +type ClientFacingSleepBreathingDisturbanceChangedEventType string + +const ( + ClientFacingSleepBreathingDisturbanceChangedEventTypeDailyDataSleepBreathingDisturbanceCreated ClientFacingSleepBreathingDisturbanceChangedEventType = "daily.data.sleep_breathing_disturbance.created" + ClientFacingSleepBreathingDisturbanceChangedEventTypeDailyDataSleepBreathingDisturbanceUpdated ClientFacingSleepBreathingDisturbanceChangedEventType = "daily.data.sleep_breathing_disturbance.updated" +) + +func NewClientFacingSleepBreathingDisturbanceChangedEventTypeFromString(s string) (ClientFacingSleepBreathingDisturbanceChangedEventType, error) { + switch s { + case "daily.data.sleep_breathing_disturbance.created": + return ClientFacingSleepBreathingDisturbanceChangedEventTypeDailyDataSleepBreathingDisturbanceCreated, nil + case "daily.data.sleep_breathing_disturbance.updated": + return ClientFacingSleepBreathingDisturbanceChangedEventTypeDailyDataSleepBreathingDisturbanceUpdated, nil + } + var t ClientFacingSleepBreathingDisturbanceChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingSleepBreathingDisturbanceChangedEventType) Ptr() *ClientFacingSleepBreathingDisturbanceChangedEventType { + return &c +} + var ( - clientFacingShipmentFieldId = big.NewInt(1 << 0) - clientFacingShipmentFieldOutboundTrackingNumber = big.NewInt(1 << 1) - clientFacingShipmentFieldOutboundTrackingUrl = big.NewInt(1 << 2) - clientFacingShipmentFieldInboundTrackingNumber = big.NewInt(1 << 3) - clientFacingShipmentFieldInboundTrackingUrl = big.NewInt(1 << 4) - clientFacingShipmentFieldOutboundCourier = big.NewInt(1 << 5) - clientFacingShipmentFieldInboundCourier = big.NewInt(1 << 6) - clientFacingShipmentFieldNotes = big.NewInt(1 << 7) + clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingShipment struct { - // The Vital Shipment ID - Id string `json:"id" url:"id"` - // Tracking number for delivery to customer - OutboundTrackingNumber *string `json:"outbound_tracking_number,omitempty" url:"outbound_tracking_number,omitempty"` - // Tracking url for delivery to customer - OutboundTrackingUrl *string `json:"outbound_tracking_url,omitempty" url:"outbound_tracking_url,omitempty"` - // Tracking number for delivery to lab - InboundTrackingNumber *string `json:"inbound_tracking_number,omitempty" url:"inbound_tracking_number,omitempty"` - // Tracking url for delivery to lab - InboundTrackingUrl *string `json:"inbound_tracking_url,omitempty" url:"inbound_tracking_url,omitempty"` - // Courier used for delivery to customer - OutboundCourier *string `json:"outbound_courier,omitempty" url:"outbound_courier,omitempty"` - // Courier used for delivery to lab - InboundCourier *string `json:"inbound_courier,omitempty" url:"inbound_courier,omitempty"` - // Notes associated to the Vital shipment - Notes *string `json:"notes,omitempty" url:"notes,omitempty"` +type ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted 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 *ClientFacingShipment) GetId() string { +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } - return c.Id -} - -func (c *ClientFacingShipment) GetOutboundTrackingNumber() *string { - if c == nil { - return nil - } - return c.OutboundTrackingNumber -} - -func (c *ClientFacingShipment) GetOutboundTrackingUrl() *string { - if c == nil { - return nil - } - return c.OutboundTrackingUrl -} - -func (c *ClientFacingShipment) GetInboundTrackingNumber() *string { - if c == nil { - return nil - } - return c.InboundTrackingNumber + return c.UserId } -func (c *ClientFacingShipment) GetInboundTrackingUrl() *string { +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) GetClientUserId() string { if c == nil { - return nil + return "" } - return c.InboundTrackingUrl + return c.ClientUserId } -func (c *ClientFacingShipment) GetOutboundCourier() *string { +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) GetTeamId() string { if c == nil { - return nil + return "" } - return c.OutboundCourier + return c.TeamId } -func (c *ClientFacingShipment) GetInboundCourier() *string { +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } - return c.InboundCourier + return c.Data } -func (c *ClientFacingShipment) GetNotes() *string { - if c == nil { - return nil - } - return c.Notes +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) EventType() string { + return c.eventType } -func (c *ClientFacingShipment) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingShipment) require(field *big.Int) { +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) 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 *ClientFacingShipment) SetId(id string) { - c.Id = id - c.require(clientFacingShipmentFieldId) -} - -// SetOutboundTrackingNumber sets the OutboundTrackingNumber field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingShipment) SetOutboundTrackingNumber(outboundTrackingNumber *string) { - c.OutboundTrackingNumber = outboundTrackingNumber - c.require(clientFacingShipmentFieldOutboundTrackingNumber) -} - -// SetOutboundTrackingUrl sets the OutboundTrackingUrl field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingShipment) SetOutboundTrackingUrl(outboundTrackingUrl *string) { - c.OutboundTrackingUrl = outboundTrackingUrl - c.require(clientFacingShipmentFieldOutboundTrackingUrl) -} - -// SetInboundTrackingNumber sets the InboundTrackingNumber field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingShipment) SetInboundTrackingNumber(inboundTrackingNumber *string) { - c.InboundTrackingNumber = inboundTrackingNumber - c.require(clientFacingShipmentFieldInboundTrackingNumber) -} - -// SetInboundTrackingUrl sets the InboundTrackingUrl 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 *ClientFacingShipment) SetInboundTrackingUrl(inboundTrackingUrl *string) { - c.InboundTrackingUrl = inboundTrackingUrl - c.require(clientFacingShipmentFieldInboundTrackingUrl) +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldUserId) } -// SetOutboundCourier sets the OutboundCourier 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 *ClientFacingShipment) SetOutboundCourier(outboundCourier *string) { - c.OutboundCourier = outboundCourier - c.require(clientFacingShipmentFieldOutboundCourier) +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldClientUserId) } -// SetInboundCourier sets the InboundCourier 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 *ClientFacingShipment) SetInboundCourier(inboundCourier *string) { - c.InboundCourier = inboundCourier - c.require(clientFacingShipmentFieldInboundCourier) +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldTeamId) } -// SetNotes sets the Notes 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 *ClientFacingShipment) SetNotes(notes *string) { - c.Notes = notes - c.require(clientFacingShipmentFieldNotes) +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { + c.Data = data + c.require(clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldData) } -func (c *ClientFacingShipment) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingShipment - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted + var unmarshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingShipment(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) + *c = ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.sleep_breathing_disturbance.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.sleep_breathing_disturbance.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") if err != nil { return err } @@ -18021,18 +19624,20 @@ func (c *ClientFacingShipment) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingShipment) MarshalJSON() ([]byte, error) { - type embed ClientFacingShipment +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted var marshaler = struct { embed + EventType string `json:"event_type"` }{ - embed: embed(*c), + embed: embed(*c), + EventType: "historical.data.sleep_breathing_disturbance.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingShipment) String() string { +func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -18045,19 +19650,19 @@ func (c *ClientFacingShipment) String() string { } var ( - clientFacingSleepApneaAlertChangedFieldEventType = big.NewInt(1 << 0) - clientFacingSleepApneaAlertChangedFieldUserId = big.NewInt(1 << 1) - clientFacingSleepApneaAlertChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingSleepApneaAlertChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingSleepApneaAlertChangedFieldData = big.NewInt(1 << 4) + clientFacingSleepChangedFieldEventType = big.NewInt(1 << 0) + clientFacingSleepChangedFieldUserId = big.NewInt(1 << 1) + clientFacingSleepChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingSleepChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingSleepChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingSleepApneaAlertChanged struct { - EventType ClientFacingSleepApneaAlertChangedEventType `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 *GroupedSleepApneaAlert `json:"data" url:"data"` +type ClientFacingSleepChanged struct { + EventType ClientFacingSleepChangedEventType `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 *ClientFacingSleep `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -18066,46 +19671,46 @@ type ClientFacingSleepApneaAlertChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingSleepApneaAlertChanged) GetEventType() ClientFacingSleepApneaAlertChangedEventType { +func (c *ClientFacingSleepChanged) GetEventType() ClientFacingSleepChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingSleepApneaAlertChanged) GetUserId() string { +func (c *ClientFacingSleepChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingSleepApneaAlertChanged) GetClientUserId() string { +func (c *ClientFacingSleepChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingSleepApneaAlertChanged) GetTeamId() string { +func (c *ClientFacingSleepChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingSleepApneaAlertChanged) GetData() *GroupedSleepApneaAlert { +func (c *ClientFacingSleepChanged) GetData() *ClientFacingSleep { if c == nil { return nil } return c.Data } -func (c *ClientFacingSleepApneaAlertChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingSleepChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingSleepApneaAlertChanged) require(field *big.Int) { +func (c *ClientFacingSleepChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -18114,46 +19719,46 @@ func (c *ClientFacingSleepApneaAlertChanged) 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 *ClientFacingSleepApneaAlertChanged) SetEventType(eventType ClientFacingSleepApneaAlertChangedEventType) { +func (c *ClientFacingSleepChanged) SetEventType(eventType ClientFacingSleepChangedEventType) { c.EventType = eventType - c.require(clientFacingSleepApneaAlertChangedFieldEventType) + c.require(clientFacingSleepChangedFieldEventType) } // 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 *ClientFacingSleepApneaAlertChanged) SetUserId(userId string) { +func (c *ClientFacingSleepChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingSleepApneaAlertChangedFieldUserId) + c.require(clientFacingSleepChangedFieldUserId) } // 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 *ClientFacingSleepApneaAlertChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingSleepChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingSleepApneaAlertChangedFieldClientUserId) + c.require(clientFacingSleepChangedFieldClientUserId) } // 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 *ClientFacingSleepApneaAlertChanged) SetTeamId(teamId string) { +func (c *ClientFacingSleepChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingSleepApneaAlertChangedFieldTeamId) + c.require(clientFacingSleepChangedFieldTeamId) } // 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 *ClientFacingSleepApneaAlertChanged) SetData(data *GroupedSleepApneaAlert) { +func (c *ClientFacingSleepChanged) SetData(data *ClientFacingSleep) { c.Data = data - c.require(clientFacingSleepApneaAlertChangedFieldData) + c.require(clientFacingSleepChangedFieldData) } -func (c *ClientFacingSleepApneaAlertChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingSleepApneaAlertChanged +func (c *ClientFacingSleepChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingSleepChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingSleepApneaAlertChanged(value) + *c = ClientFacingSleepChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -18163,8 +19768,8 @@ func (c *ClientFacingSleepApneaAlertChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingSleepApneaAlertChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingSleepApneaAlertChanged +func (c *ClientFacingSleepChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingSleepChanged var marshaler = struct { embed }{ @@ -18174,7 +19779,7 @@ func (c *ClientFacingSleepApneaAlertChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingSleepApneaAlertChanged) String() string { +func (c *ClientFacingSleepChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -18186,137 +19791,139 @@ func (c *ClientFacingSleepApneaAlertChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingSleepApneaAlertChangedEventType string +type ClientFacingSleepChangedEventType string const ( - ClientFacingSleepApneaAlertChangedEventTypeDailyDataSleepApneaAlertCreated ClientFacingSleepApneaAlertChangedEventType = "daily.data.sleep_apnea_alert.created" - ClientFacingSleepApneaAlertChangedEventTypeDailyDataSleepApneaAlertUpdated ClientFacingSleepApneaAlertChangedEventType = "daily.data.sleep_apnea_alert.updated" + ClientFacingSleepChangedEventTypeDailyDataSleepCreated ClientFacingSleepChangedEventType = "daily.data.sleep.created" + ClientFacingSleepChangedEventTypeDailyDataSleepUpdated ClientFacingSleepChangedEventType = "daily.data.sleep.updated" ) -func NewClientFacingSleepApneaAlertChangedEventTypeFromString(s string) (ClientFacingSleepApneaAlertChangedEventType, error) { +func NewClientFacingSleepChangedEventTypeFromString(s string) (ClientFacingSleepChangedEventType, error) { switch s { - case "daily.data.sleep_apnea_alert.created": - return ClientFacingSleepApneaAlertChangedEventTypeDailyDataSleepApneaAlertCreated, nil - case "daily.data.sleep_apnea_alert.updated": - return ClientFacingSleepApneaAlertChangedEventTypeDailyDataSleepApneaAlertUpdated, nil + case "daily.data.sleep.created": + return ClientFacingSleepChangedEventTypeDailyDataSleepCreated, nil + case "daily.data.sleep.updated": + return ClientFacingSleepChangedEventTypeDailyDataSleepUpdated, nil } - var t ClientFacingSleepApneaAlertChangedEventType + var t ClientFacingSleepChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingSleepApneaAlertChangedEventType) Ptr() *ClientFacingSleepApneaAlertChangedEventType { +func (c ClientFacingSleepChangedEventType) Ptr() *ClientFacingSleepChangedEventType { return &c } var ( - clientFacingSleepApneaAlertHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingSleepApneaAlertHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingSleepApneaAlertHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingSleepApneaAlertHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingSleepCycleChangedFieldEventType = big.NewInt(1 << 0) + clientFacingSleepCycleChangedFieldUserId = big.NewInt(1 << 1) + clientFacingSleepCycleChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingSleepCycleChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingSleepCycleChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingSleepApneaAlertHistoricalPullCompleted 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 ClientFacingSleepCycleChanged struct { + EventType ClientFacingSleepCycleChangedEventType `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 *ClientFacingSleepCycle `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 *ClientFacingSleepApneaAlertHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingSleepCycleChanged) GetEventType() ClientFacingSleepCycleChangedEventType { + if c == nil { + return "" + } + return c.EventType +} + +func (c *ClientFacingSleepCycleChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingSleepCycleChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingSleepCycleChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingSleepCycleChanged) GetData() *ClientFacingSleepCycle { if c == nil { return nil } return c.Data } -func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) EventType() string { - return c.eventType -} - -func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingSleepCycleChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingSleepCycleChanged) 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 *ClientFacingSleepCycleChanged) SetEventType(eventType ClientFacingSleepCycleChangedEventType) { + c.EventType = eventType + c.require(clientFacingSleepCycleChangedFieldEventType) +} + // 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 *ClientFacingSleepApneaAlertHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingSleepCycleChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingSleepApneaAlertHistoricalPullCompletedFieldUserId) + c.require(clientFacingSleepCycleChangedFieldUserId) } // 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 *ClientFacingSleepApneaAlertHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingSleepCycleChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingSleepApneaAlertHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingSleepCycleChangedFieldClientUserId) } // 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 *ClientFacingSleepApneaAlertHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingSleepCycleChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingSleepApneaAlertHistoricalPullCompletedFieldTeamId) + c.require(clientFacingSleepCycleChangedFieldTeamId) } // 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 *ClientFacingSleepApneaAlertHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingSleepCycleChanged) SetData(data *ClientFacingSleepCycle) { c.Data = data - c.require(clientFacingSleepApneaAlertHistoricalPullCompletedFieldData) + c.require(clientFacingSleepCycleChangedFieldData) } -func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingSleepApneaAlertHistoricalPullCompleted - var unmarshaler = struct { - embed - EventType string `json:"event_type"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { +func (c *ClientFacingSleepCycleChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingSleepCycleChanged + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingSleepApneaAlertHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.sleep_apnea_alert.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.sleep_apnea_alert.created", unmarshaler.EventType) - } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + *c = ClientFacingSleepCycleChanged(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } @@ -18325,20 +19932,18 @@ func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) UnmarshalJSON(data return nil } -func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingSleepApneaAlertHistoricalPullCompleted +func (c *ClientFacingSleepCycleChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingSleepCycleChanged var marshaler = struct { embed - EventType string `json:"event_type"` }{ - embed: embed(*c), - EventType: "historical.data.sleep_apnea_alert.created", + embed: embed(*c), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) String() string { +func (c *ClientFacingSleepCycleChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -18350,117 +19955,137 @@ func (c *ClientFacingSleepApneaAlertHistoricalPullCompleted) String() string { return fmt.Sprintf("%#v", c) } -var ( - clientFacingSleepBreathingDisturbanceChangedFieldEventType = big.NewInt(1 << 0) - clientFacingSleepBreathingDisturbanceChangedFieldUserId = big.NewInt(1 << 1) - clientFacingSleepBreathingDisturbanceChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingSleepBreathingDisturbanceChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingSleepBreathingDisturbanceChangedFieldData = big.NewInt(1 << 4) +type ClientFacingSleepCycleChangedEventType string + +const ( + ClientFacingSleepCycleChangedEventTypeDailyDataSleepCycleCreated ClientFacingSleepCycleChangedEventType = "daily.data.sleep_cycle.created" + ClientFacingSleepCycleChangedEventTypeDailyDataSleepCycleUpdated ClientFacingSleepCycleChangedEventType = "daily.data.sleep_cycle.updated" ) -type ClientFacingSleepBreathingDisturbanceChanged struct { - EventType ClientFacingSleepBreathingDisturbanceChangedEventType `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 *GroupedSleepBreathingDisturbance `json:"data" url:"data"` +func NewClientFacingSleepCycleChangedEventTypeFromString(s string) (ClientFacingSleepCycleChangedEventType, error) { + switch s { + case "daily.data.sleep_cycle.created": + return ClientFacingSleepCycleChangedEventTypeDailyDataSleepCycleCreated, nil + case "daily.data.sleep_cycle.updated": + return ClientFacingSleepCycleChangedEventTypeDailyDataSleepCycleUpdated, nil + } + var t ClientFacingSleepCycleChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingSleepCycleChangedEventType) Ptr() *ClientFacingSleepCycleChangedEventType { + return &c +} + +var ( + clientFacingSleepCycleHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingSleepCycleHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingSleepCycleHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingSleepCycleHistoricalPullCompletedFieldData = big.NewInt(1 << 3) +) + +type ClientFacingSleepCycleHistoricalPullCompleted 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 *ClientFacingSleepBreathingDisturbanceChanged) GetEventType() ClientFacingSleepBreathingDisturbanceChangedEventType { - if c == nil { - return "" - } - return c.EventType -} - -func (c *ClientFacingSleepBreathingDisturbanceChanged) GetUserId() string { +func (c *ClientFacingSleepCycleHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingSleepBreathingDisturbanceChanged) GetClientUserId() string { +func (c *ClientFacingSleepCycleHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingSleepBreathingDisturbanceChanged) GetTeamId() string { +func (c *ClientFacingSleepCycleHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingSleepBreathingDisturbanceChanged) GetData() *GroupedSleepBreathingDisturbance { +func (c *ClientFacingSleepCycleHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingSleepBreathingDisturbanceChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingSleepCycleHistoricalPullCompleted) EventType() string { + return c.eventType +} + +func (c *ClientFacingSleepCycleHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingSleepBreathingDisturbanceChanged) require(field *big.Int) { +func (c *ClientFacingSleepCycleHistoricalPullCompleted) 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 *ClientFacingSleepBreathingDisturbanceChanged) SetEventType(eventType ClientFacingSleepBreathingDisturbanceChangedEventType) { - c.EventType = eventType - c.require(clientFacingSleepBreathingDisturbanceChangedFieldEventType) -} - // 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 *ClientFacingSleepBreathingDisturbanceChanged) SetUserId(userId string) { +func (c *ClientFacingSleepCycleHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingSleepBreathingDisturbanceChangedFieldUserId) + c.require(clientFacingSleepCycleHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingSleepBreathingDisturbanceChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingSleepCycleHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingSleepBreathingDisturbanceChangedFieldClientUserId) + c.require(clientFacingSleepCycleHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingSleepBreathingDisturbanceChanged) SetTeamId(teamId string) { +func (c *ClientFacingSleepCycleHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingSleepBreathingDisturbanceChangedFieldTeamId) + c.require(clientFacingSleepCycleHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingSleepBreathingDisturbanceChanged) SetData(data *GroupedSleepBreathingDisturbance) { +func (c *ClientFacingSleepCycleHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingSleepBreathingDisturbanceChangedFieldData) + c.require(clientFacingSleepCycleHistoricalPullCompletedFieldData) } -func (c *ClientFacingSleepBreathingDisturbanceChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingSleepBreathingDisturbanceChanged - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (c *ClientFacingSleepCycleHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingSleepCycleHistoricalPullCompleted + var unmarshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingSleepBreathingDisturbanceChanged(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) + *c = ClientFacingSleepCycleHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.sleep_cycle.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.sleep_cycle.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") if err != nil { return err } @@ -18469,18 +20094,20 @@ func (c *ClientFacingSleepBreathingDisturbanceChanged) UnmarshalJSON(data []byte return nil } -func (c *ClientFacingSleepBreathingDisturbanceChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingSleepBreathingDisturbanceChanged +func (c *ClientFacingSleepCycleHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingSleepCycleHistoricalPullCompleted var marshaler = struct { embed + EventType string `json:"event_type"` }{ - embed: embed(*c), + embed: embed(*c), + EventType: "historical.data.sleep_cycle.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingSleepBreathingDisturbanceChanged) String() string { +func (c *ClientFacingSleepCycleHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -18492,36 +20119,14 @@ func (c *ClientFacingSleepBreathingDisturbanceChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingSleepBreathingDisturbanceChangedEventType string - -const ( - ClientFacingSleepBreathingDisturbanceChangedEventTypeDailyDataSleepBreathingDisturbanceCreated ClientFacingSleepBreathingDisturbanceChangedEventType = "daily.data.sleep_breathing_disturbance.created" - ClientFacingSleepBreathingDisturbanceChangedEventTypeDailyDataSleepBreathingDisturbanceUpdated ClientFacingSleepBreathingDisturbanceChangedEventType = "daily.data.sleep_breathing_disturbance.updated" -) - -func NewClientFacingSleepBreathingDisturbanceChangedEventTypeFromString(s string) (ClientFacingSleepBreathingDisturbanceChangedEventType, error) { - switch s { - case "daily.data.sleep_breathing_disturbance.created": - return ClientFacingSleepBreathingDisturbanceChangedEventTypeDailyDataSleepBreathingDisturbanceCreated, nil - case "daily.data.sleep_breathing_disturbance.updated": - return ClientFacingSleepBreathingDisturbanceChangedEventTypeDailyDataSleepBreathingDisturbanceUpdated, nil - } - var t ClientFacingSleepBreathingDisturbanceChangedEventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ClientFacingSleepBreathingDisturbanceChangedEventType) Ptr() *ClientFacingSleepBreathingDisturbanceChangedEventType { - return &c -} - var ( - clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingSleepHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingSleepHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingSleepHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingSleepHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted struct { +type ClientFacingSleepHistoricalPullCompleted 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"` @@ -18535,43 +20140,43 @@ type ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingSleepHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingSleepHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingSleepHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingSleepHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) EventType() string { +func (c *ClientFacingSleepHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingSleepHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingSleepHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -18580,34 +20185,34 @@ func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) require(f // 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 *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingSleepHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldUserId) + c.require(clientFacingSleepHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingSleepHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingSleepHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingSleepHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldTeamId) + c.require(clientFacingSleepHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingSleepHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingSleepBreathingDisturbanceHistoricalPullCompletedFieldData) + c.require(clientFacingSleepHistoricalPullCompletedFieldData) } -func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted +func (c *ClientFacingSleepHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingSleepHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -18617,9 +20222,9 @@ func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) Unmarshal if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.sleep_breathing_disturbance.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.sleep_breathing_disturbance.created", unmarshaler.EventType) + *c = ClientFacingSleepHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.sleep.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.sleep.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -18631,20 +20236,20 @@ func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) Unmarshal return nil } -func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted +func (c *ClientFacingSleepHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingSleepHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "historical.data.sleep_breathing_disturbance.created", + EventType: "historical.data.sleep.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) String() string { +func (c *ClientFacingSleepHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -18656,20 +20261,45 @@ func (c *ClientFacingSleepBreathingDisturbanceHistoricalPullCompleted) String() return fmt.Sprintf("%#v", c) } +// Source summarizes where a sample or a summary is sourced from. +// At minimum, the source provider is always included. var ( - clientFacingSleepChangedFieldEventType = big.NewInt(1 << 0) - clientFacingSleepChangedFieldUserId = big.NewInt(1 << 1) - clientFacingSleepChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingSleepChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingSleepChangedFieldData = big.NewInt(1 << 4) + clientFacingSourceFieldProvider = big.NewInt(1 << 0) + clientFacingSourceFieldType = big.NewInt(1 << 1) + clientFacingSourceFieldAppId = big.NewInt(1 << 2) + clientFacingSourceFieldDeviceId = big.NewInt(1 << 3) + clientFacingSourceFieldSport = big.NewInt(1 << 4) + clientFacingSourceFieldWorkoutId = big.NewInt(1 << 5) + clientFacingSourceFieldName = big.NewInt(1 << 6) + clientFacingSourceFieldSlug = big.NewInt(1 << 7) + clientFacingSourceFieldLogo = big.NewInt(1 << 8) ) -type ClientFacingSleepChanged struct { - EventType ClientFacingSleepChangedEventType `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 *ClientFacingSleep `json:"data" url:"data"` +type ClientFacingSource struct { + // Provider slug. e.g., `oura`, `fitbit`, `garmin`. + Provider string `json:"provider" url:"provider"` + // The type of the data source (app or device) by which the summary or the timeseries data were recorded. This defaults to `unknown` when Vital cannot extract or infer that information + Type *string `json:"type,omitempty" url:"type,omitempty"` + // The identifier of the app which recorded this summary. This is only applicable to multi-source providers like Apple Health and Android Health Connect. + AppId *string `json:"app_id,omitempty" url:"app_id,omitempty"` + // The identifier of the device which recorded this summary. + DeviceId *string `json:"device_id,omitempty" url:"device_id,omitempty"` + // For workout stream timeseries, this is the standard sport slug of the workout with which the timeseries data are associated. + // + // For the `distance` timeseries, this is `wheelchair_pushing` if the user is a wheelchair user, or `null` otherwise. + // + // For all summary types and non-workout timeseries, this is always `null`. + Sport *string `json:"sport,omitempty" url:"sport,omitempty"` + // For workout stream timeseries, this is the workout ID with which the timeseries data are associated. + // + // For all other types, this is always `null`. + WorkoutId *string `json:"workout_id,omitempty" url:"workout_id,omitempty"` + // Deprecated. Subject to removal after 1 Jan 2024. + Name *string `json:"name,omitempty" url:"name,omitempty"` + // Deprecated. Use `provider` instead. Subject to removal after 1 Jan 2024. + Slug *string `json:"slug,omitempty" url:"slug,omitempty"` + // Deprecated. Subject to removal after 1 Jan 2024. + Logo *string `json:"logo,omitempty" url:"logo,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -18678,94 +20308,150 @@ type ClientFacingSleepChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingSleepChanged) GetEventType() ClientFacingSleepChangedEventType { +func (c *ClientFacingSource) GetProvider() string { if c == nil { return "" } - return c.EventType + return c.Provider } -func (c *ClientFacingSleepChanged) GetUserId() string { +func (c *ClientFacingSource) GetType() *string { if c == nil { - return "" + return nil } - return c.UserId + return c.Type } -func (c *ClientFacingSleepChanged) GetClientUserId() string { +func (c *ClientFacingSource) GetAppId() *string { if c == nil { - return "" + return nil } - return c.ClientUserId + return c.AppId } -func (c *ClientFacingSleepChanged) GetTeamId() string { +func (c *ClientFacingSource) GetDeviceId() *string { + if c == nil { + return nil + } + return c.DeviceId +} + +func (c *ClientFacingSource) GetSport() *string { + if c == nil { + return nil + } + return c.Sport +} + +func (c *ClientFacingSource) GetWorkoutId() *string { + if c == nil { + return nil + } + return c.WorkoutId +} + +func (c *ClientFacingSource) GetName() *string { + if c == nil { + return nil + } + return c.Name +} + +func (c *ClientFacingSource) GetSlug() *string { if c == nil { - return "" + return nil } - return c.TeamId + return c.Slug } -func (c *ClientFacingSleepChanged) GetData() *ClientFacingSleep { +func (c *ClientFacingSource) GetLogo() *string { if c == nil { return nil } - return c.Data + return c.Logo } -func (c *ClientFacingSleepChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingSource) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingSleepChanged) require(field *big.Int) { +func (c *ClientFacingSource) 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; +// 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 (c *ClientFacingSleepChanged) SetEventType(eventType ClientFacingSleepChangedEventType) { - c.EventType = eventType - c.require(clientFacingSleepChangedFieldEventType) +func (c *ClientFacingSource) SetProvider(provider string) { + c.Provider = provider + c.require(clientFacingSourceFieldProvider) } -// SetUserId sets the UserId field and marks it as non-optional; +// 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 *ClientFacingSleepChanged) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingSleepChangedFieldUserId) +func (c *ClientFacingSource) SetType(type_ *string) { + c.Type = type_ + c.require(clientFacingSourceFieldType) } -// SetClientUserId sets the ClientUserId field and marks it as non-optional; +// SetAppId sets the AppId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingSleepChanged) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingSleepChangedFieldClientUserId) +func (c *ClientFacingSource) SetAppId(appId *string) { + c.AppId = appId + c.require(clientFacingSourceFieldAppId) } -// SetTeamId sets the TeamId field and marks it as non-optional; +// SetDeviceId sets the DeviceId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingSleepChanged) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingSleepChangedFieldTeamId) +func (c *ClientFacingSource) SetDeviceId(deviceId *string) { + c.DeviceId = deviceId + c.require(clientFacingSourceFieldDeviceId) } -// SetData sets the Data field and marks it as non-optional; +// SetSport sets the Sport field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingSleepChanged) SetData(data *ClientFacingSleep) { - c.Data = data - c.require(clientFacingSleepChangedFieldData) +func (c *ClientFacingSource) SetSport(sport *string) { + c.Sport = sport + c.require(clientFacingSourceFieldSport) } -func (c *ClientFacingSleepChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingSleepChanged +// SetWorkoutId sets the WorkoutId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingSource) SetWorkoutId(workoutId *string) { + c.WorkoutId = workoutId + c.require(clientFacingSourceFieldWorkoutId) +} + +// 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 *ClientFacingSource) SetName(name *string) { + c.Name = name + c.require(clientFacingSourceFieldName) +} + +// 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 *ClientFacingSource) SetSlug(slug *string) { + c.Slug = slug + c.require(clientFacingSourceFieldSlug) +} + +// SetLogo sets the Logo field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingSource) SetLogo(logo *string) { + c.Logo = logo + c.require(clientFacingSourceFieldLogo) +} + +func (c *ClientFacingSource) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingSource var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingSleepChanged(value) + *c = ClientFacingSource(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -18775,8 +20461,8 @@ func (c *ClientFacingSleepChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingSleepChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingSleepChanged +func (c *ClientFacingSource) MarshalJSON() ([]byte, error) { + type embed ClientFacingSource var marshaler = struct { embed }{ @@ -18786,7 +20472,7 @@ func (c *ClientFacingSleepChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingSleepChanged) String() string { +func (c *ClientFacingSource) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -18798,42 +20484,20 @@ func (c *ClientFacingSleepChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingSleepChangedEventType string - -const ( - ClientFacingSleepChangedEventTypeDailyDataSleepCreated ClientFacingSleepChangedEventType = "daily.data.sleep.created" - ClientFacingSleepChangedEventTypeDailyDataSleepUpdated ClientFacingSleepChangedEventType = "daily.data.sleep.updated" -) - -func NewClientFacingSleepChangedEventTypeFromString(s string) (ClientFacingSleepChangedEventType, error) { - switch s { - case "daily.data.sleep.created": - return ClientFacingSleepChangedEventTypeDailyDataSleepCreated, nil - case "daily.data.sleep.updated": - return ClientFacingSleepChangedEventTypeDailyDataSleepUpdated, nil - } - var t ClientFacingSleepChangedEventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ClientFacingSleepChangedEventType) Ptr() *ClientFacingSleepChangedEventType { - return &c -} - var ( - clientFacingSleepCycleChangedFieldEventType = big.NewInt(1 << 0) - clientFacingSleepCycleChangedFieldUserId = big.NewInt(1 << 1) - clientFacingSleepCycleChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingSleepCycleChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingSleepCycleChangedFieldData = big.NewInt(1 << 4) + clientFacingStandDurationChangedFieldEventType = big.NewInt(1 << 0) + clientFacingStandDurationChangedFieldUserId = big.NewInt(1 << 1) + clientFacingStandDurationChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingStandDurationChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingStandDurationChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingSleepCycleChanged struct { - EventType ClientFacingSleepCycleChangedEventType `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 *ClientFacingSleepCycle `json:"data" url:"data"` +type ClientFacingStandDurationChanged struct { + EventType ClientFacingStandDurationChangedEventType `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 *GroupedStandDuration `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -18842,46 +20506,46 @@ type ClientFacingSleepCycleChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingSleepCycleChanged) GetEventType() ClientFacingSleepCycleChangedEventType { +func (c *ClientFacingStandDurationChanged) GetEventType() ClientFacingStandDurationChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingSleepCycleChanged) GetUserId() string { +func (c *ClientFacingStandDurationChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingSleepCycleChanged) GetClientUserId() string { +func (c *ClientFacingStandDurationChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingSleepCycleChanged) GetTeamId() string { +func (c *ClientFacingStandDurationChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingSleepCycleChanged) GetData() *ClientFacingSleepCycle { +func (c *ClientFacingStandDurationChanged) GetData() *GroupedStandDuration { if c == nil { return nil } return c.Data } -func (c *ClientFacingSleepCycleChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingStandDurationChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingSleepCycleChanged) require(field *big.Int) { +func (c *ClientFacingStandDurationChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -18890,46 +20554,46 @@ func (c *ClientFacingSleepCycleChanged) 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 *ClientFacingSleepCycleChanged) SetEventType(eventType ClientFacingSleepCycleChangedEventType) { +func (c *ClientFacingStandDurationChanged) SetEventType(eventType ClientFacingStandDurationChangedEventType) { c.EventType = eventType - c.require(clientFacingSleepCycleChangedFieldEventType) + c.require(clientFacingStandDurationChangedFieldEventType) } // 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 *ClientFacingSleepCycleChanged) SetUserId(userId string) { +func (c *ClientFacingStandDurationChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingSleepCycleChangedFieldUserId) + c.require(clientFacingStandDurationChangedFieldUserId) } // 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 *ClientFacingSleepCycleChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingStandDurationChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingSleepCycleChangedFieldClientUserId) + c.require(clientFacingStandDurationChangedFieldClientUserId) } // 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 *ClientFacingSleepCycleChanged) SetTeamId(teamId string) { +func (c *ClientFacingStandDurationChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingSleepCycleChangedFieldTeamId) + c.require(clientFacingStandDurationChangedFieldTeamId) } // 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 *ClientFacingSleepCycleChanged) SetData(data *ClientFacingSleepCycle) { +func (c *ClientFacingStandDurationChanged) SetData(data *GroupedStandDuration) { c.Data = data - c.require(clientFacingSleepCycleChangedFieldData) + c.require(clientFacingStandDurationChangedFieldData) } -func (c *ClientFacingSleepCycleChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingSleepCycleChanged +func (c *ClientFacingStandDurationChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingStandDurationChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingSleepCycleChanged(value) + *c = ClientFacingStandDurationChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -18939,8 +20603,8 @@ func (c *ClientFacingSleepCycleChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingSleepCycleChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingSleepCycleChanged +func (c *ClientFacingStandDurationChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingStandDurationChanged var marshaler = struct { embed }{ @@ -18950,7 +20614,7 @@ func (c *ClientFacingSleepCycleChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingSleepCycleChanged) String() string { +func (c *ClientFacingStandDurationChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -18962,36 +20626,36 @@ func (c *ClientFacingSleepCycleChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingSleepCycleChangedEventType string +type ClientFacingStandDurationChangedEventType string const ( - ClientFacingSleepCycleChangedEventTypeDailyDataSleepCycleCreated ClientFacingSleepCycleChangedEventType = "daily.data.sleep_cycle.created" - ClientFacingSleepCycleChangedEventTypeDailyDataSleepCycleUpdated ClientFacingSleepCycleChangedEventType = "daily.data.sleep_cycle.updated" + ClientFacingStandDurationChangedEventTypeDailyDataStandDurationCreated ClientFacingStandDurationChangedEventType = "daily.data.stand_duration.created" + ClientFacingStandDurationChangedEventTypeDailyDataStandDurationUpdated ClientFacingStandDurationChangedEventType = "daily.data.stand_duration.updated" ) -func NewClientFacingSleepCycleChangedEventTypeFromString(s string) (ClientFacingSleepCycleChangedEventType, error) { +func NewClientFacingStandDurationChangedEventTypeFromString(s string) (ClientFacingStandDurationChangedEventType, error) { switch s { - case "daily.data.sleep_cycle.created": - return ClientFacingSleepCycleChangedEventTypeDailyDataSleepCycleCreated, nil - case "daily.data.sleep_cycle.updated": - return ClientFacingSleepCycleChangedEventTypeDailyDataSleepCycleUpdated, nil + case "daily.data.stand_duration.created": + return ClientFacingStandDurationChangedEventTypeDailyDataStandDurationCreated, nil + case "daily.data.stand_duration.updated": + return ClientFacingStandDurationChangedEventTypeDailyDataStandDurationUpdated, nil } - var t ClientFacingSleepCycleChangedEventType + var t ClientFacingStandDurationChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingSleepCycleChangedEventType) Ptr() *ClientFacingSleepCycleChangedEventType { +func (c ClientFacingStandDurationChangedEventType) Ptr() *ClientFacingStandDurationChangedEventType { return &c } var ( - clientFacingSleepCycleHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingSleepCycleHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingSleepCycleHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingSleepCycleHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingStandDurationHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingStandDurationHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingStandDurationHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingStandDurationHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingSleepCycleHistoricalPullCompleted struct { +type ClientFacingStandDurationHistoricalPullCompleted 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"` @@ -19005,43 +20669,43 @@ type ClientFacingSleepCycleHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingSleepCycleHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingStandDurationHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingSleepCycleHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingStandDurationHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingSleepCycleHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingStandDurationHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingSleepCycleHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingStandDurationHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingSleepCycleHistoricalPullCompleted) EventType() string { +func (c *ClientFacingStandDurationHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingSleepCycleHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingStandDurationHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingSleepCycleHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingStandDurationHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -19050,34 +20714,34 @@ func (c *ClientFacingSleepCycleHistoricalPullCompleted) 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 *ClientFacingSleepCycleHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingStandDurationHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingSleepCycleHistoricalPullCompletedFieldUserId) + c.require(clientFacingStandDurationHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingSleepCycleHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingStandDurationHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingSleepCycleHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingStandDurationHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingSleepCycleHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingStandDurationHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingSleepCycleHistoricalPullCompletedFieldTeamId) + c.require(clientFacingStandDurationHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingSleepCycleHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingStandDurationHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingSleepCycleHistoricalPullCompletedFieldData) + c.require(clientFacingStandDurationHistoricalPullCompletedFieldData) } -func (c *ClientFacingSleepCycleHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingSleepCycleHistoricalPullCompleted +func (c *ClientFacingStandDurationHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingStandDurationHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -19087,9 +20751,9 @@ func (c *ClientFacingSleepCycleHistoricalPullCompleted) UnmarshalJSON(data []byt if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingSleepCycleHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.sleep_cycle.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.sleep_cycle.created", unmarshaler.EventType) + *c = ClientFacingStandDurationHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.stand_duration.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.stand_duration.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -19101,20 +20765,20 @@ func (c *ClientFacingSleepCycleHistoricalPullCompleted) UnmarshalJSON(data []byt return nil } -func (c *ClientFacingSleepCycleHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingSleepCycleHistoricalPullCompleted +func (c *ClientFacingStandDurationHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingStandDurationHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "historical.data.sleep_cycle.created", + EventType: "historical.data.stand_duration.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingSleepCycleHistoricalPullCompleted) String() string { +func (c *ClientFacingStandDurationHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -19127,114 +20791,116 @@ func (c *ClientFacingSleepCycleHistoricalPullCompleted) String() string { } var ( - clientFacingSleepHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingSleepHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingSleepHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingSleepHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingStandHourChangedFieldEventType = big.NewInt(1 << 0) + clientFacingStandHourChangedFieldUserId = big.NewInt(1 << 1) + clientFacingStandHourChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingStandHourChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingStandHourChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingSleepHistoricalPullCompleted 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 ClientFacingStandHourChanged struct { + EventType ClientFacingStandHourChangedEventType `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 *GroupedStandHour `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 *ClientFacingSleepHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingStandHourChanged) GetEventType() ClientFacingStandHourChangedEventType { + if c == nil { + return "" + } + return c.EventType +} + +func (c *ClientFacingStandHourChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingSleepHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingStandHourChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingSleepHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingStandHourChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingSleepHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingStandHourChanged) GetData() *GroupedStandHour { if c == nil { return nil } return c.Data } -func (c *ClientFacingSleepHistoricalPullCompleted) EventType() string { - return c.eventType -} - -func (c *ClientFacingSleepHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingStandHourChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingSleepHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingStandHourChanged) 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 *ClientFacingStandHourChanged) SetEventType(eventType ClientFacingStandHourChangedEventType) { + c.EventType = eventType + c.require(clientFacingStandHourChangedFieldEventType) +} + // 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 *ClientFacingSleepHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingStandHourChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingSleepHistoricalPullCompletedFieldUserId) + c.require(clientFacingStandHourChangedFieldUserId) } // 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 *ClientFacingSleepHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingStandHourChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingSleepHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingStandHourChangedFieldClientUserId) } // 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 *ClientFacingSleepHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingStandHourChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingSleepHistoricalPullCompletedFieldTeamId) + c.require(clientFacingStandHourChangedFieldTeamId) } // 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 *ClientFacingSleepHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingStandHourChanged) SetData(data *GroupedStandHour) { c.Data = data - c.require(clientFacingSleepHistoricalPullCompletedFieldData) + c.require(clientFacingStandHourChangedFieldData) } -func (c *ClientFacingSleepHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingSleepHistoricalPullCompleted - var unmarshaler = struct { - embed - EventType string `json:"event_type"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { +func (c *ClientFacingStandHourChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingStandHourChanged + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingSleepHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.sleep.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.sleep.created", unmarshaler.EventType) - } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + *c = ClientFacingStandHourChanged(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } @@ -19243,20 +20909,18 @@ func (c *ClientFacingSleepHistoricalPullCompleted) UnmarshalJSON(data []byte) er return nil } -func (c *ClientFacingSleepHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingSleepHistoricalPullCompleted +func (c *ClientFacingStandHourChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingStandHourChanged var marshaler = struct { embed - EventType string `json:"event_type"` }{ - embed: embed(*c), - EventType: "historical.data.sleep.created", + embed: embed(*c), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingSleepHistoricalPullCompleted) String() string { +func (c *ClientFacingStandHourChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -19268,198 +20932,137 @@ func (c *ClientFacingSleepHistoricalPullCompleted) String() string { return fmt.Sprintf("%#v", c) } -// Source summarizes where a sample or a summary is sourced from. -// At minimum, the source provider is always included. +type ClientFacingStandHourChangedEventType string + +const ( + ClientFacingStandHourChangedEventTypeDailyDataStandHourCreated ClientFacingStandHourChangedEventType = "daily.data.stand_hour.created" + ClientFacingStandHourChangedEventTypeDailyDataStandHourUpdated ClientFacingStandHourChangedEventType = "daily.data.stand_hour.updated" +) + +func NewClientFacingStandHourChangedEventTypeFromString(s string) (ClientFacingStandHourChangedEventType, error) { + switch s { + case "daily.data.stand_hour.created": + return ClientFacingStandHourChangedEventTypeDailyDataStandHourCreated, nil + case "daily.data.stand_hour.updated": + return ClientFacingStandHourChangedEventTypeDailyDataStandHourUpdated, nil + } + var t ClientFacingStandHourChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingStandHourChangedEventType) Ptr() *ClientFacingStandHourChangedEventType { + return &c +} + var ( - clientFacingSourceFieldProvider = big.NewInt(1 << 0) - clientFacingSourceFieldType = big.NewInt(1 << 1) - clientFacingSourceFieldAppId = big.NewInt(1 << 2) - clientFacingSourceFieldDeviceId = big.NewInt(1 << 3) - clientFacingSourceFieldSport = big.NewInt(1 << 4) - clientFacingSourceFieldWorkoutId = big.NewInt(1 << 5) - clientFacingSourceFieldName = big.NewInt(1 << 6) - clientFacingSourceFieldSlug = big.NewInt(1 << 7) - clientFacingSourceFieldLogo = big.NewInt(1 << 8) + clientFacingStandHourHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingStandHourHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingStandHourHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingStandHourHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingSource struct { - // Provider slug. e.g., `oura`, `fitbit`, `garmin`. - Provider string `json:"provider" url:"provider"` - // The type of the data source (app or device) by which the summary or the timeseries data were recorded. This defaults to `unknown` when Vital cannot extract or infer that information - Type *string `json:"type,omitempty" url:"type,omitempty"` - // The identifier of the app which recorded this summary. This is only applicable to multi-source providers like Apple Health and Android Health Connect. - AppId *string `json:"app_id,omitempty" url:"app_id,omitempty"` - // The identifier of the device which recorded this summary. - DeviceId *string `json:"device_id,omitempty" url:"device_id,omitempty"` - // For workout stream timeseries, this is the standard sport slug of the workout with which the timeseries data are associated. - // - // For the `distance` timeseries, this is `wheelchair_pushing` if the user is a wheelchair user, or `null` otherwise. - // - // For all summary types and non-workout timeseries, this is always `null`. - Sport *string `json:"sport,omitempty" url:"sport,omitempty"` - // For workout stream timeseries, this is the workout ID with which the timeseries data are associated. - // - // For all other types, this is always `null`. - WorkoutId *string `json:"workout_id,omitempty" url:"workout_id,omitempty"` - // Deprecated. Subject to removal after 1 Jan 2024. - Name *string `json:"name,omitempty" url:"name,omitempty"` - // Deprecated. Use `provider` instead. Subject to removal after 1 Jan 2024. - Slug *string `json:"slug,omitempty" url:"slug,omitempty"` - // Deprecated. Subject to removal after 1 Jan 2024. - Logo *string `json:"logo,omitempty" url:"logo,omitempty"` +type ClientFacingStandHourHistoricalPullCompleted 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 *ClientFacingSource) GetProvider() string { +func (c *ClientFacingStandHourHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } - return c.Provider -} - -func (c *ClientFacingSource) GetType() *string { - if c == nil { - return nil - } - return c.Type -} - -func (c *ClientFacingSource) GetAppId() *string { - if c == nil { - return nil - } - return c.AppId -} - -func (c *ClientFacingSource) GetDeviceId() *string { - if c == nil { - return nil - } - return c.DeviceId -} - -func (c *ClientFacingSource) GetSport() *string { - if c == nil { - return nil - } - return c.Sport -} - -func (c *ClientFacingSource) GetWorkoutId() *string { - if c == nil { - return nil - } - return c.WorkoutId + return c.UserId } -func (c *ClientFacingSource) GetName() *string { +func (c *ClientFacingStandHourHistoricalPullCompleted) GetClientUserId() string { if c == nil { - return nil + return "" } - return c.Name + return c.ClientUserId } -func (c *ClientFacingSource) GetSlug() *string { +func (c *ClientFacingStandHourHistoricalPullCompleted) GetTeamId() string { if c == nil { - return nil + return "" } - return c.Slug + return c.TeamId } -func (c *ClientFacingSource) GetLogo() *string { +func (c *ClientFacingStandHourHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } - return c.Logo -} - -func (c *ClientFacingSource) GetExtraProperties() map[string]interface{} { - return c.extraProperties -} - -func (c *ClientFacingSource) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) - } - c.explicitFields.Or(c.explicitFields, field) -} - -// 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 (c *ClientFacingSource) SetProvider(provider string) { - c.Provider = provider - c.require(clientFacingSourceFieldProvider) -} - -// 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 *ClientFacingSource) SetType(type_ *string) { - c.Type = type_ - c.require(clientFacingSourceFieldType) + return c.Data } -// SetAppId sets the AppId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingSource) SetAppId(appId *string) { - c.AppId = appId - c.require(clientFacingSourceFieldAppId) +func (c *ClientFacingStandHourHistoricalPullCompleted) EventType() string { + return c.eventType } -// SetDeviceId sets the DeviceId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingSource) SetDeviceId(deviceId *string) { - c.DeviceId = deviceId - c.require(clientFacingSourceFieldDeviceId) +func (c *ClientFacingStandHourHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { + return c.extraProperties } -// SetSport sets the Sport field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingSource) SetSport(sport *string) { - c.Sport = sport - c.require(clientFacingSourceFieldSport) +func (c *ClientFacingStandHourHistoricalPullCompleted) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) } -// SetWorkoutId sets the WorkoutId 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 *ClientFacingSource) SetWorkoutId(workoutId *string) { - c.WorkoutId = workoutId - c.require(clientFacingSourceFieldWorkoutId) +func (c *ClientFacingStandHourHistoricalPullCompleted) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingStandHourHistoricalPullCompletedFieldUserId) } -// SetName sets the Name 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 *ClientFacingSource) SetName(name *string) { - c.Name = name - c.require(clientFacingSourceFieldName) +func (c *ClientFacingStandHourHistoricalPullCompleted) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingStandHourHistoricalPullCompletedFieldClientUserId) } -// SetSlug sets the Slug 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 *ClientFacingSource) SetSlug(slug *string) { - c.Slug = slug - c.require(clientFacingSourceFieldSlug) +func (c *ClientFacingStandHourHistoricalPullCompleted) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingStandHourHistoricalPullCompletedFieldTeamId) } -// SetLogo sets the Logo 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 *ClientFacingSource) SetLogo(logo *string) { - c.Logo = logo - c.require(clientFacingSourceFieldLogo) +func (c *ClientFacingStandHourHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { + c.Data = data + c.require(clientFacingStandHourHistoricalPullCompletedFieldData) } -func (c *ClientFacingSource) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingSource - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (c *ClientFacingStandHourHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingStandHourHistoricalPullCompleted + var unmarshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingSource(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) + *c = ClientFacingStandHourHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.stand_hour.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.stand_hour.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") if err != nil { return err } @@ -19468,18 +21071,20 @@ func (c *ClientFacingSource) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingSource) MarshalJSON() ([]byte, error) { - type embed ClientFacingSource +func (c *ClientFacingStandHourHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingStandHourHistoricalPullCompleted var marshaler = struct { embed + EventType string `json:"event_type"` }{ - embed: embed(*c), + embed: embed(*c), + EventType: "historical.data.stand_hour.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingSource) String() string { +func (c *ClientFacingStandHourHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -19492,19 +21097,19 @@ func (c *ClientFacingSource) String() string { } var ( - clientFacingStandDurationChangedFieldEventType = big.NewInt(1 << 0) - clientFacingStandDurationChangedFieldUserId = big.NewInt(1 << 1) - clientFacingStandDurationChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingStandDurationChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingStandDurationChangedFieldData = big.NewInt(1 << 4) + clientFacingStepsChangedFieldEventType = big.NewInt(1 << 0) + clientFacingStepsChangedFieldUserId = big.NewInt(1 << 1) + clientFacingStepsChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingStepsChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingStepsChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingStandDurationChanged struct { - EventType ClientFacingStandDurationChangedEventType `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 *GroupedStandDuration `json:"data" url:"data"` +type ClientFacingStepsChanged struct { + EventType ClientFacingStepsChangedEventType `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 *GroupedSteps `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -19513,46 +21118,46 @@ type ClientFacingStandDurationChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingStandDurationChanged) GetEventType() ClientFacingStandDurationChangedEventType { +func (c *ClientFacingStepsChanged) GetEventType() ClientFacingStepsChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingStandDurationChanged) GetUserId() string { +func (c *ClientFacingStepsChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingStandDurationChanged) GetClientUserId() string { +func (c *ClientFacingStepsChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingStandDurationChanged) GetTeamId() string { +func (c *ClientFacingStepsChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingStandDurationChanged) GetData() *GroupedStandDuration { +func (c *ClientFacingStepsChanged) GetData() *GroupedSteps { if c == nil { return nil } return c.Data } -func (c *ClientFacingStandDurationChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingStepsChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingStandDurationChanged) require(field *big.Int) { +func (c *ClientFacingStepsChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -19561,46 +21166,46 @@ func (c *ClientFacingStandDurationChanged) 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 *ClientFacingStandDurationChanged) SetEventType(eventType ClientFacingStandDurationChangedEventType) { +func (c *ClientFacingStepsChanged) SetEventType(eventType ClientFacingStepsChangedEventType) { c.EventType = eventType - c.require(clientFacingStandDurationChangedFieldEventType) + c.require(clientFacingStepsChangedFieldEventType) } // 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 *ClientFacingStandDurationChanged) SetUserId(userId string) { +func (c *ClientFacingStepsChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingStandDurationChangedFieldUserId) + c.require(clientFacingStepsChangedFieldUserId) } // 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 *ClientFacingStandDurationChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingStepsChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingStandDurationChangedFieldClientUserId) + c.require(clientFacingStepsChangedFieldClientUserId) } // 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 *ClientFacingStandDurationChanged) SetTeamId(teamId string) { +func (c *ClientFacingStepsChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingStandDurationChangedFieldTeamId) + c.require(clientFacingStepsChangedFieldTeamId) } // 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 *ClientFacingStandDurationChanged) SetData(data *GroupedStandDuration) { +func (c *ClientFacingStepsChanged) SetData(data *GroupedSteps) { c.Data = data - c.require(clientFacingStandDurationChangedFieldData) + c.require(clientFacingStepsChangedFieldData) } -func (c *ClientFacingStandDurationChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingStandDurationChanged +func (c *ClientFacingStepsChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingStepsChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingStandDurationChanged(value) + *c = ClientFacingStepsChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -19610,8 +21215,8 @@ func (c *ClientFacingStandDurationChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingStandDurationChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingStandDurationChanged +func (c *ClientFacingStepsChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingStepsChanged var marshaler = struct { embed }{ @@ -19621,7 +21226,7 @@ func (c *ClientFacingStandDurationChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingStandDurationChanged) String() string { +func (c *ClientFacingStepsChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -19633,36 +21238,36 @@ func (c *ClientFacingStandDurationChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingStandDurationChangedEventType string +type ClientFacingStepsChangedEventType string const ( - ClientFacingStandDurationChangedEventTypeDailyDataStandDurationCreated ClientFacingStandDurationChangedEventType = "daily.data.stand_duration.created" - ClientFacingStandDurationChangedEventTypeDailyDataStandDurationUpdated ClientFacingStandDurationChangedEventType = "daily.data.stand_duration.updated" + ClientFacingStepsChangedEventTypeDailyDataStepsCreated ClientFacingStepsChangedEventType = "daily.data.steps.created" + ClientFacingStepsChangedEventTypeDailyDataStepsUpdated ClientFacingStepsChangedEventType = "daily.data.steps.updated" ) -func NewClientFacingStandDurationChangedEventTypeFromString(s string) (ClientFacingStandDurationChangedEventType, error) { +func NewClientFacingStepsChangedEventTypeFromString(s string) (ClientFacingStepsChangedEventType, error) { switch s { - case "daily.data.stand_duration.created": - return ClientFacingStandDurationChangedEventTypeDailyDataStandDurationCreated, nil - case "daily.data.stand_duration.updated": - return ClientFacingStandDurationChangedEventTypeDailyDataStandDurationUpdated, nil + case "daily.data.steps.created": + return ClientFacingStepsChangedEventTypeDailyDataStepsCreated, nil + case "daily.data.steps.updated": + return ClientFacingStepsChangedEventTypeDailyDataStepsUpdated, nil } - var t ClientFacingStandDurationChangedEventType + var t ClientFacingStepsChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingStandDurationChangedEventType) Ptr() *ClientFacingStandDurationChangedEventType { +func (c ClientFacingStepsChangedEventType) Ptr() *ClientFacingStepsChangedEventType { return &c } var ( - clientFacingStandDurationHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingStandDurationHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingStandDurationHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingStandDurationHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingStepsHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingStepsHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingStepsHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingStepsHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingStandDurationHistoricalPullCompleted struct { +type ClientFacingStepsHistoricalPullCompleted 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"` @@ -19676,43 +21281,43 @@ type ClientFacingStandDurationHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingStandDurationHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingStepsHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingStandDurationHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingStepsHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingStandDurationHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingStepsHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingStandDurationHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingStepsHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingStandDurationHistoricalPullCompleted) EventType() string { +func (c *ClientFacingStepsHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingStandDurationHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingStepsHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingStandDurationHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingStepsHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -19721,34 +21326,34 @@ func (c *ClientFacingStandDurationHistoricalPullCompleted) require(field *big.In // 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 *ClientFacingStandDurationHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingStepsHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingStandDurationHistoricalPullCompletedFieldUserId) + c.require(clientFacingStepsHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingStandDurationHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingStepsHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingStandDurationHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingStepsHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingStandDurationHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingStepsHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingStandDurationHistoricalPullCompletedFieldTeamId) + c.require(clientFacingStepsHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingStandDurationHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingStepsHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingStandDurationHistoricalPullCompletedFieldData) + c.require(clientFacingStepsHistoricalPullCompletedFieldData) } -func (c *ClientFacingStandDurationHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingStandDurationHistoricalPullCompleted +func (c *ClientFacingStepsHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingStepsHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -19758,9 +21363,9 @@ func (c *ClientFacingStandDurationHistoricalPullCompleted) UnmarshalJSON(data [] if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingStandDurationHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.stand_duration.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.stand_duration.created", unmarshaler.EventType) + *c = ClientFacingStepsHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.steps.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.steps.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -19772,20 +21377,20 @@ func (c *ClientFacingStandDurationHistoricalPullCompleted) UnmarshalJSON(data [] return nil } -func (c *ClientFacingStandDurationHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingStandDurationHistoricalPullCompleted +func (c *ClientFacingStepsHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingStepsHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "historical.data.stand_duration.created", + EventType: "historical.data.steps.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingStandDurationHistoricalPullCompleted) String() string { +func (c *ClientFacingStepsHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -19798,19 +21403,19 @@ func (c *ClientFacingStandDurationHistoricalPullCompleted) String() string { } var ( - clientFacingStandHourChangedFieldEventType = big.NewInt(1 << 0) - clientFacingStandHourChangedFieldUserId = big.NewInt(1 << 1) - clientFacingStandHourChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingStandHourChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingStandHourChangedFieldData = big.NewInt(1 << 4) + clientFacingStressLevelChangedFieldEventType = big.NewInt(1 << 0) + clientFacingStressLevelChangedFieldUserId = big.NewInt(1 << 1) + clientFacingStressLevelChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingStressLevelChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingStressLevelChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingStandHourChanged struct { - EventType ClientFacingStandHourChangedEventType `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 *GroupedStandHour `json:"data" url:"data"` +type ClientFacingStressLevelChanged struct { + EventType ClientFacingStressLevelChangedEventType `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 *GroupedStressLevel `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -19819,46 +21424,46 @@ type ClientFacingStandHourChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingStandHourChanged) GetEventType() ClientFacingStandHourChangedEventType { +func (c *ClientFacingStressLevelChanged) GetEventType() ClientFacingStressLevelChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingStandHourChanged) GetUserId() string { +func (c *ClientFacingStressLevelChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingStandHourChanged) GetClientUserId() string { +func (c *ClientFacingStressLevelChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingStandHourChanged) GetTeamId() string { +func (c *ClientFacingStressLevelChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingStandHourChanged) GetData() *GroupedStandHour { +func (c *ClientFacingStressLevelChanged) GetData() *GroupedStressLevel { if c == nil { return nil } return c.Data } -func (c *ClientFacingStandHourChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingStressLevelChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingStandHourChanged) require(field *big.Int) { +func (c *ClientFacingStressLevelChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -19867,46 +21472,46 @@ func (c *ClientFacingStandHourChanged) 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 *ClientFacingStandHourChanged) SetEventType(eventType ClientFacingStandHourChangedEventType) { +func (c *ClientFacingStressLevelChanged) SetEventType(eventType ClientFacingStressLevelChangedEventType) { c.EventType = eventType - c.require(clientFacingStandHourChangedFieldEventType) + c.require(clientFacingStressLevelChangedFieldEventType) } // 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 *ClientFacingStandHourChanged) SetUserId(userId string) { +func (c *ClientFacingStressLevelChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingStandHourChangedFieldUserId) + c.require(clientFacingStressLevelChangedFieldUserId) } // 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 *ClientFacingStandHourChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingStressLevelChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingStandHourChangedFieldClientUserId) + c.require(clientFacingStressLevelChangedFieldClientUserId) } // 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 *ClientFacingStandHourChanged) SetTeamId(teamId string) { +func (c *ClientFacingStressLevelChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingStandHourChangedFieldTeamId) + c.require(clientFacingStressLevelChangedFieldTeamId) } // 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 *ClientFacingStandHourChanged) SetData(data *GroupedStandHour) { +func (c *ClientFacingStressLevelChanged) SetData(data *GroupedStressLevel) { c.Data = data - c.require(clientFacingStandHourChangedFieldData) + c.require(clientFacingStressLevelChangedFieldData) } -func (c *ClientFacingStandHourChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingStandHourChanged +func (c *ClientFacingStressLevelChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingStressLevelChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingStandHourChanged(value) + *c = ClientFacingStressLevelChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -19916,8 +21521,8 @@ func (c *ClientFacingStandHourChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingStandHourChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingStandHourChanged +func (c *ClientFacingStressLevelChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingStressLevelChanged var marshaler = struct { embed }{ @@ -19927,7 +21532,7 @@ func (c *ClientFacingStandHourChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingStandHourChanged) String() string { +func (c *ClientFacingStressLevelChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -19939,36 +21544,36 @@ func (c *ClientFacingStandHourChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingStandHourChangedEventType string +type ClientFacingStressLevelChangedEventType string const ( - ClientFacingStandHourChangedEventTypeDailyDataStandHourCreated ClientFacingStandHourChangedEventType = "daily.data.stand_hour.created" - ClientFacingStandHourChangedEventTypeDailyDataStandHourUpdated ClientFacingStandHourChangedEventType = "daily.data.stand_hour.updated" + ClientFacingStressLevelChangedEventTypeDailyDataStressLevelCreated ClientFacingStressLevelChangedEventType = "daily.data.stress_level.created" + ClientFacingStressLevelChangedEventTypeDailyDataStressLevelUpdated ClientFacingStressLevelChangedEventType = "daily.data.stress_level.updated" ) -func NewClientFacingStandHourChangedEventTypeFromString(s string) (ClientFacingStandHourChangedEventType, error) { +func NewClientFacingStressLevelChangedEventTypeFromString(s string) (ClientFacingStressLevelChangedEventType, error) { switch s { - case "daily.data.stand_hour.created": - return ClientFacingStandHourChangedEventTypeDailyDataStandHourCreated, nil - case "daily.data.stand_hour.updated": - return ClientFacingStandHourChangedEventTypeDailyDataStandHourUpdated, nil + case "daily.data.stress_level.created": + return ClientFacingStressLevelChangedEventTypeDailyDataStressLevelCreated, nil + case "daily.data.stress_level.updated": + return ClientFacingStressLevelChangedEventTypeDailyDataStressLevelUpdated, nil } - var t ClientFacingStandHourChangedEventType + var t ClientFacingStressLevelChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingStandHourChangedEventType) Ptr() *ClientFacingStandHourChangedEventType { +func (c ClientFacingStressLevelChangedEventType) Ptr() *ClientFacingStressLevelChangedEventType { return &c } var ( - clientFacingStandHourHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingStandHourHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingStandHourHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingStandHourHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingStressLevelHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingStressLevelHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingStressLevelHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingStressLevelHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingStandHourHistoricalPullCompleted struct { +type ClientFacingStressLevelHistoricalPullCompleted 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"` @@ -19982,43 +21587,43 @@ type ClientFacingStandHourHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingStandHourHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingStressLevelHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingStandHourHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingStressLevelHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingStandHourHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingStressLevelHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingStandHourHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingStressLevelHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingStandHourHistoricalPullCompleted) EventType() string { +func (c *ClientFacingStressLevelHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingStandHourHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingStressLevelHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingStandHourHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingStressLevelHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -20027,34 +21632,34 @@ func (c *ClientFacingStandHourHistoricalPullCompleted) 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 *ClientFacingStandHourHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingStressLevelHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingStandHourHistoricalPullCompletedFieldUserId) + c.require(clientFacingStressLevelHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingStandHourHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingStressLevelHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingStandHourHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingStressLevelHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingStandHourHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingStressLevelHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingStandHourHistoricalPullCompletedFieldTeamId) + c.require(clientFacingStressLevelHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingStandHourHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingStressLevelHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingStandHourHistoricalPullCompletedFieldData) + c.require(clientFacingStressLevelHistoricalPullCompletedFieldData) } -func (c *ClientFacingStandHourHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingStandHourHistoricalPullCompleted +func (c *ClientFacingStressLevelHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingStressLevelHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -20064,9 +21669,9 @@ func (c *ClientFacingStandHourHistoricalPullCompleted) UnmarshalJSON(data []byte if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingStandHourHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.stand_hour.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.stand_hour.created", unmarshaler.EventType) + *c = ClientFacingStressLevelHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.stress_level.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.stress_level.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -20078,20 +21683,20 @@ func (c *ClientFacingStandHourHistoricalPullCompleted) UnmarshalJSON(data []byte return nil } -func (c *ClientFacingStandHourHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingStandHourHistoricalPullCompleted +func (c *ClientFacingStressLevelHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingStressLevelHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "historical.data.stand_hour.created", + EventType: "historical.data.stress_level.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingStandHourHistoricalPullCompleted) String() string { +func (c *ClientFacingStressLevelHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -20104,19 +21709,11 @@ func (c *ClientFacingStandHourHistoricalPullCompleted) String() string { } var ( - clientFacingStepsChangedFieldEventType = big.NewInt(1 << 0) - clientFacingStepsChangedFieldUserId = big.NewInt(1 << 1) - clientFacingStepsChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingStepsChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingStepsChangedFieldData = big.NewInt(1 << 4) + clientFacingTestKitOrderDetailsFieldData = big.NewInt(1 << 0) ) -type ClientFacingStepsChanged struct { - EventType ClientFacingStepsChangedEventType `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 *GroupedSteps `json:"data" url:"data"` +type ClientFacingTestKitOrderDetails struct { + Data *ClientFacingTestkitOrder `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:"-"` @@ -20125,94 +21722,177 @@ type ClientFacingStepsChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingStepsChanged) GetEventType() ClientFacingStepsChangedEventType { +func (c *ClientFacingTestKitOrderDetails) GetData() *ClientFacingTestkitOrder { if c == nil { - return "" + return nil } - return c.EventType + return c.Data } -func (c *ClientFacingStepsChanged) GetUserId() string { - if c == nil { - return "" +func (c *ClientFacingTestKitOrderDetails) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingTestKitOrderDetails) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) } - return c.UserId + c.explicitFields.Or(c.explicitFields, field) } -func (c *ClientFacingStepsChanged) GetClientUserId() string { - if c == nil { - return "" +// 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 *ClientFacingTestKitOrderDetails) SetData(data *ClientFacingTestkitOrder) { + c.Data = data + c.require(clientFacingTestKitOrderDetailsFieldData) +} + +func (c *ClientFacingTestKitOrderDetails) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingTestKitOrderDetails + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err } - return c.ClientUserId + *c = ClientFacingTestKitOrderDetails(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil } -func (c *ClientFacingStepsChanged) GetTeamId() string { +func (c *ClientFacingTestKitOrderDetails) MarshalJSON() ([]byte, error) { + type embed ClientFacingTestKitOrderDetails + var marshaler = struct { + embed + }{ + embed: embed(*c), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingTestKitOrderDetails) 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) +} + +// Schema for a testkit order in the client facing API. +// +// To be used as part of a ClientFacingOrder. +var ( + clientFacingTestkitOrderFieldId = big.NewInt(1 << 0) + clientFacingTestkitOrderFieldShipment = big.NewInt(1 << 1) + clientFacingTestkitOrderFieldCreatedAt = big.NewInt(1 << 2) + clientFacingTestkitOrderFieldUpdatedAt = big.NewInt(1 << 3) +) + +type ClientFacingTestkitOrder struct { + // The Vital TestKit Order ID + Id string `json:"id" url:"id"` + // Shipment object + Shipment *ClientFacingShipment `json:"shipment,omitempty" url:"shipment,omitempty"` + 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 *ClientFacingTestkitOrder) GetId() string { if c == nil { return "" } - return c.TeamId + return c.Id } -func (c *ClientFacingStepsChanged) GetData() *GroupedSteps { +func (c *ClientFacingTestkitOrder) GetShipment() *ClientFacingShipment { if c == nil { return nil } - return c.Data + return c.Shipment } -func (c *ClientFacingStepsChanged) GetExtraProperties() map[string]interface{} { - return c.extraProperties +func (c *ClientFacingTestkitOrder) GetCreatedAt() time.Time { + if c == nil { + return time.Time{} + } + return c.CreatedAt } -func (c *ClientFacingStepsChanged) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) +func (c *ClientFacingTestkitOrder) GetUpdatedAt() time.Time { + if c == nil { + return time.Time{} } - c.explicitFields.Or(c.explicitFields, field) + return c.UpdatedAt } -// 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 *ClientFacingStepsChanged) SetEventType(eventType ClientFacingStepsChangedEventType) { - c.EventType = eventType - c.require(clientFacingStepsChangedFieldEventType) +func (c *ClientFacingTestkitOrder) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingTestkitOrder) 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; +// 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 *ClientFacingStepsChanged) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingStepsChangedFieldUserId) +func (c *ClientFacingTestkitOrder) SetId(id string) { + c.Id = id + c.require(clientFacingTestkitOrderFieldId) } -// SetClientUserId sets the ClientUserId field and marks it as non-optional; +// SetShipment sets the Shipment field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingStepsChanged) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingStepsChangedFieldClientUserId) +func (c *ClientFacingTestkitOrder) SetShipment(shipment *ClientFacingShipment) { + c.Shipment = shipment + c.require(clientFacingTestkitOrderFieldShipment) } -// 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 *ClientFacingStepsChanged) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingStepsChangedFieldTeamId) +func (c *ClientFacingTestkitOrder) SetCreatedAt(createdAt time.Time) { + c.CreatedAt = createdAt + c.require(clientFacingTestkitOrderFieldCreatedAt) } -// SetData sets the Data field and marks it as non-optional; +// 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 *ClientFacingStepsChanged) SetData(data *GroupedSteps) { - c.Data = data - c.require(clientFacingStepsChangedFieldData) +func (c *ClientFacingTestkitOrder) SetUpdatedAt(updatedAt time.Time) { + c.UpdatedAt = updatedAt + c.require(clientFacingTestkitOrderFieldUpdatedAt) } -func (c *ClientFacingStepsChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingStepsChanged - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (c *ClientFacingTestkitOrder) UnmarshalJSON(data []byte) error { + type embed ClientFacingTestkitOrder + 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 = ClientFacingStepsChanged(value) + *c = ClientFacingTestkitOrder(unmarshaler.embed) + c.CreatedAt = unmarshaler.CreatedAt.Time() + c.UpdatedAt = unmarshaler.UpdatedAt.Time() extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -20222,18 +21902,22 @@ func (c *ClientFacingStepsChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingStepsChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingStepsChanged +func (c *ClientFacingTestkitOrder) MarshalJSON() ([]byte, error) { + type embed ClientFacingTestkitOrder var marshaler = struct { embed + CreatedAt *internal.DateTime `json:"created_at"` + UpdatedAt *internal.DateTime `json:"updated_at"` }{ - embed: embed(*c), + 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 *ClientFacingStepsChanged) String() string { +func (c *ClientFacingTestkitOrder) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -20245,86 +21929,114 @@ func (c *ClientFacingStepsChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingStepsChangedEventType string - -const ( - ClientFacingStepsChangedEventTypeDailyDataStepsCreated ClientFacingStepsChangedEventType = "daily.data.steps.created" - ClientFacingStepsChangedEventTypeDailyDataStepsUpdated ClientFacingStepsChangedEventType = "daily.data.steps.updated" -) - -func NewClientFacingStepsChangedEventTypeFromString(s string) (ClientFacingStepsChangedEventType, error) { - switch s { - case "daily.data.steps.created": - return ClientFacingStepsChangedEventTypeDailyDataStepsCreated, nil - case "daily.data.steps.updated": - return ClientFacingStepsChangedEventTypeDailyDataStepsUpdated, nil - } - var t ClientFacingStepsChangedEventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ClientFacingStepsChangedEventType) Ptr() *ClientFacingStepsChangedEventType { - return &c -} - var ( - clientFacingStepsHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingStepsHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingStepsHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingStepsHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingUserFieldUserId = big.NewInt(1 << 0) + clientFacingUserFieldTeamId = big.NewInt(1 << 1) + clientFacingUserFieldClientUserId = big.NewInt(1 << 2) + clientFacingUserFieldCreatedOn = big.NewInt(1 << 3) + clientFacingUserFieldConnectedSources = big.NewInt(1 << 4) + clientFacingUserFieldFallbackTimeZone = big.NewInt(1 << 5) + clientFacingUserFieldFallbackBirthDate = big.NewInt(1 << 6) + clientFacingUserFieldIngestionStart = big.NewInt(1 << 7) + clientFacingUserFieldIngestionEnd = big.NewInt(1 << 8) ) -type ClientFacingStepsHistoricalPullCompleted 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 ClientFacingUser 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"` + // Your team id. + TeamId string `json:"team_id" url:"team_id"` + // A unique ID representing the end user. Typically this will be a user ID 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 `json:"client_user_id" url:"client_user_id"` + // When your item is created + CreatedOn time.Time `json:"created_on" url:"created_on"` + // A list of the users connected sources. + ConnectedSources []*ConnectedSourceClientFacing `json:"connected_sources" url:"connected_sources"` + // Fallback time zone of the user, in the form of a valid IANA tzdatabase identifier (e.g., `Europe/London` or `America/Los_Angeles`). + // Used when pulling data from sources that are completely time zone agnostic (e.g., all time is relative to UTC clock, without any time zone attributions on data points). + FallbackTimeZone *FallbackTimeZone `json:"fallback_time_zone,omitempty" url:"fallback_time_zone,omitempty"` + // Fallback date of birth of the user, in YYYY-mm-dd format. Used for calculating max heartrate for providers that don not provide users' age. + FallbackBirthDate *FallbackBirthDate `json:"fallback_birth_date,omitempty" url:"fallback_birth_date,omitempty"` + // Starting bound for user [data ingestion bounds](https://docs.tryvital.io/wearables/providers/data-ingestion-bounds). + IngestionStart *string `json:"ingestion_start,omitempty" url:"ingestion_start,omitempty"` + // Ending bound for user [data ingestion bounds](https://docs.tryvital.io/wearables/providers/data-ingestion-bounds). + IngestionEnd *string `json:"ingestion_end,omitempty" url:"ingestion_end,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 *ClientFacingStepsHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingUser) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingStepsHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingUser) GetTeamId() string { if c == nil { return "" } - return c.ClientUserId + return c.TeamId } -func (c *ClientFacingStepsHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingUser) GetClientUserId() string { if c == nil { return "" } - return c.TeamId + return c.ClientUserId } -func (c *ClientFacingStepsHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingUser) GetCreatedOn() time.Time { + if c == nil { + return time.Time{} + } + return c.CreatedOn +} + +func (c *ClientFacingUser) GetConnectedSources() []*ConnectedSourceClientFacing { if c == nil { return nil } - return c.Data + return c.ConnectedSources } -func (c *ClientFacingStepsHistoricalPullCompleted) EventType() string { - return c.eventType +func (c *ClientFacingUser) GetFallbackTimeZone() *FallbackTimeZone { + if c == nil { + return nil + } + return c.FallbackTimeZone } -func (c *ClientFacingStepsHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingUser) GetFallbackBirthDate() *FallbackBirthDate { + if c == nil { + return nil + } + return c.FallbackBirthDate +} + +func (c *ClientFacingUser) GetIngestionStart() *string { + if c == nil { + return nil + } + return c.IngestionStart +} + +func (c *ClientFacingUser) GetIngestionEnd() *string { + if c == nil { + return nil + } + return c.IngestionEnd +} + +func (c *ClientFacingUser) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingStepsHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingUser) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -20333,49 +22045,81 @@ func (c *ClientFacingStepsHistoricalPullCompleted) 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 *ClientFacingStepsHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingUser) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingStepsHistoricalPullCompletedFieldUserId) + c.require(clientFacingUserFieldUserId) +} + +// 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 *ClientFacingUser) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingUserFieldTeamId) } // 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 *ClientFacingStepsHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingUser) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingStepsHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingUserFieldClientUserId) } -// SetTeamId sets the TeamId field and marks it as non-optional; +// SetCreatedOn sets the CreatedOn field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingStepsHistoricalPullCompleted) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingStepsHistoricalPullCompletedFieldTeamId) +func (c *ClientFacingUser) SetCreatedOn(createdOn time.Time) { + c.CreatedOn = createdOn + c.require(clientFacingUserFieldCreatedOn) } -// SetData sets the Data field and marks it as non-optional; +// SetConnectedSources sets the ConnectedSources field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingStepsHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { - c.Data = data - c.require(clientFacingStepsHistoricalPullCompletedFieldData) +func (c *ClientFacingUser) SetConnectedSources(connectedSources []*ConnectedSourceClientFacing) { + c.ConnectedSources = connectedSources + c.require(clientFacingUserFieldConnectedSources) } -func (c *ClientFacingStepsHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingStepsHistoricalPullCompleted +// SetFallbackTimeZone sets the FallbackTimeZone field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingUser) SetFallbackTimeZone(fallbackTimeZone *FallbackTimeZone) { + c.FallbackTimeZone = fallbackTimeZone + c.require(clientFacingUserFieldFallbackTimeZone) +} + +// SetFallbackBirthDate sets the FallbackBirthDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingUser) SetFallbackBirthDate(fallbackBirthDate *FallbackBirthDate) { + c.FallbackBirthDate = fallbackBirthDate + c.require(clientFacingUserFieldFallbackBirthDate) +} + +// SetIngestionStart sets the IngestionStart field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingUser) SetIngestionStart(ingestionStart *string) { + c.IngestionStart = ingestionStart + c.require(clientFacingUserFieldIngestionStart) +} + +// SetIngestionEnd sets the IngestionEnd field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientFacingUser) SetIngestionEnd(ingestionEnd *string) { + c.IngestionEnd = ingestionEnd + c.require(clientFacingUserFieldIngestionEnd) +} + +func (c *ClientFacingUser) UnmarshalJSON(data []byte) error { + type embed ClientFacingUser var unmarshaler = struct { embed - EventType string `json:"event_type"` + CreatedOn *internal.DateTime `json:"created_on"` }{ embed: embed(*c), } if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingStepsHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.steps.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.steps.created", unmarshaler.EventType) - } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + *c = ClientFacingUser(unmarshaler.embed) + c.CreatedOn = unmarshaler.CreatedOn.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } @@ -20384,20 +22128,20 @@ func (c *ClientFacingStepsHistoricalPullCompleted) UnmarshalJSON(data []byte) er return nil } -func (c *ClientFacingStepsHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingStepsHistoricalPullCompleted +func (c *ClientFacingUser) MarshalJSON() ([]byte, error) { + type embed ClientFacingUser var marshaler = struct { embed - EventType string `json:"event_type"` + CreatedOn *internal.DateTime `json:"created_on"` }{ embed: embed(*c), - EventType: "historical.data.steps.created", + CreatedOn: internal.NewDateTime(c.CreatedOn), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingStepsHistoricalPullCompleted) String() string { +func (c *ClientFacingUser) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -20410,19 +22154,19 @@ func (c *ClientFacingStepsHistoricalPullCompleted) String() string { } var ( - clientFacingStressLevelChangedFieldEventType = big.NewInt(1 << 0) - clientFacingStressLevelChangedFieldUserId = big.NewInt(1 << 1) - clientFacingStressLevelChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingStressLevelChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingStressLevelChangedFieldData = big.NewInt(1 << 4) + clientFacingUvExposureChangedFieldEventType = big.NewInt(1 << 0) + clientFacingUvExposureChangedFieldUserId = big.NewInt(1 << 1) + clientFacingUvExposureChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingUvExposureChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingUvExposureChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingStressLevelChanged struct { - EventType ClientFacingStressLevelChangedEventType `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 *GroupedStressLevel `json:"data" url:"data"` +type ClientFacingUvExposureChanged struct { + EventType ClientFacingUvExposureChangedEventType `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 *GroupedUvExposure `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -20431,46 +22175,46 @@ type ClientFacingStressLevelChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingStressLevelChanged) GetEventType() ClientFacingStressLevelChangedEventType { +func (c *ClientFacingUvExposureChanged) GetEventType() ClientFacingUvExposureChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingStressLevelChanged) GetUserId() string { +func (c *ClientFacingUvExposureChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingStressLevelChanged) GetClientUserId() string { +func (c *ClientFacingUvExposureChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingStressLevelChanged) GetTeamId() string { +func (c *ClientFacingUvExposureChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingStressLevelChanged) GetData() *GroupedStressLevel { +func (c *ClientFacingUvExposureChanged) GetData() *GroupedUvExposure { if c == nil { return nil } return c.Data } -func (c *ClientFacingStressLevelChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingUvExposureChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingStressLevelChanged) require(field *big.Int) { +func (c *ClientFacingUvExposureChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -20479,46 +22223,46 @@ func (c *ClientFacingStressLevelChanged) 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 *ClientFacingStressLevelChanged) SetEventType(eventType ClientFacingStressLevelChangedEventType) { +func (c *ClientFacingUvExposureChanged) SetEventType(eventType ClientFacingUvExposureChangedEventType) { c.EventType = eventType - c.require(clientFacingStressLevelChangedFieldEventType) + c.require(clientFacingUvExposureChangedFieldEventType) } // 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 *ClientFacingStressLevelChanged) SetUserId(userId string) { +func (c *ClientFacingUvExposureChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingStressLevelChangedFieldUserId) + c.require(clientFacingUvExposureChangedFieldUserId) } // 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 *ClientFacingStressLevelChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingUvExposureChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingStressLevelChangedFieldClientUserId) + c.require(clientFacingUvExposureChangedFieldClientUserId) } // 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 *ClientFacingStressLevelChanged) SetTeamId(teamId string) { +func (c *ClientFacingUvExposureChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingStressLevelChangedFieldTeamId) + c.require(clientFacingUvExposureChangedFieldTeamId) } // 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 *ClientFacingStressLevelChanged) SetData(data *GroupedStressLevel) { +func (c *ClientFacingUvExposureChanged) SetData(data *GroupedUvExposure) { c.Data = data - c.require(clientFacingStressLevelChangedFieldData) + c.require(clientFacingUvExposureChangedFieldData) } -func (c *ClientFacingStressLevelChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingStressLevelChanged +func (c *ClientFacingUvExposureChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingUvExposureChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingStressLevelChanged(value) + *c = ClientFacingUvExposureChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -20528,8 +22272,8 @@ func (c *ClientFacingStressLevelChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingStressLevelChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingStressLevelChanged +func (c *ClientFacingUvExposureChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingUvExposureChanged var marshaler = struct { embed }{ @@ -20539,7 +22283,7 @@ func (c *ClientFacingStressLevelChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingStressLevelChanged) String() string { +func (c *ClientFacingUvExposureChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -20551,36 +22295,36 @@ func (c *ClientFacingStressLevelChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingStressLevelChangedEventType string +type ClientFacingUvExposureChangedEventType string const ( - ClientFacingStressLevelChangedEventTypeDailyDataStressLevelCreated ClientFacingStressLevelChangedEventType = "daily.data.stress_level.created" - ClientFacingStressLevelChangedEventTypeDailyDataStressLevelUpdated ClientFacingStressLevelChangedEventType = "daily.data.stress_level.updated" + ClientFacingUvExposureChangedEventTypeDailyDataUvExposureCreated ClientFacingUvExposureChangedEventType = "daily.data.uv_exposure.created" + ClientFacingUvExposureChangedEventTypeDailyDataUvExposureUpdated ClientFacingUvExposureChangedEventType = "daily.data.uv_exposure.updated" ) -func NewClientFacingStressLevelChangedEventTypeFromString(s string) (ClientFacingStressLevelChangedEventType, error) { +func NewClientFacingUvExposureChangedEventTypeFromString(s string) (ClientFacingUvExposureChangedEventType, error) { switch s { - case "daily.data.stress_level.created": - return ClientFacingStressLevelChangedEventTypeDailyDataStressLevelCreated, nil - case "daily.data.stress_level.updated": - return ClientFacingStressLevelChangedEventTypeDailyDataStressLevelUpdated, nil + case "daily.data.uv_exposure.created": + return ClientFacingUvExposureChangedEventTypeDailyDataUvExposureCreated, nil + case "daily.data.uv_exposure.updated": + return ClientFacingUvExposureChangedEventTypeDailyDataUvExposureUpdated, nil } - var t ClientFacingStressLevelChangedEventType + var t ClientFacingUvExposureChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingStressLevelChangedEventType) Ptr() *ClientFacingStressLevelChangedEventType { +func (c ClientFacingUvExposureChangedEventType) Ptr() *ClientFacingUvExposureChangedEventType { return &c } var ( - clientFacingStressLevelHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingStressLevelHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingStressLevelHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingStressLevelHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingUvExposureHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingUvExposureHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingUvExposureHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingUvExposureHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingStressLevelHistoricalPullCompleted struct { +type ClientFacingUvExposureHistoricalPullCompleted 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"` @@ -20594,43 +22338,43 @@ type ClientFacingStressLevelHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingStressLevelHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingUvExposureHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingStressLevelHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingUvExposureHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingStressLevelHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingUvExposureHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingStressLevelHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingUvExposureHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingStressLevelHistoricalPullCompleted) EventType() string { +func (c *ClientFacingUvExposureHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingStressLevelHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingUvExposureHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingStressLevelHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingUvExposureHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -20639,34 +22383,34 @@ func (c *ClientFacingStressLevelHistoricalPullCompleted) 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 *ClientFacingStressLevelHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingUvExposureHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingStressLevelHistoricalPullCompletedFieldUserId) + c.require(clientFacingUvExposureHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingStressLevelHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingUvExposureHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingStressLevelHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingUvExposureHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingStressLevelHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingUvExposureHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingStressLevelHistoricalPullCompletedFieldTeamId) + c.require(clientFacingUvExposureHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingStressLevelHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingUvExposureHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingStressLevelHistoricalPullCompletedFieldData) + c.require(clientFacingUvExposureHistoricalPullCompletedFieldData) } -func (c *ClientFacingStressLevelHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingStressLevelHistoricalPullCompleted +func (c *ClientFacingUvExposureHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingUvExposureHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -20676,9 +22420,9 @@ func (c *ClientFacingStressLevelHistoricalPullCompleted) UnmarshalJSON(data []by if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingStressLevelHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.stress_level.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.stress_level.created", unmarshaler.EventType) + *c = ClientFacingUvExposureHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.uv_exposure.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.uv_exposure.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -20690,20 +22434,20 @@ func (c *ClientFacingStressLevelHistoricalPullCompleted) UnmarshalJSON(data []by return nil } -func (c *ClientFacingStressLevelHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingStressLevelHistoricalPullCompleted +func (c *ClientFacingUvExposureHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingUvExposureHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "historical.data.stress_level.created", + EventType: "historical.data.uv_exposure.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingStressLevelHistoricalPullCompleted) String() string { +func (c *ClientFacingUvExposureHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -20716,11 +22460,19 @@ func (c *ClientFacingStressLevelHistoricalPullCompleted) String() string { } var ( - clientFacingTestKitOrderDetailsFieldData = big.NewInt(1 << 0) + clientFacingVo2MaxChangedFieldEventType = big.NewInt(1 << 0) + clientFacingVo2MaxChangedFieldUserId = big.NewInt(1 << 1) + clientFacingVo2MaxChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingVo2MaxChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingVo2MaxChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingTestKitOrderDetails struct { - Data *ClientFacingTestkitOrder `json:"data,omitempty" url:"data,omitempty"` +type ClientFacingVo2MaxChanged struct { + EventType ClientFacingVo2MaxChangedEventType `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 *GroupedVo2Max `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -20729,177 +22481,94 @@ type ClientFacingTestKitOrderDetails struct { rawJSON json.RawMessage } -func (c *ClientFacingTestKitOrderDetails) GetData() *ClientFacingTestkitOrder { +func (c *ClientFacingVo2MaxChanged) GetEventType() ClientFacingVo2MaxChangedEventType { if c == nil { - return nil - } - return c.Data -} - -func (c *ClientFacingTestKitOrderDetails) GetExtraProperties() map[string]interface{} { - return c.extraProperties -} - -func (c *ClientFacingTestKitOrderDetails) 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 *ClientFacingTestKitOrderDetails) SetData(data *ClientFacingTestkitOrder) { - c.Data = data - c.require(clientFacingTestKitOrderDetailsFieldData) -} - -func (c *ClientFacingTestKitOrderDetails) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingTestKitOrderDetails - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = ClientFacingTestKitOrderDetails(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) - if err != nil { - return err - } - c.extraProperties = extraProperties - c.rawJSON = json.RawMessage(data) - return nil -} - -func (c *ClientFacingTestKitOrderDetails) MarshalJSON() ([]byte, error) { - type embed ClientFacingTestKitOrderDetails - var marshaler = struct { - embed - }{ - embed: embed(*c), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) - return json.Marshal(explicitMarshaler) -} - -func (c *ClientFacingTestKitOrderDetails) 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 "" } - return fmt.Sprintf("%#v", c) -} - -// Schema for a testkit order in the client facing API. -// -// To be used as part of a ClientFacingOrder. -var ( - clientFacingTestkitOrderFieldId = big.NewInt(1 << 0) - clientFacingTestkitOrderFieldShipment = big.NewInt(1 << 1) - clientFacingTestkitOrderFieldCreatedAt = big.NewInt(1 << 2) - clientFacingTestkitOrderFieldUpdatedAt = big.NewInt(1 << 3) -) - -type ClientFacingTestkitOrder struct { - // The Vital TestKit Order ID - Id string `json:"id" url:"id"` - // Shipment object - Shipment *ClientFacingShipment `json:"shipment,omitempty" url:"shipment,omitempty"` - 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 + return c.EventType } -func (c *ClientFacingTestkitOrder) GetId() string { +func (c *ClientFacingVo2MaxChanged) GetUserId() string { if c == nil { return "" } - return c.Id + return c.UserId } -func (c *ClientFacingTestkitOrder) GetShipment() *ClientFacingShipment { +func (c *ClientFacingVo2MaxChanged) GetClientUserId() string { if c == nil { - return nil + return "" } - return c.Shipment + return c.ClientUserId } -func (c *ClientFacingTestkitOrder) GetCreatedAt() time.Time { +func (c *ClientFacingVo2MaxChanged) GetTeamId() string { if c == nil { - return time.Time{} + return "" } - return c.CreatedAt + return c.TeamId } -func (c *ClientFacingTestkitOrder) GetUpdatedAt() time.Time { +func (c *ClientFacingVo2MaxChanged) GetData() *GroupedVo2Max { if c == nil { - return time.Time{} + return nil } - return c.UpdatedAt + return c.Data } -func (c *ClientFacingTestkitOrder) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingVo2MaxChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingTestkitOrder) require(field *big.Int) { +func (c *ClientFacingVo2MaxChanged) 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; +// 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 *ClientFacingTestkitOrder) SetId(id string) { - c.Id = id - c.require(clientFacingTestkitOrderFieldId) +func (c *ClientFacingVo2MaxChanged) SetEventType(eventType ClientFacingVo2MaxChangedEventType) { + c.EventType = eventType + c.require(clientFacingVo2MaxChangedFieldEventType) } -// SetShipment sets the Shipment 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 *ClientFacingTestkitOrder) SetShipment(shipment *ClientFacingShipment) { - c.Shipment = shipment - c.require(clientFacingTestkitOrderFieldShipment) +func (c *ClientFacingVo2MaxChanged) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingVo2MaxChangedFieldUserId) } -// 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 *ClientFacingTestkitOrder) SetCreatedAt(createdAt time.Time) { - c.CreatedAt = createdAt - c.require(clientFacingTestkitOrderFieldCreatedAt) +func (c *ClientFacingVo2MaxChanged) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingVo2MaxChangedFieldClientUserId) } -// 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 *ClientFacingTestkitOrder) SetUpdatedAt(updatedAt time.Time) { - c.UpdatedAt = updatedAt - c.require(clientFacingTestkitOrderFieldUpdatedAt) +func (c *ClientFacingVo2MaxChanged) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingVo2MaxChangedFieldTeamId) } -func (c *ClientFacingTestkitOrder) UnmarshalJSON(data []byte) error { - type embed ClientFacingTestkitOrder - 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 { +// 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 *ClientFacingVo2MaxChanged) SetData(data *GroupedVo2Max) { + c.Data = data + c.require(clientFacingVo2MaxChangedFieldData) +} + +func (c *ClientFacingVo2MaxChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingVo2MaxChanged + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingTestkitOrder(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c.UpdatedAt = unmarshaler.UpdatedAt.Time() + *c = ClientFacingVo2MaxChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -20909,22 +22578,18 @@ func (c *ClientFacingTestkitOrder) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingTestkitOrder) MarshalJSON() ([]byte, error) { - type embed ClientFacingTestkitOrder +func (c *ClientFacingVo2MaxChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingVo2MaxChanged 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), + embed: embed(*c), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingTestkitOrder) String() string { +func (c *ClientFacingVo2MaxChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -20936,114 +22601,86 @@ func (c *ClientFacingTestkitOrder) String() string { return fmt.Sprintf("%#v", c) } +type ClientFacingVo2MaxChangedEventType string + +const ( + ClientFacingVo2MaxChangedEventTypeDailyDataVo2MaxCreated ClientFacingVo2MaxChangedEventType = "daily.data.vo2_max.created" + ClientFacingVo2MaxChangedEventTypeDailyDataVo2MaxUpdated ClientFacingVo2MaxChangedEventType = "daily.data.vo2_max.updated" +) + +func NewClientFacingVo2MaxChangedEventTypeFromString(s string) (ClientFacingVo2MaxChangedEventType, error) { + switch s { + case "daily.data.vo2_max.created": + return ClientFacingVo2MaxChangedEventTypeDailyDataVo2MaxCreated, nil + case "daily.data.vo2_max.updated": + return ClientFacingVo2MaxChangedEventTypeDailyDataVo2MaxUpdated, nil + } + var t ClientFacingVo2MaxChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingVo2MaxChangedEventType) Ptr() *ClientFacingVo2MaxChangedEventType { + return &c +} + var ( - clientFacingUserFieldUserId = big.NewInt(1 << 0) - clientFacingUserFieldTeamId = big.NewInt(1 << 1) - clientFacingUserFieldClientUserId = big.NewInt(1 << 2) - clientFacingUserFieldCreatedOn = big.NewInt(1 << 3) - clientFacingUserFieldConnectedSources = big.NewInt(1 << 4) - clientFacingUserFieldFallbackTimeZone = big.NewInt(1 << 5) - clientFacingUserFieldFallbackBirthDate = big.NewInt(1 << 6) - clientFacingUserFieldIngestionStart = big.NewInt(1 << 7) - clientFacingUserFieldIngestionEnd = big.NewInt(1 << 8) + clientFacingVo2MaxHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingVo2MaxHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingVo2MaxHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingVo2MaxHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingUser 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"` - // Your team id. - TeamId string `json:"team_id" url:"team_id"` - // A unique ID representing the end user. Typically this will be a user ID 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 `json:"client_user_id" url:"client_user_id"` - // When your item is created - CreatedOn time.Time `json:"created_on" url:"created_on"` - // A list of the users connected sources. - ConnectedSources []*ConnectedSourceClientFacing `json:"connected_sources" url:"connected_sources"` - // Fallback time zone of the user, in the form of a valid IANA tzdatabase identifier (e.g., `Europe/London` or `America/Los_Angeles`). - // Used when pulling data from sources that are completely time zone agnostic (e.g., all time is relative to UTC clock, without any time zone attributions on data points). - FallbackTimeZone *FallbackTimeZone `json:"fallback_time_zone,omitempty" url:"fallback_time_zone,omitempty"` - // Fallback date of birth of the user, in YYYY-mm-dd format. Used for calculating max heartrate for providers that don not provide users' age. - FallbackBirthDate *FallbackBirthDate `json:"fallback_birth_date,omitempty" url:"fallback_birth_date,omitempty"` - // Starting bound for user [data ingestion bounds](https://docs.tryvital.io/wearables/providers/data-ingestion-bounds). - IngestionStart *string `json:"ingestion_start,omitempty" url:"ingestion_start,omitempty"` - // Ending bound for user [data ingestion bounds](https://docs.tryvital.io/wearables/providers/data-ingestion-bounds). - IngestionEnd *string `json:"ingestion_end,omitempty" url:"ingestion_end,omitempty"` +type ClientFacingVo2MaxHistoricalPullCompleted 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 *ClientFacingUser) GetUserId() string { +func (c *ClientFacingVo2MaxHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingUser) GetTeamId() string { - if c == nil { - return "" - } - return c.TeamId -} - -func (c *ClientFacingUser) GetClientUserId() string { +func (c *ClientFacingVo2MaxHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingUser) GetCreatedOn() time.Time { - if c == nil { - return time.Time{} - } - return c.CreatedOn -} - -func (c *ClientFacingUser) GetConnectedSources() []*ConnectedSourceClientFacing { - if c == nil { - return nil - } - return c.ConnectedSources -} - -func (c *ClientFacingUser) GetFallbackTimeZone() *FallbackTimeZone { - if c == nil { - return nil - } - return c.FallbackTimeZone -} - -func (c *ClientFacingUser) GetFallbackBirthDate() *FallbackBirthDate { +func (c *ClientFacingVo2MaxHistoricalPullCompleted) GetTeamId() string { if c == nil { - return nil + return "" } - return c.FallbackBirthDate + return c.TeamId } -func (c *ClientFacingUser) GetIngestionStart() *string { +func (c *ClientFacingVo2MaxHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } - return c.IngestionStart + return c.Data } -func (c *ClientFacingUser) GetIngestionEnd() *string { - if c == nil { - return nil - } - return c.IngestionEnd +func (c *ClientFacingVo2MaxHistoricalPullCompleted) EventType() string { + return c.eventType } -func (c *ClientFacingUser) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingVo2MaxHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingUser) require(field *big.Int) { +func (c *ClientFacingVo2MaxHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -21052,81 +22689,49 @@ func (c *ClientFacingUser) 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 *ClientFacingUser) SetUserId(userId string) { +func (c *ClientFacingVo2MaxHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingUserFieldUserId) -} - -// 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 *ClientFacingUser) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingUserFieldTeamId) + c.require(clientFacingVo2MaxHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingUser) SetClientUserId(clientUserId string) { +func (c *ClientFacingVo2MaxHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingUserFieldClientUserId) -} - -// SetCreatedOn sets the CreatedOn field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingUser) SetCreatedOn(createdOn time.Time) { - c.CreatedOn = createdOn - c.require(clientFacingUserFieldCreatedOn) -} - -// SetConnectedSources sets the ConnectedSources field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingUser) SetConnectedSources(connectedSources []*ConnectedSourceClientFacing) { - c.ConnectedSources = connectedSources - c.require(clientFacingUserFieldConnectedSources) -} - -// SetFallbackTimeZone sets the FallbackTimeZone field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingUser) SetFallbackTimeZone(fallbackTimeZone *FallbackTimeZone) { - c.FallbackTimeZone = fallbackTimeZone - c.require(clientFacingUserFieldFallbackTimeZone) -} - -// SetFallbackBirthDate sets the FallbackBirthDate field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingUser) SetFallbackBirthDate(fallbackBirthDate *FallbackBirthDate) { - c.FallbackBirthDate = fallbackBirthDate - c.require(clientFacingUserFieldFallbackBirthDate) + c.require(clientFacingVo2MaxHistoricalPullCompletedFieldClientUserId) } -// SetIngestionStart sets the IngestionStart 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 *ClientFacingUser) SetIngestionStart(ingestionStart *string) { - c.IngestionStart = ingestionStart - c.require(clientFacingUserFieldIngestionStart) +func (c *ClientFacingVo2MaxHistoricalPullCompleted) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingVo2MaxHistoricalPullCompletedFieldTeamId) } -// SetIngestionEnd sets the IngestionEnd 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 *ClientFacingUser) SetIngestionEnd(ingestionEnd *string) { - c.IngestionEnd = ingestionEnd - c.require(clientFacingUserFieldIngestionEnd) +func (c *ClientFacingVo2MaxHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { + c.Data = data + c.require(clientFacingVo2MaxHistoricalPullCompletedFieldData) } -func (c *ClientFacingUser) UnmarshalJSON(data []byte) error { - type embed ClientFacingUser +func (c *ClientFacingVo2MaxHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingVo2MaxHistoricalPullCompleted var unmarshaler = struct { embed - CreatedOn *internal.DateTime `json:"created_on"` + EventType string `json:"event_type"` }{ embed: embed(*c), } if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingUser(unmarshaler.embed) - c.CreatedOn = unmarshaler.CreatedOn.Time() - extraProperties, err := internal.ExtractExtraProperties(data, *c) + *c = ClientFacingVo2MaxHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.vo2_max.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.vo2_max.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") if err != nil { return err } @@ -21135,20 +22740,20 @@ func (c *ClientFacingUser) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingUser) MarshalJSON() ([]byte, error) { - type embed ClientFacingUser +func (c *ClientFacingVo2MaxHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingVo2MaxHistoricalPullCompleted var marshaler = struct { embed - CreatedOn *internal.DateTime `json:"created_on"` + EventType string `json:"event_type"` }{ embed: embed(*c), - CreatedOn: internal.NewDateTime(c.CreatedOn), + EventType: "historical.data.vo2_max.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingUser) String() string { +func (c *ClientFacingVo2MaxHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -21161,19 +22766,19 @@ func (c *ClientFacingUser) String() string { } var ( - clientFacingUvExposureChangedFieldEventType = big.NewInt(1 << 0) - clientFacingUvExposureChangedFieldUserId = big.NewInt(1 << 1) - clientFacingUvExposureChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingUvExposureChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingUvExposureChangedFieldData = big.NewInt(1 << 4) + clientFacingWaistCircumferenceChangedFieldEventType = big.NewInt(1 << 0) + clientFacingWaistCircumferenceChangedFieldUserId = big.NewInt(1 << 1) + clientFacingWaistCircumferenceChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingWaistCircumferenceChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingWaistCircumferenceChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingUvExposureChanged struct { - EventType ClientFacingUvExposureChangedEventType `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 *GroupedUvExposure `json:"data" url:"data"` +type ClientFacingWaistCircumferenceChanged struct { + EventType ClientFacingWaistCircumferenceChangedEventType `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 *GroupedWaistCircumference `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -21182,46 +22787,46 @@ type ClientFacingUvExposureChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingUvExposureChanged) GetEventType() ClientFacingUvExposureChangedEventType { +func (c *ClientFacingWaistCircumferenceChanged) GetEventType() ClientFacingWaistCircumferenceChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingUvExposureChanged) GetUserId() string { +func (c *ClientFacingWaistCircumferenceChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingUvExposureChanged) GetClientUserId() string { +func (c *ClientFacingWaistCircumferenceChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingUvExposureChanged) GetTeamId() string { +func (c *ClientFacingWaistCircumferenceChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingUvExposureChanged) GetData() *GroupedUvExposure { +func (c *ClientFacingWaistCircumferenceChanged) GetData() *GroupedWaistCircumference { if c == nil { return nil } return c.Data } -func (c *ClientFacingUvExposureChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWaistCircumferenceChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingUvExposureChanged) require(field *big.Int) { +func (c *ClientFacingWaistCircumferenceChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -21230,46 +22835,46 @@ func (c *ClientFacingUvExposureChanged) 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 *ClientFacingUvExposureChanged) SetEventType(eventType ClientFacingUvExposureChangedEventType) { +func (c *ClientFacingWaistCircumferenceChanged) SetEventType(eventType ClientFacingWaistCircumferenceChangedEventType) { c.EventType = eventType - c.require(clientFacingUvExposureChangedFieldEventType) + c.require(clientFacingWaistCircumferenceChangedFieldEventType) } // 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 *ClientFacingUvExposureChanged) SetUserId(userId string) { +func (c *ClientFacingWaistCircumferenceChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingUvExposureChangedFieldUserId) + c.require(clientFacingWaistCircumferenceChangedFieldUserId) } // 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 *ClientFacingUvExposureChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingWaistCircumferenceChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingUvExposureChangedFieldClientUserId) + c.require(clientFacingWaistCircumferenceChangedFieldClientUserId) } // 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 *ClientFacingUvExposureChanged) SetTeamId(teamId string) { +func (c *ClientFacingWaistCircumferenceChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingUvExposureChangedFieldTeamId) + c.require(clientFacingWaistCircumferenceChangedFieldTeamId) } // 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 *ClientFacingUvExposureChanged) SetData(data *GroupedUvExposure) { +func (c *ClientFacingWaistCircumferenceChanged) SetData(data *GroupedWaistCircumference) { c.Data = data - c.require(clientFacingUvExposureChangedFieldData) + c.require(clientFacingWaistCircumferenceChangedFieldData) } -func (c *ClientFacingUvExposureChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingUvExposureChanged +func (c *ClientFacingWaistCircumferenceChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingWaistCircumferenceChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingUvExposureChanged(value) + *c = ClientFacingWaistCircumferenceChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -21279,8 +22884,8 @@ func (c *ClientFacingUvExposureChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingUvExposureChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingUvExposureChanged +func (c *ClientFacingWaistCircumferenceChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingWaistCircumferenceChanged var marshaler = struct { embed }{ @@ -21290,7 +22895,7 @@ func (c *ClientFacingUvExposureChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingUvExposureChanged) String() string { +func (c *ClientFacingWaistCircumferenceChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -21302,36 +22907,36 @@ func (c *ClientFacingUvExposureChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingUvExposureChangedEventType string +type ClientFacingWaistCircumferenceChangedEventType string const ( - ClientFacingUvExposureChangedEventTypeDailyDataUvExposureCreated ClientFacingUvExposureChangedEventType = "daily.data.uv_exposure.created" - ClientFacingUvExposureChangedEventTypeDailyDataUvExposureUpdated ClientFacingUvExposureChangedEventType = "daily.data.uv_exposure.updated" + ClientFacingWaistCircumferenceChangedEventTypeDailyDataWaistCircumferenceCreated ClientFacingWaistCircumferenceChangedEventType = "daily.data.waist_circumference.created" + ClientFacingWaistCircumferenceChangedEventTypeDailyDataWaistCircumferenceUpdated ClientFacingWaistCircumferenceChangedEventType = "daily.data.waist_circumference.updated" ) -func NewClientFacingUvExposureChangedEventTypeFromString(s string) (ClientFacingUvExposureChangedEventType, error) { +func NewClientFacingWaistCircumferenceChangedEventTypeFromString(s string) (ClientFacingWaistCircumferenceChangedEventType, error) { switch s { - case "daily.data.uv_exposure.created": - return ClientFacingUvExposureChangedEventTypeDailyDataUvExposureCreated, nil - case "daily.data.uv_exposure.updated": - return ClientFacingUvExposureChangedEventTypeDailyDataUvExposureUpdated, nil + case "daily.data.waist_circumference.created": + return ClientFacingWaistCircumferenceChangedEventTypeDailyDataWaistCircumferenceCreated, nil + case "daily.data.waist_circumference.updated": + return ClientFacingWaistCircumferenceChangedEventTypeDailyDataWaistCircumferenceUpdated, nil } - var t ClientFacingUvExposureChangedEventType + var t ClientFacingWaistCircumferenceChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingUvExposureChangedEventType) Ptr() *ClientFacingUvExposureChangedEventType { +func (c ClientFacingWaistCircumferenceChangedEventType) Ptr() *ClientFacingWaistCircumferenceChangedEventType { return &c } var ( - clientFacingUvExposureHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingUvExposureHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingUvExposureHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingUvExposureHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingWaistCircumferenceHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingWaistCircumferenceHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingWaistCircumferenceHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingWaistCircumferenceHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingUvExposureHistoricalPullCompleted struct { +type ClientFacingWaistCircumferenceHistoricalPullCompleted 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"` @@ -21345,43 +22950,43 @@ type ClientFacingUvExposureHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingUvExposureHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingUvExposureHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingUvExposureHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingUvExposureHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingUvExposureHistoricalPullCompleted) EventType() string { +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingUvExposureHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingUvExposureHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -21390,34 +22995,34 @@ func (c *ClientFacingUvExposureHistoricalPullCompleted) 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 *ClientFacingUvExposureHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingUvExposureHistoricalPullCompletedFieldUserId) + c.require(clientFacingWaistCircumferenceHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingUvExposureHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingUvExposureHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingWaistCircumferenceHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingUvExposureHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingUvExposureHistoricalPullCompletedFieldTeamId) + c.require(clientFacingWaistCircumferenceHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingUvExposureHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingUvExposureHistoricalPullCompletedFieldData) + c.require(clientFacingWaistCircumferenceHistoricalPullCompletedFieldData) } -func (c *ClientFacingUvExposureHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingUvExposureHistoricalPullCompleted +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingWaistCircumferenceHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -21427,9 +23032,9 @@ func (c *ClientFacingUvExposureHistoricalPullCompleted) UnmarshalJSON(data []byt if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingUvExposureHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.uv_exposure.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.uv_exposure.created", unmarshaler.EventType) + *c = ClientFacingWaistCircumferenceHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.waist_circumference.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.waist_circumference.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -21441,20 +23046,20 @@ func (c *ClientFacingUvExposureHistoricalPullCompleted) UnmarshalJSON(data []byt return nil } -func (c *ClientFacingUvExposureHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingUvExposureHistoricalPullCompleted +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingWaistCircumferenceHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "historical.data.uv_exposure.created", + EventType: "historical.data.waist_circumference.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingUvExposureHistoricalPullCompleted) String() string { +func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -21467,19 +23072,11 @@ func (c *ClientFacingUvExposureHistoricalPullCompleted) String() string { } var ( - clientFacingVo2MaxChangedFieldEventType = big.NewInt(1 << 0) - clientFacingVo2MaxChangedFieldUserId = big.NewInt(1 << 1) - clientFacingVo2MaxChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingVo2MaxChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingVo2MaxChangedFieldData = big.NewInt(1 << 4) + clientFacingWalkInOrderDetailsFieldData = big.NewInt(1 << 0) ) -type ClientFacingVo2MaxChanged struct { - EventType ClientFacingVo2MaxChangedEventType `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 *GroupedVo2Max `json:"data" url:"data"` +type ClientFacingWalkInOrderDetails struct { + Data *ClientFacingWalkInTestOrder `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:"-"` @@ -21488,94 +23085,38 @@ type ClientFacingVo2MaxChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingVo2MaxChanged) GetEventType() ClientFacingVo2MaxChangedEventType { - if c == nil { - return "" - } - return c.EventType -} - -func (c *ClientFacingVo2MaxChanged) GetUserId() string { - if c == nil { - return "" - } - return c.UserId -} - -func (c *ClientFacingVo2MaxChanged) GetClientUserId() string { - if c == nil { - return "" - } - return c.ClientUserId -} - -func (c *ClientFacingVo2MaxChanged) GetTeamId() string { - if c == nil { - return "" - } - return c.TeamId -} - -func (c *ClientFacingVo2MaxChanged) GetData() *GroupedVo2Max { +func (c *ClientFacingWalkInOrderDetails) GetData() *ClientFacingWalkInTestOrder { if c == nil { return nil } return c.Data } -func (c *ClientFacingVo2MaxChanged) GetExtraProperties() map[string]interface{} { - return c.extraProperties -} - -func (c *ClientFacingVo2MaxChanged) 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 *ClientFacingVo2MaxChanged) SetEventType(eventType ClientFacingVo2MaxChangedEventType) { - c.EventType = eventType - c.require(clientFacingVo2MaxChangedFieldEventType) -} - -// 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 *ClientFacingVo2MaxChanged) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingVo2MaxChangedFieldUserId) -} - -// 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 *ClientFacingVo2MaxChanged) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingVo2MaxChangedFieldClientUserId) +func (c *ClientFacingWalkInOrderDetails) GetExtraProperties() map[string]interface{} { + return c.extraProperties } -// 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 *ClientFacingVo2MaxChanged) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingVo2MaxChangedFieldTeamId) +func (c *ClientFacingWalkInOrderDetails) 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 *ClientFacingVo2MaxChanged) SetData(data *GroupedVo2Max) { +func (c *ClientFacingWalkInOrderDetails) SetData(data *ClientFacingWalkInTestOrder) { c.Data = data - c.require(clientFacingVo2MaxChangedFieldData) + c.require(clientFacingWalkInOrderDetailsFieldData) } -func (c *ClientFacingVo2MaxChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingVo2MaxChanged +func (c *ClientFacingWalkInOrderDetails) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingWalkInOrderDetails var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingVo2MaxChanged(value) + *c = ClientFacingWalkInOrderDetails(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -21585,8 +23126,8 @@ func (c *ClientFacingVo2MaxChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingVo2MaxChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingVo2MaxChanged +func (c *ClientFacingWalkInOrderDetails) MarshalJSON() ([]byte, error) { + type embed ClientFacingWalkInOrderDetails var marshaler = struct { embed }{ @@ -21596,7 +23137,7 @@ func (c *ClientFacingVo2MaxChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingVo2MaxChanged) String() string { +func (c *ClientFacingWalkInOrderDetails) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -21608,137 +23149,113 @@ func (c *ClientFacingVo2MaxChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingVo2MaxChangedEventType string - -const ( - ClientFacingVo2MaxChangedEventTypeDailyDataVo2MaxCreated ClientFacingVo2MaxChangedEventType = "daily.data.vo2_max.created" - ClientFacingVo2MaxChangedEventTypeDailyDataVo2MaxUpdated ClientFacingVo2MaxChangedEventType = "daily.data.vo2_max.updated" -) - -func NewClientFacingVo2MaxChangedEventTypeFromString(s string) (ClientFacingVo2MaxChangedEventType, error) { - switch s { - case "daily.data.vo2_max.created": - return ClientFacingVo2MaxChangedEventTypeDailyDataVo2MaxCreated, nil - case "daily.data.vo2_max.updated": - return ClientFacingVo2MaxChangedEventTypeDailyDataVo2MaxUpdated, nil - } - var t ClientFacingVo2MaxChangedEventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ClientFacingVo2MaxChangedEventType) Ptr() *ClientFacingVo2MaxChangedEventType { - return &c -} - +// Schema for a walk-in test order in the client facing API. +// +// To be used as part of a ClientFacingOrder. var ( - clientFacingVo2MaxHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingVo2MaxHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingVo2MaxHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingVo2MaxHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingWalkInTestOrderFieldId = big.NewInt(1 << 0) + clientFacingWalkInTestOrderFieldCreatedAt = big.NewInt(1 << 1) + clientFacingWalkInTestOrderFieldUpdatedAt = big.NewInt(1 << 2) + clientFacingWalkInTestOrderFieldAppointmentId = big.NewInt(1 << 3) ) -type ClientFacingVo2MaxHistoricalPullCompleted 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 ClientFacingWalkInTestOrder struct { + // The Vital walk-in test 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"` + AppointmentId *string `json:"appointment_id,omitempty" url:"appointment_id,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 *ClientFacingVo2MaxHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingWalkInTestOrder) GetId() string { if c == nil { return "" } - return c.UserId + return c.Id } -func (c *ClientFacingVo2MaxHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingWalkInTestOrder) GetCreatedAt() time.Time { if c == nil { - return "" + return time.Time{} } - return c.ClientUserId + return c.CreatedAt } -func (c *ClientFacingVo2MaxHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingWalkInTestOrder) GetUpdatedAt() time.Time { if c == nil { - return "" + return time.Time{} } - return c.TeamId + return c.UpdatedAt } -func (c *ClientFacingVo2MaxHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingWalkInTestOrder) GetAppointmentId() *string { if c == nil { return nil } - return c.Data -} - -func (c *ClientFacingVo2MaxHistoricalPullCompleted) EventType() string { - return c.eventType + return c.AppointmentId } -func (c *ClientFacingVo2MaxHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWalkInTestOrder) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingVo2MaxHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingWalkInTestOrder) 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; +// 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 *ClientFacingVo2MaxHistoricalPullCompleted) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingVo2MaxHistoricalPullCompletedFieldUserId) +func (c *ClientFacingWalkInTestOrder) SetId(id string) { + c.Id = id + c.require(clientFacingWalkInTestOrderFieldId) } -// SetClientUserId sets the ClientUserId 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 *ClientFacingVo2MaxHistoricalPullCompleted) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingVo2MaxHistoricalPullCompletedFieldClientUserId) +func (c *ClientFacingWalkInTestOrder) SetCreatedAt(createdAt time.Time) { + c.CreatedAt = createdAt + c.require(clientFacingWalkInTestOrderFieldCreatedAt) } -// SetTeamId sets the TeamId field and marks it as non-optional; +// 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 *ClientFacingVo2MaxHistoricalPullCompleted) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingVo2MaxHistoricalPullCompletedFieldTeamId) +func (c *ClientFacingWalkInTestOrder) SetUpdatedAt(updatedAt time.Time) { + c.UpdatedAt = updatedAt + c.require(clientFacingWalkInTestOrderFieldUpdatedAt) } -// SetData sets the Data field and marks it as non-optional; +// SetAppointmentId sets the AppointmentId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingVo2MaxHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { - c.Data = data - c.require(clientFacingVo2MaxHistoricalPullCompletedFieldData) +func (c *ClientFacingWalkInTestOrder) SetAppointmentId(appointmentId *string) { + c.AppointmentId = appointmentId + c.require(clientFacingWalkInTestOrderFieldAppointmentId) } -func (c *ClientFacingVo2MaxHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingVo2MaxHistoricalPullCompleted +func (c *ClientFacingWalkInTestOrder) UnmarshalJSON(data []byte) error { + type embed ClientFacingWalkInTestOrder var unmarshaler = struct { embed - EventType string `json:"event_type"` + 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 = ClientFacingVo2MaxHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.vo2_max.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.vo2_max.created", unmarshaler.EventType) - } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + *c = ClientFacingWalkInTestOrder(unmarshaler.embed) + c.CreatedAt = unmarshaler.CreatedAt.Time() + c.UpdatedAt = unmarshaler.UpdatedAt.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } @@ -21747,20 +23264,22 @@ func (c *ClientFacingVo2MaxHistoricalPullCompleted) UnmarshalJSON(data []byte) e return nil } -func (c *ClientFacingVo2MaxHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingVo2MaxHistoricalPullCompleted +func (c *ClientFacingWalkInTestOrder) MarshalJSON() ([]byte, error) { + type embed ClientFacingWalkInTestOrder var marshaler = struct { embed - EventType string `json:"event_type"` + CreatedAt *internal.DateTime `json:"created_at"` + UpdatedAt *internal.DateTime `json:"updated_at"` }{ embed: embed(*c), - EventType: "historical.data.vo2_max.created", + CreatedAt: internal.NewDateTime(c.CreatedAt), + UpdatedAt: internal.NewDateTime(c.UpdatedAt), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingVo2MaxHistoricalPullCompleted) String() string { +func (c *ClientFacingWalkInTestOrder) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -21773,19 +23292,19 @@ func (c *ClientFacingVo2MaxHistoricalPullCompleted) String() string { } var ( - clientFacingWaistCircumferenceChangedFieldEventType = big.NewInt(1 << 0) - clientFacingWaistCircumferenceChangedFieldUserId = big.NewInt(1 << 1) - clientFacingWaistCircumferenceChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingWaistCircumferenceChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingWaistCircumferenceChangedFieldData = big.NewInt(1 << 4) + clientFacingWaterChangedFieldEventType = big.NewInt(1 << 0) + clientFacingWaterChangedFieldUserId = big.NewInt(1 << 1) + clientFacingWaterChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingWaterChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingWaterChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingWaistCircumferenceChanged struct { - EventType ClientFacingWaistCircumferenceChangedEventType `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 *GroupedWaistCircumference `json:"data" url:"data"` +type ClientFacingWaterChanged struct { + EventType ClientFacingWaterChangedEventType `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 *GroupedWater `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -21794,46 +23313,46 @@ type ClientFacingWaistCircumferenceChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingWaistCircumferenceChanged) GetEventType() ClientFacingWaistCircumferenceChangedEventType { +func (c *ClientFacingWaterChanged) GetEventType() ClientFacingWaterChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingWaistCircumferenceChanged) GetUserId() string { +func (c *ClientFacingWaterChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWaistCircumferenceChanged) GetClientUserId() string { +func (c *ClientFacingWaterChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWaistCircumferenceChanged) GetTeamId() string { +func (c *ClientFacingWaterChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWaistCircumferenceChanged) GetData() *GroupedWaistCircumference { +func (c *ClientFacingWaterChanged) GetData() *GroupedWater { if c == nil { return nil } return c.Data } -func (c *ClientFacingWaistCircumferenceChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWaterChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWaistCircumferenceChanged) require(field *big.Int) { +func (c *ClientFacingWaterChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -21842,46 +23361,46 @@ func (c *ClientFacingWaistCircumferenceChanged) 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 *ClientFacingWaistCircumferenceChanged) SetEventType(eventType ClientFacingWaistCircumferenceChangedEventType) { +func (c *ClientFacingWaterChanged) SetEventType(eventType ClientFacingWaterChangedEventType) { c.EventType = eventType - c.require(clientFacingWaistCircumferenceChangedFieldEventType) + c.require(clientFacingWaterChangedFieldEventType) } // 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 *ClientFacingWaistCircumferenceChanged) SetUserId(userId string) { +func (c *ClientFacingWaterChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWaistCircumferenceChangedFieldUserId) + c.require(clientFacingWaterChangedFieldUserId) } // 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 *ClientFacingWaistCircumferenceChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingWaterChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWaistCircumferenceChangedFieldClientUserId) + c.require(clientFacingWaterChangedFieldClientUserId) } // 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 *ClientFacingWaistCircumferenceChanged) SetTeamId(teamId string) { +func (c *ClientFacingWaterChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWaistCircumferenceChangedFieldTeamId) + c.require(clientFacingWaterChangedFieldTeamId) } // 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 *ClientFacingWaistCircumferenceChanged) SetData(data *GroupedWaistCircumference) { +func (c *ClientFacingWaterChanged) SetData(data *GroupedWater) { c.Data = data - c.require(clientFacingWaistCircumferenceChangedFieldData) + c.require(clientFacingWaterChangedFieldData) } -func (c *ClientFacingWaistCircumferenceChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingWaistCircumferenceChanged +func (c *ClientFacingWaterChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingWaterChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingWaistCircumferenceChanged(value) + *c = ClientFacingWaterChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -21891,8 +23410,8 @@ func (c *ClientFacingWaistCircumferenceChanged) UnmarshalJSON(data []byte) error return nil } -func (c *ClientFacingWaistCircumferenceChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingWaistCircumferenceChanged +func (c *ClientFacingWaterChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingWaterChanged var marshaler = struct { embed }{ @@ -21902,7 +23421,7 @@ func (c *ClientFacingWaistCircumferenceChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWaistCircumferenceChanged) String() string { +func (c *ClientFacingWaterChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -21914,36 +23433,36 @@ func (c *ClientFacingWaistCircumferenceChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingWaistCircumferenceChangedEventType string +type ClientFacingWaterChangedEventType string const ( - ClientFacingWaistCircumferenceChangedEventTypeDailyDataWaistCircumferenceCreated ClientFacingWaistCircumferenceChangedEventType = "daily.data.waist_circumference.created" - ClientFacingWaistCircumferenceChangedEventTypeDailyDataWaistCircumferenceUpdated ClientFacingWaistCircumferenceChangedEventType = "daily.data.waist_circumference.updated" + ClientFacingWaterChangedEventTypeDailyDataWaterCreated ClientFacingWaterChangedEventType = "daily.data.water.created" + ClientFacingWaterChangedEventTypeDailyDataWaterUpdated ClientFacingWaterChangedEventType = "daily.data.water.updated" ) -func NewClientFacingWaistCircumferenceChangedEventTypeFromString(s string) (ClientFacingWaistCircumferenceChangedEventType, error) { +func NewClientFacingWaterChangedEventTypeFromString(s string) (ClientFacingWaterChangedEventType, error) { switch s { - case "daily.data.waist_circumference.created": - return ClientFacingWaistCircumferenceChangedEventTypeDailyDataWaistCircumferenceCreated, nil - case "daily.data.waist_circumference.updated": - return ClientFacingWaistCircumferenceChangedEventTypeDailyDataWaistCircumferenceUpdated, nil + case "daily.data.water.created": + return ClientFacingWaterChangedEventTypeDailyDataWaterCreated, nil + case "daily.data.water.updated": + return ClientFacingWaterChangedEventTypeDailyDataWaterUpdated, nil } - var t ClientFacingWaistCircumferenceChangedEventType + var t ClientFacingWaterChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingWaistCircumferenceChangedEventType) Ptr() *ClientFacingWaistCircumferenceChangedEventType { +func (c ClientFacingWaterChangedEventType) Ptr() *ClientFacingWaterChangedEventType { return &c } var ( - clientFacingWaistCircumferenceHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingWaistCircumferenceHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingWaistCircumferenceHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingWaistCircumferenceHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingWaterHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingWaterHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingWaterHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingWaterHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingWaistCircumferenceHistoricalPullCompleted struct { +type ClientFacingWaterHistoricalPullCompleted 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"` @@ -21957,43 +23476,43 @@ type ClientFacingWaistCircumferenceHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingWaterHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingWaterHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingWaterHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingWaterHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) EventType() string { +func (c *ClientFacingWaterHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWaterHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingWaterHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -22002,34 +23521,34 @@ func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) require(field *b // 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 *ClientFacingWaistCircumferenceHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingWaterHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWaistCircumferenceHistoricalPullCompletedFieldUserId) + c.require(clientFacingWaterHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingWaistCircumferenceHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingWaterHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWaistCircumferenceHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingWaterHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingWaistCircumferenceHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingWaterHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWaistCircumferenceHistoricalPullCompletedFieldTeamId) + c.require(clientFacingWaterHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingWaistCircumferenceHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingWaterHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingWaistCircumferenceHistoricalPullCompletedFieldData) + c.require(clientFacingWaterHistoricalPullCompletedFieldData) } -func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingWaistCircumferenceHistoricalPullCompleted +func (c *ClientFacingWaterHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingWaterHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -22039,9 +23558,9 @@ func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) UnmarshalJSON(da if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingWaistCircumferenceHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.waist_circumference.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.waist_circumference.created", unmarshaler.EventType) + *c = ClientFacingWaterHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.water.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.water.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -22053,20 +23572,20 @@ func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) UnmarshalJSON(da return nil } -func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingWaistCircumferenceHistoricalPullCompleted +func (c *ClientFacingWaterHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingWaterHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "historical.data.waist_circumference.created", + EventType: "historical.data.water.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) String() string { +func (c *ClientFacingWaterHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -22079,11 +23598,19 @@ func (c *ClientFacingWaistCircumferenceHistoricalPullCompleted) String() string } var ( - clientFacingWalkInOrderDetailsFieldData = big.NewInt(1 << 0) + clientFacingWeightChangedFieldEventType = big.NewInt(1 << 0) + clientFacingWeightChangedFieldUserId = big.NewInt(1 << 1) + clientFacingWeightChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingWeightChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingWeightChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingWalkInOrderDetails struct { - Data *ClientFacingWalkInTestOrder `json:"data,omitempty" url:"data,omitempty"` +type ClientFacingWeightChanged struct { + EventType ClientFacingWeightChangedEventType `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 *GroupedBodyWeight `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -22092,38 +23619,94 @@ type ClientFacingWalkInOrderDetails struct { rawJSON json.RawMessage } -func (c *ClientFacingWalkInOrderDetails) GetData() *ClientFacingWalkInTestOrder { +func (c *ClientFacingWeightChanged) GetEventType() ClientFacingWeightChangedEventType { + if c == nil { + return "" + } + return c.EventType +} + +func (c *ClientFacingWeightChanged) GetUserId() string { + if c == nil { + return "" + } + return c.UserId +} + +func (c *ClientFacingWeightChanged) GetClientUserId() string { + if c == nil { + return "" + } + return c.ClientUserId +} + +func (c *ClientFacingWeightChanged) GetTeamId() string { + if c == nil { + return "" + } + return c.TeamId +} + +func (c *ClientFacingWeightChanged) GetData() *GroupedBodyWeight { if c == nil { return nil } return c.Data } -func (c *ClientFacingWalkInOrderDetails) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWeightChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWalkInOrderDetails) require(field *big.Int) { +func (c *ClientFacingWeightChanged) 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 *ClientFacingWeightChanged) SetEventType(eventType ClientFacingWeightChangedEventType) { + c.EventType = eventType + c.require(clientFacingWeightChangedFieldEventType) +} + +// 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 *ClientFacingWeightChanged) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingWeightChangedFieldUserId) +} + +// 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 *ClientFacingWeightChanged) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingWeightChangedFieldClientUserId) +} + +// 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 *ClientFacingWeightChanged) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingWeightChangedFieldTeamId) +} + // 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 *ClientFacingWalkInOrderDetails) SetData(data *ClientFacingWalkInTestOrder) { +func (c *ClientFacingWeightChanged) SetData(data *GroupedBodyWeight) { c.Data = data - c.require(clientFacingWalkInOrderDetailsFieldData) + c.require(clientFacingWeightChangedFieldData) } -func (c *ClientFacingWalkInOrderDetails) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingWalkInOrderDetails +func (c *ClientFacingWeightChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingWeightChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingWalkInOrderDetails(value) + *c = ClientFacingWeightChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -22133,8 +23716,8 @@ func (c *ClientFacingWalkInOrderDetails) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingWalkInOrderDetails) MarshalJSON() ([]byte, error) { - type embed ClientFacingWalkInOrderDetails +func (c *ClientFacingWeightChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingWeightChanged var marshaler = struct { embed }{ @@ -22144,7 +23727,7 @@ func (c *ClientFacingWalkInOrderDetails) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWalkInOrderDetails) String() string { +func (c *ClientFacingWeightChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -22156,113 +23739,137 @@ func (c *ClientFacingWalkInOrderDetails) String() string { return fmt.Sprintf("%#v", c) } -// Schema for a walk-in test order in the client facing API. -// -// To be used as part of a ClientFacingOrder. +type ClientFacingWeightChangedEventType string + +const ( + ClientFacingWeightChangedEventTypeDailyDataWeightCreated ClientFacingWeightChangedEventType = "daily.data.weight.created" + ClientFacingWeightChangedEventTypeDailyDataWeightUpdated ClientFacingWeightChangedEventType = "daily.data.weight.updated" +) + +func NewClientFacingWeightChangedEventTypeFromString(s string) (ClientFacingWeightChangedEventType, error) { + switch s { + case "daily.data.weight.created": + return ClientFacingWeightChangedEventTypeDailyDataWeightCreated, nil + case "daily.data.weight.updated": + return ClientFacingWeightChangedEventTypeDailyDataWeightUpdated, nil + } + var t ClientFacingWeightChangedEventType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingWeightChangedEventType) Ptr() *ClientFacingWeightChangedEventType { + return &c +} + var ( - clientFacingWalkInTestOrderFieldId = big.NewInt(1 << 0) - clientFacingWalkInTestOrderFieldCreatedAt = big.NewInt(1 << 1) - clientFacingWalkInTestOrderFieldUpdatedAt = big.NewInt(1 << 2) - clientFacingWalkInTestOrderFieldAppointmentId = big.NewInt(1 << 3) + clientFacingWeightHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingWeightHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingWeightHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingWeightHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingWalkInTestOrder struct { - // The Vital walk-in test 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"` - AppointmentId *string `json:"appointment_id,omitempty" url:"appointment_id,omitempty"` +type ClientFacingWeightHistoricalPullCompleted 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 *ClientFacingWalkInTestOrder) GetId() string { +func (c *ClientFacingWeightHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } - return c.Id + return c.UserId } -func (c *ClientFacingWalkInTestOrder) GetCreatedAt() time.Time { +func (c *ClientFacingWeightHistoricalPullCompleted) GetClientUserId() string { if c == nil { - return time.Time{} + return "" } - return c.CreatedAt + return c.ClientUserId } -func (c *ClientFacingWalkInTestOrder) GetUpdatedAt() time.Time { +func (c *ClientFacingWeightHistoricalPullCompleted) GetTeamId() string { if c == nil { - return time.Time{} + return "" } - return c.UpdatedAt + return c.TeamId } -func (c *ClientFacingWalkInTestOrder) GetAppointmentId() *string { +func (c *ClientFacingWeightHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } - return c.AppointmentId + return c.Data } -func (c *ClientFacingWalkInTestOrder) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWeightHistoricalPullCompleted) EventType() string { + return c.eventType +} + +func (c *ClientFacingWeightHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWalkInTestOrder) require(field *big.Int) { +func (c *ClientFacingWeightHistoricalPullCompleted) 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 *ClientFacingWalkInTestOrder) SetId(id string) { - c.Id = id - c.require(clientFacingWalkInTestOrderFieldId) +func (c *ClientFacingWeightHistoricalPullCompleted) SetUserId(userId string) { + c.UserId = userId + c.require(clientFacingWeightHistoricalPullCompletedFieldUserId) } -// 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 *ClientFacingWalkInTestOrder) SetCreatedAt(createdAt time.Time) { - c.CreatedAt = createdAt - c.require(clientFacingWalkInTestOrderFieldCreatedAt) +func (c *ClientFacingWeightHistoricalPullCompleted) SetClientUserId(clientUserId string) { + c.ClientUserId = clientUserId + c.require(clientFacingWeightHistoricalPullCompletedFieldClientUserId) } -// 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 *ClientFacingWalkInTestOrder) SetUpdatedAt(updatedAt time.Time) { - c.UpdatedAt = updatedAt - c.require(clientFacingWalkInTestOrderFieldUpdatedAt) +func (c *ClientFacingWeightHistoricalPullCompleted) SetTeamId(teamId string) { + c.TeamId = teamId + c.require(clientFacingWeightHistoricalPullCompletedFieldTeamId) } -// SetAppointmentId sets the AppointmentId 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 *ClientFacingWalkInTestOrder) SetAppointmentId(appointmentId *string) { - c.AppointmentId = appointmentId - c.require(clientFacingWalkInTestOrderFieldAppointmentId) +func (c *ClientFacingWeightHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { + c.Data = data + c.require(clientFacingWeightHistoricalPullCompletedFieldData) } -func (c *ClientFacingWalkInTestOrder) UnmarshalJSON(data []byte) error { - type embed ClientFacingWalkInTestOrder +func (c *ClientFacingWeightHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingWeightHistoricalPullCompleted 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 = ClientFacingWalkInTestOrder(unmarshaler.embed) - c.CreatedAt = unmarshaler.CreatedAt.Time() - c.UpdatedAt = unmarshaler.UpdatedAt.Time() - extraProperties, err := internal.ExtractExtraProperties(data, *c) + *c = ClientFacingWeightHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.weight.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.weight.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") if err != nil { return err } @@ -22271,22 +23878,20 @@ func (c *ClientFacingWalkInTestOrder) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingWalkInTestOrder) MarshalJSON() ([]byte, error) { - type embed ClientFacingWalkInTestOrder +func (c *ClientFacingWeightHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingWeightHistoricalPullCompleted 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.weight.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWalkInTestOrder) String() string { +func (c *ClientFacingWeightHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -22299,19 +23904,19 @@ func (c *ClientFacingWalkInTestOrder) String() string { } var ( - clientFacingWaterChangedFieldEventType = big.NewInt(1 << 0) - clientFacingWaterChangedFieldUserId = big.NewInt(1 << 1) - clientFacingWaterChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingWaterChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingWaterChangedFieldData = big.NewInt(1 << 4) + clientFacingWheelchairPushChangedFieldEventType = big.NewInt(1 << 0) + clientFacingWheelchairPushChangedFieldUserId = big.NewInt(1 << 1) + clientFacingWheelchairPushChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingWheelchairPushChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingWheelchairPushChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingWaterChanged struct { - EventType ClientFacingWaterChangedEventType `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 *GroupedWater `json:"data" url:"data"` +type ClientFacingWheelchairPushChanged struct { + EventType ClientFacingWheelchairPushChangedEventType `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 *GroupedWheelchairPush `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -22320,46 +23925,46 @@ type ClientFacingWaterChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingWaterChanged) GetEventType() ClientFacingWaterChangedEventType { +func (c *ClientFacingWheelchairPushChanged) GetEventType() ClientFacingWheelchairPushChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingWaterChanged) GetUserId() string { +func (c *ClientFacingWheelchairPushChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWaterChanged) GetClientUserId() string { +func (c *ClientFacingWheelchairPushChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWaterChanged) GetTeamId() string { +func (c *ClientFacingWheelchairPushChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWaterChanged) GetData() *GroupedWater { +func (c *ClientFacingWheelchairPushChanged) GetData() *GroupedWheelchairPush { if c == nil { return nil } return c.Data } -func (c *ClientFacingWaterChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWheelchairPushChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWaterChanged) require(field *big.Int) { +func (c *ClientFacingWheelchairPushChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -22368,46 +23973,46 @@ func (c *ClientFacingWaterChanged) 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 *ClientFacingWaterChanged) SetEventType(eventType ClientFacingWaterChangedEventType) { +func (c *ClientFacingWheelchairPushChanged) SetEventType(eventType ClientFacingWheelchairPushChangedEventType) { c.EventType = eventType - c.require(clientFacingWaterChangedFieldEventType) + c.require(clientFacingWheelchairPushChangedFieldEventType) } // 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 *ClientFacingWaterChanged) SetUserId(userId string) { +func (c *ClientFacingWheelchairPushChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWaterChangedFieldUserId) + c.require(clientFacingWheelchairPushChangedFieldUserId) } // 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 *ClientFacingWaterChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingWheelchairPushChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWaterChangedFieldClientUserId) + c.require(clientFacingWheelchairPushChangedFieldClientUserId) } // 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 *ClientFacingWaterChanged) SetTeamId(teamId string) { +func (c *ClientFacingWheelchairPushChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWaterChangedFieldTeamId) + c.require(clientFacingWheelchairPushChangedFieldTeamId) } // 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 *ClientFacingWaterChanged) SetData(data *GroupedWater) { +func (c *ClientFacingWheelchairPushChanged) SetData(data *GroupedWheelchairPush) { c.Data = data - c.require(clientFacingWaterChangedFieldData) + c.require(clientFacingWheelchairPushChangedFieldData) } -func (c *ClientFacingWaterChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingWaterChanged +func (c *ClientFacingWheelchairPushChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingWheelchairPushChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingWaterChanged(value) + *c = ClientFacingWheelchairPushChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -22417,8 +24022,8 @@ func (c *ClientFacingWaterChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingWaterChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingWaterChanged +func (c *ClientFacingWheelchairPushChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingWheelchairPushChanged var marshaler = struct { embed }{ @@ -22428,7 +24033,7 @@ func (c *ClientFacingWaterChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWaterChanged) String() string { +func (c *ClientFacingWheelchairPushChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -22440,36 +24045,36 @@ func (c *ClientFacingWaterChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingWaterChangedEventType string +type ClientFacingWheelchairPushChangedEventType string const ( - ClientFacingWaterChangedEventTypeDailyDataWaterCreated ClientFacingWaterChangedEventType = "daily.data.water.created" - ClientFacingWaterChangedEventTypeDailyDataWaterUpdated ClientFacingWaterChangedEventType = "daily.data.water.updated" + ClientFacingWheelchairPushChangedEventTypeDailyDataWheelchairPushCreated ClientFacingWheelchairPushChangedEventType = "daily.data.wheelchair_push.created" + ClientFacingWheelchairPushChangedEventTypeDailyDataWheelchairPushUpdated ClientFacingWheelchairPushChangedEventType = "daily.data.wheelchair_push.updated" ) -func NewClientFacingWaterChangedEventTypeFromString(s string) (ClientFacingWaterChangedEventType, error) { +func NewClientFacingWheelchairPushChangedEventTypeFromString(s string) (ClientFacingWheelchairPushChangedEventType, error) { switch s { - case "daily.data.water.created": - return ClientFacingWaterChangedEventTypeDailyDataWaterCreated, nil - case "daily.data.water.updated": - return ClientFacingWaterChangedEventTypeDailyDataWaterUpdated, nil + case "daily.data.wheelchair_push.created": + return ClientFacingWheelchairPushChangedEventTypeDailyDataWheelchairPushCreated, nil + case "daily.data.wheelchair_push.updated": + return ClientFacingWheelchairPushChangedEventTypeDailyDataWheelchairPushUpdated, nil } - var t ClientFacingWaterChangedEventType + var t ClientFacingWheelchairPushChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingWaterChangedEventType) Ptr() *ClientFacingWaterChangedEventType { +func (c ClientFacingWheelchairPushChangedEventType) Ptr() *ClientFacingWheelchairPushChangedEventType { return &c } var ( - clientFacingWaterHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingWaterHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingWaterHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingWaterHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingWheelchairPushHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingWheelchairPushHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingWheelchairPushHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingWheelchairPushHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingWaterHistoricalPullCompleted struct { +type ClientFacingWheelchairPushHistoricalPullCompleted 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"` @@ -22483,43 +24088,43 @@ type ClientFacingWaterHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingWaterHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWaterHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWaterHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWaterHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingWaterHistoricalPullCompleted) EventType() string { +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingWaterHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWaterHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -22528,34 +24133,34 @@ func (c *ClientFacingWaterHistoricalPullCompleted) 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 *ClientFacingWaterHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWaterHistoricalPullCompletedFieldUserId) + c.require(clientFacingWheelchairPushHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingWaterHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWaterHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingWheelchairPushHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingWaterHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWaterHistoricalPullCompletedFieldTeamId) + c.require(clientFacingWheelchairPushHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingWaterHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingWaterHistoricalPullCompletedFieldData) + c.require(clientFacingWheelchairPushHistoricalPullCompletedFieldData) } -func (c *ClientFacingWaterHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingWaterHistoricalPullCompleted +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingWheelchairPushHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -22565,9 +24170,9 @@ func (c *ClientFacingWaterHistoricalPullCompleted) UnmarshalJSON(data []byte) er if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingWaterHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.water.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.water.created", unmarshaler.EventType) + *c = ClientFacingWheelchairPushHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.wheelchair_push.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.wheelchair_push.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -22579,20 +24184,20 @@ func (c *ClientFacingWaterHistoricalPullCompleted) UnmarshalJSON(data []byte) er return nil } -func (c *ClientFacingWaterHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingWaterHistoricalPullCompleted +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingWheelchairPushHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "historical.data.water.created", + EventType: "historical.data.wheelchair_push.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWaterHistoricalPullCompleted) String() string { +func (c *ClientFacingWheelchairPushHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -22605,19 +24210,19 @@ func (c *ClientFacingWaterHistoricalPullCompleted) String() string { } var ( - clientFacingWeightChangedFieldEventType = big.NewInt(1 << 0) - clientFacingWeightChangedFieldUserId = big.NewInt(1 << 1) - clientFacingWeightChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingWeightChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingWeightChangedFieldData = big.NewInt(1 << 4) + clientFacingWorkoutDistanceChangedFieldEventType = big.NewInt(1 << 0) + clientFacingWorkoutDistanceChangedFieldUserId = big.NewInt(1 << 1) + clientFacingWorkoutDistanceChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingWorkoutDistanceChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingWorkoutDistanceChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingWeightChanged struct { - EventType ClientFacingWeightChangedEventType `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 *GroupedBodyWeight `json:"data" url:"data"` +type ClientFacingWorkoutDistanceChanged struct { + EventType ClientFacingWorkoutDistanceChangedEventType `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 *GroupedWorkoutDistance `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -22626,46 +24231,46 @@ type ClientFacingWeightChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingWeightChanged) GetEventType() ClientFacingWeightChangedEventType { +func (c *ClientFacingWorkoutDistanceChanged) GetEventType() ClientFacingWorkoutDistanceChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingWeightChanged) GetUserId() string { +func (c *ClientFacingWorkoutDistanceChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWeightChanged) GetClientUserId() string { +func (c *ClientFacingWorkoutDistanceChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWeightChanged) GetTeamId() string { +func (c *ClientFacingWorkoutDistanceChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWeightChanged) GetData() *GroupedBodyWeight { +func (c *ClientFacingWorkoutDistanceChanged) GetData() *GroupedWorkoutDistance { if c == nil { return nil } return c.Data } -func (c *ClientFacingWeightChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWorkoutDistanceChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWeightChanged) require(field *big.Int) { +func (c *ClientFacingWorkoutDistanceChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -22674,46 +24279,46 @@ func (c *ClientFacingWeightChanged) 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 *ClientFacingWeightChanged) SetEventType(eventType ClientFacingWeightChangedEventType) { +func (c *ClientFacingWorkoutDistanceChanged) SetEventType(eventType ClientFacingWorkoutDistanceChangedEventType) { c.EventType = eventType - c.require(clientFacingWeightChangedFieldEventType) + c.require(clientFacingWorkoutDistanceChangedFieldEventType) } // 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 *ClientFacingWeightChanged) SetUserId(userId string) { +func (c *ClientFacingWorkoutDistanceChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWeightChangedFieldUserId) + c.require(clientFacingWorkoutDistanceChangedFieldUserId) } // 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 *ClientFacingWeightChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingWorkoutDistanceChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWeightChangedFieldClientUserId) + c.require(clientFacingWorkoutDistanceChangedFieldClientUserId) } // 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 *ClientFacingWeightChanged) SetTeamId(teamId string) { +func (c *ClientFacingWorkoutDistanceChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWeightChangedFieldTeamId) + c.require(clientFacingWorkoutDistanceChangedFieldTeamId) } // 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 *ClientFacingWeightChanged) SetData(data *GroupedBodyWeight) { +func (c *ClientFacingWorkoutDistanceChanged) SetData(data *GroupedWorkoutDistance) { c.Data = data - c.require(clientFacingWeightChangedFieldData) + c.require(clientFacingWorkoutDistanceChangedFieldData) } -func (c *ClientFacingWeightChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingWeightChanged +func (c *ClientFacingWorkoutDistanceChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingWorkoutDistanceChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingWeightChanged(value) + *c = ClientFacingWorkoutDistanceChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -22723,8 +24328,8 @@ func (c *ClientFacingWeightChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingWeightChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingWeightChanged +func (c *ClientFacingWorkoutDistanceChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingWorkoutDistanceChanged var marshaler = struct { embed }{ @@ -22734,7 +24339,7 @@ func (c *ClientFacingWeightChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWeightChanged) String() string { +func (c *ClientFacingWorkoutDistanceChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -22746,36 +24351,36 @@ func (c *ClientFacingWeightChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingWeightChangedEventType string +type ClientFacingWorkoutDistanceChangedEventType string const ( - ClientFacingWeightChangedEventTypeDailyDataWeightCreated ClientFacingWeightChangedEventType = "daily.data.weight.created" - ClientFacingWeightChangedEventTypeDailyDataWeightUpdated ClientFacingWeightChangedEventType = "daily.data.weight.updated" + ClientFacingWorkoutDistanceChangedEventTypeDailyDataWorkoutDistanceCreated ClientFacingWorkoutDistanceChangedEventType = "daily.data.workout_distance.created" + ClientFacingWorkoutDistanceChangedEventTypeDailyDataWorkoutDistanceUpdated ClientFacingWorkoutDistanceChangedEventType = "daily.data.workout_distance.updated" ) -func NewClientFacingWeightChangedEventTypeFromString(s string) (ClientFacingWeightChangedEventType, error) { +func NewClientFacingWorkoutDistanceChangedEventTypeFromString(s string) (ClientFacingWorkoutDistanceChangedEventType, error) { switch s { - case "daily.data.weight.created": - return ClientFacingWeightChangedEventTypeDailyDataWeightCreated, nil - case "daily.data.weight.updated": - return ClientFacingWeightChangedEventTypeDailyDataWeightUpdated, nil + case "daily.data.workout_distance.created": + return ClientFacingWorkoutDistanceChangedEventTypeDailyDataWorkoutDistanceCreated, nil + case "daily.data.workout_distance.updated": + return ClientFacingWorkoutDistanceChangedEventTypeDailyDataWorkoutDistanceUpdated, nil } - var t ClientFacingWeightChangedEventType + var t ClientFacingWorkoutDistanceChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingWeightChangedEventType) Ptr() *ClientFacingWeightChangedEventType { +func (c ClientFacingWorkoutDistanceChangedEventType) Ptr() *ClientFacingWorkoutDistanceChangedEventType { return &c } var ( - clientFacingWeightHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingWeightHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingWeightHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingWeightHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingWorkoutDistanceHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingWorkoutDistanceHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingWorkoutDistanceHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingWorkoutDistanceHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingWeightHistoricalPullCompleted struct { +type ClientFacingWorkoutDistanceHistoricalPullCompleted 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"` @@ -22789,43 +24394,43 @@ type ClientFacingWeightHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingWeightHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWeightHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWeightHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWeightHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingWeightHistoricalPullCompleted) EventType() string { +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingWeightHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWeightHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -22834,34 +24439,34 @@ func (c *ClientFacingWeightHistoricalPullCompleted) 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 *ClientFacingWeightHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWeightHistoricalPullCompletedFieldUserId) + c.require(clientFacingWorkoutDistanceHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingWeightHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWeightHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingWorkoutDistanceHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingWeightHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWeightHistoricalPullCompletedFieldTeamId) + c.require(clientFacingWorkoutDistanceHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingWeightHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingWeightHistoricalPullCompletedFieldData) + c.require(clientFacingWorkoutDistanceHistoricalPullCompletedFieldData) } -func (c *ClientFacingWeightHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingWeightHistoricalPullCompleted +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingWorkoutDistanceHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -22871,9 +24476,9 @@ func (c *ClientFacingWeightHistoricalPullCompleted) UnmarshalJSON(data []byte) e if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingWeightHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.weight.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.weight.created", unmarshaler.EventType) + *c = ClientFacingWorkoutDistanceHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.workout_distance.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.workout_distance.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -22885,20 +24490,20 @@ func (c *ClientFacingWeightHistoricalPullCompleted) UnmarshalJSON(data []byte) e return nil } -func (c *ClientFacingWeightHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingWeightHistoricalPullCompleted +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingWorkoutDistanceHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "historical.data.weight.created", + EventType: "historical.data.workout_distance.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWeightHistoricalPullCompleted) String() string { +func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -22911,19 +24516,19 @@ func (c *ClientFacingWeightHistoricalPullCompleted) String() string { } var ( - clientFacingWheelchairPushChangedFieldEventType = big.NewInt(1 << 0) - clientFacingWheelchairPushChangedFieldUserId = big.NewInt(1 << 1) - clientFacingWheelchairPushChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingWheelchairPushChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingWheelchairPushChangedFieldData = big.NewInt(1 << 4) + clientFacingWorkoutDurationChangedFieldEventType = big.NewInt(1 << 0) + clientFacingWorkoutDurationChangedFieldUserId = big.NewInt(1 << 1) + clientFacingWorkoutDurationChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingWorkoutDurationChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingWorkoutDurationChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingWheelchairPushChanged struct { - EventType ClientFacingWheelchairPushChangedEventType `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 *GroupedWheelchairPush `json:"data" url:"data"` +type ClientFacingWorkoutDurationChanged struct { + EventType ClientFacingWorkoutDurationChangedEventType `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 *GroupedWorkoutDuration `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -22932,46 +24537,46 @@ type ClientFacingWheelchairPushChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingWheelchairPushChanged) GetEventType() ClientFacingWheelchairPushChangedEventType { +func (c *ClientFacingWorkoutDurationChanged) GetEventType() ClientFacingWorkoutDurationChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingWheelchairPushChanged) GetUserId() string { +func (c *ClientFacingWorkoutDurationChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWheelchairPushChanged) GetClientUserId() string { +func (c *ClientFacingWorkoutDurationChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWheelchairPushChanged) GetTeamId() string { +func (c *ClientFacingWorkoutDurationChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWheelchairPushChanged) GetData() *GroupedWheelchairPush { +func (c *ClientFacingWorkoutDurationChanged) GetData() *GroupedWorkoutDuration { if c == nil { return nil } return c.Data } -func (c *ClientFacingWheelchairPushChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWorkoutDurationChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWheelchairPushChanged) require(field *big.Int) { +func (c *ClientFacingWorkoutDurationChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -22980,46 +24585,46 @@ func (c *ClientFacingWheelchairPushChanged) 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 *ClientFacingWheelchairPushChanged) SetEventType(eventType ClientFacingWheelchairPushChangedEventType) { +func (c *ClientFacingWorkoutDurationChanged) SetEventType(eventType ClientFacingWorkoutDurationChangedEventType) { c.EventType = eventType - c.require(clientFacingWheelchairPushChangedFieldEventType) + c.require(clientFacingWorkoutDurationChangedFieldEventType) } // 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 *ClientFacingWheelchairPushChanged) SetUserId(userId string) { +func (c *ClientFacingWorkoutDurationChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWheelchairPushChangedFieldUserId) + c.require(clientFacingWorkoutDurationChangedFieldUserId) } // 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 *ClientFacingWheelchairPushChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingWorkoutDurationChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWheelchairPushChangedFieldClientUserId) + c.require(clientFacingWorkoutDurationChangedFieldClientUserId) } // 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 *ClientFacingWheelchairPushChanged) SetTeamId(teamId string) { +func (c *ClientFacingWorkoutDurationChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWheelchairPushChangedFieldTeamId) + c.require(clientFacingWorkoutDurationChangedFieldTeamId) } // 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 *ClientFacingWheelchairPushChanged) SetData(data *GroupedWheelchairPush) { +func (c *ClientFacingWorkoutDurationChanged) SetData(data *GroupedWorkoutDuration) { c.Data = data - c.require(clientFacingWheelchairPushChangedFieldData) + c.require(clientFacingWorkoutDurationChangedFieldData) } -func (c *ClientFacingWheelchairPushChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingWheelchairPushChanged +func (c *ClientFacingWorkoutDurationChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingWorkoutDurationChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingWheelchairPushChanged(value) + *c = ClientFacingWorkoutDurationChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -23029,8 +24634,8 @@ func (c *ClientFacingWheelchairPushChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingWheelchairPushChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingWheelchairPushChanged +func (c *ClientFacingWorkoutDurationChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingWorkoutDurationChanged var marshaler = struct { embed }{ @@ -23040,7 +24645,7 @@ func (c *ClientFacingWheelchairPushChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWheelchairPushChanged) String() string { +func (c *ClientFacingWorkoutDurationChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -23052,36 +24657,36 @@ func (c *ClientFacingWheelchairPushChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingWheelchairPushChangedEventType string +type ClientFacingWorkoutDurationChangedEventType string const ( - ClientFacingWheelchairPushChangedEventTypeDailyDataWheelchairPushCreated ClientFacingWheelchairPushChangedEventType = "daily.data.wheelchair_push.created" - ClientFacingWheelchairPushChangedEventTypeDailyDataWheelchairPushUpdated ClientFacingWheelchairPushChangedEventType = "daily.data.wheelchair_push.updated" + ClientFacingWorkoutDurationChangedEventTypeDailyDataWorkoutDurationCreated ClientFacingWorkoutDurationChangedEventType = "daily.data.workout_duration.created" + ClientFacingWorkoutDurationChangedEventTypeDailyDataWorkoutDurationUpdated ClientFacingWorkoutDurationChangedEventType = "daily.data.workout_duration.updated" ) -func NewClientFacingWheelchairPushChangedEventTypeFromString(s string) (ClientFacingWheelchairPushChangedEventType, error) { +func NewClientFacingWorkoutDurationChangedEventTypeFromString(s string) (ClientFacingWorkoutDurationChangedEventType, error) { switch s { - case "daily.data.wheelchair_push.created": - return ClientFacingWheelchairPushChangedEventTypeDailyDataWheelchairPushCreated, nil - case "daily.data.wheelchair_push.updated": - return ClientFacingWheelchairPushChangedEventTypeDailyDataWheelchairPushUpdated, nil + case "daily.data.workout_duration.created": + return ClientFacingWorkoutDurationChangedEventTypeDailyDataWorkoutDurationCreated, nil + case "daily.data.workout_duration.updated": + return ClientFacingWorkoutDurationChangedEventTypeDailyDataWorkoutDurationUpdated, nil } - var t ClientFacingWheelchairPushChangedEventType + var t ClientFacingWorkoutDurationChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingWheelchairPushChangedEventType) Ptr() *ClientFacingWheelchairPushChangedEventType { +func (c ClientFacingWorkoutDurationChangedEventType) Ptr() *ClientFacingWorkoutDurationChangedEventType { return &c } var ( - clientFacingWheelchairPushHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingWheelchairPushHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingWheelchairPushHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingWheelchairPushHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingWorkoutDurationHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingWorkoutDurationHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingWorkoutDurationHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingWorkoutDurationHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingWheelchairPushHistoricalPullCompleted struct { +type ClientFacingWorkoutDurationHistoricalPullCompleted 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"` @@ -23095,43 +24700,43 @@ type ClientFacingWheelchairPushHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingWheelchairPushHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWheelchairPushHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWheelchairPushHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWheelchairPushHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingWheelchairPushHistoricalPullCompleted) EventType() string { +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingWheelchairPushHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWheelchairPushHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -23140,34 +24745,34 @@ func (c *ClientFacingWheelchairPushHistoricalPullCompleted) require(field *big.I // 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 *ClientFacingWheelchairPushHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWheelchairPushHistoricalPullCompletedFieldUserId) + c.require(clientFacingWorkoutDurationHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingWheelchairPushHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWheelchairPushHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingWorkoutDurationHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingWheelchairPushHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWheelchairPushHistoricalPullCompletedFieldTeamId) + c.require(clientFacingWorkoutDurationHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingWheelchairPushHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingWheelchairPushHistoricalPullCompletedFieldData) + c.require(clientFacingWorkoutDurationHistoricalPullCompletedFieldData) } -func (c *ClientFacingWheelchairPushHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingWheelchairPushHistoricalPullCompleted +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingWorkoutDurationHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -23177,9 +24782,9 @@ func (c *ClientFacingWheelchairPushHistoricalPullCompleted) UnmarshalJSON(data [ if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingWheelchairPushHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.wheelchair_push.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.wheelchair_push.created", unmarshaler.EventType) + *c = ClientFacingWorkoutDurationHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.workout_duration.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.workout_duration.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -23191,20 +24796,20 @@ func (c *ClientFacingWheelchairPushHistoricalPullCompleted) UnmarshalJSON(data [ return nil } -func (c *ClientFacingWheelchairPushHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingWheelchairPushHistoricalPullCompleted +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingWorkoutDurationHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "historical.data.wheelchair_push.created", + EventType: "historical.data.workout_duration.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWheelchairPushHistoricalPullCompleted) String() string { +func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -23217,19 +24822,19 @@ func (c *ClientFacingWheelchairPushHistoricalPullCompleted) String() string { } var ( - clientFacingWorkoutDistanceChangedFieldEventType = big.NewInt(1 << 0) - clientFacingWorkoutDistanceChangedFieldUserId = big.NewInt(1 << 1) - clientFacingWorkoutDistanceChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingWorkoutDistanceChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingWorkoutDistanceChangedFieldData = big.NewInt(1 << 4) + clientFacingWorkoutStreamChangedFieldEventType = big.NewInt(1 << 0) + clientFacingWorkoutStreamChangedFieldUserId = big.NewInt(1 << 1) + clientFacingWorkoutStreamChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingWorkoutStreamChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingWorkoutStreamChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingWorkoutDistanceChanged struct { - EventType ClientFacingWorkoutDistanceChangedEventType `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 *GroupedWorkoutDistance `json:"data" url:"data"` +type ClientFacingWorkoutStreamChanged struct { + EventType ClientFacingWorkoutStreamChangedEventType `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 *ClientFacingShallowWorkoutStream `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -23238,46 +24843,46 @@ type ClientFacingWorkoutDistanceChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingWorkoutDistanceChanged) GetEventType() ClientFacingWorkoutDistanceChangedEventType { +func (c *ClientFacingWorkoutStreamChanged) GetEventType() ClientFacingWorkoutStreamChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingWorkoutDistanceChanged) GetUserId() string { +func (c *ClientFacingWorkoutStreamChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWorkoutDistanceChanged) GetClientUserId() string { +func (c *ClientFacingWorkoutStreamChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWorkoutDistanceChanged) GetTeamId() string { +func (c *ClientFacingWorkoutStreamChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWorkoutDistanceChanged) GetData() *GroupedWorkoutDistance { +func (c *ClientFacingWorkoutStreamChanged) GetData() *ClientFacingShallowWorkoutStream { if c == nil { return nil } return c.Data } -func (c *ClientFacingWorkoutDistanceChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWorkoutStreamChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWorkoutDistanceChanged) require(field *big.Int) { +func (c *ClientFacingWorkoutStreamChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -23286,46 +24891,46 @@ func (c *ClientFacingWorkoutDistanceChanged) 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 *ClientFacingWorkoutDistanceChanged) SetEventType(eventType ClientFacingWorkoutDistanceChangedEventType) { +func (c *ClientFacingWorkoutStreamChanged) SetEventType(eventType ClientFacingWorkoutStreamChangedEventType) { c.EventType = eventType - c.require(clientFacingWorkoutDistanceChangedFieldEventType) + c.require(clientFacingWorkoutStreamChangedFieldEventType) } // 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 *ClientFacingWorkoutDistanceChanged) SetUserId(userId string) { +func (c *ClientFacingWorkoutStreamChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWorkoutDistanceChangedFieldUserId) + c.require(clientFacingWorkoutStreamChangedFieldUserId) } // 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 *ClientFacingWorkoutDistanceChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingWorkoutStreamChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWorkoutDistanceChangedFieldClientUserId) + c.require(clientFacingWorkoutStreamChangedFieldClientUserId) } // 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 *ClientFacingWorkoutDistanceChanged) SetTeamId(teamId string) { +func (c *ClientFacingWorkoutStreamChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWorkoutDistanceChangedFieldTeamId) + c.require(clientFacingWorkoutStreamChangedFieldTeamId) } // 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 *ClientFacingWorkoutDistanceChanged) SetData(data *GroupedWorkoutDistance) { +func (c *ClientFacingWorkoutStreamChanged) SetData(data *ClientFacingShallowWorkoutStream) { c.Data = data - c.require(clientFacingWorkoutDistanceChangedFieldData) + c.require(clientFacingWorkoutStreamChangedFieldData) } -func (c *ClientFacingWorkoutDistanceChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingWorkoutDistanceChanged +func (c *ClientFacingWorkoutStreamChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingWorkoutStreamChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingWorkoutDistanceChanged(value) + *c = ClientFacingWorkoutStreamChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -23335,8 +24940,8 @@ func (c *ClientFacingWorkoutDistanceChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingWorkoutDistanceChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingWorkoutDistanceChanged +func (c *ClientFacingWorkoutStreamChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingWorkoutStreamChanged var marshaler = struct { embed }{ @@ -23346,7 +24951,7 @@ func (c *ClientFacingWorkoutDistanceChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWorkoutDistanceChanged) String() string { +func (c *ClientFacingWorkoutStreamChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -23358,36 +24963,36 @@ func (c *ClientFacingWorkoutDistanceChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingWorkoutDistanceChangedEventType string +type ClientFacingWorkoutStreamChangedEventType string const ( - ClientFacingWorkoutDistanceChangedEventTypeDailyDataWorkoutDistanceCreated ClientFacingWorkoutDistanceChangedEventType = "daily.data.workout_distance.created" - ClientFacingWorkoutDistanceChangedEventTypeDailyDataWorkoutDistanceUpdated ClientFacingWorkoutDistanceChangedEventType = "daily.data.workout_distance.updated" + ClientFacingWorkoutStreamChangedEventTypeDailyDataWorkoutStreamCreated ClientFacingWorkoutStreamChangedEventType = "daily.data.workout_stream.created" + ClientFacingWorkoutStreamChangedEventTypeDailyDataWorkoutStreamUpdated ClientFacingWorkoutStreamChangedEventType = "daily.data.workout_stream.updated" ) -func NewClientFacingWorkoutDistanceChangedEventTypeFromString(s string) (ClientFacingWorkoutDistanceChangedEventType, error) { +func NewClientFacingWorkoutStreamChangedEventTypeFromString(s string) (ClientFacingWorkoutStreamChangedEventType, error) { switch s { - case "daily.data.workout_distance.created": - return ClientFacingWorkoutDistanceChangedEventTypeDailyDataWorkoutDistanceCreated, nil - case "daily.data.workout_distance.updated": - return ClientFacingWorkoutDistanceChangedEventTypeDailyDataWorkoutDistanceUpdated, nil + case "daily.data.workout_stream.created": + return ClientFacingWorkoutStreamChangedEventTypeDailyDataWorkoutStreamCreated, nil + case "daily.data.workout_stream.updated": + return ClientFacingWorkoutStreamChangedEventTypeDailyDataWorkoutStreamUpdated, nil } - var t ClientFacingWorkoutDistanceChangedEventType + var t ClientFacingWorkoutStreamChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingWorkoutDistanceChangedEventType) Ptr() *ClientFacingWorkoutDistanceChangedEventType { +func (c ClientFacingWorkoutStreamChangedEventType) Ptr() *ClientFacingWorkoutStreamChangedEventType { return &c } var ( - clientFacingWorkoutDistanceHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingWorkoutDistanceHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingWorkoutDistanceHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingWorkoutDistanceHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingWorkoutStreamHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingWorkoutStreamHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingWorkoutStreamHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingWorkoutStreamHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingWorkoutDistanceHistoricalPullCompleted struct { +type ClientFacingWorkoutStreamHistoricalPullCompleted 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"` @@ -23401,43 +25006,43 @@ type ClientFacingWorkoutDistanceHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) EventType() string { +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -23446,34 +25051,34 @@ func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) require(field *big. // 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 *ClientFacingWorkoutDistanceHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWorkoutDistanceHistoricalPullCompletedFieldUserId) + c.require(clientFacingWorkoutStreamHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingWorkoutDistanceHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWorkoutDistanceHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingWorkoutStreamHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingWorkoutDistanceHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWorkoutDistanceHistoricalPullCompletedFieldTeamId) + c.require(clientFacingWorkoutStreamHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingWorkoutDistanceHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingWorkoutDistanceHistoricalPullCompletedFieldData) + c.require(clientFacingWorkoutStreamHistoricalPullCompletedFieldData) } -func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingWorkoutDistanceHistoricalPullCompleted +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingWorkoutStreamHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -23483,9 +25088,9 @@ func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) UnmarshalJSON(data if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingWorkoutDistanceHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.workout_distance.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.workout_distance.created", unmarshaler.EventType) + *c = ClientFacingWorkoutStreamHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.workout_stream.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.workout_stream.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -23497,20 +25102,20 @@ func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) UnmarshalJSON(data return nil } -func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingWorkoutDistanceHistoricalPullCompleted +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingWorkoutStreamHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "historical.data.workout_distance.created", + EventType: "historical.data.workout_stream.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) String() string { +func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -23523,19 +25128,19 @@ func (c *ClientFacingWorkoutDistanceHistoricalPullCompleted) String() string { } var ( - clientFacingWorkoutDurationChangedFieldEventType = big.NewInt(1 << 0) - clientFacingWorkoutDurationChangedFieldUserId = big.NewInt(1 << 1) - clientFacingWorkoutDurationChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingWorkoutDurationChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingWorkoutDurationChangedFieldData = big.NewInt(1 << 4) + clientFacingWorkoutSwimmingStrokeChangedFieldEventType = big.NewInt(1 << 0) + clientFacingWorkoutSwimmingStrokeChangedFieldUserId = big.NewInt(1 << 1) + clientFacingWorkoutSwimmingStrokeChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingWorkoutSwimmingStrokeChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingWorkoutSwimmingStrokeChangedFieldData = big.NewInt(1 << 4) ) -type ClientFacingWorkoutDurationChanged struct { - EventType ClientFacingWorkoutDurationChangedEventType `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 *GroupedWorkoutDuration `json:"data" url:"data"` +type ClientFacingWorkoutSwimmingStrokeChanged struct { + EventType ClientFacingWorkoutSwimmingStrokeChangedEventType `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 *GroupedWorkoutSwimmingStroke `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -23544,46 +25149,46 @@ type ClientFacingWorkoutDurationChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingWorkoutDurationChanged) GetEventType() ClientFacingWorkoutDurationChangedEventType { +func (c *ClientFacingWorkoutSwimmingStrokeChanged) GetEventType() ClientFacingWorkoutSwimmingStrokeChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingWorkoutDurationChanged) GetUserId() string { +func (c *ClientFacingWorkoutSwimmingStrokeChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWorkoutDurationChanged) GetClientUserId() string { +func (c *ClientFacingWorkoutSwimmingStrokeChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWorkoutDurationChanged) GetTeamId() string { +func (c *ClientFacingWorkoutSwimmingStrokeChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWorkoutDurationChanged) GetData() *GroupedWorkoutDuration { +func (c *ClientFacingWorkoutSwimmingStrokeChanged) GetData() *GroupedWorkoutSwimmingStroke { if c == nil { return nil } return c.Data } -func (c *ClientFacingWorkoutDurationChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWorkoutSwimmingStrokeChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWorkoutDurationChanged) require(field *big.Int) { +func (c *ClientFacingWorkoutSwimmingStrokeChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -23592,46 +25197,46 @@ func (c *ClientFacingWorkoutDurationChanged) 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 *ClientFacingWorkoutDurationChanged) SetEventType(eventType ClientFacingWorkoutDurationChangedEventType) { +func (c *ClientFacingWorkoutSwimmingStrokeChanged) SetEventType(eventType ClientFacingWorkoutSwimmingStrokeChangedEventType) { c.EventType = eventType - c.require(clientFacingWorkoutDurationChangedFieldEventType) + c.require(clientFacingWorkoutSwimmingStrokeChangedFieldEventType) } // 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 *ClientFacingWorkoutDurationChanged) SetUserId(userId string) { +func (c *ClientFacingWorkoutSwimmingStrokeChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWorkoutDurationChangedFieldUserId) + c.require(clientFacingWorkoutSwimmingStrokeChangedFieldUserId) } // 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 *ClientFacingWorkoutDurationChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingWorkoutSwimmingStrokeChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWorkoutDurationChangedFieldClientUserId) + c.require(clientFacingWorkoutSwimmingStrokeChangedFieldClientUserId) } // 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 *ClientFacingWorkoutDurationChanged) SetTeamId(teamId string) { +func (c *ClientFacingWorkoutSwimmingStrokeChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWorkoutDurationChangedFieldTeamId) + c.require(clientFacingWorkoutSwimmingStrokeChangedFieldTeamId) } // 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 *ClientFacingWorkoutDurationChanged) SetData(data *GroupedWorkoutDuration) { +func (c *ClientFacingWorkoutSwimmingStrokeChanged) SetData(data *GroupedWorkoutSwimmingStroke) { c.Data = data - c.require(clientFacingWorkoutDurationChangedFieldData) + c.require(clientFacingWorkoutSwimmingStrokeChangedFieldData) } -func (c *ClientFacingWorkoutDurationChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingWorkoutDurationChanged +func (c *ClientFacingWorkoutSwimmingStrokeChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingWorkoutSwimmingStrokeChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingWorkoutDurationChanged(value) + *c = ClientFacingWorkoutSwimmingStrokeChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -23641,8 +25246,8 @@ func (c *ClientFacingWorkoutDurationChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingWorkoutDurationChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingWorkoutDurationChanged +func (c *ClientFacingWorkoutSwimmingStrokeChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingWorkoutSwimmingStrokeChanged var marshaler = struct { embed }{ @@ -23652,7 +25257,7 @@ func (c *ClientFacingWorkoutDurationChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWorkoutDurationChanged) String() string { +func (c *ClientFacingWorkoutSwimmingStrokeChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -23664,36 +25269,36 @@ func (c *ClientFacingWorkoutDurationChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingWorkoutDurationChangedEventType string +type ClientFacingWorkoutSwimmingStrokeChangedEventType string const ( - ClientFacingWorkoutDurationChangedEventTypeDailyDataWorkoutDurationCreated ClientFacingWorkoutDurationChangedEventType = "daily.data.workout_duration.created" - ClientFacingWorkoutDurationChangedEventTypeDailyDataWorkoutDurationUpdated ClientFacingWorkoutDurationChangedEventType = "daily.data.workout_duration.updated" + ClientFacingWorkoutSwimmingStrokeChangedEventTypeDailyDataWorkoutSwimmingStrokeCreated ClientFacingWorkoutSwimmingStrokeChangedEventType = "daily.data.workout_swimming_stroke.created" + ClientFacingWorkoutSwimmingStrokeChangedEventTypeDailyDataWorkoutSwimmingStrokeUpdated ClientFacingWorkoutSwimmingStrokeChangedEventType = "daily.data.workout_swimming_stroke.updated" ) -func NewClientFacingWorkoutDurationChangedEventTypeFromString(s string) (ClientFacingWorkoutDurationChangedEventType, error) { +func NewClientFacingWorkoutSwimmingStrokeChangedEventTypeFromString(s string) (ClientFacingWorkoutSwimmingStrokeChangedEventType, error) { switch s { - case "daily.data.workout_duration.created": - return ClientFacingWorkoutDurationChangedEventTypeDailyDataWorkoutDurationCreated, nil - case "daily.data.workout_duration.updated": - return ClientFacingWorkoutDurationChangedEventTypeDailyDataWorkoutDurationUpdated, nil + case "daily.data.workout_swimming_stroke.created": + return ClientFacingWorkoutSwimmingStrokeChangedEventTypeDailyDataWorkoutSwimmingStrokeCreated, nil + case "daily.data.workout_swimming_stroke.updated": + return ClientFacingWorkoutSwimmingStrokeChangedEventTypeDailyDataWorkoutSwimmingStrokeUpdated, nil } - var t ClientFacingWorkoutDurationChangedEventType + var t ClientFacingWorkoutSwimmingStrokeChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingWorkoutDurationChangedEventType) Ptr() *ClientFacingWorkoutDurationChangedEventType { +func (c ClientFacingWorkoutSwimmingStrokeChangedEventType) Ptr() *ClientFacingWorkoutSwimmingStrokeChangedEventType { return &c } var ( - clientFacingWorkoutDurationHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingWorkoutDurationHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingWorkoutDurationHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingWorkoutDurationHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingWorkoutDurationHistoricalPullCompleted struct { +type ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted 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"` @@ -23707,43 +25312,43 @@ type ClientFacingWorkoutDurationHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) EventType() string { +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -23752,34 +25357,34 @@ func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) require(field *big. // 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 *ClientFacingWorkoutDurationHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWorkoutDurationHistoricalPullCompletedFieldUserId) + c.require(clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingWorkoutDurationHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWorkoutDurationHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingWorkoutDurationHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWorkoutDurationHistoricalPullCompletedFieldTeamId) + c.require(clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingWorkoutDurationHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingWorkoutDurationHistoricalPullCompletedFieldData) + c.require(clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldData) } -func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingWorkoutDurationHistoricalPullCompleted +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -23789,9 +25394,9 @@ func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) UnmarshalJSON(data if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingWorkoutDurationHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.workout_duration.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.workout_duration.created", unmarshaler.EventType) + *c = ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.workout_swimming_stroke.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.workout_swimming_stroke.created", unmarshaler.EventType) } c.eventType = unmarshaler.EventType extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") @@ -23803,20 +25408,20 @@ func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) UnmarshalJSON(data return nil } -func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingWorkoutDurationHistoricalPullCompleted +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted var marshaler = struct { embed EventType string `json:"event_type"` }{ embed: embed(*c), - EventType: "historical.data.workout_duration.created", + EventType: "historical.data.workout_swimming_stroke.created", } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) String() string { +func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -23829,19 +25434,19 @@ func (c *ClientFacingWorkoutDurationHistoricalPullCompleted) String() string { } var ( - clientFacingWorkoutStreamChangedFieldEventType = big.NewInt(1 << 0) - clientFacingWorkoutStreamChangedFieldUserId = big.NewInt(1 << 1) - clientFacingWorkoutStreamChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingWorkoutStreamChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingWorkoutStreamChangedFieldData = big.NewInt(1 << 4) -) - -type ClientFacingWorkoutStreamChanged struct { - EventType ClientFacingWorkoutStreamChangedEventType `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 *ClientFacingShallowWorkoutStream `json:"data" url:"data"` + clientFacingWorkoutsChangedFieldEventType = big.NewInt(1 << 0) + clientFacingWorkoutsChangedFieldUserId = big.NewInt(1 << 1) + clientFacingWorkoutsChangedFieldClientUserId = big.NewInt(1 << 2) + clientFacingWorkoutsChangedFieldTeamId = big.NewInt(1 << 3) + clientFacingWorkoutsChangedFieldData = big.NewInt(1 << 4) +) + +type ClientFacingWorkoutsChanged struct { + EventType ClientFacingWorkoutsChangedEventType `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 *ClientFacingWorkout `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -23850,46 +25455,46 @@ type ClientFacingWorkoutStreamChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingWorkoutStreamChanged) GetEventType() ClientFacingWorkoutStreamChangedEventType { +func (c *ClientFacingWorkoutsChanged) GetEventType() ClientFacingWorkoutsChangedEventType { if c == nil { return "" } return c.EventType } -func (c *ClientFacingWorkoutStreamChanged) GetUserId() string { +func (c *ClientFacingWorkoutsChanged) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWorkoutStreamChanged) GetClientUserId() string { +func (c *ClientFacingWorkoutsChanged) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWorkoutStreamChanged) GetTeamId() string { +func (c *ClientFacingWorkoutsChanged) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWorkoutStreamChanged) GetData() *ClientFacingShallowWorkoutStream { +func (c *ClientFacingWorkoutsChanged) GetData() *ClientFacingWorkout { if c == nil { return nil } return c.Data } -func (c *ClientFacingWorkoutStreamChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWorkoutsChanged) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWorkoutStreamChanged) require(field *big.Int) { +func (c *ClientFacingWorkoutsChanged) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -23898,46 +25503,46 @@ func (c *ClientFacingWorkoutStreamChanged) 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 *ClientFacingWorkoutStreamChanged) SetEventType(eventType ClientFacingWorkoutStreamChangedEventType) { +func (c *ClientFacingWorkoutsChanged) SetEventType(eventType ClientFacingWorkoutsChangedEventType) { c.EventType = eventType - c.require(clientFacingWorkoutStreamChangedFieldEventType) + c.require(clientFacingWorkoutsChangedFieldEventType) } // 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 *ClientFacingWorkoutStreamChanged) SetUserId(userId string) { +func (c *ClientFacingWorkoutsChanged) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWorkoutStreamChangedFieldUserId) + c.require(clientFacingWorkoutsChangedFieldUserId) } // 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 *ClientFacingWorkoutStreamChanged) SetClientUserId(clientUserId string) { +func (c *ClientFacingWorkoutsChanged) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWorkoutStreamChangedFieldClientUserId) + c.require(clientFacingWorkoutsChangedFieldClientUserId) } // 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 *ClientFacingWorkoutStreamChanged) SetTeamId(teamId string) { +func (c *ClientFacingWorkoutsChanged) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWorkoutStreamChangedFieldTeamId) + c.require(clientFacingWorkoutsChangedFieldTeamId) } // 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 *ClientFacingWorkoutStreamChanged) SetData(data *ClientFacingShallowWorkoutStream) { +func (c *ClientFacingWorkoutsChanged) SetData(data *ClientFacingWorkout) { c.Data = data - c.require(clientFacingWorkoutStreamChangedFieldData) + c.require(clientFacingWorkoutsChangedFieldData) } -func (c *ClientFacingWorkoutStreamChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingWorkoutStreamChanged +func (c *ClientFacingWorkoutsChanged) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingWorkoutsChanged var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingWorkoutStreamChanged(value) + *c = ClientFacingWorkoutsChanged(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -23947,8 +25552,8 @@ func (c *ClientFacingWorkoutStreamChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingWorkoutStreamChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingWorkoutStreamChanged +func (c *ClientFacingWorkoutsChanged) MarshalJSON() ([]byte, error) { + type embed ClientFacingWorkoutsChanged var marshaler = struct { embed }{ @@ -23958,7 +25563,7 @@ func (c *ClientFacingWorkoutStreamChanged) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWorkoutStreamChanged) String() string { +func (c *ClientFacingWorkoutsChanged) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -23970,36 +25575,36 @@ func (c *ClientFacingWorkoutStreamChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingWorkoutStreamChangedEventType string +type ClientFacingWorkoutsChangedEventType string const ( - ClientFacingWorkoutStreamChangedEventTypeDailyDataWorkoutStreamCreated ClientFacingWorkoutStreamChangedEventType = "daily.data.workout_stream.created" - ClientFacingWorkoutStreamChangedEventTypeDailyDataWorkoutStreamUpdated ClientFacingWorkoutStreamChangedEventType = "daily.data.workout_stream.updated" + ClientFacingWorkoutsChangedEventTypeDailyDataWorkoutsCreated ClientFacingWorkoutsChangedEventType = "daily.data.workouts.created" + ClientFacingWorkoutsChangedEventTypeDailyDataWorkoutsUpdated ClientFacingWorkoutsChangedEventType = "daily.data.workouts.updated" ) -func NewClientFacingWorkoutStreamChangedEventTypeFromString(s string) (ClientFacingWorkoutStreamChangedEventType, error) { +func NewClientFacingWorkoutsChangedEventTypeFromString(s string) (ClientFacingWorkoutsChangedEventType, error) { switch s { - case "daily.data.workout_stream.created": - return ClientFacingWorkoutStreamChangedEventTypeDailyDataWorkoutStreamCreated, nil - case "daily.data.workout_stream.updated": - return ClientFacingWorkoutStreamChangedEventTypeDailyDataWorkoutStreamUpdated, nil + case "daily.data.workouts.created": + return ClientFacingWorkoutsChangedEventTypeDailyDataWorkoutsCreated, nil + case "daily.data.workouts.updated": + return ClientFacingWorkoutsChangedEventTypeDailyDataWorkoutsUpdated, nil } - var t ClientFacingWorkoutStreamChangedEventType + var t ClientFacingWorkoutsChangedEventType return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (c ClientFacingWorkoutStreamChangedEventType) Ptr() *ClientFacingWorkoutStreamChangedEventType { +func (c ClientFacingWorkoutsChangedEventType) Ptr() *ClientFacingWorkoutsChangedEventType { return &c } var ( - clientFacingWorkoutStreamHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingWorkoutStreamHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingWorkoutStreamHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingWorkoutStreamHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clientFacingWorkoutsHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) + clientFacingWorkoutsHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) + clientFacingWorkoutsHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) + clientFacingWorkoutsHistoricalPullCompletedFieldData = big.NewInt(1 << 3) ) -type ClientFacingWorkoutStreamHistoricalPullCompleted struct { +type ClientFacingWorkoutsHistoricalPullCompleted 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"` @@ -24013,43 +25618,43 @@ type ClientFacingWorkoutStreamHistoricalPullCompleted struct { rawJSON json.RawMessage } -func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) GetUserId() string { +func (c *ClientFacingWorkoutsHistoricalPullCompleted) GetUserId() string { if c == nil { return "" } return c.UserId } -func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) GetClientUserId() string { +func (c *ClientFacingWorkoutsHistoricalPullCompleted) GetClientUserId() string { if c == nil { return "" } return c.ClientUserId } -func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) GetTeamId() string { +func (c *ClientFacingWorkoutsHistoricalPullCompleted) GetTeamId() string { if c == nil { return "" } return c.TeamId } -func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClientFacingWorkoutsHistoricalPullCompleted) GetData() *HistoricalPullCompleted { if c == nil { return nil } return c.Data } -func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) EventType() string { +func (c *ClientFacingWorkoutsHistoricalPullCompleted) EventType() string { return c.eventType } -func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClientFacingWorkoutsHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) require(field *big.Int) { +func (c *ClientFacingWorkoutsHistoricalPullCompleted) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } @@ -24058,34 +25663,34 @@ func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) require(field *big.In // 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 *ClientFacingWorkoutStreamHistoricalPullCompleted) SetUserId(userId string) { +func (c *ClientFacingWorkoutsHistoricalPullCompleted) SetUserId(userId string) { c.UserId = userId - c.require(clientFacingWorkoutStreamHistoricalPullCompletedFieldUserId) + c.require(clientFacingWorkoutsHistoricalPullCompletedFieldUserId) } // 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 *ClientFacingWorkoutStreamHistoricalPullCompleted) SetClientUserId(clientUserId string) { +func (c *ClientFacingWorkoutsHistoricalPullCompleted) SetClientUserId(clientUserId string) { c.ClientUserId = clientUserId - c.require(clientFacingWorkoutStreamHistoricalPullCompletedFieldClientUserId) + c.require(clientFacingWorkoutsHistoricalPullCompletedFieldClientUserId) } // 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 *ClientFacingWorkoutStreamHistoricalPullCompleted) SetTeamId(teamId string) { +func (c *ClientFacingWorkoutsHistoricalPullCompleted) SetTeamId(teamId string) { c.TeamId = teamId - c.require(clientFacingWorkoutStreamHistoricalPullCompletedFieldTeamId) + c.require(clientFacingWorkoutsHistoricalPullCompletedFieldTeamId) } // 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 *ClientFacingWorkoutStreamHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { +func (c *ClientFacingWorkoutsHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { c.Data = data - c.require(clientFacingWorkoutStreamHistoricalPullCompletedFieldData) + c.require(clientFacingWorkoutsHistoricalPullCompletedFieldData) } -func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingWorkoutStreamHistoricalPullCompleted +func (c *ClientFacingWorkoutsHistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed ClientFacingWorkoutsHistoricalPullCompleted var unmarshaler = struct { embed EventType string `json:"event_type"` @@ -24095,12 +25700,146 @@ func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) UnmarshalJSON(data [] if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingWorkoutStreamHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.workout_stream.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.workout_stream.created", unmarshaler.EventType) + *c = ClientFacingWorkoutsHistoricalPullCompleted(unmarshaler.embed) + if unmarshaler.EventType != "historical.data.workouts.created" { + return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.workouts.created", unmarshaler.EventType) + } + c.eventType = unmarshaler.EventType + extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + if err != nil { + return err + } + c.extraProperties = extraProperties + c.rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingWorkoutsHistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed ClientFacingWorkoutsHistoricalPullCompleted + var marshaler = struct { + embed + EventType string `json:"event_type"` + }{ + embed: embed(*c), + EventType: "historical.data.workouts.created", + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (c *ClientFacingWorkoutsHistoricalPullCompleted) 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 ( + clientUserIdConflictFieldErrorType = big.NewInt(1 << 0) + clientUserIdConflictFieldErrorMessage = big.NewInt(1 << 1) + clientUserIdConflictFieldUserId = big.NewInt(1 << 2) + clientUserIdConflictFieldCreatedOn = big.NewInt(1 << 3) +) + +type ClientUserIdConflict struct { + ErrorType string `json:"error_type" url:"error_type"` + ErrorMessage string `json:"error_message" url:"error_message"` + UserId string `json:"user_id" url:"user_id"` + CreatedOn time.Time `json:"created_on" url:"created_on"` + + // 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 *ClientUserIdConflict) GetErrorType() string { + if c == nil { + return "" + } + return c.ErrorType +} + +func (c *ClientUserIdConflict) GetErrorMessage() string { + if c == nil { + return "" + } + return c.ErrorMessage +} + +func (c *ClientUserIdConflict) GetUserId() string { + if c == nil { + return "" + } + return c.UserId +} + +func (c *ClientUserIdConflict) GetCreatedOn() time.Time { + if c == nil { + return time.Time{} + } + return c.CreatedOn +} + +func (c *ClientUserIdConflict) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientUserIdConflict) require(field *big.Int) { + if c.explicitFields == nil { + c.explicitFields = big.NewInt(0) + } + c.explicitFields.Or(c.explicitFields, field) +} + +// SetErrorType sets the ErrorType field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientUserIdConflict) SetErrorType(errorType string) { + c.ErrorType = errorType + c.require(clientUserIdConflictFieldErrorType) +} + +// SetErrorMessage sets the ErrorMessage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientUserIdConflict) SetErrorMessage(errorMessage string) { + c.ErrorMessage = errorMessage + c.require(clientUserIdConflictFieldErrorMessage) +} + +// 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 *ClientUserIdConflict) SetUserId(userId string) { + c.UserId = userId + c.require(clientUserIdConflictFieldUserId) +} + +// SetCreatedOn sets the CreatedOn field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (c *ClientUserIdConflict) SetCreatedOn(createdOn time.Time) { + c.CreatedOn = createdOn + c.require(clientUserIdConflictFieldCreatedOn) +} + +func (c *ClientUserIdConflict) UnmarshalJSON(data []byte) error { + type embed ClientUserIdConflict + var unmarshaler = struct { + embed + CreatedOn *internal.DateTime `json:"created_on"` + }{ + embed: embed(*c), } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *c = ClientUserIdConflict(unmarshaler.embed) + c.CreatedOn = unmarshaler.CreatedOn.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } @@ -24109,20 +25848,20 @@ func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) UnmarshalJSON(data [] return nil } -func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingWorkoutStreamHistoricalPullCompleted +func (c *ClientUserIdConflict) MarshalJSON() ([]byte, error) { + type embed ClientUserIdConflict var marshaler = struct { embed - EventType string `json:"event_type"` + CreatedOn *internal.DateTime `json:"created_on"` }{ embed: embed(*c), - EventType: "historical.data.workout_stream.created", + CreatedOn: internal.NewDateTime(c.CreatedOn), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) String() string { +func (c *ClientUserIdConflict) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -24135,19 +25874,11 @@ func (c *ClientFacingWorkoutStreamHistoricalPullCompleted) String() string { } var ( - clientFacingWorkoutSwimmingStrokeChangedFieldEventType = big.NewInt(1 << 0) - clientFacingWorkoutSwimmingStrokeChangedFieldUserId = big.NewInt(1 << 1) - clientFacingWorkoutSwimmingStrokeChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingWorkoutSwimmingStrokeChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingWorkoutSwimmingStrokeChangedFieldData = big.NewInt(1 << 4) + clientUserIdConflictResponseFieldDetail = big.NewInt(1 << 0) ) -type ClientFacingWorkoutSwimmingStrokeChanged struct { - EventType ClientFacingWorkoutSwimmingStrokeChangedEventType `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 *GroupedWorkoutSwimmingStroke `json:"data" url:"data"` +type ClientUserIdConflictResponse struct { + Detail *ClientUserIdConflict `json:"detail" url:"detail"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -24156,94 +25887,38 @@ type ClientFacingWorkoutSwimmingStrokeChanged struct { rawJSON json.RawMessage } -func (c *ClientFacingWorkoutSwimmingStrokeChanged) GetEventType() ClientFacingWorkoutSwimmingStrokeChangedEventType { - if c == nil { - return "" - } - return c.EventType -} - -func (c *ClientFacingWorkoutSwimmingStrokeChanged) GetUserId() string { - if c == nil { - return "" - } - return c.UserId -} - -func (c *ClientFacingWorkoutSwimmingStrokeChanged) GetClientUserId() string { - if c == nil { - return "" - } - return c.ClientUserId -} - -func (c *ClientFacingWorkoutSwimmingStrokeChanged) GetTeamId() string { - if c == nil { - return "" - } - return c.TeamId -} - -func (c *ClientFacingWorkoutSwimmingStrokeChanged) GetData() *GroupedWorkoutSwimmingStroke { +func (c *ClientUserIdConflictResponse) GetDetail() *ClientUserIdConflict { if c == nil { return nil } - return c.Data + return c.Detail } -func (c *ClientFacingWorkoutSwimmingStrokeChanged) GetExtraProperties() map[string]interface{} { +func (c *ClientUserIdConflictResponse) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWorkoutSwimmingStrokeChanged) require(field *big.Int) { +func (c *ClientUserIdConflictResponse) 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 *ClientFacingWorkoutSwimmingStrokeChanged) SetEventType(eventType ClientFacingWorkoutSwimmingStrokeChangedEventType) { - c.EventType = eventType - c.require(clientFacingWorkoutSwimmingStrokeChangedFieldEventType) -} - -// 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 *ClientFacingWorkoutSwimmingStrokeChanged) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingWorkoutSwimmingStrokeChangedFieldUserId) -} - -// 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 *ClientFacingWorkoutSwimmingStrokeChanged) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingWorkoutSwimmingStrokeChangedFieldClientUserId) -} - -// 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 *ClientFacingWorkoutSwimmingStrokeChanged) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingWorkoutSwimmingStrokeChangedFieldTeamId) -} - -// SetData sets the Data field and marks it as non-optional; +// 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 *ClientFacingWorkoutSwimmingStrokeChanged) SetData(data *GroupedWorkoutSwimmingStroke) { - c.Data = data - c.require(clientFacingWorkoutSwimmingStrokeChangedFieldData) +func (c *ClientUserIdConflictResponse) SetDetail(detail *ClientUserIdConflict) { + c.Detail = detail + c.require(clientUserIdConflictResponseFieldDetail) } -func (c *ClientFacingWorkoutSwimmingStrokeChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingWorkoutSwimmingStrokeChanged +func (c *ClientUserIdConflictResponse) UnmarshalJSON(data []byte) error { + type unmarshaler ClientUserIdConflictResponse var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingWorkoutSwimmingStrokeChanged(value) + *c = ClientUserIdConflictResponse(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -24253,8 +25928,8 @@ func (c *ClientFacingWorkoutSwimmingStrokeChanged) UnmarshalJSON(data []byte) er return nil } -func (c *ClientFacingWorkoutSwimmingStrokeChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingWorkoutSwimmingStrokeChanged +func (c *ClientUserIdConflictResponse) MarshalJSON() ([]byte, error) { + type embed ClientUserIdConflictResponse var marshaler = struct { embed }{ @@ -24264,7 +25939,7 @@ func (c *ClientFacingWorkoutSwimmingStrokeChanged) MarshalJSON() ([]byte, error) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWorkoutSwimmingStrokeChanged) String() string { +func (c *ClientUserIdConflictResponse) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -24276,137 +25951,101 @@ func (c *ClientFacingWorkoutSwimmingStrokeChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingWorkoutSwimmingStrokeChangedEventType string - -const ( - ClientFacingWorkoutSwimmingStrokeChangedEventTypeDailyDataWorkoutSwimmingStrokeCreated ClientFacingWorkoutSwimmingStrokeChangedEventType = "daily.data.workout_swimming_stroke.created" - ClientFacingWorkoutSwimmingStrokeChangedEventTypeDailyDataWorkoutSwimmingStrokeUpdated ClientFacingWorkoutSwimmingStrokeChangedEventType = "daily.data.workout_swimming_stroke.updated" -) - -func NewClientFacingWorkoutSwimmingStrokeChangedEventTypeFromString(s string) (ClientFacingWorkoutSwimmingStrokeChangedEventType, error) { - switch s { - case "daily.data.workout_swimming_stroke.created": - return ClientFacingWorkoutSwimmingStrokeChangedEventTypeDailyDataWorkoutSwimmingStrokeCreated, nil - case "daily.data.workout_swimming_stroke.updated": - return ClientFacingWorkoutSwimmingStrokeChangedEventTypeDailyDataWorkoutSwimmingStrokeUpdated, nil - } - var t ClientFacingWorkoutSwimmingStrokeChangedEventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ClientFacingWorkoutSwimmingStrokeChangedEventType) Ptr() *ClientFacingWorkoutSwimmingStrokeChangedEventType { - return &c -} - var ( - clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + clinicalInformationFieldFasting = big.NewInt(1 << 0) + clinicalInformationFieldNotes = big.NewInt(1 << 1) + clinicalInformationFieldInformation = big.NewInt(1 << 2) + clinicalInformationFieldTotalVolume = big.NewInt(1 << 3) ) -type ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted 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 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:"-"` - eventType string extraProperties map[string]interface{} rawJSON json.RawMessage } -func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) GetUserId() string { +func (c *ClinicalInformation) GetFasting() *bool { if c == nil { - return "" + return nil } - return c.UserId + return c.Fasting } -func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) GetClientUserId() string { +func (c *ClinicalInformation) GetNotes() *string { if c == nil { - return "" + return nil } - return c.ClientUserId + return c.Notes } -func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) GetTeamId() string { +func (c *ClinicalInformation) GetInformation() *string { if c == nil { - return "" + return nil } - return c.TeamId + return c.Information } -func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *ClinicalInformation) GetTotalVolume() *string { if c == nil { return nil } - return c.Data -} - -func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) EventType() string { - return c.eventType + return c.TotalVolume } -func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *ClinicalInformation) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) require(field *big.Int) { +func (c *ClinicalInformation) 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; +// 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 *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldUserId) +func (c *ClinicalInformation) SetFasting(fasting *bool) { + c.Fasting = fasting + c.require(clinicalInformationFieldFasting) } -// SetClientUserId sets the ClientUserId field and marks it as non-optional; +// 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 *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldClientUserId) +func (c *ClinicalInformation) SetNotes(notes *string) { + c.Notes = notes + c.require(clinicalInformationFieldNotes) } -// SetTeamId sets the TeamId field and marks it as non-optional; +// 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 *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldTeamId) +func (c *ClinicalInformation) SetInformation(information *string) { + c.Information = information + c.require(clinicalInformationFieldInformation) } -// SetData sets the Data field and marks it as non-optional; +// 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 *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { - c.Data = data - c.require(clientFacingWorkoutSwimmingStrokeHistoricalPullCompletedFieldData) +func (c *ClinicalInformation) SetTotalVolume(totalVolume *string) { + c.TotalVolume = totalVolume + c.require(clinicalInformationFieldTotalVolume) } -func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted - var unmarshaler = struct { - embed - EventType string `json:"event_type"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { +func (c *ClinicalInformation) UnmarshalJSON(data []byte) error { + type unmarshaler ClinicalInformation + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.workout_swimming_stroke.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.workout_swimming_stroke.created", unmarshaler.EventType) - } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + *c = ClinicalInformation(value) + extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } @@ -24415,20 +26054,18 @@ func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) UnmarshalJSON return nil } -func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted +func (c *ClinicalInformation) MarshalJSON() ([]byte, error) { + type embed ClinicalInformation var marshaler = struct { embed - EventType string `json:"event_type"` }{ - embed: embed(*c), - EventType: "historical.data.workout_swimming_stroke.created", + embed: embed(*c), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) String() string { +func (c *ClinicalInformation) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -24441,115 +26078,92 @@ func (c *ClientFacingWorkoutSwimmingStrokeHistoricalPullCompleted) String() stri } var ( - clientFacingWorkoutsChangedFieldEventType = big.NewInt(1 << 0) - clientFacingWorkoutsChangedFieldUserId = big.NewInt(1 << 1) - clientFacingWorkoutsChangedFieldClientUserId = big.NewInt(1 << 2) - clientFacingWorkoutsChangedFieldTeamId = big.NewInt(1 << 3) - clientFacingWorkoutsChangedFieldData = big.NewInt(1 << 4) + connectedSourceClientFacingFieldProvider = big.NewInt(1 << 0) + connectedSourceClientFacingFieldCreatedOn = big.NewInt(1 << 1) + connectedSourceClientFacingFieldSource = big.NewInt(1 << 2) ) -type ClientFacingWorkoutsChanged struct { - EventType ClientFacingWorkoutsChangedEventType `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 *ClientFacingWorkout `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 *ClientFacingWorkoutsChanged) GetEventType() ClientFacingWorkoutsChangedEventType { - if c == nil { - return "" - } - return c.EventType -} - -func (c *ClientFacingWorkoutsChanged) GetUserId() string { - if c == nil { - return "" - } - return c.UserId +type ConnectedSourceClientFacing struct { + // The provider of this connected source. + Provider *ClientFacingProvider `json:"provider" url:"provider"` + // When your item is created + CreatedOn time.Time `json:"created_on" url:"created_on"` + // Deprecated. Use `provider` instead. Subject to removal after 1 Jan 2024. + Source *ClientFacingProvider `json:"source" url:"source"` + + // 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 *ClientFacingWorkoutsChanged) GetClientUserId() string { +func (c *ConnectedSourceClientFacing) GetProvider() *ClientFacingProvider { if c == nil { - return "" + return nil } - return c.ClientUserId + return c.Provider } -func (c *ClientFacingWorkoutsChanged) GetTeamId() string { +func (c *ConnectedSourceClientFacing) GetCreatedOn() time.Time { if c == nil { - return "" + return time.Time{} } - return c.TeamId + return c.CreatedOn } -func (c *ClientFacingWorkoutsChanged) GetData() *ClientFacingWorkout { +func (c *ConnectedSourceClientFacing) GetSource() *ClientFacingProvider { if c == nil { return nil } - return c.Data + return c.Source } -func (c *ClientFacingWorkoutsChanged) GetExtraProperties() map[string]interface{} { +func (c *ConnectedSourceClientFacing) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWorkoutsChanged) require(field *big.Int) { +func (c *ConnectedSourceClientFacing) 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 *ClientFacingWorkoutsChanged) SetEventType(eventType ClientFacingWorkoutsChangedEventType) { - c.EventType = eventType - c.require(clientFacingWorkoutsChangedFieldEventType) -} - -// 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 *ClientFacingWorkoutsChanged) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingWorkoutsChangedFieldUserId) -} - -// SetClientUserId sets the ClientUserId field and marks it as non-optional; +// 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 (c *ClientFacingWorkoutsChanged) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingWorkoutsChangedFieldClientUserId) +func (c *ConnectedSourceClientFacing) SetProvider(provider *ClientFacingProvider) { + c.Provider = provider + c.require(connectedSourceClientFacingFieldProvider) } -// SetTeamId sets the TeamId field and marks it as non-optional; +// SetCreatedOn sets the CreatedOn field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingWorkoutsChanged) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingWorkoutsChangedFieldTeamId) +func (c *ConnectedSourceClientFacing) SetCreatedOn(createdOn time.Time) { + c.CreatedOn = createdOn + c.require(connectedSourceClientFacingFieldCreatedOn) } -// SetData sets the Data field and marks it as non-optional; +// SetSource sets the Source field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingWorkoutsChanged) SetData(data *ClientFacingWorkout) { - c.Data = data - c.require(clientFacingWorkoutsChangedFieldData) +func (c *ConnectedSourceClientFacing) SetSource(source *ClientFacingProvider) { + c.Source = source + c.require(connectedSourceClientFacingFieldSource) } -func (c *ClientFacingWorkoutsChanged) UnmarshalJSON(data []byte) error { - type unmarshaler ClientFacingWorkoutsChanged - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (c *ConnectedSourceClientFacing) UnmarshalJSON(data []byte) error { + type embed ConnectedSourceClientFacing + var unmarshaler = struct { + embed + CreatedOn *internal.DateTime `json:"created_on"` + }{ + embed: embed(*c), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingWorkoutsChanged(value) + *c = ConnectedSourceClientFacing(unmarshaler.embed) + c.CreatedOn = unmarshaler.CreatedOn.Time() extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -24559,18 +26173,20 @@ func (c *ClientFacingWorkoutsChanged) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientFacingWorkoutsChanged) MarshalJSON() ([]byte, error) { - type embed ClientFacingWorkoutsChanged +func (c *ConnectedSourceClientFacing) MarshalJSON() ([]byte, error) { + type embed ConnectedSourceClientFacing var marshaler = struct { embed + CreatedOn *internal.DateTime `json:"created_on"` }{ - embed: embed(*c), + embed: embed(*c), + CreatedOn: internal.NewDateTime(c.CreatedOn), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWorkoutsChanged) String() string { +func (c *ConnectedSourceClientFacing) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -24582,137 +26198,91 @@ func (c *ClientFacingWorkoutsChanged) String() string { return fmt.Sprintf("%#v", c) } -type ClientFacingWorkoutsChangedEventType string - -const ( - ClientFacingWorkoutsChangedEventTypeDailyDataWorkoutsCreated ClientFacingWorkoutsChangedEventType = "daily.data.workouts.created" - ClientFacingWorkoutsChangedEventTypeDailyDataWorkoutsUpdated ClientFacingWorkoutsChangedEventType = "daily.data.workouts.updated" -) - -func NewClientFacingWorkoutsChangedEventTypeFromString(s string) (ClientFacingWorkoutsChangedEventType, error) { - switch s { - case "daily.data.workouts.created": - return ClientFacingWorkoutsChangedEventTypeDailyDataWorkoutsCreated, nil - case "daily.data.workouts.updated": - return ClientFacingWorkoutsChangedEventTypeDailyDataWorkoutsUpdated, nil - } - var t ClientFacingWorkoutsChangedEventType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ClientFacingWorkoutsChangedEventType) Ptr() *ClientFacingWorkoutsChangedEventType { - return &c -} - var ( - clientFacingWorkoutsHistoricalPullCompletedFieldUserId = big.NewInt(1 << 0) - clientFacingWorkoutsHistoricalPullCompletedFieldClientUserId = big.NewInt(1 << 1) - clientFacingWorkoutsHistoricalPullCompletedFieldTeamId = big.NewInt(1 << 2) - clientFacingWorkoutsHistoricalPullCompletedFieldData = big.NewInt(1 << 3) + consentFieldConsentType = big.NewInt(1 << 0) + consentFieldVersion = big.NewInt(1 << 1) + consentFieldTimeOfConsent = big.NewInt(1 << 2) ) -type ClientFacingWorkoutsHistoricalPullCompleted 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 Consent struct { + ConsentType ConsentType `json:"consentType" url:"consentType"` + Version *string `json:"version,omitempty" url:"version,omitempty"` + TimeOfConsent *time.Time `json:"timeOfConsent,omitempty" url:"timeOfConsent,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 *ClientFacingWorkoutsHistoricalPullCompleted) GetUserId() string { - if c == nil { - return "" - } - return c.UserId -} - -func (c *ClientFacingWorkoutsHistoricalPullCompleted) GetClientUserId() string { +func (c *Consent) GetConsentType() ConsentType { if c == nil { return "" } - return c.ClientUserId + return c.ConsentType } -func (c *ClientFacingWorkoutsHistoricalPullCompleted) GetTeamId() string { +func (c *Consent) GetVersion() *string { if c == nil { - return "" + return nil } - return c.TeamId + return c.Version } -func (c *ClientFacingWorkoutsHistoricalPullCompleted) GetData() *HistoricalPullCompleted { +func (c *Consent) GetTimeOfConsent() *time.Time { if c == nil { return nil } - return c.Data -} - -func (c *ClientFacingWorkoutsHistoricalPullCompleted) EventType() string { - return c.eventType + return c.TimeOfConsent } -func (c *ClientFacingWorkoutsHistoricalPullCompleted) GetExtraProperties() map[string]interface{} { +func (c *Consent) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientFacingWorkoutsHistoricalPullCompleted) require(field *big.Int) { +func (c *Consent) 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 *ClientFacingWorkoutsHistoricalPullCompleted) SetUserId(userId string) { - c.UserId = userId - c.require(clientFacingWorkoutsHistoricalPullCompletedFieldUserId) -} - -// SetClientUserId sets the ClientUserId field and marks it as non-optional; +// SetConsentType sets the ConsentType field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingWorkoutsHistoricalPullCompleted) SetClientUserId(clientUserId string) { - c.ClientUserId = clientUserId - c.require(clientFacingWorkoutsHistoricalPullCompletedFieldClientUserId) +func (c *Consent) SetConsentType(consentType ConsentType) { + c.ConsentType = consentType + c.require(consentFieldConsentType) } -// SetTeamId sets the TeamId field and marks it as non-optional; +// SetVersion sets the Version field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingWorkoutsHistoricalPullCompleted) SetTeamId(teamId string) { - c.TeamId = teamId - c.require(clientFacingWorkoutsHistoricalPullCompletedFieldTeamId) +func (c *Consent) SetVersion(version *string) { + c.Version = version + c.require(consentFieldVersion) } -// SetData sets the Data field and marks it as non-optional; +// SetTimeOfConsent sets the TimeOfConsent field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientFacingWorkoutsHistoricalPullCompleted) SetData(data *HistoricalPullCompleted) { - c.Data = data - c.require(clientFacingWorkoutsHistoricalPullCompletedFieldData) +func (c *Consent) SetTimeOfConsent(timeOfConsent *time.Time) { + c.TimeOfConsent = timeOfConsent + c.require(consentFieldTimeOfConsent) } -func (c *ClientFacingWorkoutsHistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed ClientFacingWorkoutsHistoricalPullCompleted +func (c *Consent) UnmarshalJSON(data []byte) error { + type embed Consent var unmarshaler = struct { embed - EventType string `json:"event_type"` + TimeOfConsent *internal.DateTime `json:"timeOfConsent,omitempty"` }{ embed: embed(*c), } if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientFacingWorkoutsHistoricalPullCompleted(unmarshaler.embed) - if unmarshaler.EventType != "historical.data.workouts.created" { - return fmt.Errorf("unexpected value for literal on type %T; expected %v got %v", c, "historical.data.workouts.created", unmarshaler.EventType) - } - c.eventType = unmarshaler.EventType - extraProperties, err := internal.ExtractExtraProperties(data, *c, "event_type") + *c = Consent(unmarshaler.embed) + c.TimeOfConsent = unmarshaler.TimeOfConsent.TimePtr() + extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err } @@ -24721,20 +26291,20 @@ func (c *ClientFacingWorkoutsHistoricalPullCompleted) UnmarshalJSON(data []byte) return nil } -func (c *ClientFacingWorkoutsHistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed ClientFacingWorkoutsHistoricalPullCompleted +func (c *Consent) MarshalJSON() ([]byte, error) { + type embed Consent var marshaler = struct { embed - EventType string `json:"event_type"` + TimeOfConsent *internal.DateTime `json:"timeOfConsent,omitempty"` }{ - embed: embed(*c), - EventType: "historical.data.workouts.created", + embed: embed(*c), + TimeOfConsent: internal.NewOptionalDateTime(c.TimeOfConsent), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientFacingWorkoutsHistoricalPullCompleted) String() string { +func (c *Consent) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -24746,18 +26316,51 @@ func (c *ClientFacingWorkoutsHistoricalPullCompleted) String() string { return fmt.Sprintf("%#v", c) } -var ( - clientUserIdConflictFieldErrorType = big.NewInt(1 << 0) - clientUserIdConflictFieldErrorMessage = big.NewInt(1 << 1) - clientUserIdConflictFieldUserId = big.NewInt(1 << 2) - clientUserIdConflictFieldCreatedOn = big.NewInt(1 << 3) +// ℹ️ This enum is non-exhaustive. +type ConsentType string + +const ( + ConsentTypeTermsOfUse ConsentType = "terms-of-use" + ConsentTypeTelehealthInformedConsent ConsentType = "telehealth-informed-consent" + ConsentTypeMobileTermsAndConditions ConsentType = "mobile-terms-and-conditions" + ConsentTypeNoticeOfPrivacyPractices ConsentType = "notice-of-privacy-practices" + ConsentTypePrivacyPolicy ConsentType = "privacy-policy" + ConsentTypeHipaaAuthorization ConsentType = "hipaa-authorization" +) + +func NewConsentTypeFromString(s string) (ConsentType, error) { + switch s { + case "terms-of-use": + return ConsentTypeTermsOfUse, nil + case "telehealth-informed-consent": + return ConsentTypeTelehealthInformedConsent, nil + case "mobile-terms-and-conditions": + return ConsentTypeMobileTermsAndConditions, nil + case "notice-of-privacy-practices": + return ConsentTypeNoticeOfPrivacyPractices, nil + case "privacy-policy": + return ConsentTypePrivacyPolicy, nil + case "hipaa-authorization": + return ConsentTypeHipaaAuthorization, nil + } + var t ConsentType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ConsentType) Ptr() *ConsentType { + return &c +} + +var ( + continuousQueryResultTableChangesFieldQueryId = big.NewInt(1 << 0) + continuousQueryResultTableChangesFieldQuerySlug = big.NewInt(1 << 1) + continuousQueryResultTableChangesFieldData = big.NewInt(1 << 2) ) -type ClientUserIdConflict struct { - ErrorType string `json:"error_type" url:"error_type"` - ErrorMessage string `json:"error_message" url:"error_message"` - UserId string `json:"user_id" url:"user_id"` - CreatedOn time.Time `json:"created_on" url:"created_on"` +type ContinuousQueryResultTableChanges struct { + QueryId string `json:"query_id" url:"query_id"` + QuerySlug string `json:"query_slug" url:"query_slug"` + Data map[string][]interface{} `json:"data" url:"data"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -24766,86 +26369,66 @@ type ClientUserIdConflict struct { rawJSON json.RawMessage } -func (c *ClientUserIdConflict) GetErrorType() string { - if c == nil { - return "" - } - return c.ErrorType -} - -func (c *ClientUserIdConflict) GetErrorMessage() string { +func (c *ContinuousQueryResultTableChanges) GetQueryId() string { if c == nil { return "" } - return c.ErrorMessage + return c.QueryId } -func (c *ClientUserIdConflict) GetUserId() string { +func (c *ContinuousQueryResultTableChanges) GetQuerySlug() string { if c == nil { return "" } - return c.UserId + return c.QuerySlug } -func (c *ClientUserIdConflict) GetCreatedOn() time.Time { +func (c *ContinuousQueryResultTableChanges) GetData() map[string][]interface{} { if c == nil { - return time.Time{} + return nil } - return c.CreatedOn + return c.Data } -func (c *ClientUserIdConflict) GetExtraProperties() map[string]interface{} { +func (c *ContinuousQueryResultTableChanges) GetExtraProperties() map[string]interface{} { return c.extraProperties } -func (c *ClientUserIdConflict) require(field *big.Int) { +func (c *ContinuousQueryResultTableChanges) require(field *big.Int) { if c.explicitFields == nil { c.explicitFields = big.NewInt(0) } c.explicitFields.Or(c.explicitFields, field) } -// SetErrorType sets the ErrorType field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientUserIdConflict) SetErrorType(errorType string) { - c.ErrorType = errorType - c.require(clientUserIdConflictFieldErrorType) -} - -// SetErrorMessage sets the ErrorMessage field and marks it as non-optional; +// SetQueryId sets the QueryId field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientUserIdConflict) SetErrorMessage(errorMessage string) { - c.ErrorMessage = errorMessage - c.require(clientUserIdConflictFieldErrorMessage) +func (c *ContinuousQueryResultTableChanges) SetQueryId(queryId string) { + c.QueryId = queryId + c.require(continuousQueryResultTableChangesFieldQueryId) } -// SetUserId sets the UserId field and marks it as non-optional; +// SetQuerySlug sets the QuerySlug field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ClientUserIdConflict) SetUserId(userId string) { - c.UserId = userId - c.require(clientUserIdConflictFieldUserId) +func (c *ContinuousQueryResultTableChanges) SetQuerySlug(querySlug string) { + c.QuerySlug = querySlug + c.require(continuousQueryResultTableChangesFieldQuerySlug) } -// SetCreatedOn sets the CreatedOn 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 *ClientUserIdConflict) SetCreatedOn(createdOn time.Time) { - c.CreatedOn = createdOn - c.require(clientUserIdConflictFieldCreatedOn) +func (c *ContinuousQueryResultTableChanges) SetData(data map[string][]interface{}) { + c.Data = data + c.require(continuousQueryResultTableChangesFieldData) } -func (c *ClientUserIdConflict) UnmarshalJSON(data []byte) error { - type embed ClientUserIdConflict - var unmarshaler = struct { - embed - CreatedOn *internal.DateTime `json:"created_on"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { +func (c *ContinuousQueryResultTableChanges) UnmarshalJSON(data []byte) error { + type unmarshaler ContinuousQueryResultTableChanges + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *c = ClientUserIdConflict(unmarshaler.embed) - c.CreatedOn = unmarshaler.CreatedOn.Time() + *c = ContinuousQueryResultTableChanges(value) extraProperties, err := internal.ExtractExtraProperties(data, *c) if err != nil { return err @@ -24855,20 +26438,18 @@ func (c *ClientUserIdConflict) UnmarshalJSON(data []byte) error { return nil } -func (c *ClientUserIdConflict) MarshalJSON() ([]byte, error) { - type embed ClientUserIdConflict +func (c *ContinuousQueryResultTableChanges) MarshalJSON() ([]byte, error) { + type embed ContinuousQueryResultTableChanges var marshaler = struct { embed - CreatedOn *internal.DateTime `json:"created_on"` }{ - embed: embed(*c), - CreatedOn: internal.NewDateTime(c.CreatedOn), + embed: embed(*c), } explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientUserIdConflict) String() string { +func (c *ContinuousQueryResultTableChanges) String() string { if len(c.rawJSON) > 0 { if value, err := internal.StringifyJSON(c.rawJSON); err == nil { return value @@ -24880,12 +26461,97 @@ func (c *ClientUserIdConflict) String() string { return fmt.Sprintf("%#v", c) } +// ℹ️ This enum is non-exhaustive. +type Ethnicity string + +const ( + EthnicityHispanic Ethnicity = "hispanic" + EthnicityNonHispanic Ethnicity = "non_hispanic" + EthnicityAshkenaziJewish Ethnicity = "ashkenazi_jewish" + EthnicityOther Ethnicity = "other" +) + +func NewEthnicityFromString(s string) (Ethnicity, error) { + switch s { + case "hispanic": + return EthnicityHispanic, nil + case "non_hispanic": + return EthnicityNonHispanic, nil + case "ashkenazi_jewish": + return EthnicityAshkenaziJewish, nil + case "other": + return EthnicityOther, nil + } + var t Ethnicity + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +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 ( - clientUserIdConflictResponseFieldDetail = big.NewInt(1 << 0) + fallbackBirthDateFieldValue = big.NewInt(1 << 0) + fallbackBirthDateFieldSourceSlug = big.NewInt(1 << 1) + fallbackBirthDateFieldUpdatedAt = big.NewInt(1 << 2) ) -type ClientUserIdConflictResponse struct { - Detail *ClientUserIdConflict `json:"detail" url:"detail"` +type FallbackBirthDate struct { + // Fallback date of birth of the user, in YYYY-mm-dd format. Used for calculating max heartrate for providers that don not provide users' age. + Value string `json:"value" url:"value"` + // Slug for designated source + SourceSlug string `json:"source_slug" url:"source_slug"` + 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:"-"` @@ -24894,83 +26560,119 @@ type ClientUserIdConflictResponse struct { rawJSON json.RawMessage } -func (c *ClientUserIdConflictResponse) GetDetail() *ClientUserIdConflict { - if c == nil { - return nil +func (f *FallbackBirthDate) GetValue() string { + if f == nil { + return "" } - return c.Detail + return f.Value } -func (c *ClientUserIdConflictResponse) GetExtraProperties() map[string]interface{} { - return c.extraProperties +func (f *FallbackBirthDate) GetSourceSlug() string { + if f == nil { + return "" + } + return f.SourceSlug } -func (c *ClientUserIdConflictResponse) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) +func (f *FallbackBirthDate) GetUpdatedAt() time.Time { + if f == nil { + return time.Time{} } - c.explicitFields.Or(c.explicitFields, field) + return f.UpdatedAt } -// SetDetail sets the Detail field and marks it as non-optional; +func (f *FallbackBirthDate) GetExtraProperties() map[string]interface{} { + return f.extraProperties +} + +func (f *FallbackBirthDate) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) + } + f.explicitFields.Or(f.explicitFields, field) +} + +// SetValue sets the Value 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 (f *FallbackBirthDate) SetValue(value string) { + f.Value = value + f.require(fallbackBirthDateFieldValue) } -func (c *ClientUserIdConflictResponse) UnmarshalJSON(data []byte) error { - type unmarshaler ClientUserIdConflictResponse - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +// SetSourceSlug sets the SourceSlug field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (f *FallbackBirthDate) SetSourceSlug(sourceSlug string) { + f.SourceSlug = sourceSlug + f.require(fallbackBirthDateFieldSourceSlug) +} + +// 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 (f *FallbackBirthDate) SetUpdatedAt(updatedAt time.Time) { + f.UpdatedAt = updatedAt + f.require(fallbackBirthDateFieldUpdatedAt) +} + +func (f *FallbackBirthDate) UnmarshalJSON(data []byte) error { + type embed FallbackBirthDate + var unmarshaler = struct { + embed + UpdatedAt *internal.DateTime `json:"updated_at"` + }{ + embed: embed(*f), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ClientUserIdConflictResponse(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) + *f = FallbackBirthDate(unmarshaler.embed) + f.UpdatedAt = unmarshaler.UpdatedAt.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *f) if err != nil { return err } - c.extraProperties = extraProperties - c.rawJSON = json.RawMessage(data) + f.extraProperties = extraProperties + f.rawJSON = json.RawMessage(data) return nil } -func (c *ClientUserIdConflictResponse) MarshalJSON() ([]byte, error) { - type embed ClientUserIdConflictResponse +func (f *FallbackBirthDate) MarshalJSON() ([]byte, error) { + type embed FallbackBirthDate var marshaler = struct { embed + UpdatedAt *internal.DateTime `json:"updated_at"` }{ - embed: embed(*c), + embed: embed(*f), + UpdatedAt: internal.NewDateTime(f.UpdatedAt), } - explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ClientUserIdConflictResponse) String() string { - if len(c.rawJSON) > 0 { - if value, err := internal.StringifyJSON(c.rawJSON); err == nil { +func (f *FallbackBirthDate) String() string { + if len(f.rawJSON) > 0 { + if value, err := internal.StringifyJSON(f.rawJSON); err == nil { return value } } - if value, err := internal.StringifyJSON(c); err == nil { + if value, err := internal.StringifyJSON(f); err == nil { return value } - return fmt.Sprintf("%#v", c) + return fmt.Sprintf("%#v", f) } -var ( - connectedSourceClientFacingFieldProvider = big.NewInt(1 << 0) - connectedSourceClientFacingFieldCreatedOn = big.NewInt(1 << 1) - connectedSourceClientFacingFieldSource = big.NewInt(1 << 2) -) - -type ConnectedSourceClientFacing struct { - // The provider of this connected source. - Provider *ClientFacingProvider `json:"provider" url:"provider"` - // When your item is created - CreatedOn time.Time `json:"created_on" url:"created_on"` - // Deprecated. Use `provider` instead. Subject to removal after 1 Jan 2024. - Source *ClientFacingProvider `json:"source" url:"source"` +var ( + fallbackTimeZoneFieldId = big.NewInt(1 << 0) + fallbackTimeZoneFieldSourceSlug = big.NewInt(1 << 1) + fallbackTimeZoneFieldUpdatedAt = big.NewInt(1 << 2) +) + +type FallbackTimeZone struct { + // Fallback time zone of the user, in the form of a valid IANA tzdatabase identifier (e.g., `Europe/London` or `America/Los_Angeles`). + // Used when pulling data from sources that are completely time zone agnostic (e.g., all time is relative to UTC clock, without any time zone attributions on data points). + Id string `json:"id" url:"id"` + // Slug for designated source + SourceSlug string `json:"source_slug" url:"source_slug"` + 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:"-"` @@ -24979,116 +26681,188 @@ type ConnectedSourceClientFacing struct { rawJSON json.RawMessage } -func (c *ConnectedSourceClientFacing) GetProvider() *ClientFacingProvider { - if c == nil { - return nil +func (f *FallbackTimeZone) GetId() string { + if f == nil { + return "" } - return c.Provider + return f.Id } -func (c *ConnectedSourceClientFacing) GetCreatedOn() time.Time { - if c == nil { - return time.Time{} +func (f *FallbackTimeZone) GetSourceSlug() string { + if f == nil { + return "" } - return c.CreatedOn + return f.SourceSlug } -func (c *ConnectedSourceClientFacing) GetSource() *ClientFacingProvider { - if c == nil { - return nil +func (f *FallbackTimeZone) GetUpdatedAt() time.Time { + if f == nil { + return time.Time{} } - return c.Source + return f.UpdatedAt } -func (c *ConnectedSourceClientFacing) GetExtraProperties() map[string]interface{} { - return c.extraProperties +func (f *FallbackTimeZone) GetExtraProperties() map[string]interface{} { + return f.extraProperties } -func (c *ConnectedSourceClientFacing) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) +func (f *FallbackTimeZone) require(field *big.Int) { + if f.explicitFields == nil { + f.explicitFields = big.NewInt(0) } - c.explicitFields.Or(c.explicitFields, field) + f.explicitFields.Or(f.explicitFields, field) } -// SetProvider sets the Provider 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 *ConnectedSourceClientFacing) SetProvider(provider *ClientFacingProvider) { - c.Provider = provider - c.require(connectedSourceClientFacingFieldProvider) +func (f *FallbackTimeZone) SetId(id string) { + f.Id = id + f.require(fallbackTimeZoneFieldId) } -// SetCreatedOn sets the CreatedOn field and marks it as non-optional; +// SetSourceSlug sets the SourceSlug field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *ConnectedSourceClientFacing) SetCreatedOn(createdOn time.Time) { - c.CreatedOn = createdOn - c.require(connectedSourceClientFacingFieldCreatedOn) +func (f *FallbackTimeZone) SetSourceSlug(sourceSlug string) { + f.SourceSlug = sourceSlug + f.require(fallbackTimeZoneFieldSourceSlug) } -// SetSource sets the Source field and marks it as non-optional; +// 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 *ConnectedSourceClientFacing) SetSource(source *ClientFacingProvider) { - c.Source = source - c.require(connectedSourceClientFacingFieldSource) +func (f *FallbackTimeZone) SetUpdatedAt(updatedAt time.Time) { + f.UpdatedAt = updatedAt + f.require(fallbackTimeZoneFieldUpdatedAt) } -func (c *ConnectedSourceClientFacing) UnmarshalJSON(data []byte) error { - type embed ConnectedSourceClientFacing +func (f *FallbackTimeZone) UnmarshalJSON(data []byte) error { + type embed FallbackTimeZone var unmarshaler = struct { embed - CreatedOn *internal.DateTime `json:"created_on"` + UpdatedAt *internal.DateTime `json:"updated_at"` }{ - embed: embed(*c), + embed: embed(*f), } if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *c = ConnectedSourceClientFacing(unmarshaler.embed) - c.CreatedOn = unmarshaler.CreatedOn.Time() - extraProperties, err := internal.ExtractExtraProperties(data, *c) + *f = FallbackTimeZone(unmarshaler.embed) + f.UpdatedAt = unmarshaler.UpdatedAt.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *f) if err != nil { return err } - c.extraProperties = extraProperties - c.rawJSON = json.RawMessage(data) + f.extraProperties = extraProperties + f.rawJSON = json.RawMessage(data) return nil } -func (c *ConnectedSourceClientFacing) MarshalJSON() ([]byte, error) { - type embed ConnectedSourceClientFacing +func (f *FallbackTimeZone) MarshalJSON() ([]byte, error) { + type embed FallbackTimeZone var marshaler = struct { embed - CreatedOn *internal.DateTime `json:"created_on"` + UpdatedAt *internal.DateTime `json:"updated_at"` }{ - embed: embed(*c), - CreatedOn: internal.NewDateTime(c.CreatedOn), + embed: embed(*f), + UpdatedAt: internal.NewDateTime(f.UpdatedAt), } - explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *ConnectedSourceClientFacing) String() string { - if len(c.rawJSON) > 0 { - if value, err := internal.StringifyJSON(c.rawJSON); err == nil { +func (f *FallbackTimeZone) String() string { + if len(f.rawJSON) > 0 { + if value, err := internal.StringifyJSON(f.rawJSON); err == nil { return value } } - if value, err := internal.StringifyJSON(c); err == nil { + if value, err := internal.StringifyJSON(f); err == nil { return value } - return fmt.Sprintf("%#v", c) + return fmt.Sprintf("%#v", f) +} + +// ℹ️ This enum is non-exhaustive. +type Gender string + +const ( + GenderFemale Gender = "female" + GenderMale Gender = "male" + GenderOther Gender = "other" + GenderUnknown Gender = "unknown" +) + +func NewGenderFromString(s string) (Gender, error) { + switch s { + case "female": + return GenderFemale, nil + case "male": + return GenderMale, nil + case "other": + return GenderOther, nil + case "unknown": + return GenderUnknown, nil + } + var t Gender + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (g Gender) Ptr() *Gender { + return &g +} + +// ℹ️ This enum is non-exhaustive. +type GenderIdentity string + +const ( + GenderIdentityMale GenderIdentity = "male" + GenderIdentityFemale GenderIdentity = "female" + GenderIdentityFemaleToMaleFtmTransgenderMaleTransMan GenderIdentity = "female_to_male_ftm_transgender_male_trans_man" + GenderIdentityMaleToFemaleMtfTransgenderFemaleTransWoman GenderIdentity = "male_to_female_mtf_transgender_female_trans_woman" + GenderIdentityGenderqueer GenderIdentity = "genderqueer" + GenderIdentityOther GenderIdentity = "other" +) + +func NewGenderIdentityFromString(s string) (GenderIdentity, error) { + switch s { + case "male": + return GenderIdentityMale, nil + case "female": + return GenderIdentityFemale, nil + case "female_to_male_ftm_transgender_male_trans_man": + return GenderIdentityFemaleToMaleFtmTransgenderMaleTransMan, nil + case "male_to_female_mtf_transgender_female_trans_woman": + return GenderIdentityMaleToFemaleMtfTransgenderFemaleTransWoman, nil + case "genderqueer": + return GenderIdentityGenderqueer, nil + case "other": + return GenderIdentityOther, nil + } + var t GenderIdentity + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (g GenderIdentity) Ptr() *GenderIdentity { + return &g } var ( - consentFieldConsentType = big.NewInt(1 << 0) - consentFieldVersion = big.NewInt(1 << 1) - consentFieldTimeOfConsent = big.NewInt(1 << 2) + guarantorDetailsFieldFirstName = big.NewInt(1 << 0) + guarantorDetailsFieldLastName = big.NewInt(1 << 1) + guarantorDetailsFieldAddress = big.NewInt(1 << 2) + guarantorDetailsFieldPhoneNumber = big.NewInt(1 << 3) + guarantorDetailsFieldHouseholdIncome = big.NewInt(1 << 4) + guarantorDetailsFieldHouseholdSize = big.NewInt(1 << 5) + guarantorDetailsFieldEmail = big.NewInt(1 << 6) ) -type Consent struct { - ConsentType ConsentType `json:"consentType" url:"consentType"` - Version *string `json:"version,omitempty" url:"version,omitempty"` - TimeOfConsent *time.Time `json:"timeOfConsent,omitempty" url:"timeOfConsent,omitempty"` +type GuarantorDetails struct { + FirstName string `json:"first_name" url:"first_name"` + LastName string `json:"last_name" url:"last_name"` + Address *Address `json:"address" url:"address"` + PhoneNumber string `json:"phone_number" url:"phone_number"` + HouseholdIncome *int `json:"household_income,omitempty" url:"household_income,omitempty"` + HouseholdSize *int `json:"household_size,omitempty" url:"household_size,omitempty"` + Email *string `json:"email,omitempty" url:"email,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -25097,151 +26871,188 @@ type Consent struct { rawJSON json.RawMessage } -func (c *Consent) GetConsentType() ConsentType { - if c == nil { +func (g *GuarantorDetails) GetFirstName() string { + if g == nil { return "" } - return c.ConsentType + return g.FirstName } -func (c *Consent) GetVersion() *string { - if c == nil { +func (g *GuarantorDetails) GetLastName() string { + if g == nil { + return "" + } + return g.LastName +} + +func (g *GuarantorDetails) GetAddress() *Address { + if g == nil { return nil } - return c.Version + return g.Address +} + +func (g *GuarantorDetails) GetPhoneNumber() string { + if g == nil { + return "" + } + return g.PhoneNumber +} + +func (g *GuarantorDetails) GetHouseholdIncome() *int { + if g == nil { + return nil + } + return g.HouseholdIncome +} + +func (g *GuarantorDetails) GetHouseholdSize() *int { + if g == nil { + return nil + } + return g.HouseholdSize +} + +func (g *GuarantorDetails) GetEmail() *string { + if g == nil { + return nil + } + return g.Email +} + +func (g *GuarantorDetails) GetExtraProperties() map[string]interface{} { + return g.extraProperties +} + +func (g *GuarantorDetails) require(field *big.Int) { + if g.explicitFields == nil { + g.explicitFields = big.NewInt(0) + } + g.explicitFields.Or(g.explicitFields, field) } -func (c *Consent) GetTimeOfConsent() *time.Time { - if c == nil { - return nil - } - return c.TimeOfConsent +// SetFirstName sets the FirstName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GuarantorDetails) SetFirstName(firstName string) { + g.FirstName = firstName + g.require(guarantorDetailsFieldFirstName) } -func (c *Consent) GetExtraProperties() map[string]interface{} { - return c.extraProperties +// SetLastName sets the LastName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GuarantorDetails) SetLastName(lastName string) { + g.LastName = lastName + g.require(guarantorDetailsFieldLastName) } -func (c *Consent) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) - } - c.explicitFields.Or(c.explicitFields, field) +// 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 (g *GuarantorDetails) SetAddress(address *Address) { + g.Address = address + g.require(guarantorDetailsFieldAddress) } -// SetConsentType sets the ConsentType field and marks it as non-optional; +// 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 (c *Consent) SetConsentType(consentType ConsentType) { - c.ConsentType = consentType - c.require(consentFieldConsentType) +func (g *GuarantorDetails) SetPhoneNumber(phoneNumber string) { + g.PhoneNumber = phoneNumber + g.require(guarantorDetailsFieldPhoneNumber) } -// SetVersion sets the Version field and marks it as non-optional; +// SetHouseholdIncome sets the HouseholdIncome field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *Consent) SetVersion(version *string) { - c.Version = version - c.require(consentFieldVersion) +func (g *GuarantorDetails) SetHouseholdIncome(householdIncome *int) { + g.HouseholdIncome = householdIncome + g.require(guarantorDetailsFieldHouseholdIncome) } -// SetTimeOfConsent sets the TimeOfConsent field and marks it as non-optional; +// SetHouseholdSize sets the HouseholdSize field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (c *Consent) SetTimeOfConsent(timeOfConsent *time.Time) { - c.TimeOfConsent = timeOfConsent - c.require(consentFieldTimeOfConsent) +func (g *GuarantorDetails) SetHouseholdSize(householdSize *int) { + g.HouseholdSize = householdSize + g.require(guarantorDetailsFieldHouseholdSize) } -func (c *Consent) UnmarshalJSON(data []byte) error { - type embed Consent - var unmarshaler = struct { - embed - TimeOfConsent *internal.DateTime `json:"timeOfConsent,omitempty"` - }{ - embed: embed(*c), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { +// SetEmail sets the Email field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (g *GuarantorDetails) SetEmail(email *string) { + g.Email = email + g.require(guarantorDetailsFieldEmail) +} + +func (g *GuarantorDetails) UnmarshalJSON(data []byte) error { + type unmarshaler GuarantorDetails + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *c = Consent(unmarshaler.embed) - c.TimeOfConsent = unmarshaler.TimeOfConsent.TimePtr() - extraProperties, err := internal.ExtractExtraProperties(data, *c) + *g = GuarantorDetails(value) + extraProperties, err := internal.ExtractExtraProperties(data, *g) if err != nil { return err } - c.extraProperties = extraProperties - c.rawJSON = json.RawMessage(data) + g.extraProperties = extraProperties + g.rawJSON = json.RawMessage(data) return nil } -func (c *Consent) MarshalJSON() ([]byte, error) { - type embed Consent +func (g *GuarantorDetails) MarshalJSON() ([]byte, error) { + type embed GuarantorDetails var marshaler = struct { embed - TimeOfConsent *internal.DateTime `json:"timeOfConsent,omitempty"` }{ - embed: embed(*c), - TimeOfConsent: internal.NewOptionalDateTime(c.TimeOfConsent), + embed: embed(*g), } - explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) + explicitMarshaler := internal.HandleExplicitFields(marshaler, g.explicitFields) return json.Marshal(explicitMarshaler) } -func (c *Consent) String() string { - if len(c.rawJSON) > 0 { - if value, err := internal.StringifyJSON(c.rawJSON); err == nil { +func (g *GuarantorDetails) String() string { + if len(g.rawJSON) > 0 { + if value, err := internal.StringifyJSON(g.rawJSON); err == nil { return value } } - if value, err := internal.StringifyJSON(c); err == nil { + if value, err := internal.StringifyJSON(g); err == nil { return value } - return fmt.Sprintf("%#v", c) -} - -// ℹ️ This enum is non-exhaustive. -type ConsentType string - -const ( - ConsentTypeTermsOfUse ConsentType = "terms-of-use" - ConsentTypeTelehealthInformedConsent ConsentType = "telehealth-informed-consent" - ConsentTypeMobileTermsAndConditions ConsentType = "mobile-terms-and-conditions" - ConsentTypeNoticeOfPrivacyPractices ConsentType = "notice-of-privacy-practices" - ConsentTypePrivacyPolicy ConsentType = "privacy-policy" - ConsentTypeHipaaAuthorization ConsentType = "hipaa-authorization" -) - -func NewConsentTypeFromString(s string) (ConsentType, error) { - switch s { - case "terms-of-use": - return ConsentTypeTermsOfUse, nil - case "telehealth-informed-consent": - return ConsentTypeTelehealthInformedConsent, nil - case "mobile-terms-and-conditions": - return ConsentTypeMobileTermsAndConditions, nil - case "notice-of-privacy-practices": - return ConsentTypeNoticeOfPrivacyPractices, nil - case "privacy-policy": - return ConsentTypePrivacyPolicy, nil - case "hipaa-authorization": - return ConsentTypeHipaaAuthorization, nil - } - var t ConsentType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (c ConsentType) Ptr() *ConsentType { - return &c + return fmt.Sprintf("%#v", g) } var ( - continuousQueryResultTableChangesFieldQueryId = big.NewInt(1 << 0) - continuousQueryResultTableChangesFieldQuerySlug = big.NewInt(1 << 1) - continuousQueryResultTableChangesFieldData = big.NewInt(1 << 2) + healthInsuranceCreateRequestFieldFrontImage = big.NewInt(1 << 0) + healthInsuranceCreateRequestFieldBackImage = big.NewInt(1 << 1) + healthInsuranceCreateRequestFieldPatientSignatureImage = big.NewInt(1 << 2) + healthInsuranceCreateRequestFieldSubjective = big.NewInt(1 << 3) + healthInsuranceCreateRequestFieldAssessmentPlan = big.NewInt(1 << 4) + healthInsuranceCreateRequestFieldPayorCode = big.NewInt(1 << 5) + healthInsuranceCreateRequestFieldInsuranceId = big.NewInt(1 << 6) + healthInsuranceCreateRequestFieldResponsibleRelationship = big.NewInt(1 << 7) + healthInsuranceCreateRequestFieldResponsibleDetails = big.NewInt(1 << 8) + healthInsuranceCreateRequestFieldDiagnosisCodes = big.NewInt(1 << 9) ) -type ContinuousQueryResultTableChanges struct { - QueryId string `json:"query_id" url:"query_id"` - QuerySlug string `json:"query_slug" url:"query_slug"` - Data map[string][]interface{} `json:"data" url:"data"` +type HealthInsuranceCreateRequest struct { + // An image of the front of the patient insurance card. + FrontImage *HealthInsuranceCreateRequestFrontImage `json:"front_image,omitempty" url:"front_image,omitempty"` + // An image of the back of the patient insurance card. + BackImage *HealthInsuranceCreateRequestBackImage `json:"back_image,omitempty" url:"back_image,omitempty"` + // An image of the patient signature for health insurance billing. + PatientSignatureImage *HealthInsuranceCreateRequestPatientSignatureImage `json:"patient_signature_image,omitempty" url:"patient_signature_image,omitempty"` + // Textual description of what are the patient symptoms and attempted treatments. + Subjective *string `json:"subjective,omitempty" url:"subjective,omitempty"` + // Textual description of what are the physician assessments and testing plans. + AssessmentPlan *string `json:"assessment_plan,omitempty" url:"assessment_plan,omitempty"` + // Unique identifier representing a specific Health Insurance. + PayorCode *string `json:"payor_code,omitempty" url:"payor_code,omitempty"` + // Insurance unique number assigned to a patient, usually present on the insurance card. + InsuranceId *string `json:"insurance_id,omitempty" url:"insurance_id,omitempty"` + // Relationship between the patient and the insurance contractor. Values can be (Self, Spouse, Other Relationship). + ResponsibleRelationship *ResponsibleRelationship `json:"responsible_relationship,omitempty" url:"responsible_relationship,omitempty"` + // Responsible details when the value of responsible_relationship is not 'Self'. + ResponsibleDetails *VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails `json:"responsible_details,omitempty" url:"responsible_details,omitempty"` + // Diagnosis codes for insurance billing. + DiagnosisCodes []string `json:"diagnosis_codes,omitempty" url:"diagnosis_codes,omitempty"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -25250,450 +27061,399 @@ type ContinuousQueryResultTableChanges struct { rawJSON json.RawMessage } -func (c *ContinuousQueryResultTableChanges) GetQueryId() string { - if c == nil { - return "" - } - return c.QueryId -} - -func (c *ContinuousQueryResultTableChanges) GetQuerySlug() string { - if c == nil { - return "" - } - return c.QuerySlug -} - -func (c *ContinuousQueryResultTableChanges) GetData() map[string][]interface{} { - if c == nil { +func (h *HealthInsuranceCreateRequest) GetFrontImage() *HealthInsuranceCreateRequestFrontImage { + if h == nil { return nil } - return c.Data -} - -func (c *ContinuousQueryResultTableChanges) GetExtraProperties() map[string]interface{} { - return c.extraProperties + return h.FrontImage } -func (c *ContinuousQueryResultTableChanges) require(field *big.Int) { - if c.explicitFields == nil { - c.explicitFields = big.NewInt(0) +func (h *HealthInsuranceCreateRequest) GetBackImage() *HealthInsuranceCreateRequestBackImage { + if h == nil { + return nil } - c.explicitFields.Or(c.explicitFields, field) -} - -// SetQueryId sets the QueryId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ContinuousQueryResultTableChanges) SetQueryId(queryId string) { - c.QueryId = queryId - c.require(continuousQueryResultTableChangesFieldQueryId) -} - -// SetQuerySlug sets the QuerySlug field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (c *ContinuousQueryResultTableChanges) SetQuerySlug(querySlug string) { - c.QuerySlug = querySlug - c.require(continuousQueryResultTableChangesFieldQuerySlug) -} - -// 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 *ContinuousQueryResultTableChanges) SetData(data map[string][]interface{}) { - c.Data = data - c.require(continuousQueryResultTableChangesFieldData) + return h.BackImage } -func (c *ContinuousQueryResultTableChanges) UnmarshalJSON(data []byte) error { - type unmarshaler ContinuousQueryResultTableChanges - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { - return err - } - *c = ContinuousQueryResultTableChanges(value) - extraProperties, err := internal.ExtractExtraProperties(data, *c) - if err != nil { - return err +func (h *HealthInsuranceCreateRequest) GetPatientSignatureImage() *HealthInsuranceCreateRequestPatientSignatureImage { + if h == nil { + return nil } - c.extraProperties = extraProperties - c.rawJSON = json.RawMessage(data) - return nil + return h.PatientSignatureImage } -func (c *ContinuousQueryResultTableChanges) MarshalJSON() ([]byte, error) { - type embed ContinuousQueryResultTableChanges - var marshaler = struct { - embed - }{ - embed: embed(*c), +func (h *HealthInsuranceCreateRequest) GetSubjective() *string { + if h == nil { + return nil } - explicitMarshaler := internal.HandleExplicitFields(marshaler, c.explicitFields) - return json.Marshal(explicitMarshaler) + return h.Subjective } -func (c *ContinuousQueryResultTableChanges) String() string { - if len(c.rawJSON) > 0 { - if value, err := internal.StringifyJSON(c.rawJSON); err == nil { - return value - } +func (h *HealthInsuranceCreateRequest) GetAssessmentPlan() *string { + if h == nil { + return nil } - if value, err := internal.StringifyJSON(c); err == nil { - return value + return h.AssessmentPlan +} + +func (h *HealthInsuranceCreateRequest) GetPayorCode() *string { + if h == nil { + return nil } - return fmt.Sprintf("%#v", c) + return h.PayorCode } -// ℹ️ This enum is non-exhaustive. -type Ethnicity string +func (h *HealthInsuranceCreateRequest) GetInsuranceId() *string { + if h == nil { + return nil + } + return h.InsuranceId +} -const ( - EthnicityHispanic Ethnicity = "hispanic" - EthnicityNonHispanic Ethnicity = "non_hispanic" - EthnicityAshkenaziJewish Ethnicity = "ashkenazi_jewish" - EthnicityOther Ethnicity = "other" -) +func (h *HealthInsuranceCreateRequest) GetResponsibleRelationship() *ResponsibleRelationship { + if h == nil { + return nil + } + return h.ResponsibleRelationship +} -func NewEthnicityFromString(s string) (Ethnicity, error) { - switch s { - case "hispanic": - return EthnicityHispanic, nil - case "non_hispanic": - return EthnicityNonHispanic, nil - case "ashkenazi_jewish": - return EthnicityAshkenaziJewish, nil - case "other": - return EthnicityOther, nil +func (h *HealthInsuranceCreateRequest) GetResponsibleDetails() *VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails { + if h == nil { + return nil } - var t Ethnicity - return "", fmt.Errorf("%s is not a valid %T", s, t) + return h.ResponsibleDetails } -func (e Ethnicity) Ptr() *Ethnicity { - return &e +func (h *HealthInsuranceCreateRequest) GetDiagnosisCodes() []string { + if h == nil { + return nil + } + return h.DiagnosisCodes } -var ( - fallbackBirthDateFieldValue = big.NewInt(1 << 0) - fallbackBirthDateFieldSourceSlug = big.NewInt(1 << 1) - fallbackBirthDateFieldUpdatedAt = big.NewInt(1 << 2) -) +func (h *HealthInsuranceCreateRequest) GetExtraProperties() map[string]interface{} { + return h.extraProperties +} -type FallbackBirthDate struct { - // Fallback date of birth of the user, in YYYY-mm-dd format. Used for calculating max heartrate for providers that don not provide users' age. - Value string `json:"value" url:"value"` - // Slug for designated source - SourceSlug string `json:"source_slug" url:"source_slug"` - UpdatedAt time.Time `json:"updated_at" url:"updated_at"` +func (h *HealthInsuranceCreateRequest) require(field *big.Int) { + if h.explicitFields == nil { + h.explicitFields = big.NewInt(0) + } + h.explicitFields.Or(h.explicitFields, field) +} - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` +// SetFrontImage sets the FrontImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (h *HealthInsuranceCreateRequest) SetFrontImage(frontImage *HealthInsuranceCreateRequestFrontImage) { + h.FrontImage = frontImage + h.require(healthInsuranceCreateRequestFieldFrontImage) +} - extraProperties map[string]interface{} - rawJSON json.RawMessage +// SetBackImage sets the BackImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (h *HealthInsuranceCreateRequest) SetBackImage(backImage *HealthInsuranceCreateRequestBackImage) { + h.BackImage = backImage + h.require(healthInsuranceCreateRequestFieldBackImage) } -func (f *FallbackBirthDate) GetValue() string { - if f == nil { - return "" - } - return f.Value +// SetPatientSignatureImage sets the PatientSignatureImage field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (h *HealthInsuranceCreateRequest) SetPatientSignatureImage(patientSignatureImage *HealthInsuranceCreateRequestPatientSignatureImage) { + h.PatientSignatureImage = patientSignatureImage + h.require(healthInsuranceCreateRequestFieldPatientSignatureImage) } -func (f *FallbackBirthDate) GetSourceSlug() string { - if f == nil { - return "" - } - return f.SourceSlug +// SetSubjective sets the Subjective field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (h *HealthInsuranceCreateRequest) SetSubjective(subjective *string) { + h.Subjective = subjective + h.require(healthInsuranceCreateRequestFieldSubjective) } -func (f *FallbackBirthDate) GetUpdatedAt() time.Time { - if f == nil { - return time.Time{} - } - return f.UpdatedAt +// SetAssessmentPlan sets the AssessmentPlan field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (h *HealthInsuranceCreateRequest) SetAssessmentPlan(assessmentPlan *string) { + h.AssessmentPlan = assessmentPlan + h.require(healthInsuranceCreateRequestFieldAssessmentPlan) } -func (f *FallbackBirthDate) GetExtraProperties() map[string]interface{} { - return f.extraProperties +// SetPayorCode sets the PayorCode field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (h *HealthInsuranceCreateRequest) SetPayorCode(payorCode *string) { + h.PayorCode = payorCode + h.require(healthInsuranceCreateRequestFieldPayorCode) } -func (f *FallbackBirthDate) require(field *big.Int) { - if f.explicitFields == nil { - f.explicitFields = big.NewInt(0) - } - f.explicitFields.Or(f.explicitFields, field) +// SetInsuranceId sets the InsuranceId field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (h *HealthInsuranceCreateRequest) SetInsuranceId(insuranceId *string) { + h.InsuranceId = insuranceId + h.require(healthInsuranceCreateRequestFieldInsuranceId) } -// SetValue sets the Value field and marks it as non-optional; +// SetResponsibleRelationship sets the ResponsibleRelationship field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (f *FallbackBirthDate) SetValue(value string) { - f.Value = value - f.require(fallbackBirthDateFieldValue) +func (h *HealthInsuranceCreateRequest) SetResponsibleRelationship(responsibleRelationship *ResponsibleRelationship) { + h.ResponsibleRelationship = responsibleRelationship + h.require(healthInsuranceCreateRequestFieldResponsibleRelationship) } -// SetSourceSlug sets the SourceSlug field and marks it as non-optional; +// SetResponsibleDetails sets the ResponsibleDetails field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (f *FallbackBirthDate) SetSourceSlug(sourceSlug string) { - f.SourceSlug = sourceSlug - f.require(fallbackBirthDateFieldSourceSlug) +func (h *HealthInsuranceCreateRequest) SetResponsibleDetails(responsibleDetails *VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails) { + h.ResponsibleDetails = responsibleDetails + h.require(healthInsuranceCreateRequestFieldResponsibleDetails) } -// SetUpdatedAt sets the UpdatedAt field and marks it as non-optional; +// SetDiagnosisCodes sets the DiagnosisCodes field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (f *FallbackBirthDate) SetUpdatedAt(updatedAt time.Time) { - f.UpdatedAt = updatedAt - f.require(fallbackBirthDateFieldUpdatedAt) +func (h *HealthInsuranceCreateRequest) SetDiagnosisCodes(diagnosisCodes []string) { + h.DiagnosisCodes = diagnosisCodes + h.require(healthInsuranceCreateRequestFieldDiagnosisCodes) } -func (f *FallbackBirthDate) UnmarshalJSON(data []byte) error { - type embed FallbackBirthDate - var unmarshaler = struct { - embed - UpdatedAt *internal.DateTime `json:"updated_at"` - }{ - embed: embed(*f), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { +func (h *HealthInsuranceCreateRequest) UnmarshalJSON(data []byte) error { + type unmarshaler HealthInsuranceCreateRequest + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { return err } - *f = FallbackBirthDate(unmarshaler.embed) - f.UpdatedAt = unmarshaler.UpdatedAt.Time() - extraProperties, err := internal.ExtractExtraProperties(data, *f) + *h = HealthInsuranceCreateRequest(value) + extraProperties, err := internal.ExtractExtraProperties(data, *h) if err != nil { return err } - f.extraProperties = extraProperties - f.rawJSON = json.RawMessage(data) + h.extraProperties = extraProperties + h.rawJSON = json.RawMessage(data) return nil } -func (f *FallbackBirthDate) MarshalJSON() ([]byte, error) { - type embed FallbackBirthDate +func (h *HealthInsuranceCreateRequest) MarshalJSON() ([]byte, error) { + type embed HealthInsuranceCreateRequest var marshaler = struct { embed - UpdatedAt *internal.DateTime `json:"updated_at"` }{ - embed: embed(*f), - UpdatedAt: internal.NewDateTime(f.UpdatedAt), + embed: embed(*h), } - explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) + explicitMarshaler := internal.HandleExplicitFields(marshaler, h.explicitFields) return json.Marshal(explicitMarshaler) } -func (f *FallbackBirthDate) String() string { - if len(f.rawJSON) > 0 { - if value, err := internal.StringifyJSON(f.rawJSON); err == nil { +func (h *HealthInsuranceCreateRequest) String() string { + if len(h.rawJSON) > 0 { + if value, err := internal.StringifyJSON(h.rawJSON); err == nil { return value } } - if value, err := internal.StringifyJSON(f); err == nil { + if value, err := internal.StringifyJSON(h); err == nil { return value } - return fmt.Sprintf("%#v", f) + return fmt.Sprintf("%#v", h) } -var ( - fallbackTimeZoneFieldId = big.NewInt(1 << 0) - fallbackTimeZoneFieldSourceSlug = big.NewInt(1 << 1) - fallbackTimeZoneFieldUpdatedAt = big.NewInt(1 << 2) -) - -type FallbackTimeZone struct { - // Fallback time zone of the user, in the form of a valid IANA tzdatabase identifier (e.g., `Europe/London` or `America/Los_Angeles`). - // Used when pulling data from sources that are completely time zone agnostic (e.g., all time is relative to UTC clock, without any time zone attributions on data points). - Id string `json:"id" url:"id"` - // Slug for designated source - SourceSlug string `json:"source_slug" url:"source_slug"` - UpdatedAt time.Time `json:"updated_at" url:"updated_at"` +// An image of the back of the patient insurance card. +type HealthInsuranceCreateRequestBackImage struct { + Jpeg *Jpeg + Png *Png - // 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 (h *HealthInsuranceCreateRequestBackImage) GetJpeg() *Jpeg { + if h == nil { + return nil + } + return h.Jpeg } -func (f *FallbackTimeZone) GetId() string { - if f == nil { - return "" +func (h *HealthInsuranceCreateRequestBackImage) GetPng() *Png { + if h == nil { + return nil } - return f.Id + return h.Png } -func (f *FallbackTimeZone) GetSourceSlug() string { - if f == nil { - return "" +func (h *HealthInsuranceCreateRequestBackImage) UnmarshalJSON(data []byte) error { + valueJpeg := new(Jpeg) + if err := json.Unmarshal(data, &valueJpeg); err == nil { + h.typ = "Jpeg" + h.Jpeg = valueJpeg + return nil + } + valuePng := new(Png) + if err := json.Unmarshal(data, &valuePng); err == nil { + h.typ = "Png" + h.Png = valuePng + return nil } - return f.SourceSlug + return fmt.Errorf("%s cannot be deserialized as a %T", data, h) } -func (f *FallbackTimeZone) GetUpdatedAt() time.Time { - if f == nil { - return time.Time{} +func (h HealthInsuranceCreateRequestBackImage) MarshalJSON() ([]byte, error) { + if h.typ == "Jpeg" || h.Jpeg != nil { + return json.Marshal(h.Jpeg) } - return f.UpdatedAt + if h.typ == "Png" || h.Png != nil { + return json.Marshal(h.Png) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", h) } -func (f *FallbackTimeZone) GetExtraProperties() map[string]interface{} { - return f.extraProperties +type HealthInsuranceCreateRequestBackImageVisitor interface { + VisitJpeg(*Jpeg) error + VisitPng(*Png) error } -func (f *FallbackTimeZone) require(field *big.Int) { - if f.explicitFields == nil { - f.explicitFields = big.NewInt(0) +func (h *HealthInsuranceCreateRequestBackImage) Accept(visitor HealthInsuranceCreateRequestBackImageVisitor) error { + if h.typ == "Jpeg" || h.Jpeg != nil { + return visitor.VisitJpeg(h.Jpeg) } - f.explicitFields.Or(f.explicitFields, field) + if h.typ == "Png" || h.Png != nil { + return visitor.VisitPng(h.Png) + } + return fmt.Errorf("type %T does not include a non-empty union type", h) } -// 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 (f *FallbackTimeZone) SetId(id string) { - f.Id = id - f.require(fallbackTimeZoneFieldId) -} +// An image of the front of the patient insurance card. +type HealthInsuranceCreateRequestFrontImage struct { + Jpeg *Jpeg + Png *Png -// SetSourceSlug sets the SourceSlug field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (f *FallbackTimeZone) SetSourceSlug(sourceSlug string) { - f.SourceSlug = sourceSlug - f.require(fallbackTimeZoneFieldSourceSlug) + typ string } -// 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 (f *FallbackTimeZone) SetUpdatedAt(updatedAt time.Time) { - f.UpdatedAt = updatedAt - f.require(fallbackTimeZoneFieldUpdatedAt) +func (h *HealthInsuranceCreateRequestFrontImage) GetJpeg() *Jpeg { + if h == nil { + return nil + } + return h.Jpeg } -func (f *FallbackTimeZone) UnmarshalJSON(data []byte) error { - type embed FallbackTimeZone - var unmarshaler = struct { - embed - UpdatedAt *internal.DateTime `json:"updated_at"` - }{ - embed: embed(*f), +func (h *HealthInsuranceCreateRequestFrontImage) GetPng() *Png { + if h == nil { + return nil } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err + return h.Png +} + +func (h *HealthInsuranceCreateRequestFrontImage) UnmarshalJSON(data []byte) error { + valueJpeg := new(Jpeg) + if err := json.Unmarshal(data, &valueJpeg); err == nil { + h.typ = "Jpeg" + h.Jpeg = valueJpeg + return nil } - *f = FallbackTimeZone(unmarshaler.embed) - f.UpdatedAt = unmarshaler.UpdatedAt.Time() - extraProperties, err := internal.ExtractExtraProperties(data, *f) - if err != nil { - return err + valuePng := new(Png) + if err := json.Unmarshal(data, &valuePng); err == nil { + h.typ = "Png" + h.Png = valuePng + return nil } - f.extraProperties = extraProperties - f.rawJSON = json.RawMessage(data) - return nil + return fmt.Errorf("%s cannot be deserialized as a %T", data, h) } -func (f *FallbackTimeZone) MarshalJSON() ([]byte, error) { - type embed FallbackTimeZone - var marshaler = struct { - embed - UpdatedAt *internal.DateTime `json:"updated_at"` - }{ - embed: embed(*f), - UpdatedAt: internal.NewDateTime(f.UpdatedAt), +func (h HealthInsuranceCreateRequestFrontImage) MarshalJSON() ([]byte, error) { + if h.typ == "Jpeg" || h.Jpeg != nil { + return json.Marshal(h.Jpeg) } - explicitMarshaler := internal.HandleExplicitFields(marshaler, f.explicitFields) - return json.Marshal(explicitMarshaler) + if h.typ == "Png" || h.Png != nil { + return json.Marshal(h.Png) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", h) } -func (f *FallbackTimeZone) String() string { - if len(f.rawJSON) > 0 { - if value, err := internal.StringifyJSON(f.rawJSON); err == nil { - return value - } +type HealthInsuranceCreateRequestFrontImageVisitor interface { + VisitJpeg(*Jpeg) error + VisitPng(*Png) error +} + +func (h *HealthInsuranceCreateRequestFrontImage) Accept(visitor HealthInsuranceCreateRequestFrontImageVisitor) error { + if h.typ == "Jpeg" || h.Jpeg != nil { + return visitor.VisitJpeg(h.Jpeg) } - if value, err := internal.StringifyJSON(f); err == nil { - return value + if h.typ == "Png" || h.Png != nil { + return visitor.VisitPng(h.Png) } - return fmt.Sprintf("%#v", f) + return fmt.Errorf("type %T does not include a non-empty union type", h) } -// ℹ️ This enum is non-exhaustive. -type Gender string +// An image of the patient signature for health insurance billing. +type HealthInsuranceCreateRequestPatientSignatureImage struct { + Jpeg *Jpeg + Png *Png -const ( - GenderFemale Gender = "female" - GenderMale Gender = "male" - GenderOther Gender = "other" - GenderUnknown Gender = "unknown" -) + typ string +} -func NewGenderFromString(s string) (Gender, error) { - switch s { - case "female": - return GenderFemale, nil - case "male": - return GenderMale, nil - case "other": - return GenderOther, nil - case "unknown": - return GenderUnknown, nil +func (h *HealthInsuranceCreateRequestPatientSignatureImage) GetJpeg() *Jpeg { + if h == nil { + return nil } - var t Gender - return "", fmt.Errorf("%s is not a valid %T", s, t) + return h.Jpeg } -func (g Gender) Ptr() *Gender { - return &g +func (h *HealthInsuranceCreateRequestPatientSignatureImage) GetPng() *Png { + if h == nil { + return nil + } + return h.Png } -// ℹ️ This enum is non-exhaustive. -type GenderIdentity string - -const ( - GenderIdentityMale GenderIdentity = "male" - GenderIdentityFemale GenderIdentity = "female" - GenderIdentityFemaleToMaleFtmTransgenderMaleTransMan GenderIdentity = "female_to_male_ftm_transgender_male_trans_man" - GenderIdentityMaleToFemaleMtfTransgenderFemaleTransWoman GenderIdentity = "male_to_female_mtf_transgender_female_trans_woman" - GenderIdentityGenderqueer GenderIdentity = "genderqueer" - GenderIdentityOther GenderIdentity = "other" -) +func (h *HealthInsuranceCreateRequestPatientSignatureImage) UnmarshalJSON(data []byte) error { + valueJpeg := new(Jpeg) + if err := json.Unmarshal(data, &valueJpeg); err == nil { + h.typ = "Jpeg" + h.Jpeg = valueJpeg + return nil + } + valuePng := new(Png) + if err := json.Unmarshal(data, &valuePng); err == nil { + h.typ = "Png" + h.Png = valuePng + return nil + } + return fmt.Errorf("%s cannot be deserialized as a %T", data, h) +} -func NewGenderIdentityFromString(s string) (GenderIdentity, error) { - switch s { - case "male": - return GenderIdentityMale, nil - case "female": - return GenderIdentityFemale, nil - case "female_to_male_ftm_transgender_male_trans_man": - return GenderIdentityFemaleToMaleFtmTransgenderMaleTransMan, nil - case "male_to_female_mtf_transgender_female_trans_woman": - return GenderIdentityMaleToFemaleMtfTransgenderFemaleTransWoman, nil - case "genderqueer": - return GenderIdentityGenderqueer, nil - case "other": - return GenderIdentityOther, nil +func (h HealthInsuranceCreateRequestPatientSignatureImage) MarshalJSON() ([]byte, error) { + if h.typ == "Jpeg" || h.Jpeg != nil { + return json.Marshal(h.Jpeg) } - var t GenderIdentity - return "", fmt.Errorf("%s is not a valid %T", s, t) + if h.typ == "Png" || h.Png != nil { + return json.Marshal(h.Png) + } + return nil, fmt.Errorf("type %T does not include a non-empty union type", h) } -func (g GenderIdentity) Ptr() *GenderIdentity { - return &g +type HealthInsuranceCreateRequestPatientSignatureImageVisitor interface { + VisitJpeg(*Jpeg) error + VisitPng(*Png) error +} + +func (h *HealthInsuranceCreateRequestPatientSignatureImage) Accept(visitor HealthInsuranceCreateRequestPatientSignatureImageVisitor) error { + if h.typ == "Jpeg" || h.Jpeg != nil { + return visitor.VisitJpeg(h.Jpeg) + } + if h.typ == "Png" || h.Png != nil { + return visitor.VisitPng(h.Png) + } + return fmt.Errorf("type %T does not include a non-empty union type", h) } var ( - guarantorDetailsFieldFirstName = big.NewInt(1 << 0) - guarantorDetailsFieldLastName = big.NewInt(1 << 1) - guarantorDetailsFieldAddress = big.NewInt(1 << 2) - guarantorDetailsFieldPhoneNumber = big.NewInt(1 << 3) - guarantorDetailsFieldHouseholdIncome = big.NewInt(1 << 4) - guarantorDetailsFieldHouseholdSize = big.NewInt(1 << 5) - guarantorDetailsFieldEmail = big.NewInt(1 << 6) + historicalPullCompletedFieldUserId = big.NewInt(1 << 0) + historicalPullCompletedFieldStartDate = big.NewInt(1 << 1) + historicalPullCompletedFieldEndDate = big.NewInt(1 << 2) + historicalPullCompletedFieldIsFinal = big.NewInt(1 << 3) + historicalPullCompletedFieldProvider = big.NewInt(1 << 4) ) -type GuarantorDetails struct { - FirstName string `json:"first_name" url:"first_name"` - LastName string `json:"last_name" url:"last_name"` - Address *Address `json:"address" url:"address"` - PhoneNumber string `json:"phone_number" url:"phone_number"` - HouseholdIncome *int `json:"household_income,omitempty" url:"household_income,omitempty"` - HouseholdSize *int `json:"household_size,omitempty" url:"household_size,omitempty"` - Email *string `json:"email,omitempty" url:"email,omitempty"` +type HistoricalPullCompleted struct { + UserId string `json:"user_id" url:"user_id"` + StartDate time.Time `json:"start_date" url:"start_date"` + EndDate time.Time `json:"end_date" url:"end_date"` + IsFinal bool `json:"is_final" url:"is_final"` + Provider string `json:"provider" url:"provider"` // Private bitmask of fields set to an explicit value and therefore not to be omitted explicitFields *big.Int `json:"-" url:"-"` @@ -25702,354 +27462,184 @@ type GuarantorDetails struct { rawJSON json.RawMessage } -func (g *GuarantorDetails) GetFirstName() string { - if g == nil { - return "" - } - return g.FirstName -} - -func (g *GuarantorDetails) GetLastName() string { - if g == nil { +func (h *HistoricalPullCompleted) GetUserId() string { + if h == nil { return "" } - return g.LastName -} - -func (g *GuarantorDetails) GetAddress() *Address { - if g == nil { - return nil - } - return g.Address + return h.UserId } -func (g *GuarantorDetails) GetPhoneNumber() string { - if g == nil { - return "" +func (h *HistoricalPullCompleted) GetStartDate() time.Time { + if h == nil { + return time.Time{} } - return g.PhoneNumber + return h.StartDate } -func (g *GuarantorDetails) GetHouseholdIncome() *int { - if g == nil { - return nil +func (h *HistoricalPullCompleted) GetEndDate() time.Time { + if h == nil { + return time.Time{} } - return g.HouseholdIncome + return h.EndDate } -func (g *GuarantorDetails) GetHouseholdSize() *int { - if g == nil { - return nil +func (h *HistoricalPullCompleted) GetIsFinal() bool { + if h == nil { + return false } - return g.HouseholdSize + return h.IsFinal } -func (g *GuarantorDetails) GetEmail() *string { - if g == nil { - return nil +func (h *HistoricalPullCompleted) GetProvider() string { + if h == nil { + return "" } - return g.Email + return h.Provider } -func (g *GuarantorDetails) GetExtraProperties() map[string]interface{} { - return g.extraProperties +func (h *HistoricalPullCompleted) GetExtraProperties() map[string]interface{} { + return h.extraProperties } -func (g *GuarantorDetails) require(field *big.Int) { - if g.explicitFields == nil { - g.explicitFields = big.NewInt(0) +func (h *HistoricalPullCompleted) require(field *big.Int) { + if h.explicitFields == nil { + h.explicitFields = big.NewInt(0) } - g.explicitFields.Or(g.explicitFields, field) -} - -// SetFirstName sets the FirstName field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (g *GuarantorDetails) SetFirstName(firstName string) { - g.FirstName = firstName - g.require(guarantorDetailsFieldFirstName) -} - -// SetLastName sets the LastName field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (g *GuarantorDetails) SetLastName(lastName string) { - g.LastName = lastName - g.require(guarantorDetailsFieldLastName) + h.explicitFields.Or(h.explicitFields, field) } -// SetAddress sets the Address 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 (g *GuarantorDetails) SetAddress(address *Address) { - g.Address = address - g.require(guarantorDetailsFieldAddress) +func (h *HistoricalPullCompleted) SetUserId(userId string) { + h.UserId = userId + h.require(historicalPullCompletedFieldUserId) } -// SetPhoneNumber sets the PhoneNumber field and marks it as non-optional; +// SetStartDate sets the StartDate field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (g *GuarantorDetails) SetPhoneNumber(phoneNumber string) { - g.PhoneNumber = phoneNumber - g.require(guarantorDetailsFieldPhoneNumber) +func (h *HistoricalPullCompleted) SetStartDate(startDate time.Time) { + h.StartDate = startDate + h.require(historicalPullCompletedFieldStartDate) } -// SetHouseholdIncome sets the HouseholdIncome field and marks it as non-optional; +// SetEndDate sets the EndDate field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (g *GuarantorDetails) SetHouseholdIncome(householdIncome *int) { - g.HouseholdIncome = householdIncome - g.require(guarantorDetailsFieldHouseholdIncome) +func (h *HistoricalPullCompleted) SetEndDate(endDate time.Time) { + h.EndDate = endDate + h.require(historicalPullCompletedFieldEndDate) } -// SetHouseholdSize sets the HouseholdSize field and marks it as non-optional; +// SetIsFinal sets the IsFinal field and marks it as non-optional; // this prevents an empty or null value for this field from being omitted during serialization. -func (g *GuarantorDetails) SetHouseholdSize(householdSize *int) { - g.HouseholdSize = householdSize - g.require(guarantorDetailsFieldHouseholdSize) +func (h *HistoricalPullCompleted) SetIsFinal(isFinal bool) { + h.IsFinal = isFinal + h.require(historicalPullCompletedFieldIsFinal) } -// SetEmail sets the Email field and marks it as non-optional; +// 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 (g *GuarantorDetails) SetEmail(email *string) { - g.Email = email - g.require(guarantorDetailsFieldEmail) +func (h *HistoricalPullCompleted) SetProvider(provider string) { + h.Provider = provider + h.require(historicalPullCompletedFieldProvider) } -func (g *GuarantorDetails) UnmarshalJSON(data []byte) error { - type unmarshaler GuarantorDetails - var value unmarshaler - if err := json.Unmarshal(data, &value); err != nil { +func (h *HistoricalPullCompleted) UnmarshalJSON(data []byte) error { + type embed HistoricalPullCompleted + var unmarshaler = struct { + embed + StartDate *internal.DateTime `json:"start_date"` + EndDate *internal.DateTime `json:"end_date"` + }{ + embed: embed(*h), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { return err } - *g = GuarantorDetails(value) - extraProperties, err := internal.ExtractExtraProperties(data, *g) + *h = HistoricalPullCompleted(unmarshaler.embed) + h.StartDate = unmarshaler.StartDate.Time() + h.EndDate = unmarshaler.EndDate.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *h) if err != nil { return err } - g.extraProperties = extraProperties - g.rawJSON = json.RawMessage(data) + h.extraProperties = extraProperties + h.rawJSON = json.RawMessage(data) return nil } -func (g *GuarantorDetails) MarshalJSON() ([]byte, error) { - type embed GuarantorDetails +func (h *HistoricalPullCompleted) MarshalJSON() ([]byte, error) { + type embed HistoricalPullCompleted var marshaler = struct { embed + StartDate *internal.DateTime `json:"start_date"` + EndDate *internal.DateTime `json:"end_date"` }{ - embed: embed(*g), + embed: embed(*h), + StartDate: internal.NewDateTime(h.StartDate), + EndDate: internal.NewDateTime(h.EndDate), } - explicitMarshaler := internal.HandleExplicitFields(marshaler, g.explicitFields) + explicitMarshaler := internal.HandleExplicitFields(marshaler, h.explicitFields) return json.Marshal(explicitMarshaler) } -func (g *GuarantorDetails) String() string { - if len(g.rawJSON) > 0 { - if value, err := internal.StringifyJSON(g.rawJSON); err == nil { +func (h *HistoricalPullCompleted) String() string { + if len(h.rawJSON) > 0 { + if value, err := internal.StringifyJSON(h.rawJSON); err == nil { return value - } - } - if value, err := internal.StringifyJSON(g); err == nil { - return value - } - return fmt.Sprintf("%#v", g) -} - -var ( - healthInsuranceCreateRequestFieldFrontImage = big.NewInt(1 << 0) - healthInsuranceCreateRequestFieldBackImage = big.NewInt(1 << 1) - healthInsuranceCreateRequestFieldPatientSignatureImage = big.NewInt(1 << 2) - healthInsuranceCreateRequestFieldSubjective = big.NewInt(1 << 3) - healthInsuranceCreateRequestFieldAssessmentPlan = big.NewInt(1 << 4) - healthInsuranceCreateRequestFieldPayorCode = big.NewInt(1 << 5) - healthInsuranceCreateRequestFieldInsuranceId = big.NewInt(1 << 6) - healthInsuranceCreateRequestFieldResponsibleRelationship = big.NewInt(1 << 7) - healthInsuranceCreateRequestFieldResponsibleDetails = big.NewInt(1 << 8) - healthInsuranceCreateRequestFieldDiagnosisCodes = big.NewInt(1 << 9) -) - -type HealthInsuranceCreateRequest struct { - // An image of the front of the patient insurance card. - FrontImage *HealthInsuranceCreateRequestFrontImage `json:"front_image,omitempty" url:"front_image,omitempty"` - // An image of the back of the patient insurance card. - BackImage *HealthInsuranceCreateRequestBackImage `json:"back_image,omitempty" url:"back_image,omitempty"` - // An image of the patient signature for health insurance billing. - PatientSignatureImage *HealthInsuranceCreateRequestPatientSignatureImage `json:"patient_signature_image,omitempty" url:"patient_signature_image,omitempty"` - // Textual description of what are the patient symptoms and attempted treatments. - Subjective *string `json:"subjective,omitempty" url:"subjective,omitempty"` - // Textual description of what are the physician assessments and testing plans. - AssessmentPlan *string `json:"assessment_plan,omitempty" url:"assessment_plan,omitempty"` - // Unique identifier representing a specific Health Insurance. - PayorCode *string `json:"payor_code,omitempty" url:"payor_code,omitempty"` - // Insurance unique number assigned to a patient, usually present on the insurance card. - InsuranceId *string `json:"insurance_id,omitempty" url:"insurance_id,omitempty"` - // Relationship between the patient and the insurance contractor. Values can be (Self, Spouse, Other Relationship). - ResponsibleRelationship *ResponsibleRelationship `json:"responsible_relationship,omitempty" url:"responsible_relationship,omitempty"` - // Responsible details when the value of responsible_relationship is not 'Self'. - ResponsibleDetails *VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails `json:"responsible_details,omitempty" url:"responsible_details,omitempty"` - // Diagnosis codes for insurance billing. - DiagnosisCodes []string `json:"diagnosis_codes,omitempty" url:"diagnosis_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 (h *HealthInsuranceCreateRequest) GetFrontImage() *HealthInsuranceCreateRequestFrontImage { - if h == nil { - return nil - } - return h.FrontImage -} - -func (h *HealthInsuranceCreateRequest) GetBackImage() *HealthInsuranceCreateRequestBackImage { - if h == nil { - return nil - } - return h.BackImage -} - -func (h *HealthInsuranceCreateRequest) GetPatientSignatureImage() *HealthInsuranceCreateRequestPatientSignatureImage { - if h == nil { - return nil - } - return h.PatientSignatureImage -} - -func (h *HealthInsuranceCreateRequest) GetSubjective() *string { - if h == nil { - return nil - } - return h.Subjective -} - -func (h *HealthInsuranceCreateRequest) GetAssessmentPlan() *string { - if h == nil { - return nil - } - return h.AssessmentPlan -} - -func (h *HealthInsuranceCreateRequest) GetPayorCode() *string { - if h == nil { - return nil - } - return h.PayorCode -} - -func (h *HealthInsuranceCreateRequest) GetInsuranceId() *string { - if h == nil { - return nil + } } - return h.InsuranceId -} - -func (h *HealthInsuranceCreateRequest) GetResponsibleRelationship() *ResponsibleRelationship { - if h == nil { - return nil + if value, err := internal.StringifyJSON(h); err == nil { + return value } - return h.ResponsibleRelationship + return fmt.Sprintf("%#v", h) } -func (h *HealthInsuranceCreateRequest) GetResponsibleDetails() *VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails { - if h == nil { - return nil - } - return h.ResponsibleDetails +var ( + httpValidationErrorFieldDetail = big.NewInt(1 << 0) +) + +type HttpValidationError struct { + Detail interface{} `json:"detail,omitempty" url:"detail,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 (h *HealthInsuranceCreateRequest) GetDiagnosisCodes() []string { +func (h *HttpValidationError) GetDetail() interface{} { if h == nil { return nil } - return h.DiagnosisCodes + return h.Detail } -func (h *HealthInsuranceCreateRequest) GetExtraProperties() map[string]interface{} { +func (h *HttpValidationError) GetExtraProperties() map[string]interface{} { return h.extraProperties } -func (h *HealthInsuranceCreateRequest) require(field *big.Int) { +func (h *HttpValidationError) require(field *big.Int) { if h.explicitFields == nil { h.explicitFields = big.NewInt(0) } h.explicitFields.Or(h.explicitFields, field) } -// SetFrontImage sets the FrontImage field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (h *HealthInsuranceCreateRequest) SetFrontImage(frontImage *HealthInsuranceCreateRequestFrontImage) { - h.FrontImage = frontImage - h.require(healthInsuranceCreateRequestFieldFrontImage) -} - -// SetBackImage sets the BackImage field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (h *HealthInsuranceCreateRequest) SetBackImage(backImage *HealthInsuranceCreateRequestBackImage) { - h.BackImage = backImage - h.require(healthInsuranceCreateRequestFieldBackImage) -} - -// SetPatientSignatureImage sets the PatientSignatureImage field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (h *HealthInsuranceCreateRequest) SetPatientSignatureImage(patientSignatureImage *HealthInsuranceCreateRequestPatientSignatureImage) { - h.PatientSignatureImage = patientSignatureImage - h.require(healthInsuranceCreateRequestFieldPatientSignatureImage) -} - -// SetSubjective sets the Subjective field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (h *HealthInsuranceCreateRequest) SetSubjective(subjective *string) { - h.Subjective = subjective - h.require(healthInsuranceCreateRequestFieldSubjective) -} - -// SetAssessmentPlan sets the AssessmentPlan field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (h *HealthInsuranceCreateRequest) SetAssessmentPlan(assessmentPlan *string) { - h.AssessmentPlan = assessmentPlan - h.require(healthInsuranceCreateRequestFieldAssessmentPlan) -} - -// SetPayorCode sets the PayorCode field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (h *HealthInsuranceCreateRequest) SetPayorCode(payorCode *string) { - h.PayorCode = payorCode - h.require(healthInsuranceCreateRequestFieldPayorCode) -} - -// SetInsuranceId sets the InsuranceId field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (h *HealthInsuranceCreateRequest) SetInsuranceId(insuranceId *string) { - h.InsuranceId = insuranceId - h.require(healthInsuranceCreateRequestFieldInsuranceId) -} - -// SetResponsibleRelationship sets the ResponsibleRelationship field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (h *HealthInsuranceCreateRequest) SetResponsibleRelationship(responsibleRelationship *ResponsibleRelationship) { - h.ResponsibleRelationship = responsibleRelationship - h.require(healthInsuranceCreateRequestFieldResponsibleRelationship) -} - -// SetResponsibleDetails sets the ResponsibleDetails field and marks it as non-optional; -// this prevents an empty or null value for this field from being omitted during serialization. -func (h *HealthInsuranceCreateRequest) SetResponsibleDetails(responsibleDetails *VitalCoreSchemasDbSchemasLabTestHealthInsurancePersonDetails) { - h.ResponsibleDetails = responsibleDetails - h.require(healthInsuranceCreateRequestFieldResponsibleDetails) -} - -// SetDiagnosisCodes sets the DiagnosisCodes field and marks it as non-optional; +// 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 (h *HealthInsuranceCreateRequest) SetDiagnosisCodes(diagnosisCodes []string) { - h.DiagnosisCodes = diagnosisCodes - h.require(healthInsuranceCreateRequestFieldDiagnosisCodes) +func (h *HttpValidationError) SetDetail(detail interface{}) { + h.Detail = detail + h.require(httpValidationErrorFieldDetail) } -func (h *HealthInsuranceCreateRequest) UnmarshalJSON(data []byte) error { - type unmarshaler HealthInsuranceCreateRequest +func (h *HttpValidationError) UnmarshalJSON(data []byte) error { + type unmarshaler HttpValidationError var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *h = HealthInsuranceCreateRequest(value) + *h = HttpValidationError(value) extraProperties, err := internal.ExtractExtraProperties(data, *h) if err != nil { return err @@ -26059,8 +27649,8 @@ func (h *HealthInsuranceCreateRequest) UnmarshalJSON(data []byte) error { return nil } -func (h *HealthInsuranceCreateRequest) MarshalJSON() ([]byte, error) { - type embed HealthInsuranceCreateRequest +func (h *HttpValidationError) MarshalJSON() ([]byte, error) { + type embed HttpValidationError var marshaler = struct { embed }{ @@ -26070,7 +27660,7 @@ func (h *HealthInsuranceCreateRequest) MarshalJSON() ([]byte, error) { return json.Marshal(explicitMarshaler) } -func (h *HealthInsuranceCreateRequest) String() string { +func (h *HttpValidationError) String() string { if len(h.rawJSON) > 0 { if value, err := internal.StringifyJSON(h.rawJSON); err == nil { return value @@ -26082,548 +27672,617 @@ func (h *HealthInsuranceCreateRequest) String() string { return fmt.Sprintf("%#v", h) } -// An image of the back of the patient insurance card. -type HealthInsuranceCreateRequestBackImage struct { - Jpeg *Jpeg - Png *Png +// ℹ️ This enum is non-exhaustive. +type Interpretation string - typ string -} +const ( + InterpretationNormal Interpretation = "normal" + InterpretationAbnormal Interpretation = "abnormal" + InterpretationCritical Interpretation = "critical" + InterpretationUnknown Interpretation = "unknown" +) -func (h *HealthInsuranceCreateRequestBackImage) GetJpeg() *Jpeg { - if h == nil { - return 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 } - return h.Jpeg + var t Interpretation + return "", fmt.Errorf("%s is not a valid %T", s, t) } -func (h *HealthInsuranceCreateRequestBackImage) GetPng() *Png { - if h == nil { - return nil - } - return h.Png +func (i Interpretation) Ptr() *Interpretation { + return &i } -func (h *HealthInsuranceCreateRequestBackImage) UnmarshalJSON(data []byte) error { - valueJpeg := new(Jpeg) - if err := json.Unmarshal(data, &valueJpeg); err == nil { - h.typ = "Jpeg" - h.Jpeg = valueJpeg - return nil - } - valuePng := new(Png) - if err := json.Unmarshal(data, &valuePng); err == nil { - h.typ = "Png" - h.Png = valuePng - return nil - } - return fmt.Errorf("%s cannot be deserialized as a %T", data, h) -} +var ( + jpegFieldContent = big.NewInt(1 << 0) +) -func (h HealthInsuranceCreateRequestBackImage) MarshalJSON() ([]byte, error) { - if h.typ == "Jpeg" || h.Jpeg != nil { - return json.Marshal(h.Jpeg) - } - if h.typ == "Png" || h.Png != nil { - return json.Marshal(h.Png) - } - return nil, fmt.Errorf("type %T does not include a non-empty union type", h) -} +type Jpeg struct { + Content string `json:"content" url:"content"` -type HealthInsuranceCreateRequestBackImageVisitor interface { - VisitJpeg(*Jpeg) error - VisitPng(*Png) error + // 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 (h *HealthInsuranceCreateRequestBackImage) Accept(visitor HealthInsuranceCreateRequestBackImageVisitor) error { - if h.typ == "Jpeg" || h.Jpeg != nil { - return visitor.VisitJpeg(h.Jpeg) - } - if h.typ == "Png" || h.Png != nil { - return visitor.VisitPng(h.Png) +func (j *Jpeg) GetContent() string { + if j == nil { + return "" } - return fmt.Errorf("type %T does not include a non-empty union type", h) + return j.Content } -// An image of the front of the patient insurance card. -type HealthInsuranceCreateRequestFrontImage struct { - Jpeg *Jpeg - Png *Png +func (j *Jpeg) ContentType() string { + return j.contentType +} - typ string +func (j *Jpeg) GetExtraProperties() map[string]interface{} { + return j.extraProperties } -func (h *HealthInsuranceCreateRequestFrontImage) GetJpeg() *Jpeg { - if h == nil { - return nil +func (j *Jpeg) require(field *big.Int) { + if j.explicitFields == nil { + j.explicitFields = big.NewInt(0) } - return h.Jpeg + j.explicitFields.Or(j.explicitFields, field) } -func (h *HealthInsuranceCreateRequestFrontImage) GetPng() *Png { - if h == nil { - return nil +// 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), } - return h.Png + 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 (h *HealthInsuranceCreateRequestFrontImage) UnmarshalJSON(data []byte) error { - valueJpeg := new(Jpeg) - if err := json.Unmarshal(data, &valueJpeg); err == nil { - h.typ = "Jpeg" - h.Jpeg = valueJpeg - return nil - } - valuePng := new(Png) - if err := json.Unmarshal(data, &valuePng); err == nil { - h.typ = "Png" - h.Png = valuePng - 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", } - return fmt.Errorf("%s cannot be deserialized as a %T", data, h) + explicitMarshaler := internal.HandleExplicitFields(marshaler, j.explicitFields) + return json.Marshal(explicitMarshaler) } -func (h HealthInsuranceCreateRequestFrontImage) MarshalJSON() ([]byte, error) { - if h.typ == "Jpeg" || h.Jpeg != nil { - return json.Marshal(h.Jpeg) +func (j *Jpeg) String() string { + if len(j.rawJSON) > 0 { + if value, err := internal.StringifyJSON(j.rawJSON); err == nil { + return value + } } - if h.typ == "Png" || h.Png != nil { - return json.Marshal(h.Png) + if value, err := internal.StringifyJSON(j); err == nil { + return value } - return nil, fmt.Errorf("type %T does not include a non-empty union type", h) + return fmt.Sprintf("%#v", j) } -type HealthInsuranceCreateRequestFrontImageVisitor interface { - VisitJpeg(*Jpeg) error - VisitPng(*Png) error +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 (h *HealthInsuranceCreateRequestFrontImage) Accept(visitor HealthInsuranceCreateRequestFrontImageVisitor) error { - if h.typ == "Jpeg" || h.Jpeg != nil { - return visitor.VisitJpeg(h.Jpeg) - } - if h.typ == "Png" || h.Png != nil { - return visitor.VisitPng(h.Png) +func (l *LabResultsMetadata) GetAge() string { + if l == nil { + return "" } - return fmt.Errorf("type %T does not include a non-empty union type", h) + return l.Age } -// An image of the patient signature for health insurance billing. -type HealthInsuranceCreateRequestPatientSignatureImage struct { - Jpeg *Jpeg - Png *Png - - typ string +func (l *LabResultsMetadata) GetDob() string { + if l == nil { + return "" + } + return l.Dob } -func (h *HealthInsuranceCreateRequestPatientSignatureImage) GetJpeg() *Jpeg { - if h == nil { +func (l *LabResultsMetadata) GetClia() *string { + if l == nil { return nil } - return h.Jpeg + return l.Clia } -func (h *HealthInsuranceCreateRequestPatientSignatureImage) GetPng() *Png { - if h == nil { - return nil +func (l *LabResultsMetadata) GetPatient() string { + if l == nil { + return "" } - return h.Png + return l.Patient } -func (h *HealthInsuranceCreateRequestPatientSignatureImage) UnmarshalJSON(data []byte) error { - valueJpeg := new(Jpeg) - if err := json.Unmarshal(data, &valueJpeg); err == nil { - h.typ = "Jpeg" - h.Jpeg = valueJpeg - return nil - } - valuePng := new(Png) - if err := json.Unmarshal(data, &valuePng); err == nil { - h.typ = "Png" - h.Png = valuePng +func (l *LabResultsMetadata) GetProvider() *string { + if l == nil { return nil } - return fmt.Errorf("%s cannot be deserialized as a %T", data, h) + return l.Provider } -func (h HealthInsuranceCreateRequestPatientSignatureImage) MarshalJSON() ([]byte, error) { - if h.typ == "Jpeg" || h.Jpeg != nil { - return json.Marshal(h.Jpeg) - } - if h.typ == "Png" || h.Png != nil { - return json.Marshal(h.Png) +func (l *LabResultsMetadata) GetLaboratory() *string { + if l == nil { + return nil } - return nil, fmt.Errorf("type %T does not include a non-empty union type", h) + return l.Laboratory } -type HealthInsuranceCreateRequestPatientSignatureImageVisitor interface { - VisitJpeg(*Jpeg) error - VisitPng(*Png) error +func (l *LabResultsMetadata) GetDateReported() string { + if l == nil { + return "" + } + return l.DateReported } -func (h *HealthInsuranceCreateRequestPatientSignatureImage) Accept(visitor HealthInsuranceCreateRequestPatientSignatureImageVisitor) error { - if h.typ == "Jpeg" || h.Jpeg != nil { - return visitor.VisitJpeg(h.Jpeg) - } - if h.typ == "Png" || h.Png != nil { - return visitor.VisitPng(h.Png) +func (l *LabResultsMetadata) GetDateCollected() *string { + if l == nil { + return nil } - return fmt.Errorf("type %T does not include a non-empty union type", h) + return l.DateCollected } -var ( - historicalPullCompletedFieldUserId = big.NewInt(1 << 0) - historicalPullCompletedFieldStartDate = big.NewInt(1 << 1) - historicalPullCompletedFieldEndDate = big.NewInt(1 << 2) - historicalPullCompletedFieldIsFinal = big.NewInt(1 << 3) - historicalPullCompletedFieldProvider = big.NewInt(1 << 4) -) - -type HistoricalPullCompleted struct { - UserId string `json:"user_id" url:"user_id"` - StartDate time.Time `json:"start_date" url:"start_date"` - EndDate time.Time `json:"end_date" url:"end_date"` - IsFinal bool `json:"is_final" url:"is_final"` - Provider string `json:"provider" url:"provider"` - - // 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) GetSpecimenNumber() string { + if l == nil { + return "" + } + return l.SpecimenNumber } -func (h *HistoricalPullCompleted) GetUserId() string { - if h == nil { - return "" +func (l *LabResultsMetadata) GetDateReceived() *string { + if l == nil { + return nil } - return h.UserId + return l.DateReceived } -func (h *HistoricalPullCompleted) GetStartDate() time.Time { - if h == nil { - return time.Time{} +func (l *LabResultsMetadata) GetStatus() *string { + if l == nil { + return nil } - return h.StartDate + return l.Status } -func (h *HistoricalPullCompleted) GetEndDate() time.Time { - if h == nil { - return time.Time{} +func (l *LabResultsMetadata) GetInterpretation() *string { + if l == nil { + return nil } - return h.EndDate + return l.Interpretation } -func (h *HistoricalPullCompleted) GetIsFinal() bool { - if h == nil { - return false +func (l *LabResultsMetadata) GetPatientId() *string { + if l == nil { + return nil } - return h.IsFinal + return l.PatientId } -func (h *HistoricalPullCompleted) GetProvider() string { - if h == nil { - return "" +func (l *LabResultsMetadata) GetAccountId() *string { + if l == nil { + return nil } - return h.Provider + return l.AccountId } -func (h *HistoricalPullCompleted) GetExtraProperties() map[string]interface{} { - return h.extraProperties +func (l *LabResultsMetadata) GetExtraProperties() map[string]interface{} { + return l.extraProperties } -func (h *HistoricalPullCompleted) require(field *big.Int) { - if h.explicitFields == nil { - h.explicitFields = big.NewInt(0) +func (l *LabResultsMetadata) require(field *big.Int) { + if l.explicitFields == nil { + l.explicitFields = big.NewInt(0) } - h.explicitFields.Or(h.explicitFields, field) + l.explicitFields.Or(l.explicitFields, field) } -// SetUserId sets the UserId field and marks it as non-optional; +// 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 (h *HistoricalPullCompleted) SetUserId(userId string) { - h.UserId = userId - h.require(historicalPullCompletedFieldUserId) +func (l *LabResultsMetadata) SetAge(age string) { + l.Age = age + l.require(labResultsMetadataFieldAge) } -// SetStartDate sets the StartDate field and marks it as non-optional; +// 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 (h *HistoricalPullCompleted) SetStartDate(startDate time.Time) { - h.StartDate = startDate - h.require(historicalPullCompletedFieldStartDate) +func (l *LabResultsMetadata) SetDob(dob string) { + l.Dob = dob + l.require(labResultsMetadataFieldDob) } -// SetEndDate sets the EndDate field and marks it as non-optional; +// 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 (h *HistoricalPullCompleted) SetEndDate(endDate time.Time) { - h.EndDate = endDate - h.require(historicalPullCompletedFieldEndDate) +func (l *LabResultsMetadata) SetClia(clia *string) { + l.Clia = clia + l.require(labResultsMetadataFieldClia) } -// SetIsFinal sets the IsFinal field and marks it as non-optional; +// 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 (h *HistoricalPullCompleted) SetIsFinal(isFinal bool) { - h.IsFinal = isFinal - h.require(historicalPullCompletedFieldIsFinal) +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 (h *HistoricalPullCompleted) SetProvider(provider string) { - h.Provider = provider - h.require(historicalPullCompletedFieldProvider) +func (l *LabResultsMetadata) SetProvider(provider *string) { + l.Provider = provider + l.require(labResultsMetadataFieldProvider) } -func (h *HistoricalPullCompleted) UnmarshalJSON(data []byte) error { - type embed HistoricalPullCompleted - var unmarshaler = struct { - embed - StartDate *internal.DateTime `json:"start_date"` - EndDate *internal.DateTime `json:"end_date"` - }{ - embed: embed(*h), - } - if err := json.Unmarshal(data, &unmarshaler); err != nil { - return err - } - *h = HistoricalPullCompleted(unmarshaler.embed) - h.StartDate = unmarshaler.StartDate.Time() - h.EndDate = unmarshaler.EndDate.Time() - extraProperties, err := internal.ExtractExtraProperties(data, *h) - if err != nil { - return err - } - h.extraProperties = extraProperties - h.rawJSON = json.RawMessage(data) - return nil +// 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) } -func (h *HistoricalPullCompleted) MarshalJSON() ([]byte, error) { - type embed HistoricalPullCompleted - var marshaler = struct { - embed - StartDate *internal.DateTime `json:"start_date"` - EndDate *internal.DateTime `json:"end_date"` - }{ - embed: embed(*h), - StartDate: internal.NewDateTime(h.StartDate), - EndDate: internal.NewDateTime(h.EndDate), - } - explicitMarshaler := internal.HandleExplicitFields(marshaler, h.explicitFields) - return json.Marshal(explicitMarshaler) +// 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) } -func (h *HistoricalPullCompleted) String() string { - if len(h.rawJSON) > 0 { - if value, err := internal.StringifyJSON(h.rawJSON); err == nil { - return value - } - } - if value, err := internal.StringifyJSON(h); err == nil { - return value - } - return fmt.Sprintf("%#v", h) +// 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) } -var ( - httpValidationErrorFieldDetail = big.NewInt(1 << 0) -) - -type HttpValidationError struct { - Detail interface{} `json:"detail,omitempty" url:"detail,omitempty"` - - // Private bitmask of fields set to an explicit value and therefore not to be omitted - explicitFields *big.Int `json:"-" url:"-"` +// 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) +} - extraProperties map[string]interface{} - rawJSON json.RawMessage +// 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) } -func (h *HttpValidationError) GetDetail() interface{} { - if h == nil { - return nil - } - return h.Detail +// 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) } -func (h *HttpValidationError) GetExtraProperties() map[string]interface{} { - return h.extraProperties +// 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) } -func (h *HttpValidationError) require(field *big.Int) { - if h.explicitFields == nil { - h.explicitFields = big.NewInt(0) - } - h.explicitFields.Or(h.explicitFields, field) +// 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) } -// SetDetail sets the Detail field and marks it as non-optional; +// 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 (h *HttpValidationError) SetDetail(detail interface{}) { - h.Detail = detail - h.require(httpValidationErrorFieldDetail) +func (l *LabResultsMetadata) SetAccountId(accountId *string) { + l.AccountId = accountId + l.require(labResultsMetadataFieldAccountId) } -func (h *HttpValidationError) UnmarshalJSON(data []byte) error { - type unmarshaler HttpValidationError +func (l *LabResultsMetadata) UnmarshalJSON(data []byte) error { + type unmarshaler LabResultsMetadata var value unmarshaler if err := json.Unmarshal(data, &value); err != nil { return err } - *h = HttpValidationError(value) - extraProperties, err := internal.ExtractExtraProperties(data, *h) + *l = LabResultsMetadata(value) + extraProperties, err := internal.ExtractExtraProperties(data, *l) if err != nil { return err } - h.extraProperties = extraProperties - h.rawJSON = json.RawMessage(data) + l.extraProperties = extraProperties + l.rawJSON = json.RawMessage(data) return nil } -func (h *HttpValidationError) MarshalJSON() ([]byte, error) { - type embed HttpValidationError +func (l *LabResultsMetadata) MarshalJSON() ([]byte, error) { + type embed LabResultsMetadata var marshaler = struct { embed }{ - embed: embed(*h), + embed: embed(*l), } - explicitMarshaler := internal.HandleExplicitFields(marshaler, h.explicitFields) + explicitMarshaler := internal.HandleExplicitFields(marshaler, l.explicitFields) return json.Marshal(explicitMarshaler) } -func (h *HttpValidationError) String() string { - if len(h.rawJSON) > 0 { - if value, err := internal.StringifyJSON(h.rawJSON); err == nil { +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(h); err == nil { + if value, err := internal.StringifyJSON(l); err == nil { return value } - return fmt.Sprintf("%#v", h) -} - -// ℹ️ This enum is non-exhaustive. -type Interpretation string - -const ( - InterpretationNormal Interpretation = "normal" - InterpretationAbnormal Interpretation = "abnormal" - InterpretationCritical Interpretation = "critical" - 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 - } - var t Interpretation - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (i Interpretation) Ptr() *Interpretation { - return &i + 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 +28380,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 +28401,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": @@ -26825,12 +28487,202 @@ func NewMineralsFromString(s string) (Minerals, error) { case "chloride": return MineralsChloride, nil } - var t Minerals - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (m Minerals) Ptr() *Minerals { - return &m + var t Minerals + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +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 ( @@ -26911,6 +28763,124 @@ func (n *NotFoundErrorBody) String() string { 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. type OrderStatus string @@ -27110,6 +29080,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) @@ -27768,38 +29890,167 @@ 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" + PayorCodeExternalProviderApreo PayorCodeExternalProvider = "apreo" +) + +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 "apreo": + return PayorCodeExternalProviderApreo, 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 +30622,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 +30695,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 +30875,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 +32012,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..f569217 100644 --- a/user.go +++ b/user.go @@ -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) ) @@ -3000,7 +3084,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 *Address `json:"address" url:"-"` MedicalProxy *GuarantorDetails `json:"medical_proxy,omitempty" url:"-"` Race *Race `json:"race,omitempty" url:"-"` Ethnicity *Ethnicity `json:"ethnicity,omitempty" url:"-"` @@ -3101,3 +3185,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..622bcd1 100644 --- a/user/client.go +++ b/user/client.go @@ -4,7 +4,7 @@ package user import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..40ceaf4 100644 --- a/user/raw_client.go +++ b/user/raw_client.go @@ -4,7 +4,7 @@ package user import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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/client.go b/vitals/client.go index e1037bc..d97ea2f 100644 --- a/vitals/client.go +++ b/vitals/client.go @@ -4,7 +4,7 @@ package vitals import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..fe29d42 100644 --- a/vitals/raw_client.go +++ b/vitals/raw_client.go @@ -4,7 +4,7 @@ package vitals import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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/client.go b/workouts/client.go index 52e93ef..fa4be6d 100644 --- a/workouts/client.go +++ b/workouts/client.go @@ -4,7 +4,7 @@ package workouts import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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..8b27991 100644 --- a/workouts/raw_client.go +++ b/workouts/raw_client.go @@ -4,7 +4,7 @@ package workouts import ( context "context" - vitalgo "github.com/tryVital/vital-go" + v505 "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" @@ -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,