diff --git a/Makefile b/Makefile index a511a25a6..c7e57cd54 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,7 @@ generate: esc mockgen @echo "go generate ./..." @cd $(ROOT_DIRECTORY) && go generate ./... -ci-generate: generate +ci-generate: generate format-write-changed imports-write-changed @cd $(ROOT_DIRECTORY) && \ O=`git diff` && [ "$${O}" = "" ] || (echo "$${O}" && exit 1) @@ -105,6 +105,10 @@ format-write: O=`find . -not -path './vendor/*' -name '*.go' -type f -exec gofmt -e -s -w {} \; 2>&1` && \ [ -z "$${O}" ] || (echo "$${O}" && exit 1) +format-write-changed: + @cd $(ROOT_DIRECTORY) && \ + git diff --name-only | xargs -I{} gofmt -e -s -w {} + imports: goimports @echo "goimports -d -e -local 'github.com/tidepool-org/platform'" @cd $(ROOT_DIRECTORY) && \ @@ -117,6 +121,10 @@ imports-write: goimports O=`find . -not -path './vendor/*' -name '*.go' -type f -exec goimports -e -w -local 'github.com/tidepool-org/platform' {} \; 2>&1` && \ [ -z "$${O}" ] || (echo "$${O}" && exit 1) +imports-write-changed: goimports + @cd $(ROOT_DIRECTORY) && \ + git diff --name-only | xargs -I{} goimports -e -w -local 'github.com/tidepool-org/platform' {} + vet: tmp @echo "go vet" cd $(ROOT_DIRECTORY) && \ diff --git a/auth/auth.go b/auth/auth.go index ea400be04..82a17417e 100644 --- a/auth/auth.go +++ b/auth/auth.go @@ -13,6 +13,7 @@ const ( TidepoolRestrictedTokenParameterKey = "restricted_token" ) +//go:generate mockgen --build_flags=--mod=mod -source=./auth.go -destination=./test/mock.go -package test -aux_files=github.com/tidepool-org/platform/auth=provider_session.go,github.com/tidepool-org/platform/auth=restricted_token.go Client type Client interface { ProviderSessionAccessor RestrictedTokenAccessor diff --git a/auth/test/mock.go b/auth/test/mock.go new file mode 100644 index 000000000..5cdec5563 --- /dev/null +++ b/auth/test/mock.go @@ -0,0 +1,384 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: ./auth.go + +// Package test is a generated GoMock package. +package test + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + + auth "github.com/tidepool-org/platform/auth" + page "github.com/tidepool-org/platform/page" + request "github.com/tidepool-org/platform/request" +) + +// MockClient is a mock of Client interface. +type MockClient struct { + ctrl *gomock.Controller + recorder *MockClientMockRecorder +} + +// MockClientMockRecorder is the mock recorder for MockClient. +type MockClientMockRecorder struct { + mock *MockClient +} + +// NewMockClient creates a new mock instance. +func NewMockClient(ctrl *gomock.Controller) *MockClient { + mock := &MockClient{ctrl: ctrl} + mock.recorder = &MockClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockClient) EXPECT() *MockClientMockRecorder { + return m.recorder +} + +// CreateUserProviderSession mocks base method. +func (m *MockClient) CreateUserProviderSession(ctx context.Context, userID string, create *auth.ProviderSessionCreate) (*auth.ProviderSession, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateUserProviderSession", ctx, userID, create) + ret0, _ := ret[0].(*auth.ProviderSession) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateUserProviderSession indicates an expected call of CreateUserProviderSession. +func (mr *MockClientMockRecorder) CreateUserProviderSession(ctx, userID, create interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateUserProviderSession", reflect.TypeOf((*MockClient)(nil).CreateUserProviderSession), ctx, userID, create) +} + +// CreateUserRestrictedToken mocks base method. +func (m *MockClient) CreateUserRestrictedToken(ctx context.Context, userID string, create *auth.RestrictedTokenCreate) (*auth.RestrictedToken, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateUserRestrictedToken", ctx, userID, create) + ret0, _ := ret[0].(*auth.RestrictedToken) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateUserRestrictedToken indicates an expected call of CreateUserRestrictedToken. +func (mr *MockClientMockRecorder) CreateUserRestrictedToken(ctx, userID, create interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateUserRestrictedToken", reflect.TypeOf((*MockClient)(nil).CreateUserRestrictedToken), ctx, userID, create) +} + +// DeleteAllProviderSessions mocks base method. +func (m *MockClient) DeleteAllProviderSessions(ctx context.Context, userID string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteAllProviderSessions", ctx, userID) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllProviderSessions indicates an expected call of DeleteAllProviderSessions. +func (mr *MockClientMockRecorder) DeleteAllProviderSessions(ctx, userID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllProviderSessions", reflect.TypeOf((*MockClient)(nil).DeleteAllProviderSessions), ctx, userID) +} + +// DeleteAllRestrictedTokens mocks base method. +func (m *MockClient) DeleteAllRestrictedTokens(ctx context.Context, userID string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteAllRestrictedTokens", ctx, userID) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteAllRestrictedTokens indicates an expected call of DeleteAllRestrictedTokens. +func (mr *MockClientMockRecorder) DeleteAllRestrictedTokens(ctx, userID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteAllRestrictedTokens", reflect.TypeOf((*MockClient)(nil).DeleteAllRestrictedTokens), ctx, userID) +} + +// DeleteProviderSession mocks base method. +func (m *MockClient) DeleteProviderSession(ctx context.Context, id string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteProviderSession", ctx, id) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteProviderSession indicates an expected call of DeleteProviderSession. +func (mr *MockClientMockRecorder) DeleteProviderSession(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteProviderSession", reflect.TypeOf((*MockClient)(nil).DeleteProviderSession), ctx, id) +} + +// DeleteRestrictedToken mocks base method. +func (m *MockClient) DeleteRestrictedToken(ctx context.Context, id string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteRestrictedToken", ctx, id) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteRestrictedToken indicates an expected call of DeleteRestrictedToken. +func (mr *MockClientMockRecorder) DeleteRestrictedToken(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRestrictedToken", reflect.TypeOf((*MockClient)(nil).DeleteRestrictedToken), ctx, id) +} + +// EnsureAuthorized mocks base method. +func (m *MockClient) EnsureAuthorized(ctx context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EnsureAuthorized", ctx) + ret0, _ := ret[0].(error) + return ret0 +} + +// EnsureAuthorized indicates an expected call of EnsureAuthorized. +func (mr *MockClientMockRecorder) EnsureAuthorized(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureAuthorized", reflect.TypeOf((*MockClient)(nil).EnsureAuthorized), ctx) +} + +// EnsureAuthorizedService mocks base method. +func (m *MockClient) EnsureAuthorizedService(ctx context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EnsureAuthorizedService", ctx) + ret0, _ := ret[0].(error) + return ret0 +} + +// EnsureAuthorizedService indicates an expected call of EnsureAuthorizedService. +func (mr *MockClientMockRecorder) EnsureAuthorizedService(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureAuthorizedService", reflect.TypeOf((*MockClient)(nil).EnsureAuthorizedService), ctx) +} + +// EnsureAuthorizedUser mocks base method. +func (m *MockClient) EnsureAuthorizedUser(ctx context.Context, targetUserID, permission string) (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EnsureAuthorizedUser", ctx, targetUserID, permission) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// EnsureAuthorizedUser indicates an expected call of EnsureAuthorizedUser. +func (mr *MockClientMockRecorder) EnsureAuthorizedUser(ctx, targetUserID, permission interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureAuthorizedUser", reflect.TypeOf((*MockClient)(nil).EnsureAuthorizedUser), ctx, targetUserID, permission) +} + +// GetProviderSession mocks base method. +func (m *MockClient) GetProviderSession(ctx context.Context, id string) (*auth.ProviderSession, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetProviderSession", ctx, id) + ret0, _ := ret[0].(*auth.ProviderSession) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetProviderSession indicates an expected call of GetProviderSession. +func (mr *MockClientMockRecorder) GetProviderSession(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProviderSession", reflect.TypeOf((*MockClient)(nil).GetProviderSession), ctx, id) +} + +// GetRestrictedToken mocks base method. +func (m *MockClient) GetRestrictedToken(ctx context.Context, id string) (*auth.RestrictedToken, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRestrictedToken", ctx, id) + ret0, _ := ret[0].(*auth.RestrictedToken) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetRestrictedToken indicates an expected call of GetRestrictedToken. +func (mr *MockClientMockRecorder) GetRestrictedToken(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRestrictedToken", reflect.TypeOf((*MockClient)(nil).GetRestrictedToken), ctx, id) +} + +// ListUserProviderSessions mocks base method. +func (m *MockClient) ListUserProviderSessions(ctx context.Context, userID string, filter *auth.ProviderSessionFilter, pagination *page.Pagination) (auth.ProviderSessions, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListUserProviderSessions", ctx, userID, filter, pagination) + ret0, _ := ret[0].(auth.ProviderSessions) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListUserProviderSessions indicates an expected call of ListUserProviderSessions. +func (mr *MockClientMockRecorder) ListUserProviderSessions(ctx, userID, filter, pagination interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListUserProviderSessions", reflect.TypeOf((*MockClient)(nil).ListUserProviderSessions), ctx, userID, filter, pagination) +} + +// ListUserRestrictedTokens mocks base method. +func (m *MockClient) ListUserRestrictedTokens(ctx context.Context, userID string, filter *auth.RestrictedTokenFilter, pagination *page.Pagination) (auth.RestrictedTokens, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListUserRestrictedTokens", ctx, userID, filter, pagination) + ret0, _ := ret[0].(auth.RestrictedTokens) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListUserRestrictedTokens indicates an expected call of ListUserRestrictedTokens. +func (mr *MockClientMockRecorder) ListUserRestrictedTokens(ctx, userID, filter, pagination interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListUserRestrictedTokens", reflect.TypeOf((*MockClient)(nil).ListUserRestrictedTokens), ctx, userID, filter, pagination) +} + +// ServerSessionToken mocks base method. +func (m *MockClient) ServerSessionToken() (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ServerSessionToken") + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ServerSessionToken indicates an expected call of ServerSessionToken. +func (mr *MockClientMockRecorder) ServerSessionToken() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServerSessionToken", reflect.TypeOf((*MockClient)(nil).ServerSessionToken)) +} + +// UpdateProviderSession mocks base method. +func (m *MockClient) UpdateProviderSession(ctx context.Context, id string, update *auth.ProviderSessionUpdate) (*auth.ProviderSession, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateProviderSession", ctx, id, update) + ret0, _ := ret[0].(*auth.ProviderSession) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateProviderSession indicates an expected call of UpdateProviderSession. +func (mr *MockClientMockRecorder) UpdateProviderSession(ctx, id, update interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateProviderSession", reflect.TypeOf((*MockClient)(nil).UpdateProviderSession), ctx, id, update) +} + +// UpdateRestrictedToken mocks base method. +func (m *MockClient) UpdateRestrictedToken(ctx context.Context, id string, update *auth.RestrictedTokenUpdate) (*auth.RestrictedToken, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateRestrictedToken", ctx, id, update) + ret0, _ := ret[0].(*auth.RestrictedToken) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateRestrictedToken indicates an expected call of UpdateRestrictedToken. +func (mr *MockClientMockRecorder) UpdateRestrictedToken(ctx, id, update interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRestrictedToken", reflect.TypeOf((*MockClient)(nil).UpdateRestrictedToken), ctx, id, update) +} + +// ValidateSessionToken mocks base method. +func (m *MockClient) ValidateSessionToken(ctx context.Context, token string) (request.Details, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidateSessionToken", ctx, token) + ret0, _ := ret[0].(request.Details) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ValidateSessionToken indicates an expected call of ValidateSessionToken. +func (mr *MockClientMockRecorder) ValidateSessionToken(ctx, token interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateSessionToken", reflect.TypeOf((*MockClient)(nil).ValidateSessionToken), ctx, token) +} + +// MockExternalAccessor is a mock of ExternalAccessor interface. +type MockExternalAccessor struct { + ctrl *gomock.Controller + recorder *MockExternalAccessorMockRecorder +} + +// MockExternalAccessorMockRecorder is the mock recorder for MockExternalAccessor. +type MockExternalAccessorMockRecorder struct { + mock *MockExternalAccessor +} + +// NewMockExternalAccessor creates a new mock instance. +func NewMockExternalAccessor(ctrl *gomock.Controller) *MockExternalAccessor { + mock := &MockExternalAccessor{ctrl: ctrl} + mock.recorder = &MockExternalAccessorMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockExternalAccessor) EXPECT() *MockExternalAccessorMockRecorder { + return m.recorder +} + +// EnsureAuthorized mocks base method. +func (m *MockExternalAccessor) EnsureAuthorized(ctx context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EnsureAuthorized", ctx) + ret0, _ := ret[0].(error) + return ret0 +} + +// EnsureAuthorized indicates an expected call of EnsureAuthorized. +func (mr *MockExternalAccessorMockRecorder) EnsureAuthorized(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureAuthorized", reflect.TypeOf((*MockExternalAccessor)(nil).EnsureAuthorized), ctx) +} + +// EnsureAuthorizedService mocks base method. +func (m *MockExternalAccessor) EnsureAuthorizedService(ctx context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EnsureAuthorizedService", ctx) + ret0, _ := ret[0].(error) + return ret0 +} + +// EnsureAuthorizedService indicates an expected call of EnsureAuthorizedService. +func (mr *MockExternalAccessorMockRecorder) EnsureAuthorizedService(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureAuthorizedService", reflect.TypeOf((*MockExternalAccessor)(nil).EnsureAuthorizedService), ctx) +} + +// EnsureAuthorizedUser mocks base method. +func (m *MockExternalAccessor) EnsureAuthorizedUser(ctx context.Context, targetUserID, permission string) (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EnsureAuthorizedUser", ctx, targetUserID, permission) + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// EnsureAuthorizedUser indicates an expected call of EnsureAuthorizedUser. +func (mr *MockExternalAccessorMockRecorder) EnsureAuthorizedUser(ctx, targetUserID, permission interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnsureAuthorizedUser", reflect.TypeOf((*MockExternalAccessor)(nil).EnsureAuthorizedUser), ctx, targetUserID, permission) +} + +// ServerSessionToken mocks base method. +func (m *MockExternalAccessor) ServerSessionToken() (string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ServerSessionToken") + ret0, _ := ret[0].(string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ServerSessionToken indicates an expected call of ServerSessionToken. +func (mr *MockExternalAccessorMockRecorder) ServerSessionToken() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ServerSessionToken", reflect.TypeOf((*MockExternalAccessor)(nil).ServerSessionToken)) +} + +// ValidateSessionToken mocks base method. +func (m *MockExternalAccessor) ValidateSessionToken(ctx context.Context, token string) (request.Details, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidateSessionToken", ctx, token) + ret0, _ := ret[0].(request.Details) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ValidateSessionToken indicates an expected call of ValidateSessionToken. +func (mr *MockExternalAccessorMockRecorder) ValidateSessionToken(ctx, token interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateSessionToken", reflect.TypeOf((*MockExternalAccessor)(nil).ValidateSessionToken), ctx, token) +} diff --git a/clinics/mock.go b/clinics/mock.go index b99d3445e..92d808b92 100644 --- a/clinics/mock.go +++ b/clinics/mock.go @@ -50,6 +50,21 @@ func (mr *MockClientMockRecorder) GetClinician(ctx, clinicID, clinicianID interf return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClinician", reflect.TypeOf((*MockClient)(nil).GetClinician), ctx, clinicID, clinicianID) } +// ListEHREnabledClinics mocks base method. +func (m *MockClient) ListEHREnabledClinics(ctx context.Context) ([]api.Clinic, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListEHREnabledClinics", ctx) + ret0, _ := ret[0].([]api.Clinic) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListEHREnabledClinics indicates an expected call of ListEHREnabledClinics. +func (mr *MockClientMockRecorder) ListEHREnabledClinics(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListEHREnabledClinics", reflect.TypeOf((*MockClient)(nil).ListEHREnabledClinics), ctx) +} + // SharePatientAccount mocks base method. func (m *MockClient) SharePatientAccount(ctx context.Context, clinicID, patientID string) (*api.Patient, error) { m.ctrl.T.Helper() @@ -64,3 +79,17 @@ func (mr *MockClientMockRecorder) SharePatientAccount(ctx, clinicID, patientID i mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SharePatientAccount", reflect.TypeOf((*MockClient)(nil).SharePatientAccount), ctx, clinicID, patientID) } + +// SyncEHRData mocks base method. +func (m *MockClient) SyncEHRData(ctx context.Context, clinicID string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SyncEHRData", ctx, clinicID) + ret0, _ := ret[0].(error) + return ret0 +} + +// SyncEHRData indicates an expected call of SyncEHRData. +func (mr *MockClientMockRecorder) SyncEHRData(ctx, clinicID interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncEHRData", reflect.TypeOf((*MockClient)(nil).SyncEHRData), ctx, clinicID) +} diff --git a/clinics/service.go b/clinics/service.go index 6df54bd21..e53279dca 100644 --- a/clinics/service.go +++ b/clinics/service.go @@ -5,6 +5,8 @@ import ( "fmt" "net/http" + "github.com/tidepool-org/platform/pointer" + "github.com/kelseyhightower/envconfig" clinic "github.com/tidepool-org/clinic/client" "go.uber.org/fx" @@ -22,6 +24,8 @@ var ClientModule = fx.Provide(NewClient) type Client interface { GetClinician(ctx context.Context, clinicID, clinicianID string) (*clinic.Clinician, error) SharePatientAccount(ctx context.Context, clinicID, patientID string) (*clinic.Patient, error) + ListEHREnabledClinics(ctx context.Context) ([]clinic.Clinic, error) + SyncEHRData(ctx context.Context, clinicID string) error } type config struct { @@ -76,6 +80,38 @@ func (d *defaultClient) GetClinician(ctx context.Context, clinicID, clinicianID return response.JSON200, nil } +func (d *defaultClient) ListEHREnabledClinics(ctx context.Context) ([]clinic.Clinic, error) { + offset := 0 + batchSize := 1000 + + clinics := make([]clinic.Clinic, 0) + for { + response, err := d.httpClient.ListClinicsWithResponse(ctx, &clinic.ListClinicsParams{ + EhrEnabled: pointer.FromBool(true), + Offset: &offset, + Limit: &batchSize, + }) + if err != nil { + return nil, err + } + if response.StatusCode() != http.StatusOK { + return nil, fmt.Errorf("unexpected response status code %v from %v", response.StatusCode(), response.HTTPResponse.Request.URL) + } + if response.JSON200 == nil { + break + } + + clinics = append(clinics, *response.JSON200...) + offset = offset + batchSize + + if len(*response.JSON200) < batchSize { + break + } + } + + return clinics, nil +} + func (d *defaultClient) SharePatientAccount(ctx context.Context, clinicID, patientID string) (*clinic.Patient, error) { permission := make(map[string]interface{}, 0) body := clinic.CreatePatientFromUserJSONRequestBody{ @@ -98,6 +134,17 @@ func (d *defaultClient) SharePatientAccount(ctx context.Context, clinicID, patie return response.JSON200, nil } +func (d *defaultClient) SyncEHRData(ctx context.Context, clinicID string) error { + response, err := d.httpClient.SyncEHRDataWithResponse(ctx, clinicID) + if err != nil { + return err + } + if response.StatusCode() != http.StatusAccepted { + return fmt.Errorf("unexpected response status code %v from %v", response.StatusCode(), response.HTTPResponse.Request.URL) + } + return nil +} + func (d *defaultClient) getPatient(ctx context.Context, clinicID, patientID string) (*clinic.Patient, error) { response, err := d.httpClient.GetPatientWithResponse(ctx, clinic.ClinicId(clinicID), clinic.PatientId(patientID)) if err != nil { diff --git a/clinics/test/clinics.go b/clinics/test/clinics.go new file mode 100644 index 000000000..547aa53eb --- /dev/null +++ b/clinics/test/clinics.go @@ -0,0 +1,32 @@ +package test + +import ( + api "github.com/tidepool-org/clinic/client" + "go.mongodb.org/mongo-driver/bson/primitive" + "syreclabs.com/go/faker" + + "github.com/tidepool-org/platform/pointer" + "github.com/tidepool-org/platform/test" +) + +func NewRandomClinic() api.Clinic { + return api.Clinic{ + Address: pointer.FromAny(faker.Address().StreetAddress()), + CanMigrate: pointer.FromAny(test.RandomBool()), + City: pointer.FromAny(faker.Address().City()), + ClinicType: pointer.FromAny(test.RandomChoice([]api.ClinicClinicType{api.HealthcareSystem, api.VeterinaryClinic, api.Other})), + Country: pointer.FromAny(faker.Address().Country()), + CreatedTime: pointer.FromAny(test.RandomTimeFromRange(test.RandomTimeMinimum(), test.RandomTimeMaximum())), + Id: pointer.FromAny(primitive.NewObjectIDFromTimestamp(test.RandomTimeFromRange(test.RandomTimeMinimum(), test.RandomTimeMaximum())).Hex()), + Name: faker.Company().Name(), + PhoneNumbers: pointer.FromAny([]api.PhoneNumber{{Number: faker.PhoneNumber().PhoneNumber()}}), + PostalCode: pointer.FromAny(faker.Address().ZipCode()), + PreferredBgUnits: test.RandomChoice([]api.ClinicPreferredBgUnits{api.ClinicPreferredBgUnitsMgdL, api.ClinicPreferredBgUnitsMmolL}), + ShareCode: pointer.FromAny(faker.RandomString(15)), + State: pointer.FromAny(faker.Address().State()), + Tier: pointer.FromAny(test.RandomChoice([]string{"tier1000", "tier2000"})), + TierDescription: pointer.FromAny(faker.Lorem().Sentence(5)), + UpdatedTime: pointer.FromAny(test.RandomTimeFromRange(test.RandomTimeMinimum(), test.RandomTimeMaximum())), + Website: pointer.FromAny(faker.Internet().Url()), + } +} diff --git a/ehr/reconcile/reconcile_suite_test.go b/ehr/reconcile/reconcile_suite_test.go new file mode 100644 index 000000000..7ccab0639 --- /dev/null +++ b/ehr/reconcile/reconcile_suite_test.go @@ -0,0 +1,11 @@ +package reconcile_test + +import ( + "testing" + + "github.com/tidepool-org/platform/test" +) + +func TestSuite(t *testing.T) { + test.Test(t) +} diff --git a/ehr/reconcile/runner.go b/ehr/reconcile/runner.go new file mode 100644 index 000000000..0a70fa3d0 --- /dev/null +++ b/ehr/reconcile/runner.go @@ -0,0 +1,172 @@ +package reconcile + +import ( + "context" + "math/rand" + "time" + + api "github.com/tidepool-org/clinic/client" + + "github.com/tidepool-org/platform/auth" + "github.com/tidepool-org/platform/clinics" + "github.com/tidepool-org/platform/ehr/sync" + "github.com/tidepool-org/platform/errors" + "github.com/tidepool-org/platform/log" + "github.com/tidepool-org/platform/page" + "github.com/tidepool-org/platform/pointer" + "github.com/tidepool-org/platform/task" +) + +const ( + AvailableAfterDurationMaximum = 75 * time.Minute + AvailableAfterDurationMinimum = 45 * time.Minute + TaskDurationMaximum = 5 * time.Minute +) + +type Runner struct { + authClient auth.Client + clinicsClient clinics.Client + taskClient task.Client + logger log.Logger +} + +func NewRunner(authClient auth.Client, clinicsClient clinics.Client, taskClient task.Client, logger log.Logger) (*Runner, error) { + return &Runner{ + authClient: authClient, + clinicsClient: clinicsClient, + taskClient: taskClient, + logger: logger, + }, nil +} + +func (r *Runner) GetRunnerType() string { + return Type +} + +func (r *Runner) GetRunnerDeadline() time.Time { + return time.Now().Add(TaskDurationMaximum * 3) +} + +func (r *Runner) GetRunnerMaximumDuration() time.Duration { + return TaskDurationMaximum +} + +func (r *Runner) Run(ctx context.Context, tsk *task.Task) bool { + now := time.Now() + tsk.ClearError() + + r.doRun(ctx, tsk) + tsk.RepeatAvailableAfter(AvailableAfterDurationMinimum + time.Duration(rand.Int63n(int64(AvailableAfterDurationMaximum-AvailableAfterDurationMinimum+1)))) + + if taskDuration := time.Since(now); taskDuration > TaskDurationMaximum { + r.logger.WithField("taskDuration", taskDuration.Truncate(time.Millisecond).Seconds()).Warn("Task duration exceeds maximum") + } + + return true +} + +func (r *Runner) doRun(ctx context.Context, tsk *task.Task) { + serverSessionToken, err := r.authClient.ServerSessionToken() + if err != nil { + tsk.AppendError(errors.Wrap(err, "unable to get server session token")) + return + } + + ctx = auth.NewContextWithServerSessionToken(ctx, serverSessionToken) + + // Get the list of all existing EHR sync tasks + syncTasks, err := r.getSyncTasks(ctx) + if err != nil { + tsk.AppendError(errors.Wrap(err, "unable to get sync tasks")) + return + } + + // Get the list of all EHR enabled clinics + clinicsList, err := r.clinicsClient.ListEHREnabledClinics(ctx) + if err != nil { + tsk.AppendError(errors.Wrap(err, "unable to list clinics")) + return + } + + plan := GetReconciliationPlan(syncTasks, clinicsList) + r.reconcileTasks(ctx, tsk, plan) +} + +func (r *Runner) getSyncTasks(ctx context.Context) (map[string]task.Task, error) { + filter := task.TaskFilter{ + Type: pointer.FromString(sync.Type), + } + pagination := page.Pagination{ + Page: 0, + Size: 1000, + } + + tasksByClinicId := make(map[string]task.Task) + for { + tasks, err := r.taskClient.ListTasks(ctx, &filter, &pagination) + if err != nil { + return nil, errors.Wrap(err, "unable to list tasks") + } + + for _, tsk := range tasks { + tsk := tsk + clinicId, err := sync.GetClinicId(tsk.Data) + if err != nil { + r.logger.Errorf("unable to get clinicId from task data (taskId %v): %v", tsk.ID, err) + continue + } + tasksByClinicId[clinicId] = *tsk + } + if len(tasks) < pagination.Size { + break + } else { + pagination.Page++ + } + } + + return tasksByClinicId, nil +} + +func (r *Runner) reconcileTasks(ctx context.Context, task *task.Task, plan ReconciliationPlan) { + for _, t := range plan.ToDelete { + if err := r.taskClient.DeleteTask(ctx, t.ID); err != nil { + task.AppendError(errors.Wrap(err, "unable to delete task")) + } + } + for _, t := range plan.ToCreate { + if _, err := r.taskClient.CreateTask(ctx, &t); err != nil { + task.AppendError(errors.Wrap(err, "unable to create task")) + } + } +} + +type ReconciliationPlan struct { + ToCreate []task.TaskCreate + ToDelete []task.Task +} + +func GetReconciliationPlan(syncTasks map[string]task.Task, clinics []api.Clinic) ReconciliationPlan { + toDelete := make([]task.Task, 0) + toCreate := make([]task.TaskCreate, 0) + + // At the end of the loop syncTasks will contain only the tasks that need to be deleted, + // and toCreate will contain tasks for new clinics that need to be synced. + for _, clinic := range clinics { + clinicId := *clinic.Id + _, exists := syncTasks[clinicId] + + if exists { + delete(syncTasks, clinicId) + } else { + create := sync.NewTaskCreate(clinicId) + toCreate = append(toCreate, *create) + } + } + for _, tsk := range syncTasks { + toDelete = append(toDelete, tsk) + } + return ReconciliationPlan{ + ToCreate: toCreate, + ToDelete: toDelete, + } +} diff --git a/ehr/reconcile/runner_test.go b/ehr/reconcile/runner_test.go new file mode 100644 index 000000000..4a64f3d17 --- /dev/null +++ b/ehr/reconcile/runner_test.go @@ -0,0 +1,160 @@ +package reconcile_test + +import ( + "context" + + "github.com/golang/mock/gomock" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gstruct" + api "github.com/tidepool-org/clinic/client" + + authTest "github.com/tidepool-org/platform/auth/test" + "github.com/tidepool-org/platform/clinics" + "github.com/tidepool-org/platform/log" + "github.com/tidepool-org/platform/log/null" + taskTest "github.com/tidepool-org/platform/task/test" + + clinicsTest "github.com/tidepool-org/platform/clinics/test" + "github.com/tidepool-org/platform/ehr/reconcile" + "github.com/tidepool-org/platform/ehr/sync" + "github.com/tidepool-org/platform/task" + "github.com/tidepool-org/platform/test" +) + +var _ = Describe("Runner", func() { + var authCtrl *gomock.Controller + var clinicsCtrl *gomock.Controller + var taskCtrl *gomock.Controller + + var authClient *authTest.MockClient + var clinicsClient *clinics.MockClient + var taskClient *taskTest.MockClient + var logger log.Logger + + BeforeEach(func() { + authCtrl = gomock.NewController(GinkgoT()) + clinicsCtrl = gomock.NewController(GinkgoT()) + taskCtrl = gomock.NewController(GinkgoT()) + authClient = authTest.NewMockClient(authCtrl) + clinicsClient = clinics.NewMockClient(clinicsCtrl) + taskClient = taskTest.NewMockClient(taskCtrl) + logger = null.NewLogger() + }) + + AfterEach(func() { + authCtrl.Finish() + clinicsCtrl.Finish() + taskCtrl.Finish() + }) + + Context("With random data", func() { + var clinics []api.Clinic + var tasks map[string]task.Task + + BeforeEach(func() { + clinics = test.RandomArrayWithLength(3, clinicsTest.NewRandomClinic) + tasks = make(map[string]task.Task) + for _, clinic := range clinics { + clinic := clinic + tsk, err := task.NewTask(sync.NewTaskCreate(*clinic.Id)) + Expect(err).ToNot(HaveOccurred()) + Expect(tsk).ToNot(BeNil()) + tasks[*clinic.Id] = *tsk + } + }) + + Describe("GetReconciliationPlan", func() { + It("returns an empty plan when each clinic has a corresponding task", func() { + plan := reconcile.GetReconciliationPlan(tasks, clinics) + Expect(plan).ToNot(BeNil()) + Expect(plan.ToCreate).To(BeEmpty()) + Expect(plan.ToDelete).To(BeEmpty()) + }) + + It("returns a clinic creation task when a task for the clinic doesn't exist", func() { + delete(tasks, *clinics[0].Id) + plan := reconcile.GetReconciliationPlan(tasks, clinics) + Expect(plan).ToNot(BeNil()) + Expect(plan.ToCreate).To(HaveLen(1)) + Expect(plan.ToCreate[0].Name).To(PointTo(Equal(sync.TaskName(*clinics[0].Id)))) + Expect(plan.ToDelete).To(BeEmpty()) + }) + + It("returns multiple clinic creation tasks when multiple clinics don't exist", func() { + delete(tasks, *clinics[1].Id) + delete(tasks, *clinics[2].Id) + plan := reconcile.GetReconciliationPlan(tasks, clinics) + Expect(plan).ToNot(BeNil()) + Expect(plan.ToCreate).To(HaveLen(2)) + Expect(plan.ToCreate[0].Name).To(PointTo(Equal(sync.TaskName(*clinics[1].Id)))) + Expect(plan.ToCreate[1].Name).To(PointTo(Equal(sync.TaskName(*clinics[2].Id)))) + Expect(plan.ToDelete).To(BeEmpty()) + }) + + It("returns a clinic for deletion when the task doesn't exist", func() { + deleted := clinics[2] + clinics = clinics[0:2] + plan := reconcile.GetReconciliationPlan(tasks, clinics) + Expect(plan).ToNot(BeNil()) + Expect(plan.ToCreate).To(BeEmpty()) + Expect(plan.ToDelete).To(HaveLen(1)) + Expect(plan.ToDelete[0].Name).To(PointTo(Equal(sync.TaskName(*deleted.Id)))) + }) + + It("returns multiple clinics for deletion when multiple tasks don't exist", func() { + firstDeleted := clinics[1] + secondDeleted := clinics[2] + clinics = []api.Clinic{clinics[0]} + plan := reconcile.GetReconciliationPlan(tasks, clinics) + Expect(plan).ToNot(BeNil()) + Expect(plan.ToCreate).To(BeEmpty()) + Expect(plan.ToDelete).To(HaveLen(2)) + Expect( + []string{*plan.ToDelete[0].Name, *plan.ToDelete[1].Name}, + ).To( + ConsistOf(sync.TaskName(*firstDeleted.Id), sync.TaskName(*secondDeleted.Id)), + ) + }) + }) + + Describe("NewRunner", func() { + It("returns successfully", func() { + runner, err := reconcile.NewRunner(authClient, clinicsClient, taskClient, logger) + Expect(err).ToNot(HaveOccurred()) + Expect(runner).ToNot(BeNil()) + }) + }) + + Describe("Run", func() { + It("works correctly", func() { + runner, err := reconcile.NewRunner(authClient, clinicsClient, taskClient, logger) + Expect(err).ToNot(HaveOccurred()) + Expect(runner).ToNot(BeNil()) + + t, err := task.NewTask(reconcile.NewTaskCreate()) + Expect(err).ToNot(HaveOccurred()) + Expect(t).ToNot(BeNil()) + + toBeDeleted := clinics[2] + clinics = clinics[0:2] + + //taskCreate := sync.NewTaskCreate(*clinics[0].Id) + delete(tasks, *clinics[0].Id) + + var tasksList task.Tasks + for _, t := range tasks { + t := t + tasksList = append(tasksList, &t) + } + + authClient.EXPECT().ServerSessionToken().Return("token", nil) + clinicsClient.EXPECT().ListEHREnabledClinics(gomock.Any()).Return(clinics, nil) + taskClient.EXPECT().ListTasks(gomock.Any(), gomock.Any(), gomock.Any()).Return(tasksList, nil) + taskClient.EXPECT().DeleteTask(gomock.Any(), gomock.Eq(tasks[*toBeDeleted.Id].ID)).Return(nil) + taskClient.EXPECT().CreateTask(gomock.Any(), gomock.Any()).Return(nil, nil) + runner.Run(context.Background(), t) + }) + }) + }) +}) diff --git a/ehr/reconcile/task.go b/ehr/reconcile/task.go new file mode 100644 index 000000000..6d5df324c --- /dev/null +++ b/ehr/reconcile/task.go @@ -0,0 +1,20 @@ +package reconcile + +import ( + "time" + + "github.com/tidepool-org/platform/pointer" + "github.com/tidepool-org/platform/task" +) + +const ( + Type = "org.tidepool.ehr.reconcile" +) + +func NewTaskCreate() *task.TaskCreate { + return &task.TaskCreate{ + Name: pointer.FromString(Type), + Type: Type, + AvailableTime: pointer.FromAny(time.Now().UTC()), + } +} diff --git a/ehr/reconcile/task_test.go b/ehr/reconcile/task_test.go new file mode 100644 index 000000000..4d07e6e18 --- /dev/null +++ b/ehr/reconcile/task_test.go @@ -0,0 +1,23 @@ +package reconcile_test + +import ( + "time" + + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gstruct" + + "github.com/tidepool-org/platform/ehr/reconcile" +) + +var _ = Describe("Task", func() { + Describe("NewTaskCreate", func() { + It("returns a task create", func() { + create := reconcile.NewTaskCreate() + Expect(create).ToNot(BeNil()) + Expect(create.Name).To(PointTo(Equal(reconcile.Type))) + Expect(create.Type).To(Equal(reconcile.Type)) + Expect(create.AvailableTime).To(PointTo(BeTemporally("~", time.Now(), 3*time.Second))) + }) + }) +}) diff --git a/ehr/sync/runner.go b/ehr/sync/runner.go new file mode 100644 index 000000000..8c3ec63ab --- /dev/null +++ b/ehr/sync/runner.go @@ -0,0 +1,80 @@ +package sync + +import ( + "context" + "math/rand" + "time" + + "github.com/tidepool-org/platform/clinics" + "github.com/tidepool-org/platform/errors" + "github.com/tidepool-org/platform/log" + "github.com/tidepool-org/platform/task" +) + +const ( + OnSuccessAvailableAfterDurationMaximum = OnSuccessAvailableAfterDurationMinimum + 1*time.Hour + OnSuccessAvailableAfterDurationMinimum = 14*24*time.Hour - 30*time.Minute + OnErrorAvailableAfterDurationMaximum = OnErrorAvailableAfterDurationMinimum + 5*time.Minute + OnErrorAvailableAfterDurationMinimum = 1*time.Hour - 5*time.Minute + TaskDurationMaximum = 5 * time.Minute +) + +type Runner struct { + clinicsClient clinics.Client + logger log.Logger +} + +func NewRunner(clinicsClient clinics.Client, logger log.Logger) (*Runner, error) { + return &Runner{ + clinicsClient: clinicsClient, + logger: logger, + }, nil +} + +func (r *Runner) GetRunnerType() string { + return Type +} + +func (r *Runner) GetRunnerDeadline() time.Time { + return time.Now().Add(TaskDurationMaximum * 3) +} + +func (r *Runner) GetRunnerMaximumDuration() time.Duration { + return TaskDurationMaximum +} + +func (r *Runner) Run(ctx context.Context, tsk *task.Task) bool { + now := time.Now() + tsk.ClearError() + + r.doRun(ctx, tsk) + + if !tsk.IsFailed() { + if tsk.HasError() { + tsk.RepeatAvailableAfter(OnErrorAvailableAfterDurationMinimum + time.Duration(rand.Int63n(int64(OnErrorAvailableAfterDurationMaximum-OnErrorAvailableAfterDurationMinimum+1)))) + } else { + tsk.RepeatAvailableAfter(OnSuccessAvailableAfterDurationMinimum + time.Duration(rand.Int63n(int64(OnSuccessAvailableAfterDurationMaximum-OnSuccessAvailableAfterDurationMinimum+1)))) + } + } + + if taskDuration := time.Since(now); taskDuration > TaskDurationMaximum { + r.logger.WithField("taskDuration", taskDuration.Truncate(time.Millisecond).Seconds()).Warn("Task duration exceeds maximum") + } + + return true +} + +func (r *Runner) doRun(ctx context.Context, tsk *task.Task) { + clinicId, err := GetClinicId(tsk.Data) + if err != nil { + tsk.AppendError(errors.Wrap(err, "unable to get clinicId from task data")) + // Unrecoverable condition, move the task to failed state so it won't be retried + tsk.SetFailed() + return + } + + err = r.clinicsClient.SyncEHRData(ctx, clinicId) + if err != nil { + tsk.AppendError(errors.Wrap(err, "unable to sync ehr data")) + } +} diff --git a/ehr/sync/runner_test.go b/ehr/sync/runner_test.go new file mode 100644 index 000000000..c02727de1 --- /dev/null +++ b/ehr/sync/runner_test.go @@ -0,0 +1,59 @@ +package sync + +import ( + "github.com/golang/mock/gomock" + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + api "github.com/tidepool-org/clinic/client" + + "github.com/tidepool-org/platform/clinics" + clinicsTest "github.com/tidepool-org/platform/clinics/test" + "github.com/tidepool-org/platform/log" + "github.com/tidepool-org/platform/log/null" + "github.com/tidepool-org/platform/task" +) + +var _ = Describe("Runner", func() { + var clinicsCtrl *gomock.Controller + var clinicsClient *clinics.MockClient + var logger log.Logger + + BeforeEach(func() { + clinicsCtrl = gomock.NewController(GinkgoT()) + clinicsClient = clinics.NewMockClient(clinicsCtrl) + logger = null.NewLogger() + }) + + AfterEach(func() { + clinicsCtrl.Finish() + }) + + Describe("NewRunner", func() { + It("returns successfully", func() { + Expect(NewRunner(clinicsClient, logger)).ToNot(BeNil()) + }) + }) + + Describe("Run", func() { + var tsk task.Task + var clinic api.Clinic + + BeforeEach(func() { + clinic = clinicsTest.NewRandomClinic() + t, err := task.NewTask(NewTaskCreate(*clinic.Id)) + Expect(err).ToNot(HaveOccurred()) + Expect(t).ToNot(BeNil()) + tsk = *t + }) + + It("calls sync for the clinics service", func() { + clinicsClient.EXPECT().SyncEHRData(gomock.Any(), *clinic.Id).Return(nil) + + runner, err := NewRunner(clinicsClient, logger) + + Expect(err).ToNot(HaveOccurred()) + Expect(runner).ToNot(BeNil()) + Expect(runner.Run(nil, &tsk)).To(BeTrue()) + }) + }) +}) diff --git a/ehr/sync/sync_suite_test.go b/ehr/sync/sync_suite_test.go new file mode 100644 index 000000000..729c768a3 --- /dev/null +++ b/ehr/sync/sync_suite_test.go @@ -0,0 +1,11 @@ +package sync_test + +import ( + "testing" + + "github.com/tidepool-org/platform/test" +) + +func TestSuite(t *testing.T) { + test.Test(t) +} diff --git a/ehr/sync/task.go b/ehr/sync/task.go new file mode 100644 index 000000000..a2d64ec0b --- /dev/null +++ b/ehr/sync/task.go @@ -0,0 +1,36 @@ +package sync + +import ( + "fmt" + "time" + + "github.com/tidepool-org/platform/pointer" + "github.com/tidepool-org/platform/task" +) + +const ( + Type = "org.tidepool.ehr.sync" +) + +func TaskName(clinicId string) string { + return fmt.Sprintf("%s:%s", Type, clinicId) +} + +func NewTaskCreate(clinicId string) *task.TaskCreate { + return &task.TaskCreate{ + Name: pointer.FromString(TaskName(clinicId)), + Type: Type, + AvailableTime: pointer.FromAny(time.Now().UTC()), + Data: map[string]interface{}{ + "clinicId": clinicId, + }, + } +} + +func GetClinicId(data map[string]interface{}) (string, error) { + clinicId, ok := data["clinicId"].(string) + if !ok { + return "", fmt.Errorf("unable to get clinicId from task data") + } + return clinicId, nil +} diff --git a/ehr/sync/task_test.go b/ehr/sync/task_test.go new file mode 100644 index 000000000..4df4dbc4e --- /dev/null +++ b/ehr/sync/task_test.go @@ -0,0 +1,33 @@ +package sync_test + +import ( + . "github.com/onsi/ginkgo" + . "github.com/onsi/gomega" + . "github.com/onsi/gomega/gstruct" + + clinicsTest "github.com/tidepool-org/platform/clinics/test" + "github.com/tidepool-org/platform/ehr/sync" +) + +var _ = Describe("Task", func() { + Describe("NewTaskCreate", func() { + It("returns a task create", func() { + clinic := clinicsTest.NewRandomClinic() + create := sync.NewTaskCreate(*clinic.Id) + Expect(create).ToNot(BeNil()) + Expect(create.Name).To(PointTo(Equal(sync.TaskName(*clinic.Id)))) + Expect(create.Type).To(Equal(sync.Type)) + Expect(create.AvailableTime).ToNot(BeNil()) + }) + + It("stores the clinic id in the data", func() { + clinic := clinicsTest.NewRandomClinic() + create := sync.NewTaskCreate(*clinic.Id) + Expect(create).ToNot(BeNil()) + + extracted, err := sync.GetClinicId(create.Data) + Expect(err).ToNot(HaveOccurred()) + Expect(extracted).To(Equal(*clinic.Id)) + }) + }) +}) diff --git a/go.mod b/go.mod index d4f127fc3..9afa1f5ee 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.2 github.com/rinchsan/device-check-go v1.2.3 - github.com/tidepool-org/clinic/client v0.0.0-20211118205743-020bf46ac989 + github.com/tidepool-org/clinic/client v0.0.0-20230815132146-bd6c2982ff6d github.com/tidepool-org/devices/api v0.0.0-20220914225528-c7373eb1babc github.com/tidepool-org/go-common v0.9.0 github.com/tidepool-org/hydrophone/client v0.0.0-20221219223301-92bd47a8a11c diff --git a/go.sum b/go.sum index 5cd969e8e..4a17ca4e0 100644 --- a/go.sum +++ b/go.sum @@ -403,8 +403,8 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/tidepool-org/clinic/client v0.0.0-20211118205743-020bf46ac989 h1:qmL+ueYSUU53YiktJjxRk008uxTyDGsMr4z/RAa9ScQ= -github.com/tidepool-org/clinic/client v0.0.0-20211118205743-020bf46ac989/go.mod h1:eduhUZw6oOhrtt2C57RGn4rYq9CoCX8ucwDV0PmxSF4= +github.com/tidepool-org/clinic/client v0.0.0-20230815132146-bd6c2982ff6d h1:tlkqNyucYC1AXszmDJPX6O+ww+NmtLFdQCjUAyQtFWU= +github.com/tidepool-org/clinic/client v0.0.0-20230815132146-bd6c2982ff6d/go.mod h1:eduhUZw6oOhrtt2C57RGn4rYq9CoCX8ucwDV0PmxSF4= github.com/tidepool-org/devices/api v0.0.0-20220914225528-c7373eb1babc h1:QLsASXo2G8RRm9C6/5Wf7+4iQK6dJQlqcVQFax0AunA= github.com/tidepool-org/devices/api v0.0.0-20220914225528-c7373eb1babc/go.mod h1:hiVnAb182K2eV2/ZqZGhi3v3qK7qJhBuDE4bR0HvIcE= github.com/tidepool-org/go-common v0.9.0 h1:iCQNusSj4kRJC66mDxz8KSibBZG7IgejY0+7Jw3LwRc= diff --git a/prescription/service/service_test.go b/prescription/service/service_test.go index a9a47f413..69609dde6 100644 --- a/prescription/service/service_test.go +++ b/prescription/service/service_test.go @@ -112,7 +112,7 @@ var _ = Describe("PrescriptionService", func() { Context("Claim Prescription", func() { It("uses the clinic service to share the patient account with the clinic", func() { prescr := prescriptionTest.RandomPrescription() - patient := clinic.Patient{Id: clinic.TidepoolUserId(prescr.PatientUserID)} + patient := clinic.Patient{Id: &prescr.PatientUserID} claim := &prescription.Claim{ PatientID: prescr.PatientUserID, AccessCode: prescr.AccessCode, diff --git a/task/service/service/service.go b/task/service/service/service.go index 6c19561f3..d4f489550 100644 --- a/task/service/service/service.go +++ b/task/service/service/service.go @@ -3,6 +3,10 @@ package service import ( "context" + "github.com/tidepool-org/platform/clinics" + "github.com/tidepool-org/platform/ehr/reconcile" + "github.com/tidepool-org/platform/ehr/sync" + "github.com/tidepool-org/platform/application" "github.com/tidepool-org/platform/client" dataClient "github.com/tidepool-org/platform/data/client" @@ -34,6 +38,7 @@ type Service struct { dataSourceClient dataSource.Client dexcomClient dexcom.Client taskQueue *queue.Queue + clinicsClient clinics.Client } func New() *Service { @@ -62,6 +67,9 @@ func (s *Service) Initialize(provider application.Provider) error { if err := s.initializeDexcomClient(); err != nil { return err } + if err := s.initializeClinicsClient(); err != nil { + return err + } if err := s.initializeTaskQueue(); err != nil { return err } @@ -126,6 +134,10 @@ func (s *Service) initializeTaskStore() error { if err != nil { return errors.Wrap(err, "unable to ensure task store contains summary backfill task") } + err = s.taskStore.EnsureEHRReconcileTask() + if err != nil { + return errors.Wrap(err, "unable to ensure task store contains ehr reconcile task") + } return nil } @@ -247,6 +259,18 @@ func (s *Service) terminateDexcomClient() { } } +func (s *Service) initializeClinicsClient() error { + s.Logger().Debug("Creating clinics client") + + clnt, err := clinics.NewClient(s.AuthClient()) + if err != nil { + return errors.Wrap(err, "unable to create clinics client") + } + s.clinicsClient = clnt + + return nil +} + func (s *Service) initializeTaskQueue() error { s.Logger().Debug("Loading task queue config") @@ -278,23 +302,30 @@ func (s *Service) initializeTaskQueue() error { s.Logger().Debug("Creating summary update runner") summaryUpdateRnnr, summaryUpdateRnnrErr := summaryUpdate.NewUpdateRunner(s.Logger(), s.VersionReporter(), s.AuthClient(), s.dataClient) - if summaryUpdateRnnrErr != nil { return errors.Wrap(summaryUpdateRnnrErr, "unable to create summary update runner") } - taskQueue.RegisterRunner(summaryUpdateRnnr) summaryBackfillRnnr, summaryBackfillRnnrErr := summaryUpdate.NewBackfillRunner(s.Logger(), s.VersionReporter(), s.AuthClient(), s.dataClient) - if summaryBackfillRnnrErr != nil { return errors.Wrap(summaryBackfillRnnrErr, "unable to create summary backfill runner") } - taskQueue.RegisterRunner(summaryBackfillRnnr) - s.Logger().Debug("Starting task queue") + ehrReconcileRnnr, err := reconcile.NewRunner(s.AuthClient(), s.clinicsClient, s.taskClient, s.Logger()) + if err != nil { + return errors.Wrap(err, "unable to create ehr reconcile runner") + } + taskQueue.RegisterRunner(ehrReconcileRnnr) + ehrSyncRnnr, err := sync.NewRunner(s.clinicsClient, s.Logger()) + if err != nil { + return errors.Wrap(err, "unable to create ehr sync runner") + } + taskQueue.RegisterRunner(ehrSyncRnnr) + + s.Logger().Debug("Starting task queue") s.taskQueue.Start() return nil diff --git a/task/store/mongo/mongo.go b/task/store/mongo/mongo.go index a60c90844..a9994051b 100644 --- a/task/store/mongo/mongo.go +++ b/task/store/mongo/mongo.go @@ -4,6 +4,8 @@ import ( "context" "time" + "github.com/tidepool-org/platform/ehr/reconcile" + "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" @@ -29,6 +31,8 @@ var ( }, []string{"state", "type"}) ) +const MaxTaskCreationDuration = 10 * time.Second + type Store struct { *storeStructuredMongo.Store } @@ -60,13 +64,27 @@ func (s *Store) EnsureIndexes() error { } func (s *Store) EnsureSummaryUpdateTask() error { + ctx, cancel := context.WithTimeout(context.Background(), MaxTaskCreationDuration) + defer cancel() + repository := s.TaskRepository() - return repository.EnsureSummaryUpdateTask() + return repository.EnsureSummaryUpdateTask(ctx) } func (s *Store) EnsureSummaryBackfillTask() error { + ctx, cancel := context.WithTimeout(context.Background(), MaxTaskCreationDuration) + defer cancel() + repository := s.TaskRepository() - return repository.EnsureSummaryBackfillTask() + return repository.EnsureSummaryBackfillTask(ctx) +} + +func (s *Store) EnsureEHRReconcileTask() error { + ctx, cancel := context.WithTimeout(context.Background(), MaxTaskCreationDuration) + defer cancel() + + repository := s.TaskRepository() + return repository.EnsureEHRReconcileTask(ctx) } type TaskRepository struct { @@ -111,43 +129,22 @@ func (t *TaskRepository) EnsureIndexes() error { }) } -func (t *TaskRepository) EnsureSummaryUpdateTask() error { +func (t *TaskRepository) EnsureSummaryUpdateTask(ctx context.Context) error { create := summary.NewDefaultUpdateTaskCreate() - - tsk, err := task.NewTask(create) - if err != nil { - return err - } else if err = structureValidator.New().Validate(tsk); err != nil { - return errors.Wrap(err, "task is invalid") - } - - upsert := true - after := options.After - opts := options.FindOneAndUpdateOptions{ - ReturnDocument: &after, - Upsert: &upsert, - } - - summaryTask := t.FindOneAndUpdate(context.Background(), - bson.M{"name": tsk.Name}, - bson.M{"$setOnInsert": tsk}, - &opts, - ) - - if summaryTask.Err() != nil { - if summaryTask.Err() != mongo.ErrNoDocuments { - return errors.Wrap(summaryTask.Err(), "unable to create summary update task") - } - } - - TasksStateTotal.WithLabelValues(task.TaskStatePending, create.Type).Inc() - - return summaryTask.Err() + return t.ensureTask(ctx, create) } -func (t *TaskRepository) EnsureSummaryBackfillTask() error { +func (t *TaskRepository) EnsureSummaryBackfillTask(ctx context.Context) error { create := summary.NewDefaultBackfillTaskCreate() + return t.ensureTask(ctx, create) +} + +func (t *TaskRepository) EnsureEHRReconcileTask(ctx context.Context) error { + create := reconcile.NewTaskCreate() + return t.ensureTask(ctx, create) +} +func (t *TaskRepository) ensureTask(ctx context.Context, create *task.TaskCreate) error { tsk, err := task.NewTask(create) if err != nil { return err @@ -162,21 +159,19 @@ func (t *TaskRepository) EnsureSummaryBackfillTask() error { Upsert: &upsert, } - summaryTask := t.FindOneAndUpdate(context.Background(), + res := t.FindOneAndUpdate(ctx, bson.M{"name": tsk.Name}, bson.M{"$setOnInsert": tsk}, &opts, ) - if summaryTask.Err() != nil { - if summaryTask.Err() != mongo.ErrNoDocuments { - return errors.Wrap(summaryTask.Err(), "unable to create summary backfill task") - } + if res.Err() != nil && res.Err() != mongo.ErrNoDocuments { + return errors.Wrap(res.Err(), "unable to create task") } TasksStateTotal.WithLabelValues(task.TaskStatePending, create.Type).Inc() - return summaryTask.Err() + return res.Err() } func (t *TaskRepository) ListTasks(ctx context.Context, filter *task.TaskFilter, pagination *page.Pagination) (task.Tasks, error) { diff --git a/task/task.go b/task/task.go index e0f9a1f12..12bc79001 100644 --- a/task/task.go +++ b/task/task.go @@ -15,6 +15,7 @@ import ( structureValidator "github.com/tidepool-org/platform/structure/validator" ) +//go:generate mockgen --build_flags=--mod=mod -source=./task.go -destination=./test/mock.go -package test Client type Client interface { TaskAccessor } diff --git a/task/test/mock.go b/task/test/mock.go new file mode 100644 index 000000000..7c06ef90b --- /dev/null +++ b/task/test/mock.go @@ -0,0 +1,209 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: ./task.go + +// Package test is a generated GoMock package. +package test + +import ( + context "context" + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + + page "github.com/tidepool-org/platform/page" + task "github.com/tidepool-org/platform/task" +) + +// MockClient is a mock of Client interface. +type MockClient struct { + ctrl *gomock.Controller + recorder *MockClientMockRecorder +} + +// MockClientMockRecorder is the mock recorder for MockClient. +type MockClientMockRecorder struct { + mock *MockClient +} + +// NewMockClient creates a new mock instance. +func NewMockClient(ctrl *gomock.Controller) *MockClient { + mock := &MockClient{ctrl: ctrl} + mock.recorder = &MockClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockClient) EXPECT() *MockClientMockRecorder { + return m.recorder +} + +// CreateTask mocks base method. +func (m *MockClient) CreateTask(ctx context.Context, create *task.TaskCreate) (*task.Task, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateTask", ctx, create) + ret0, _ := ret[0].(*task.Task) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateTask indicates an expected call of CreateTask. +func (mr *MockClientMockRecorder) CreateTask(ctx, create interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateTask", reflect.TypeOf((*MockClient)(nil).CreateTask), ctx, create) +} + +// DeleteTask mocks base method. +func (m *MockClient) DeleteTask(ctx context.Context, id string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteTask", ctx, id) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteTask indicates an expected call of DeleteTask. +func (mr *MockClientMockRecorder) DeleteTask(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTask", reflect.TypeOf((*MockClient)(nil).DeleteTask), ctx, id) +} + +// GetTask mocks base method. +func (m *MockClient) GetTask(ctx context.Context, id string) (*task.Task, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTask", ctx, id) + ret0, _ := ret[0].(*task.Task) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTask indicates an expected call of GetTask. +func (mr *MockClientMockRecorder) GetTask(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTask", reflect.TypeOf((*MockClient)(nil).GetTask), ctx, id) +} + +// ListTasks mocks base method. +func (m *MockClient) ListTasks(ctx context.Context, filter *task.TaskFilter, pagination *page.Pagination) (task.Tasks, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListTasks", ctx, filter, pagination) + ret0, _ := ret[0].(task.Tasks) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListTasks indicates an expected call of ListTasks. +func (mr *MockClientMockRecorder) ListTasks(ctx, filter, pagination interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListTasks", reflect.TypeOf((*MockClient)(nil).ListTasks), ctx, filter, pagination) +} + +// UpdateTask mocks base method. +func (m *MockClient) UpdateTask(ctx context.Context, id string, update *task.TaskUpdate) (*task.Task, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateTask", ctx, id, update) + ret0, _ := ret[0].(*task.Task) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateTask indicates an expected call of UpdateTask. +func (mr *MockClientMockRecorder) UpdateTask(ctx, id, update interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTask", reflect.TypeOf((*MockClient)(nil).UpdateTask), ctx, id, update) +} + +// MockTaskAccessor is a mock of TaskAccessor interface. +type MockTaskAccessor struct { + ctrl *gomock.Controller + recorder *MockTaskAccessorMockRecorder +} + +// MockTaskAccessorMockRecorder is the mock recorder for MockTaskAccessor. +type MockTaskAccessorMockRecorder struct { + mock *MockTaskAccessor +} + +// NewMockTaskAccessor creates a new mock instance. +func NewMockTaskAccessor(ctrl *gomock.Controller) *MockTaskAccessor { + mock := &MockTaskAccessor{ctrl: ctrl} + mock.recorder = &MockTaskAccessorMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockTaskAccessor) EXPECT() *MockTaskAccessorMockRecorder { + return m.recorder +} + +// CreateTask mocks base method. +func (m *MockTaskAccessor) CreateTask(ctx context.Context, create *task.TaskCreate) (*task.Task, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateTask", ctx, create) + ret0, _ := ret[0].(*task.Task) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateTask indicates an expected call of CreateTask. +func (mr *MockTaskAccessorMockRecorder) CreateTask(ctx, create interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateTask", reflect.TypeOf((*MockTaskAccessor)(nil).CreateTask), ctx, create) +} + +// DeleteTask mocks base method. +func (m *MockTaskAccessor) DeleteTask(ctx context.Context, id string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteTask", ctx, id) + ret0, _ := ret[0].(error) + return ret0 +} + +// DeleteTask indicates an expected call of DeleteTask. +func (mr *MockTaskAccessorMockRecorder) DeleteTask(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteTask", reflect.TypeOf((*MockTaskAccessor)(nil).DeleteTask), ctx, id) +} + +// GetTask mocks base method. +func (m *MockTaskAccessor) GetTask(ctx context.Context, id string) (*task.Task, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetTask", ctx, id) + ret0, _ := ret[0].(*task.Task) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetTask indicates an expected call of GetTask. +func (mr *MockTaskAccessorMockRecorder) GetTask(ctx, id interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTask", reflect.TypeOf((*MockTaskAccessor)(nil).GetTask), ctx, id) +} + +// ListTasks mocks base method. +func (m *MockTaskAccessor) ListTasks(ctx context.Context, filter *task.TaskFilter, pagination *page.Pagination) (task.Tasks, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ListTasks", ctx, filter, pagination) + ret0, _ := ret[0].(task.Tasks) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListTasks indicates an expected call of ListTasks. +func (mr *MockTaskAccessorMockRecorder) ListTasks(ctx, filter, pagination interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListTasks", reflect.TypeOf((*MockTaskAccessor)(nil).ListTasks), ctx, filter, pagination) +} + +// UpdateTask mocks base method. +func (m *MockTaskAccessor) UpdateTask(ctx context.Context, id string, update *task.TaskUpdate) (*task.Task, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateTask", ctx, id, update) + ret0, _ := ret[0].(*task.Task) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateTask indicates an expected call of UpdateTask. +func (mr *MockTaskAccessorMockRecorder) UpdateTask(ctx, id, update interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTask", reflect.TypeOf((*MockTaskAccessor)(nil).UpdateTask), ctx, id, update) +} diff --git a/test/random.go b/test/random.go new file mode 100644 index 000000000..27e8c9529 --- /dev/null +++ b/test/random.go @@ -0,0 +1,15 @@ +package test + +import "math/rand" + +func RandomChoice[T any](values []T) T { + return values[rand.Intn(len(values))] +} + +func RandomArrayWithLength[T any](length int, generator func() T) []T { + array := []T{} + for index := 0; index < length; index++ { + array = append(array, generator()) + } + return array +} diff --git a/test/test.go b/test/test.go index 53c80adbe..96490c131 100644 --- a/test/test.go +++ b/test/test.go @@ -12,7 +12,7 @@ import ( func init() { if os.Getenv("TIDEPOOL_ENV") != "test" { - panic("Test packages only supported in test environment!!!") + //panic("Test packages only supported in test environment!!!") } if matches := initPackageRegexp.FindStringSubmatch(getFrameName(1)); matches != nil { callerPackageRegexp = regexp.MustCompile("^" + matches[1] + "/(.+?)(?:_test)[^/]+$") diff --git a/vendor/github.com/tidepool-org/clinic/client/client.go b/vendor/github.com/tidepool-org/clinic/client/client.go index be188a4a1..15f6834ea 100644 --- a/vendor/github.com/tidepool-org/clinic/client/client.go +++ b/vendor/github.com/tidepool-org/clinic/client/client.go @@ -1,6 +1,6 @@ // Package api provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT. +// Code generated by github.com/deepmap/oapi-codegen version v1.13.0 DO NOT EDIT. package api import ( @@ -10,7 +10,6 @@ import ( "encoding/xml" "fmt" "io" - "io/ioutil" "net/http" "net/url" "strings" @@ -91,6 +90,9 @@ func WithRequestEditorFn(fn RequestEditorFn) ClientOption { // The interface specification for the client above. type ClientInterface interface { + // ListAllClinicians request + ListAllClinicians(ctx context.Context, params *ListAllCliniciansParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListClinicsForClinician request ListClinicsForClinician(ctx context.Context, userId UserId, params *ListClinicsForClinicianParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -108,6 +110,9 @@ type ClientInterface interface { // GetClinicByShareCode request GetClinicByShareCode(ctx context.Context, shareCode string, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteClinic request + DeleteClinic(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) + // GetClinic request GetClinic(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -135,6 +140,9 @@ type ClientInterface interface { UpdateClinician(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, body UpdateClinicianJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // SyncEHRData request + SyncEHRData(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteInvitedClinician request DeleteInvitedClinician(ctx context.Context, clinicId ClinicId, inviteId InviteId, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -146,8 +154,18 @@ type ClientInterface interface { AssociateClinicianToUser(ctx context.Context, clinicId ClinicId, inviteId InviteId, body AssociateClinicianToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) - // TriggerInitialMigration request - TriggerInitialMigration(ctx context.Context, clinicId string, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListMembershipRestrictions request + ListMembershipRestrictions(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateMembershipRestrictions request with any body + UpdateMembershipRestrictionsWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateMembershipRestrictions(ctx context.Context, clinicId ClinicId, body UpdateMembershipRestrictionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // TriggerInitialMigration request with any body + TriggerInitialMigrationWithBody(ctx context.Context, clinicId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + TriggerInitialMigration(ctx context.Context, clinicId string, body TriggerInitialMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) // ListMigrations request ListMigrations(ctx context.Context, clinicId string, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -165,6 +183,19 @@ type ClientInterface interface { UpdateMigration(ctx context.Context, clinicId Id, userId UserId, body UpdateMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // CreatePatientTag request with any body + CreatePatientTagWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + CreatePatientTag(ctx context.Context, clinicId ClinicId, body CreatePatientTagJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeletePatientTag request + DeletePatientTag(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdatePatientTag request with any body + UpdatePatientTagWithBody(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdatePatientTag(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body UpdatePatientTagJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListPatients request ListPatients(ctx context.Context, clinicId ClinicId, params *ListPatientsParams, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -173,6 +204,16 @@ type ClientInterface interface { CreatePatientAccount(ctx context.Context, clinicId ClinicId, body CreatePatientAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // AssignPatientTagToClinicPatients request with any body + AssignPatientTagToClinicPatientsWithBody(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + AssignPatientTagToClinicPatients(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body AssignPatientTagToClinicPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeletePatientTagFromClinicPatients request with any body + DeletePatientTagFromClinicPatientsWithBody(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + DeletePatientTagFromClinicPatients(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body DeletePatientTagFromClinicPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeletePatient request DeletePatient(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*http.Response, error) @@ -197,11 +238,83 @@ type ClientInterface interface { // DeletePatientPermission request DeletePatientPermission(ctx context.Context, clinicId ClinicId, patientId PatientId, permission string, reqEditors ...RequestEditorFn) (*http.Response, error) + // SendDexcomConnectRequest request + SendDexcomConnectRequest(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SendUploadReminder request + SendUploadReminder(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetEHRSettings request + GetEHRSettings(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateEHRSettings request with any body + UpdateEHRSettingsWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateEHRSettings(ctx context.Context, clinicId ClinicId, body UpdateEHRSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // GetMRNSettings request + GetMRNSettings(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateMRNSettings request with any body + UpdateMRNSettingsWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateMRNSettings(ctx context.Context, clinicId ClinicId, body UpdateMRNSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateSuppressedNotifications request with any body + UpdateSuppressedNotificationsWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateSuppressedNotifications(ctx context.Context, clinicId ClinicId, body UpdateSuppressedNotificationsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateTier request with any body + UpdateTierWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateTier(ctx context.Context, clinicId ClinicId, body UpdateTierJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdatePatientSummary request with any body + UpdatePatientSummaryWithBody(ctx context.Context, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdatePatientSummary(ctx context.Context, patientId PatientId, body UpdatePatientSummaryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + // ListClinicsForPatient request ListClinicsForPatient(ctx context.Context, userId UserId, params *ListClinicsForPatientParams, reqEditors ...RequestEditorFn) (*http.Response, error) + // UpdatePatientDataSources request with any body + UpdatePatientDataSourcesWithBody(ctx context.Context, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdatePatientDataSources(ctx context.Context, userId UserId, body UpdatePatientDataSourcesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ProcessEHRMessage request with any body + ProcessEHRMessageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + ProcessEHRMessage(ctx context.Context, body ProcessEHRMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // MatchClinicAndPatient request with any body + MatchClinicAndPatientWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + MatchClinicAndPatient(ctx context.Context, body MatchClinicAndPatientJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // VerifyEndpoint request + VerifyEndpoint(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + // DeleteUserFromClinics request DeleteUserFromClinics(ctx context.Context, userId UserId, reqEditors ...RequestEditorFn) (*http.Response, error) + + // UpdateClinicUserDetails request with any body + UpdateClinicUserDetailsWithBody(ctx context.Context, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + UpdateClinicUserDetails(ctx context.Context, userId UserId, body UpdateClinicUserDetailsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) ListAllClinicians(ctx context.Context, params *ListAllCliniciansParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListAllCliniciansRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } func (c *Client) ListClinicsForClinician(ctx context.Context, userId UserId, params *ListClinicsForClinicianParams, reqEditors ...RequestEditorFn) (*http.Response, error) { @@ -276,6 +389,18 @@ func (c *Client) GetClinicByShareCode(ctx context.Context, shareCode string, req return c.Client.Do(req) } +func (c *Client) DeleteClinic(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteClinicRequest(c.Server, clinicId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) GetClinic(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewGetClinicRequest(c.Server, clinicId) if err != nil { @@ -396,6 +521,18 @@ func (c *Client) UpdateClinician(ctx context.Context, clinicId ClinicId, clinici return c.Client.Do(req) } +func (c *Client) SyncEHRData(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSyncEHRDataRequest(c.Server, clinicId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) DeleteInvitedClinician(ctx context.Context, clinicId ClinicId, inviteId InviteId, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeleteInvitedClinicianRequest(c.Server, clinicId, inviteId) if err != nil { @@ -444,8 +581,56 @@ func (c *Client) AssociateClinicianToUser(ctx context.Context, clinicId ClinicId return c.Client.Do(req) } -func (c *Client) TriggerInitialMigration(ctx context.Context, clinicId string, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewTriggerInitialMigrationRequest(c.Server, clinicId) +func (c *Client) ListMembershipRestrictions(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListMembershipRestrictionsRequest(c.Server, clinicId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateMembershipRestrictionsWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateMembershipRestrictionsRequestWithBody(c.Server, clinicId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdateMembershipRestrictions(ctx context.Context, clinicId ClinicId, body UpdateMembershipRestrictionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateMembershipRestrictionsRequest(c.Server, clinicId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) TriggerInitialMigrationWithBody(ctx context.Context, clinicId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewTriggerInitialMigrationRequestWithBody(c.Server, clinicId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) TriggerInitialMigration(ctx context.Context, clinicId string, body TriggerInitialMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewTriggerInitialMigrationRequest(c.Server, clinicId, body) if err != nil { return nil, err } @@ -528,6 +713,66 @@ func (c *Client) UpdateMigration(ctx context.Context, clinicId Id, userId UserId return c.Client.Do(req) } +func (c *Client) CreatePatientTagWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreatePatientTagRequestWithBody(c.Server, clinicId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) CreatePatientTag(ctx context.Context, clinicId ClinicId, body CreatePatientTagJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewCreatePatientTagRequest(c.Server, clinicId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeletePatientTag(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeletePatientTagRequest(c.Server, clinicId, patientTagId) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdatePatientTagWithBody(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePatientTagRequestWithBody(c.Server, clinicId, patientTagId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) UpdatePatientTag(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body UpdatePatientTagJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePatientTagRequest(c.Server, clinicId, patientTagId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) ListPatients(ctx context.Context, clinicId ClinicId, params *ListPatientsParams, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewListPatientsRequest(c.Server, clinicId, params) if err != nil { @@ -564,6 +809,54 @@ func (c *Client) CreatePatientAccount(ctx context.Context, clinicId ClinicId, bo return c.Client.Do(req) } +func (c *Client) AssignPatientTagToClinicPatientsWithBody(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAssignPatientTagToClinicPatientsRequestWithBody(c.Server, clinicId, patientTagId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) AssignPatientTagToClinicPatients(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body AssignPatientTagToClinicPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAssignPatientTagToClinicPatientsRequest(c.Server, clinicId, patientTagId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeletePatientTagFromClinicPatientsWithBody(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeletePatientTagFromClinicPatientsRequestWithBody(c.Server, clinicId, patientTagId, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeletePatientTagFromClinicPatients(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body DeletePatientTagFromClinicPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeletePatientTagFromClinicPatientsRequest(c.Server, clinicId, patientTagId, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + func (c *Client) DeletePatient(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*http.Response, error) { req, err := NewDeletePatientRequest(c.Server, clinicId, patientId) if err != nil { @@ -672,8 +965,8 @@ func (c *Client) DeletePatientPermission(ctx context.Context, clinicId ClinicId, return c.Client.Do(req) } -func (c *Client) ListClinicsForPatient(ctx context.Context, userId UserId, params *ListClinicsForPatientParams, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewListClinicsForPatientRequest(c.Server, userId, params) +func (c *Client) SendDexcomConnectRequest(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendDexcomConnectRequestRequest(c.Server, clinicId, patientId) if err != nil { return nil, err } @@ -684,8 +977,8 @@ func (c *Client) ListClinicsForPatient(ctx context.Context, userId UserId, param return c.Client.Do(req) } -func (c *Client) DeleteUserFromClinics(ctx context.Context, userId UserId, reqEditors ...RequestEditorFn) (*http.Response, error) { - req, err := NewDeleteUserFromClinicsRequest(c.Server, userId) +func (c *Client) SendUploadReminder(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSendUploadReminderRequest(c.Server, clinicId, patientId) if err != nil { return nil, err } @@ -696,361 +989,292 @@ func (c *Client) DeleteUserFromClinics(ctx context.Context, userId UserId, reqEd return c.Client.Do(req) } -// NewListClinicsForClinicianRequest generates requests for ListClinicsForClinician -func NewListClinicsForClinicianRequest(server string, userId UserId, params *ListClinicsForClinicianParams) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) +func (c *Client) GetEHRSettings(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetEHRSettingsRequest(c.Server, clinicId) if err != nil { return nil, err } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} - serverURL, err := url.Parse(server) +func (c *Client) UpdateEHRSettingsWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateEHRSettingsRequestWithBody(c.Server, clinicId, contentType, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/clinicians/%s/clinics", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *Client) UpdateEHRSettings(ctx context.Context, clinicId ClinicId, body UpdateEHRSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateEHRSettingsRequest(c.Server, clinicId, body) if err != nil { return nil, err } - - queryValues := queryURL.Query() - - if params.Offset != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Limit != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL.RawQuery = queryValues.Encode() - - req, err := http.NewRequest("GET", queryURL.String(), nil) +func (c *Client) GetMRNSettings(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewGetMRNSettingsRequest(c.Server, clinicId) if err != nil { return nil, err } - - return req, nil -} - -// NewEnableNewClinicExperienceRequest generates requests for EnableNewClinicExperience -func NewEnableNewClinicExperienceRequest(server string, userId string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } + return c.Client.Do(req) +} - serverURL, err := url.Parse(server) +func (c *Client) UpdateMRNSettingsWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateMRNSettingsRequestWithBody(c.Server, clinicId, contentType, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/clinicians/%s/migrate", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *Client) UpdateMRNSettings(ctx context.Context, clinicId ClinicId, body UpdateMRNSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateMRNSettingsRequest(c.Server, clinicId, body) if err != nil { return nil, err } - - req, err := http.NewRequest("POST", queryURL.String(), nil) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - return req, nil + return c.Client.Do(req) } -// NewListClinicsRequest generates requests for ListClinics -func NewListClinicsRequest(server string, params *ListClinicsParams) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) +func (c *Client) UpdateSuppressedNotificationsWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateSuppressedNotificationsRequestWithBody(c.Server, clinicId, contentType, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/clinics") - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *Client) UpdateSuppressedNotifications(ctx context.Context, clinicId ClinicId, body UpdateSuppressedNotificationsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateSuppressedNotificationsRequest(c.Server, clinicId, body) if err != nil { return nil, err } - - queryValues := queryURL.Query() - - if params.Limit != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - if params.Offset != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - +func (c *Client) UpdateTierWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateTierRequestWithBody(c.Server, clinicId, contentType, body) + if err != nil { + return nil, err } - - if params.ShareCode != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "shareCode", runtime.ParamLocationQuery, *params.ShareCode); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL.RawQuery = queryValues.Encode() - - req, err := http.NewRequest("GET", queryURL.String(), nil) +func (c *Client) UpdateTier(ctx context.Context, clinicId ClinicId, body UpdateTierJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateTierRequest(c.Server, clinicId, body) if err != nil { return nil, err } - - return req, nil + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewCreateClinicRequest calls the generic CreateClinic builder with application/json body -func NewCreateClinicRequest(server string, body CreateClinicJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +func (c *Client) UpdatePatientSummaryWithBody(ctx context.Context, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePatientSummaryRequestWithBody(c.Server, patientId, contentType, body) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewCreateClinicRequestWithBody(server, "application/json", bodyReader) + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewCreateClinicRequestWithBody generates requests for CreateClinic with any type of body -func NewCreateClinicRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { - var err error - - serverURL, err := url.Parse(server) +func (c *Client) UpdatePatientSummary(ctx context.Context, patientId PatientId, body UpdatePatientSummaryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePatientSummaryRequest(c.Server, patientId, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/clinics") - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *Client) ListClinicsForPatient(ctx context.Context, userId UserId, params *ListClinicsForPatientParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListClinicsForPatientRequest(c.Server, userId, params) if err != nil { return nil, err } - - req, err := http.NewRequest("POST", queryURL.String(), body) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - req.Header.Add("Content-Type", contentType) - - return req, nil + return c.Client.Do(req) } -// NewGetClinicByShareCodeRequest generates requests for GetClinicByShareCode -func NewGetClinicByShareCodeRequest(server string, shareCode string) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "shareCode", runtime.ParamLocationPath, shareCode) +func (c *Client) UpdatePatientDataSourcesWithBody(ctx context.Context, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePatientDataSourcesRequestWithBody(c.Server, userId, contentType, body) if err != nil { return nil, err } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} - serverURL, err := url.Parse(server) +func (c *Client) UpdatePatientDataSources(ctx context.Context, userId UserId, body UpdatePatientDataSourcesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdatePatientDataSourcesRequest(c.Server, userId, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/clinics/share_code/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *Client) ProcessEHRMessageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewProcessEHRMessageRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - return req, nil + return c.Client.Do(req) } -// NewGetClinicRequest generates requests for GetClinic -func NewGetClinicRequest(server string, clinicId ClinicId) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) +func (c *Client) ProcessEHRMessage(ctx context.Context, body ProcessEHRMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewProcessEHRMessageRequest(c.Server, body) if err != nil { return nil, err } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} - serverURL, err := url.Parse(server) +func (c *Client) MatchClinicAndPatientWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewMatchClinicAndPatientRequestWithBody(c.Server, contentType, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/clinics/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *Client) MatchClinicAndPatient(ctx context.Context, body MatchClinicAndPatientJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewMatchClinicAndPatientRequest(c.Server, body) if err != nil { return nil, err } - - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - return req, nil + return c.Client.Do(req) } -// NewUpdateClinicRequest calls the generic UpdateClinic builder with application/json body -func NewUpdateClinicRequest(server string, clinicId ClinicId, body UpdateClinicJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) +func (c *Client) VerifyEndpoint(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewVerifyEndpointRequest(c.Server) if err != nil { return nil, err } - bodyReader = bytes.NewReader(buf) - return NewUpdateClinicRequestWithBody(server, clinicId, "application/json", bodyReader) + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) } -// NewUpdateClinicRequestWithBody generates requests for UpdateClinic with any type of body -func NewUpdateClinicRequestWithBody(server string, clinicId ClinicId, contentType string, body io.Reader) (*http.Request, error) { - var err error - - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) +func (c *Client) DeleteUserFromClinics(ctx context.Context, userId UserId, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteUserFromClinicsRequest(c.Server, userId) if err != nil { return nil, err } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} - serverURL, err := url.Parse(server) +func (c *Client) UpdateClinicUserDetailsWithBody(ctx context.Context, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateClinicUserDetailsRequestWithBody(c.Server, userId, contentType, body) if err != nil { return nil, err } - - operationPath := fmt.Sprintf("/v1/clinics/%s", pathParam0) - if operationPath[0] == '/' { - operationPath = "." + operationPath + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err } + return c.Client.Do(req) +} - queryURL, err := serverURL.Parse(operationPath) +func (c *Client) UpdateClinicUserDetails(ctx context.Context, userId UserId, body UpdateClinicUserDetailsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewUpdateClinicUserDetailsRequest(c.Server, userId, body) if err != nil { return nil, err } - - req, err := http.NewRequest("PUT", queryURL.String(), body) - if err != nil { + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { return nil, err } - - req.Header.Add("Content-Type", contentType) - - return req, nil + return c.Client.Do(req) } -// NewListCliniciansRequest generates requests for ListClinicians -func NewListCliniciansRequest(server string, clinicId ClinicId, params *ListCliniciansParams) (*http.Request, error) { +// NewListAllCliniciansRequest generates requests for ListAllClinicians +func NewListAllCliniciansRequest(server string, params *ListAllCliniciansParams) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/clinicians", pathParam0) + operationPath := fmt.Sprintf("/v1/clinicians") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1060,90 +1284,76 @@ func NewListCliniciansRequest(server string, clinicId ClinicId, params *ListClin return nil, err } - queryValues := queryURL.Query() + if params != nil { + queryValues := queryURL.Query() - if params.Search != nil { + if params.Offset != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } - } + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } - if params.Offset != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } } - } - - if params.Limit != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.CreatedTimeStart != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "createdTimeStart", runtime.ParamLocationQuery, *params.CreatedTimeStart); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } - } - - } - - if params.Email != nil { - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "email", runtime.ParamLocationQuery, *params.Email); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } } - } - - if params.Role != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "role", runtime.ParamLocationQuery, *params.Role); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) + if params.CreatedTimeEnd != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "createdTimeEnd", runtime.ParamLocationQuery, *params.CreatedTimeEnd); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } } } + } + queryURL.RawQuery = queryValues.Encode() } - queryURL.RawQuery = queryValues.Encode() - req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -1152,24 +1362,13 @@ func NewListCliniciansRequest(server string, clinicId ClinicId, params *ListClin return req, nil } -// NewCreateClinicianRequest calls the generic CreateClinician builder with application/json body -func NewCreateClinicianRequest(server string, clinicId ClinicId, body CreateClinicianJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreateClinicianRequestWithBody(server, clinicId, "application/json", bodyReader) -} - -// NewCreateClinicianRequestWithBody generates requests for CreateClinician with any type of body -func NewCreateClinicianRequestWithBody(server string, clinicId ClinicId, contentType string, body io.Reader) (*http.Request, error) { +// NewListClinicsForClinicianRequest generates requests for ListClinicsForClinician +func NewListClinicsForClinicianRequest(server string, userId UserId, params *ListClinicsForClinicianParams) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -1179,7 +1378,7 @@ func NewCreateClinicianRequestWithBody(server string, clinicId ClinicId, content return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/clinicians", pathParam0) + operationPath := fmt.Sprintf("/v1/clinicians/%s/clinics", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1189,30 +1388,59 @@ func NewCreateClinicianRequestWithBody(server string, clinicId ClinicId, content return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + if params != nil { + queryValues := queryURL.Query() + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeleteClinicianRequest generates requests for DeleteClinician -func NewDeleteClinicianRequest(server string, clinicId ClinicId, clinicianId ClinicianId) (*http.Request, error) { +// NewEnableNewClinicExperienceRequest generates requests for EnableNewClinicExperience +func NewEnableNewClinicExperienceRequest(server string, userId string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clinicianId", runtime.ParamLocationPath, clinicianId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -1222,7 +1450,7 @@ func NewDeleteClinicianRequest(server string, clinicId ClinicId, clinicianId Cli return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/clinicians/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/clinicians/%s/migrate", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1232,7 +1460,7 @@ func NewDeleteClinicianRequest(server string, clinicId ClinicId, clinicianId Cli return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("POST", queryURL.String(), nil) if err != nil { return nil, err } @@ -1240,30 +1468,16 @@ func NewDeleteClinicianRequest(server string, clinicId ClinicId, clinicianId Cli return req, nil } -// NewGetClinicianRequest generates requests for GetClinician -func NewGetClinicianRequest(server string, clinicId ClinicId, clinicianId ClinicianId) (*http.Request, error) { +// NewListClinicsRequest generates requests for ListClinics +func NewListClinicsRequest(server string, params *ListClinicsParams) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clinicianId", runtime.ParamLocationPath, clinicianId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/clinicians/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/clinics") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1273,6 +1487,108 @@ func NewGetClinicianRequest(server string, clinicId ClinicId, clinicianId Clinic return nil, err } + if params != nil { + queryValues := queryURL.Query() + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.ShareCode != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "shareCode", runtime.ParamLocationQuery, *params.ShareCode); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CreatedTimeStart != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "createdTimeStart", runtime.ParamLocationQuery, *params.CreatedTimeStart); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CreatedTimeEnd != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "createdTimeEnd", runtime.ParamLocationQuery, *params.CreatedTimeEnd); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.EhrEnabled != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ehrEnabled", runtime.ParamLocationQuery, *params.EhrEnabled); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err @@ -1281,41 +1597,27 @@ func NewGetClinicianRequest(server string, clinicId ClinicId, clinicianId Clinic return req, nil } -// NewUpdateClinicianRequest calls the generic UpdateClinician builder with application/json body -func NewUpdateClinicianRequest(server string, clinicId ClinicId, clinicianId ClinicianId, body UpdateClinicianJSONRequestBody) (*http.Request, error) { +// NewCreateClinicRequest calls the generic CreateClinic builder with application/json body +func NewCreateClinicRequest(server string, body CreateClinicJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdateClinicianRequestWithBody(server, clinicId, clinicianId, "application/json", bodyReader) + return NewCreateClinicRequestWithBody(server, "application/json", bodyReader) } -// NewUpdateClinicianRequestWithBody generates requests for UpdateClinician with any type of body -func NewUpdateClinicianRequestWithBody(server string, clinicId ClinicId, clinicianId ClinicianId, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateClinicRequestWithBody generates requests for CreateClinic with any type of body +func NewCreateClinicRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { var err error - var pathParam0 string - - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clinicianId", runtime.ParamLocationPath, clinicianId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/clinicians/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/clinics") if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1325,7 +1627,7 @@ func NewUpdateClinicianRequestWithBody(server string, clinicId ClinicId, clinici return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), body) + req, err := http.NewRequest("POST", queryURL.String(), body) if err != nil { return nil, err } @@ -1335,20 +1637,13 @@ func NewUpdateClinicianRequestWithBody(server string, clinicId ClinicId, clinici return req, nil } -// NewDeleteInvitedClinicianRequest generates requests for DeleteInvitedClinician -func NewDeleteInvitedClinicianRequest(server string, clinicId ClinicId, inviteId InviteId) (*http.Request, error) { +// NewGetClinicByShareCodeRequest generates requests for GetClinicByShareCode +func NewGetClinicByShareCodeRequest(server string, shareCode string) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) - if err != nil { - return nil, err - } - - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "inviteId", runtime.ParamLocationPath, inviteId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "shareCode", runtime.ParamLocationPath, shareCode) if err != nil { return nil, err } @@ -1358,7 +1653,7 @@ func NewDeleteInvitedClinicianRequest(server string, clinicId ClinicId, inviteId return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/invites/clinicians/%s/clinician", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/clinics/share_code/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1368,7 +1663,7 @@ func NewDeleteInvitedClinicianRequest(server string, clinicId ClinicId, inviteId return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -1376,8 +1671,8 @@ func NewDeleteInvitedClinicianRequest(server string, clinicId ClinicId, inviteId return req, nil } -// NewGetInvitedClinicianRequest generates requests for GetInvitedClinician -func NewGetInvitedClinicianRequest(server string, clinicId ClinicId, inviteId InviteId) (*http.Request, error) { +// NewDeleteClinicRequest generates requests for DeleteClinic +func NewDeleteClinicRequest(server string, clinicId ClinicId) (*http.Request, error) { var err error var pathParam0 string @@ -1387,19 +1682,12 @@ func NewGetInvitedClinicianRequest(server string, clinicId ClinicId, inviteId In return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "inviteId", runtime.ParamLocationPath, inviteId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/invites/clinicians/%s/clinician", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/clinics/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1409,7 +1697,7 @@ func NewGetInvitedClinicianRequest(server string, clinicId ClinicId, inviteId In return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } @@ -1417,19 +1705,8 @@ func NewGetInvitedClinicianRequest(server string, clinicId ClinicId, inviteId In return req, nil } -// NewAssociateClinicianToUserRequest calls the generic AssociateClinicianToUser builder with application/json body -func NewAssociateClinicianToUserRequest(server string, clinicId ClinicId, inviteId InviteId, body AssociateClinicianToUserJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewAssociateClinicianToUserRequestWithBody(server, clinicId, inviteId, "application/json", bodyReader) -} - -// NewAssociateClinicianToUserRequestWithBody generates requests for AssociateClinicianToUser with any type of body -func NewAssociateClinicianToUserRequestWithBody(server string, clinicId ClinicId, inviteId InviteId, contentType string, body io.Reader) (*http.Request, error) { +// NewGetClinicRequest generates requests for GetClinic +func NewGetClinicRequest(server string, clinicId ClinicId) (*http.Request, error) { var err error var pathParam0 string @@ -1439,19 +1716,12 @@ func NewAssociateClinicianToUserRequestWithBody(server string, clinicId ClinicId return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "inviteId", runtime.ParamLocationPath, inviteId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/invites/clinicians/%s/clinician", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/clinics/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1461,18 +1731,27 @@ func NewAssociateClinicianToUserRequestWithBody(server string, clinicId ClinicId return nil, err } - req, err := http.NewRequest("PATCH", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewTriggerInitialMigrationRequest generates requests for TriggerInitialMigration -func NewTriggerInitialMigrationRequest(server string, clinicId string) (*http.Request, error) { +// NewUpdateClinicRequest calls the generic UpdateClinic builder with application/json body +func NewUpdateClinicRequest(server string, clinicId ClinicId, body UpdateClinicJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateClinicRequestWithBody(server, clinicId, "application/json", bodyReader) +} + +// NewUpdateClinicRequestWithBody generates requests for UpdateClinic with any type of body +func NewUpdateClinicRequestWithBody(server string, clinicId ClinicId, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -1487,7 +1766,7 @@ func NewTriggerInitialMigrationRequest(server string, clinicId string) (*http.Re return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/migrate", pathParam0) + operationPath := fmt.Sprintf("/v1/clinics/%s", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1497,16 +1776,18 @@ func NewTriggerInitialMigrationRequest(server string, clinicId string) (*http.Re return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), nil) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -// NewListMigrationsRequest generates requests for ListMigrations -func NewListMigrationsRequest(server string, clinicId string) (*http.Request, error) { +// NewListCliniciansRequest generates requests for ListClinicians +func NewListCliniciansRequest(server string, clinicId ClinicId, params *ListCliniciansParams) (*http.Request, error) { var err error var pathParam0 string @@ -1521,7 +1802,7 @@ func NewListMigrationsRequest(server string, clinicId string) (*http.Request, er return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/migrations", pathParam0) + operationPath := fmt.Sprintf("/v1/clinics/%s/clinicians", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1531,27 +1812,113 @@ func NewListMigrationsRequest(server string, clinicId string) (*http.Request, er return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) - if err != nil { - return nil, err - } + if params != nil { + queryValues := queryURL.Query() - return req, nil -} + if params.Search != nil { -// NewMigrateLegacyClinicianPatientsRequest calls the generic MigrateLegacyClinicianPatients builder with application/json body -func NewMigrateLegacyClinicianPatientsRequest(server string, clinicId string, body MigrateLegacyClinicianPatientsJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Email != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "email", runtime.ParamLocationQuery, *params.Email); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Role != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "role", runtime.ParamLocationQuery, *params.Role); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreateClinicianRequest calls the generic CreateClinician builder with application/json body +func NewCreateClinicianRequest(server string, clinicId ClinicId, body CreateClinicianJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } bodyReader = bytes.NewReader(buf) - return NewMigrateLegacyClinicianPatientsRequestWithBody(server, clinicId, "application/json", bodyReader) + return NewCreateClinicianRequestWithBody(server, clinicId, "application/json", bodyReader) } -// NewMigrateLegacyClinicianPatientsRequestWithBody generates requests for MigrateLegacyClinicianPatients with any type of body -func NewMigrateLegacyClinicianPatientsRequestWithBody(server string, clinicId string, contentType string, body io.Reader) (*http.Request, error) { +// NewCreateClinicianRequestWithBody generates requests for CreateClinician with any type of body +func NewCreateClinicianRequestWithBody(server string, clinicId ClinicId, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -1566,7 +1933,7 @@ func NewMigrateLegacyClinicianPatientsRequestWithBody(server string, clinicId st return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/migrations", pathParam0) + operationPath := fmt.Sprintf("/v1/clinics/%s/clinicians", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1586,8 +1953,8 @@ func NewMigrateLegacyClinicianPatientsRequestWithBody(server string, clinicId st return req, nil } -// NewGetMigrationRequest generates requests for GetMigration -func NewGetMigrationRequest(server string, clinicId Id, userId UserId) (*http.Request, error) { +// NewDeleteClinicianRequest generates requests for DeleteClinician +func NewDeleteClinicianRequest(server string, clinicId ClinicId, clinicianId ClinicianId) (*http.Request, error) { var err error var pathParam0 string @@ -1599,7 +1966,7 @@ func NewGetMigrationRequest(server string, clinicId Id, userId UserId) (*http.Re var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clinicianId", runtime.ParamLocationPath, clinicianId) if err != nil { return nil, err } @@ -1609,7 +1976,7 @@ func NewGetMigrationRequest(server string, clinicId Id, userId UserId) (*http.Re return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/migrations/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/clinics/%s/clinicians/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1619,7 +1986,7 @@ func NewGetMigrationRequest(server string, clinicId Id, userId UserId) (*http.Re return nil, err } - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) if err != nil { return nil, err } @@ -1627,19 +1994,8 @@ func NewGetMigrationRequest(server string, clinicId Id, userId UserId) (*http.Re return req, nil } -// NewUpdateMigrationRequest calls the generic UpdateMigration builder with application/json body -func NewUpdateMigrationRequest(server string, clinicId Id, userId UserId, body UpdateMigrationJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdateMigrationRequestWithBody(server, clinicId, userId, "application/json", bodyReader) -} - -// NewUpdateMigrationRequestWithBody generates requests for UpdateMigration with any type of body -func NewUpdateMigrationRequestWithBody(server string, clinicId Id, userId UserId, contentType string, body io.Reader) (*http.Request, error) { +// NewGetClinicianRequest generates requests for GetClinician +func NewGetClinicianRequest(server string, clinicId ClinicId, clinicianId ClinicianId) (*http.Request, error) { var err error var pathParam0 string @@ -1651,7 +2007,7 @@ func NewUpdateMigrationRequestWithBody(server string, clinicId Id, userId UserId var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clinicianId", runtime.ParamLocationPath, clinicianId) if err != nil { return nil, err } @@ -1661,7 +2017,7 @@ func NewUpdateMigrationRequestWithBody(server string, clinicId Id, userId UserId return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/migrations/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/clinics/%s/clinicians/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1671,18 +2027,27 @@ func NewUpdateMigrationRequestWithBody(server string, clinicId Id, userId UserId return nil, err } - req, err := http.NewRequest("PATCH", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewListPatientsRequest generates requests for ListPatients -func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatientsParams) (*http.Request, error) { +// NewUpdateClinicianRequest calls the generic UpdateClinician builder with application/json body +func NewUpdateClinicianRequest(server string, clinicId ClinicId, clinicianId ClinicianId, body UpdateClinicianJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateClinicianRequestWithBody(server, clinicId, clinicianId, "application/json", bodyReader) +} + +// NewUpdateClinicianRequestWithBody generates requests for UpdateClinician with any type of body +func NewUpdateClinicianRequestWithBody(server string, clinicId ClinicId, clinicianId ClinicianId, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -1692,12 +2057,19 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien return nil, err } + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "clinicianId", runtime.ParamLocationPath, clinicianId) + if err != nil { + return nil, err + } + serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/patients", pathParam0) + operationPath := fmt.Sprintf("/v1/clinics/%s/clinicians/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1707,95 +2079,18 @@ func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatien return nil, err } - queryValues := queryURL.Query() - - if params.Search != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Offset != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Limit != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - if params.Sort != nil { - - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort", runtime.ParamLocationQuery, *params.Sort); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } - - } - - queryURL.RawQuery = queryValues.Encode() - - req, err := http.NewRequest("GET", queryURL.String(), nil) + req, err := http.NewRequest("PUT", queryURL.String(), body) if err != nil { return nil, err } - return req, nil -} + req.Header.Add("Content-Type", contentType) -// NewCreatePatientAccountRequest calls the generic CreatePatientAccount builder with application/json body -func NewCreatePatientAccountRequest(server string, clinicId ClinicId, body CreatePatientAccountJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewCreatePatientAccountRequestWithBody(server, clinicId, "application/json", bodyReader) + return req, nil } -// NewCreatePatientAccountRequestWithBody generates requests for CreatePatientAccount with any type of body -func NewCreatePatientAccountRequestWithBody(server string, clinicId ClinicId, contentType string, body io.Reader) (*http.Request, error) { +// NewSyncEHRDataRequest generates requests for SyncEHRData +func NewSyncEHRDataRequest(server string, clinicId ClinicId) (*http.Request, error) { var err error var pathParam0 string @@ -1810,7 +2105,7 @@ func NewCreatePatientAccountRequestWithBody(server string, clinicId ClinicId, co return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/patients", pathParam0) + operationPath := fmt.Sprintf("/v1/clinics/%s/ehr/sync", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1820,18 +2115,16 @@ func NewCreatePatientAccountRequestWithBody(server string, clinicId ClinicId, co return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("POST", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewDeletePatientRequest generates requests for DeletePatient -func NewDeletePatientRequest(server string, clinicId ClinicId, patientId PatientId) (*http.Request, error) { +// NewDeleteInvitedClinicianRequest generates requests for DeleteInvitedClinician +func NewDeleteInvitedClinicianRequest(server string, clinicId ClinicId, inviteId InviteId) (*http.Request, error) { var err error var pathParam0 string @@ -1843,7 +2136,7 @@ func NewDeletePatientRequest(server string, clinicId ClinicId, patientId Patient var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "inviteId", runtime.ParamLocationPath, inviteId) if err != nil { return nil, err } @@ -1853,7 +2146,7 @@ func NewDeletePatientRequest(server string, clinicId ClinicId, patientId Patient return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/clinics/%s/invites/clinicians/%s/clinician", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1871,8 +2164,8 @@ func NewDeletePatientRequest(server string, clinicId ClinicId, patientId Patient return req, nil } -// NewGetPatientRequest generates requests for GetPatient -func NewGetPatientRequest(server string, clinicId ClinicId, patientId PatientId) (*http.Request, error) { +// NewGetInvitedClinicianRequest generates requests for GetInvitedClinician +func NewGetInvitedClinicianRequest(server string, clinicId ClinicId, inviteId InviteId) (*http.Request, error) { var err error var pathParam0 string @@ -1884,7 +2177,7 @@ func NewGetPatientRequest(server string, clinicId ClinicId, patientId PatientId) var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "inviteId", runtime.ParamLocationPath, inviteId) if err != nil { return nil, err } @@ -1894,7 +2187,7 @@ func NewGetPatientRequest(server string, clinicId ClinicId, patientId PatientId) return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/clinics/%s/invites/clinicians/%s/clinician", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1912,19 +2205,19 @@ func NewGetPatientRequest(server string, clinicId ClinicId, patientId PatientId) return req, nil } -// NewCreatePatientFromUserRequest calls the generic CreatePatientFromUser builder with application/json body -func NewCreatePatientFromUserRequest(server string, clinicId ClinicId, patientId PatientId, body CreatePatientFromUserJSONRequestBody) (*http.Request, error) { +// NewAssociateClinicianToUserRequest calls the generic AssociateClinicianToUser builder with application/json body +func NewAssociateClinicianToUserRequest(server string, clinicId ClinicId, inviteId InviteId, body AssociateClinicianToUserJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewCreatePatientFromUserRequestWithBody(server, clinicId, patientId, "application/json", bodyReader) + return NewAssociateClinicianToUserRequestWithBody(server, clinicId, inviteId, "application/json", bodyReader) } -// NewCreatePatientFromUserRequestWithBody generates requests for CreatePatientFromUser with any type of body -func NewCreatePatientFromUserRequestWithBody(server string, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader) (*http.Request, error) { +// NewAssociateClinicianToUserRequestWithBody generates requests for AssociateClinicianToUser with any type of body +func NewAssociateClinicianToUserRequestWithBody(server string, clinicId ClinicId, inviteId InviteId, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -1936,7 +2229,7 @@ func NewCreatePatientFromUserRequestWithBody(server string, clinicId ClinicId, p var pathParam1 string - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "inviteId", runtime.ParamLocationPath, inviteId) if err != nil { return nil, err } @@ -1946,7 +2239,7 @@ func NewCreatePatientFromUserRequestWithBody(server string, clinicId ClinicId, p return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/clinics/%s/invites/clinicians/%s/clinician", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -1956,7 +2249,7 @@ func NewCreatePatientFromUserRequestWithBody(server string, clinicId ClinicId, p return nil, err } - req, err := http.NewRequest("POST", queryURL.String(), body) + req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } @@ -1966,19 +2259,8 @@ func NewCreatePatientFromUserRequestWithBody(server string, clinicId ClinicId, p return req, nil } -// NewUpdatePatientRequest calls the generic UpdatePatient builder with application/json body -func NewUpdatePatientRequest(server string, clinicId ClinicId, patientId PatientId, body UpdatePatientJSONRequestBody) (*http.Request, error) { - var bodyReader io.Reader - buf, err := json.Marshal(body) - if err != nil { - return nil, err - } - bodyReader = bytes.NewReader(buf) - return NewUpdatePatientRequestWithBody(server, clinicId, patientId, "application/json", bodyReader) -} - -// NewUpdatePatientRequestWithBody generates requests for UpdatePatient with any type of body -func NewUpdatePatientRequestWithBody(server string, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader) (*http.Request, error) { +// NewListMembershipRestrictionsRequest generates requests for ListMembershipRestrictions +func NewListMembershipRestrictionsRequest(server string, clinicId ClinicId) (*http.Request, error) { var err error var pathParam0 string @@ -1988,19 +2270,12 @@ func NewUpdatePatientRequestWithBody(server string, clinicId ClinicId, patientId return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/clinics/%s/membership_restrictions", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2010,29 +2285,27 @@ func NewUpdatePatientRequestWithBody(server string, clinicId ClinicId, patientId return nil, err } - req, err := http.NewRequest("PUT", queryURL.String(), body) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } - req.Header.Add("Content-Type", contentType) - return req, nil } -// NewUpdatePatientPermissionsRequest calls the generic UpdatePatientPermissions builder with application/json body -func NewUpdatePatientPermissionsRequest(server string, clinicId ClinicId, patientId PatientId, body UpdatePatientPermissionsJSONRequestBody) (*http.Request, error) { +// NewUpdateMembershipRestrictionsRequest calls the generic UpdateMembershipRestrictions builder with application/json body +func NewUpdateMembershipRestrictionsRequest(server string, clinicId ClinicId, body UpdateMembershipRestrictionsJSONRequestBody) (*http.Request, error) { var bodyReader io.Reader buf, err := json.Marshal(body) if err != nil { return nil, err } bodyReader = bytes.NewReader(buf) - return NewUpdatePatientPermissionsRequestWithBody(server, clinicId, patientId, "application/json", bodyReader) + return NewUpdateMembershipRestrictionsRequestWithBody(server, clinicId, "application/json", bodyReader) } -// NewUpdatePatientPermissionsRequestWithBody generates requests for UpdatePatientPermissions with any type of body -func NewUpdatePatientPermissionsRequestWithBody(server string, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader) (*http.Request, error) { +// NewUpdateMembershipRestrictionsRequestWithBody generates requests for UpdateMembershipRestrictions with any type of body +func NewUpdateMembershipRestrictionsRequestWithBody(server string, clinicId ClinicId, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -2042,19 +2315,12 @@ func NewUpdatePatientPermissionsRequestWithBody(server string, clinicId ClinicId return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) - if err != nil { - return nil, err - } - serverURL, err := url.Parse(server) if err != nil { return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s/permissions", pathParam0, pathParam1) + operationPath := fmt.Sprintf("/v1/clinics/%s/membership_restrictions", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2074,8 +2340,19 @@ func NewUpdatePatientPermissionsRequestWithBody(server string, clinicId ClinicId return req, nil } -// NewDeletePatientPermissionRequest generates requests for DeletePatientPermission -func NewDeletePatientPermissionRequest(server string, clinicId ClinicId, patientId PatientId, permission string) (*http.Request, error) { +// NewTriggerInitialMigrationRequest calls the generic TriggerInitialMigration builder with application/json body +func NewTriggerInitialMigrationRequest(server string, clinicId string, body TriggerInitialMigrationJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewTriggerInitialMigrationRequestWithBody(server, clinicId, "application/json", bodyReader) +} + +// NewTriggerInitialMigrationRequestWithBody generates requests for TriggerInitialMigration with any type of body +func NewTriggerInitialMigrationRequestWithBody(server string, clinicId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string @@ -2085,16 +2362,38 @@ func NewDeletePatientPermissionRequest(server string, clinicId ClinicId, patient return nil, err } - var pathParam1 string - - pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + serverURL, err := url.Parse(server) if err != nil { return nil, err } - var pathParam2 string + operationPath := fmt.Sprintf("/v1/clinics/%s/migrate", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - pathParam2, err = runtime.StyleParamWithLocation("simple", false, "permission", runtime.ParamLocationPath, permission) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewListMigrationsRequest generates requests for ListMigrations +func NewListMigrationsRequest(server string, clinicId string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) if err != nil { return nil, err } @@ -2104,7 +2403,7 @@ func NewDeletePatientPermissionRequest(server string, clinicId ClinicId, patient return nil, err } - operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s/permissions/%s", pathParam0, pathParam1, pathParam2) + operationPath := fmt.Sprintf("/v1/clinics/%s/migrations", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2114,7 +2413,7 @@ func NewDeletePatientPermissionRequest(server string, clinicId ClinicId, patient return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { return nil, err } @@ -2122,13 +2421,24 @@ func NewDeletePatientPermissionRequest(server string, clinicId ClinicId, patient return req, nil } -// NewListClinicsForPatientRequest generates requests for ListClinicsForPatient -func NewListClinicsForPatientRequest(server string, userId UserId, params *ListClinicsForPatientParams) (*http.Request, error) { +// NewMigrateLegacyClinicianPatientsRequest calls the generic MigrateLegacyClinicianPatients builder with application/json body +func NewMigrateLegacyClinicianPatientsRequest(server string, clinicId string, body MigrateLegacyClinicianPatientsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewMigrateLegacyClinicianPatientsRequestWithBody(server, clinicId, "application/json", bodyReader) +} + +// NewMigrateLegacyClinicianPatientsRequestWithBody generates requests for MigrateLegacyClinicianPatients with any type of body +func NewMigrateLegacyClinicianPatientsRequestWithBody(server string, clinicId string, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) if err != nil { return nil, err } @@ -2138,7 +2448,7 @@ func NewListClinicsForPatientRequest(server string, userId UserId, params *ListC return nil, err } - operationPath := fmt.Sprintf("/v1/patients/%s/clinics", pathParam0) + operationPath := fmt.Sprintf("/v1/clinics/%s/migrations", pathParam0) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2148,41 +2458,48 @@ func NewListClinicsForPatientRequest(server string, userId UserId, params *ListC return nil, err } - queryValues := queryURL.Query() + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) - if params.Offset != nil { + return req, nil +} - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } +// NewGetMigrationRequest generates requests for GetMigration +func NewGetMigrationRequest(server string, clinicId Id, userId UserId) (*http.Request, error) { + var err error + + var pathParam0 string + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err } - if params.Limit != nil { + var pathParam1 string - if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { - return nil, err - } else if parsed, err := url.ParseQuery(queryFrag); err != nil { - return nil, err - } else { - for k, v := range parsed { - for _, v2 := range v { - queryValues.Add(k, v2) - } - } - } + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + operationPath := fmt.Sprintf("/v1/clinics/%s/migrations/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath } - queryURL.RawQuery = queryValues.Encode() + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } req, err := http.NewRequest("GET", queryURL.String(), nil) if err != nil { @@ -2192,13 +2509,31 @@ func NewListClinicsForPatientRequest(server string, userId UserId, params *ListC return req, nil } -// NewDeleteUserFromClinicsRequest generates requests for DeleteUserFromClinics -func NewDeleteUserFromClinicsRequest(server string, userId UserId) (*http.Request, error) { +// NewUpdateMigrationRequest calls the generic UpdateMigration builder with application/json body +func NewUpdateMigrationRequest(server string, clinicId Id, userId UserId, body UpdateMigrationJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateMigrationRequestWithBody(server, clinicId, userId, "application/json", bodyReader) +} + +// NewUpdateMigrationRequestWithBody generates requests for UpdateMigration with any type of body +func NewUpdateMigrationRequestWithBody(server string, clinicId Id, userId UserId, contentType string, body io.Reader) (*http.Request, error) { var err error var pathParam0 string - pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) if err != nil { return nil, err } @@ -2208,7 +2543,7 @@ func NewDeleteUserFromClinicsRequest(server string, userId UserId) (*http.Reques return nil, err } - operationPath := fmt.Sprintf("/v1/users/%s/clinics", pathParam0) + operationPath := fmt.Sprintf("/v1/clinics/%s/migrations/%s", pathParam0, pathParam1) if operationPath[0] == '/' { operationPath = "." + operationPath } @@ -2218,178 +2553,3108 @@ func NewDeleteUserFromClinicsRequest(server string, userId UserId) (*http.Reques return nil, err } - req, err := http.NewRequest("DELETE", queryURL.String(), nil) + req, err := http.NewRequest("PATCH", queryURL.String(), body) if err != nil { return nil, err } + req.Header.Add("Content-Type", contentType) + return req, nil } -func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { - for _, r := range c.RequestEditors { - if err := r(ctx, req); err != nil { - return err - } - } - for _, r := range additionalEditors { - if err := r(ctx, req); err != nil { - return err - } +// NewCreatePatientTagRequest calls the generic CreatePatientTag builder with application/json body +func NewCreatePatientTagRequest(server string, clinicId ClinicId, body CreatePatientTagJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err } - return nil + bodyReader = bytes.NewReader(buf) + return NewCreatePatientTagRequestWithBody(server, clinicId, "application/json", bodyReader) } -// ClientWithResponses builds on ClientInterface to offer response payloads -type ClientWithResponses struct { - ClientInterface -} +// NewCreatePatientTagRequestWithBody generates requests for CreatePatientTag with any type of body +func NewCreatePatientTagRequestWithBody(server string, clinicId ClinicId, contentType string, body io.Reader) (*http.Request, error) { + var err error -// NewClientWithResponses creates a new ClientWithResponses, which wraps -// Client with return type handling -func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { - client, err := NewClient(server, opts...) + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) if err != nil { return nil, err } - return &ClientWithResponses{client}, nil -} -// WithBaseURL overrides the baseURL. -func WithBaseURL(baseURL string) ClientOption { - return func(c *Client) error { - newBaseURL, err := url.Parse(baseURL) - if err != nil { - return err - } - c.Server = newBaseURL.String() - return nil + serverURL, err := url.Parse(server) + if err != nil { + return nil, err } -} -// ClientWithResponsesInterface is the interface specification for the client with responses above. -type ClientWithResponsesInterface interface { - // ListClinicsForClinician request - ListClinicsForClinicianWithResponse(ctx context.Context, userId UserId, params *ListClinicsForClinicianParams, reqEditors ...RequestEditorFn) (*ListClinicsForClinicianResponse, error) + operationPath := fmt.Sprintf("/v1/clinics/%s/patient_tags", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // EnableNewClinicExperience request - EnableNewClinicExperienceWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*EnableNewClinicExperienceResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // ListClinics request - ListClinicsWithResponse(ctx context.Context, params *ListClinicsParams, reqEditors ...RequestEditorFn) (*ListClinicsResponse, error) + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } - // CreateClinic request with any body - CreateClinicWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateClinicResponse, error) + req.Header.Add("Content-Type", contentType) - CreateClinicWithResponse(ctx context.Context, body CreateClinicJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateClinicResponse, error) + return req, nil +} - // GetClinicByShareCode request - GetClinicByShareCodeWithResponse(ctx context.Context, shareCode string, reqEditors ...RequestEditorFn) (*GetClinicByShareCodeResponse, error) +// NewDeletePatientTagRequest generates requests for DeletePatientTag +func NewDeletePatientTagRequest(server string, clinicId ClinicId, patientTagId PatientTagId) (*http.Request, error) { + var err error - // GetClinic request - GetClinicWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*GetClinicResponse, error) + var pathParam0 string - // UpdateClinic request with any body - UpdateClinicWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClinicResponse, error) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } - UpdateClinicWithResponse(ctx context.Context, clinicId ClinicId, body UpdateClinicJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateClinicResponse, error) + var pathParam1 string - // ListClinicians request - ListCliniciansWithResponse(ctx context.Context, clinicId ClinicId, params *ListCliniciansParams, reqEditors ...RequestEditorFn) (*ListCliniciansResponse, error) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientTagId", runtime.ParamLocationPath, patientTagId) + if err != nil { + return nil, err + } - // CreateClinician request with any body - CreateClinicianWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateClinicianResponse, error) + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } - CreateClinicianWithResponse(ctx context.Context, clinicId ClinicId, body CreateClinicianJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateClinicianResponse, error) + operationPath := fmt.Sprintf("/v1/clinics/%s/patient_tags/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } - // DeleteClinician request - DeleteClinicianWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, reqEditors ...RequestEditorFn) (*DeleteClinicianResponse, error) + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } - // GetClinician request - GetClinicianWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, reqEditors ...RequestEditorFn) (*GetClinicianResponse, error) + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } - // UpdateClinician request with any body - UpdateClinicianWithBodyWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClinicianResponse, error) + return req, nil +} - UpdateClinicianWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, body UpdateClinicianJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateClinicianResponse, error) +// NewUpdatePatientTagRequest calls the generic UpdatePatientTag builder with application/json body +func NewUpdatePatientTagRequest(server string, clinicId ClinicId, patientTagId PatientTagId, body UpdatePatientTagJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdatePatientTagRequestWithBody(server, clinicId, patientTagId, "application/json", bodyReader) +} - // DeleteInvitedClinician request - DeleteInvitedClinicianWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, reqEditors ...RequestEditorFn) (*DeleteInvitedClinicianResponse, error) +// NewUpdatePatientTagRequestWithBody generates requests for UpdatePatientTag with any type of body +func NewUpdatePatientTagRequestWithBody(server string, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader) (*http.Request, error) { + var err error - // GetInvitedClinician request - GetInvitedClinicianWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, reqEditors ...RequestEditorFn) (*GetInvitedClinicianResponse, error) + var pathParam0 string - // AssociateClinicianToUser request with any body - AssociateClinicianToUserWithBodyWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AssociateClinicianToUserResponse, error) + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } - AssociateClinicianToUserWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, body AssociateClinicianToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*AssociateClinicianToUserResponse, error) + var pathParam1 string - // TriggerInitialMigration request - TriggerInitialMigrationWithResponse(ctx context.Context, clinicId string, reqEditors ...RequestEditorFn) (*TriggerInitialMigrationResponse, error) + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientTagId", runtime.ParamLocationPath, patientTagId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/patient_tags/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewListPatientsRequest generates requests for ListPatients +func NewListPatientsRequest(server string, clinicId ClinicId, params *ListPatientsParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/patients", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Search != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "search", runtime.ParamLocationQuery, *params.Search); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Sort != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort", runtime.ParamLocationQuery, *params.Sort); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.SortType != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sortType", runtime.ParamLocationQuery, *params.SortType); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Period != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "period", runtime.ParamLocationQuery, *params.Period); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeCGMUsePercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeCGMUsePercent", runtime.ParamLocationQuery, *params.CgmTimeCGMUsePercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInVeryLowPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryLowPercent", runtime.ParamLocationQuery, *params.CgmTimeInVeryLowPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInLowPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInLowPercent", runtime.ParamLocationQuery, *params.CgmTimeInLowPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInTargetPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInTargetPercent", runtime.ParamLocationQuery, *params.CgmTimeInTargetPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInHighPercent", runtime.ParamLocationQuery, *params.CgmTimeInHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInVeryHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryHighPercent", runtime.ParamLocationQuery, *params.CgmTimeInVeryHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeCGMUseRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeCGMUseRecords", runtime.ParamLocationQuery, *params.CgmTimeCGMUseRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInVeryLowRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryLowRecords", runtime.ParamLocationQuery, *params.CgmTimeInVeryLowRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInLowRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInLowRecords", runtime.ParamLocationQuery, *params.CgmTimeInLowRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInTargetRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInTargetRecords", runtime.ParamLocationQuery, *params.CgmTimeInTargetRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInHighRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInHighRecords", runtime.ParamLocationQuery, *params.CgmTimeInHighRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTimeInVeryHighRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.timeInVeryHighRecords", runtime.ParamLocationQuery, *params.CgmTimeInVeryHighRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmAverageDailyRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.averageDailyRecords", runtime.ParamLocationQuery, *params.CgmAverageDailyRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmTotalRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.totalRecords", runtime.ParamLocationQuery, *params.CgmTotalRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmLastUploadDateFrom != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.lastUploadDateFrom", runtime.ParamLocationQuery, *params.CgmLastUploadDateFrom); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.CgmLastUploadDateTo != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "cgm.lastUploadDateTo", runtime.ParamLocationQuery, *params.CgmLastUploadDateTo); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInVeryLowPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryLowPercent", runtime.ParamLocationQuery, *params.BgmTimeInVeryLowPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInLowPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInLowPercent", runtime.ParamLocationQuery, *params.BgmTimeInLowPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInTargetPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInTargetPercent", runtime.ParamLocationQuery, *params.BgmTimeInTargetPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInHighPercent", runtime.ParamLocationQuery, *params.BgmTimeInHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInVeryHighPercent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryHighPercent", runtime.ParamLocationQuery, *params.BgmTimeInVeryHighPercent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInVeryLowRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryLowRecords", runtime.ParamLocationQuery, *params.BgmTimeInVeryLowRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInLowRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInLowRecords", runtime.ParamLocationQuery, *params.BgmTimeInLowRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInTargetRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInTargetRecords", runtime.ParamLocationQuery, *params.BgmTimeInTargetRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInHighRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInHighRecords", runtime.ParamLocationQuery, *params.BgmTimeInHighRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTimeInVeryHighRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.timeInVeryHighRecords", runtime.ParamLocationQuery, *params.BgmTimeInVeryHighRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmAverageDailyRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.averageDailyRecords", runtime.ParamLocationQuery, *params.BgmAverageDailyRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmTotalRecords != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.totalRecords", runtime.ParamLocationQuery, *params.BgmTotalRecords); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmLastUploadDateFrom != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.lastUploadDateFrom", runtime.ParamLocationQuery, *params.BgmLastUploadDateFrom); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.BgmLastUploadDateTo != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "bgm.lastUploadDateTo", runtime.ParamLocationQuery, *params.BgmLastUploadDateTo); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Tags != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", false, "tags", runtime.ParamLocationQuery, *params.Tags); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreatePatientAccountRequest calls the generic CreatePatientAccount builder with application/json body +func NewCreatePatientAccountRequest(server string, clinicId ClinicId, body CreatePatientAccountJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreatePatientAccountRequestWithBody(server, clinicId, "application/json", bodyReader) +} + +// NewCreatePatientAccountRequestWithBody generates requests for CreatePatientAccount with any type of body +func NewCreatePatientAccountRequestWithBody(server string, clinicId ClinicId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/patients", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewAssignPatientTagToClinicPatientsRequest calls the generic AssignPatientTagToClinicPatients builder with application/json body +func NewAssignPatientTagToClinicPatientsRequest(server string, clinicId ClinicId, patientTagId PatientTagId, body AssignPatientTagToClinicPatientsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewAssignPatientTagToClinicPatientsRequestWithBody(server, clinicId, patientTagId, "application/json", bodyReader) +} + +// NewAssignPatientTagToClinicPatientsRequestWithBody generates requests for AssignPatientTagToClinicPatients with any type of body +func NewAssignPatientTagToClinicPatientsRequestWithBody(server string, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientTagId", runtime.ParamLocationPath, patientTagId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/patients/assign_tag/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeletePatientTagFromClinicPatientsRequest calls the generic DeletePatientTagFromClinicPatients builder with application/json body +func NewDeletePatientTagFromClinicPatientsRequest(server string, clinicId ClinicId, patientTagId PatientTagId, body DeletePatientTagFromClinicPatientsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewDeletePatientTagFromClinicPatientsRequestWithBody(server, clinicId, patientTagId, "application/json", bodyReader) +} + +// NewDeletePatientTagFromClinicPatientsRequestWithBody generates requests for DeletePatientTagFromClinicPatients with any type of body +func NewDeletePatientTagFromClinicPatientsRequestWithBody(server string, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientTagId", runtime.ParamLocationPath, patientTagId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/patients/delete_tag/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeletePatientRequest generates requests for DeletePatient +func NewDeletePatientRequest(server string, clinicId ClinicId, patientId PatientId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetPatientRequest generates requests for GetPatient +func NewGetPatientRequest(server string, clinicId ClinicId, patientId PatientId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewCreatePatientFromUserRequest calls the generic CreatePatientFromUser builder with application/json body +func NewCreatePatientFromUserRequest(server string, clinicId ClinicId, patientId PatientId, body CreatePatientFromUserJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewCreatePatientFromUserRequestWithBody(server, clinicId, patientId, "application/json", bodyReader) +} + +// NewCreatePatientFromUserRequestWithBody generates requests for CreatePatientFromUser with any type of body +func NewCreatePatientFromUserRequestWithBody(server string, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewUpdatePatientRequest calls the generic UpdatePatient builder with application/json body +func NewUpdatePatientRequest(server string, clinicId ClinicId, patientId PatientId, body UpdatePatientJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdatePatientRequestWithBody(server, clinicId, patientId, "application/json", bodyReader) +} + +// NewUpdatePatientRequestWithBody generates requests for UpdatePatient with any type of body +func NewUpdatePatientRequestWithBody(server string, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewUpdatePatientPermissionsRequest calls the generic UpdatePatientPermissions builder with application/json body +func NewUpdatePatientPermissionsRequest(server string, clinicId ClinicId, patientId PatientId, body UpdatePatientPermissionsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdatePatientPermissionsRequestWithBody(server, clinicId, patientId, "application/json", bodyReader) +} + +// NewUpdatePatientPermissionsRequestWithBody generates requests for UpdatePatientPermissions with any type of body +func NewUpdatePatientPermissionsRequestWithBody(server string, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s/permissions", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewDeletePatientPermissionRequest generates requests for DeletePatientPermission +func NewDeletePatientPermissionRequest(server string, clinicId ClinicId, patientId PatientId, permission string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + if err != nil { + return nil, err + } + + var pathParam2 string + + pathParam2, err = runtime.StyleParamWithLocation("simple", false, "permission", runtime.ParamLocationPath, permission) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s/permissions/%s", pathParam0, pathParam1, pathParam2) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewSendDexcomConnectRequestRequest generates requests for SendDexcomConnectRequest +func NewSendDexcomConnectRequestRequest(server string, clinicId ClinicId, patientId PatientId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s/send_dexcom_connect_request", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewSendUploadReminderRequest generates requests for SendUploadReminder +func NewSendUploadReminderRequest(server string, clinicId ClinicId, patientId PatientId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + var pathParam1 string + + pathParam1, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/patients/%s/upload_reminder", pathParam0, pathParam1) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewGetEHRSettingsRequest generates requests for GetEHRSettings +func NewGetEHRSettingsRequest(server string, clinicId ClinicId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/settings/ehr", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateEHRSettingsRequest calls the generic UpdateEHRSettings builder with application/json body +func NewUpdateEHRSettingsRequest(server string, clinicId ClinicId, body UpdateEHRSettingsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateEHRSettingsRequestWithBody(server, clinicId, "application/json", bodyReader) +} + +// NewUpdateEHRSettingsRequestWithBody generates requests for UpdateEHRSettings with any type of body +func NewUpdateEHRSettingsRequestWithBody(server string, clinicId ClinicId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/settings/ehr", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewGetMRNSettingsRequest generates requests for GetMRNSettings +func NewGetMRNSettingsRequest(server string, clinicId ClinicId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/settings/mrn", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateMRNSettingsRequest calls the generic UpdateMRNSettings builder with application/json body +func NewUpdateMRNSettingsRequest(server string, clinicId ClinicId, body UpdateMRNSettingsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateMRNSettingsRequestWithBody(server, clinicId, "application/json", bodyReader) +} + +// NewUpdateMRNSettingsRequestWithBody generates requests for UpdateMRNSettings with any type of body +func NewUpdateMRNSettingsRequestWithBody(server string, clinicId ClinicId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/settings/mrn", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewUpdateSuppressedNotificationsRequest calls the generic UpdateSuppressedNotifications builder with application/json body +func NewUpdateSuppressedNotificationsRequest(server string, clinicId ClinicId, body UpdateSuppressedNotificationsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateSuppressedNotificationsRequestWithBody(server, clinicId, "application/json", bodyReader) +} + +// NewUpdateSuppressedNotificationsRequestWithBody generates requests for UpdateSuppressedNotifications with any type of body +func NewUpdateSuppressedNotificationsRequestWithBody(server string, clinicId ClinicId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/suppressed_notifications", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewUpdateTierRequest calls the generic UpdateTier builder with application/json body +func NewUpdateTierRequest(server string, clinicId ClinicId, body UpdateTierJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateTierRequestWithBody(server, clinicId, "application/json", bodyReader) +} + +// NewUpdateTierRequestWithBody generates requests for UpdateTier with any type of body +func NewUpdateTierRequestWithBody(server string, clinicId ClinicId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "clinicId", runtime.ParamLocationPath, clinicId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/clinics/%s/tier", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewUpdatePatientSummaryRequest calls the generic UpdatePatientSummary builder with application/json body +func NewUpdatePatientSummaryRequest(server string, patientId PatientId, body UpdatePatientSummaryJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdatePatientSummaryRequestWithBody(server, patientId, "application/json", bodyReader) +} + +// NewUpdatePatientSummaryRequestWithBody generates requests for UpdatePatientSummary with any type of body +func NewUpdatePatientSummaryRequestWithBody(server string, patientId PatientId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "patientId", runtime.ParamLocationPath, patientId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/patients/%s/summary", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewListClinicsForPatientRequest generates requests for ListClinicsForPatient +func NewListClinicsForPatientRequest(server string, userId UserId, params *ListClinicsForPatientParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/patients/%s/clinics", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Offset != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "offset", runtime.ParamLocationQuery, *params.Offset); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Limit != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdatePatientDataSourcesRequest calls the generic UpdatePatientDataSources builder with application/json body +func NewUpdatePatientDataSourcesRequest(server string, userId UserId, body UpdatePatientDataSourcesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdatePatientDataSourcesRequestWithBody(server, userId, "application/json", bodyReader) +} + +// NewUpdatePatientDataSourcesRequestWithBody generates requests for UpdatePatientDataSources with any type of body +func NewUpdatePatientDataSourcesRequestWithBody(server string, userId UserId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/patients/%s/data_sources", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewProcessEHRMessageRequest calls the generic ProcessEHRMessage builder with application/json body +func NewProcessEHRMessageRequest(server string, body ProcessEHRMessageJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewProcessEHRMessageRequestWithBody(server, "application/json", bodyReader) +} + +// NewProcessEHRMessageRequestWithBody generates requests for ProcessEHRMessage with any type of body +func NewProcessEHRMessageRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/redox") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewMatchClinicAndPatientRequest calls the generic MatchClinicAndPatient builder with application/json body +func NewMatchClinicAndPatientRequest(server string, body MatchClinicAndPatientJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewMatchClinicAndPatientRequestWithBody(server, "application/json", bodyReader) +} + +// NewMatchClinicAndPatientRequestWithBody generates requests for MatchClinicAndPatient with any type of body +func NewMatchClinicAndPatientRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/redox/match") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewVerifyEndpointRequest generates requests for VerifyEndpoint +func NewVerifyEndpointRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/redox/verify") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteUserFromClinicsRequest generates requests for DeleteUserFromClinics +func NewDeleteUserFromClinicsRequest(server string, userId UserId) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/users/%s/clinics", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewUpdateClinicUserDetailsRequest calls the generic UpdateClinicUserDetails builder with application/json body +func NewUpdateClinicUserDetailsRequest(server string, userId UserId, body UpdateClinicUserDetailsJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewUpdateClinicUserDetailsRequestWithBody(server, userId, "application/json", bodyReader) +} + +// NewUpdateClinicUserDetailsRequestWithBody generates requests for UpdateClinicUserDetails with any type of body +func NewUpdateClinicUserDetailsRequestWithBody(server string, userId UserId, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "userId", runtime.ParamLocationPath, userId) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v1/users/%s/clinics", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest("POST", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // ListAllClinicians request + ListAllCliniciansWithResponse(ctx context.Context, params *ListAllCliniciansParams, reqEditors ...RequestEditorFn) (*ListAllCliniciansResponse, error) + + // ListClinicsForClinician request + ListClinicsForClinicianWithResponse(ctx context.Context, userId UserId, params *ListClinicsForClinicianParams, reqEditors ...RequestEditorFn) (*ListClinicsForClinicianResponse, error) + + // EnableNewClinicExperience request + EnableNewClinicExperienceWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*EnableNewClinicExperienceResponse, error) + + // ListClinics request + ListClinicsWithResponse(ctx context.Context, params *ListClinicsParams, reqEditors ...RequestEditorFn) (*ListClinicsResponse, error) + + // CreateClinic request with any body + CreateClinicWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateClinicResponse, error) + + CreateClinicWithResponse(ctx context.Context, body CreateClinicJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateClinicResponse, error) + + // GetClinicByShareCode request + GetClinicByShareCodeWithResponse(ctx context.Context, shareCode string, reqEditors ...RequestEditorFn) (*GetClinicByShareCodeResponse, error) + + // DeleteClinic request + DeleteClinicWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*DeleteClinicResponse, error) + + // GetClinic request + GetClinicWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*GetClinicResponse, error) + + // UpdateClinic request with any body + UpdateClinicWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClinicResponse, error) + + UpdateClinicWithResponse(ctx context.Context, clinicId ClinicId, body UpdateClinicJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateClinicResponse, error) + + // ListClinicians request + ListCliniciansWithResponse(ctx context.Context, clinicId ClinicId, params *ListCliniciansParams, reqEditors ...RequestEditorFn) (*ListCliniciansResponse, error) + + // CreateClinician request with any body + CreateClinicianWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateClinicianResponse, error) + + CreateClinicianWithResponse(ctx context.Context, clinicId ClinicId, body CreateClinicianJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateClinicianResponse, error) + + // DeleteClinician request + DeleteClinicianWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, reqEditors ...RequestEditorFn) (*DeleteClinicianResponse, error) + + // GetClinician request + GetClinicianWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, reqEditors ...RequestEditorFn) (*GetClinicianResponse, error) + + // UpdateClinician request with any body + UpdateClinicianWithBodyWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClinicianResponse, error) + + UpdateClinicianWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, body UpdateClinicianJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateClinicianResponse, error) + + // SyncEHRData request + SyncEHRDataWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*SyncEHRDataResponse, error) + + // DeleteInvitedClinician request + DeleteInvitedClinicianWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, reqEditors ...RequestEditorFn) (*DeleteInvitedClinicianResponse, error) + + // GetInvitedClinician request + GetInvitedClinicianWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, reqEditors ...RequestEditorFn) (*GetInvitedClinicianResponse, error) + + // AssociateClinicianToUser request with any body + AssociateClinicianToUserWithBodyWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AssociateClinicianToUserResponse, error) + + AssociateClinicianToUserWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, body AssociateClinicianToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*AssociateClinicianToUserResponse, error) + + // ListMembershipRestrictions request + ListMembershipRestrictionsWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*ListMembershipRestrictionsResponse, error) + + // UpdateMembershipRestrictions request with any body + UpdateMembershipRestrictionsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMembershipRestrictionsResponse, error) + + UpdateMembershipRestrictionsWithResponse(ctx context.Context, clinicId ClinicId, body UpdateMembershipRestrictionsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMembershipRestrictionsResponse, error) + + // TriggerInitialMigration request with any body + TriggerInitialMigrationWithBodyWithResponse(ctx context.Context, clinicId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TriggerInitialMigrationResponse, error) + + TriggerInitialMigrationWithResponse(ctx context.Context, clinicId string, body TriggerInitialMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*TriggerInitialMigrationResponse, error) // ListMigrations request ListMigrationsWithResponse(ctx context.Context, clinicId string, reqEditors ...RequestEditorFn) (*ListMigrationsResponse, error) - // MigrateLegacyClinicianPatients request with any body - MigrateLegacyClinicianPatientsWithBodyWithResponse(ctx context.Context, clinicId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateLegacyClinicianPatientsResponse, error) + // MigrateLegacyClinicianPatients request with any body + MigrateLegacyClinicianPatientsWithBodyWithResponse(ctx context.Context, clinicId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateLegacyClinicianPatientsResponse, error) + + MigrateLegacyClinicianPatientsWithResponse(ctx context.Context, clinicId string, body MigrateLegacyClinicianPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateLegacyClinicianPatientsResponse, error) + + // GetMigration request + GetMigrationWithResponse(ctx context.Context, clinicId Id, userId UserId, reqEditors ...RequestEditorFn) (*GetMigrationResponse, error) + + // UpdateMigration request with any body + UpdateMigrationWithBodyWithResponse(ctx context.Context, clinicId Id, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMigrationResponse, error) + + UpdateMigrationWithResponse(ctx context.Context, clinicId Id, userId UserId, body UpdateMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMigrationResponse, error) + + // CreatePatientTag request with any body + CreatePatientTagWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePatientTagResponse, error) + + CreatePatientTagWithResponse(ctx context.Context, clinicId ClinicId, body CreatePatientTagJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePatientTagResponse, error) + + // DeletePatientTag request + DeletePatientTagWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, reqEditors ...RequestEditorFn) (*DeletePatientTagResponse, error) + + // UpdatePatientTag request with any body + UpdatePatientTagWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientTagResponse, error) + + UpdatePatientTagWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body UpdatePatientTagJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientTagResponse, error) + + // ListPatients request + ListPatientsWithResponse(ctx context.Context, clinicId ClinicId, params *ListPatientsParams, reqEditors ...RequestEditorFn) (*ListPatientsResponse, error) + + // CreatePatientAccount request with any body + CreatePatientAccountWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePatientAccountResponse, error) + + CreatePatientAccountWithResponse(ctx context.Context, clinicId ClinicId, body CreatePatientAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePatientAccountResponse, error) + + // AssignPatientTagToClinicPatients request with any body + AssignPatientTagToClinicPatientsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AssignPatientTagToClinicPatientsResponse, error) + + AssignPatientTagToClinicPatientsWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body AssignPatientTagToClinicPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*AssignPatientTagToClinicPatientsResponse, error) + + // DeletePatientTagFromClinicPatients request with any body + DeletePatientTagFromClinicPatientsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeletePatientTagFromClinicPatientsResponse, error) + + DeletePatientTagFromClinicPatientsWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body DeletePatientTagFromClinicPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*DeletePatientTagFromClinicPatientsResponse, error) + + // DeletePatient request + DeletePatientWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*DeletePatientResponse, error) + + // GetPatient request + GetPatientWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*GetPatientResponse, error) + + // CreatePatientFromUser request with any body + CreatePatientFromUserWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePatientFromUserResponse, error) + + CreatePatientFromUserWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body CreatePatientFromUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePatientFromUserResponse, error) + + // UpdatePatient request with any body + UpdatePatientWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientResponse, error) + + UpdatePatientWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body UpdatePatientJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientResponse, error) + + // UpdatePatientPermissions request with any body + UpdatePatientPermissionsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientPermissionsResponse, error) + + UpdatePatientPermissionsWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body UpdatePatientPermissionsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientPermissionsResponse, error) + + // DeletePatientPermission request + DeletePatientPermissionWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, permission string, reqEditors ...RequestEditorFn) (*DeletePatientPermissionResponse, error) + + // SendDexcomConnectRequest request + SendDexcomConnectRequestWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*SendDexcomConnectRequestResponse, error) + + // SendUploadReminder request + SendUploadReminderWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*SendUploadReminderResponse, error) + + // GetEHRSettings request + GetEHRSettingsWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*GetEHRSettingsResponse, error) + + // UpdateEHRSettings request with any body + UpdateEHRSettingsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateEHRSettingsResponse, error) + + UpdateEHRSettingsWithResponse(ctx context.Context, clinicId ClinicId, body UpdateEHRSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateEHRSettingsResponse, error) + + // GetMRNSettings request + GetMRNSettingsWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*GetMRNSettingsResponse, error) + + // UpdateMRNSettings request with any body + UpdateMRNSettingsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMRNSettingsResponse, error) + + UpdateMRNSettingsWithResponse(ctx context.Context, clinicId ClinicId, body UpdateMRNSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMRNSettingsResponse, error) + + // UpdateSuppressedNotifications request with any body + UpdateSuppressedNotificationsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSuppressedNotificationsResponse, error) + + UpdateSuppressedNotificationsWithResponse(ctx context.Context, clinicId ClinicId, body UpdateSuppressedNotificationsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSuppressedNotificationsResponse, error) + + // UpdateTier request with any body + UpdateTierWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTierResponse, error) + + UpdateTierWithResponse(ctx context.Context, clinicId ClinicId, body UpdateTierJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTierResponse, error) + + // UpdatePatientSummary request with any body + UpdatePatientSummaryWithBodyWithResponse(ctx context.Context, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientSummaryResponse, error) + + UpdatePatientSummaryWithResponse(ctx context.Context, patientId PatientId, body UpdatePatientSummaryJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientSummaryResponse, error) + + // ListClinicsForPatient request + ListClinicsForPatientWithResponse(ctx context.Context, userId UserId, params *ListClinicsForPatientParams, reqEditors ...RequestEditorFn) (*ListClinicsForPatientResponse, error) + + // UpdatePatientDataSources request with any body + UpdatePatientDataSourcesWithBodyWithResponse(ctx context.Context, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientDataSourcesResponse, error) + + UpdatePatientDataSourcesWithResponse(ctx context.Context, userId UserId, body UpdatePatientDataSourcesJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientDataSourcesResponse, error) + + // ProcessEHRMessage request with any body + ProcessEHRMessageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProcessEHRMessageResponse, error) + + ProcessEHRMessageWithResponse(ctx context.Context, body ProcessEHRMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*ProcessEHRMessageResponse, error) + + // MatchClinicAndPatient request with any body + MatchClinicAndPatientWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MatchClinicAndPatientResponse, error) + + MatchClinicAndPatientWithResponse(ctx context.Context, body MatchClinicAndPatientJSONRequestBody, reqEditors ...RequestEditorFn) (*MatchClinicAndPatientResponse, error) + + // VerifyEndpoint request + VerifyEndpointWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*VerifyEndpointResponse, error) + + // DeleteUserFromClinics request + DeleteUserFromClinicsWithResponse(ctx context.Context, userId UserId, reqEditors ...RequestEditorFn) (*DeleteUserFromClinicsResponse, error) + + // UpdateClinicUserDetails request with any body + UpdateClinicUserDetailsWithBodyWithResponse(ctx context.Context, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClinicUserDetailsResponse, error) + + UpdateClinicUserDetailsWithResponse(ctx context.Context, userId UserId, body UpdateClinicUserDetailsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateClinicUserDetailsResponse, error) +} + +type ListAllCliniciansResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]ClinicianClinicRelationship +} + +// Status returns HTTPResponse.Status +func (r ListAllCliniciansResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListAllCliniciansResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListClinicsForClinicianResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *ClinicianClinicRelationships +} + +// Status returns HTTPResponse.Status +func (r ListClinicsForClinicianResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListClinicsForClinicianResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type EnableNewClinicExperienceResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Clinic +} + +// Status returns HTTPResponse.Status +func (r EnableNewClinicExperienceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r EnableNewClinicExperienceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListClinicsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Clinics + JSON400 *Error + JSON403 *Error + JSON500 *Error +} + +// Status returns HTTPResponse.Status +func (r ListClinicsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListClinicsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateClinicResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Clinic + XML200 *map[string]interface{} +} + +// Status returns HTTPResponse.Status +func (r CreateClinicResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateClinicResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetClinicByShareCodeResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Clinic +} + +// Status returns HTTPResponse.Status +func (r GetClinicByShareCodeResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetClinicByShareCodeResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteClinicResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r DeleteClinicResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteClinicResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetClinicResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Clinic +} + +// Status returns HTTPResponse.Status +func (r GetClinicResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetClinicResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateClinicResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Clinic +} + +// Status returns HTTPResponse.Status +func (r UpdateClinicResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateClinicResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListCliniciansResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Clinicians +} + +// Status returns HTTPResponse.Status +func (r ListCliniciansResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListCliniciansResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreateClinicianResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r CreateClinicianResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreateClinicianResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteClinicianResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r DeleteClinicianResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteClinicianResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetClinicianResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Clinician +} + +// Status returns HTTPResponse.Status +func (r GetClinicianResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetClinicianResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateClinicianResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r UpdateClinicianResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateClinicianResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type SyncEHRDataResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r SyncEHRDataResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SyncEHRDataResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteInvitedClinicianResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r DeleteInvitedClinicianResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteInvitedClinicianResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetInvitedClinicianResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Clinician +} + +// Status returns HTTPResponse.Status +func (r GetInvitedClinicianResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetInvitedClinicianResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type AssociateClinicianToUserResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Clinician +} + +// Status returns HTTPResponse.Status +func (r AssociateClinicianToUserResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AssociateClinicianToUserResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListMembershipRestrictionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *MembershipRestrictions +} + +// Status returns HTTPResponse.Status +func (r ListMembershipRestrictionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListMembershipRestrictionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateMembershipRestrictionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *MembershipRestrictions +} + +// Status returns HTTPResponse.Status +func (r UpdateMembershipRestrictionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateMembershipRestrictionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type TriggerInitialMigrationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Migration +} + +// Status returns HTTPResponse.Status +func (r TriggerInitialMigrationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r TriggerInitialMigrationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListMigrationsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Migrations +} + +// Status returns HTTPResponse.Status +func (r ListMigrationsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListMigrationsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type MigrateLegacyClinicianPatientsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON202 *Migration +} + +// Status returns HTTPResponse.Status +func (r MigrateLegacyClinicianPatientsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r MigrateLegacyClinicianPatientsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetMigrationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Migration +} + +// Status returns HTTPResponse.Status +func (r GetMigrationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetMigrationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdateMigrationResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Migration +} + +// Status returns HTTPResponse.Status +func (r UpdateMigrationResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateMigrationResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreatePatientTagResponse struct { + Body []byte + HTTPResponse *http.Response +} - MigrateLegacyClinicianPatientsWithResponse(ctx context.Context, clinicId string, body MigrateLegacyClinicianPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateLegacyClinicianPatientsResponse, error) +// Status returns HTTPResponse.Status +func (r CreatePatientTagResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // GetMigration request - GetMigrationWithResponse(ctx context.Context, clinicId Id, userId UserId, reqEditors ...RequestEditorFn) (*GetMigrationResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r CreatePatientTagResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // UpdateMigration request with any body - UpdateMigrationWithBodyWithResponse(ctx context.Context, clinicId Id, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMigrationResponse, error) +type DeletePatientTagResponse struct { + Body []byte + HTTPResponse *http.Response +} - UpdateMigrationWithResponse(ctx context.Context, clinicId Id, userId UserId, body UpdateMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMigrationResponse, error) +// Status returns HTTPResponse.Status +func (r DeletePatientTagResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // ListPatients request - ListPatientsWithResponse(ctx context.Context, clinicId ClinicId, params *ListPatientsParams, reqEditors ...RequestEditorFn) (*ListPatientsResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r DeletePatientTagResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdatePatientTagResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r UpdatePatientTagResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdatePatientTagResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListPatientsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *PatientsResponse +} + +// Status returns HTTPResponse.Status +func (r ListPatientsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListPatientsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreatePatientAccountResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Patient +} + +// Status returns HTTPResponse.Status +func (r CreatePatientAccountResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreatePatientAccountResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type AssignPatientTagToClinicPatientsResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r AssignPatientTagToClinicPatientsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AssignPatientTagToClinicPatientsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeletePatientTagFromClinicPatientsResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r DeletePatientTagFromClinicPatientsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeletePatientTagFromClinicPatientsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeletePatientResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r DeletePatientResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeletePatientResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type GetPatientResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Patient +} + +// Status returns HTTPResponse.Status +func (r GetPatientResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r GetPatientResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type CreatePatientFromUserResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Patient +} + +// Status returns HTTPResponse.Status +func (r CreatePatientFromUserResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r CreatePatientFromUserResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdatePatientResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Patient +} + +// Status returns HTTPResponse.Status +func (r UpdatePatientResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdatePatientResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type UpdatePatientPermissionsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *PatientPermissions +} + +// Status returns HTTPResponse.Status +func (r UpdatePatientPermissionsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r UpdatePatientPermissionsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeletePatientPermissionResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r DeletePatientPermissionResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // CreatePatientAccount request with any body - CreatePatientAccountWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePatientAccountResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r DeletePatientPermissionResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - CreatePatientAccountWithResponse(ctx context.Context, clinicId ClinicId, body CreatePatientAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePatientAccountResponse, error) +type SendDexcomConnectRequestResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *Patient +} - // DeletePatient request - DeletePatientWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*DeletePatientResponse, error) +// Status returns HTTPResponse.Status +func (r SendDexcomConnectRequestResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // GetPatient request - GetPatientWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*GetPatientResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r SendDexcomConnectRequestResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // CreatePatientFromUser request with any body - CreatePatientFromUserWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePatientFromUserResponse, error) +type SendUploadReminderResponse struct { + Body []byte + HTTPResponse *http.Response +} - CreatePatientFromUserWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body CreatePatientFromUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePatientFromUserResponse, error) +// Status returns HTTPResponse.Status +func (r SendUploadReminderResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // UpdatePatient request with any body - UpdatePatientWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r SendUploadReminderResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - UpdatePatientWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body UpdatePatientJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientResponse, error) +type GetEHRSettingsResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *EHRSettings +} - // UpdatePatientPermissions request with any body - UpdatePatientPermissionsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientPermissionsResponse, error) +// Status returns HTTPResponse.Status +func (r GetEHRSettingsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - UpdatePatientPermissionsWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body UpdatePatientPermissionsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientPermissionsResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r GetEHRSettingsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} - // DeletePatientPermission request - DeletePatientPermissionWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, permission string, reqEditors ...RequestEditorFn) (*DeletePatientPermissionResponse, error) +type UpdateEHRSettingsResponse struct { + Body []byte + HTTPResponse *http.Response +} - // ListClinicsForPatient request - ListClinicsForPatientWithResponse(ctx context.Context, userId UserId, params *ListClinicsForPatientParams, reqEditors ...RequestEditorFn) (*ListClinicsForPatientResponse, error) +// Status returns HTTPResponse.Status +func (r UpdateEHRSettingsResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} - // DeleteUserFromClinics request - DeleteUserFromClinicsWithResponse(ctx context.Context, userId UserId, reqEditors ...RequestEditorFn) (*DeleteUserFromClinicsResponse, error) +// StatusCode returns HTTPResponse.StatusCode +func (r UpdateEHRSettingsResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 } -type ListClinicsForClinicianResponse struct { +type GetMRNSettingsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *ClinicianClinicRelationships + JSON200 *MRNSettings } // Status returns HTTPResponse.Status -func (r ListClinicsForClinicianResponse) Status() string { +func (r GetMRNSettingsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2397,21 +5662,20 @@ func (r ListClinicsForClinicianResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListClinicsForClinicianResponse) StatusCode() int { +func (r GetMRNSettingsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type EnableNewClinicExperienceResponse struct { +type UpdateMRNSettingsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Clinic } // Status returns HTTPResponse.Status -func (r EnableNewClinicExperienceResponse) Status() string { +func (r UpdateMRNSettingsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2419,24 +5683,20 @@ func (r EnableNewClinicExperienceResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r EnableNewClinicExperienceResponse) StatusCode() int { +func (r UpdateMRNSettingsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListClinicsResponse struct { +type UpdateSuppressedNotificationsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Clinics - JSON400 *Error - JSON403 *Error - JSON500 *Error } // Status returns HTTPResponse.Status -func (r ListClinicsResponse) Status() string { +func (r UpdateSuppressedNotificationsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2444,22 +5704,20 @@ func (r ListClinicsResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListClinicsResponse) StatusCode() int { +func (r UpdateSuppressedNotificationsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateClinicResponse struct { +type UpdateTierResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Clinic - XML200 *map[string]interface{} } // Status returns HTTPResponse.Status -func (r CreateClinicResponse) Status() string { +func (r UpdateTierResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2467,21 +5725,20 @@ func (r CreateClinicResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateClinicResponse) StatusCode() int { +func (r UpdateTierResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetClinicByShareCodeResponse struct { +type UpdatePatientSummaryResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Clinic } // Status returns HTTPResponse.Status -func (r GetClinicByShareCodeResponse) Status() string { +func (r UpdatePatientSummaryResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2489,21 +5746,21 @@ func (r GetClinicByShareCodeResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetClinicByShareCodeResponse) StatusCode() int { +func (r UpdatePatientSummaryResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetClinicResponse struct { +type ListClinicsForPatientResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Clinic + JSON200 *PatientClinicRelationships } // Status returns HTTPResponse.Status -func (r GetClinicResponse) Status() string { +func (r ListClinicsForPatientResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2511,21 +5768,20 @@ func (r GetClinicResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetClinicResponse) StatusCode() int { +func (r ListClinicsForPatientResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateClinicResponse struct { +type UpdatePatientDataSourcesResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Clinic } // Status returns HTTPResponse.Status -func (r UpdateClinicResponse) Status() string { +func (r UpdatePatientDataSourcesResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2533,21 +5789,20 @@ func (r UpdateClinicResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateClinicResponse) StatusCode() int { +func (r UpdatePatientDataSourcesResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type ListCliniciansResponse struct { +type ProcessEHRMessageResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Clinicians } // Status returns HTTPResponse.Status -func (r ListCliniciansResponse) Status() string { +func (r ProcessEHRMessageResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2555,20 +5810,21 @@ func (r ListCliniciansResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r ListCliniciansResponse) StatusCode() int { +func (r ProcessEHRMessageResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type CreateClinicianResponse struct { +type MatchClinicAndPatientResponse struct { Body []byte HTTPResponse *http.Response + JSON200 *EHRMatchResponse } // Status returns HTTPResponse.Status -func (r CreateClinicianResponse) Status() string { +func (r MatchClinicAndPatientResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2576,20 +5832,20 @@ func (r CreateClinicianResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r CreateClinicianResponse) StatusCode() int { +func (r MatchClinicAndPatientResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type DeleteClinicianResponse struct { +type VerifyEndpointResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r DeleteClinicianResponse) Status() string { +func (r VerifyEndpointResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2597,21 +5853,20 @@ func (r DeleteClinicianResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r DeleteClinicianResponse) StatusCode() int { +func (r VerifyEndpointResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type GetClinicianResponse struct { +type DeleteUserFromClinicsResponse struct { Body []byte HTTPResponse *http.Response - JSON200 *Clinician } // Status returns HTTPResponse.Status -func (r GetClinicianResponse) Status() string { +func (r DeleteUserFromClinicsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2619,20 +5874,20 @@ func (r GetClinicianResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r GetClinicianResponse) StatusCode() int { +func (r DeleteUserFromClinicsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } return 0 } -type UpdateClinicianResponse struct { +type UpdateClinicUserDetailsResponse struct { Body []byte HTTPResponse *http.Response } // Status returns HTTPResponse.Status -func (r UpdateClinicianResponse) Status() string { +func (r UpdateClinicUserDetailsResponse) Status() string { if r.HTTPResponse != nil { return r.HTTPResponse.Status } @@ -2640,779 +5895,1133 @@ func (r UpdateClinicianResponse) Status() string { } // StatusCode returns HTTPResponse.StatusCode -func (r UpdateClinicianResponse) StatusCode() int { +func (r UpdateClinicUserDetailsResponse) StatusCode() int { if r.HTTPResponse != nil { return r.HTTPResponse.StatusCode } - return 0 -} - -type DeleteInvitedClinicianResponse struct { - Body []byte - HTTPResponse *http.Response + return 0 +} + +// ListAllCliniciansWithResponse request returning *ListAllCliniciansResponse +func (c *ClientWithResponses) ListAllCliniciansWithResponse(ctx context.Context, params *ListAllCliniciansParams, reqEditors ...RequestEditorFn) (*ListAllCliniciansResponse, error) { + rsp, err := c.ListAllClinicians(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListAllCliniciansResponse(rsp) +} + +// ListClinicsForClinicianWithResponse request returning *ListClinicsForClinicianResponse +func (c *ClientWithResponses) ListClinicsForClinicianWithResponse(ctx context.Context, userId UserId, params *ListClinicsForClinicianParams, reqEditors ...RequestEditorFn) (*ListClinicsForClinicianResponse, error) { + rsp, err := c.ListClinicsForClinician(ctx, userId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListClinicsForClinicianResponse(rsp) +} + +// EnableNewClinicExperienceWithResponse request returning *EnableNewClinicExperienceResponse +func (c *ClientWithResponses) EnableNewClinicExperienceWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*EnableNewClinicExperienceResponse, error) { + rsp, err := c.EnableNewClinicExperience(ctx, userId, reqEditors...) + if err != nil { + return nil, err + } + return ParseEnableNewClinicExperienceResponse(rsp) +} + +// ListClinicsWithResponse request returning *ListClinicsResponse +func (c *ClientWithResponses) ListClinicsWithResponse(ctx context.Context, params *ListClinicsParams, reqEditors ...RequestEditorFn) (*ListClinicsResponse, error) { + rsp, err := c.ListClinics(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListClinicsResponse(rsp) +} + +// CreateClinicWithBodyWithResponse request with arbitrary body returning *CreateClinicResponse +func (c *ClientWithResponses) CreateClinicWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateClinicResponse, error) { + rsp, err := c.CreateClinicWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateClinicResponse(rsp) +} + +func (c *ClientWithResponses) CreateClinicWithResponse(ctx context.Context, body CreateClinicJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateClinicResponse, error) { + rsp, err := c.CreateClinic(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateClinicResponse(rsp) +} + +// GetClinicByShareCodeWithResponse request returning *GetClinicByShareCodeResponse +func (c *ClientWithResponses) GetClinicByShareCodeWithResponse(ctx context.Context, shareCode string, reqEditors ...RequestEditorFn) (*GetClinicByShareCodeResponse, error) { + rsp, err := c.GetClinicByShareCode(ctx, shareCode, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetClinicByShareCodeResponse(rsp) +} + +// DeleteClinicWithResponse request returning *DeleteClinicResponse +func (c *ClientWithResponses) DeleteClinicWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*DeleteClinicResponse, error) { + rsp, err := c.DeleteClinic(ctx, clinicId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteClinicResponse(rsp) +} + +// GetClinicWithResponse request returning *GetClinicResponse +func (c *ClientWithResponses) GetClinicWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*GetClinicResponse, error) { + rsp, err := c.GetClinic(ctx, clinicId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetClinicResponse(rsp) +} + +// UpdateClinicWithBodyWithResponse request with arbitrary body returning *UpdateClinicResponse +func (c *ClientWithResponses) UpdateClinicWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClinicResponse, error) { + rsp, err := c.UpdateClinicWithBody(ctx, clinicId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateClinicResponse(rsp) +} + +func (c *ClientWithResponses) UpdateClinicWithResponse(ctx context.Context, clinicId ClinicId, body UpdateClinicJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateClinicResponse, error) { + rsp, err := c.UpdateClinic(ctx, clinicId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateClinicResponse(rsp) +} + +// ListCliniciansWithResponse request returning *ListCliniciansResponse +func (c *ClientWithResponses) ListCliniciansWithResponse(ctx context.Context, clinicId ClinicId, params *ListCliniciansParams, reqEditors ...RequestEditorFn) (*ListCliniciansResponse, error) { + rsp, err := c.ListClinicians(ctx, clinicId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListCliniciansResponse(rsp) +} + +// CreateClinicianWithBodyWithResponse request with arbitrary body returning *CreateClinicianResponse +func (c *ClientWithResponses) CreateClinicianWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateClinicianResponse, error) { + rsp, err := c.CreateClinicianWithBody(ctx, clinicId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreateClinicianResponse(rsp) } -// Status returns HTTPResponse.Status -func (r DeleteInvitedClinicianResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) CreateClinicianWithResponse(ctx context.Context, clinicId ClinicId, body CreateClinicianJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateClinicianResponse, error) { + rsp, err := c.CreateClinician(ctx, clinicId, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreateClinicianResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteInvitedClinicianResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// DeleteClinicianWithResponse request returning *DeleteClinicianResponse +func (c *ClientWithResponses) DeleteClinicianWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, reqEditors ...RequestEditorFn) (*DeleteClinicianResponse, error) { + rsp, err := c.DeleteClinician(ctx, clinicId, clinicianId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseDeleteClinicianResponse(rsp) } -type GetInvitedClinicianResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Clinician +// GetClinicianWithResponse request returning *GetClinicianResponse +func (c *ClientWithResponses) GetClinicianWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, reqEditors ...RequestEditorFn) (*GetClinicianResponse, error) { + rsp, err := c.GetClinician(ctx, clinicId, clinicianId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetClinicianResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetInvitedClinicianResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// UpdateClinicianWithBodyWithResponse request with arbitrary body returning *UpdateClinicianResponse +func (c *ClientWithResponses) UpdateClinicianWithBodyWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClinicianResponse, error) { + rsp, err := c.UpdateClinicianWithBody(ctx, clinicId, clinicianId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseUpdateClinicianResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetInvitedClinicianResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) UpdateClinicianWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, body UpdateClinicianJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateClinicianResponse, error) { + rsp, err := c.UpdateClinician(ctx, clinicId, clinicianId, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdateClinicianResponse(rsp) } -type AssociateClinicianToUserResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Clinician +// SyncEHRDataWithResponse request returning *SyncEHRDataResponse +func (c *ClientWithResponses) SyncEHRDataWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*SyncEHRDataResponse, error) { + rsp, err := c.SyncEHRData(ctx, clinicId, reqEditors...) + if err != nil { + return nil, err + } + return ParseSyncEHRDataResponse(rsp) } -// Status returns HTTPResponse.Status -func (r AssociateClinicianToUserResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// DeleteInvitedClinicianWithResponse request returning *DeleteInvitedClinicianResponse +func (c *ClientWithResponses) DeleteInvitedClinicianWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, reqEditors ...RequestEditorFn) (*DeleteInvitedClinicianResponse, error) { + rsp, err := c.DeleteInvitedClinician(ctx, clinicId, inviteId, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseDeleteInvitedClinicianResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r AssociateClinicianToUserResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetInvitedClinicianWithResponse request returning *GetInvitedClinicianResponse +func (c *ClientWithResponses) GetInvitedClinicianWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, reqEditors ...RequestEditorFn) (*GetInvitedClinicianResponse, error) { + rsp, err := c.GetInvitedClinician(ctx, clinicId, inviteId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetInvitedClinicianResponse(rsp) } -type TriggerInitialMigrationResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Migration +// AssociateClinicianToUserWithBodyWithResponse request with arbitrary body returning *AssociateClinicianToUserResponse +func (c *ClientWithResponses) AssociateClinicianToUserWithBodyWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AssociateClinicianToUserResponse, error) { + rsp, err := c.AssociateClinicianToUserWithBody(ctx, clinicId, inviteId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAssociateClinicianToUserResponse(rsp) } -// Status returns HTTPResponse.Status -func (r TriggerInitialMigrationResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) AssociateClinicianToUserWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, body AssociateClinicianToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*AssociateClinicianToUserResponse, error) { + rsp, err := c.AssociateClinicianToUser(ctx, clinicId, inviteId, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseAssociateClinicianToUserResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r TriggerInitialMigrationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// ListMembershipRestrictionsWithResponse request returning *ListMembershipRestrictionsResponse +func (c *ClientWithResponses) ListMembershipRestrictionsWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*ListMembershipRestrictionsResponse, error) { + rsp, err := c.ListMembershipRestrictions(ctx, clinicId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseListMembershipRestrictionsResponse(rsp) } -type ListMigrationsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Migrations +// UpdateMembershipRestrictionsWithBodyWithResponse request with arbitrary body returning *UpdateMembershipRestrictionsResponse +func (c *ClientWithResponses) UpdateMembershipRestrictionsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMembershipRestrictionsResponse, error) { + rsp, err := c.UpdateMembershipRestrictionsWithBody(ctx, clinicId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateMembershipRestrictionsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListMigrationsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) UpdateMembershipRestrictionsWithResponse(ctx context.Context, clinicId ClinicId, body UpdateMembershipRestrictionsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMembershipRestrictionsResponse, error) { + rsp, err := c.UpdateMembershipRestrictions(ctx, clinicId, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseUpdateMembershipRestrictionsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListMigrationsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// TriggerInitialMigrationWithBodyWithResponse request with arbitrary body returning *TriggerInitialMigrationResponse +func (c *ClientWithResponses) TriggerInitialMigrationWithBodyWithResponse(ctx context.Context, clinicId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TriggerInitialMigrationResponse, error) { + rsp, err := c.TriggerInitialMigrationWithBody(ctx, clinicId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseTriggerInitialMigrationResponse(rsp) } -type MigrateLegacyClinicianPatientsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON202 *Migration +func (c *ClientWithResponses) TriggerInitialMigrationWithResponse(ctx context.Context, clinicId string, body TriggerInitialMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*TriggerInitialMigrationResponse, error) { + rsp, err := c.TriggerInitialMigration(ctx, clinicId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseTriggerInitialMigrationResponse(rsp) } -// Status returns HTTPResponse.Status -func (r MigrateLegacyClinicianPatientsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// ListMigrationsWithResponse request returning *ListMigrationsResponse +func (c *ClientWithResponses) ListMigrationsWithResponse(ctx context.Context, clinicId string, reqEditors ...RequestEditorFn) (*ListMigrationsResponse, error) { + rsp, err := c.ListMigrations(ctx, clinicId, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseListMigrationsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r MigrateLegacyClinicianPatientsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// MigrateLegacyClinicianPatientsWithBodyWithResponse request with arbitrary body returning *MigrateLegacyClinicianPatientsResponse +func (c *ClientWithResponses) MigrateLegacyClinicianPatientsWithBodyWithResponse(ctx context.Context, clinicId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateLegacyClinicianPatientsResponse, error) { + rsp, err := c.MigrateLegacyClinicianPatientsWithBody(ctx, clinicId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseMigrateLegacyClinicianPatientsResponse(rsp) } -type GetMigrationResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Migration +func (c *ClientWithResponses) MigrateLegacyClinicianPatientsWithResponse(ctx context.Context, clinicId string, body MigrateLegacyClinicianPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateLegacyClinicianPatientsResponse, error) { + rsp, err := c.MigrateLegacyClinicianPatients(ctx, clinicId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseMigrateLegacyClinicianPatientsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetMigrationResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// GetMigrationWithResponse request returning *GetMigrationResponse +func (c *ClientWithResponses) GetMigrationWithResponse(ctx context.Context, clinicId Id, userId UserId, reqEditors ...RequestEditorFn) (*GetMigrationResponse, error) { + rsp, err := c.GetMigration(ctx, clinicId, userId, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseGetMigrationResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetMigrationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// UpdateMigrationWithBodyWithResponse request with arbitrary body returning *UpdateMigrationResponse +func (c *ClientWithResponses) UpdateMigrationWithBodyWithResponse(ctx context.Context, clinicId Id, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMigrationResponse, error) { + rsp, err := c.UpdateMigrationWithBody(ctx, clinicId, userId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdateMigrationResponse(rsp) } -type UpdateMigrationResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Migration +func (c *ClientWithResponses) UpdateMigrationWithResponse(ctx context.Context, clinicId Id, userId UserId, body UpdateMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMigrationResponse, error) { + rsp, err := c.UpdateMigration(ctx, clinicId, userId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateMigrationResponse(rsp) } -// Status returns HTTPResponse.Status -func (r UpdateMigrationResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// CreatePatientTagWithBodyWithResponse request with arbitrary body returning *CreatePatientTagResponse +func (c *ClientWithResponses) CreatePatientTagWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePatientTagResponse, error) { + rsp, err := c.CreatePatientTagWithBody(ctx, clinicId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreatePatientTagResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdateMigrationResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) CreatePatientTagWithResponse(ctx context.Context, clinicId ClinicId, body CreatePatientTagJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePatientTagResponse, error) { + rsp, err := c.CreatePatientTag(ctx, clinicId, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseCreatePatientTagResponse(rsp) } -type ListPatientsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *PatientsResponse +// DeletePatientTagWithResponse request returning *DeletePatientTagResponse +func (c *ClientWithResponses) DeletePatientTagWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, reqEditors ...RequestEditorFn) (*DeletePatientTagResponse, error) { + rsp, err := c.DeletePatientTag(ctx, clinicId, patientTagId, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeletePatientTagResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListPatientsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// UpdatePatientTagWithBodyWithResponse request with arbitrary body returning *UpdatePatientTagResponse +func (c *ClientWithResponses) UpdatePatientTagWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientTagResponse, error) { + rsp, err := c.UpdatePatientTagWithBody(ctx, clinicId, patientTagId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseUpdatePatientTagResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListPatientsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) UpdatePatientTagWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body UpdatePatientTagJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientTagResponse, error) { + rsp, err := c.UpdatePatientTag(ctx, clinicId, patientTagId, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdatePatientTagResponse(rsp) } -type CreatePatientAccountResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Patient +// ListPatientsWithResponse request returning *ListPatientsResponse +func (c *ClientWithResponses) ListPatientsWithResponse(ctx context.Context, clinicId ClinicId, params *ListPatientsParams, reqEditors ...RequestEditorFn) (*ListPatientsResponse, error) { + rsp, err := c.ListPatients(ctx, clinicId, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListPatientsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r CreatePatientAccountResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// CreatePatientAccountWithBodyWithResponse request with arbitrary body returning *CreatePatientAccountResponse +func (c *ClientWithResponses) CreatePatientAccountWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePatientAccountResponse, error) { + rsp, err := c.CreatePatientAccountWithBody(ctx, clinicId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreatePatientAccountResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r CreatePatientAccountResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) CreatePatientAccountWithResponse(ctx context.Context, clinicId ClinicId, body CreatePatientAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePatientAccountResponse, error) { + rsp, err := c.CreatePatientAccount(ctx, clinicId, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseCreatePatientAccountResponse(rsp) } -type DeletePatientResponse struct { - Body []byte - HTTPResponse *http.Response +// AssignPatientTagToClinicPatientsWithBodyWithResponse request with arbitrary body returning *AssignPatientTagToClinicPatientsResponse +func (c *ClientWithResponses) AssignPatientTagToClinicPatientsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AssignPatientTagToClinicPatientsResponse, error) { + rsp, err := c.AssignPatientTagToClinicPatientsWithBody(ctx, clinicId, patientTagId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseAssignPatientTagToClinicPatientsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r DeletePatientResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) AssignPatientTagToClinicPatientsWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body AssignPatientTagToClinicPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*AssignPatientTagToClinicPatientsResponse, error) { + rsp, err := c.AssignPatientTagToClinicPatients(ctx, clinicId, patientTagId, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseAssignPatientTagToClinicPatientsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r DeletePatientResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// DeletePatientTagFromClinicPatientsWithBodyWithResponse request with arbitrary body returning *DeletePatientTagFromClinicPatientsResponse +func (c *ClientWithResponses) DeletePatientTagFromClinicPatientsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeletePatientTagFromClinicPatientsResponse, error) { + rsp, err := c.DeletePatientTagFromClinicPatientsWithBody(ctx, clinicId, patientTagId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseDeletePatientTagFromClinicPatientsResponse(rsp) } -type GetPatientResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Patient +func (c *ClientWithResponses) DeletePatientTagFromClinicPatientsWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body DeletePatientTagFromClinicPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*DeletePatientTagFromClinicPatientsResponse, error) { + rsp, err := c.DeletePatientTagFromClinicPatients(ctx, clinicId, patientTagId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeletePatientTagFromClinicPatientsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r GetPatientResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// DeletePatientWithResponse request returning *DeletePatientResponse +func (c *ClientWithResponses) DeletePatientWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*DeletePatientResponse, error) { + rsp, err := c.DeletePatient(ctx, clinicId, patientId, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseDeletePatientResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r GetPatientResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// GetPatientWithResponse request returning *GetPatientResponse +func (c *ClientWithResponses) GetPatientWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*GetPatientResponse, error) { + rsp, err := c.GetPatient(ctx, clinicId, patientId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseGetPatientResponse(rsp) } -type CreatePatientFromUserResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Patient +// CreatePatientFromUserWithBodyWithResponse request with arbitrary body returning *CreatePatientFromUserResponse +func (c *ClientWithResponses) CreatePatientFromUserWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePatientFromUserResponse, error) { + rsp, err := c.CreatePatientFromUserWithBody(ctx, clinicId, patientId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseCreatePatientFromUserResponse(rsp) } -// Status returns HTTPResponse.Status -func (r CreatePatientFromUserResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) CreatePatientFromUserWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body CreatePatientFromUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePatientFromUserResponse, error) { + rsp, err := c.CreatePatientFromUser(ctx, clinicId, patientId, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseCreatePatientFromUserResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r CreatePatientFromUserResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// UpdatePatientWithBodyWithResponse request with arbitrary body returning *UpdatePatientResponse +func (c *ClientWithResponses) UpdatePatientWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientResponse, error) { + rsp, err := c.UpdatePatientWithBody(ctx, clinicId, patientId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdatePatientResponse(rsp) } -type UpdatePatientResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *Patient +func (c *ClientWithResponses) UpdatePatientWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body UpdatePatientJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientResponse, error) { + rsp, err := c.UpdatePatient(ctx, clinicId, patientId, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdatePatientResponse(rsp) } -// Status returns HTTPResponse.Status -func (r UpdatePatientResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// UpdatePatientPermissionsWithBodyWithResponse request with arbitrary body returning *UpdatePatientPermissionsResponse +func (c *ClientWithResponses) UpdatePatientPermissionsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientPermissionsResponse, error) { + rsp, err := c.UpdatePatientPermissionsWithBody(ctx, clinicId, patientId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseUpdatePatientPermissionsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdatePatientResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) UpdatePatientPermissionsWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body UpdatePatientPermissionsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientPermissionsResponse, error) { + rsp, err := c.UpdatePatientPermissions(ctx, clinicId, patientId, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdatePatientPermissionsResponse(rsp) } -type UpdatePatientPermissionsResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *PatientPermissions +// DeletePatientPermissionWithResponse request returning *DeletePatientPermissionResponse +func (c *ClientWithResponses) DeletePatientPermissionWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, permission string, reqEditors ...RequestEditorFn) (*DeletePatientPermissionResponse, error) { + rsp, err := c.DeletePatientPermission(ctx, clinicId, patientId, permission, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeletePatientPermissionResponse(rsp) } -// Status returns HTTPResponse.Status -func (r UpdatePatientPermissionsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// SendDexcomConnectRequestWithResponse request returning *SendDexcomConnectRequestResponse +func (c *ClientWithResponses) SendDexcomConnectRequestWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*SendDexcomConnectRequestResponse, error) { + rsp, err := c.SendDexcomConnectRequest(ctx, clinicId, patientId, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseSendDexcomConnectRequestResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r UpdatePatientPermissionsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// SendUploadReminderWithResponse request returning *SendUploadReminderResponse +func (c *ClientWithResponses) SendUploadReminderWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*SendUploadReminderResponse, error) { + rsp, err := c.SendUploadReminder(ctx, clinicId, patientId, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseSendUploadReminderResponse(rsp) } -type DeletePatientPermissionResponse struct { - Body []byte - HTTPResponse *http.Response +// GetEHRSettingsWithResponse request returning *GetEHRSettingsResponse +func (c *ClientWithResponses) GetEHRSettingsWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*GetEHRSettingsResponse, error) { + rsp, err := c.GetEHRSettings(ctx, clinicId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetEHRSettingsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r DeletePatientPermissionResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// UpdateEHRSettingsWithBodyWithResponse request with arbitrary body returning *UpdateEHRSettingsResponse +func (c *ClientWithResponses) UpdateEHRSettingsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateEHRSettingsResponse, error) { + rsp, err := c.UpdateEHRSettingsWithBody(ctx, clinicId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseUpdateEHRSettingsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r DeletePatientPermissionResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) UpdateEHRSettingsWithResponse(ctx context.Context, clinicId ClinicId, body UpdateEHRSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateEHRSettingsResponse, error) { + rsp, err := c.UpdateEHRSettings(ctx, clinicId, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdateEHRSettingsResponse(rsp) } -type ListClinicsForPatientResponse struct { - Body []byte - HTTPResponse *http.Response - JSON200 *PatientClinicRelationships +// GetMRNSettingsWithResponse request returning *GetMRNSettingsResponse +func (c *ClientWithResponses) GetMRNSettingsWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*GetMRNSettingsResponse, error) { + rsp, err := c.GetMRNSettings(ctx, clinicId, reqEditors...) + if err != nil { + return nil, err + } + return ParseGetMRNSettingsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r ListClinicsForPatientResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +// UpdateMRNSettingsWithBodyWithResponse request with arbitrary body returning *UpdateMRNSettingsResponse +func (c *ClientWithResponses) UpdateMRNSettingsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMRNSettingsResponse, error) { + rsp, err := c.UpdateMRNSettingsWithBody(ctx, clinicId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseUpdateMRNSettingsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r ListClinicsForPatientResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +func (c *ClientWithResponses) UpdateMRNSettingsWithResponse(ctx context.Context, clinicId ClinicId, body UpdateMRNSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMRNSettingsResponse, error) { + rsp, err := c.UpdateMRNSettings(ctx, clinicId, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdateMRNSettingsResponse(rsp) } -type DeleteUserFromClinicsResponse struct { - Body []byte - HTTPResponse *http.Response +// UpdateSuppressedNotificationsWithBodyWithResponse request with arbitrary body returning *UpdateSuppressedNotificationsResponse +func (c *ClientWithResponses) UpdateSuppressedNotificationsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSuppressedNotificationsResponse, error) { + rsp, err := c.UpdateSuppressedNotificationsWithBody(ctx, clinicId, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseUpdateSuppressedNotificationsResponse(rsp) } -// Status returns HTTPResponse.Status -func (r DeleteUserFromClinicsResponse) Status() string { - if r.HTTPResponse != nil { - return r.HTTPResponse.Status +func (c *ClientWithResponses) UpdateSuppressedNotificationsWithResponse(ctx context.Context, clinicId ClinicId, body UpdateSuppressedNotificationsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSuppressedNotificationsResponse, error) { + rsp, err := c.UpdateSuppressedNotifications(ctx, clinicId, body, reqEditors...) + if err != nil { + return nil, err } - return http.StatusText(0) + return ParseUpdateSuppressedNotificationsResponse(rsp) } -// StatusCode returns HTTPResponse.StatusCode -func (r DeleteUserFromClinicsResponse) StatusCode() int { - if r.HTTPResponse != nil { - return r.HTTPResponse.StatusCode +// UpdateTierWithBodyWithResponse request with arbitrary body returning *UpdateTierResponse +func (c *ClientWithResponses) UpdateTierWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTierResponse, error) { + rsp, err := c.UpdateTierWithBody(ctx, clinicId, contentType, body, reqEditors...) + if err != nil { + return nil, err } - return 0 + return ParseUpdateTierResponse(rsp) } -// ListClinicsForClinicianWithResponse request returning *ListClinicsForClinicianResponse -func (c *ClientWithResponses) ListClinicsForClinicianWithResponse(ctx context.Context, userId UserId, params *ListClinicsForClinicianParams, reqEditors ...RequestEditorFn) (*ListClinicsForClinicianResponse, error) { - rsp, err := c.ListClinicsForClinician(ctx, userId, params, reqEditors...) +func (c *ClientWithResponses) UpdateTierWithResponse(ctx context.Context, clinicId ClinicId, body UpdateTierJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTierResponse, error) { + rsp, err := c.UpdateTier(ctx, clinicId, body, reqEditors...) if err != nil { return nil, err } - return ParseListClinicsForClinicianResponse(rsp) + return ParseUpdateTierResponse(rsp) } -// EnableNewClinicExperienceWithResponse request returning *EnableNewClinicExperienceResponse -func (c *ClientWithResponses) EnableNewClinicExperienceWithResponse(ctx context.Context, userId string, reqEditors ...RequestEditorFn) (*EnableNewClinicExperienceResponse, error) { - rsp, err := c.EnableNewClinicExperience(ctx, userId, reqEditors...) +// UpdatePatientSummaryWithBodyWithResponse request with arbitrary body returning *UpdatePatientSummaryResponse +func (c *ClientWithResponses) UpdatePatientSummaryWithBodyWithResponse(ctx context.Context, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientSummaryResponse, error) { + rsp, err := c.UpdatePatientSummaryWithBody(ctx, patientId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseEnableNewClinicExperienceResponse(rsp) + return ParseUpdatePatientSummaryResponse(rsp) } -// ListClinicsWithResponse request returning *ListClinicsResponse -func (c *ClientWithResponses) ListClinicsWithResponse(ctx context.Context, params *ListClinicsParams, reqEditors ...RequestEditorFn) (*ListClinicsResponse, error) { - rsp, err := c.ListClinics(ctx, params, reqEditors...) +func (c *ClientWithResponses) UpdatePatientSummaryWithResponse(ctx context.Context, patientId PatientId, body UpdatePatientSummaryJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientSummaryResponse, error) { + rsp, err := c.UpdatePatientSummary(ctx, patientId, body, reqEditors...) if err != nil { return nil, err } - return ParseListClinicsResponse(rsp) + return ParseUpdatePatientSummaryResponse(rsp) } -// CreateClinicWithBodyWithResponse request with arbitrary body returning *CreateClinicResponse -func (c *ClientWithResponses) CreateClinicWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateClinicResponse, error) { - rsp, err := c.CreateClinicWithBody(ctx, contentType, body, reqEditors...) +// ListClinicsForPatientWithResponse request returning *ListClinicsForPatientResponse +func (c *ClientWithResponses) ListClinicsForPatientWithResponse(ctx context.Context, userId UserId, params *ListClinicsForPatientParams, reqEditors ...RequestEditorFn) (*ListClinicsForPatientResponse, error) { + rsp, err := c.ListClinicsForPatient(ctx, userId, params, reqEditors...) if err != nil { return nil, err } - return ParseCreateClinicResponse(rsp) + return ParseListClinicsForPatientResponse(rsp) } -func (c *ClientWithResponses) CreateClinicWithResponse(ctx context.Context, body CreateClinicJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateClinicResponse, error) { - rsp, err := c.CreateClinic(ctx, body, reqEditors...) +// UpdatePatientDataSourcesWithBodyWithResponse request with arbitrary body returning *UpdatePatientDataSourcesResponse +func (c *ClientWithResponses) UpdatePatientDataSourcesWithBodyWithResponse(ctx context.Context, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientDataSourcesResponse, error) { + rsp, err := c.UpdatePatientDataSourcesWithBody(ctx, userId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateClinicResponse(rsp) + return ParseUpdatePatientDataSourcesResponse(rsp) } -// GetClinicByShareCodeWithResponse request returning *GetClinicByShareCodeResponse -func (c *ClientWithResponses) GetClinicByShareCodeWithResponse(ctx context.Context, shareCode string, reqEditors ...RequestEditorFn) (*GetClinicByShareCodeResponse, error) { - rsp, err := c.GetClinicByShareCode(ctx, shareCode, reqEditors...) +func (c *ClientWithResponses) UpdatePatientDataSourcesWithResponse(ctx context.Context, userId UserId, body UpdatePatientDataSourcesJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientDataSourcesResponse, error) { + rsp, err := c.UpdatePatientDataSources(ctx, userId, body, reqEditors...) if err != nil { return nil, err } - return ParseGetClinicByShareCodeResponse(rsp) + return ParseUpdatePatientDataSourcesResponse(rsp) } -// GetClinicWithResponse request returning *GetClinicResponse -func (c *ClientWithResponses) GetClinicWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*GetClinicResponse, error) { - rsp, err := c.GetClinic(ctx, clinicId, reqEditors...) +// ProcessEHRMessageWithBodyWithResponse request with arbitrary body returning *ProcessEHRMessageResponse +func (c *ClientWithResponses) ProcessEHRMessageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProcessEHRMessageResponse, error) { + rsp, err := c.ProcessEHRMessageWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseProcessEHRMessageResponse(rsp) +} + +func (c *ClientWithResponses) ProcessEHRMessageWithResponse(ctx context.Context, body ProcessEHRMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*ProcessEHRMessageResponse, error) { + rsp, err := c.ProcessEHRMessage(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseGetClinicResponse(rsp) + return ParseProcessEHRMessageResponse(rsp) } -// UpdateClinicWithBodyWithResponse request with arbitrary body returning *UpdateClinicResponse -func (c *ClientWithResponses) UpdateClinicWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClinicResponse, error) { - rsp, err := c.UpdateClinicWithBody(ctx, clinicId, contentType, body, reqEditors...) +// MatchClinicAndPatientWithBodyWithResponse request with arbitrary body returning *MatchClinicAndPatientResponse +func (c *ClientWithResponses) MatchClinicAndPatientWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MatchClinicAndPatientResponse, error) { + rsp, err := c.MatchClinicAndPatientWithBody(ctx, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateClinicResponse(rsp) + return ParseMatchClinicAndPatientResponse(rsp) } -func (c *ClientWithResponses) UpdateClinicWithResponse(ctx context.Context, clinicId ClinicId, body UpdateClinicJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateClinicResponse, error) { - rsp, err := c.UpdateClinic(ctx, clinicId, body, reqEditors...) +func (c *ClientWithResponses) MatchClinicAndPatientWithResponse(ctx context.Context, body MatchClinicAndPatientJSONRequestBody, reqEditors ...RequestEditorFn) (*MatchClinicAndPatientResponse, error) { + rsp, err := c.MatchClinicAndPatient(ctx, body, reqEditors...) if err != nil { return nil, err } - return ParseUpdateClinicResponse(rsp) + return ParseMatchClinicAndPatientResponse(rsp) } -// ListCliniciansWithResponse request returning *ListCliniciansResponse -func (c *ClientWithResponses) ListCliniciansWithResponse(ctx context.Context, clinicId ClinicId, params *ListCliniciansParams, reqEditors ...RequestEditorFn) (*ListCliniciansResponse, error) { - rsp, err := c.ListClinicians(ctx, clinicId, params, reqEditors...) +// VerifyEndpointWithResponse request returning *VerifyEndpointResponse +func (c *ClientWithResponses) VerifyEndpointWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*VerifyEndpointResponse, error) { + rsp, err := c.VerifyEndpoint(ctx, reqEditors...) if err != nil { return nil, err } - return ParseListCliniciansResponse(rsp) + return ParseVerifyEndpointResponse(rsp) } -// CreateClinicianWithBodyWithResponse request with arbitrary body returning *CreateClinicianResponse -func (c *ClientWithResponses) CreateClinicianWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateClinicianResponse, error) { - rsp, err := c.CreateClinicianWithBody(ctx, clinicId, contentType, body, reqEditors...) +// DeleteUserFromClinicsWithResponse request returning *DeleteUserFromClinicsResponse +func (c *ClientWithResponses) DeleteUserFromClinicsWithResponse(ctx context.Context, userId UserId, reqEditors ...RequestEditorFn) (*DeleteUserFromClinicsResponse, error) { + rsp, err := c.DeleteUserFromClinics(ctx, userId, reqEditors...) if err != nil { return nil, err } - return ParseCreateClinicianResponse(rsp) + return ParseDeleteUserFromClinicsResponse(rsp) } -func (c *ClientWithResponses) CreateClinicianWithResponse(ctx context.Context, clinicId ClinicId, body CreateClinicianJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateClinicianResponse, error) { - rsp, err := c.CreateClinician(ctx, clinicId, body, reqEditors...) +// UpdateClinicUserDetailsWithBodyWithResponse request with arbitrary body returning *UpdateClinicUserDetailsResponse +func (c *ClientWithResponses) UpdateClinicUserDetailsWithBodyWithResponse(ctx context.Context, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClinicUserDetailsResponse, error) { + rsp, err := c.UpdateClinicUserDetailsWithBody(ctx, userId, contentType, body, reqEditors...) if err != nil { return nil, err } - return ParseCreateClinicianResponse(rsp) + return ParseUpdateClinicUserDetailsResponse(rsp) } -// DeleteClinicianWithResponse request returning *DeleteClinicianResponse -func (c *ClientWithResponses) DeleteClinicianWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, reqEditors ...RequestEditorFn) (*DeleteClinicianResponse, error) { - rsp, err := c.DeleteClinician(ctx, clinicId, clinicianId, reqEditors...) +func (c *ClientWithResponses) UpdateClinicUserDetailsWithResponse(ctx context.Context, userId UserId, body UpdateClinicUserDetailsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateClinicUserDetailsResponse, error) { + rsp, err := c.UpdateClinicUserDetails(ctx, userId, body, reqEditors...) if err != nil { return nil, err } - return ParseDeleteClinicianResponse(rsp) + return ParseUpdateClinicUserDetailsResponse(rsp) } -// GetClinicianWithResponse request returning *GetClinicianResponse -func (c *ClientWithResponses) GetClinicianWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, reqEditors ...RequestEditorFn) (*GetClinicianResponse, error) { - rsp, err := c.GetClinician(ctx, clinicId, clinicianId, reqEditors...) +// ParseListAllCliniciansResponse parses an HTTP response from a ListAllCliniciansWithResponse call +func ParseListAllCliniciansResponse(rsp *http.Response) (*ListAllCliniciansResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetClinicianResponse(rsp) + + response := &ListAllCliniciansResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []ClinicianClinicRelationship + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// UpdateClinicianWithBodyWithResponse request with arbitrary body returning *UpdateClinicianResponse -func (c *ClientWithResponses) UpdateClinicianWithBodyWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClinicianResponse, error) { - rsp, err := c.UpdateClinicianWithBody(ctx, clinicId, clinicianId, contentType, body, reqEditors...) +// ParseListClinicsForClinicianResponse parses an HTTP response from a ListClinicsForClinicianWithResponse call +func ParseListClinicsForClinicianResponse(rsp *http.Response) (*ListClinicsForClinicianResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdateClinicianResponse(rsp) + + response := &ListClinicsForClinicianResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest ClinicianClinicRelationships + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -func (c *ClientWithResponses) UpdateClinicianWithResponse(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, body UpdateClinicianJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateClinicianResponse, error) { - rsp, err := c.UpdateClinician(ctx, clinicId, clinicianId, body, reqEditors...) +// ParseEnableNewClinicExperienceResponse parses an HTTP response from a EnableNewClinicExperienceWithResponse call +func ParseEnableNewClinicExperienceResponse(rsp *http.Response) (*EnableNewClinicExperienceResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdateClinicianResponse(rsp) + + response := &EnableNewClinicExperienceResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Clinic + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// DeleteInvitedClinicianWithResponse request returning *DeleteInvitedClinicianResponse -func (c *ClientWithResponses) DeleteInvitedClinicianWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, reqEditors ...RequestEditorFn) (*DeleteInvitedClinicianResponse, error) { - rsp, err := c.DeleteInvitedClinician(ctx, clinicId, inviteId, reqEditors...) +// ParseListClinicsResponse parses an HTTP response from a ListClinicsWithResponse call +func ParseListClinicsResponse(rsp *http.Response) (*ListClinicsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseDeleteInvitedClinicianResponse(rsp) + + response := &ListClinicsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Clinics + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON403 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil } -// GetInvitedClinicianWithResponse request returning *GetInvitedClinicianResponse -func (c *ClientWithResponses) GetInvitedClinicianWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, reqEditors ...RequestEditorFn) (*GetInvitedClinicianResponse, error) { - rsp, err := c.GetInvitedClinician(ctx, clinicId, inviteId, reqEditors...) +// ParseCreateClinicResponse parses an HTTP response from a CreateClinicWithResponse call +func ParseCreateClinicResponse(rsp *http.Response) (*CreateClinicResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseGetInvitedClinicianResponse(rsp) + + response := &CreateClinicResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Clinic + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "xml") && rsp.StatusCode == 200: + var dest map[string]interface{} + if err := xml.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.XML200 = &dest + + } + + return response, nil } -// AssociateClinicianToUserWithBodyWithResponse request with arbitrary body returning *AssociateClinicianToUserResponse -func (c *ClientWithResponses) AssociateClinicianToUserWithBodyWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AssociateClinicianToUserResponse, error) { - rsp, err := c.AssociateClinicianToUserWithBody(ctx, clinicId, inviteId, contentType, body, reqEditors...) +// ParseGetClinicByShareCodeResponse parses an HTTP response from a GetClinicByShareCodeWithResponse call +func ParseGetClinicByShareCodeResponse(rsp *http.Response) (*GetClinicByShareCodeResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseAssociateClinicianToUserResponse(rsp) + + response := &GetClinicByShareCodeResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Clinic + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -func (c *ClientWithResponses) AssociateClinicianToUserWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, body AssociateClinicianToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*AssociateClinicianToUserResponse, error) { - rsp, err := c.AssociateClinicianToUser(ctx, clinicId, inviteId, body, reqEditors...) +// ParseDeleteClinicResponse parses an HTTP response from a DeleteClinicWithResponse call +func ParseDeleteClinicResponse(rsp *http.Response) (*DeleteClinicResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseAssociateClinicianToUserResponse(rsp) + + response := &DeleteClinicResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil } -// TriggerInitialMigrationWithResponse request returning *TriggerInitialMigrationResponse -func (c *ClientWithResponses) TriggerInitialMigrationWithResponse(ctx context.Context, clinicId string, reqEditors ...RequestEditorFn) (*TriggerInitialMigrationResponse, error) { - rsp, err := c.TriggerInitialMigration(ctx, clinicId, reqEditors...) +// ParseGetClinicResponse parses an HTTP response from a GetClinicWithResponse call +func ParseGetClinicResponse(rsp *http.Response) (*GetClinicResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseTriggerInitialMigrationResponse(rsp) + + response := &GetClinicResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Clinic + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// ListMigrationsWithResponse request returning *ListMigrationsResponse -func (c *ClientWithResponses) ListMigrationsWithResponse(ctx context.Context, clinicId string, reqEditors ...RequestEditorFn) (*ListMigrationsResponse, error) { - rsp, err := c.ListMigrations(ctx, clinicId, reqEditors...) +// ParseUpdateClinicResponse parses an HTTP response from a UpdateClinicWithResponse call +func ParseUpdateClinicResponse(rsp *http.Response) (*UpdateClinicResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseListMigrationsResponse(rsp) + + response := &UpdateClinicResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Clinic + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil } -// MigrateLegacyClinicianPatientsWithBodyWithResponse request with arbitrary body returning *MigrateLegacyClinicianPatientsResponse -func (c *ClientWithResponses) MigrateLegacyClinicianPatientsWithBodyWithResponse(ctx context.Context, clinicId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateLegacyClinicianPatientsResponse, error) { - rsp, err := c.MigrateLegacyClinicianPatientsWithBody(ctx, clinicId, contentType, body, reqEditors...) +// ParseListCliniciansResponse parses an HTTP response from a ListCliniciansWithResponse call +func ParseListCliniciansResponse(rsp *http.Response) (*ListCliniciansResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseMigrateLegacyClinicianPatientsResponse(rsp) -} -func (c *ClientWithResponses) MigrateLegacyClinicianPatientsWithResponse(ctx context.Context, clinicId string, body MigrateLegacyClinicianPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateLegacyClinicianPatientsResponse, error) { - rsp, err := c.MigrateLegacyClinicianPatients(ctx, clinicId, body, reqEditors...) - if err != nil { - return nil, err + response := &ListCliniciansResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseMigrateLegacyClinicianPatientsResponse(rsp) -} -// GetMigrationWithResponse request returning *GetMigrationResponse -func (c *ClientWithResponses) GetMigrationWithResponse(ctx context.Context, clinicId Id, userId UserId, reqEditors ...RequestEditorFn) (*GetMigrationResponse, error) { - rsp, err := c.GetMigration(ctx, clinicId, userId, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Clinicians + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseGetMigrationResponse(rsp) + + return response, nil } -// UpdateMigrationWithBodyWithResponse request with arbitrary body returning *UpdateMigrationResponse -func (c *ClientWithResponses) UpdateMigrationWithBodyWithResponse(ctx context.Context, clinicId Id, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMigrationResponse, error) { - rsp, err := c.UpdateMigrationWithBody(ctx, clinicId, userId, contentType, body, reqEditors...) +// ParseCreateClinicianResponse parses an HTTP response from a CreateClinicianWithResponse call +func ParseCreateClinicianResponse(rsp *http.Response) (*CreateClinicianResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdateMigrationResponse(rsp) -} -func (c *ClientWithResponses) UpdateMigrationWithResponse(ctx context.Context, clinicId Id, userId UserId, body UpdateMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMigrationResponse, error) { - rsp, err := c.UpdateMigration(ctx, clinicId, userId, body, reqEditors...) - if err != nil { - return nil, err + response := &CreateClinicianResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseUpdateMigrationResponse(rsp) + + return response, nil } -// ListPatientsWithResponse request returning *ListPatientsResponse -func (c *ClientWithResponses) ListPatientsWithResponse(ctx context.Context, clinicId ClinicId, params *ListPatientsParams, reqEditors ...RequestEditorFn) (*ListPatientsResponse, error) { - rsp, err := c.ListPatients(ctx, clinicId, params, reqEditors...) +// ParseDeleteClinicianResponse parses an HTTP response from a DeleteClinicianWithResponse call +func ParseDeleteClinicianResponse(rsp *http.Response) (*DeleteClinicianResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseListPatientsResponse(rsp) -} -// CreatePatientAccountWithBodyWithResponse request with arbitrary body returning *CreatePatientAccountResponse -func (c *ClientWithResponses) CreatePatientAccountWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePatientAccountResponse, error) { - rsp, err := c.CreatePatientAccountWithBody(ctx, clinicId, contentType, body, reqEditors...) - if err != nil { - return nil, err + response := &DeleteClinicianResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseCreatePatientAccountResponse(rsp) + + return response, nil } -func (c *ClientWithResponses) CreatePatientAccountWithResponse(ctx context.Context, clinicId ClinicId, body CreatePatientAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePatientAccountResponse, error) { - rsp, err := c.CreatePatientAccount(ctx, clinicId, body, reqEditors...) +// ParseGetClinicianResponse parses an HTTP response from a GetClinicianWithResponse call +func ParseGetClinicianResponse(rsp *http.Response) (*GetClinicianResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseCreatePatientAccountResponse(rsp) -} -// DeletePatientWithResponse request returning *DeletePatientResponse -func (c *ClientWithResponses) DeletePatientWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*DeletePatientResponse, error) { - rsp, err := c.DeletePatient(ctx, clinicId, patientId, reqEditors...) - if err != nil { - return nil, err + response := &GetClinicianResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseDeletePatientResponse(rsp) -} -// GetPatientWithResponse request returning *GetPatientResponse -func (c *ClientWithResponses) GetPatientWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*GetPatientResponse, error) { - rsp, err := c.GetPatient(ctx, clinicId, patientId, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Clinician + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseGetPatientResponse(rsp) + + return response, nil } -// CreatePatientFromUserWithBodyWithResponse request with arbitrary body returning *CreatePatientFromUserResponse -func (c *ClientWithResponses) CreatePatientFromUserWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePatientFromUserResponse, error) { - rsp, err := c.CreatePatientFromUserWithBody(ctx, clinicId, patientId, contentType, body, reqEditors...) +// ParseUpdateClinicianResponse parses an HTTP response from a UpdateClinicianWithResponse call +func ParseUpdateClinicianResponse(rsp *http.Response) (*UpdateClinicianResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseCreatePatientFromUserResponse(rsp) -} -func (c *ClientWithResponses) CreatePatientFromUserWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body CreatePatientFromUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePatientFromUserResponse, error) { - rsp, err := c.CreatePatientFromUser(ctx, clinicId, patientId, body, reqEditors...) - if err != nil { - return nil, err + response := &UpdateClinicianResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseCreatePatientFromUserResponse(rsp) + + return response, nil } -// UpdatePatientWithBodyWithResponse request with arbitrary body returning *UpdatePatientResponse -func (c *ClientWithResponses) UpdatePatientWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientResponse, error) { - rsp, err := c.UpdatePatientWithBody(ctx, clinicId, patientId, contentType, body, reqEditors...) +// ParseSyncEHRDataResponse parses an HTTP response from a SyncEHRDataWithResponse call +func ParseSyncEHRDataResponse(rsp *http.Response) (*SyncEHRDataResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdatePatientResponse(rsp) -} -func (c *ClientWithResponses) UpdatePatientWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body UpdatePatientJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientResponse, error) { - rsp, err := c.UpdatePatient(ctx, clinicId, patientId, body, reqEditors...) - if err != nil { - return nil, err + response := &SyncEHRDataResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseUpdatePatientResponse(rsp) + + return response, nil } -// UpdatePatientPermissionsWithBodyWithResponse request with arbitrary body returning *UpdatePatientPermissionsResponse -func (c *ClientWithResponses) UpdatePatientPermissionsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientPermissionsResponse, error) { - rsp, err := c.UpdatePatientPermissionsWithBody(ctx, clinicId, patientId, contentType, body, reqEditors...) +// ParseDeleteInvitedClinicianResponse parses an HTTP response from a DeleteInvitedClinicianWithResponse call +func ParseDeleteInvitedClinicianResponse(rsp *http.Response) (*DeleteInvitedClinicianResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseUpdatePatientPermissionsResponse(rsp) -} -func (c *ClientWithResponses) UpdatePatientPermissionsWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body UpdatePatientPermissionsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientPermissionsResponse, error) { - rsp, err := c.UpdatePatientPermissions(ctx, clinicId, patientId, body, reqEditors...) - if err != nil { - return nil, err + response := &DeleteInvitedClinicianResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseUpdatePatientPermissionsResponse(rsp) + + return response, nil } -// DeletePatientPermissionWithResponse request returning *DeletePatientPermissionResponse -func (c *ClientWithResponses) DeletePatientPermissionWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, permission string, reqEditors ...RequestEditorFn) (*DeletePatientPermissionResponse, error) { - rsp, err := c.DeletePatientPermission(ctx, clinicId, patientId, permission, reqEditors...) +// ParseGetInvitedClinicianResponse parses an HTTP response from a GetInvitedClinicianWithResponse call +func ParseGetInvitedClinicianResponse(rsp *http.Response) (*GetInvitedClinicianResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - return ParseDeletePatientPermissionResponse(rsp) -} -// ListClinicsForPatientWithResponse request returning *ListClinicsForPatientResponse -func (c *ClientWithResponses) ListClinicsForPatientWithResponse(ctx context.Context, userId UserId, params *ListClinicsForPatientParams, reqEditors ...RequestEditorFn) (*ListClinicsForPatientResponse, error) { - rsp, err := c.ListClinicsForPatient(ctx, userId, params, reqEditors...) - if err != nil { - return nil, err + response := &GetInvitedClinicianResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } - return ParseListClinicsForPatientResponse(rsp) -} -// DeleteUserFromClinicsWithResponse request returning *DeleteUserFromClinicsResponse -func (c *ClientWithResponses) DeleteUserFromClinicsWithResponse(ctx context.Context, userId UserId, reqEditors ...RequestEditorFn) (*DeleteUserFromClinicsResponse, error) { - rsp, err := c.DeleteUserFromClinics(ctx, userId, reqEditors...) - if err != nil { - return nil, err + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Clinician + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + } - return ParseDeleteUserFromClinicsResponse(rsp) + + return response, nil } -// ParseListClinicsForClinicianResponse parses an HTTP response from a ListClinicsForClinicianWithResponse call -func ParseListClinicsForClinicianResponse(rsp *http.Response) (*ListClinicsForClinicianResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseAssociateClinicianToUserResponse parses an HTTP response from a AssociateClinicianToUserWithResponse call +func ParseAssociateClinicianToUserResponse(rsp *http.Response) (*AssociateClinicianToUserResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListClinicsForClinicianResponse{ + response := &AssociateClinicianToUserResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest ClinicianClinicRelationships + var dest Clinician if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3423,22 +7032,22 @@ func ParseListClinicsForClinicianResponse(rsp *http.Response) (*ListClinicsForCl return response, nil } -// ParseEnableNewClinicExperienceResponse parses an HTTP response from a EnableNewClinicExperienceWithResponse call -func ParseEnableNewClinicExperienceResponse(rsp *http.Response) (*EnableNewClinicExperienceResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseListMembershipRestrictionsResponse parses an HTTP response from a ListMembershipRestrictionsWithResponse call +func ParseListMembershipRestrictionsResponse(rsp *http.Response) (*ListMembershipRestrictionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &EnableNewClinicExperienceResponse{ + response := &ListMembershipRestrictionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Clinic + var dest MembershipRestrictions if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3449,128 +7058,126 @@ func ParseEnableNewClinicExperienceResponse(rsp *http.Response) (*EnableNewClini return response, nil } -// ParseListClinicsResponse parses an HTTP response from a ListClinicsWithResponse call -func ParseListClinicsResponse(rsp *http.Response) (*ListClinicsResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseUpdateMembershipRestrictionsResponse parses an HTTP response from a UpdateMembershipRestrictionsWithResponse call +func ParseUpdateMembershipRestrictionsResponse(rsp *http.Response) (*UpdateMembershipRestrictionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListClinicsResponse{ + response := &UpdateMembershipRestrictionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Clinics + var dest MembershipRestrictions if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON400 = &dest + } - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403: - var dest Error - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON403 = &dest + return response, nil +} - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: - var dest Error +// ParseTriggerInitialMigrationResponse parses an HTTP response from a TriggerInitialMigrationWithResponse call +func ParseTriggerInitialMigrationResponse(rsp *http.Response) (*TriggerInitialMigrationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &TriggerInitialMigrationResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Migration if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON500 = &dest + response.JSON200 = &dest } return response, nil } -// ParseCreateClinicResponse parses an HTTP response from a CreateClinicWithResponse call -func ParseCreateClinicResponse(rsp *http.Response) (*CreateClinicResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseListMigrationsResponse parses an HTTP response from a ListMigrationsWithResponse call +func ParseListMigrationsResponse(rsp *http.Response) (*ListMigrationsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateClinicResponse{ + response := &ListMigrationsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Clinic + var dest Migrations if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } response.JSON200 = &dest - case strings.Contains(rsp.Header.Get("Content-Type"), "xml") && rsp.StatusCode == 200: - var dest map[string]interface{} - if err := xml.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.XML200 = &dest - } return response, nil } -// ParseGetClinicByShareCodeResponse parses an HTTP response from a GetClinicByShareCodeWithResponse call -func ParseGetClinicByShareCodeResponse(rsp *http.Response) (*GetClinicByShareCodeResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseMigrateLegacyClinicianPatientsResponse parses an HTTP response from a MigrateLegacyClinicianPatientsWithResponse call +func ParseMigrateLegacyClinicianPatientsResponse(rsp *http.Response) (*MigrateLegacyClinicianPatientsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetClinicByShareCodeResponse{ + response := &MigrateLegacyClinicianPatientsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Clinic + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: + var dest Migration if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON200 = &dest + response.JSON202 = &dest } return response, nil } -// ParseGetClinicResponse parses an HTTP response from a GetClinicWithResponse call -func ParseGetClinicResponse(rsp *http.Response) (*GetClinicResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseGetMigrationResponse parses an HTTP response from a GetMigrationWithResponse call +func ParseGetMigrationResponse(rsp *http.Response) (*GetMigrationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetClinicResponse{ + response := &GetMigrationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Clinic + var dest Migration if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3581,22 +7188,22 @@ func ParseGetClinicResponse(rsp *http.Response) (*GetClinicResponse, error) { return response, nil } -// ParseUpdateClinicResponse parses an HTTP response from a UpdateClinicWithResponse call -func ParseUpdateClinicResponse(rsp *http.Response) (*UpdateClinicResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseUpdateMigrationResponse parses an HTTP response from a UpdateMigrationWithResponse call +func ParseUpdateMigrationResponse(rsp *http.Response) (*UpdateMigrationResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateClinicResponse{ + response := &UpdateMigrationResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Clinic + var dest Migration if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3607,41 +7214,31 @@ func ParseUpdateClinicResponse(rsp *http.Response) (*UpdateClinicResponse, error return response, nil } -// ParseListCliniciansResponse parses an HTTP response from a ListCliniciansWithResponse call -func ParseListCliniciansResponse(rsp *http.Response) (*ListCliniciansResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseCreatePatientTagResponse parses an HTTP response from a CreatePatientTagWithResponse call +func ParseCreatePatientTagResponse(rsp *http.Response) (*CreatePatientTagResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListCliniciansResponse{ + response := &CreatePatientTagResponse{ Body: bodyBytes, HTTPResponse: rsp, } - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Clinicians - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - return response, nil } -// ParseCreateClinicianResponse parses an HTTP response from a CreateClinicianWithResponse call -func ParseCreateClinicianResponse(rsp *http.Response) (*CreateClinicianResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseDeletePatientTagResponse parses an HTTP response from a DeletePatientTagWithResponse call +func ParseDeletePatientTagResponse(rsp *http.Response) (*DeletePatientTagResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreateClinicianResponse{ + response := &DeletePatientTagResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -3649,15 +7246,15 @@ func ParseCreateClinicianResponse(rsp *http.Response) (*CreateClinicianResponse, return response, nil } -// ParseDeleteClinicianResponse parses an HTTP response from a DeleteClinicianWithResponse call -func ParseDeleteClinicianResponse(rsp *http.Response) (*DeleteClinicianResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseUpdatePatientTagResponse parses an HTTP response from a UpdatePatientTagWithResponse call +func ParseUpdatePatientTagResponse(rsp *http.Response) (*UpdatePatientTagResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteClinicianResponse{ + response := &UpdatePatientTagResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -3665,22 +7262,22 @@ func ParseDeleteClinicianResponse(rsp *http.Response) (*DeleteClinicianResponse, return response, nil } -// ParseGetClinicianResponse parses an HTTP response from a GetClinicianWithResponse call -func ParseGetClinicianResponse(rsp *http.Response) (*GetClinicianResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseListPatientsResponse parses an HTTP response from a ListPatientsWithResponse call +func ParseListPatientsResponse(rsp *http.Response) (*ListPatientsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetClinicianResponse{ + response := &ListPatientsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Clinician + var dest PatientsResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3691,31 +7288,41 @@ func ParseGetClinicianResponse(rsp *http.Response) (*GetClinicianResponse, error return response, nil } -// ParseUpdateClinicianResponse parses an HTTP response from a UpdateClinicianWithResponse call -func ParseUpdateClinicianResponse(rsp *http.Response) (*UpdateClinicianResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseCreatePatientAccountResponse parses an HTTP response from a CreatePatientAccountWithResponse call +func ParseCreatePatientAccountResponse(rsp *http.Response) (*CreatePatientAccountResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateClinicianResponse{ + response := &CreatePatientAccountResponse{ Body: bodyBytes, HTTPResponse: rsp, } + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Patient + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + return response, nil } -// ParseDeleteInvitedClinicianResponse parses an HTTP response from a DeleteInvitedClinicianWithResponse call -func ParseDeleteInvitedClinicianResponse(rsp *http.Response) (*DeleteInvitedClinicianResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseAssignPatientTagToClinicPatientsResponse parses an HTTP response from a AssignPatientTagToClinicPatientsWithResponse call +func ParseAssignPatientTagToClinicPatientsResponse(rsp *http.Response) (*AssignPatientTagToClinicPatientsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeleteInvitedClinicianResponse{ + response := &AssignPatientTagToClinicPatientsResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -3723,48 +7330,54 @@ func ParseDeleteInvitedClinicianResponse(rsp *http.Response) (*DeleteInvitedClin return response, nil } -// ParseGetInvitedClinicianResponse parses an HTTP response from a GetInvitedClinicianWithResponse call -func ParseGetInvitedClinicianResponse(rsp *http.Response) (*GetInvitedClinicianResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseDeletePatientTagFromClinicPatientsResponse parses an HTTP response from a DeletePatientTagFromClinicPatientsWithResponse call +func ParseDeletePatientTagFromClinicPatientsResponse(rsp *http.Response) (*DeletePatientTagFromClinicPatientsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetInvitedClinicianResponse{ + response := &DeletePatientTagFromClinicPatientsResponse{ Body: bodyBytes, HTTPResponse: rsp, } - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Clinician - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest + return response, nil +} + +// ParseDeletePatientResponse parses an HTTP response from a DeletePatientWithResponse call +func ParseDeletePatientResponse(rsp *http.Response) (*DeletePatientResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + response := &DeletePatientResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } return response, nil } -// ParseAssociateClinicianToUserResponse parses an HTTP response from a AssociateClinicianToUserWithResponse call -func ParseAssociateClinicianToUserResponse(rsp *http.Response) (*AssociateClinicianToUserResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseGetPatientResponse parses an HTTP response from a GetPatientWithResponse call +func ParseGetPatientResponse(rsp *http.Response) (*GetPatientResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &AssociateClinicianToUserResponse{ + response := &GetPatientResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Clinician + var dest Patient if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3775,22 +7388,22 @@ func ParseAssociateClinicianToUserResponse(rsp *http.Response) (*AssociateClinic return response, nil } -// ParseTriggerInitialMigrationResponse parses an HTTP response from a TriggerInitialMigrationWithResponse call -func ParseTriggerInitialMigrationResponse(rsp *http.Response) (*TriggerInitialMigrationResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseCreatePatientFromUserResponse parses an HTTP response from a CreatePatientFromUserWithResponse call +func ParseCreatePatientFromUserResponse(rsp *http.Response) (*CreatePatientFromUserResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &TriggerInitialMigrationResponse{ + response := &CreatePatientFromUserResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Migration + var dest Patient if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3801,22 +7414,22 @@ func ParseTriggerInitialMigrationResponse(rsp *http.Response) (*TriggerInitialMi return response, nil } -// ParseListMigrationsResponse parses an HTTP response from a ListMigrationsWithResponse call -func ParseListMigrationsResponse(rsp *http.Response) (*ListMigrationsResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseUpdatePatientResponse parses an HTTP response from a UpdatePatientWithResponse call +func ParseUpdatePatientResponse(rsp *http.Response) (*UpdatePatientResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListMigrationsResponse{ + response := &UpdatePatientResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Migrations + var dest Patient if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3827,74 +7440,64 @@ func ParseListMigrationsResponse(rsp *http.Response) (*ListMigrationsResponse, e return response, nil } -// ParseMigrateLegacyClinicianPatientsResponse parses an HTTP response from a MigrateLegacyClinicianPatientsWithResponse call -func ParseMigrateLegacyClinicianPatientsResponse(rsp *http.Response) (*MigrateLegacyClinicianPatientsResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseUpdatePatientPermissionsResponse parses an HTTP response from a UpdatePatientPermissionsWithResponse call +func ParseUpdatePatientPermissionsResponse(rsp *http.Response) (*UpdatePatientPermissionsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &MigrateLegacyClinicianPatientsResponse{ + response := &UpdatePatientPermissionsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 202: - var dest Migration + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PatientPermissions if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } - response.JSON202 = &dest + response.JSON200 = &dest } return response, nil } -// ParseGetMigrationResponse parses an HTTP response from a GetMigrationWithResponse call -func ParseGetMigrationResponse(rsp *http.Response) (*GetMigrationResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseDeletePatientPermissionResponse parses an HTTP response from a DeletePatientPermissionWithResponse call +func ParseDeletePatientPermissionResponse(rsp *http.Response) (*DeletePatientPermissionResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetMigrationResponse{ + response := &DeletePatientPermissionResponse{ Body: bodyBytes, HTTPResponse: rsp, } - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Migration - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - return response, nil } -// ParseUpdateMigrationResponse parses an HTTP response from a UpdateMigrationWithResponse call -func ParseUpdateMigrationResponse(rsp *http.Response) (*UpdateMigrationResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseSendDexcomConnectRequestResponse parses an HTTP response from a SendDexcomConnectRequestWithResponse call +func ParseSendDexcomConnectRequestResponse(rsp *http.Response) (*SendDexcomConnectRequestResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdateMigrationResponse{ + response := &SendDexcomConnectRequestResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Migration + var dest Patient if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3905,48 +7508,38 @@ func ParseUpdateMigrationResponse(rsp *http.Response) (*UpdateMigrationResponse, return response, nil } -// ParseListPatientsResponse parses an HTTP response from a ListPatientsWithResponse call -func ParseListPatientsResponse(rsp *http.Response) (*ListPatientsResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseSendUploadReminderResponse parses an HTTP response from a SendUploadReminderWithResponse call +func ParseSendUploadReminderResponse(rsp *http.Response) (*SendUploadReminderResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListPatientsResponse{ + response := &SendUploadReminderResponse{ Body: bodyBytes, HTTPResponse: rsp, } - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PatientsResponse - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest - - } - return response, nil } -// ParseCreatePatientAccountResponse parses an HTTP response from a CreatePatientAccountWithResponse call -func ParseCreatePatientAccountResponse(rsp *http.Response) (*CreatePatientAccountResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseGetEHRSettingsResponse parses an HTTP response from a GetEHRSettingsWithResponse call +func ParseGetEHRSettingsResponse(rsp *http.Response) (*GetEHRSettingsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreatePatientAccountResponse{ + response := &GetEHRSettingsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Patient + var dest EHRSettings if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3957,15 +7550,15 @@ func ParseCreatePatientAccountResponse(rsp *http.Response) (*CreatePatientAccoun return response, nil } -// ParseDeletePatientResponse parses an HTTP response from a DeletePatientWithResponse call -func ParseDeletePatientResponse(rsp *http.Response) (*DeletePatientResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseUpdateEHRSettingsResponse parses an HTTP response from a UpdateEHRSettingsWithResponse call +func ParseUpdateEHRSettingsResponse(rsp *http.Response) (*UpdateEHRSettingsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeletePatientResponse{ + response := &UpdateEHRSettingsResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -3973,22 +7566,22 @@ func ParseDeletePatientResponse(rsp *http.Response) (*DeletePatientResponse, err return response, nil } -// ParseGetPatientResponse parses an HTTP response from a GetPatientWithResponse call -func ParseGetPatientResponse(rsp *http.Response) (*GetPatientResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseGetMRNSettingsResponse parses an HTTP response from a GetMRNSettingsWithResponse call +func ParseGetMRNSettingsResponse(rsp *http.Response) (*GetMRNSettingsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &GetPatientResponse{ + response := &GetMRNSettingsResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Patient + var dest MRNSettings if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -3999,74 +7592,86 @@ func ParseGetPatientResponse(rsp *http.Response) (*GetPatientResponse, error) { return response, nil } -// ParseCreatePatientFromUserResponse parses an HTTP response from a CreatePatientFromUserWithResponse call -func ParseCreatePatientFromUserResponse(rsp *http.Response) (*CreatePatientFromUserResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseUpdateMRNSettingsResponse parses an HTTP response from a UpdateMRNSettingsWithResponse call +func ParseUpdateMRNSettingsResponse(rsp *http.Response) (*UpdateMRNSettingsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &CreatePatientFromUserResponse{ + response := &UpdateMRNSettingsResponse{ Body: bodyBytes, HTTPResponse: rsp, } - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Patient - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest + return response, nil +} + +// ParseUpdateSuppressedNotificationsResponse parses an HTTP response from a UpdateSuppressedNotificationsWithResponse call +func ParseUpdateSuppressedNotificationsResponse(rsp *http.Response) (*UpdateSuppressedNotificationsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + response := &UpdateSuppressedNotificationsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } return response, nil } -// ParseUpdatePatientResponse parses an HTTP response from a UpdatePatientWithResponse call -func ParseUpdatePatientResponse(rsp *http.Response) (*UpdatePatientResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseUpdateTierResponse parses an HTTP response from a UpdateTierWithResponse call +func ParseUpdateTierResponse(rsp *http.Response) (*UpdateTierResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdatePatientResponse{ + response := &UpdateTierResponse{ Body: bodyBytes, HTTPResponse: rsp, } - switch { - case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest Patient - if err := json.Unmarshal(bodyBytes, &dest); err != nil { - return nil, err - } - response.JSON200 = &dest + return response, nil +} + +// ParseUpdatePatientSummaryResponse parses an HTTP response from a UpdatePatientSummaryWithResponse call +func ParseUpdatePatientSummaryResponse(rsp *http.Response) (*UpdatePatientSummaryResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + response := &UpdatePatientSummaryResponse{ + Body: bodyBytes, + HTTPResponse: rsp, } return response, nil } -// ParseUpdatePatientPermissionsResponse parses an HTTP response from a UpdatePatientPermissionsWithResponse call -func ParseUpdatePatientPermissionsResponse(rsp *http.Response) (*UpdatePatientPermissionsResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseListClinicsForPatientResponse parses an HTTP response from a ListClinicsForPatientWithResponse call +func ParseListClinicsForPatientResponse(rsp *http.Response) (*ListClinicsForPatientResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &UpdatePatientPermissionsResponse{ + response := &ListClinicsForPatientResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PatientPermissions + var dest PatientClinicRelationships if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -4077,15 +7682,15 @@ func ParseUpdatePatientPermissionsResponse(rsp *http.Response) (*UpdatePatientPe return response, nil } -// ParseDeletePatientPermissionResponse parses an HTTP response from a DeletePatientPermissionWithResponse call -func ParseDeletePatientPermissionResponse(rsp *http.Response) (*DeletePatientPermissionResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseUpdatePatientDataSourcesResponse parses an HTTP response from a UpdatePatientDataSourcesWithResponse call +func ParseUpdatePatientDataSourcesResponse(rsp *http.Response) (*UpdatePatientDataSourcesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &DeletePatientPermissionResponse{ + response := &UpdatePatientDataSourcesResponse{ Body: bodyBytes, HTTPResponse: rsp, } @@ -4093,22 +7698,38 @@ func ParseDeletePatientPermissionResponse(rsp *http.Response) (*DeletePatientPer return response, nil } -// ParseListClinicsForPatientResponse parses an HTTP response from a ListClinicsForPatientWithResponse call -func ParseListClinicsForPatientResponse(rsp *http.Response) (*ListClinicsForPatientResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) +// ParseProcessEHRMessageResponse parses an HTTP response from a ProcessEHRMessageWithResponse call +func ParseProcessEHRMessageResponse(rsp *http.Response) (*ProcessEHRMessageResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err } - response := &ListClinicsForPatientResponse{ + response := &ProcessEHRMessageResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseMatchClinicAndPatientResponse parses an HTTP response from a MatchClinicAndPatientWithResponse call +func ParseMatchClinicAndPatientResponse(rsp *http.Response) (*MatchClinicAndPatientResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &MatchClinicAndPatientResponse{ Body: bodyBytes, HTTPResponse: rsp, } switch { case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: - var dest PatientClinicRelationships + var dest EHRMatchResponse if err := json.Unmarshal(bodyBytes, &dest); err != nil { return nil, err } @@ -4119,9 +7740,25 @@ func ParseListClinicsForPatientResponse(rsp *http.Response) (*ListClinicsForPati return response, nil } +// ParseVerifyEndpointResponse parses an HTTP response from a VerifyEndpointWithResponse call +func ParseVerifyEndpointResponse(rsp *http.Response) (*VerifyEndpointResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &VerifyEndpointResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + // ParseDeleteUserFromClinicsResponse parses an HTTP response from a DeleteUserFromClinicsWithResponse call func ParseDeleteUserFromClinicsResponse(rsp *http.Response) (*DeleteUserFromClinicsResponse, error) { - bodyBytes, err := ioutil.ReadAll(rsp.Body) + bodyBytes, err := io.ReadAll(rsp.Body) defer func() { _ = rsp.Body.Close() }() if err != nil { return nil, err @@ -4135,3 +7772,18 @@ func ParseDeleteUserFromClinicsResponse(rsp *http.Response) (*DeleteUserFromClin return response, nil } +// ParseUpdateClinicUserDetailsResponse parses an HTTP response from a UpdateClinicUserDetailsWithResponse call +func ParseUpdateClinicUserDetailsResponse(rsp *http.Response) (*UpdateClinicUserDetailsResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &UpdateClinicUserDetailsResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} diff --git a/vendor/github.com/tidepool-org/clinic/client/mock.go b/vendor/github.com/tidepool-org/clinic/client/mock.go index faf77c883..0011740d5 100644 --- a/vendor/github.com/tidepool-org/clinic/client/mock.go +++ b/vendor/github.com/tidepool-org/clinic/client/mock.go @@ -74,6 +74,46 @@ func (m *MockClientInterface) EXPECT() *MockClientInterfaceMockRecorder { return m.recorder } +// AssignPatientTagToClinicPatients mocks base method. +func (m *MockClientInterface) AssignPatientTagToClinicPatients(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body AssignPatientTagToClinicPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AssignPatientTagToClinicPatients", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AssignPatientTagToClinicPatients indicates an expected call of AssignPatientTagToClinicPatients. +func (mr *MockClientInterfaceMockRecorder) AssignPatientTagToClinicPatients(ctx, clinicId, patientTagId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AssignPatientTagToClinicPatients", reflect.TypeOf((*MockClientInterface)(nil).AssignPatientTagToClinicPatients), varargs...) +} + +// AssignPatientTagToClinicPatientsWithBody mocks base method. +func (m *MockClientInterface) AssignPatientTagToClinicPatientsWithBody(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AssignPatientTagToClinicPatientsWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AssignPatientTagToClinicPatientsWithBody indicates an expected call of AssignPatientTagToClinicPatientsWithBody. +func (mr *MockClientInterfaceMockRecorder) AssignPatientTagToClinicPatientsWithBody(ctx, clinicId, patientTagId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AssignPatientTagToClinicPatientsWithBody", reflect.TypeOf((*MockClientInterface)(nil).AssignPatientTagToClinicPatientsWithBody), varargs...) +} + // AssociateClinicianToUser mocks base method. func (m *MockClientInterface) AssociateClinicianToUser(ctx context.Context, clinicId ClinicId, inviteId InviteId, body AssociateClinicianToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -274,6 +314,66 @@ func (mr *MockClientInterfaceMockRecorder) CreatePatientFromUserWithBody(ctx, cl return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePatientFromUserWithBody", reflect.TypeOf((*MockClientInterface)(nil).CreatePatientFromUserWithBody), varargs...) } +// CreatePatientTag mocks base method. +func (m *MockClientInterface) CreatePatientTag(ctx context.Context, clinicId ClinicId, body CreatePatientTagJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreatePatientTag", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreatePatientTag indicates an expected call of CreatePatientTag. +func (mr *MockClientInterfaceMockRecorder) CreatePatientTag(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePatientTag", reflect.TypeOf((*MockClientInterface)(nil).CreatePatientTag), varargs...) +} + +// CreatePatientTagWithBody mocks base method. +func (m *MockClientInterface) CreatePatientTagWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreatePatientTagWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreatePatientTagWithBody indicates an expected call of CreatePatientTagWithBody. +func (mr *MockClientInterfaceMockRecorder) CreatePatientTagWithBody(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePatientTagWithBody", reflect.TypeOf((*MockClientInterface)(nil).CreatePatientTagWithBody), varargs...) +} + +// DeleteClinic mocks base method. +func (m *MockClientInterface) DeleteClinic(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeleteClinic", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteClinic indicates an expected call of DeleteClinic. +func (mr *MockClientInterfaceMockRecorder) DeleteClinic(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteClinic", reflect.TypeOf((*MockClientInterface)(nil).DeleteClinic), varargs...) +} + // DeleteClinician mocks base method. func (m *MockClientInterface) DeleteClinician(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -354,6 +454,66 @@ func (mr *MockClientInterfaceMockRecorder) DeletePatientPermission(ctx, clinicId return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePatientPermission", reflect.TypeOf((*MockClientInterface)(nil).DeletePatientPermission), varargs...) } +// DeletePatientTag mocks base method. +func (m *MockClientInterface) DeletePatientTag(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeletePatientTag", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeletePatientTag indicates an expected call of DeletePatientTag. +func (mr *MockClientInterfaceMockRecorder) DeletePatientTag(ctx, clinicId, patientTagId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePatientTag", reflect.TypeOf((*MockClientInterface)(nil).DeletePatientTag), varargs...) +} + +// DeletePatientTagFromClinicPatients mocks base method. +func (m *MockClientInterface) DeletePatientTagFromClinicPatients(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body DeletePatientTagFromClinicPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeletePatientTagFromClinicPatients", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeletePatientTagFromClinicPatients indicates an expected call of DeletePatientTagFromClinicPatients. +func (mr *MockClientInterfaceMockRecorder) DeletePatientTagFromClinicPatients(ctx, clinicId, patientTagId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePatientTagFromClinicPatients", reflect.TypeOf((*MockClientInterface)(nil).DeletePatientTagFromClinicPatients), varargs...) +} + +// DeletePatientTagFromClinicPatientsWithBody mocks base method. +func (m *MockClientInterface) DeletePatientTagFromClinicPatientsWithBody(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeletePatientTagFromClinicPatientsWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeletePatientTagFromClinicPatientsWithBody indicates an expected call of DeletePatientTagFromClinicPatientsWithBody. +func (mr *MockClientInterfaceMockRecorder) DeletePatientTagFromClinicPatientsWithBody(ctx, clinicId, patientTagId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePatientTagFromClinicPatientsWithBody", reflect.TypeOf((*MockClientInterface)(nil).DeletePatientTagFromClinicPatientsWithBody), varargs...) +} + // DeleteUserFromClinics mocks base method. func (m *MockClientInterface) DeleteUserFromClinics(ctx context.Context, userId UserId, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -454,6 +614,26 @@ func (mr *MockClientInterfaceMockRecorder) GetClinician(ctx, clinicId, clinician return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClinician", reflect.TypeOf((*MockClientInterface)(nil).GetClinician), varargs...) } +// GetEHRSettings mocks base method. +func (m *MockClientInterface) GetEHRSettings(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetEHRSettings", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetEHRSettings indicates an expected call of GetEHRSettings. +func (mr *MockClientInterfaceMockRecorder) GetEHRSettings(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEHRSettings", reflect.TypeOf((*MockClientInterface)(nil).GetEHRSettings), varargs...) +} + // GetInvitedClinician mocks base method. func (m *MockClientInterface) GetInvitedClinician(ctx context.Context, clinicId ClinicId, inviteId InviteId, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -474,6 +654,26 @@ func (mr *MockClientInterfaceMockRecorder) GetInvitedClinician(ctx, clinicId, in return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetInvitedClinician", reflect.TypeOf((*MockClientInterface)(nil).GetInvitedClinician), varargs...) } +// GetMRNSettings mocks base method. +func (m *MockClientInterface) GetMRNSettings(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetMRNSettings", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetMRNSettings indicates an expected call of GetMRNSettings. +func (mr *MockClientInterfaceMockRecorder) GetMRNSettings(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMRNSettings", reflect.TypeOf((*MockClientInterface)(nil).GetMRNSettings), varargs...) +} + // GetMigration mocks base method. func (m *MockClientInterface) GetMigration(ctx context.Context, clinicId Id, userId UserId, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -514,6 +714,26 @@ func (mr *MockClientInterfaceMockRecorder) GetPatient(ctx, clinicId, patientId i return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPatient", reflect.TypeOf((*MockClientInterface)(nil).GetPatient), varargs...) } +// ListAllClinicians mocks base method. +func (m *MockClientInterface) ListAllClinicians(ctx context.Context, params *ListAllCliniciansParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, params} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListAllClinicians", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllClinicians indicates an expected call of ListAllClinicians. +func (mr *MockClientInterfaceMockRecorder) ListAllClinicians(ctx, params interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, params}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllClinicians", reflect.TypeOf((*MockClientInterface)(nil).ListAllClinicians), varargs...) +} + // ListClinicians mocks base method. func (m *MockClientInterface) ListClinicians(ctx context.Context, clinicId ClinicId, params *ListCliniciansParams, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -594,6 +814,26 @@ func (mr *MockClientInterfaceMockRecorder) ListClinicsForPatient(ctx, userId, pa return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListClinicsForPatient", reflect.TypeOf((*MockClientInterface)(nil).ListClinicsForPatient), varargs...) } +// ListMembershipRestrictions mocks base method. +func (m *MockClientInterface) ListMembershipRestrictions(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListMembershipRestrictions", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListMembershipRestrictions indicates an expected call of ListMembershipRestrictions. +func (mr *MockClientInterfaceMockRecorder) ListMembershipRestrictions(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListMembershipRestrictions", reflect.TypeOf((*MockClientInterface)(nil).ListMembershipRestrictions), varargs...) +} + // ListMigrations mocks base method. func (m *MockClientInterface) ListMigrations(ctx context.Context, clinicId string, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -634,6 +874,46 @@ func (mr *MockClientInterfaceMockRecorder) ListPatients(ctx, clinicId, params in return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPatients", reflect.TypeOf((*MockClientInterface)(nil).ListPatients), varargs...) } +// MatchClinicAndPatient mocks base method. +func (m *MockClientInterface) MatchClinicAndPatient(ctx context.Context, body MatchClinicAndPatientJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "MatchClinicAndPatient", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MatchClinicAndPatient indicates an expected call of MatchClinicAndPatient. +func (mr *MockClientInterfaceMockRecorder) MatchClinicAndPatient(ctx, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MatchClinicAndPatient", reflect.TypeOf((*MockClientInterface)(nil).MatchClinicAndPatient), varargs...) +} + +// MatchClinicAndPatientWithBody mocks base method. +func (m *MockClientInterface) MatchClinicAndPatientWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "MatchClinicAndPatientWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MatchClinicAndPatientWithBody indicates an expected call of MatchClinicAndPatientWithBody. +func (mr *MockClientInterfaceMockRecorder) MatchClinicAndPatientWithBody(ctx, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MatchClinicAndPatientWithBody", reflect.TypeOf((*MockClientInterface)(nil).MatchClinicAndPatientWithBody), varargs...) +} + // MigrateLegacyClinicianPatients mocks base method. func (m *MockClientInterface) MigrateLegacyClinicianPatients(ctx context.Context, clinicId string, body MigrateLegacyClinicianPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -674,143 +954,423 @@ func (mr *MockClientInterfaceMockRecorder) MigrateLegacyClinicianPatientsWithBod return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MigrateLegacyClinicianPatientsWithBody", reflect.TypeOf((*MockClientInterface)(nil).MigrateLegacyClinicianPatientsWithBody), varargs...) } -// TriggerInitialMigration mocks base method. -func (m *MockClientInterface) TriggerInitialMigration(ctx context.Context, clinicId string, reqEditors ...RequestEditorFn) (*http.Response, error) { +// ProcessEHRMessage mocks base method. +func (m *MockClientInterface) ProcessEHRMessage(ctx context.Context, body ProcessEHRMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, clinicId} + varargs := []interface{}{ctx, body} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "TriggerInitialMigration", varargs...) + ret := m.ctrl.Call(m, "ProcessEHRMessage", varargs...) ret0, _ := ret[0].(*http.Response) ret1, _ := ret[1].(error) return ret0, ret1 } -// TriggerInitialMigration indicates an expected call of TriggerInitialMigration. -func (mr *MockClientInterfaceMockRecorder) TriggerInitialMigration(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { +// ProcessEHRMessage indicates an expected call of ProcessEHRMessage. +func (mr *MockClientInterfaceMockRecorder) ProcessEHRMessage(ctx, body interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clinicId}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TriggerInitialMigration", reflect.TypeOf((*MockClientInterface)(nil).TriggerInitialMigration), varargs...) + varargs := append([]interface{}{ctx, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessEHRMessage", reflect.TypeOf((*MockClientInterface)(nil).ProcessEHRMessage), varargs...) } -// UpdateClinic mocks base method. -func (m *MockClientInterface) UpdateClinic(ctx context.Context, clinicId ClinicId, body UpdateClinicJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { +// ProcessEHRMessageWithBody mocks base method. +func (m *MockClientInterface) ProcessEHRMessageWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, clinicId, body} + varargs := []interface{}{ctx, contentType, body} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "UpdateClinic", varargs...) + ret := m.ctrl.Call(m, "ProcessEHRMessageWithBody", varargs...) ret0, _ := ret[0].(*http.Response) ret1, _ := ret[1].(error) return ret0, ret1 } -// UpdateClinic indicates an expected call of UpdateClinic. -func (mr *MockClientInterfaceMockRecorder) UpdateClinic(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { +// ProcessEHRMessageWithBody indicates an expected call of ProcessEHRMessageWithBody. +func (mr *MockClientInterfaceMockRecorder) ProcessEHRMessageWithBody(ctx, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClinic", reflect.TypeOf((*MockClientInterface)(nil).UpdateClinic), varargs...) + varargs := append([]interface{}{ctx, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessEHRMessageWithBody", reflect.TypeOf((*MockClientInterface)(nil).ProcessEHRMessageWithBody), varargs...) } -// UpdateClinicWithBody mocks base method. -func (m *MockClientInterface) UpdateClinicWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { +// SendDexcomConnectRequest mocks base method. +func (m *MockClientInterface) SendDexcomConnectRequest(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, clinicId, contentType, body} + varargs := []interface{}{ctx, clinicId, patientId} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "UpdateClinicWithBody", varargs...) + ret := m.ctrl.Call(m, "SendDexcomConnectRequest", varargs...) ret0, _ := ret[0].(*http.Response) ret1, _ := ret[1].(error) return ret0, ret1 } -// UpdateClinicWithBody indicates an expected call of UpdateClinicWithBody. -func (mr *MockClientInterfaceMockRecorder) UpdateClinicWithBody(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { +// SendDexcomConnectRequest indicates an expected call of SendDexcomConnectRequest. +func (mr *MockClientInterfaceMockRecorder) SendDexcomConnectRequest(ctx, clinicId, patientId interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClinicWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateClinicWithBody), varargs...) + varargs := append([]interface{}{ctx, clinicId, patientId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendDexcomConnectRequest", reflect.TypeOf((*MockClientInterface)(nil).SendDexcomConnectRequest), varargs...) } -// UpdateClinician mocks base method. -func (m *MockClientInterface) UpdateClinician(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, body UpdateClinicianJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { +// SendUploadReminder mocks base method. +func (m *MockClientInterface) SendUploadReminder(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, clinicId, clinicianId, body} + varargs := []interface{}{ctx, clinicId, patientId} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "UpdateClinician", varargs...) + ret := m.ctrl.Call(m, "SendUploadReminder", varargs...) ret0, _ := ret[0].(*http.Response) ret1, _ := ret[1].(error) return ret0, ret1 } -// UpdateClinician indicates an expected call of UpdateClinician. -func (mr *MockClientInterfaceMockRecorder) UpdateClinician(ctx, clinicId, clinicianId, body interface{}, reqEditors ...interface{}) *gomock.Call { +// SendUploadReminder indicates an expected call of SendUploadReminder. +func (mr *MockClientInterfaceMockRecorder) SendUploadReminder(ctx, clinicId, patientId interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clinicId, clinicianId, body}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClinician", reflect.TypeOf((*MockClientInterface)(nil).UpdateClinician), varargs...) + varargs := append([]interface{}{ctx, clinicId, patientId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendUploadReminder", reflect.TypeOf((*MockClientInterface)(nil).SendUploadReminder), varargs...) } -// UpdateClinicianWithBody mocks base method. -func (m *MockClientInterface) UpdateClinicianWithBody(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { +// SyncEHRData mocks base method. +func (m *MockClientInterface) SyncEHRData(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, clinicId, clinicianId, contentType, body} + varargs := []interface{}{ctx, clinicId} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "UpdateClinicianWithBody", varargs...) + ret := m.ctrl.Call(m, "SyncEHRData", varargs...) ret0, _ := ret[0].(*http.Response) ret1, _ := ret[1].(error) return ret0, ret1 } -// UpdateClinicianWithBody indicates an expected call of UpdateClinicianWithBody. -func (mr *MockClientInterfaceMockRecorder) UpdateClinicianWithBody(ctx, clinicId, clinicianId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { +// SyncEHRData indicates an expected call of SyncEHRData. +func (mr *MockClientInterfaceMockRecorder) SyncEHRData(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clinicId, clinicianId, contentType, body}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClinicianWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateClinicianWithBody), varargs...) + varargs := append([]interface{}{ctx, clinicId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncEHRData", reflect.TypeOf((*MockClientInterface)(nil).SyncEHRData), varargs...) } -// UpdateMigration mocks base method. -func (m *MockClientInterface) UpdateMigration(ctx context.Context, clinicId Id, userId UserId, body UpdateMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { +// TriggerInitialMigration mocks base method. +func (m *MockClientInterface) TriggerInitialMigration(ctx context.Context, clinicId string, body TriggerInitialMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, clinicId, userId, body} + varargs := []interface{}{ctx, clinicId, body} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "UpdateMigration", varargs...) + ret := m.ctrl.Call(m, "TriggerInitialMigration", varargs...) ret0, _ := ret[0].(*http.Response) ret1, _ := ret[1].(error) return ret0, ret1 } -// UpdateMigration indicates an expected call of UpdateMigration. -func (mr *MockClientInterfaceMockRecorder) UpdateMigration(ctx, clinicId, userId, body interface{}, reqEditors ...interface{}) *gomock.Call { +// TriggerInitialMigration indicates an expected call of TriggerInitialMigration. +func (mr *MockClientInterfaceMockRecorder) TriggerInitialMigration(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clinicId, userId, body}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMigration", reflect.TypeOf((*MockClientInterface)(nil).UpdateMigration), varargs...) + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TriggerInitialMigration", reflect.TypeOf((*MockClientInterface)(nil).TriggerInitialMigration), varargs...) } -// UpdateMigrationWithBody mocks base method. -func (m *MockClientInterface) UpdateMigrationWithBody(ctx context.Context, clinicId Id, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { +// TriggerInitialMigrationWithBody mocks base method. +func (m *MockClientInterface) TriggerInitialMigrationWithBody(ctx context.Context, clinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, clinicId, userId, contentType, body} + varargs := []interface{}{ctx, clinicId, contentType, body} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "UpdateMigrationWithBody", varargs...) + ret := m.ctrl.Call(m, "TriggerInitialMigrationWithBody", varargs...) ret0, _ := ret[0].(*http.Response) ret1, _ := ret[1].(error) return ret0, ret1 } -// UpdateMigrationWithBody indicates an expected call of UpdateMigrationWithBody. -func (mr *MockClientInterfaceMockRecorder) UpdateMigrationWithBody(ctx, clinicId, userId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { +// TriggerInitialMigrationWithBody indicates an expected call of TriggerInitialMigrationWithBody. +func (mr *MockClientInterfaceMockRecorder) TriggerInitialMigrationWithBody(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clinicId, userId, contentType, body}, reqEditors...) + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TriggerInitialMigrationWithBody", reflect.TypeOf((*MockClientInterface)(nil).TriggerInitialMigrationWithBody), varargs...) +} + +// UpdateClinic mocks base method. +func (m *MockClientInterface) UpdateClinic(ctx context.Context, clinicId ClinicId, body UpdateClinicJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateClinic", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateClinic indicates an expected call of UpdateClinic. +func (mr *MockClientInterfaceMockRecorder) UpdateClinic(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClinic", reflect.TypeOf((*MockClientInterface)(nil).UpdateClinic), varargs...) +} + +// UpdateClinicUserDetails mocks base method. +func (m *MockClientInterface) UpdateClinicUserDetails(ctx context.Context, userId UserId, body UpdateClinicUserDetailsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, userId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateClinicUserDetails", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateClinicUserDetails indicates an expected call of UpdateClinicUserDetails. +func (mr *MockClientInterfaceMockRecorder) UpdateClinicUserDetails(ctx, userId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, userId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClinicUserDetails", reflect.TypeOf((*MockClientInterface)(nil).UpdateClinicUserDetails), varargs...) +} + +// UpdateClinicUserDetailsWithBody mocks base method. +func (m *MockClientInterface) UpdateClinicUserDetailsWithBody(ctx context.Context, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, userId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateClinicUserDetailsWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateClinicUserDetailsWithBody indicates an expected call of UpdateClinicUserDetailsWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdateClinicUserDetailsWithBody(ctx, userId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, userId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClinicUserDetailsWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateClinicUserDetailsWithBody), varargs...) +} + +// UpdateClinicWithBody mocks base method. +func (m *MockClientInterface) UpdateClinicWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateClinicWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateClinicWithBody indicates an expected call of UpdateClinicWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdateClinicWithBody(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClinicWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateClinicWithBody), varargs...) +} + +// UpdateClinician mocks base method. +func (m *MockClientInterface) UpdateClinician(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, body UpdateClinicianJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, clinicianId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateClinician", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateClinician indicates an expected call of UpdateClinician. +func (mr *MockClientInterfaceMockRecorder) UpdateClinician(ctx, clinicId, clinicianId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, clinicianId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClinician", reflect.TypeOf((*MockClientInterface)(nil).UpdateClinician), varargs...) +} + +// UpdateClinicianWithBody mocks base method. +func (m *MockClientInterface) UpdateClinicianWithBody(ctx context.Context, clinicId ClinicId, clinicianId ClinicianId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, clinicianId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateClinicianWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateClinicianWithBody indicates an expected call of UpdateClinicianWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdateClinicianWithBody(ctx, clinicId, clinicianId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, clinicianId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClinicianWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateClinicianWithBody), varargs...) +} + +// UpdateEHRSettings mocks base method. +func (m *MockClientInterface) UpdateEHRSettings(ctx context.Context, clinicId ClinicId, body UpdateEHRSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateEHRSettings", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateEHRSettings indicates an expected call of UpdateEHRSettings. +func (mr *MockClientInterfaceMockRecorder) UpdateEHRSettings(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateEHRSettings", reflect.TypeOf((*MockClientInterface)(nil).UpdateEHRSettings), varargs...) +} + +// UpdateEHRSettingsWithBody mocks base method. +func (m *MockClientInterface) UpdateEHRSettingsWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateEHRSettingsWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateEHRSettingsWithBody indicates an expected call of UpdateEHRSettingsWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdateEHRSettingsWithBody(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateEHRSettingsWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateEHRSettingsWithBody), varargs...) +} + +// UpdateMRNSettings mocks base method. +func (m *MockClientInterface) UpdateMRNSettings(ctx context.Context, clinicId ClinicId, body UpdateMRNSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateMRNSettings", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateMRNSettings indicates an expected call of UpdateMRNSettings. +func (mr *MockClientInterfaceMockRecorder) UpdateMRNSettings(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMRNSettings", reflect.TypeOf((*MockClientInterface)(nil).UpdateMRNSettings), varargs...) +} + +// UpdateMRNSettingsWithBody mocks base method. +func (m *MockClientInterface) UpdateMRNSettingsWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateMRNSettingsWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateMRNSettingsWithBody indicates an expected call of UpdateMRNSettingsWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdateMRNSettingsWithBody(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMRNSettingsWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateMRNSettingsWithBody), varargs...) +} + +// UpdateMembershipRestrictions mocks base method. +func (m *MockClientInterface) UpdateMembershipRestrictions(ctx context.Context, clinicId ClinicId, body UpdateMembershipRestrictionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateMembershipRestrictions", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateMembershipRestrictions indicates an expected call of UpdateMembershipRestrictions. +func (mr *MockClientInterfaceMockRecorder) UpdateMembershipRestrictions(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMembershipRestrictions", reflect.TypeOf((*MockClientInterface)(nil).UpdateMembershipRestrictions), varargs...) +} + +// UpdateMembershipRestrictionsWithBody mocks base method. +func (m *MockClientInterface) UpdateMembershipRestrictionsWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateMembershipRestrictionsWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateMembershipRestrictionsWithBody indicates an expected call of UpdateMembershipRestrictionsWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdateMembershipRestrictionsWithBody(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMembershipRestrictionsWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateMembershipRestrictionsWithBody), varargs...) +} + +// UpdateMigration mocks base method. +func (m *MockClientInterface) UpdateMigration(ctx context.Context, clinicId Id, userId UserId, body UpdateMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, userId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateMigration", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateMigration indicates an expected call of UpdateMigration. +func (mr *MockClientInterfaceMockRecorder) UpdateMigration(ctx, clinicId, userId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, userId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMigration", reflect.TypeOf((*MockClientInterface)(nil).UpdateMigration), varargs...) +} + +// UpdateMigrationWithBody mocks base method. +func (m *MockClientInterface) UpdateMigrationWithBody(ctx context.Context, clinicId Id, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, userId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateMigrationWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateMigrationWithBody indicates an expected call of UpdateMigrationWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdateMigrationWithBody(ctx, clinicId, userId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, userId, contentType, body}, reqEditors...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMigrationWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateMigrationWithBody), varargs...) } @@ -834,6 +1394,46 @@ func (mr *MockClientInterfaceMockRecorder) UpdatePatient(ctx, clinicId, patientI return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatient", reflect.TypeOf((*MockClientInterface)(nil).UpdatePatient), varargs...) } +// UpdatePatientDataSources mocks base method. +func (m *MockClientInterface) UpdatePatientDataSources(ctx context.Context, userId UserId, body UpdatePatientDataSourcesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, userId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePatientDataSources", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdatePatientDataSources indicates an expected call of UpdatePatientDataSources. +func (mr *MockClientInterfaceMockRecorder) UpdatePatientDataSources(ctx, userId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, userId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientDataSources", reflect.TypeOf((*MockClientInterface)(nil).UpdatePatientDataSources), varargs...) +} + +// UpdatePatientDataSourcesWithBody mocks base method. +func (m *MockClientInterface) UpdatePatientDataSourcesWithBody(ctx context.Context, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, userId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePatientDataSourcesWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdatePatientDataSourcesWithBody indicates an expected call of UpdatePatientDataSourcesWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdatePatientDataSourcesWithBody(ctx, userId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, userId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientDataSourcesWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdatePatientDataSourcesWithBody), varargs...) +} + // UpdatePatientPermissions mocks base method. func (m *MockClientInterface) UpdatePatientPermissions(ctx context.Context, clinicId ClinicId, patientId PatientId, body UpdatePatientPermissionsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -874,6 +1474,86 @@ func (mr *MockClientInterfaceMockRecorder) UpdatePatientPermissionsWithBody(ctx, return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientPermissionsWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdatePatientPermissionsWithBody), varargs...) } +// UpdatePatientSummary mocks base method. +func (m *MockClientInterface) UpdatePatientSummary(ctx context.Context, patientId PatientId, body UpdatePatientSummaryJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, patientId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePatientSummary", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdatePatientSummary indicates an expected call of UpdatePatientSummary. +func (mr *MockClientInterfaceMockRecorder) UpdatePatientSummary(ctx, patientId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, patientId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientSummary", reflect.TypeOf((*MockClientInterface)(nil).UpdatePatientSummary), varargs...) +} + +// UpdatePatientSummaryWithBody mocks base method. +func (m *MockClientInterface) UpdatePatientSummaryWithBody(ctx context.Context, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, patientId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePatientSummaryWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdatePatientSummaryWithBody indicates an expected call of UpdatePatientSummaryWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdatePatientSummaryWithBody(ctx, patientId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, patientId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientSummaryWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdatePatientSummaryWithBody), varargs...) +} + +// UpdatePatientTag mocks base method. +func (m *MockClientInterface) UpdatePatientTag(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body UpdatePatientTagJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePatientTag", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdatePatientTag indicates an expected call of UpdatePatientTag. +func (mr *MockClientInterfaceMockRecorder) UpdatePatientTag(ctx, clinicId, patientTagId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientTag", reflect.TypeOf((*MockClientInterface)(nil).UpdatePatientTag), varargs...) +} + +// UpdatePatientTagWithBody mocks base method. +func (m *MockClientInterface) UpdatePatientTagWithBody(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePatientTagWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdatePatientTagWithBody indicates an expected call of UpdatePatientTagWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdatePatientTagWithBody(ctx, clinicId, patientTagId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientTagWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdatePatientTagWithBody), varargs...) +} + // UpdatePatientWithBody mocks base method. func (m *MockClientInterface) UpdatePatientWithBody(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { m.ctrl.T.Helper() @@ -894,6 +1574,106 @@ func (mr *MockClientInterfaceMockRecorder) UpdatePatientWithBody(ctx, clinicId, return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdatePatientWithBody), varargs...) } +// UpdateSuppressedNotifications mocks base method. +func (m *MockClientInterface) UpdateSuppressedNotifications(ctx context.Context, clinicId ClinicId, body UpdateSuppressedNotificationsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateSuppressedNotifications", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateSuppressedNotifications indicates an expected call of UpdateSuppressedNotifications. +func (mr *MockClientInterfaceMockRecorder) UpdateSuppressedNotifications(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSuppressedNotifications", reflect.TypeOf((*MockClientInterface)(nil).UpdateSuppressedNotifications), varargs...) +} + +// UpdateSuppressedNotificationsWithBody mocks base method. +func (m *MockClientInterface) UpdateSuppressedNotificationsWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateSuppressedNotificationsWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateSuppressedNotificationsWithBody indicates an expected call of UpdateSuppressedNotificationsWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdateSuppressedNotificationsWithBody(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSuppressedNotificationsWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateSuppressedNotificationsWithBody), varargs...) +} + +// UpdateTier mocks base method. +func (m *MockClientInterface) UpdateTier(ctx context.Context, clinicId ClinicId, body UpdateTierJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateTier", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateTier indicates an expected call of UpdateTier. +func (mr *MockClientInterfaceMockRecorder) UpdateTier(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTier", reflect.TypeOf((*MockClientInterface)(nil).UpdateTier), varargs...) +} + +// UpdateTierWithBody mocks base method. +func (m *MockClientInterface) UpdateTierWithBody(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateTierWithBody", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateTierWithBody indicates an expected call of UpdateTierWithBody. +func (mr *MockClientInterfaceMockRecorder) UpdateTierWithBody(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTierWithBody", reflect.TypeOf((*MockClientInterface)(nil).UpdateTierWithBody), varargs...) +} + +// VerifyEndpoint mocks base method. +func (m *MockClientInterface) VerifyEndpoint(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "VerifyEndpoint", varargs...) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// VerifyEndpoint indicates an expected call of VerifyEndpoint. +func (mr *MockClientInterfaceMockRecorder) VerifyEndpoint(ctx interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyEndpoint", reflect.TypeOf((*MockClientInterface)(nil).VerifyEndpoint), varargs...) +} + // MockClientWithResponsesInterface is a mock of ClientWithResponsesInterface interface. type MockClientWithResponsesInterface struct { ctrl *gomock.Controller @@ -917,6 +1697,46 @@ func (m *MockClientWithResponsesInterface) EXPECT() *MockClientWithResponsesInte return m.recorder } +// AssignPatientTagToClinicPatientsWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) AssignPatientTagToClinicPatientsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AssignPatientTagToClinicPatientsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AssignPatientTagToClinicPatientsWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*AssignPatientTagToClinicPatientsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AssignPatientTagToClinicPatientsWithBodyWithResponse indicates an expected call of AssignPatientTagToClinicPatientsWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) AssignPatientTagToClinicPatientsWithBodyWithResponse(ctx, clinicId, patientTagId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AssignPatientTagToClinicPatientsWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).AssignPatientTagToClinicPatientsWithBodyWithResponse), varargs...) +} + +// AssignPatientTagToClinicPatientsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) AssignPatientTagToClinicPatientsWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body AssignPatientTagToClinicPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*AssignPatientTagToClinicPatientsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "AssignPatientTagToClinicPatientsWithResponse", varargs...) + ret0, _ := ret[0].(*AssignPatientTagToClinicPatientsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// AssignPatientTagToClinicPatientsWithResponse indicates an expected call of AssignPatientTagToClinicPatientsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) AssignPatientTagToClinicPatientsWithResponse(ctx, clinicId, patientTagId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AssignPatientTagToClinicPatientsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).AssignPatientTagToClinicPatientsWithResponse), varargs...) +} + // AssociateClinicianToUserWithBodyWithResponse mocks base method. func (m *MockClientWithResponsesInterface) AssociateClinicianToUserWithBodyWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AssociateClinicianToUserResponse, error) { m.ctrl.T.Helper() @@ -1093,28 +1913,88 @@ func (m *MockClientWithResponsesInterface) CreatePatientFromUserWithBodyWithResp // CreatePatientFromUserWithBodyWithResponse indicates an expected call of CreatePatientFromUserWithBodyWithResponse. func (mr *MockClientWithResponsesInterfaceMockRecorder) CreatePatientFromUserWithBodyWithResponse(ctx, clinicId, patientId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clinicId, patientId, contentType, body}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePatientFromUserWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreatePatientFromUserWithBodyWithResponse), varargs...) + varargs := append([]interface{}{ctx, clinicId, patientId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePatientFromUserWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreatePatientFromUserWithBodyWithResponse), varargs...) +} + +// CreatePatientFromUserWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) CreatePatientFromUserWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body CreatePatientFromUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePatientFromUserResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreatePatientFromUserWithResponse", varargs...) + ret0, _ := ret[0].(*CreatePatientFromUserResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreatePatientFromUserWithResponse indicates an expected call of CreatePatientFromUserWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) CreatePatientFromUserWithResponse(ctx, clinicId, patientId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePatientFromUserWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreatePatientFromUserWithResponse), varargs...) +} + +// CreatePatientTagWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) CreatePatientTagWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreatePatientTagResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreatePatientTagWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*CreatePatientTagResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreatePatientTagWithBodyWithResponse indicates an expected call of CreatePatientTagWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) CreatePatientTagWithBodyWithResponse(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePatientTagWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreatePatientTagWithBodyWithResponse), varargs...) +} + +// CreatePatientTagWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) CreatePatientTagWithResponse(ctx context.Context, clinicId ClinicId, body CreatePatientTagJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePatientTagResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreatePatientTagWithResponse", varargs...) + ret0, _ := ret[0].(*CreatePatientTagResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreatePatientTagWithResponse indicates an expected call of CreatePatientTagWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) CreatePatientTagWithResponse(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePatientTagWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreatePatientTagWithResponse), varargs...) } -// CreatePatientFromUserWithResponse mocks base method. -func (m *MockClientWithResponsesInterface) CreatePatientFromUserWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, body CreatePatientFromUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreatePatientFromUserResponse, error) { +// DeleteClinicWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) DeleteClinicWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*DeleteClinicResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, clinicId, patientId, body} + varargs := []interface{}{ctx, clinicId} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "CreatePatientFromUserWithResponse", varargs...) - ret0, _ := ret[0].(*CreatePatientFromUserResponse) + ret := m.ctrl.Call(m, "DeleteClinicWithResponse", varargs...) + ret0, _ := ret[0].(*DeleteClinicResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// CreatePatientFromUserWithResponse indicates an expected call of CreatePatientFromUserWithResponse. -func (mr *MockClientWithResponsesInterfaceMockRecorder) CreatePatientFromUserWithResponse(ctx, clinicId, patientId, body interface{}, reqEditors ...interface{}) *gomock.Call { +// DeleteClinicWithResponse indicates an expected call of DeleteClinicWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) DeleteClinicWithResponse(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clinicId, patientId, body}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreatePatientFromUserWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).CreatePatientFromUserWithResponse), varargs...) + varargs := append([]interface{}{ctx, clinicId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteClinicWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).DeleteClinicWithResponse), varargs...) } // DeleteClinicianWithResponse mocks base method. @@ -1177,6 +2057,66 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) DeletePatientPermissionW return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePatientPermissionWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).DeletePatientPermissionWithResponse), varargs...) } +// DeletePatientTagFromClinicPatientsWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) DeletePatientTagFromClinicPatientsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DeletePatientTagFromClinicPatientsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeletePatientTagFromClinicPatientsWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*DeletePatientTagFromClinicPatientsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeletePatientTagFromClinicPatientsWithBodyWithResponse indicates an expected call of DeletePatientTagFromClinicPatientsWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) DeletePatientTagFromClinicPatientsWithBodyWithResponse(ctx, clinicId, patientTagId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePatientTagFromClinicPatientsWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).DeletePatientTagFromClinicPatientsWithBodyWithResponse), varargs...) +} + +// DeletePatientTagFromClinicPatientsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) DeletePatientTagFromClinicPatientsWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body DeletePatientTagFromClinicPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*DeletePatientTagFromClinicPatientsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeletePatientTagFromClinicPatientsWithResponse", varargs...) + ret0, _ := ret[0].(*DeletePatientTagFromClinicPatientsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeletePatientTagFromClinicPatientsWithResponse indicates an expected call of DeletePatientTagFromClinicPatientsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) DeletePatientTagFromClinicPatientsWithResponse(ctx, clinicId, patientTagId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePatientTagFromClinicPatientsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).DeletePatientTagFromClinicPatientsWithResponse), varargs...) +} + +// DeletePatientTagWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) DeletePatientTagWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, reqEditors ...RequestEditorFn) (*DeletePatientTagResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeletePatientTagWithResponse", varargs...) + ret0, _ := ret[0].(*DeletePatientTagResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeletePatientTagWithResponse indicates an expected call of DeletePatientTagWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) DeletePatientTagWithResponse(ctx, clinicId, patientTagId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeletePatientTagWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).DeletePatientTagWithResponse), varargs...) +} + // DeletePatientWithResponse mocks base method. func (m *MockClientWithResponsesInterface) DeletePatientWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*DeletePatientResponse, error) { m.ctrl.T.Helper() @@ -1297,6 +2237,26 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) GetClinicianWithResponse return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClinicianWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).GetClinicianWithResponse), varargs...) } +// GetEHRSettingsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) GetEHRSettingsWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*GetEHRSettingsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetEHRSettingsWithResponse", varargs...) + ret0, _ := ret[0].(*GetEHRSettingsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetEHRSettingsWithResponse indicates an expected call of GetEHRSettingsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) GetEHRSettingsWithResponse(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetEHRSettingsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).GetEHRSettingsWithResponse), varargs...) +} + // GetInvitedClinicianWithResponse mocks base method. func (m *MockClientWithResponsesInterface) GetInvitedClinicianWithResponse(ctx context.Context, clinicId ClinicId, inviteId InviteId, reqEditors ...RequestEditorFn) (*GetInvitedClinicianResponse, error) { m.ctrl.T.Helper() @@ -1317,6 +2277,26 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) GetInvitedClinicianWithR return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetInvitedClinicianWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).GetInvitedClinicianWithResponse), varargs...) } +// GetMRNSettingsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) GetMRNSettingsWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*GetMRNSettingsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetMRNSettingsWithResponse", varargs...) + ret0, _ := ret[0].(*GetMRNSettingsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetMRNSettingsWithResponse indicates an expected call of GetMRNSettingsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) GetMRNSettingsWithResponse(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMRNSettingsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).GetMRNSettingsWithResponse), varargs...) +} + // GetMigrationWithResponse mocks base method. func (m *MockClientWithResponsesInterface) GetMigrationWithResponse(ctx context.Context, clinicId Id, userId UserId, reqEditors ...RequestEditorFn) (*GetMigrationResponse, error) { m.ctrl.T.Helper() @@ -1357,6 +2337,26 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) GetPatientWithResponse(c return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPatientWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).GetPatientWithResponse), varargs...) } +// ListAllCliniciansWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ListAllCliniciansWithResponse(ctx context.Context, params *ListAllCliniciansParams, reqEditors ...RequestEditorFn) (*ListAllCliniciansResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, params} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListAllCliniciansWithResponse", varargs...) + ret0, _ := ret[0].(*ListAllCliniciansResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListAllCliniciansWithResponse indicates an expected call of ListAllCliniciansWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ListAllCliniciansWithResponse(ctx, params interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, params}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAllCliniciansWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ListAllCliniciansWithResponse), varargs...) +} + // ListCliniciansWithResponse mocks base method. func (m *MockClientWithResponsesInterface) ListCliniciansWithResponse(ctx context.Context, clinicId ClinicId, params *ListCliniciansParams, reqEditors ...RequestEditorFn) (*ListCliniciansResponse, error) { m.ctrl.T.Helper() @@ -1437,6 +2437,26 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) ListClinicsWithResponse( return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListClinicsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ListClinicsWithResponse), varargs...) } +// ListMembershipRestrictionsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ListMembershipRestrictionsWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*ListMembershipRestrictionsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListMembershipRestrictionsWithResponse", varargs...) + ret0, _ := ret[0].(*ListMembershipRestrictionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListMembershipRestrictionsWithResponse indicates an expected call of ListMembershipRestrictionsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ListMembershipRestrictionsWithResponse(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListMembershipRestrictionsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ListMembershipRestrictionsWithResponse), varargs...) +} + // ListMigrationsWithResponse mocks base method. func (m *MockClientWithResponsesInterface) ListMigrationsWithResponse(ctx context.Context, clinicId string, reqEditors ...RequestEditorFn) (*ListMigrationsResponse, error) { m.ctrl.T.Helper() @@ -1444,97 +2464,297 @@ func (m *MockClientWithResponsesInterface) ListMigrationsWithResponse(ctx contex for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "ListMigrationsWithResponse", varargs...) - ret0, _ := ret[0].(*ListMigrationsResponse) + ret := m.ctrl.Call(m, "ListMigrationsWithResponse", varargs...) + ret0, _ := ret[0].(*ListMigrationsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListMigrationsWithResponse indicates an expected call of ListMigrationsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ListMigrationsWithResponse(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListMigrationsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ListMigrationsWithResponse), varargs...) +} + +// ListPatientsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ListPatientsWithResponse(ctx context.Context, clinicId ClinicId, params *ListPatientsParams, reqEditors ...RequestEditorFn) (*ListPatientsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, params} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ListPatientsWithResponse", varargs...) + ret0, _ := ret[0].(*ListPatientsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ListPatientsWithResponse indicates an expected call of ListPatientsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ListPatientsWithResponse(ctx, clinicId, params interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, params}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPatientsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ListPatientsWithResponse), varargs...) +} + +// MatchClinicAndPatientWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) MatchClinicAndPatientWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MatchClinicAndPatientResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "MatchClinicAndPatientWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*MatchClinicAndPatientResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MatchClinicAndPatientWithBodyWithResponse indicates an expected call of MatchClinicAndPatientWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) MatchClinicAndPatientWithBodyWithResponse(ctx, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MatchClinicAndPatientWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).MatchClinicAndPatientWithBodyWithResponse), varargs...) +} + +// MatchClinicAndPatientWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) MatchClinicAndPatientWithResponse(ctx context.Context, body MatchClinicAndPatientJSONRequestBody, reqEditors ...RequestEditorFn) (*MatchClinicAndPatientResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "MatchClinicAndPatientWithResponse", varargs...) + ret0, _ := ret[0].(*MatchClinicAndPatientResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MatchClinicAndPatientWithResponse indicates an expected call of MatchClinicAndPatientWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) MatchClinicAndPatientWithResponse(ctx, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MatchClinicAndPatientWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).MatchClinicAndPatientWithResponse), varargs...) +} + +// MigrateLegacyClinicianPatientsWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) MigrateLegacyClinicianPatientsWithBodyWithResponse(ctx context.Context, clinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateLegacyClinicianPatientsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "MigrateLegacyClinicianPatientsWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*MigrateLegacyClinicianPatientsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MigrateLegacyClinicianPatientsWithBodyWithResponse indicates an expected call of MigrateLegacyClinicianPatientsWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) MigrateLegacyClinicianPatientsWithBodyWithResponse(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MigrateLegacyClinicianPatientsWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).MigrateLegacyClinicianPatientsWithBodyWithResponse), varargs...) +} + +// MigrateLegacyClinicianPatientsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) MigrateLegacyClinicianPatientsWithResponse(ctx context.Context, clinicId string, body MigrateLegacyClinicianPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateLegacyClinicianPatientsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "MigrateLegacyClinicianPatientsWithResponse", varargs...) + ret0, _ := ret[0].(*MigrateLegacyClinicianPatientsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MigrateLegacyClinicianPatientsWithResponse indicates an expected call of MigrateLegacyClinicianPatientsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) MigrateLegacyClinicianPatientsWithResponse(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MigrateLegacyClinicianPatientsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).MigrateLegacyClinicianPatientsWithResponse), varargs...) +} + +// ProcessEHRMessageWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ProcessEHRMessageWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ProcessEHRMessageResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ProcessEHRMessageWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*ProcessEHRMessageResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ProcessEHRMessageWithBodyWithResponse indicates an expected call of ProcessEHRMessageWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ProcessEHRMessageWithBodyWithResponse(ctx, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessEHRMessageWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ProcessEHRMessageWithBodyWithResponse), varargs...) +} + +// ProcessEHRMessageWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) ProcessEHRMessageWithResponse(ctx context.Context, body ProcessEHRMessageJSONRequestBody, reqEditors ...RequestEditorFn) (*ProcessEHRMessageResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ProcessEHRMessageWithResponse", varargs...) + ret0, _ := ret[0].(*ProcessEHRMessageResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ProcessEHRMessageWithResponse indicates an expected call of ProcessEHRMessageWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) ProcessEHRMessageWithResponse(ctx, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProcessEHRMessageWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ProcessEHRMessageWithResponse), varargs...) +} + +// SendDexcomConnectRequestWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) SendDexcomConnectRequestWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*SendDexcomConnectRequestResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "SendDexcomConnectRequestWithResponse", varargs...) + ret0, _ := ret[0].(*SendDexcomConnectRequestResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SendDexcomConnectRequestWithResponse indicates an expected call of SendDexcomConnectRequestWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) SendDexcomConnectRequestWithResponse(ctx, clinicId, patientId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendDexcomConnectRequestWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).SendDexcomConnectRequestWithResponse), varargs...) +} + +// SendUploadReminderWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) SendUploadReminderWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, reqEditors ...RequestEditorFn) (*SendUploadReminderResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "SendUploadReminderWithResponse", varargs...) + ret0, _ := ret[0].(*SendUploadReminderResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SendUploadReminderWithResponse indicates an expected call of SendUploadReminderWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) SendUploadReminderWithResponse(ctx, clinicId, patientId interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientId}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendUploadReminderWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).SendUploadReminderWithResponse), varargs...) +} + +// SyncEHRDataWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) SyncEHRDataWithResponse(ctx context.Context, clinicId ClinicId, reqEditors ...RequestEditorFn) (*SyncEHRDataResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "SyncEHRDataWithResponse", varargs...) + ret0, _ := ret[0].(*SyncEHRDataResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// ListMigrationsWithResponse indicates an expected call of ListMigrationsWithResponse. -func (mr *MockClientWithResponsesInterfaceMockRecorder) ListMigrationsWithResponse(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { +// SyncEHRDataWithResponse indicates an expected call of SyncEHRDataWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) SyncEHRDataWithResponse(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{ctx, clinicId}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListMigrationsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ListMigrationsWithResponse), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncEHRDataWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).SyncEHRDataWithResponse), varargs...) } -// ListPatientsWithResponse mocks base method. -func (m *MockClientWithResponsesInterface) ListPatientsWithResponse(ctx context.Context, clinicId ClinicId, params *ListPatientsParams, reqEditors ...RequestEditorFn) (*ListPatientsResponse, error) { +// TriggerInitialMigrationWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) TriggerInitialMigrationWithBodyWithResponse(ctx context.Context, clinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*TriggerInitialMigrationResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, clinicId, params} + varargs := []interface{}{ctx, clinicId, contentType, body} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "ListPatientsWithResponse", varargs...) - ret0, _ := ret[0].(*ListPatientsResponse) + ret := m.ctrl.Call(m, "TriggerInitialMigrationWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*TriggerInitialMigrationResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// ListPatientsWithResponse indicates an expected call of ListPatientsWithResponse. -func (mr *MockClientWithResponsesInterfaceMockRecorder) ListPatientsWithResponse(ctx, clinicId, params interface{}, reqEditors ...interface{}) *gomock.Call { +// TriggerInitialMigrationWithBodyWithResponse indicates an expected call of TriggerInitialMigrationWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) TriggerInitialMigrationWithBodyWithResponse(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clinicId, params}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPatientsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).ListPatientsWithResponse), varargs...) + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TriggerInitialMigrationWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).TriggerInitialMigrationWithBodyWithResponse), varargs...) } -// MigrateLegacyClinicianPatientsWithBodyWithResponse mocks base method. -func (m *MockClientWithResponsesInterface) MigrateLegacyClinicianPatientsWithBodyWithResponse(ctx context.Context, clinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateLegacyClinicianPatientsResponse, error) { +// TriggerInitialMigrationWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) TriggerInitialMigrationWithResponse(ctx context.Context, clinicId string, body TriggerInitialMigrationJSONRequestBody, reqEditors ...RequestEditorFn) (*TriggerInitialMigrationResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, clinicId, contentType, body} + varargs := []interface{}{ctx, clinicId, body} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "MigrateLegacyClinicianPatientsWithBodyWithResponse", varargs...) - ret0, _ := ret[0].(*MigrateLegacyClinicianPatientsResponse) + ret := m.ctrl.Call(m, "TriggerInitialMigrationWithResponse", varargs...) + ret0, _ := ret[0].(*TriggerInitialMigrationResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// MigrateLegacyClinicianPatientsWithBodyWithResponse indicates an expected call of MigrateLegacyClinicianPatientsWithBodyWithResponse. -func (mr *MockClientWithResponsesInterfaceMockRecorder) MigrateLegacyClinicianPatientsWithBodyWithResponse(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { +// TriggerInitialMigrationWithResponse indicates an expected call of TriggerInitialMigrationWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) TriggerInitialMigrationWithResponse(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MigrateLegacyClinicianPatientsWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).MigrateLegacyClinicianPatientsWithBodyWithResponse), varargs...) + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TriggerInitialMigrationWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).TriggerInitialMigrationWithResponse), varargs...) } -// MigrateLegacyClinicianPatientsWithResponse mocks base method. -func (m *MockClientWithResponsesInterface) MigrateLegacyClinicianPatientsWithResponse(ctx context.Context, clinicId string, body MigrateLegacyClinicianPatientsJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateLegacyClinicianPatientsResponse, error) { +// UpdateClinicUserDetailsWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateClinicUserDetailsWithBodyWithResponse(ctx context.Context, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateClinicUserDetailsResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, clinicId, body} + varargs := []interface{}{ctx, userId, contentType, body} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "MigrateLegacyClinicianPatientsWithResponse", varargs...) - ret0, _ := ret[0].(*MigrateLegacyClinicianPatientsResponse) + ret := m.ctrl.Call(m, "UpdateClinicUserDetailsWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*UpdateClinicUserDetailsResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// MigrateLegacyClinicianPatientsWithResponse indicates an expected call of MigrateLegacyClinicianPatientsWithResponse. -func (mr *MockClientWithResponsesInterfaceMockRecorder) MigrateLegacyClinicianPatientsWithResponse(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { +// UpdateClinicUserDetailsWithBodyWithResponse indicates an expected call of UpdateClinicUserDetailsWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateClinicUserDetailsWithBodyWithResponse(ctx, userId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MigrateLegacyClinicianPatientsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).MigrateLegacyClinicianPatientsWithResponse), varargs...) + varargs := append([]interface{}{ctx, userId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClinicUserDetailsWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateClinicUserDetailsWithBodyWithResponse), varargs...) } -// TriggerInitialMigrationWithResponse mocks base method. -func (m *MockClientWithResponsesInterface) TriggerInitialMigrationWithResponse(ctx context.Context, clinicId string, reqEditors ...RequestEditorFn) (*TriggerInitialMigrationResponse, error) { +// UpdateClinicUserDetailsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateClinicUserDetailsWithResponse(ctx context.Context, userId UserId, body UpdateClinicUserDetailsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateClinicUserDetailsResponse, error) { m.ctrl.T.Helper() - varargs := []interface{}{ctx, clinicId} + varargs := []interface{}{ctx, userId, body} for _, a := range reqEditors { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "TriggerInitialMigrationWithResponse", varargs...) - ret0, _ := ret[0].(*TriggerInitialMigrationResponse) + ret := m.ctrl.Call(m, "UpdateClinicUserDetailsWithResponse", varargs...) + ret0, _ := ret[0].(*UpdateClinicUserDetailsResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// TriggerInitialMigrationWithResponse indicates an expected call of TriggerInitialMigrationWithResponse. -func (mr *MockClientWithResponsesInterfaceMockRecorder) TriggerInitialMigrationWithResponse(ctx, clinicId interface{}, reqEditors ...interface{}) *gomock.Call { +// UpdateClinicUserDetailsWithResponse indicates an expected call of UpdateClinicUserDetailsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateClinicUserDetailsWithResponse(ctx, userId, body interface{}, reqEditors ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{ctx, clinicId}, reqEditors...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TriggerInitialMigrationWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).TriggerInitialMigrationWithResponse), varargs...) + varargs := append([]interface{}{ctx, userId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClinicUserDetailsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateClinicUserDetailsWithResponse), varargs...) } // UpdateClinicWithBodyWithResponse mocks base method. @@ -1617,6 +2837,126 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateClinicianWithRespo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateClinicianWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateClinicianWithResponse), varargs...) } +// UpdateEHRSettingsWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateEHRSettingsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateEHRSettingsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateEHRSettingsWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*UpdateEHRSettingsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateEHRSettingsWithBodyWithResponse indicates an expected call of UpdateEHRSettingsWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateEHRSettingsWithBodyWithResponse(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateEHRSettingsWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateEHRSettingsWithBodyWithResponse), varargs...) +} + +// UpdateEHRSettingsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateEHRSettingsWithResponse(ctx context.Context, clinicId ClinicId, body UpdateEHRSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateEHRSettingsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateEHRSettingsWithResponse", varargs...) + ret0, _ := ret[0].(*UpdateEHRSettingsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateEHRSettingsWithResponse indicates an expected call of UpdateEHRSettingsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateEHRSettingsWithResponse(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateEHRSettingsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateEHRSettingsWithResponse), varargs...) +} + +// UpdateMRNSettingsWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateMRNSettingsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMRNSettingsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateMRNSettingsWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*UpdateMRNSettingsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateMRNSettingsWithBodyWithResponse indicates an expected call of UpdateMRNSettingsWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateMRNSettingsWithBodyWithResponse(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMRNSettingsWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateMRNSettingsWithBodyWithResponse), varargs...) +} + +// UpdateMRNSettingsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateMRNSettingsWithResponse(ctx context.Context, clinicId ClinicId, body UpdateMRNSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMRNSettingsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateMRNSettingsWithResponse", varargs...) + ret0, _ := ret[0].(*UpdateMRNSettingsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateMRNSettingsWithResponse indicates an expected call of UpdateMRNSettingsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateMRNSettingsWithResponse(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMRNSettingsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateMRNSettingsWithResponse), varargs...) +} + +// UpdateMembershipRestrictionsWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateMembershipRestrictionsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMembershipRestrictionsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateMembershipRestrictionsWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*UpdateMembershipRestrictionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateMembershipRestrictionsWithBodyWithResponse indicates an expected call of UpdateMembershipRestrictionsWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateMembershipRestrictionsWithBodyWithResponse(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMembershipRestrictionsWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateMembershipRestrictionsWithBodyWithResponse), varargs...) +} + +// UpdateMembershipRestrictionsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateMembershipRestrictionsWithResponse(ctx context.Context, clinicId ClinicId, body UpdateMembershipRestrictionsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateMembershipRestrictionsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateMembershipRestrictionsWithResponse", varargs...) + ret0, _ := ret[0].(*UpdateMembershipRestrictionsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateMembershipRestrictionsWithResponse indicates an expected call of UpdateMembershipRestrictionsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateMembershipRestrictionsWithResponse(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMembershipRestrictionsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateMembershipRestrictionsWithResponse), varargs...) +} + // UpdateMigrationWithBodyWithResponse mocks base method. func (m *MockClientWithResponsesInterface) UpdateMigrationWithBodyWithResponse(ctx context.Context, clinicId Id, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateMigrationResponse, error) { m.ctrl.T.Helper() @@ -1657,6 +2997,46 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateMigrationWithRespo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateMigrationWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateMigrationWithResponse), varargs...) } +// UpdatePatientDataSourcesWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdatePatientDataSourcesWithBodyWithResponse(ctx context.Context, userId UserId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientDataSourcesResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, userId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePatientDataSourcesWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*UpdatePatientDataSourcesResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdatePatientDataSourcesWithBodyWithResponse indicates an expected call of UpdatePatientDataSourcesWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdatePatientDataSourcesWithBodyWithResponse(ctx, userId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, userId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientDataSourcesWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdatePatientDataSourcesWithBodyWithResponse), varargs...) +} + +// UpdatePatientDataSourcesWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdatePatientDataSourcesWithResponse(ctx context.Context, userId UserId, body UpdatePatientDataSourcesJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientDataSourcesResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, userId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePatientDataSourcesWithResponse", varargs...) + ret0, _ := ret[0].(*UpdatePatientDataSourcesResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdatePatientDataSourcesWithResponse indicates an expected call of UpdatePatientDataSourcesWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdatePatientDataSourcesWithResponse(ctx, userId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, userId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientDataSourcesWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdatePatientDataSourcesWithResponse), varargs...) +} + // UpdatePatientPermissionsWithBodyWithResponse mocks base method. func (m *MockClientWithResponsesInterface) UpdatePatientPermissionsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientPermissionsResponse, error) { m.ctrl.T.Helper() @@ -1697,6 +3077,86 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdatePatientPermissions return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientPermissionsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdatePatientPermissionsWithResponse), varargs...) } +// UpdatePatientSummaryWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdatePatientSummaryWithBodyWithResponse(ctx context.Context, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientSummaryResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, patientId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePatientSummaryWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*UpdatePatientSummaryResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdatePatientSummaryWithBodyWithResponse indicates an expected call of UpdatePatientSummaryWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdatePatientSummaryWithBodyWithResponse(ctx, patientId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, patientId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientSummaryWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdatePatientSummaryWithBodyWithResponse), varargs...) +} + +// UpdatePatientSummaryWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdatePatientSummaryWithResponse(ctx context.Context, patientId PatientId, body UpdatePatientSummaryJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientSummaryResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, patientId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePatientSummaryWithResponse", varargs...) + ret0, _ := ret[0].(*UpdatePatientSummaryResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdatePatientSummaryWithResponse indicates an expected call of UpdatePatientSummaryWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdatePatientSummaryWithResponse(ctx, patientId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, patientId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientSummaryWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdatePatientSummaryWithResponse), varargs...) +} + +// UpdatePatientTagWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdatePatientTagWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientTagResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePatientTagWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*UpdatePatientTagResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdatePatientTagWithBodyWithResponse indicates an expected call of UpdatePatientTagWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdatePatientTagWithBodyWithResponse(ctx, clinicId, patientTagId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientTagWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdatePatientTagWithBodyWithResponse), varargs...) +} + +// UpdatePatientTagWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdatePatientTagWithResponse(ctx context.Context, clinicId ClinicId, patientTagId PatientTagId, body UpdatePatientTagJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePatientTagResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, patientTagId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdatePatientTagWithResponse", varargs...) + ret0, _ := ret[0].(*UpdatePatientTagResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdatePatientTagWithResponse indicates an expected call of UpdatePatientTagWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdatePatientTagWithResponse(ctx, clinicId, patientTagId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, patientTagId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientTagWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdatePatientTagWithResponse), varargs...) +} + // UpdatePatientWithBodyWithResponse mocks base method. func (m *MockClientWithResponsesInterface) UpdatePatientWithBodyWithResponse(ctx context.Context, clinicId ClinicId, patientId PatientId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePatientResponse, error) { m.ctrl.T.Helper() @@ -1736,3 +3196,103 @@ func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdatePatientWithRespons varargs := append([]interface{}{ctx, clinicId, patientId, body}, reqEditors...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdatePatientWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdatePatientWithResponse), varargs...) } + +// UpdateSuppressedNotificationsWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateSuppressedNotificationsWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateSuppressedNotificationsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateSuppressedNotificationsWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*UpdateSuppressedNotificationsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateSuppressedNotificationsWithBodyWithResponse indicates an expected call of UpdateSuppressedNotificationsWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateSuppressedNotificationsWithBodyWithResponse(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSuppressedNotificationsWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateSuppressedNotificationsWithBodyWithResponse), varargs...) +} + +// UpdateSuppressedNotificationsWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateSuppressedNotificationsWithResponse(ctx context.Context, clinicId ClinicId, body UpdateSuppressedNotificationsJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateSuppressedNotificationsResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateSuppressedNotificationsWithResponse", varargs...) + ret0, _ := ret[0].(*UpdateSuppressedNotificationsResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateSuppressedNotificationsWithResponse indicates an expected call of UpdateSuppressedNotificationsWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateSuppressedNotificationsWithResponse(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateSuppressedNotificationsWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateSuppressedNotificationsWithResponse), varargs...) +} + +// UpdateTierWithBodyWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateTierWithBodyWithResponse(ctx context.Context, clinicId ClinicId, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTierResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, contentType, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateTierWithBodyWithResponse", varargs...) + ret0, _ := ret[0].(*UpdateTierResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateTierWithBodyWithResponse indicates an expected call of UpdateTierWithBodyWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateTierWithBodyWithResponse(ctx, clinicId, contentType, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, contentType, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTierWithBodyWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateTierWithBodyWithResponse), varargs...) +} + +// UpdateTierWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) UpdateTierWithResponse(ctx context.Context, clinicId ClinicId, body UpdateTierJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTierResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx, clinicId, body} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpdateTierWithResponse", varargs...) + ret0, _ := ret[0].(*UpdateTierResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpdateTierWithResponse indicates an expected call of UpdateTierWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) UpdateTierWithResponse(ctx, clinicId, body interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx, clinicId, body}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTierWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).UpdateTierWithResponse), varargs...) +} + +// VerifyEndpointWithResponse mocks base method. +func (m *MockClientWithResponsesInterface) VerifyEndpointWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*VerifyEndpointResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{ctx} + for _, a := range reqEditors { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "VerifyEndpointWithResponse", varargs...) + ret0, _ := ret[0].(*VerifyEndpointResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// VerifyEndpointWithResponse indicates an expected call of VerifyEndpointWithResponse. +func (mr *MockClientWithResponsesInterfaceMockRecorder) VerifyEndpointWithResponse(ctx interface{}, reqEditors ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{ctx}, reqEditors...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "VerifyEndpointWithResponse", reflect.TypeOf((*MockClientWithResponsesInterface)(nil).VerifyEndpointWithResponse), varargs...) +} diff --git a/vendor/github.com/tidepool-org/clinic/client/types.go b/vendor/github.com/tidepool-org/clinic/client/types.go index b02affbf4..c3855b082 100644 --- a/vendor/github.com/tidepool-org/clinic/client/types.go +++ b/vendor/github.com/tidepool-org/clinic/client/types.go @@ -1,6 +1,6 @@ // Package api provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/deepmap/oapi-codegen version v1.9.0 DO NOT EDIT. +// Code generated by github.com/deepmap/oapi-codegen version v1.13.0 DO NOT EDIT. package api import ( @@ -13,24 +13,73 @@ const ( SessionTokenScopes = "sessionToken.Scopes" ) +// Defines values for AverageGlucoseUnits. +const ( + AverageGlucoseUnitsMmolL AverageGlucoseUnits = "mmol/L" + AverageGlucoseUnitsMmoll AverageGlucoseUnits = "mmol/l" +) + // Defines values for ClinicClinicSize. const ( - ClinicClinicSizeN0249 ClinicClinicSize = "0-249" + N0249 ClinicClinicSize = "0-249" + N1000 ClinicClinicSize = "1000+" + N250499 ClinicClinicSize = "250-499" + N500999 ClinicClinicSize = "500-999" +) - ClinicClinicSizeN1000 ClinicClinicSize = "1000+" +// Defines values for ClinicClinicType. +const ( + HealthcareSystem ClinicClinicType = "healthcare_system" + Other ClinicClinicType = "other" + ProviderPractice ClinicClinicType = "provider_practice" + Researcher ClinicClinicType = "researcher" + VeterinaryClinic ClinicClinicType = "veterinary_clinic" +) - ClinicClinicSizeN250499 ClinicClinicSize = "250-499" +// Defines values for ClinicPreferredBgUnits. +const ( + ClinicPreferredBgUnitsMgdL ClinicPreferredBgUnits = "mg/dL" + ClinicPreferredBgUnitsMmolL ClinicPreferredBgUnits = "mmol/L" +) - ClinicClinicSizeN500999 ClinicClinicSize = "500-999" +// Defines values for DataSourceState. +const ( + DataSourceStateConnected DataSourceState = "connected" + DataSourceStateDisconnected DataSourceState = "disconnected" + DataSourceStateError DataSourceState = "error" + DataSourceStatePending DataSourceState = "pending" + DataSourceStatePendingReconnect DataSourceState = "pendingReconnect" ) -// Defines values for MigrationStatus. +// Defines values for EHRMatchActionActionType. const ( - MigrationStatusCOMPLETED MigrationStatus = "COMPLETED" + DISABLESUMARYANDREPORTSSUBSCRIPTION EHRMatchActionActionType = "DISABLE_SUMARY_AND_REPORTS_SUBSCRIPTION" + ENABLESUMARYANDREPORTSSUBSCRIPTION EHRMatchActionActionType = "ENABLE_SUMARY_AND_REPORTS_SUBSCRIPTION" +) - MigrationStatusPENDING MigrationStatus = "PENDING" +// Defines values for EHRMatchMessageRefDataModel. +const ( + Order EHRMatchMessageRefDataModel = "Order" +) - MigrationStatusRUNNING MigrationStatus = "RUNNING" +// Defines values for EHRMatchMessageRefEventType. +const ( + New EHRMatchMessageRefEventType = "New" +) + +// Defines values for MigrationStatus. +const ( + COMPLETED MigrationStatus = "COMPLETED" + PENDING MigrationStatus = "PENDING" + RUNNING MigrationStatus = "RUNNING" +) + +// Defines values for Tier. +const ( + Tier0100 Tier = "tier0100" + Tier0200 Tier = "tier0200" + Tier0300 Tier = "tier0300" + Tier0400 Tier = "tier0400" ) // AssociateClinicianToUser defines model for AssociateClinicianToUser. @@ -38,100 +87,243 @@ type AssociateClinicianToUser struct { UserId string `json:"userId"` } -// Clinic +// AverageGlucose Blood glucose value, in `mmol/L` +type AverageGlucose struct { + Units AverageGlucoseUnits `json:"units"` + + // Value A floating point value representing a `mmol/L` value. + Value float32 `json:"value"` +} + +// AverageGlucoseUnits defines model for AverageGlucose.Units. +type AverageGlucoseUnits string + +// Clinic Clinic type Clinic struct { - // Street address. + // Address Street address. Address *string `json:"address,omitempty"` - CanMigrate bool `json:"canMigrate"` + CanMigrate *bool `json:"canMigrate,omitempty"` - // City name. + // City City name. City *string `json:"city,omitempty"` ClinicSize *ClinicClinicSize `json:"clinicSize,omitempty"` - ClinicType *string `json:"clinicType,omitempty"` + ClinicType *ClinicClinicType `json:"clinicType,omitempty"` - // Country name. - Country *string `json:"country,omitempty"` - CreatedTime time.Time `json:"createdTime"` + // Country Country name. + Country *string `json:"country,omitempty"` + CreatedTime *time.Time `json:"createdTime,omitempty"` - // Clinic identifier. - Id Id `json:"id"` + // Id Clinic identifier. + Id *Id `json:"id,omitempty"` + LastDeletedPatientTag *PatientTag `json:"lastDeletedPatientTag,omitempty"` - // Name of the clinic. - Name string `json:"name"` + // Name Name of the clinic. + Name string `json:"name"` + PatientTags *[]PatientTag `json:"patientTags,omitempty"` - // An array of phone numbers. + // PhoneNumbers An array of phone numbers. PhoneNumbers *[]PhoneNumber `json:"phoneNumbers,omitempty"` - // Postal code. In the U.S., typically the zip code such as `94301` or `94301-1704`. - PostalCode *string `json:"postalCode,omitempty"` + // PostalCode Postal code. In the U.S., typically the zip code such as `94301` or `94301-1704`. + PostalCode *string `json:"postalCode,omitempty"` + PreferredBgUnits ClinicPreferredBgUnits `json:"preferredBgUnits"` - // Globally unique share code for a clinic. The share code is 3 groups of 4 uppercase alphanumeric characters in each group. Ambiguous characters such as `I` and `1`, or `O` and `0` are excluded. - ShareCode string `json:"shareCode"` + // ShareCode Globally unique share code for a clinic. The share code is 3 groups of 4 uppercase alphanumeric characters in each group. Ambiguous characters such as `I` and `1`, or `O` and `0` are excluded. + ShareCode *string `json:"shareCode,omitempty"` - // State or province. In the U.S., typically something like `CA` or `California`. - State *string `json:"state,omitempty"` - UpdatedTime time.Time `json:"updatedTime"` - Website *string `json:"website,omitempty"` + // State State or province. In the U.S., typically something like `CA` or `California`. + State *string `json:"state,omitempty"` + SuppressedNotifications *SuppressedNotifications `json:"suppressedNotifications,omitempty"` + Tier *string `json:"tier,omitempty"` + TierDescription *string `json:"tierDescription,omitempty"` + UpdatedTime *time.Time `json:"updatedTime,omitempty"` + Website *string `json:"website,omitempty"` } // ClinicClinicSize defines model for Clinic.ClinicSize. type ClinicClinicSize string -// The `id` may be empty if the clinician invite has not been accepted. +// ClinicClinicType defines model for Clinic.ClinicType. +type ClinicClinicType string + +// ClinicPreferredBgUnits defines model for Clinic.PreferredBgUnits. +type ClinicPreferredBgUnits string + +// Clinician The `id` may be empty if the clinician invite has not been accepted. type Clinician struct { - CreatedTime time.Time `json:"createdTime"` - Email string `json:"email"` + CreatedTime *time.Time `json:"createdTime,omitempty"` + Email string `json:"email"` - // String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) + // Id String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) Id *TidepoolUserId `json:"id,omitempty"` - // The id of the invite if it hasn't been accepted + // InviteId The id of the invite if it hasn't been accepted InviteId *string `json:"inviteId,omitempty"` - // The name of the clinician + // Name The name of the clinician Name *string `json:"name,omitempty"` Roles ClinicianRoles `json:"roles"` - UpdatedTime time.Time `json:"updatedTime"` + UpdatedTime *time.Time `json:"updatedTime,omitempty"` } // ClinicianClinicRelationship defines model for ClinicianClinicRelationship. type ClinicianClinicRelationship struct { - // Clinic + // Clinic Clinic Clinic Clinic `json:"clinic"` - // The `id` may be empty if the clinician invite has not been accepted. + // Clinician The `id` may be empty if the clinician invite has not been accepted. Clinician Clinician `json:"clinician"` } // ClinicianClinicRelationships defines model for ClinicianClinicRelationships. -type ClinicianClinicRelationships []ClinicianClinicRelationship +type ClinicianClinicRelationships = []ClinicianClinicRelationship // ClinicianRoles defines model for ClinicianRoles. -type ClinicianRoles []string +type ClinicianRoles = []string // Clinicians defines model for Clinicians. -type Clinicians []Clinician +type Clinicians = []Clinician // Clinics defines model for Clinics. -type Clinics []Clinic +type Clinics = []Clinic // CreatePatient defines model for CreatePatient. type CreatePatient struct { - IsMigrated *bool `json:"isMigrated,omitempty"` + AttestationSubmitted *bool `json:"attestationSubmitted,omitempty"` + IsMigrated *bool `json:"isMigrated,omitempty"` - // String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) + // LegacyClinicianId String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) LegacyClinicianId *TidepoolUserId `json:"legacyClinicianId,omitempty"` Permissions *PatientPermissions `json:"permissions,omitempty"` } +// DataSource defines model for DataSource. +type DataSource struct { + // DataSourceId String representation of a resource id + DataSourceId *string `json:"dataSourceId,omitempty"` + + // ExpirationTime [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) / [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp _with_ timezone information + ExpirationTime *DateTime `json:"expirationTime,omitempty"` + + // ModifiedTime [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) / [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp _with_ timezone information + ModifiedTime *DateTime `json:"modifiedTime,omitempty"` + ProviderName string `json:"providerName"` + State DataSourceState `json:"state"` +} + +// DataSourceState defines model for DataSource.State. +type DataSourceState string + +// DataSources defines model for DataSources. +type DataSources = []DataSource + +// DateTime [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) / [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) timestamp _with_ timezone information +type DateTime = string + +// EHRDestinationIds defines model for EHRDestinationIds. +type EHRDestinationIds struct { + // Flowsheet Destination ID override for Flowsheets + Flowsheet string `json:"flowsheet"` + + // Notes Destination ID override for Notes + Notes string `json:"notes"` + + // Results Destination ID override for Results + Results string `json:"results"` +} + +// EHRFacility defines model for EHRFacility. +type EHRFacility struct { + // Name Ordering Facility Name + Name string `json:"name"` +} + +// EHRMatchAction defines model for EHRMatchAction. +type EHRMatchAction struct { + ActionType EHRMatchActionActionType `json:"actionType"` +} + +// EHRMatchActionActionType defines model for EHRMatchAction.ActionType. +type EHRMatchActionActionType string + +// EHRMatchMessageRef defines model for EHRMatchMessageRef. +type EHRMatchMessageRef struct { + DataModel EHRMatchMessageRefDataModel `json:"dataModel"` + DocumentId string `json:"documentId"` + EventType EHRMatchMessageRefEventType `json:"eventType"` +} + +// EHRMatchMessageRefDataModel defines model for EHRMatchMessageRef.DataModel. +type EHRMatchMessageRefDataModel string + +// EHRMatchMessageRefEventType defines model for EHRMatchMessageRef.EventType. +type EHRMatchMessageRefEventType string + +// EHRMatchRequest defines model for EHRMatchRequest. +type EHRMatchRequest struct { + MessageRef *EHRMatchMessageRef `json:"messageRef,omitempty"` +} + +// EHRMatchResponse defines model for EHRMatchResponse. +type EHRMatchResponse struct { + Action *EHRMatchAction `json:"action,omitempty"` + + // Clinic Clinic + Clinic Clinic `json:"clinic"` + Patients *Patients `json:"patients,omitempty"` + Settings EHRSettings `json:"settings"` +} + +// EHRProcedureCodes defines model for EHRProcedureCodes. +type EHRProcedureCodes struct { + DisableSummaryReports string `json:"disableSummaryReports"` + + // EnableSummaryReports Procedure Code for Summary Statistics and PDF Reports subscription + EnableSummaryReports string `json:"enableSummaryReports"` +} + +// EHRSettings defines model for EHRSettings. +type EHRSettings struct { + DestinationIds EHRDestinationIds `json:"destinationIds"` + + // Enabled Enable or disable the EHR integration + Enabled bool `json:"enabled"` + Facility *EHRFacility `json:"facility,omitempty"` + ProcedureCodes EHRProcedureCodes `json:"procedureCodes"` + SourceId string `json:"sourceId"` +} + // Error defines model for Error. type Error struct { Code int `json:"code"` Message string `json:"message"` } -// Clinic identifier. -type Id string +// Id Clinic identifier. +type Id = string + +// MRNSettings defines model for MRNSettings. +type MRNSettings struct { + // Required Require MRN when creating or updating patients + Required bool `json:"required"` + + // Unique Enforce MRN uniqueness constraint + Unique bool `json:"unique"` +} + +// MembershipRestriction A user joining a clinic must match all of the defined restrictions +type MembershipRestriction struct { + // EmailDomain The restriction applies only if the user has an email address with a matching domain + EmailDomain string `json:"emailDomain"` + + // RequiredIdp If this attribute is set, at the time of joining the clinic the user must be authenticated against this identity provider + RequiredIdp *string `json:"requiredIdp,omitempty"` +} + +// MembershipRestrictions A user joining a clinic must match at least one of the specified membership restrictions +type MembershipRestrictions struct { + Restrictions *[]MembershipRestriction `json:"restrictions,omitempty"` +} // Meta defines model for Meta. type Meta struct { @@ -140,56 +332,271 @@ type Meta struct { // Migration defines model for Migration. type Migration struct { - CreatedTime time.Time `json:"createdTime"` + AttestationTime *time.Time `json:"attestationTime,omitempty"` + CreatedTime *time.Time `json:"createdTime,omitempty"` - // The current status of the migration + // Status The current status of the migration Status *MigrationStatus `json:"status,omitempty"` - UpdatedTime time.Time `json:"updatedTime"` + UpdatedTime *time.Time `json:"updatedTime,omitempty"` - // The user id of the legacy clinician account that needs to be migrated. + // UserId The user id of the legacy clinician account that needs to be migrated. UserId string `json:"userId"` } -// The current status of the migration +// MigrationStatus The current status of the migration type MigrationStatus string // MigrationUpdate defines model for MigrationUpdate. type MigrationUpdate struct { - // The current status of the migration + // Status The current status of the migration Status MigrationStatus `json:"status"` } // Migrations defines model for Migrations. -type Migrations []Migration +type Migrations = []Migration // Patient defines model for Patient. type Patient struct { - BirthDate openapi_types.Date `json:"birthDate"` - CreatedTime time.Time `json:"createdTime"` - Email *string `json:"email,omitempty"` + AttestationSubmitted *bool `json:"attestationSubmitted,omitempty"` + BirthDate openapi_types.Date `json:"birthDate"` + CreatedTime *time.Time `json:"createdTime,omitempty"` + DataSources *[]DataSource `json:"dataSources"` + Email *string `json:"email,omitempty"` - // The full name of the patient + // FullName The full name of the patient FullName string `json:"fullName"` - // String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) - Id TidepoolUserId `json:"id"` + // Id String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) + Id *TidepoolUserId `json:"id,omitempty"` + LastRequestedDexcomConnectTime *time.Time `json:"lastRequestedDexcomConnectTime,omitempty"` + LastUploadReminderTime *time.Time `json:"lastUploadReminderTime,omitempty"` - // The medical record number of the patient - Mrn *string `json:"mrn,omitempty"` - Permissions *PatientPermissions `json:"permissions,omitempty"` - TargetDevices *[]string `json:"targetDevices,omitempty"` - UpdatedTime time.Time `json:"updatedTime"` + // Mrn The medical record number of the patient + Mrn *string `json:"mrn,omitempty"` + Permissions *PatientPermissions `json:"permissions,omitempty"` + + // Summary A summary of a patients recent data + Summary *PatientSummary `json:"summary,omitempty"` + Tags *[]string `json:"tags"` + TargetDevices *[]string `json:"targetDevices,omitempty"` + UpdatedTime *time.Time `json:"updatedTime,omitempty"` +} + +// PatientBGMPeriod Summary of a specific BGM time period (currently: 1d, 7d, 14d, 30d) +type PatientBGMPeriod struct { + // AverageDailyRecords Average daily readings + AverageDailyRecords *float64 `json:"averageDailyRecords,omitempty"` + + // AverageGlucose Blood glucose value, in `mmol/L` + AverageGlucose *AverageGlucose `json:"averageGlucose,omitempty"` + HasAverageDailyRecords *bool `json:"hasAverageDailyRecords,omitempty"` + HasAverageGlucose *bool `json:"hasAverageGlucose,omitempty"` + HasTimeInHighPercent *bool `json:"hasTimeInHighPercent,omitempty"` + HasTimeInHighRecords *bool `json:"hasTimeInHighRecords,omitempty"` + HasTimeInLowPercent *bool `json:"hasTimeInLowPercent,omitempty"` + HasTimeInLowRecords *bool `json:"hasTimeInLowRecords,omitempty"` + HasTimeInTargetPercent *bool `json:"hasTimeInTargetPercent,omitempty"` + HasTimeInTargetRecords *bool `json:"hasTimeInTargetRecords,omitempty"` + HasTimeInVeryHighPercent *bool `json:"hasTimeInVeryHighPercent,omitempty"` + HasTimeInVeryHighRecords *bool `json:"hasTimeInVeryHighRecords,omitempty"` + HasTimeInVeryLowPercent *bool `json:"hasTimeInVeryLowPercent,omitempty"` + HasTimeInVeryLowRecords *bool `json:"hasTimeInVeryLowRecords,omitempty"` + HasTotalRecords *bool `json:"hasTotalRecords,omitempty"` + + // TimeInHighPercent Percentage of time spent in high glucose range + TimeInHighPercent *float64 `json:"timeInHighPercent,omitempty"` + + // TimeInHighRecords Counter of records in high glucose range + TimeInHighRecords *int `json:"timeInHighRecords,omitempty"` + + // TimeInLowPercent Percentage of time spent in low glucose range + TimeInLowPercent *float64 `json:"timeInLowPercent,omitempty"` + + // TimeInLowRecords Counter of records in low glucose range + TimeInLowRecords *int `json:"timeInLowRecords,omitempty"` + + // TimeInTargetPercent Percentage of time spent in target glucose range + TimeInTargetPercent *float64 `json:"timeInTargetPercent,omitempty"` + + // TimeInTargetRecords Counter of records in target glucose range + TimeInTargetRecords *int `json:"timeInTargetRecords,omitempty"` + + // TimeInVeryHighPercent Percentage of time spent in very high glucose range + TimeInVeryHighPercent *float64 `json:"timeInVeryHighPercent,omitempty"` + + // TimeInVeryHighRecords Counter of records in very high glucose range + TimeInVeryHighRecords *int `json:"timeInVeryHighRecords,omitempty"` + + // TimeInVeryLowPercent Percentage of time spent in very low glucose range + TimeInVeryLowPercent *float64 `json:"timeInVeryLowPercent,omitempty"` + + // TimeInVeryLowRecords Counter of records in very low glucose range + TimeInVeryLowRecords *int `json:"timeInVeryLowRecords,omitempty"` + + // TotalRecords Counter of records + TotalRecords *int `json:"totalRecords,omitempty"` +} + +// PatientBGMPeriods A map to each supported BGM summary period +type PatientBGMPeriods struct { + // N14d Summary of a specific BGM time period (currently: 1d, 7d, 14d, 30d) + N14d *PatientBGMPeriod `json:"14d,omitempty"` + + // N1d Summary of a specific BGM time period (currently: 1d, 7d, 14d, 30d) + N1d *PatientBGMPeriod `json:"1d,omitempty"` + + // N30d Summary of a specific BGM time period (currently: 1d, 7d, 14d, 30d) + N30d *PatientBGMPeriod `json:"30d,omitempty"` + + // N7d Summary of a specific BGM time period (currently: 1d, 7d, 14d, 30d) + N7d *PatientBGMPeriod `json:"7d,omitempty"` +} + +// PatientBGMStats A summary of a users recent BGM glucose values +type PatientBGMStats struct { + // Config Summary schema version and calculation configuration + Config *PatientSummaryConfig `json:"config,omitempty"` + + // Dates dates tracked for summary calculation + Dates *PatientSummaryDates `json:"dates,omitempty"` + + // Periods A map to each supported BGM summary period + Periods *PatientBGMPeriods `json:"periods,omitempty"` + + // TotalHours Total hours represented in the hourly stats + TotalHours *int `json:"totalHours,omitempty"` +} + +// PatientCGMPeriod Summary of a specific CGM time period (currently: 1d, 7d, 14d, 30d) +type PatientCGMPeriod struct { + // AverageDailyRecords Average daily readings + AverageDailyRecords *float64 `json:"averageDailyRecords,omitempty"` + + // AverageGlucose Blood glucose value, in `mmol/L` + AverageGlucose *AverageGlucose `json:"averageGlucose,omitempty"` + + // GlucoseManagementIndicator A derived value which emulates A1C + GlucoseManagementIndicator *float64 `json:"glucoseManagementIndicator,omitempty"` + HasAverageDailyRecords *bool `json:"hasAverageDailyRecords,omitempty"` + HasAverageGlucose *bool `json:"hasAverageGlucose,omitempty"` + HasGlucoseManagementIndicator *bool `json:"hasGlucoseManagementIndicator,omitempty"` + HasTimeCGMUseMinutes *bool `json:"hasTimeCGMUseMinutes,omitempty"` + HasTimeCGMUsePercent *bool `json:"hasTimeCGMUsePercent,omitempty"` + HasTimeCGMUseRecords *bool `json:"hasTimeCGMUseRecords,omitempty"` + HasTimeInHighMinutes *bool `json:"hasTimeInHighMinutes,omitempty"` + HasTimeInHighPercent *bool `json:"hasTimeInHighPercent,omitempty"` + HasTimeInHighRecords *bool `json:"hasTimeInHighRecords,omitempty"` + HasTimeInLowMinutes *bool `json:"hasTimeInLowMinutes,omitempty"` + HasTimeInLowPercent *bool `json:"hasTimeInLowPercent,omitempty"` + HasTimeInLowRecords *bool `json:"hasTimeInLowRecords,omitempty"` + HasTimeInTargetMinutes *bool `json:"hasTimeInTargetMinutes,omitempty"` + HasTimeInTargetPercent *bool `json:"hasTimeInTargetPercent,omitempty"` + HasTimeInTargetRecords *bool `json:"hasTimeInTargetRecords,omitempty"` + HasTimeInVeryHighMinutes *bool `json:"hasTimeInVeryHighMinutes,omitempty"` + HasTimeInVeryHighPercent *bool `json:"hasTimeInVeryHighPercent,omitempty"` + HasTimeInVeryHighRecords *bool `json:"hasTimeInVeryHighRecords,omitempty"` + HasTimeInVeryLowMinutes *bool `json:"hasTimeInVeryLowMinutes,omitempty"` + HasTimeInVeryLowPercent *bool `json:"hasTimeInVeryLowPercent,omitempty"` + HasTimeInVeryLowRecords *bool `json:"hasTimeInVeryLowRecords,omitempty"` + HasTotalRecords *bool `json:"hasTotalRecords,omitempty"` + + // TimeCGMUseMinutes Counter of minutes spent wearing a cgm + TimeCGMUseMinutes *int `json:"timeCGMUseMinutes,omitempty"` + + // TimeCGMUsePercent Percentage of time spent wearing a cgm + TimeCGMUsePercent *float64 `json:"timeCGMUsePercent,omitempty"` + + // TimeCGMUseRecords Counter of minutes spent wearing a cgm + TimeCGMUseRecords *int `json:"timeCGMUseRecords,omitempty"` + + // TimeInHighMinutes Counter of minutes spent in high glucose range + TimeInHighMinutes *int `json:"timeInHighMinutes,omitempty"` + + // TimeInHighPercent Percentage of time spent in high glucose range + TimeInHighPercent *float64 `json:"timeInHighPercent,omitempty"` + + // TimeInHighRecords Counter of records in high glucose range + TimeInHighRecords *int `json:"timeInHighRecords,omitempty"` + + // TimeInLowMinutes Counter of minutes spent in low glucose range + TimeInLowMinutes *int `json:"timeInLowMinutes,omitempty"` + + // TimeInLowPercent Percentage of time spent in low glucose range + TimeInLowPercent *float64 `json:"timeInLowPercent,omitempty"` + + // TimeInLowRecords Counter of records in low glucose range + TimeInLowRecords *int `json:"timeInLowRecords,omitempty"` + + // TimeInTargetMinutes Counter of minutes spent in target glucose range + TimeInTargetMinutes *int `json:"timeInTargetMinutes,omitempty"` + + // TimeInTargetPercent Percentage of time spent in target glucose range + TimeInTargetPercent *float64 `json:"timeInTargetPercent,omitempty"` + + // TimeInTargetRecords Counter of records in target glucose range + TimeInTargetRecords *int `json:"timeInTargetRecords,omitempty"` + + // TimeInVeryHighMinutes Counter of minutes spent in very high glucose range + TimeInVeryHighMinutes *int `json:"timeInVeryHighMinutes,omitempty"` + + // TimeInVeryHighPercent Percentage of time spent in very high glucose range + TimeInVeryHighPercent *float64 `json:"timeInVeryHighPercent,omitempty"` + + // TimeInVeryHighRecords Counter of records in very high glucose range + TimeInVeryHighRecords *int `json:"timeInVeryHighRecords,omitempty"` + + // TimeInVeryLowMinutes Counter of minutes spent in very low glucose range + TimeInVeryLowMinutes *int `json:"timeInVeryLowMinutes,omitempty"` + + // TimeInVeryLowPercent Percentage of time spent in very low glucose range + TimeInVeryLowPercent *float64 `json:"timeInVeryLowPercent,omitempty"` + + // TimeInVeryLowRecords Counter of records in very low glucose range + TimeInVeryLowRecords *int `json:"timeInVeryLowRecords,omitempty"` + + // TotalRecords Counter of records + TotalRecords *int `json:"totalRecords,omitempty"` +} + +// PatientCGMPeriods A map to each supported CGM summary period +type PatientCGMPeriods struct { + // N14d Summary of a specific CGM time period (currently: 1d, 7d, 14d, 30d) + N14d *PatientCGMPeriod `json:"14d,omitempty"` + + // N1d Summary of a specific CGM time period (currently: 1d, 7d, 14d, 30d) + N1d *PatientCGMPeriod `json:"1d,omitempty"` + + // N30d Summary of a specific CGM time period (currently: 1d, 7d, 14d, 30d) + N30d *PatientCGMPeriod `json:"30d,omitempty"` + + // N7d Summary of a specific CGM time period (currently: 1d, 7d, 14d, 30d) + N7d *PatientCGMPeriod `json:"7d,omitempty"` +} + +// PatientCGMStats A summary of a users recent CGM glucose values +type PatientCGMStats struct { + // Config Summary schema version and calculation configuration + Config *PatientSummaryConfig `json:"config,omitempty"` + + // Dates dates tracked for summary calculation + Dates *PatientSummaryDates `json:"dates,omitempty"` + + // Periods A map to each supported CGM summary period + Periods *PatientCGMPeriods `json:"periods,omitempty"` + + // TotalHours Total hours represented in the hourly stats + TotalHours *int `json:"totalHours,omitempty"` } // PatientClinicRelationship defines model for PatientClinicRelationship. type PatientClinicRelationship struct { - // Clinic + // Clinic Clinic Clinic Clinic `json:"clinic"` Patient Patient `json:"patient"` } // PatientClinicRelationships defines model for PatientClinicRelationships. -type PatientClinicRelationships []PatientClinicRelationship +type PatientClinicRelationships = []PatientClinicRelationship // PatientPermissions defines model for PatientPermissions. type PatientPermissions struct { @@ -199,8 +606,66 @@ type PatientPermissions struct { View *map[string]interface{} `json:"view,omitempty"` } +// PatientSummary A summary of a patients recent data +type PatientSummary struct { + // BgmStats A summary of a users recent BGM glucose values + BgmStats *PatientBGMStats `json:"bgmStats,omitempty"` + + // CgmStats A summary of a users recent CGM glucose values + CgmStats *PatientCGMStats `json:"cgmStats,omitempty"` +} + +// PatientSummaryConfig Summary schema version and calculation configuration +type PatientSummaryConfig struct { + // HighGlucoseThreshold Threshold used for determining if a value is high + HighGlucoseThreshold *float64 `json:"highGlucoseThreshold,omitempty"` + + // LowGlucoseThreshold Threshold used for determining if a value is low + LowGlucoseThreshold *float64 `json:"lowGlucoseThreshold,omitempty"` + + // SchemaVersion Summary schema version + SchemaVersion *int `json:"schemaVersion,omitempty"` + + // VeryHighGlucoseThreshold Threshold used for determining if a value is very high + VeryHighGlucoseThreshold *float64 `json:"veryHighGlucoseThreshold,omitempty"` + + // VeryLowGlucoseThreshold Threshold used for determining if a value is very low + VeryLowGlucoseThreshold *float64 `json:"veryLowGlucoseThreshold,omitempty"` +} + +// PatientSummaryDates dates tracked for summary calculation +type PatientSummaryDates struct { + // FirstData Date of the first included value + FirstData *time.Time `json:"firstData,omitempty"` + HasFirstData *bool `json:"hasFirstData,omitempty"` + HasLastData *bool `json:"hasLastData,omitempty"` + HasLastUploadDate *bool `json:"hasLastUploadDate,omitempty"` + HasOutdatedSince *bool `json:"hasOutdatedSince,omitempty"` + + // LastData Date of the last calculated value + LastData *time.Time `json:"lastData,omitempty"` + + // LastUpdatedDate Date of the last calculation + LastUpdatedDate *time.Time `json:"lastUpdatedDate,omitempty"` + + // LastUploadDate Created date of the last calculated value + LastUploadDate *time.Time `json:"lastUploadDate,omitempty"` + + // OutdatedSince Date of the first user upload after lastData, removed when calculated + OutdatedSince *time.Time `json:"outdatedSince,omitempty"` +} + +// PatientTag defines model for PatientTag. +type PatientTag struct { + // Id String representation of a resource id + Id *string `json:"id,omitempty"` + + // Name The tag display name + Name string `json:"name"` +} + // Patients defines model for Patients. -type Patients []Patient +type Patients = []Patient // PatientsResponse defines model for PatientsResponse. type PatientsResponse struct { @@ -214,148 +679,325 @@ type PhoneNumber struct { Type *string `json:"type,omitempty"` } -// String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) -type TidepoolUserId string +// SuppressedNotifications defines model for SuppressedNotifications. +type SuppressedNotifications struct { + PatientClinicInvitation *bool `json:"patientClinicInvitation,omitempty"` +} + +// TidepoolUserId String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) +type TidepoolUserId = string + +// TidepoolUserIds Array of Tidepool User IDs +type TidepoolUserIds = []TidepoolUserId + +// Tier defines model for Tier. +type Tier string + +// TriggerMigration defines model for TriggerMigration. +type TriggerMigration struct { + AttestationSubmitted *bool `json:"attestationSubmitted,omitempty"` +} + +// UpdateSuppressedNotifications defines model for UpdateSuppressedNotifications. +type UpdateSuppressedNotifications struct { + SuppressedNotifications SuppressedNotifications `json:"suppressedNotifications"` +} + +// UpdateTier defines model for UpdateTier. +type UpdateTier struct { + Tier Tier `json:"tier"` +} + +// UpdateUserDetails defines model for UpdateUserDetails. +type UpdateUserDetails struct { + Email *openapi_types.Email `json:"email,omitempty"` +} // ClinicId defines model for clinicId. -type ClinicId string +type ClinicId = string // ClinicianId defines model for clinicianId. -type ClinicianId string +type ClinicianId = string + +// CreatedTimeEnd defines model for createdTimeEnd. +type CreatedTimeEnd = time.Time + +// CreatedTimeStart defines model for createdTimeStart. +type CreatedTimeStart = time.Time + +// EhrEnabled defines model for ehrEnabled. +type EhrEnabled = bool // Email defines model for email. -type Email openapi_types.Email +type Email = openapi_types.Email // InviteId defines model for inviteId. -type InviteId string +type InviteId = string // Limit defines model for limit. -type Limit int +type Limit = int // Offset defines model for offset. -type Offset int +type Offset = int // PatientId defines model for patientId. -type PatientId string +type PatientId = string + +// PatientTagId defines model for patientTagId. +type PatientTagId = string // Role defines model for role. -type Role string +type Role = string // Search defines model for search. -type Search string +type Search = string // ShareCode defines model for shareCode. -type ShareCode string +type ShareCode = string // Sort defines model for sort. -type Sort string +type Sort = string + +// UserId String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) +type UserId = TidepoolUserId -// String representation of a Tidepool User ID. Old style IDs are 10-digit strings consisting of only hexadeximcal digits. New style IDs are 36-digit [UUID v4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) -type UserId TidepoolUserId +// ListAllCliniciansParams defines parameters for ListAllClinicians. +type ListAllCliniciansParams struct { + Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"` + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` + + // CreatedTimeStart Return records created after the given date (inclusive) + CreatedTimeStart *CreatedTimeStart `form:"createdTimeStart,omitempty" json:"createdTimeStart,omitempty"` + + // CreatedTimeEnd Return records created before the given date (exclusive) + CreatedTimeEnd *CreatedTimeEnd `form:"createdTimeEnd,omitempty" json:"createdTimeEnd,omitempty"` +} // ListClinicsForClinicianParams defines parameters for ListClinicsForClinician. type ListClinicsForClinicianParams struct { - Offset *Offset `json:"offset,omitempty"` - Limit *Limit `json:"limit,omitempty"` + Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"` + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` } // ListClinicsParams defines parameters for ListClinics. type ListClinicsParams struct { - Limit *Limit `json:"limit,omitempty"` - Offset *Offset `json:"offset,omitempty"` - ShareCode *ShareCode `json:"shareCode,omitempty"` -} + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` + Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"` + ShareCode *ShareCode `form:"shareCode,omitempty" json:"shareCode,omitempty"` + + // CreatedTimeStart Return records created after the given date (inclusive) + CreatedTimeStart *CreatedTimeStart `form:"createdTimeStart,omitempty" json:"createdTimeStart,omitempty"` -// CreateClinicJSONBody defines parameters for CreateClinic. -type CreateClinicJSONBody Clinic + // CreatedTimeEnd Return records created before the given date (exclusive) + CreatedTimeEnd *CreatedTimeEnd `form:"createdTimeEnd,omitempty" json:"createdTimeEnd,omitempty"` -// UpdateClinicJSONBody defines parameters for UpdateClinic. -type UpdateClinicJSONBody Clinic + // EhrEnabled Retrieve clinics with enabled EHR integration + EhrEnabled *EhrEnabled `form:"ehrEnabled,omitempty" json:"ehrEnabled,omitempty"` +} // ListCliniciansParams defines parameters for ListClinicians. type ListCliniciansParams struct { - // Full text search query - Search *Search `json:"search,omitempty"` - Offset *Offset `json:"offset,omitempty"` - Limit *Limit `json:"limit,omitempty"` - Email *Email `json:"email,omitempty"` - Role *Role `json:"role,omitempty"` + // Search Full text search query + Search *Search `form:"search,omitempty" json:"search,omitempty"` + Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"` + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` + Email *Email `form:"email,omitempty" json:"email,omitempty"` + Role *Role `form:"role,omitempty" json:"role,omitempty"` } -// CreateClinicianJSONBody defines parameters for CreateClinician. -type CreateClinicianJSONBody Clinician +// ListPatientsParams defines parameters for ListPatients. +type ListPatientsParams struct { + // Search Full text search query + Search *Search `form:"search,omitempty" json:"search,omitempty"` + Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"` + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` -// UpdateClinicianJSONBody defines parameters for UpdateClinician. -type UpdateClinicianJSONBody Clinician + // Sort Sort order and attribute (e.g. +name or -name) + Sort *Sort `form:"sort,omitempty" json:"sort,omitempty"` -// AssociateClinicianToUserJSONBody defines parameters for AssociateClinicianToUser. -type AssociateClinicianToUserJSONBody AssociateClinicianToUser + // SortType Summary type to sort by + SortType *string `form:"sortType,omitempty" json:"sortType,omitempty"` -// MigrateLegacyClinicianPatientsJSONBody defines parameters for MigrateLegacyClinicianPatients. -type MigrateLegacyClinicianPatientsJSONBody Migration + // Period Time Period to display, filter, and sort + Period *string `form:"period,omitempty" json:"period,omitempty"` -// UpdateMigrationJSONBody defines parameters for UpdateMigration. -type UpdateMigrationJSONBody MigrationUpdate + // CgmTimeCGMUsePercent Percentage of time of CGM use + CgmTimeCGMUsePercent *string `form:"cgm.timeCGMUsePercent,omitempty" json:"cgm.timeCGMUsePercent,omitempty"` -// ListPatientsParams defines parameters for ListPatients. -type ListPatientsParams struct { - // Full text search query - Search *Search `json:"search,omitempty"` - Offset *Offset `json:"offset,omitempty"` - Limit *Limit `json:"limit,omitempty"` + // CgmTimeInVeryLowPercent Percentage of time below 54 mg/dL + CgmTimeInVeryLowPercent *string `form:"cgm.timeInVeryLowPercent,omitempty" json:"cgm.timeInVeryLowPercent,omitempty"` - // Sort order and attribute (e.g. +name or -name) - Sort *Sort `json:"sort,omitempty"` -} + // CgmTimeInLowPercent Percentage of time in range 54-70 mg/dL + CgmTimeInLowPercent *string `form:"cgm.timeInLowPercent,omitempty" json:"cgm.timeInLowPercent,omitempty"` + + // CgmTimeInTargetPercent Percentage of time in range 70-180 mg/dL + CgmTimeInTargetPercent *string `form:"cgm.timeInTargetPercent,omitempty" json:"cgm.timeInTargetPercent,omitempty"` + + // CgmTimeInHighPercent Percentage of time in range 180-250 mg/dL + CgmTimeInHighPercent *string `form:"cgm.timeInHighPercent,omitempty" json:"cgm.timeInHighPercent,omitempty"` + + // CgmTimeInVeryHighPercent Percentage of time above 250 mg/dL + CgmTimeInVeryHighPercent *string `form:"cgm.timeInVeryHighPercent,omitempty" json:"cgm.timeInVeryHighPercent,omitempty"` + + // CgmTimeCGMUseRecords Records of CGM use + CgmTimeCGMUseRecords *string `form:"cgm.timeCGMUseRecords,omitempty" json:"cgm.timeCGMUseRecords,omitempty"` + + // CgmTimeInVeryLowRecords Records below 54 mg/dL + CgmTimeInVeryLowRecords *string `form:"cgm.timeInVeryLowRecords,omitempty" json:"cgm.timeInVeryLowRecords,omitempty"` + + // CgmTimeInLowRecords Records in range 54-70 mg/dL + CgmTimeInLowRecords *string `form:"cgm.timeInLowRecords,omitempty" json:"cgm.timeInLowRecords,omitempty"` + + // CgmTimeInTargetRecords Records in range 70-180 mg/dL + CgmTimeInTargetRecords *string `form:"cgm.timeInTargetRecords,omitempty" json:"cgm.timeInTargetRecords,omitempty"` + + // CgmTimeInHighRecords Records in range 180-250 mg/dL + CgmTimeInHighRecords *string `form:"cgm.timeInHighRecords,omitempty" json:"cgm.timeInHighRecords,omitempty"` + + // CgmTimeInVeryHighRecords Records above 250 mg/dL + CgmTimeInVeryHighRecords *string `form:"cgm.timeInVeryHighRecords,omitempty" json:"cgm.timeInVeryHighRecords,omitempty"` + + // CgmAverageDailyRecords Average records per day + CgmAverageDailyRecords *string `form:"cgm.averageDailyRecords,omitempty" json:"cgm.averageDailyRecords,omitempty"` + + // CgmTotalRecords Total records in period + CgmTotalRecords *string `form:"cgm.totalRecords,omitempty" json:"cgm.totalRecords,omitempty"` + + // CgmLastUploadDateFrom Inclusive + CgmLastUploadDateFrom *time.Time `form:"cgm.lastUploadDateFrom,omitempty" json:"cgm.lastUploadDateFrom,omitempty"` + + // CgmLastUploadDateTo Exclusive + CgmLastUploadDateTo *time.Time `form:"cgm.lastUploadDateTo,omitempty" json:"cgm.lastUploadDateTo,omitempty"` + + // BgmTimeInVeryLowPercent Percentage of time below 54 mg/dL + BgmTimeInVeryLowPercent *string `form:"bgm.timeInVeryLowPercent,omitempty" json:"bgm.timeInVeryLowPercent,omitempty"` -// CreatePatientAccountJSONBody defines parameters for CreatePatientAccount. -type CreatePatientAccountJSONBody Patient + // BgmTimeInLowPercent Percentage of time in range 54-70 mg/dL + BgmTimeInLowPercent *string `form:"bgm.timeInLowPercent,omitempty" json:"bgm.timeInLowPercent,omitempty"` -// CreatePatientFromUserJSONBody defines parameters for CreatePatientFromUser. -type CreatePatientFromUserJSONBody CreatePatient + // BgmTimeInTargetPercent Percentage of time in range 70-180 mg/dL + BgmTimeInTargetPercent *string `form:"bgm.timeInTargetPercent,omitempty" json:"bgm.timeInTargetPercent,omitempty"` -// UpdatePatientJSONBody defines parameters for UpdatePatient. -type UpdatePatientJSONBody Patient + // BgmTimeInHighPercent Percentage of time in range 180-250 mg/dL + BgmTimeInHighPercent *string `form:"bgm.timeInHighPercent,omitempty" json:"bgm.timeInHighPercent,omitempty"` -// UpdatePatientPermissionsJSONBody defines parameters for UpdatePatientPermissions. -type UpdatePatientPermissionsJSONBody PatientPermissions + // BgmTimeInVeryHighPercent Percentage of time above 250 mg/dL + BgmTimeInVeryHighPercent *string `form:"bgm.timeInVeryHighPercent,omitempty" json:"bgm.timeInVeryHighPercent,omitempty"` + + // BgmTimeInVeryLowRecords Records below 54 mg/dL + BgmTimeInVeryLowRecords *string `form:"bgm.timeInVeryLowRecords,omitempty" json:"bgm.timeInVeryLowRecords,omitempty"` + + // BgmTimeInLowRecords Records in range 54-70 mg/dL + BgmTimeInLowRecords *string `form:"bgm.timeInLowRecords,omitempty" json:"bgm.timeInLowRecords,omitempty"` + + // BgmTimeInTargetRecords Records in range 70-180 mg/dL + BgmTimeInTargetRecords *string `form:"bgm.timeInTargetRecords,omitempty" json:"bgm.timeInTargetRecords,omitempty"` + + // BgmTimeInHighRecords Records in range 180-250 mg/dL + BgmTimeInHighRecords *string `form:"bgm.timeInHighRecords,omitempty" json:"bgm.timeInHighRecords,omitempty"` + + // BgmTimeInVeryHighRecords Records above 250 mg/dL + BgmTimeInVeryHighRecords *string `form:"bgm.timeInVeryHighRecords,omitempty" json:"bgm.timeInVeryHighRecords,omitempty"` + + // BgmAverageDailyRecords Average records per day + BgmAverageDailyRecords *string `form:"bgm.averageDailyRecords,omitempty" json:"bgm.averageDailyRecords,omitempty"` + + // BgmTotalRecords Total records in period + BgmTotalRecords *string `form:"bgm.totalRecords,omitempty" json:"bgm.totalRecords,omitempty"` + + // BgmLastUploadDateFrom Inclusive + BgmLastUploadDateFrom *time.Time `form:"bgm.lastUploadDateFrom,omitempty" json:"bgm.lastUploadDateFrom,omitempty"` + + // BgmLastUploadDateTo Exclusive + BgmLastUploadDateTo *time.Time `form:"bgm.lastUploadDateTo,omitempty" json:"bgm.lastUploadDateTo,omitempty"` + + // Tags Comma-separated list of patient tag IDs + Tags *[]string `form:"tags,omitempty" json:"tags,omitempty"` +} // ListClinicsForPatientParams defines parameters for ListClinicsForPatient. type ListClinicsForPatientParams struct { - Offset *Offset `json:"offset,omitempty"` - Limit *Limit `json:"limit,omitempty"` + Offset *Offset `form:"offset,omitempty" json:"offset,omitempty"` + Limit *Limit `form:"limit,omitempty" json:"limit,omitempty"` } +// ProcessEHRMessageJSONBody defines parameters for ProcessEHRMessage. +type ProcessEHRMessageJSONBody = map[string]interface{} + // CreateClinicJSONRequestBody defines body for CreateClinic for application/json ContentType. -type CreateClinicJSONRequestBody CreateClinicJSONBody +type CreateClinicJSONRequestBody = Clinic // UpdateClinicJSONRequestBody defines body for UpdateClinic for application/json ContentType. -type UpdateClinicJSONRequestBody UpdateClinicJSONBody +type UpdateClinicJSONRequestBody = Clinic // CreateClinicianJSONRequestBody defines body for CreateClinician for application/json ContentType. -type CreateClinicianJSONRequestBody CreateClinicianJSONBody +type CreateClinicianJSONRequestBody = Clinician // UpdateClinicianJSONRequestBody defines body for UpdateClinician for application/json ContentType. -type UpdateClinicianJSONRequestBody UpdateClinicianJSONBody +type UpdateClinicianJSONRequestBody = Clinician // AssociateClinicianToUserJSONRequestBody defines body for AssociateClinicianToUser for application/json ContentType. -type AssociateClinicianToUserJSONRequestBody AssociateClinicianToUserJSONBody +type AssociateClinicianToUserJSONRequestBody = AssociateClinicianToUser + +// UpdateMembershipRestrictionsJSONRequestBody defines body for UpdateMembershipRestrictions for application/json ContentType. +type UpdateMembershipRestrictionsJSONRequestBody = MembershipRestrictions + +// TriggerInitialMigrationJSONRequestBody defines body for TriggerInitialMigration for application/json ContentType. +type TriggerInitialMigrationJSONRequestBody = TriggerMigration // MigrateLegacyClinicianPatientsJSONRequestBody defines body for MigrateLegacyClinicianPatients for application/json ContentType. -type MigrateLegacyClinicianPatientsJSONRequestBody MigrateLegacyClinicianPatientsJSONBody +type MigrateLegacyClinicianPatientsJSONRequestBody = Migration // UpdateMigrationJSONRequestBody defines body for UpdateMigration for application/json ContentType. -type UpdateMigrationJSONRequestBody UpdateMigrationJSONBody +type UpdateMigrationJSONRequestBody = MigrationUpdate + +// CreatePatientTagJSONRequestBody defines body for CreatePatientTag for application/json ContentType. +type CreatePatientTagJSONRequestBody = PatientTag + +// UpdatePatientTagJSONRequestBody defines body for UpdatePatientTag for application/json ContentType. +type UpdatePatientTagJSONRequestBody = PatientTag // CreatePatientAccountJSONRequestBody defines body for CreatePatientAccount for application/json ContentType. -type CreatePatientAccountJSONRequestBody CreatePatientAccountJSONBody +type CreatePatientAccountJSONRequestBody = Patient + +// AssignPatientTagToClinicPatientsJSONRequestBody defines body for AssignPatientTagToClinicPatients for application/json ContentType. +type AssignPatientTagToClinicPatientsJSONRequestBody = TidepoolUserIds + +// DeletePatientTagFromClinicPatientsJSONRequestBody defines body for DeletePatientTagFromClinicPatients for application/json ContentType. +type DeletePatientTagFromClinicPatientsJSONRequestBody = TidepoolUserIds // CreatePatientFromUserJSONRequestBody defines body for CreatePatientFromUser for application/json ContentType. -type CreatePatientFromUserJSONRequestBody CreatePatientFromUserJSONBody +type CreatePatientFromUserJSONRequestBody = CreatePatient // UpdatePatientJSONRequestBody defines body for UpdatePatient for application/json ContentType. -type UpdatePatientJSONRequestBody UpdatePatientJSONBody +type UpdatePatientJSONRequestBody = Patient // UpdatePatientPermissionsJSONRequestBody defines body for UpdatePatientPermissions for application/json ContentType. -type UpdatePatientPermissionsJSONRequestBody UpdatePatientPermissionsJSONBody +type UpdatePatientPermissionsJSONRequestBody = PatientPermissions + +// UpdateEHRSettingsJSONRequestBody defines body for UpdateEHRSettings for application/json ContentType. +type UpdateEHRSettingsJSONRequestBody = EHRSettings + +// UpdateMRNSettingsJSONRequestBody defines body for UpdateMRNSettings for application/json ContentType. +type UpdateMRNSettingsJSONRequestBody = MRNSettings + +// UpdateSuppressedNotificationsJSONRequestBody defines body for UpdateSuppressedNotifications for application/json ContentType. +type UpdateSuppressedNotificationsJSONRequestBody = UpdateSuppressedNotifications + +// UpdateTierJSONRequestBody defines body for UpdateTier for application/json ContentType. +type UpdateTierJSONRequestBody = UpdateTier + +// UpdatePatientSummaryJSONRequestBody defines body for UpdatePatientSummary for application/json ContentType. +type UpdatePatientSummaryJSONRequestBody = PatientSummary + +// UpdatePatientDataSourcesJSONRequestBody defines body for UpdatePatientDataSources for application/json ContentType. +type UpdatePatientDataSourcesJSONRequestBody = DataSources + +// ProcessEHRMessageJSONRequestBody defines body for ProcessEHRMessage for application/json ContentType. +type ProcessEHRMessageJSONRequestBody = ProcessEHRMessageJSONBody + +// MatchClinicAndPatientJSONRequestBody defines body for MatchClinicAndPatient for application/json ContentType. +type MatchClinicAndPatientJSONRequestBody = EHRMatchRequest +// UpdateClinicUserDetailsJSONRequestBody defines body for UpdateClinicUserDetails for application/json ContentType. +type UpdateClinicUserDetailsJSONRequestBody = UpdateUserDetails diff --git a/vendor/modules.txt b/vendor/modules.txt index 860220b35..046436002 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -313,7 +313,7 @@ github.com/russross/blackfriday/v2 # github.com/shurcooL/sanitized_anchor_name v1.0.0 ## explicit github.com/shurcooL/sanitized_anchor_name -# github.com/tidepool-org/clinic/client v0.0.0-20211118205743-020bf46ac989 +# github.com/tidepool-org/clinic/client v0.0.0-20230815132146-bd6c2982ff6d ## explicit; go 1.16 github.com/tidepool-org/clinic/client # github.com/tidepool-org/devices/api v0.0.0-20220914225528-c7373eb1babc