From 02967d83bf41ebe91131f87198fa9d9d5d402cbb Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 11:02:55 +0000 Subject: [PATCH] Release v1.1.169 --- core/request_option.go | 2 +- insurance.go | 4 +- link.go | 3 +- types.go | 112 +++++++++++++++++++++++++++++++++++++++-- 4 files changed, 115 insertions(+), 6 deletions(-) diff --git a/core/request_option.go b/core/request_option.go index 7b86b42..af8057f 100644 --- a/core/request_option.go +++ b/core/request_option.go @@ -57,7 +57,7 @@ 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.168") + headers.Set("X-Fern-SDK-Version", "v1.1.169") return headers } diff --git a/insurance.go b/insurance.go index 94be418..e4ed98b 100644 --- a/insurance.go +++ b/insurance.go @@ -7,5 +7,7 @@ type InsuranceSearchDiagnosisRequest struct { } type PayorSearchRequest struct { - InsuranceName string `json:"insurance_name" url:"-"` + InsuranceName *string `json:"insurance_name,omitempty" url:"-"` + Provider *PayorCodeExternalProvider `json:"provider,omitempty" url:"-"` + ProviderId *string `json:"provider_id,omitempty" url:"-"` } diff --git a/link.go b/link.go index 0cbd46f..83300a8 100644 --- a/link.go +++ b/link.go @@ -7,7 +7,8 @@ import ( ) type LinkCodeCreateRequest struct { - UserId string `json:"-" url:"user_id"` + UserId string `json:"-" url:"user_id"` + // When the link code should expire. Defaults to server time plus 1 hour. ExpiresAt *time.Time `json:"-" url:"expires_at,omitempty"` } diff --git a/types.go b/types.go index 1d0ae62..8a00347 100644 --- a/types.go +++ b/types.go @@ -2961,6 +2961,86 @@ func (c *ClientFacingCholesterolTimeseries) String() string { return fmt.Sprintf("%#v", c) } +type ClientFacingConnectionErrorDetails struct { + ErrorType ClientFacingConnectionErrorDetailsErrorType `json:"error_type" url:"error_type"` + ErrorMessage string `json:"error_message" url:"error_message"` + ErroredAt string `json:"errored_at" url:"errored_at"` + + extraProperties map[string]interface{} + _rawJSON json.RawMessage +} + +func (c *ClientFacingConnectionErrorDetails) GetExtraProperties() map[string]interface{} { + return c.extraProperties +} + +func (c *ClientFacingConnectionErrorDetails) UnmarshalJSON(data []byte) error { + type unmarshaler ClientFacingConnectionErrorDetails + var value unmarshaler + if err := json.Unmarshal(data, &value); err != nil { + return err + } + *c = ClientFacingConnectionErrorDetails(value) + + extraProperties, err := core.ExtractExtraProperties(data, *c) + if err != nil { + return err + } + c.extraProperties = extraProperties + + c._rawJSON = json.RawMessage(data) + return nil +} + +func (c *ClientFacingConnectionErrorDetails) String() string { + if len(c._rawJSON) > 0 { + if value, err := core.StringifyJSON(c._rawJSON); err == nil { + return value + } + } + if value, err := core.StringifyJSON(c); err == nil { + return value + } + return fmt.Sprintf("%#v", c) +} + +type ClientFacingConnectionErrorDetailsErrorType string + +const ( + ClientFacingConnectionErrorDetailsErrorTypeTokenRefreshFailed ClientFacingConnectionErrorDetailsErrorType = "token_refresh_failed" + ClientFacingConnectionErrorDetailsErrorTypeWebhookRegistrationFailed ClientFacingConnectionErrorDetailsErrorType = "webhook_registration_failed" + ClientFacingConnectionErrorDetailsErrorTypeUserNotFound ClientFacingConnectionErrorDetailsErrorType = "user_not_found" + ClientFacingConnectionErrorDetailsErrorTypeDeregisteredPerProvider ClientFacingConnectionErrorDetailsErrorType = "deregistered_per_provider" + ClientFacingConnectionErrorDetailsErrorTypeRequiredScopesNotGranted ClientFacingConnectionErrorDetailsErrorType = "required_scopes_not_granted" + ClientFacingConnectionErrorDetailsErrorTypeProviderCredentialError ClientFacingConnectionErrorDetailsErrorType = "provider_credential_error" + ClientFacingConnectionErrorDetailsErrorTypeUnknown ClientFacingConnectionErrorDetailsErrorType = "unknown" +) + +func NewClientFacingConnectionErrorDetailsErrorTypeFromString(s string) (ClientFacingConnectionErrorDetailsErrorType, error) { + switch s { + case "token_refresh_failed": + return ClientFacingConnectionErrorDetailsErrorTypeTokenRefreshFailed, nil + case "webhook_registration_failed": + return ClientFacingConnectionErrorDetailsErrorTypeWebhookRegistrationFailed, nil + case "user_not_found": + return ClientFacingConnectionErrorDetailsErrorTypeUserNotFound, nil + case "deregistered_per_provider": + return ClientFacingConnectionErrorDetailsErrorTypeDeregisteredPerProvider, nil + case "required_scopes_not_granted": + return ClientFacingConnectionErrorDetailsErrorTypeRequiredScopesNotGranted, nil + case "provider_credential_error": + return ClientFacingConnectionErrorDetailsErrorTypeProviderCredentialError, nil + case "unknown": + return ClientFacingConnectionErrorDetailsErrorTypeUnknown, nil + } + var t ClientFacingConnectionErrorDetailsErrorType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (c ClientFacingConnectionErrorDetailsErrorType) Ptr() *ClientFacingConnectionErrorDetailsErrorType { + return &c +} + type ClientFacingDiagnosisInformation struct { // Diagnosis code for insurance information. DiagnosisCode string `json:"diagnosis_code" url:"diagnosis_code"` @@ -5682,10 +5762,13 @@ type ClientFacingProviderWithStatus struct { // Slug for designated source Slug string `json:"slug" url:"slug"` // URL for source logo - Logo string `json:"logo" url:"logo"` + Logo string `json:"logo" url:"logo"` + CreatedOn string `json:"created_on" url:"created_on"` // Status of source, either error or connected - Status string `json:"status" url:"status"` - ResourceAvailability map[string]*ResourceAvailability `json:"resource_availability,omitempty" url:"resource_availability,omitempty"` + Status string `json:"status" url:"status"` + // Details of the terminal connection error — populated only when the status is `error`. + ErrorDetails *ClientFacingConnectionErrorDetails `json:"error_details,omitempty" url:"error_details,omitempty"` + ResourceAvailability map[string]*ResourceAvailability `json:"resource_availability,omitempty" url:"resource_availability,omitempty"` extraProperties map[string]interface{} _rawJSON json.RawMessage @@ -14063,6 +14146,28 @@ func (p *PatientDetailsWithValidation) String() string { return fmt.Sprintf("%#v", p) } +type PayorCodeExternalProvider string + +const ( + PayorCodeExternalProviderChangeHealthcare PayorCodeExternalProvider = "change_healthcare" + PayorCodeExternalProviderAvaility PayorCodeExternalProvider = "availity" +) + +func NewPayorCodeExternalProviderFromString(s string) (PayorCodeExternalProvider, error) { + switch s { + case "change_healthcare": + return PayorCodeExternalProviderChangeHealthcare, nil + case "availity": + return PayorCodeExternalProviderAvaility, nil + } + var t PayorCodeExternalProvider + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (p PayorCodeExternalProvider) Ptr() *PayorCodeExternalProvider { + return &p +} + type Period struct { Value *int `json:"value,omitempty" url:"value,omitempty"` Unit PeriodUnit `json:"unit" url:"unit"` @@ -17732,6 +17837,7 @@ type VitalSleepStage = int type VitalTokenCreatedResponse struct { Code string `json:"code" url:"code"` ExchangeUrl string `json:"exchange_url" url:"exchange_url"` + ExpiresAt string `json:"expires_at" url:"expires_at"` extraProperties map[string]interface{} _rawJSON json.RawMessage