diff --git a/go.mod b/go.mod index ef36436..f29155a 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/golang-jwt/jwt v3.2.2+incompatible github.com/google/uuid v1.3.0 github.com/joho/godotenv v1.4.0 - github.com/satimoto/go-datastore v0.1.2-0.20220622133836-a81a7a5cb5a0 + github.com/satimoto/go-datastore v0.1.2-0.20220708123616-97e1b56f1fbd github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e github.com/vektah/gqlparser/v2 v2.4.0 ) @@ -65,7 +65,7 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/prometheus/client_golang v1.12.2 github.com/satimoto/go-ferp v0.0.0-20220616081646-4cef41ddc35c - github.com/satimoto/go-ocpi v0.0.3-0.20220629073124-496523cd8663 + github.com/satimoto/go-ocpi v0.0.3-0.20220706220813-218dea960d16 golang.org/x/text v0.3.7 // indirect google.golang.org/genproto v0.0.0-20210617175327-b9e0b3197ced // indirect google.golang.org/grpc v1.47.0 diff --git a/go.sum b/go.sum index 302134c..aa9bcfb 100644 --- a/go.sum +++ b/go.sum @@ -674,10 +674,24 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/ryanuber/go-glob v0.0.0-20170128012129-256dc444b735/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/satimoto/go-datastore v0.1.2-0.20220622133836-a81a7a5cb5a0 h1:z22k7+KCtcBBz0r+T+BK4v3UmaYiYYpCbuKux7XuK6M= github.com/satimoto/go-datastore v0.1.2-0.20220622133836-a81a7a5cb5a0/go.mod h1:SvM8losYPwH6hJgUKLkjNtQwVv06lZgCMWl8cGdllCM= +github.com/satimoto/go-datastore v0.1.2-0.20220630143844-9db8ae144524 h1:5y7BbzgMj7maFbGsjv7BdfXNAU6pYIzTYtDD1JV7er0= +github.com/satimoto/go-datastore v0.1.2-0.20220630143844-9db8ae144524/go.mod h1:SvM8losYPwH6hJgUKLkjNtQwVv06lZgCMWl8cGdllCM= +github.com/satimoto/go-datastore v0.1.2-0.20220630201402-dcb5c3b244b7 h1:D0xO2MO3Pn4MvHdw/NciqEAboNCDtVCQ6TR/9NOXQAg= +github.com/satimoto/go-datastore v0.1.2-0.20220630201402-dcb5c3b244b7/go.mod h1:SvM8losYPwH6hJgUKLkjNtQwVv06lZgCMWl8cGdllCM= +github.com/satimoto/go-datastore v0.1.2-0.20220701141911-9931038d34e2 h1:76PX/zhm7RlbgCt2eUwswko+kpME7UrldfddY8iao5Q= +github.com/satimoto/go-datastore v0.1.2-0.20220701141911-9931038d34e2/go.mod h1:SvM8losYPwH6hJgUKLkjNtQwVv06lZgCMWl8cGdllCM= +github.com/satimoto/go-datastore v0.1.2-0.20220701142508-5fa05af508e7 h1:gUt2mjrvnmf/KsLVNN5yJILVJP4TZXMOh5J1u2helEI= +github.com/satimoto/go-datastore v0.1.2-0.20220701142508-5fa05af508e7/go.mod h1:SvM8losYPwH6hJgUKLkjNtQwVv06lZgCMWl8cGdllCM= +github.com/satimoto/go-datastore v0.1.2-0.20220706210314-d8475e7648e7 h1:qGjmNcQql/eMidB4fdNVM5Q3J0HWJKy0muWkDNl4PqM= +github.com/satimoto/go-datastore v0.1.2-0.20220706210314-d8475e7648e7/go.mod h1:SvM8losYPwH6hJgUKLkjNtQwVv06lZgCMWl8cGdllCM= +github.com/satimoto/go-datastore v0.1.2-0.20220708123616-97e1b56f1fbd h1:RgxMBYa0Eb04R4Aop2Cd+17PGwivwwU+4n/XIS/6VVo= +github.com/satimoto/go-datastore v0.1.2-0.20220708123616-97e1b56f1fbd/go.mod h1:SvM8losYPwH6hJgUKLkjNtQwVv06lZgCMWl8cGdllCM= github.com/satimoto/go-ferp v0.0.0-20220616081646-4cef41ddc35c h1:veyh4QvrSGfyDnvXuZZ0bHTnRwMMMBL6xhnsHToVlF4= github.com/satimoto/go-ferp v0.0.0-20220616081646-4cef41ddc35c/go.mod h1:pNLfpKibIdJEBYSyD7c0d6HB0zzb1Sjw06CamVB2xTI= github.com/satimoto/go-ocpi v0.0.3-0.20220629073124-496523cd8663 h1:YFN5ip+jF2+L711GSq3SaSbqdm8Ifz9SSZqKtOrRyVY= github.com/satimoto/go-ocpi v0.0.3-0.20220629073124-496523cd8663/go.mod h1:UT4T/JPdtGs516g6+OzP/4gqyl2fmFaFmGa/6iERIpk= +github.com/satimoto/go-ocpi v0.0.3-0.20220706220813-218dea960d16 h1:dqE8S5mW3CzWzUCBr9lHyfp1GW0jVRsOO0VacE9IHhc= +github.com/satimoto/go-ocpi v0.0.3-0.20220706220813-218dea960d16/go.mod h1:VyaARU7K3FaAbxE8IxuMxrNN2RPF/f3E50Ix0Y6Zy8I= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= diff --git a/graph/exec.go b/graph/exec.go index b16ac6f..d2fa419 100644 --- a/graph/exec.go +++ b/graph/exec.go @@ -53,6 +53,8 @@ type ResolverRoot interface { PriceComponent() PriceComponentResolver Query() QueryResolver RegularHour() RegularHourResolver + Session() SessionResolver + SessionInvoice() SessionInvoiceResolver StatusSchedule() StatusScheduleResolver Tariff() TariffResolver } @@ -84,6 +86,8 @@ type ComplexityRoot struct { Connector struct { Amperage func(childComplexity int) int Format func(childComplexity int) int + ID func(childComplexity int) int + Identifier func(childComplexity int) int LastUpdated func(childComplexity int) int PowerType func(childComplexity int) int Standard func(childComplexity int) int @@ -156,9 +160,10 @@ type ComplexityRoot struct { Capabilities func(childComplexity int) int Connectors func(childComplexity int) int Directions func(childComplexity int) int - EvseID func(childComplexity int) int FloorLevel func(childComplexity int) int Geom func(childComplexity int) int + ID func(childComplexity int) int + Identifier func(childComplexity int) int Images func(childComplexity int) int IsRemoteCapable func(childComplexity int) int IsRfidCapable func(childComplexity int) int @@ -215,6 +220,7 @@ type ComplexityRoot struct { Evses func(childComplexity int) int Facilities func(childComplexity int) int Geom func(childComplexity int) int + ID func(childComplexity int) int Images func(childComplexity int) int IsRemoteCapable func(childComplexity int) int IsRfidCapable func(childComplexity int) int @@ -267,9 +273,11 @@ type ComplexityRoot struct { } Query struct { - GetLocation func(childComplexity int, uid string) int + GetLocation func(childComplexity int, input GetLocationInput) int GetRate func(childComplexity int, currency string) int - GetTariff func(childComplexity int, uid string) int + GetSession func(childComplexity int, input GetSessionInput) int + GetSessionInvoice func(childComplexity int, id int64) int + GetTariff func(childComplexity int, input GetTariffInput) int ListLocations func(childComplexity int, input ListLocationsInput) int VerifyAuthentication func(childComplexity int, code string) int } @@ -290,6 +298,40 @@ type ComplexityRoot struct { ID func(childComplexity int) int } + Session struct { + AuthMethod func(childComplexity int) int + AuthorizationID func(childComplexity int) int + Connector func(childComplexity int) int + EndDatetime func(childComplexity int) int + Evse func(childComplexity int) int + ID func(childComplexity int) int + Kwh func(childComplexity int) int + LastUpdated func(childComplexity int) int + Location func(childComplexity int) int + MeterID func(childComplexity int) int + SessionInvoices func(childComplexity int) int + StartDatetime func(childComplexity int) int + Status func(childComplexity int) int + Uid func(childComplexity int) int + } + + SessionInvoice struct { + AmountFiat func(childComplexity int) int + AmountMsat func(childComplexity int) int + CommissionFiat func(childComplexity int) int + CommissionMsat func(childComplexity int) int + Currency func(childComplexity int) int + CurrencyRate func(childComplexity int) int + CurrencyRateMsat func(childComplexity int) int + ID func(childComplexity int) int + IsExpired func(childComplexity int) int + IsSettled func(childComplexity int) int + LastUpdated func(childComplexity int) int + PaymentRequest func(childComplexity int) int + TaxFiat func(childComplexity int) int + TaxMsat func(childComplexity int) int + } + StartSession struct { AuthorizationID func(childComplexity int) int EvseUID func(childComplexity int) int @@ -314,6 +356,7 @@ type ComplexityRoot struct { Currency func(childComplexity int) int Elements func(childComplexity int) int EnergyMix func(childComplexity int) int + ID func(childComplexity int) int Uid func(childComplexity int) int } @@ -349,6 +392,7 @@ type ChannelRequestResolver interface { Node(ctx context.Context, obj *db.ChannelRequest) (*db.Node, error) } type ConnectorResolver interface { + Identifier(ctx context.Context, obj *db.Connector) (*string, error) Standard(ctx context.Context, obj *db.Connector) (string, error) Format(ctx context.Context, obj *db.Connector) (string, error) PowerType(ctx context.Context, obj *db.Connector) (string, error) @@ -384,7 +428,7 @@ type EnvironmentalImpactResolver interface { Source(ctx context.Context, obj *db.EnvironmentalImpact) (string, error) } type EvseResolver interface { - EvseID(ctx context.Context, obj *db.Evse) (*string, error) + Identifier(ctx context.Context, obj *db.Evse) (*string, error) Status(ctx context.Context, obj *db.Evse) (string, error) StatusSchedule(ctx context.Context, obj *db.Evse) ([]db.StatusSchedule, error) Capabilities(ctx context.Context, obj *db.Evse) ([]TextDescription, error) @@ -456,14 +500,33 @@ type PriceComponentResolver interface { } type QueryResolver interface { VerifyAuthentication(ctx context.Context, code string) (*VerifyAuthentication, error) - GetLocation(ctx context.Context, uid string) (*db.Location, error) + GetLocation(ctx context.Context, input GetLocationInput) (*db.Location, error) ListLocations(ctx context.Context, input ListLocationsInput) ([]ListLocation, error) GetRate(ctx context.Context, currency string) (*Rate, error) - GetTariff(ctx context.Context, uid string) (*db.Tariff, error) + GetSession(ctx context.Context, input GetSessionInput) (*db.Session, error) + GetSessionInvoice(ctx context.Context, id int64) (*db.SessionInvoice, error) + GetTariff(ctx context.Context, input GetTariffInput) (*db.Tariff, error) } type RegularHourResolver interface { Weekday(ctx context.Context, obj *db.RegularHour) (int, error) } +type SessionResolver interface { + AuthorizationID(ctx context.Context, obj *db.Session) (*string, error) + StartDatetime(ctx context.Context, obj *db.Session) (string, error) + EndDatetime(ctx context.Context, obj *db.Session) (*string, error) + + AuthMethod(ctx context.Context, obj *db.Session) (string, error) + Location(ctx context.Context, obj *db.Session) (*db.Location, error) + Evse(ctx context.Context, obj *db.Session) (*db.Evse, error) + Connector(ctx context.Context, obj *db.Session) (*db.Connector, error) + MeterID(ctx context.Context, obj *db.Session) (*string, error) + SessionInvoices(ctx context.Context, obj *db.Session) ([]db.SessionInvoice, error) + Status(ctx context.Context, obj *db.Session) (string, error) + LastUpdated(ctx context.Context, obj *db.Session) (string, error) +} +type SessionInvoiceResolver interface { + LastUpdated(ctx context.Context, obj *db.SessionInvoice) (string, error) +} type StatusScheduleResolver interface { PeriodBegin(ctx context.Context, obj *db.StatusSchedule) (string, error) PeriodEnd(ctx context.Context, obj *db.StatusSchedule) (*string, error) @@ -580,6 +643,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Connector.Format(childComplexity), true + case "Connector.id": + if e.complexity.Connector.ID == nil { + break + } + + return e.complexity.Connector.ID(childComplexity), true + + case "Connector.identifier": + if e.complexity.Connector.Identifier == nil { + break + } + + return e.complexity.Connector.Identifier(childComplexity), true + case "Connector.lastUpdated": if e.complexity.Connector.LastUpdated == nil { break @@ -895,13 +972,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Evse.Directions(childComplexity), true - case "Evse.evseId": - if e.complexity.Evse.EvseID == nil { - break - } - - return e.complexity.Evse.EvseID(childComplexity), true - case "Evse.floorLevel": if e.complexity.Evse.FloorLevel == nil { break @@ -916,6 +986,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Evse.Geom(childComplexity), true + case "Evse.id": + if e.complexity.Evse.ID == nil { + break + } + + return e.complexity.Evse.ID(childComplexity), true + + case "Evse.identifier": + if e.complexity.Evse.Identifier == nil { + break + } + + return e.complexity.Evse.Identifier(childComplexity), true + case "Evse.images": if e.complexity.Evse.Images == nil { break @@ -1182,6 +1266,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Location.Geom(childComplexity), true + case "Location.id": + if e.complexity.Location.ID == nil { + break + } + + return e.complexity.Location.ID(childComplexity), true + case "Location.images": if e.complexity.Location.Images == nil { break @@ -1511,7 +1602,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.GetLocation(childComplexity, args["uid"].(string)), true + return e.complexity.Query.GetLocation(childComplexity, args["input"].(GetLocationInput)), true case "Query.getRate": if e.complexity.Query.GetRate == nil { @@ -1525,6 +1616,30 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Query.GetRate(childComplexity, args["currency"].(string)), true + case "Query.getSession": + if e.complexity.Query.GetSession == nil { + break + } + + args, err := ec.field_Query_getSession_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GetSession(childComplexity, args["input"].(GetSessionInput)), true + + case "Query.getSessionInvoice": + if e.complexity.Query.GetSessionInvoice == nil { + break + } + + args, err := ec.field_Query_getSessionInvoice_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Query.GetSessionInvoice(childComplexity, args["id"].(int64)), true + case "Query.getTariff": if e.complexity.Query.GetTariff == nil { break @@ -1535,7 +1650,7 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return 0, false } - return e.complexity.Query.GetTariff(childComplexity, args["uid"].(string)), true + return e.complexity.Query.GetTariff(childComplexity, args["input"].(GetTariffInput)), true case "Query.listLocations": if e.complexity.Query.ListLocations == nil { @@ -1610,6 +1725,202 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Result.ID(childComplexity), true + case "Session.authMethod": + if e.complexity.Session.AuthMethod == nil { + break + } + + return e.complexity.Session.AuthMethod(childComplexity), true + + case "Session.authorizationId": + if e.complexity.Session.AuthorizationID == nil { + break + } + + return e.complexity.Session.AuthorizationID(childComplexity), true + + case "Session.connector": + if e.complexity.Session.Connector == nil { + break + } + + return e.complexity.Session.Connector(childComplexity), true + + case "Session.endDatetime": + if e.complexity.Session.EndDatetime == nil { + break + } + + return e.complexity.Session.EndDatetime(childComplexity), true + + case "Session.evse": + if e.complexity.Session.Evse == nil { + break + } + + return e.complexity.Session.Evse(childComplexity), true + + case "Session.id": + if e.complexity.Session.ID == nil { + break + } + + return e.complexity.Session.ID(childComplexity), true + + case "Session.kwh": + if e.complexity.Session.Kwh == nil { + break + } + + return e.complexity.Session.Kwh(childComplexity), true + + case "Session.lastUpdated": + if e.complexity.Session.LastUpdated == nil { + break + } + + return e.complexity.Session.LastUpdated(childComplexity), true + + case "Session.location": + if e.complexity.Session.Location == nil { + break + } + + return e.complexity.Session.Location(childComplexity), true + + case "Session.meterId": + if e.complexity.Session.MeterID == nil { + break + } + + return e.complexity.Session.MeterID(childComplexity), true + + case "Session.sessionInvoices": + if e.complexity.Session.SessionInvoices == nil { + break + } + + return e.complexity.Session.SessionInvoices(childComplexity), true + + case "Session.startDatetime": + if e.complexity.Session.StartDatetime == nil { + break + } + + return e.complexity.Session.StartDatetime(childComplexity), true + + case "Session.status": + if e.complexity.Session.Status == nil { + break + } + + return e.complexity.Session.Status(childComplexity), true + + case "Session.uid": + if e.complexity.Session.Uid == nil { + break + } + + return e.complexity.Session.Uid(childComplexity), true + + case "SessionInvoice.amountFiat": + if e.complexity.SessionInvoice.AmountFiat == nil { + break + } + + return e.complexity.SessionInvoice.AmountFiat(childComplexity), true + + case "SessionInvoice.amountMsat": + if e.complexity.SessionInvoice.AmountMsat == nil { + break + } + + return e.complexity.SessionInvoice.AmountMsat(childComplexity), true + + case "SessionInvoice.commissionFiat": + if e.complexity.SessionInvoice.CommissionFiat == nil { + break + } + + return e.complexity.SessionInvoice.CommissionFiat(childComplexity), true + + case "SessionInvoice.commissionMsat": + if e.complexity.SessionInvoice.CommissionMsat == nil { + break + } + + return e.complexity.SessionInvoice.CommissionMsat(childComplexity), true + + case "SessionInvoice.currency": + if e.complexity.SessionInvoice.Currency == nil { + break + } + + return e.complexity.SessionInvoice.Currency(childComplexity), true + + case "SessionInvoice.currencyRate": + if e.complexity.SessionInvoice.CurrencyRate == nil { + break + } + + return e.complexity.SessionInvoice.CurrencyRate(childComplexity), true + + case "SessionInvoice.currencyRateMsat": + if e.complexity.SessionInvoice.CurrencyRateMsat == nil { + break + } + + return e.complexity.SessionInvoice.CurrencyRateMsat(childComplexity), true + + case "SessionInvoice.id": + if e.complexity.SessionInvoice.ID == nil { + break + } + + return e.complexity.SessionInvoice.ID(childComplexity), true + + case "SessionInvoice.isExpired": + if e.complexity.SessionInvoice.IsExpired == nil { + break + } + + return e.complexity.SessionInvoice.IsExpired(childComplexity), true + + case "SessionInvoice.isSettled": + if e.complexity.SessionInvoice.IsSettled == nil { + break + } + + return e.complexity.SessionInvoice.IsSettled(childComplexity), true + + case "SessionInvoice.lastUpdated": + if e.complexity.SessionInvoice.LastUpdated == nil { + break + } + + return e.complexity.SessionInvoice.LastUpdated(childComplexity), true + + case "SessionInvoice.paymentRequest": + if e.complexity.SessionInvoice.PaymentRequest == nil { + break + } + + return e.complexity.SessionInvoice.PaymentRequest(childComplexity), true + + case "SessionInvoice.taxFiat": + if e.complexity.SessionInvoice.TaxFiat == nil { + break + } + + return e.complexity.SessionInvoice.TaxFiat(childComplexity), true + + case "SessionInvoice.taxMsat": + if e.complexity.SessionInvoice.TaxMsat == nil { + break + } + + return e.complexity.SessionInvoice.TaxMsat(childComplexity), true + case "StartSession.authorizationId": if e.complexity.StartSession.AuthorizationID == nil { break @@ -1708,6 +2019,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Tariff.EnergyMix(childComplexity), true + case "Tariff.id": + if e.complexity.Tariff.ID == nil { + break + } + + return e.complexity.Tariff.ID(childComplexity), true + case "Tariff.uid": if e.complexity.Tariff.Uid == nil { break @@ -1940,7 +2258,9 @@ extend type Mutation { } `, BuiltIn: false}, {Name: "graph/schema/connector.graphqls", Input: `type Connector { + id: ID! uid: String! + identifier: String standard: String! format: String! powerType: String! @@ -2042,8 +2362,9 @@ extend type Mutation { } `, BuiltIn: false}, {Name: "graph/schema/evse.graphqls", Input: `type Evse { + id: ID! uid: String! - evseId: String + identifier: String status: String! statusSchedule: [StatusSchedule!]! capabilities: [TextDescription!]! @@ -2098,6 +2419,7 @@ input CreateImageInput { } type Location { + id: ID! uid: String! type: String! name: String @@ -2125,6 +2447,11 @@ type Location { lastUpdated: String! } +input GetLocationInput { + id: ID + uid: String +} + input ListLocationsInput { xMin: Float! yMin: Float! @@ -2134,7 +2461,7 @@ input ListLocationsInput { } extend type Query { - getLocation(uid: String!): Location + getLocation(input: GetLocationInput!): Location! listLocations(input: ListLocationsInput!): [ListLocation!]! } @@ -2175,6 +2502,52 @@ extend type Query { `, BuiltIn: false}, {Name: "graph/schema/result.graphqls", Input: `type Result { id: ID! +}`, BuiltIn: false}, + {Name: "graph/schema/session.graphqls", Input: `type Session { + id: ID! + uid: String! + authorizationId: String + startDatetime: String! + endDatetime: String + kwh: Float! + authMethod: String! + location: Location! + evse: Evse! + connector: Connector! + meterId: String + sessionInvoices: [SessionInvoice!]! + status: String! + lastUpdated: String! +} + +input GetSessionInput { + id: ID + uid: String + authorizationId: String +} + +extend type Query { + getSession(input: GetSessionInput!): Session! +}`, BuiltIn: false}, + {Name: "graph/schema/sessioninvoice.graphqls", Input: `type SessionInvoice { + id: ID! + currency: String! + currencyRate: Int! + currencyRateMsat: Int! + amountFiat: Float! + amountMsat: Int! + commissionFiat: Float! + commissionMsat: Int! + taxFiat: Float! + taxMsat: Int! + paymentRequest: String! + isSettled: Boolean! + isExpired: Boolean! + lastUpdated: String! +} + +extend type Query { + getSessionInvoice(id: ID!): SessionInvoice }`, BuiltIn: false}, {Name: "graph/schema/statusschedule.graphqls", Input: `type StatusSchedule { periodBegin: String! @@ -2182,14 +2555,20 @@ extend type Query { status: String! }`, BuiltIn: false}, {Name: "graph/schema/tariff.graphqls", Input: `type Tariff { + id: ID! uid: String! currency: String! elements: [TariffElement!]! energyMix: EnergyMix } +input GetTariffInput { + id: ID + uid: String +} + extend type Query { - getTariff(uid: String!): Tariff + getTariff(input: GetTariffInput!): Tariff! }`, BuiltIn: false}, {Name: "graph/schema/tariffelement.graphqls", Input: `type TariffElement { priceComponents: [PriceComponent!] @@ -2426,15 +2805,15 @@ func (ec *executionContext) field_Query___type_args(ctx context.Context, rawArgs func (ec *executionContext) field_Query_getLocation_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["uid"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uid")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) + var arg0 GetLocationInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNGetLocationInput2githubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐGetLocationInput(ctx, tmp) if err != nil { return nil, err } } - args["uid"] = arg0 + args["input"] = arg0 return args, nil } @@ -2453,18 +2832,48 @@ func (ec *executionContext) field_Query_getRate_args(ctx context.Context, rawArg return args, nil } +func (ec *executionContext) field_Query_getSessionInvoice_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 int64 + if tmp, ok := rawArgs["id"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + arg0, err = ec.unmarshalNID2int64(ctx, tmp) + if err != nil { + return nil, err + } + } + args["id"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Query_getSession_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 GetSessionInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNGetSessionInput2githubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐGetSessionInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + func (ec *executionContext) field_Query_getTariff_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { var err error args := map[string]interface{}{} - var arg0 string - if tmp, ok := rawArgs["uid"]; ok { - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uid")) - arg0, err = ec.unmarshalNString2string(ctx, tmp) + var arg0 GetTariffInput + if tmp, ok := rawArgs["input"]; ok { + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("input")) + arg0, err = ec.unmarshalNGetTariffInput2githubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐGetTariffInput(ctx, tmp) if err != nil { return nil, err } } - args["uid"] = arg0 + args["input"] = arg0 return args, nil } @@ -2912,7 +3321,7 @@ func (ec *executionContext) _ChannelRequest_node(ctx context.Context, field grap return ec.marshalNNode2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐNode(ctx, field.Selections, res) } -func (ec *executionContext) _Connector_uid(ctx context.Context, field graphql.CollectedField, obj *db.Connector) (ret graphql.Marshaler) { +func (ec *executionContext) _Connector_id(ctx context.Context, field graphql.CollectedField, obj *db.Connector) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -2930,7 +3339,7 @@ func (ec *executionContext) _Connector_uid(ctx context.Context, field graphql.Co ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Uid, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -2942,12 +3351,12 @@ func (ec *executionContext) _Connector_uid(ctx context.Context, field graphql.Co } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int64) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2int64(ctx, field.Selections, res) } -func (ec *executionContext) _Connector_standard(ctx context.Context, field graphql.CollectedField, obj *db.Connector) (ret graphql.Marshaler) { +func (ec *executionContext) _Connector_uid(ctx context.Context, field graphql.CollectedField, obj *db.Connector) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -2958,14 +3367,14 @@ func (ec *executionContext) _Connector_standard(ctx context.Context, field graph Object: "Connector", Field: field, Args: nil, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Connector().Standard(rctx, obj) + return obj.Uid, nil }) if err != nil { ec.Error(ctx, err) @@ -2982,7 +3391,7 @@ func (ec *executionContext) _Connector_standard(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Connector_format(ctx context.Context, field graphql.CollectedField, obj *db.Connector) (ret graphql.Marshaler) { +func (ec *executionContext) _Connector_identifier(ctx context.Context, field graphql.CollectedField, obj *db.Connector) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3000,24 +3409,21 @@ func (ec *executionContext) _Connector_format(ctx context.Context, field graphql ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Connector().Format(rctx, obj) + return ec.resolvers.Connector().Identifier(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) _Connector_powerType(ctx context.Context, field graphql.CollectedField, obj *db.Connector) (ret graphql.Marshaler) { +func (ec *executionContext) _Connector_standard(ctx context.Context, field graphql.CollectedField, obj *db.Connector) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3035,7 +3441,7 @@ func (ec *executionContext) _Connector_powerType(ctx context.Context, field grap ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Connector().PowerType(rctx, obj) + return ec.resolvers.Connector().Standard(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -3052,7 +3458,7 @@ func (ec *executionContext) _Connector_powerType(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Connector_voltage(ctx context.Context, field graphql.CollectedField, obj *db.Connector) (ret graphql.Marshaler) { +func (ec *executionContext) _Connector_format(ctx context.Context, field graphql.CollectedField, obj *db.Connector) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3063,14 +3469,84 @@ func (ec *executionContext) _Connector_voltage(ctx context.Context, field graphq Object: "Connector", Field: field, Args: nil, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Voltage, nil + return ec.resolvers.Connector().Format(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Connector_powerType(ctx context.Context, field graphql.CollectedField, obj *db.Connector) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Connector", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Connector().PowerType(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Connector_voltage(ctx context.Context, field graphql.CollectedField, obj *db.Connector) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Connector", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Voltage, nil }) if err != nil { ec.Error(ctx, err) @@ -4404,6 +4880,41 @@ func (ec *executionContext) _EnvironmentalImpact_amount(ctx context.Context, fie return ec.marshalNFloat2float64(ctx, field.Selections, res) } +func (ec *executionContext) _Evse_id(ctx context.Context, field graphql.CollectedField, obj *db.Evse) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Evse", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalNID2int64(ctx, field.Selections, res) +} + func (ec *executionContext) _Evse_uid(ctx context.Context, field graphql.CollectedField, obj *db.Evse) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { @@ -4439,7 +4950,7 @@ func (ec *executionContext) _Evse_uid(ctx context.Context, field graphql.Collect return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Evse_evseId(ctx context.Context, field graphql.CollectedField, obj *db.Evse) (ret graphql.Marshaler) { +func (ec *executionContext) _Evse_identifier(ctx context.Context, field graphql.CollectedField, obj *db.Evse) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4457,7 +4968,7 @@ func (ec *executionContext) _Evse_evseId(ctx context.Context, field graphql.Coll ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Evse().EvseID(rctx, obj) + return ec.resolvers.Evse().Identifier(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -5570,6 +6081,41 @@ func (ec *executionContext) _ListLocation_isRfidCapable(ctx context.Context, fie return ec.marshalNBoolean2bool(ctx, field.Selections, res) } +func (ec *executionContext) _Location_id(ctx context.Context, field graphql.CollectedField, obj *db.Location) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Location", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(int64) + fc.Result = res + return ec.marshalNID2int64(ctx, field.Selections, res) +} + func (ec *executionContext) _Location_uid(ctx context.Context, field graphql.CollectedField, obj *db.Location) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { @@ -7345,18 +7891,21 @@ func (ec *executionContext) _Query_getLocation(ctx context.Context, field graphq fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().GetLocation(rctx, args["uid"].(string)) + return ec.resolvers.Query().GetLocation(rctx, args["input"].(GetLocationInput)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.(*db.Location) fc.Result = res - return ec.marshalOLocation2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐLocation(ctx, field.Selections, res) + return ec.marshalNLocation2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐLocation(ctx, field.Selections, res) } func (ec *executionContext) _Query_listLocations(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -7440,6 +7989,87 @@ func (ec *executionContext) _Query_getRate(ctx context.Context, field graphql.Co return ec.marshalORate2ᚖgithubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐRate(ctx, field.Selections, res) } +func (ec *executionContext) _Query_getSession(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Query_getSession_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GetSession(rctx, args["input"].(GetSessionInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.Session) + fc.Result = res + return ec.marshalNSession2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐSession(ctx, field.Selections, res) +} + +func (ec *executionContext) _Query_getSessionInvoice(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Query", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Query_getSessionInvoice_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Query().GetSessionInvoice(rctx, args["id"].(int64)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*db.SessionInvoice) + fc.Result = res + return ec.marshalOSessionInvoice2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐSessionInvoice(ctx, field.Selections, res) +} + func (ec *executionContext) _Query_getTariff(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { @@ -7465,18 +8095,21 @@ func (ec *executionContext) _Query_getTariff(ctx context.Context, field graphql. fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Query().GetTariff(rctx, args["uid"].(string)) + return ec.resolvers.Query().GetTariff(rctx, args["input"].(GetTariffInput)) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.(*db.Tariff) fc.Result = res - return ec.marshalOTariff2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐTariff(ctx, field.Selections, res) + return ec.marshalNTariff2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐTariff(ctx, field.Selections, res) } func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -7795,7 +8428,7 @@ func (ec *executionContext) _Result_id(ctx context.Context, field graphql.Collec return ec.marshalNID2int64(ctx, field.Selections, res) } -func (ec *executionContext) _StartSession_id(ctx context.Context, field graphql.CollectedField, obj *StartSession) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_id(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7803,7 +8436,7 @@ func (ec *executionContext) _StartSession_id(ctx context.Context, field graphql. } }() fc := &graphql.FieldContext{ - Object: "StartSession", + Object: "Session", Field: field, Args: nil, IsMethod: false, @@ -7830,7 +8463,7 @@ func (ec *executionContext) _StartSession_id(ctx context.Context, field graphql. return ec.marshalNID2int64(ctx, field.Selections, res) } -func (ec *executionContext) _StartSession_status(ctx context.Context, field graphql.CollectedField, obj *StartSession) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_uid(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7838,7 +8471,7 @@ func (ec *executionContext) _StartSession_status(ctx context.Context, field grap } }() fc := &graphql.FieldContext{ - Object: "StartSession", + Object: "Session", Field: field, Args: nil, IsMethod: false, @@ -7848,7 +8481,7 @@ func (ec *executionContext) _StartSession_status(ctx context.Context, field grap ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Status, nil + return obj.Uid, nil }) if err != nil { ec.Error(ctx, err) @@ -7865,7 +8498,7 @@ func (ec *executionContext) _StartSession_status(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _StartSession_authorizationId(ctx context.Context, field graphql.CollectedField, obj *StartSession) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_authorizationId(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7873,34 +8506,31 @@ func (ec *executionContext) _StartSession_authorizationId(ctx context.Context, f } }() fc := &graphql.FieldContext{ - Object: "StartSession", + Object: "Session", Field: field, Args: nil, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.AuthorizationID, nil + return ec.resolvers.Session().AuthorizationID(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) _StartSession_locationUid(ctx context.Context, field graphql.CollectedField, obj *StartSession) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_startDatetime(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7908,17 +8538,17 @@ func (ec *executionContext) _StartSession_locationUid(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "StartSession", + Object: "Session", Field: field, Args: nil, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.LocationUID, nil + return ec.resolvers.Session().StartDatetime(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -7935,7 +8565,7 @@ func (ec *executionContext) _StartSession_locationUid(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _StartSession_evseUid(ctx context.Context, field graphql.CollectedField, obj *StartSession) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_endDatetime(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7943,17 +8573,17 @@ func (ec *executionContext) _StartSession_evseUid(ctx context.Context, field gra } }() fc := &graphql.FieldContext{ - Object: "StartSession", + Object: "Session", Field: field, Args: nil, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.EvseUID, nil + return ec.resolvers.Session().EndDatetime(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -7967,7 +8597,7 @@ func (ec *executionContext) _StartSession_evseUid(ctx context.Context, field gra return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) _StatusSchedule_periodBegin(ctx context.Context, field graphql.CollectedField, obj *db.StatusSchedule) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_kwh(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7975,17 +8605,17 @@ func (ec *executionContext) _StatusSchedule_periodBegin(ctx context.Context, fie } }() fc := &graphql.FieldContext{ - Object: "StatusSchedule", + Object: "Session", Field: field, Args: nil, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.StatusSchedule().PeriodBegin(rctx, obj) + return obj.Kwh, nil }) if err != nil { ec.Error(ctx, err) @@ -7997,12 +8627,12 @@ func (ec *executionContext) _StatusSchedule_periodBegin(ctx context.Context, fie } return graphql.Null } - res := resTmp.(string) + res := resTmp.(float64) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _StatusSchedule_periodEnd(ctx context.Context, field graphql.CollectedField, obj *db.StatusSchedule) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_authMethod(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8010,7 +8640,7 @@ func (ec *executionContext) _StatusSchedule_periodEnd(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "StatusSchedule", + Object: "Session", Field: field, Args: nil, IsMethod: true, @@ -8020,21 +8650,24 @@ func (ec *executionContext) _StatusSchedule_periodEnd(ctx context.Context, field ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.StatusSchedule().PeriodEnd(rctx, obj) + return ec.resolvers.Session().AuthMethod(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _StatusSchedule_status(ctx context.Context, field graphql.CollectedField, obj *db.StatusSchedule) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_location(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8042,7 +8675,7 @@ func (ec *executionContext) _StatusSchedule_status(ctx context.Context, field gr } }() fc := &graphql.FieldContext{ - Object: "StatusSchedule", + Object: "Session", Field: field, Args: nil, IsMethod: true, @@ -8052,7 +8685,7 @@ func (ec *executionContext) _StatusSchedule_status(ctx context.Context, field gr ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.StatusSchedule().Status(rctx, obj) + return ec.resolvers.Session().Location(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -8064,12 +8697,12 @@ func (ec *executionContext) _StatusSchedule_status(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*db.Location) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNLocation2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐLocation(ctx, field.Selections, res) } -func (ec *executionContext) _StopSession_id(ctx context.Context, field graphql.CollectedField, obj *StopSession) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_evse(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8077,17 +8710,17 @@ func (ec *executionContext) _StopSession_id(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "StopSession", + Object: "Session", Field: field, Args: nil, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return ec.resolvers.Session().Evse(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -8099,12 +8732,12 @@ func (ec *executionContext) _StopSession_id(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(int64) + res := resTmp.(*db.Evse) fc.Result = res - return ec.marshalNID2int64(ctx, field.Selections, res) + return ec.marshalNEvse2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐEvse(ctx, field.Selections, res) } -func (ec *executionContext) _StopSession_status(ctx context.Context, field graphql.CollectedField, obj *StopSession) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_connector(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8112,17 +8745,17 @@ func (ec *executionContext) _StopSession_status(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "StopSession", + Object: "Session", Field: field, Args: nil, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Status, nil + return ec.resolvers.Session().Connector(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -8134,12 +8767,12 @@ func (ec *executionContext) _StopSession_status(ctx context.Context, field graph } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*db.Connector) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNConnector2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐConnector(ctx, field.Selections, res) } -func (ec *executionContext) _StopSession_sessionUid(ctx context.Context, field graphql.CollectedField, obj *StopSession) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_meterId(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8147,34 +8780,31 @@ func (ec *executionContext) _StopSession_sessionUid(ctx context.Context, field g } }() fc := &graphql.FieldContext{ - Object: "StopSession", + Object: "Session", Field: field, Args: nil, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SessionUID, nil + return ec.resolvers.Session().MeterID(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) _Tariff_uid(ctx context.Context, field graphql.CollectedField, obj *db.Tariff) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_sessionInvoices(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8182,17 +8812,17 @@ func (ec *executionContext) _Tariff_uid(ctx context.Context, field graphql.Colle } }() fc := &graphql.FieldContext{ - Object: "Tariff", + Object: "Session", Field: field, Args: nil, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Uid, nil + return ec.resolvers.Session().SessionInvoices(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -8204,12 +8834,12 @@ func (ec *executionContext) _Tariff_uid(ctx context.Context, field graphql.Colle } return graphql.Null } - res := resTmp.(string) + res := resTmp.([]db.SessionInvoice) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNSessionInvoice2ᚕgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐSessionInvoiceᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _Tariff_currency(ctx context.Context, field graphql.CollectedField, obj *db.Tariff) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_status(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8217,17 +8847,17 @@ func (ec *executionContext) _Tariff_currency(ctx context.Context, field graphql. } }() fc := &graphql.FieldContext{ - Object: "Tariff", + Object: "Session", Field: field, Args: nil, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Currency, nil + return ec.resolvers.Session().Status(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -8244,7 +8874,7 @@ func (ec *executionContext) _Tariff_currency(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Tariff_elements(ctx context.Context, field graphql.CollectedField, obj *db.Tariff) (ret graphql.Marshaler) { +func (ec *executionContext) _Session_lastUpdated(ctx context.Context, field graphql.CollectedField, obj *db.Session) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8252,7 +8882,7 @@ func (ec *executionContext) _Tariff_elements(ctx context.Context, field graphql. } }() fc := &graphql.FieldContext{ - Object: "Tariff", + Object: "Session", Field: field, Args: nil, IsMethod: true, @@ -8262,7 +8892,7 @@ func (ec *executionContext) _Tariff_elements(ctx context.Context, field graphql. ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Tariff().Elements(rctx, obj) + return ec.resolvers.Session().LastUpdated(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -8274,12 +8904,12 @@ func (ec *executionContext) _Tariff_elements(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.([]TariffElement) + res := resTmp.(string) fc.Result = res - return ec.marshalNTariffElement2ᚕgithubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐTariffElementᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Tariff_energyMix(ctx context.Context, field graphql.CollectedField, obj *db.Tariff) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_id(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8287,31 +8917,34 @@ func (ec *executionContext) _Tariff_energyMix(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "Tariff", + Object: "SessionInvoice", Field: field, Args: nil, - IsMethod: true, - IsResolver: true, + IsMethod: false, + IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Tariff().EnergyMix(rctx, obj) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*db.EnergyMix) + res := resTmp.(int64) fc.Result = res - return ec.marshalOEnergyMix2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐEnergyMix(ctx, field.Selections, res) + return ec.marshalNID2int64(ctx, field.Selections, res) } -func (ec *executionContext) _TariffElement_priceComponents(ctx context.Context, field graphql.CollectedField, obj *TariffElement) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_currency(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8319,7 +8952,7 @@ func (ec *executionContext) _TariffElement_priceComponents(ctx context.Context, } }() fc := &graphql.FieldContext{ - Object: "TariffElement", + Object: "SessionInvoice", Field: field, Args: nil, IsMethod: false, @@ -8329,21 +8962,24 @@ func (ec *executionContext) _TariffElement_priceComponents(ctx context.Context, ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PriceComponents, nil + return obj.Currency, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]db.PriceComponent) + res := resTmp.(string) fc.Result = res - return ec.marshalOPriceComponent2ᚕgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐPriceComponentᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _TariffElement_restrictions(ctx context.Context, field graphql.CollectedField, obj *TariffElement) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_currencyRate(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8351,7 +8987,7 @@ func (ec *executionContext) _TariffElement_restrictions(ctx context.Context, fie } }() fc := &graphql.FieldContext{ - Object: "TariffElement", + Object: "SessionInvoice", Field: field, Args: nil, IsMethod: false, @@ -8361,21 +8997,24 @@ func (ec *executionContext) _TariffElement_restrictions(ctx context.Context, fie ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Restrictions, nil + return obj.CurrencyRate, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*db.ElementRestriction) + res := resTmp.(int64) fc.Result = res - return ec.marshalOElementRestriction2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐElementRestriction(ctx, field.Selections, res) + return ec.marshalNInt2int64(ctx, field.Selections, res) } -func (ec *executionContext) _TextDescription_text(ctx context.Context, field graphql.CollectedField, obj *TextDescription) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_currencyRateMsat(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8383,7 +9022,7 @@ func (ec *executionContext) _TextDescription_text(ctx context.Context, field gra } }() fc := &graphql.FieldContext{ - Object: "TextDescription", + Object: "SessionInvoice", Field: field, Args: nil, IsMethod: false, @@ -8393,7 +9032,7 @@ func (ec *executionContext) _TextDescription_text(ctx context.Context, field gra ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Text, nil + return obj.CurrencyRateMsat, nil }) if err != nil { ec.Error(ctx, err) @@ -8405,12 +9044,12 @@ func (ec *executionContext) _TextDescription_text(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int64) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int64(ctx, field.Selections, res) } -func (ec *executionContext) _TextDescription_description(ctx context.Context, field graphql.CollectedField, obj *TextDescription) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_amountFiat(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8418,7 +9057,7 @@ func (ec *executionContext) _TextDescription_description(ctx context.Context, fi } }() fc := &graphql.FieldContext{ - Object: "TextDescription", + Object: "SessionInvoice", Field: field, Args: nil, IsMethod: false, @@ -8428,7 +9067,7 @@ func (ec *executionContext) _TextDescription_description(ctx context.Context, fi ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description, nil + return obj.AmountFiat, nil }) if err != nil { ec.Error(ctx, err) @@ -8440,12 +9079,12 @@ func (ec *executionContext) _TextDescription_description(ctx context.Context, fi } return graphql.Null } - res := resTmp.(string) + res := resTmp.(float64) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *db.User) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_amountMsat(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8453,7 +9092,7 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte } }() fc := &graphql.FieldContext{ - Object: "User", + Object: "SessionInvoice", Field: field, Args: nil, IsMethod: false, @@ -8463,7 +9102,7 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.ID, nil + return obj.AmountMsat, nil }) if err != nil { ec.Error(ctx, err) @@ -8477,10 +9116,10 @@ func (ec *executionContext) _User_id(ctx context.Context, field graphql.Collecte } res := resTmp.(int64) fc.Result = res - return ec.marshalNID2int64(ctx, field.Selections, res) + return ec.marshalNInt2int64(ctx, field.Selections, res) } -func (ec *executionContext) _User_pubkey(ctx context.Context, field graphql.CollectedField, obj *db.User) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_commissionFiat(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8488,7 +9127,7 @@ func (ec *executionContext) _User_pubkey(ctx context.Context, field graphql.Coll } }() fc := &graphql.FieldContext{ - Object: "User", + Object: "SessionInvoice", Field: field, Args: nil, IsMethod: false, @@ -8498,7 +9137,7 @@ func (ec *executionContext) _User_pubkey(ctx context.Context, field graphql.Coll ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Pubkey, nil + return obj.CommissionFiat, nil }) if err != nil { ec.Error(ctx, err) @@ -8510,12 +9149,12 @@ func (ec *executionContext) _User_pubkey(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.(string) + res := resTmp.(float64) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _User_deviceToken(ctx context.Context, field graphql.CollectedField, obj *db.User) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_commissionMsat(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8523,7 +9162,7 @@ func (ec *executionContext) _User_deviceToken(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "User", + Object: "SessionInvoice", Field: field, Args: nil, IsMethod: false, @@ -8533,7 +9172,7 @@ func (ec *executionContext) _User_deviceToken(ctx context.Context, field graphql ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeviceToken, nil + return obj.CommissionMsat, nil }) if err != nil { ec.Error(ctx, err) @@ -8545,12 +9184,12 @@ func (ec *executionContext) _User_deviceToken(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int64) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int64(ctx, field.Selections, res) } -func (ec *executionContext) _VerifyAuthentication_verified(ctx context.Context, field graphql.CollectedField, obj *VerifyAuthentication) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_taxFiat(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8558,7 +9197,7 @@ func (ec *executionContext) _VerifyAuthentication_verified(ctx context.Context, } }() fc := &graphql.FieldContext{ - Object: "VerifyAuthentication", + Object: "SessionInvoice", Field: field, Args: nil, IsMethod: false, @@ -8568,7 +9207,7 @@ func (ec *executionContext) _VerifyAuthentication_verified(ctx context.Context, ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Verified, nil + return obj.TaxFiat, nil }) if err != nil { ec.Error(ctx, err) @@ -8580,12 +9219,12 @@ func (ec *executionContext) _VerifyAuthentication_verified(ctx context.Context, } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(float64) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_taxMsat(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8593,7 +9232,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "__Directive", + Object: "SessionInvoice", Field: field, Args: nil, IsMethod: false, @@ -8603,7 +9242,7 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.TaxMsat, nil }) if err != nil { ec.Error(ctx, err) @@ -8615,12 +9254,12 @@ func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int64) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNInt2int64(ctx, field.Selections, res) } -func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_paymentRequest(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8628,31 +9267,34 @@ func (ec *executionContext) ___Directive_description(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "__Directive", + Object: "SessionInvoice", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.PaymentRequest, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_isSettled(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8660,7 +9302,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } }() fc := &graphql.FieldContext{ - Object: "__Directive", + Object: "SessionInvoice", Field: field, Args: nil, IsMethod: false, @@ -8670,7 +9312,7 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Locations, nil + return obj.IsSettled, nil }) if err != nil { ec.Error(ctx, err) @@ -8682,12 +9324,12 @@ func (ec *executionContext) ___Directive_locations(ctx context.Context, field gr } return graphql.Null } - res := resTmp.([]string) + res := resTmp.(bool) fc.Result = res - return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_isExpired(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8695,7 +9337,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "__Directive", + Object: "SessionInvoice", Field: field, Args: nil, IsMethod: false, @@ -8705,7 +9347,7 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return obj.IsExpired, nil }) if err != nil { ec.Error(ctx, err) @@ -8717,12 +9359,12 @@ func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(bool) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { +func (ec *executionContext) _SessionInvoice_lastUpdated(ctx context.Context, field graphql.CollectedField, obj *db.SessionInvoice) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8730,17 +9372,17 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "__Directive", + Object: "SessionInvoice", Field: field, Args: nil, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsRepeatable, nil + return ec.resolvers.SessionInvoice().LastUpdated(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -8752,12 +9394,12 @@ func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { +func (ec *executionContext) _StartSession_id(ctx context.Context, field graphql.CollectedField, obj *StartSession) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8765,7 +9407,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } }() fc := &graphql.FieldContext{ - Object: "__EnumValue", + Object: "StartSession", Field: field, Args: nil, IsMethod: false, @@ -8775,7 +9417,7 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -8787,12 +9429,12 @@ func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.(string) + res := resTmp.(int64) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalNID2int64(ctx, field.Selections, res) } -func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { +func (ec *executionContext) _StartSession_status(ctx context.Context, field graphql.CollectedField, obj *StartSession) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8800,31 +9442,34 @@ func (ec *executionContext) ___EnumValue_description(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "__EnumValue", + Object: "StartSession", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Status, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { +func (ec *executionContext) _StartSession_authorizationId(ctx context.Context, field graphql.CollectedField, obj *StartSession) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8832,17 +9477,17 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "__EnumValue", + Object: "StartSession", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil + return obj.AuthorizationID, nil }) if err != nil { ec.Error(ctx, err) @@ -8854,12 +9499,12 @@ func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(string) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { +func (ec *executionContext) _StartSession_locationUid(ctx context.Context, field graphql.CollectedField, obj *StartSession) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8867,31 +9512,34 @@ func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, } }() fc := &graphql.FieldContext{ - Object: "__EnumValue", + Object: "StartSession", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.LocationUID, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { +func (ec *executionContext) _StartSession_evseUid(ctx context.Context, field graphql.CollectedField, obj *StartSession) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8899,7 +9547,7 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "__Field", + Object: "StartSession", Field: field, Args: nil, IsMethod: false, @@ -8909,24 +9557,21 @@ func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.Col ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.EvseUID, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(string) + res := resTmp.(*string) fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { +func (ec *executionContext) _StatusSchedule_periodBegin(ctx context.Context, field graphql.CollectedField, obj *db.StatusSchedule) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8934,31 +9579,34 @@ func (ec *executionContext) ___Field_description(ctx context.Context, field grap } }() fc := &graphql.FieldContext{ - Object: "__Field", + Object: "StatusSchedule", Field: field, Args: nil, IsMethod: true, - IsResolver: false, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return ec.resolvers.StatusSchedule().PeriodBegin(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { +func (ec *executionContext) _StatusSchedule_periodEnd(ctx context.Context, field graphql.CollectedField, obj *db.StatusSchedule) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8966,34 +9614,31 @@ func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "__Field", + Object: "StatusSchedule", Field: field, Args: nil, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Args, nil + return ec.resolvers.StatusSchedule().PeriodEnd(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.([]introspection.InputValue) + res := resTmp.(*string) fc.Result = res - return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { +func (ec *executionContext) _StatusSchedule_status(ctx context.Context, field graphql.CollectedField, obj *db.StatusSchedule) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9001,17 +9646,17 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } }() fc := &graphql.FieldContext{ - Object: "__Field", + Object: "StatusSchedule", Field: field, Args: nil, - IsMethod: false, - IsResolver: false, + IsMethod: true, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return ec.resolvers.StatusSchedule().Status(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -9023,12 +9668,12 @@ func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { +func (ec *executionContext) _StopSession_id(ctx context.Context, field graphql.CollectedField, obj *StopSession) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9036,17 +9681,17 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } }() fc := &graphql.FieldContext{ - Object: "__Field", + Object: "StopSession", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.IsDeprecated(), nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -9058,12 +9703,12 @@ func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field gra } return graphql.Null } - res := resTmp.(bool) + res := resTmp.(int64) fc.Result = res - return ec.marshalNBoolean2bool(ctx, field.Selections, res) + return ec.marshalNID2int64(ctx, field.Selections, res) } -func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { +func (ec *executionContext) _StopSession_status(ctx context.Context, field graphql.CollectedField, obj *StopSession) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9071,31 +9716,34 @@ func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, fiel } }() fc := &graphql.FieldContext{ - Object: "__Field", + Object: "StopSession", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DeprecationReason(), nil + return obj.Status, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { +func (ec *executionContext) _StopSession_sessionUid(ctx context.Context, field graphql.CollectedField, obj *StopSession) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9103,7 +9751,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq } }() fc := &graphql.FieldContext{ - Object: "__InputValue", + Object: "StopSession", Field: field, Args: nil, IsMethod: false, @@ -9113,7 +9761,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name, nil + return obj.SessionUID, nil }) if err != nil { ec.Error(ctx, err) @@ -9130,7 +9778,7 @@ func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { +func (ec *executionContext) _Tariff_id(ctx context.Context, field graphql.CollectedField, obj *db.Tariff) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9138,31 +9786,34 @@ func (ec *executionContext) ___InputValue_description(ctx context.Context, field } }() fc := &graphql.FieldContext{ - Object: "__InputValue", + Object: "Tariff", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(int64) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNID2int64(ctx, field.Selections, res) } -func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { +func (ec *executionContext) _Tariff_uid(ctx context.Context, field graphql.CollectedField, obj *db.Tariff) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9170,7 +9821,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } }() fc := &graphql.FieldContext{ - Object: "__InputValue", + Object: "Tariff", Field: field, Args: nil, IsMethod: false, @@ -9180,7 +9831,7 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Type, nil + return obj.Uid, nil }) if err != nil { ec.Error(ctx, err) @@ -9192,12 +9843,12 @@ func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { +func (ec *executionContext) _Tariff_currency(ctx context.Context, field graphql.CollectedField, obj *db.Tariff) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9205,7 +9856,7 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel } }() fc := &graphql.FieldContext{ - Object: "__InputValue", + Object: "Tariff", Field: field, Args: nil, IsMethod: false, @@ -9215,21 +9866,24 @@ func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, fiel ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.DefaultValue, nil + return obj.Currency, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { +func (ec *executionContext) _Tariff_elements(ctx context.Context, field graphql.CollectedField, obj *db.Tariff) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9237,17 +9891,17 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } }() fc := &graphql.FieldContext{ - Object: "__Schema", + Object: "Tariff", Field: field, Args: nil, IsMethod: true, - IsResolver: false, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Types(), nil + return ec.resolvers.Tariff().Elements(rctx, obj) }) if err != nil { ec.Error(ctx, err) @@ -9259,12 +9913,12 @@ func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.([]TariffElement) fc.Result = res - return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalNTariffElement2ᚕgithubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐTariffElementᚄ(ctx, field.Selections, res) } -func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { +func (ec *executionContext) _Tariff_energyMix(ctx context.Context, field graphql.CollectedField, obj *db.Tariff) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9272,34 +9926,31 @@ func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "__Schema", + Object: "Tariff", Field: field, Args: nil, IsMethod: true, - IsResolver: false, + IsResolver: true, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.QueryType(), nil + return ec.resolvers.Tariff().EnergyMix(rctx, obj) }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(*db.EnergyMix) fc.Result = res - return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOEnergyMix2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐEnergyMix(ctx, field.Selections, res) } -func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { +func (ec *executionContext) _TariffElement_priceComponents(ctx context.Context, field graphql.CollectedField, obj *TariffElement) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9307,17 +9958,17 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr } }() fc := &graphql.FieldContext{ - Object: "__Schema", + Object: "TariffElement", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.MutationType(), nil + return obj.PriceComponents, nil }) if err != nil { ec.Error(ctx, err) @@ -9326,12 +9977,12 @@ func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field gr if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.([]db.PriceComponent) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOPriceComponent2ᚕgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐPriceComponentᚄ(ctx, field.Selections, res) } -func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { +func (ec *executionContext) _TariffElement_restrictions(ctx context.Context, field graphql.CollectedField, obj *TariffElement) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9339,17 +9990,17 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel } }() fc := &graphql.FieldContext{ - Object: "__Schema", + Object: "TariffElement", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.SubscriptionType(), nil + return obj.Restrictions, nil }) if err != nil { ec.Error(ctx, err) @@ -9358,12 +10009,12 @@ func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, fiel if resTmp == nil { return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(*db.ElementRestriction) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalOElementRestriction2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐElementRestriction(ctx, field.Selections, res) } -func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { +func (ec *executionContext) _TextDescription_text(ctx context.Context, field graphql.CollectedField, obj *TextDescription) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9371,17 +10022,17 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } }() fc := &graphql.FieldContext{ - Object: "__Schema", + Object: "TextDescription", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Directives(), nil + return obj.Text, nil }) if err != nil { ec.Error(ctx, err) @@ -9393,12 +10044,12 @@ func (ec *executionContext) ___Schema_directives(ctx context.Context, field grap } return graphql.Null } - res := resTmp.([]introspection.Directive) + res := resTmp.(string) fc.Result = res - return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { +func (ec *executionContext) _TextDescription_description(ctx context.Context, field graphql.CollectedField, obj *TextDescription) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9406,17 +10057,17 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } }() fc := &graphql.FieldContext{ - Object: "__Type", + Object: "TextDescription", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Kind(), nil + return obj.Description, nil }) if err != nil { ec.Error(ctx, err) @@ -9430,10 +10081,10 @@ func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.Coll } res := resTmp.(string) fc.Result = res - return ec.marshalN__TypeKind2string(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { +func (ec *executionContext) _User_id(ctx context.Context, field graphql.CollectedField, obj *db.User) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9441,31 +10092,34 @@ func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.Coll } }() fc := &graphql.FieldContext{ - Object: "__Type", + Object: "User", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Name(), nil + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(int64) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNID2int64(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { +func (ec *executionContext) _User_pubkey(ctx context.Context, field graphql.CollectedField, obj *db.User) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9473,31 +10127,34 @@ func (ec *executionContext) ___Type_description(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "__Type", + Object: "User", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Description(), nil + return obj.Pubkey, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*string) + res := resTmp.(string) fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { +func (ec *executionContext) _User_deviceToken(ctx context.Context, field graphql.CollectedField, obj *db.User) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9505,38 +10162,34 @@ func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "__Type", + Object: "User", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field___Type_fields_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Fields(args["includeDeprecated"].(bool)), nil + return obj.DeviceToken, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Field) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { +func (ec *executionContext) _VerifyAuthentication_verified(ctx context.Context, field graphql.CollectedField, obj *VerifyAuthentication) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9544,31 +10197,34 @@ func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphq } }() fc := &graphql.FieldContext{ - Object: "__Type", + Object: "VerifyAuthentication", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.Interfaces(), nil + return obj.Verified, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(bool) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { +func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9576,31 +10232,34 @@ func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field gra } }() fc := &graphql.FieldContext{ - Object: "__Type", + Object: "__Directive", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.PossibleTypes(), nil + return obj.Name, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.Type) + res := resTmp.(string) fc.Result = res - return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { +func (ec *executionContext) ___Directive_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9608,7 +10267,7 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } }() fc := &graphql.FieldContext{ - Object: "__Type", + Object: "__Directive", Field: field, Args: nil, IsMethod: true, @@ -9616,30 +10275,58 @@ func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphq } ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field___Type_enumValues_args(ctx, rawArgs) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) if err != nil { ec.Error(ctx, err) return graphql.Null } - fc.Args = args + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Directive_locations(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Directive", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.EnumValues(args["includeDeprecated"].(bool)), nil + return obj.Locations, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.([]introspection.EnumValue) + res := resTmp.([]string) fc.Result = res - return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) + return ec.marshalN__DirectiveLocation2ᚕstringᚄ(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { +func (ec *executionContext) ___Directive_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9647,31 +10334,34 @@ func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graph } }() fc := &graphql.FieldContext{ - Object: "__Type", + Object: "__Directive", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.InputFields(), nil + return obj.Args, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } res := resTmp.([]introspection.InputValue) fc.Result = res - return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) } -func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { +func (ec *executionContext) ___Directive_isRepeatable(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -9679,125 +10369,1074 @@ func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.Co } }() fc := &graphql.FieldContext{ - Object: "__Type", + Object: "__Directive", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, IsResolver: false, } ctx = graphql.WithFieldContext(ctx, fc) resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return obj.OfType(), nil + return obj.IsRepeatable, nil }) if err != nil { ec.Error(ctx, err) return graphql.Null } if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } return graphql.Null } - res := resTmp.(*introspection.Type) + res := resTmp.(bool) fc.Result = res - return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) + return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -// endregion **************************** field.gotpl ***************************** - -// region **************************** input.gotpl ***************************** - -func (ec *executionContext) unmarshalInputCreateBusinessDetailInput(ctx context.Context, obj interface{}) (CreateBusinessDetailInput, error) { - var it CreateBusinessDetailInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v +func (ec *executionContext) ___EnumValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, } - for k, v := range asMap { - switch k { - case "name": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) - it.Name, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "website": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("website")) - it.Website, err = ec.unmarshalOString2ᚖstring(ctx, v) - if err != nil { - return it, err - } - case "logo": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("logo")) - it.Logo, err = ec.unmarshalOCreateImageInput2ᚖgithubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐCreateImageInput(ctx, v) - if err != nil { - return it, err - } + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") } + return graphql.Null } - - return it, nil + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) unmarshalInputCreateChannelRequestInput(ctx context.Context, obj interface{}) (CreateChannelRequestInput, error) { - var it CreateChannelRequestInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } - - for k, v := range asMap { - switch k { - case "paymentHash": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("paymentHash")) - it.PaymentHash, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "paymentAddr": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("paymentAddr")) - it.PaymentAddr, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "amountMsat": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("amountMsat")) - it.AmountMsat, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } +func (ec *executionContext) ___EnumValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } - return it, nil + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) unmarshalInputCreateCredentialInput(ctx context.Context, obj interface{}) (CreateCredentialInput, error) { - var it CreateCredentialInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v +func (ec *executionContext) ___EnumValue_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, } - for k, v := range asMap { - switch k { - case "clientToken": - var err error + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientToken")) +func (ec *executionContext) ___EnumValue_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.EnumValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__EnumValue", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_args(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Args, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalN__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_type(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_isDeprecated(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.IsDeprecated(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Field_deprecationReason(ctx context.Context, field graphql.CollectedField, obj *introspection.Field) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Field", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DeprecationReason(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___InputValue_name(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___InputValue_description(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___InputValue_type(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Type, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___InputValue_defaultValue(ctx context.Context, field graphql.CollectedField, obj *introspection.InputValue) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__InputValue", + Field: field, + Args: nil, + IsMethod: false, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.DefaultValue, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_types(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Types(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_queryType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.QueryType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalN__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_mutationType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.MutationType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_subscriptionType(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.SubscriptionType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Schema_directives(ctx context.Context, field graphql.CollectedField, obj *introspection.Schema) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Schema", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Directives(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.([]introspection.Directive) + fc.Result = res + return ec.marshalN__Directive2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirectiveᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_kind(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Kind(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalN__TypeKind2string(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_description(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Description(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2ᚖstring(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_fields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field___Type_fields_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Fields(args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Field) + fc.Result = res + return ec.marshalO__Field2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐFieldᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_interfaces(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Interfaces(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_possibleTypes(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PossibleTypes(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐTypeᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_enumValues(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field___Type_enumValues_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.EnumValues(args["includeDeprecated"].(bool)), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.EnumValue) + fc.Result = res + return ec.marshalO__EnumValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐEnumValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_inputFields(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.InputFields(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.([]introspection.InputValue) + fc.Result = res + return ec.marshalO__InputValue2ᚕgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐInputValueᚄ(ctx, field.Selections, res) +} + +func (ec *executionContext) ___Type_ofType(ctx context.Context, field graphql.CollectedField, obj *introspection.Type) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "__Type", + Field: field, + Args: nil, + IsMethod: true, + IsResolver: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.OfType(), nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*introspection.Type) + fc.Result = res + return ec.marshalO__Type2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐType(ctx, field.Selections, res) +} + +// endregion **************************** field.gotpl ***************************** + +// region **************************** input.gotpl ***************************** + +func (ec *executionContext) unmarshalInputCreateBusinessDetailInput(ctx context.Context, obj interface{}) (CreateBusinessDetailInput, error) { + var it CreateBusinessDetailInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + for k, v := range asMap { + switch k { + case "name": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) + it.Name, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "website": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("website")) + it.Website, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "logo": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("logo")) + it.Logo, err = ec.unmarshalOCreateImageInput2ᚖgithubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐCreateImageInput(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateChannelRequestInput(ctx context.Context, obj interface{}) (CreateChannelRequestInput, error) { + var it CreateChannelRequestInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + for k, v := range asMap { + switch k { + case "paymentHash": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("paymentHash")) + it.PaymentHash, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "paymentAddr": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("paymentAddr")) + it.PaymentAddr, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "amountMsat": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("amountMsat")) + it.AmountMsat, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputCreateCredentialInput(ctx context.Context, obj interface{}) (CreateCredentialInput, error) { + var it CreateCredentialInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + for k, v := range asMap { + switch k { + case "clientToken": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("clientToken")) it.ClientToken, err = ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err @@ -9951,27 +11590,128 @@ func (ec *executionContext) unmarshalInputCreateUserInput(ctx context.Context, o for k, v := range asMap { switch k { - case "code": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("code")) - it.Code, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err - } - case "pubkey": + case "code": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("code")) + it.Code, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "pubkey": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pubkey")) + it.Pubkey, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "deviceToken": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceToken")) + it.DeviceToken, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGetLocationInput(ctx context.Context, obj interface{}) (GetLocationInput, error) { + var it GetLocationInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + for k, v := range asMap { + switch k { + case "id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + it.ID, err = ec.unmarshalOID2ᚖint64(ctx, v) + if err != nil { + return it, err + } + case "uid": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uid")) + it.UID, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGetSessionInput(ctx context.Context, obj interface{}) (GetSessionInput, error) { + var it GetSessionInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + for k, v := range asMap { + switch k { + case "id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + it.ID, err = ec.unmarshalOID2ᚖint64(ctx, v) + if err != nil { + return it, err + } + case "uid": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uid")) + it.UID, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + case "authorizationId": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("authorizationId")) + it.AuthorizationID, err = ec.unmarshalOString2ᚖstring(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputGetTariffInput(ctx context.Context, obj interface{}) (GetTariffInput, error) { + var it GetTariffInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + for k, v := range asMap { + switch k { + case "id": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("pubkey")) - it.Pubkey, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + it.ID, err = ec.unmarshalOID2ᚖint64(ctx, v) if err != nil { return it, err } - case "deviceToken": + case "uid": var err error - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceToken")) - it.DeviceToken, err = ec.unmarshalNString2string(ctx, v) + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("uid")) + it.UID, err = ec.unmarshalOString2ᚖstring(ctx, v) if err != nil { return it, err } @@ -10117,118 +11857,508 @@ func (ec *executionContext) unmarshalInputStopSessionInput(ctx context.Context, } } } - - return it, nil + + return it, nil +} + +func (ec *executionContext) unmarshalInputUnregisterCredentialInput(ctx context.Context, obj interface{}) (UnregisterCredentialInput, error) { + var it UnregisterCredentialInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + for k, v := range asMap { + switch k { + case "id": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) + it.ID, err = ec.unmarshalNID2int64(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputUpdateUserInput(ctx context.Context, obj interface{}) (UpdateUserInput, error) { + var it UpdateUserInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + for k, v := range asMap { + switch k { + case "deviceToken": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceToken")) + it.DeviceToken, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +func (ec *executionContext) unmarshalInputVerifyEmailSubscriptionInput(ctx context.Context, obj interface{}) (VerifyEmailSubscriptionInput, error) { + var it VerifyEmailSubscriptionInput + asMap := map[string]interface{}{} + for k, v := range obj.(map[string]interface{}) { + asMap[k] = v + } + + for k, v := range asMap { + switch k { + case "email": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) + it.Email, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + case "verificationCode": + var err error + + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("verificationCode")) + it.VerificationCode, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + +// endregion **************************** input.gotpl ***************************** + +// region ************************** interface.gotpl *************************** + +// endregion ************************** interface.gotpl *************************** + +// region **************************** object.gotpl **************************** + +var addtionalGeoLocationImplementors = []string{"AddtionalGeoLocation"} + +func (ec *executionContext) _AddtionalGeoLocation(ctx context.Context, sel ast.SelectionSet, obj *AddtionalGeoLocation) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, addtionalGeoLocationImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("AddtionalGeoLocation") + case "latitude": + out.Values[i] = ec._AddtionalGeoLocation_latitude(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "longitude": + out.Values[i] = ec._AddtionalGeoLocation_longitude(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "name": + out.Values[i] = ec._AddtionalGeoLocation_name(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var businessDetailImplementors = []string{"BusinessDetail"} + +func (ec *executionContext) _BusinessDetail(ctx context.Context, sel ast.SelectionSet, obj *db.BusinessDetail) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, businessDetailImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("BusinessDetail") + case "name": + out.Values[i] = ec._BusinessDetail_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "website": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._BusinessDetail_website(ctx, field, obj) + return res + }) + case "logo": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._BusinessDetail_logo(ctx, field, obj) + return res + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var channelRequestImplementors = []string{"ChannelRequest"} + +func (ec *executionContext) _ChannelRequest(ctx context.Context, sel ast.SelectionSet, obj *db.ChannelRequest) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, channelRequestImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ChannelRequest") + case "id": + out.Values[i] = ec._ChannelRequest_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "paymentHash": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ChannelRequest_paymentHash(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) + case "paymentAddr": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ChannelRequest_paymentAddr(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) + case "amountMsat": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ChannelRequest_amountMsat(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) + case "node": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ChannelRequest_node(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputUnregisterCredentialInput(ctx context.Context, obj interface{}) (UnregisterCredentialInput, error) { - var it UnregisterCredentialInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var connectorImplementors = []string{"Connector"} - for k, v := range asMap { - switch k { - case "id": - var err error +func (ec *executionContext) _Connector(ctx context.Context, sel ast.SelectionSet, obj *db.Connector) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, connectorImplementors) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("id")) - it.ID, err = ec.unmarshalNID2int64(ctx, v) - if err != nil { - return it, err + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Connector") + case "id": + out.Values[i] = ec._Connector_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "uid": + out.Values[i] = ec._Connector_uid(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "identifier": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Connector_identifier(ctx, field, obj) + return res + }) + case "standard": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Connector_standard(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) + case "format": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Connector_format(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) + case "powerType": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Connector_powerType(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) + case "voltage": + out.Values[i] = ec._Connector_voltage(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "amperage": + out.Values[i] = ec._Connector_amperage(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "wattage": + out.Values[i] = ec._Connector_wattage(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) } + case "tariffId": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Connector_tariffId(ctx, field, obj) + return res + }) + case "tariff": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Connector_tariff(ctx, field, obj) + return res + }) + case "termsAndConditions": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Connector_termsAndConditions(ctx, field, obj) + return res + }) + case "lastUpdated": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Connector_lastUpdated(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputUpdateUserInput(ctx context.Context, obj interface{}) (UpdateUserInput, error) { - var it UpdateUserInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var createAuthenticationImplementors = []string{"CreateAuthentication"} - for k, v := range asMap { - switch k { - case "deviceToken": - var err error +func (ec *executionContext) _CreateAuthentication(ctx context.Context, sel ast.SelectionSet, obj *CreateAuthentication) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, createAuthenticationImplementors) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("deviceToken")) - it.DeviceToken, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CreateAuthentication") + case "code": + out.Values[i] = ec._CreateAuthentication_code(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "lnUrl": + out.Values[i] = ec._CreateAuthentication_lnUrl(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -func (ec *executionContext) unmarshalInputVerifyEmailSubscriptionInput(ctx context.Context, obj interface{}) (VerifyEmailSubscriptionInput, error) { - var it VerifyEmailSubscriptionInput - asMap := map[string]interface{}{} - for k, v := range obj.(map[string]interface{}) { - asMap[k] = v - } +var credentialImplementors = []string{"Credential"} - for k, v := range asMap { - switch k { - case "email": - var err error +func (ec *executionContext) _Credential(ctx context.Context, sel ast.SelectionSet, obj *db.Credential) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, credentialImplementors) - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("email")) - it.Email, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Credential") + case "id": + out.Values[i] = ec._Credential_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ } - case "verificationCode": - var err error - - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("verificationCode")) - it.VerificationCode, err = ec.unmarshalNString2string(ctx, v) - if err != nil { - return it, err + case "url": + out.Values[i] = ec._Credential_url(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "countryCode": + out.Values[i] = ec._Credential_countryCode(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "partyId": + out.Values[i] = ec._Credential_partyId(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "isHub": + out.Values[i] = ec._Credential_isHub(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ } + default: + panic("unknown field " + strconv.Quote(field.Name)) } } - - return it, nil + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out } -// endregion **************************** input.gotpl ***************************** - -// region ************************** interface.gotpl *************************** - -// endregion ************************** interface.gotpl *************************** - -// region **************************** object.gotpl **************************** - -var addtionalGeoLocationImplementors = []string{"AddtionalGeoLocation"} +var displayTextImplementors = []string{"DisplayText"} -func (ec *executionContext) _AddtionalGeoLocation(ctx context.Context, sel ast.SelectionSet, obj *AddtionalGeoLocation) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, addtionalGeoLocationImplementors) +func (ec *executionContext) _DisplayText(ctx context.Context, sel ast.SelectionSet, obj *db.DisplayText) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, displayTextImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("AddtionalGeoLocation") - case "latitude": - out.Values[i] = ec._AddtionalGeoLocation_latitude(ctx, field, obj) + out.Values[i] = graphql.MarshalString("DisplayText") + case "language": + out.Values[i] = ec._DisplayText_language(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "longitude": - out.Values[i] = ec._AddtionalGeoLocation_longitude(ctx, field, obj) + case "text": + out.Values[i] = ec._DisplayText_text(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "name": - out.Values[i] = ec._AddtionalGeoLocation_name(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -10240,23 +12370,18 @@ func (ec *executionContext) _AddtionalGeoLocation(ctx context.Context, sel ast.S return out } -var businessDetailImplementors = []string{"BusinessDetail"} +var elementRestrictionImplementors = []string{"ElementRestriction"} -func (ec *executionContext) _BusinessDetail(ctx context.Context, sel ast.SelectionSet, obj *db.BusinessDetail) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, businessDetailImplementors) +func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.SelectionSet, obj *db.ElementRestriction) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, elementRestrictionImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("BusinessDetail") - case "name": - out.Values[i] = ec._BusinessDetail_name(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "website": + out.Values[i] = graphql.MarshalString("ElementRestriction") + case "startTime": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10264,10 +12389,10 @@ func (ec *executionContext) _BusinessDetail(ctx context.Context, sel ast.Selecti ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._BusinessDetail_website(ctx, field, obj) + res = ec._ElementRestriction_startTime(ctx, field, obj) return res }) - case "logo": + case "endTime": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10275,37 +12400,10 @@ func (ec *executionContext) _BusinessDetail(ctx context.Context, sel ast.Selecti ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._BusinessDetail_logo(ctx, field, obj) + res = ec._ElementRestriction_endTime(ctx, field, obj) return res }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var channelRequestImplementors = []string{"ChannelRequest"} - -func (ec *executionContext) _ChannelRequest(ctx context.Context, sel ast.SelectionSet, obj *db.ChannelRequest) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, channelRequestImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ChannelRequest") - case "id": - out.Values[i] = ec._ChannelRequest_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "paymentHash": + case "startDate": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10313,13 +12411,10 @@ func (ec *executionContext) _ChannelRequest(ctx context.Context, sel ast.Selecti ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ChannelRequest_paymentHash(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._ElementRestriction_startDate(ctx, field, obj) return res }) - case "paymentAddr": + case "endDate": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10327,13 +12422,10 @@ func (ec *executionContext) _ChannelRequest(ctx context.Context, sel ast.Selecti ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ChannelRequest_paymentAddr(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._ElementRestriction_endDate(ctx, field, obj) return res }) - case "amountMsat": + case "minKwh": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10341,13 +12433,10 @@ func (ec *executionContext) _ChannelRequest(ctx context.Context, sel ast.Selecti ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ChannelRequest_amountMsat(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._ElementRestriction_minKwh(ctx, field, obj) return res }) - case "node": + case "maxKwh": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10355,40 +12444,10 @@ func (ec *executionContext) _ChannelRequest(ctx context.Context, sel ast.Selecti ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ChannelRequest_node(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._ElementRestriction_maxKwh(ctx, field, obj) return res }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var connectorImplementors = []string{"Connector"} - -func (ec *executionContext) _Connector(ctx context.Context, sel ast.SelectionSet, obj *db.Connector) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, connectorImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Connector") - case "uid": - out.Values[i] = ec._Connector_uid(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "standard": + case "minPower": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10396,13 +12455,10 @@ func (ec *executionContext) _Connector(ctx context.Context, sel ast.SelectionSet ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Connector_standard(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._ElementRestriction_minPower(ctx, field, obj) return res }) - case "format": + case "maxPower": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10410,13 +12466,10 @@ func (ec *executionContext) _Connector(ctx context.Context, sel ast.SelectionSet ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Connector_format(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._ElementRestriction_maxPower(ctx, field, obj) return res }) - case "powerType": + case "minDuration": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10424,28 +12477,101 @@ func (ec *executionContext) _Connector(ctx context.Context, sel ast.SelectionSet ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Connector_powerType(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._ElementRestriction_minDuration(ctx, field, obj) return res }) - case "voltage": - out.Values[i] = ec._Connector_voltage(ctx, field, obj) + case "maxDuration": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ElementRestriction_maxDuration(ctx, field, obj) + return res + }) + case "dayOfWeek": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._ElementRestriction_dayOfWeek(ctx, field, obj) + return res + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var emailSubscriptionImplementors = []string{"EmailSubscription"} + +func (ec *executionContext) _EmailSubscription(ctx context.Context, sel ast.SelectionSet, obj *db.EmailSubscription) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, emailSubscriptionImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("EmailSubscription") + case "id": + out.Values[i] = ec._EmailSubscription_id(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + invalids++ } - case "amperage": - out.Values[i] = ec._Connector_amperage(ctx, field, obj) + case "email": + out.Values[i] = ec._EmailSubscription_email(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + invalids++ } - case "wattage": - out.Values[i] = ec._Connector_wattage(ctx, field, obj) + case "locale": + out.Values[i] = ec._EmailSubscription_locale(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "isVerified": + out.Values[i] = ec._EmailSubscription_isVerified(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var energyMixImplementors = []string{"EnergyMix"} + +func (ec *executionContext) _EnergyMix(ctx context.Context, sel ast.SelectionSet, obj *db.EnergyMix) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, energyMixImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("EnergyMix") + case "isGreenEnergy": + out.Values[i] = ec._EnergyMix_isGreenEnergy(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "tariffId": + case "energySources": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10453,10 +12579,13 @@ func (ec *executionContext) _Connector(ctx context.Context, sel ast.SelectionSet ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Connector_tariffId(ctx, field, obj) + res = ec._EnergyMix_energySources(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "tariff": + case "environmentalImpact": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10464,10 +12593,13 @@ func (ec *executionContext) _Connector(ctx context.Context, sel ast.SelectionSet ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Connector_tariff(ctx, field, obj) + res = ec._EnergyMix_environmentalImpact(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "termsAndConditions": + case "supplierName": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10475,10 +12607,10 @@ func (ec *executionContext) _Connector(ctx context.Context, sel ast.SelectionSet ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Connector_termsAndConditions(ctx, field, obj) + res = ec._EnergyMix_supplierName(ctx, field, obj) return res }) - case "lastUpdated": + case "energyProductName": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10486,10 +12618,7 @@ func (ec *executionContext) _Connector(ctx context.Context, sel ast.SelectionSet ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Connector_lastUpdated(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._EnergyMix_energyProductName(ctx, field, obj) return res }) default: @@ -10503,26 +12632,35 @@ func (ec *executionContext) _Connector(ctx context.Context, sel ast.SelectionSet return out } -var createAuthenticationImplementors = []string{"CreateAuthentication"} +var energySourceImplementors = []string{"EnergySource"} -func (ec *executionContext) _CreateAuthentication(ctx context.Context, sel ast.SelectionSet, obj *CreateAuthentication) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, createAuthenticationImplementors) +func (ec *executionContext) _EnergySource(ctx context.Context, sel ast.SelectionSet, obj *db.EnergySource) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, energySourceImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("CreateAuthentication") - case "code": - out.Values[i] = ec._CreateAuthentication_code(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "lnUrl": - out.Values[i] = ec._CreateAuthentication_lnUrl(ctx, field, obj) + out.Values[i] = graphql.MarshalString("EnergySource") + case "source": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._EnergySource_source(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) + case "percentage": + out.Values[i] = ec._EnergySource_percentage(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } default: panic("unknown field " + strconv.Quote(field.Name)) @@ -10535,41 +12673,35 @@ func (ec *executionContext) _CreateAuthentication(ctx context.Context, sel ast.S return out } -var credentialImplementors = []string{"Credential"} +var environmentalImpactImplementors = []string{"EnvironmentalImpact"} -func (ec *executionContext) _Credential(ctx context.Context, sel ast.SelectionSet, obj *db.Credential) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, credentialImplementors) +func (ec *executionContext) _EnvironmentalImpact(ctx context.Context, sel ast.SelectionSet, obj *db.EnvironmentalImpact) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, environmentalImpactImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Credential") - case "id": - out.Values[i] = ec._Credential_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "url": - out.Values[i] = ec._Credential_url(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "countryCode": - out.Values[i] = ec._Credential_countryCode(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "partyId": - out.Values[i] = ec._Credential_partyId(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "isHub": - out.Values[i] = ec._Credential_isHub(ctx, field, obj) + out.Values[i] = graphql.MarshalString("EnvironmentalImpact") + case "source": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._EnvironmentalImpact_source(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) + case "amount": + out.Values[i] = ec._EnvironmentalImpact_amount(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } default: panic("unknown field " + strconv.Quote(field.Name)) @@ -10582,50 +12714,28 @@ func (ec *executionContext) _Credential(ctx context.Context, sel ast.SelectionSe return out } -var displayTextImplementors = []string{"DisplayText"} +var evseImplementors = []string{"Evse"} -func (ec *executionContext) _DisplayText(ctx context.Context, sel ast.SelectionSet, obj *db.DisplayText) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, displayTextImplementors) +func (ec *executionContext) _Evse(ctx context.Context, sel ast.SelectionSet, obj *db.Evse) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, evseImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("DisplayText") - case "language": - out.Values[i] = ec._DisplayText_language(ctx, field, obj) + out.Values[i] = graphql.MarshalString("Evse") + case "id": + out.Values[i] = ec._Evse_id(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - case "text": - out.Values[i] = ec._DisplayText_text(ctx, field, obj) + case "uid": + out.Values[i] = ec._Evse_uid(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var elementRestrictionImplementors = []string{"ElementRestriction"} - -func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.SelectionSet, obj *db.ElementRestriction) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, elementRestrictionImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ElementRestriction") - case "startTime": + case "identifier": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10633,10 +12743,10 @@ func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.Sel ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ElementRestriction_startTime(ctx, field, obj) + res = ec._Evse_identifier(ctx, field, obj) return res }) - case "endTime": + case "status": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10644,10 +12754,13 @@ func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.Sel ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ElementRestriction_endTime(ctx, field, obj) + res = ec._Evse_status(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "startDate": + case "statusSchedule": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10655,10 +12768,13 @@ func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.Sel ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ElementRestriction_startDate(ctx, field, obj) + res = ec._Evse_statusSchedule(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "endDate": + case "capabilities": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10666,10 +12782,13 @@ func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.Sel ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ElementRestriction_endDate(ctx, field, obj) + res = ec._Evse_capabilities(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "minKwh": + case "connectors": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10677,10 +12796,13 @@ func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.Sel ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ElementRestriction_minKwh(ctx, field, obj) + res = ec._Evse_connectors(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "maxKwh": + case "floorLevel": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10688,10 +12810,10 @@ func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.Sel ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ElementRestriction_maxKwh(ctx, field, obj) + res = ec._Evse_floorLevel(ctx, field, obj) return res }) - case "minPower": + case "geom": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10699,10 +12821,20 @@ func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.Sel ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ElementRestriction_minPower(ctx, field, obj) + res = ec._Evse_geom(ctx, field, obj) return res }) - case "maxPower": + case "isRemoteCapable": + out.Values[i] = ec._Evse_isRemoteCapable(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "isRfidCapable": + out.Values[i] = ec._Evse_isRfidCapable(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "physicalReference": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10710,10 +12842,10 @@ func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.Sel ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ElementRestriction_maxPower(ctx, field, obj) + res = ec._Evse_physicalReference(ctx, field, obj) return res }) - case "minDuration": + case "directions": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10721,10 +12853,77 @@ func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.Sel ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ElementRestriction_minDuration(ctx, field, obj) + res = ec._Evse_directions(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "maxDuration": + case "parkingRestrictions": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Evse_parkingRestrictions(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) + case "images": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Evse_images(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) + case "lastUpdated": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Evse_lastUpdated(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var exceptionalPeriodImplementors = []string{"ExceptionalPeriod"} + +func (ec *executionContext) _ExceptionalPeriod(ctx context.Context, sel ast.SelectionSet, obj *db.ExceptionalPeriod) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, exceptionalPeriodImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("ExceptionalPeriod") + case "periodBegin": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10732,10 +12931,13 @@ func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.Sel ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ElementRestriction_maxDuration(ctx, field, obj) + res = ec._ExceptionalPeriod_periodBegin(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "dayOfWeek": + case "periodEnd": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10743,7 +12945,10 @@ func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.Sel ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ElementRestriction_dayOfWeek(ctx, field, obj) + res = ec._ExceptionalPeriod_periodEnd(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) default: @@ -10757,37 +12962,56 @@ func (ec *executionContext) _ElementRestriction(ctx context.Context, sel ast.Sel return out } -var emailSubscriptionImplementors = []string{"EmailSubscription"} +var exchangeAuthenticationImplementors = []string{"ExchangeAuthentication"} -func (ec *executionContext) _EmailSubscription(ctx context.Context, sel ast.SelectionSet, obj *db.EmailSubscription) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, emailSubscriptionImplementors) +func (ec *executionContext) _ExchangeAuthentication(ctx context.Context, sel ast.SelectionSet, obj *ExchangeAuthentication) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, exchangeAuthenticationImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("EmailSubscription") - case "id": - out.Values[i] = ec._EmailSubscription_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "email": - out.Values[i] = ec._EmailSubscription_email(ctx, field, obj) + out.Values[i] = graphql.MarshalString("ExchangeAuthentication") + case "token": + out.Values[i] = ec._ExchangeAuthentication_token(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "locale": - out.Values[i] = ec._EmailSubscription_locale(ctx, field, obj) + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var geolocationImplementors = []string{"Geolocation"} + +func (ec *executionContext) _Geolocation(ctx context.Context, sel ast.SelectionSet, obj *Geolocation) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, geolocationImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Geolocation") + case "latitude": + out.Values[i] = ec._Geolocation_latitude(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "isVerified": - out.Values[i] = ec._EmailSubscription_isVerified(ctx, field, obj) + case "longitude": + out.Values[i] = ec._Geolocation_longitude(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } + case "name": + out.Values[i] = ec._Geolocation_name(ctx, field, obj) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -10799,23 +13023,23 @@ func (ec *executionContext) _EmailSubscription(ctx context.Context, sel ast.Sele return out } -var energyMixImplementors = []string{"EnergyMix"} +var imageImplementors = []string{"Image"} -func (ec *executionContext) _EnergyMix(ctx context.Context, sel ast.SelectionSet, obj *db.EnergyMix) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, energyMixImplementors) +func (ec *executionContext) _Image(ctx context.Context, sel ast.SelectionSet, obj *db.Image) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, imageImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("EnergyMix") - case "isGreenEnergy": - out.Values[i] = ec._EnergyMix_isGreenEnergy(ctx, field, obj) + out.Values[i] = graphql.MarshalString("Image") + case "url": + out.Values[i] = ec._Image_url(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "energySources": + case "thumbnail": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10823,13 +13047,10 @@ func (ec *executionContext) _EnergyMix(ctx context.Context, sel ast.SelectionSet ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._EnergyMix_energySources(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Image_thumbnail(ctx, field, obj) return res }) - case "environmentalImpact": + case "category": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10837,13 +13058,18 @@ func (ec *executionContext) _EnergyMix(ctx context.Context, sel ast.SelectionSet ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._EnergyMix_environmentalImpact(ctx, field, obj) + res = ec._Image_category(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "supplierName": + case "type": + out.Values[i] = ec._Image_type(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "width": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10851,10 +13077,10 @@ func (ec *executionContext) _EnergyMix(ctx context.Context, sel ast.SelectionSet ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._EnergyMix_supplierName(ctx, field, obj) + res = ec._Image_width(ctx, field, obj) return res }) - case "energyProductName": + case "height": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10862,7 +13088,7 @@ func (ec *executionContext) _EnergyMix(ctx context.Context, sel ast.SelectionSet ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._EnergyMix_energyProductName(ctx, field, obj) + res = ec._Image_height(ctx, field, obj) return res }) default: @@ -10876,35 +13102,51 @@ func (ec *executionContext) _EnergyMix(ctx context.Context, sel ast.SelectionSet return out } -var energySourceImplementors = []string{"EnergySource"} +var listLocationImplementors = []string{"ListLocation"} -func (ec *executionContext) _EnergySource(ctx context.Context, sel ast.SelectionSet, obj *db.EnergySource) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, energySourceImplementors) +func (ec *executionContext) _ListLocation(ctx context.Context, sel ast.SelectionSet, obj *ListLocation) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, listLocationImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("EnergySource") - case "source": - field := field - out.Concurrently(i, func() (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._EnergySource_source(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - }) - case "percentage": - out.Values[i] = ec._EnergySource_percentage(ctx, field, obj) + out.Values[i] = graphql.MarshalString("ListLocation") + case "uid": + out.Values[i] = ec._ListLocation_uid(ctx, field, obj) if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) + invalids++ + } + case "name": + out.Values[i] = ec._ListLocation_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "geom": + out.Values[i] = ec._ListLocation_geom(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "availableEvses": + out.Values[i] = ec._ListLocation_availableEvses(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "totalEvses": + out.Values[i] = ec._ListLocation_totalEvses(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "isRemoteCapable": + out.Values[i] = ec._ListLocation_isRemoteCapable(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "isRfidCapable": + out.Values[i] = ec._ListLocation_isRfidCapable(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ } default: panic("unknown field " + strconv.Quote(field.Name)) @@ -10917,75 +13159,28 @@ func (ec *executionContext) _EnergySource(ctx context.Context, sel ast.Selection return out } -var environmentalImpactImplementors = []string{"EnvironmentalImpact"} +var locationImplementors = []string{"Location"} -func (ec *executionContext) _EnvironmentalImpact(ctx context.Context, sel ast.SelectionSet, obj *db.EnvironmentalImpact) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, environmentalImpactImplementors) +func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, obj *db.Location) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, locationImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("EnvironmentalImpact") - case "source": - field := field - out.Concurrently(i, func() (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._EnvironmentalImpact_source(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - }) - case "amount": - out.Values[i] = ec._EnvironmentalImpact_amount(ctx, field, obj) + out.Values[i] = graphql.MarshalString("Location") + case "id": + out.Values[i] = ec._Location_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var evseImplementors = []string{"Evse"} - -func (ec *executionContext) _Evse(ctx context.Context, sel ast.SelectionSet, obj *db.Evse) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, evseImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Evse") case "uid": - out.Values[i] = ec._Evse_uid(ctx, field, obj) + out.Values[i] = ec._Location_uid(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "evseId": - field := field - out.Concurrently(i, func() (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Evse_evseId(ctx, field, obj) - return res - }) - case "status": + case "type": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -10993,13 +13188,13 @@ func (ec *executionContext) _Evse(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Evse_status(ctx, field, obj) + res = ec._Location_type(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "statusSchedule": + case "name": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11007,13 +13202,35 @@ func (ec *executionContext) _Evse(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Evse_statusSchedule(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Location_name(ctx, field, obj) return res }) - case "capabilities": + case "address": + out.Values[i] = ec._Location_address(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "city": + out.Values[i] = ec._Location_city(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "postalCode": + out.Values[i] = ec._Location_postalCode(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "country": + out.Values[i] = ec._Location_country(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "geom": + out.Values[i] = ec._Location_geom(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "relatedLocations": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11021,13 +13238,13 @@ func (ec *executionContext) _Evse(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Evse_capabilities(ctx, field, obj) + res = ec._Location_relatedLocations(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "connectors": + case "evses": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11035,55 +13252,32 @@ func (ec *executionContext) _Evse(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Evse_connectors(ctx, field, obj) + res = ec._Location_evses(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "floorLevel": - field := field - out.Concurrently(i, func() (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Evse_floorLevel(ctx, field, obj) - return res - }) - case "geom": - field := field - out.Concurrently(i, func() (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Evse_geom(ctx, field, obj) - return res - }) + case "availableEvses": + out.Values[i] = ec._Location_availableEvses(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "totalEvses": + out.Values[i] = ec._Location_totalEvses(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "isRemoteCapable": - out.Values[i] = ec._Evse_isRemoteCapable(ctx, field, obj) + out.Values[i] = ec._Location_isRemoteCapable(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } case "isRfidCapable": - out.Values[i] = ec._Evse_isRfidCapable(ctx, field, obj) + out.Values[i] = ec._Location_isRfidCapable(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "physicalReference": - field := field - out.Concurrently(i, func() (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Evse_physicalReference(ctx, field, obj) - return res - }) case "directions": field := field out.Concurrently(i, func() (res graphql.Marshaler) { @@ -11092,13 +13286,13 @@ func (ec *executionContext) _Evse(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Evse_directions(ctx, field, obj) + res = ec._Location_directions(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "parkingRestrictions": + case "operator": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11106,13 +13300,10 @@ func (ec *executionContext) _Evse(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Evse_parkingRestrictions(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Location_operator(ctx, field, obj) return res }) - case "images": + case "suboperator": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11120,13 +13311,10 @@ func (ec *executionContext) _Evse(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Evse_images(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Location_suboperator(ctx, field, obj) return res }) - case "lastUpdated": + case "owner": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11134,35 +13322,10 @@ func (ec *executionContext) _Evse(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Evse_lastUpdated(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Location_owner(ctx, field, obj) return res }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var exceptionalPeriodImplementors = []string{"ExceptionalPeriod"} - -func (ec *executionContext) _ExceptionalPeriod(ctx context.Context, sel ast.SelectionSet, obj *db.ExceptionalPeriod) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, exceptionalPeriodImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ExceptionalPeriod") - case "periodBegin": + case "facilities": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11170,13 +13333,13 @@ func (ec *executionContext) _ExceptionalPeriod(ctx context.Context, sel ast.Sele ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ExceptionalPeriod_periodBegin(ctx, field, obj) + res = ec._Location_facilities(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "periodEnd": + case "timeZone": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11184,101 +13347,10 @@ func (ec *executionContext) _ExceptionalPeriod(ctx context.Context, sel ast.Sele ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._ExceptionalPeriod_periodEnd(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } + res = ec._Location_timeZone(ctx, field, obj) return res }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var exchangeAuthenticationImplementors = []string{"ExchangeAuthentication"} - -func (ec *executionContext) _ExchangeAuthentication(ctx context.Context, sel ast.SelectionSet, obj *ExchangeAuthentication) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, exchangeAuthenticationImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ExchangeAuthentication") - case "token": - out.Values[i] = ec._ExchangeAuthentication_token(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var geolocationImplementors = []string{"Geolocation"} - -func (ec *executionContext) _Geolocation(ctx context.Context, sel ast.SelectionSet, obj *Geolocation) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, geolocationImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Geolocation") - case "latitude": - out.Values[i] = ec._Geolocation_latitude(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "longitude": - out.Values[i] = ec._Geolocation_longitude(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "name": - out.Values[i] = ec._Geolocation_name(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var imageImplementors = []string{"Image"} - -func (ec *executionContext) _Image(ctx context.Context, sel ast.SelectionSet, obj *db.Image) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, imageImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Image") - case "url": - out.Values[i] = ec._Image_url(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "thumbnail": + case "openingTime": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11286,10 +13358,15 @@ func (ec *executionContext) _Image(ctx context.Context, sel ast.SelectionSet, ob ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Image_thumbnail(ctx, field, obj) + res = ec._Location_openingTime(ctx, field, obj) return res }) - case "category": + case "chargingWhenClosed": + out.Values[i] = ec._Location_chargingWhenClosed(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "images": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11297,18 +13374,13 @@ func (ec *executionContext) _Image(ctx context.Context, sel ast.SelectionSet, ob ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Image_category(ctx, field, obj) + res = ec._Location_images(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "type": - out.Values[i] = ec._Image_type(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "width": + case "energyMix": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11316,10 +13388,10 @@ func (ec *executionContext) _Image(ctx context.Context, sel ast.SelectionSet, ob ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Image_width(ctx, field, obj) + res = ec._Location_energyMix(ctx, field, obj) return res }) - case "height": + case "lastUpdated": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11327,7 +13399,10 @@ func (ec *executionContext) _Image(ctx context.Context, sel ast.SelectionSet, ob ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Image_height(ctx, field, obj) + res = ec._Location_lastUpdated(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) default: @@ -11341,49 +13416,78 @@ func (ec *executionContext) _Image(ctx context.Context, sel ast.SelectionSet, ob return out } -var listLocationImplementors = []string{"ListLocation"} +var mutationImplementors = []string{"Mutation"} -func (ec *executionContext) _ListLocation(ctx context.Context, sel ast.SelectionSet, obj *ListLocation) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, listLocationImplementors) +func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) + + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Mutation", + }) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("ListLocation") - case "uid": - out.Values[i] = ec._ListLocation_uid(ctx, field, obj) + out.Values[i] = graphql.MarshalString("Mutation") + case "createAuthentication": + out.Values[i] = ec._Mutation_createAuthentication(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "exchangeAuthentication": + out.Values[i] = ec._Mutation_exchangeAuthentication(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "name": - out.Values[i] = ec._ListLocation_name(ctx, field, obj) + case "createChannelRequest": + out.Values[i] = ec._Mutation_createChannelRequest(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "geom": - out.Values[i] = ec._ListLocation_geom(ctx, field, obj) + case "startSession": + out.Values[i] = ec._Mutation_startSession(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "availableEvses": - out.Values[i] = ec._ListLocation_availableEvses(ctx, field, obj) + case "stopSession": + out.Values[i] = ec._Mutation_stopSession(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "totalEvses": - out.Values[i] = ec._ListLocation_totalEvses(ctx, field, obj) + case "createCredential": + out.Values[i] = ec._Mutation_createCredential(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "isRemoteCapable": - out.Values[i] = ec._ListLocation_isRemoteCapable(ctx, field, obj) + case "registerCredential": + out.Values[i] = ec._Mutation_registerCredential(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "isRfidCapable": - out.Values[i] = ec._ListLocation_isRfidCapable(ctx, field, obj) + case "unregisterCredential": + out.Values[i] = ec._Mutation_unregisterCredential(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "createEmailSubscription": + out.Values[i] = ec._Mutation_createEmailSubscription(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "verifyEmailSubscription": + out.Values[i] = ec._Mutation_verifyEmailSubscription(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "createUser": + out.Values[i] = ec._Mutation_createUser(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "updateUser": + out.Values[i] = ec._Mutation_updateUser(ctx, field) if out.Values[i] == graphql.Null { invalids++ } @@ -11398,23 +13502,23 @@ func (ec *executionContext) _ListLocation(ctx context.Context, sel ast.Selection return out } -var locationImplementors = []string{"Location"} +var nodeImplementors = []string{"Node"} -func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, obj *db.Location) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, locationImplementors) +func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj *db.Node) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, nodeImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Location") - case "uid": - out.Values[i] = ec._Location_uid(ctx, field, obj) + out.Values[i] = graphql.MarshalString("Node") + case "pubkey": + out.Values[i] = ec._Node_pubkey(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "type": + case "addr": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11422,63 +13526,40 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Location_type(ctx, field, obj) + res = ec._Node_addr(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "name": - field := field - out.Concurrently(i, func() (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Location_name(ctx, field, obj) - return res - }) - case "address": - out.Values[i] = ec._Location_address(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "city": - out.Values[i] = ec._Location_city(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "postalCode": - out.Values[i] = ec._Location_postalCode(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "country": - out.Values[i] = ec._Location_country(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "geom": - out.Values[i] = ec._Location_geom(ctx, field, obj) + case "alias": + out.Values[i] = ec._Node_alias(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "relatedLocations": - field := field - out.Concurrently(i, func() (res graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - } - }() - res = ec._Location_relatedLocations(ctx, field, obj) - if res == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - return res - }) - case "evses": + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var openingTimeImplementors = []string{"OpeningTime"} + +func (ec *executionContext) _OpeningTime(ctx context.Context, sel ast.SelectionSet, obj *db.OpeningTime) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, openingTimeImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("OpeningTime") + case "regularHours": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11486,33 +13567,18 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Location_evses(ctx, field, obj) + res = ec._OpeningTime_regularHours(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "availableEvses": - out.Values[i] = ec._Location_availableEvses(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "totalEvses": - out.Values[i] = ec._Location_totalEvses(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "isRemoteCapable": - out.Values[i] = ec._Location_isRemoteCapable(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "isRfidCapable": - out.Values[i] = ec._Location_isRfidCapable(ctx, field, obj) + case "twentyfourseven": + out.Values[i] = ec._OpeningTime_twentyfourseven(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "directions": + case "exceptionalOpenings": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11520,13 +13586,13 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Location_directions(ctx, field, obj) + res = ec._OpeningTime_exceptionalOpenings(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "operator": + case "exceptionalClosings": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11534,10 +13600,35 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Location_operator(ctx, field, obj) + res = ec._OpeningTime_exceptionalClosings(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "suboperator": + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var priceComponentImplementors = []string{"PriceComponent"} + +func (ec *executionContext) _PriceComponent(ctx context.Context, sel ast.SelectionSet, obj *db.PriceComponent) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, priceComponentImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("PriceComponent") + case "type": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11545,10 +13636,49 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Location_suboperator(ctx, field, obj) + res = ec._PriceComponent_type(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "owner": + case "price": + out.Values[i] = ec._PriceComponent_price(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "stepSize": + out.Values[i] = ec._PriceComponent_stepSize(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var queryImplementors = []string{"Query"} + +func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) + + ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ + Object: "Query", + }) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Query") + case "verifyAuthentication": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11556,10 +13686,13 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Location_owner(ctx, field, obj) + res = ec._Query_verifyAuthentication(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "facilities": + case "getLocation": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11567,13 +13700,13 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Location_facilities(ctx, field, obj) + res = ec._Query_getLocation(ctx, field) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "timeZone": + case "listLocations": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11581,10 +13714,13 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Location_timeZone(ctx, field, obj) + res = ec._Query_listLocations(ctx, field) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "openingTime": + case "getRate": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11592,15 +13728,10 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Location_openingTime(ctx, field, obj) + res = ec._Query_getRate(ctx, field) return res }) - case "chargingWhenClosed": - out.Values[i] = ec._Location_chargingWhenClosed(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "images": + case "getSession": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11608,13 +13739,13 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Location_images(ctx, field, obj) + res = ec._Query_getSession(ctx, field) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "energyMix": + case "getSessionInvoice": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11622,10 +13753,10 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Location_energyMix(ctx, field, obj) + res = ec._Query_getSessionInvoice(ctx, field) return res }) - case "lastUpdated": + case "getTariff": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11633,12 +13764,16 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Location_lastUpdated(ctx, field, obj) + res = ec._Query_getTariff(ctx, field) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) + case "__type": + out.Values[i] = ec._Query___type(ctx, field) + case "__schema": + out.Values[i] = ec._Query___schema(ctx, field) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -11650,78 +13785,29 @@ func (ec *executionContext) _Location(ctx context.Context, sel ast.SelectionSet, return out } -var mutationImplementors = []string{"Mutation"} - -func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, mutationImplementors) +var rateImplementors = []string{"Rate"} - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ - Object: "Mutation", - }) +func (ec *executionContext) _Rate(ctx context.Context, sel ast.SelectionSet, obj *Rate) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, rateImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Mutation") - case "createAuthentication": - out.Values[i] = ec._Mutation_createAuthentication(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "exchangeAuthentication": - out.Values[i] = ec._Mutation_exchangeAuthentication(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "createChannelRequest": - out.Values[i] = ec._Mutation_createChannelRequest(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "startSession": - out.Values[i] = ec._Mutation_startSession(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "stopSession": - out.Values[i] = ec._Mutation_stopSession(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "createCredential": - out.Values[i] = ec._Mutation_createCredential(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "registerCredential": - out.Values[i] = ec._Mutation_registerCredential(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "unregisterCredential": - out.Values[i] = ec._Mutation_unregisterCredential(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "createEmailSubscription": - out.Values[i] = ec._Mutation_createEmailSubscription(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "verifyEmailSubscription": - out.Values[i] = ec._Mutation_verifyEmailSubscription(ctx, field) + out.Values[i] = graphql.MarshalString("Rate") + case "rate": + out.Values[i] = ec._Rate_rate(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "createUser": - out.Values[i] = ec._Mutation_createUser(ctx, field) + case "rateMsat": + out.Values[i] = ec._Rate_rateMsat(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } - case "updateUser": - out.Values[i] = ec._Mutation_updateUser(ctx, field) + case "lastUpdated": + out.Values[i] = ec._Rate_lastUpdated(ctx, field, obj) if out.Values[i] == graphql.Null { invalids++ } @@ -11736,23 +13822,18 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) return out } -var nodeImplementors = []string{"Node"} +var regularHourImplementors = []string{"RegularHour"} -func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj *db.Node) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, nodeImplementors) +func (ec *executionContext) _RegularHour(ctx context.Context, sel ast.SelectionSet, obj *db.RegularHour) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, regularHourImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Node") - case "pubkey": - out.Values[i] = ec._Node_pubkey(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "addr": + out.Values[i] = graphql.MarshalString("RegularHour") + case "weekday": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11760,14 +13841,19 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Node_addr(ctx, field, obj) + res = ec._RegularHour_weekday(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "alias": - out.Values[i] = ec._Node_alias(ctx, field, obj) + case "periodBegin": + out.Values[i] = ec._RegularHour_periodBegin(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "periodEnd": + out.Values[i] = ec._RegularHour_periodEnd(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } @@ -11782,18 +13868,55 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj return out } -var openingTimeImplementors = []string{"OpeningTime"} +var resultImplementors = []string{"Result"} -func (ec *executionContext) _OpeningTime(ctx context.Context, sel ast.SelectionSet, obj *db.OpeningTime) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, openingTimeImplementors) +func (ec *executionContext) _Result(ctx context.Context, sel ast.SelectionSet, obj *Result) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, resultImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("OpeningTime") - case "regularHours": + out.Values[i] = graphql.MarshalString("Result") + case "id": + out.Values[i] = ec._Result_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var sessionImplementors = []string{"Session"} + +func (ec *executionContext) _Session(ctx context.Context, sel ast.SelectionSet, obj *db.Session) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, sessionImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Session") + case "id": + out.Values[i] = ec._Session_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "uid": + out.Values[i] = ec._Session_uid(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "authorizationId": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11801,18 +13924,40 @@ func (ec *executionContext) _OpeningTime(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._OpeningTime_regularHours(ctx, field, obj) + res = ec._Session_authorizationId(ctx, field, obj) + return res + }) + case "startDatetime": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Session_startDatetime(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "twentyfourseven": - out.Values[i] = ec._OpeningTime_twentyfourseven(ctx, field, obj) + case "endDatetime": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._Session_endDatetime(ctx, field, obj) + return res + }) + case "kwh": + out.Values[i] = ec._Session_kwh(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } - case "exceptionalOpenings": + case "authMethod": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11820,13 +13965,13 @@ func (ec *executionContext) _OpeningTime(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._OpeningTime_exceptionalOpenings(ctx, field, obj) + res = ec._Session_authMethod(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "exceptionalClosings": + case "location": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11834,35 +13979,13 @@ func (ec *executionContext) _OpeningTime(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._OpeningTime_exceptionalClosings(ctx, field, obj) + res = ec._Session_location(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var priceComponentImplementors = []string{"PriceComponent"} - -func (ec *executionContext) _PriceComponent(ctx context.Context, sel ast.SelectionSet, obj *db.PriceComponent) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, priceComponentImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("PriceComponent") - case "type": + case "evse": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11870,49 +13993,13 @@ func (ec *executionContext) _PriceComponent(ctx context.Context, sel ast.Selecti ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._PriceComponent_type(ctx, field, obj) + res = ec._Session_evse(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "price": - out.Values[i] = ec._PriceComponent_price(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "stepSize": - out.Values[i] = ec._PriceComponent_stepSize(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var queryImplementors = []string{"Query"} - -func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, queryImplementors) - - ctx = graphql.WithFieldContext(ctx, &graphql.FieldContext{ - Object: "Query", - }) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Query") - case "verifyAuthentication": + case "connector": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11920,13 +14007,13 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_verifyAuthentication(ctx, field) + res = ec._Session_connector(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "getLocation": + case "meterId": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11934,10 +14021,10 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_getLocation(ctx, field) + res = ec._Session_meterId(ctx, field, obj) return res }) - case "listLocations": + case "sessionInvoices": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11945,13 +14032,13 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_listLocations(ctx, field) + res = ec._Session_sessionInvoices(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "getRate": + case "status": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11959,10 +14046,13 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_getRate(ctx, field) + res = ec._Session_status(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "getTariff": + case "lastUpdated": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -11970,13 +14060,12 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Query_getTariff(ctx, field) + res = ec._Session_lastUpdated(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } return res }) - case "__type": - out.Values[i] = ec._Query___type(ctx, field) - case "__schema": - out.Values[i] = ec._Query___schema(ctx, field) default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -11988,55 +14077,83 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr return out } -var rateImplementors = []string{"Rate"} +var sessionInvoiceImplementors = []string{"SessionInvoice"} -func (ec *executionContext) _Rate(ctx context.Context, sel ast.SelectionSet, obj *Rate) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, rateImplementors) +func (ec *executionContext) _SessionInvoice(ctx context.Context, sel ast.SelectionSet, obj *db.SessionInvoice) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, sessionInvoiceImplementors) out := graphql.NewFieldSet(fields) var invalids uint32 for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("Rate") - case "rate": - out.Values[i] = ec._Rate_rate(ctx, field, obj) + out.Values[i] = graphql.MarshalString("SessionInvoice") + case "id": + out.Values[i] = ec._SessionInvoice_id(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - case "rateMsat": - out.Values[i] = ec._Rate_rateMsat(ctx, field, obj) + case "currency": + out.Values[i] = ec._SessionInvoice_currency(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - case "lastUpdated": - out.Values[i] = ec._Rate_lastUpdated(ctx, field, obj) + case "currencyRate": + out.Values[i] = ec._SessionInvoice_currencyRate(ctx, field, obj) if out.Values[i] == graphql.Null { - invalids++ + atomic.AddUint32(&invalids, 1) } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var regularHourImplementors = []string{"RegularHour"} - -func (ec *executionContext) _RegularHour(ctx context.Context, sel ast.SelectionSet, obj *db.RegularHour) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, regularHourImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("RegularHour") - case "weekday": + case "currencyRateMsat": + out.Values[i] = ec._SessionInvoice_currencyRateMsat(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "amountFiat": + out.Values[i] = ec._SessionInvoice_amountFiat(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "amountMsat": + out.Values[i] = ec._SessionInvoice_amountMsat(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "commissionFiat": + out.Values[i] = ec._SessionInvoice_commissionFiat(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "commissionMsat": + out.Values[i] = ec._SessionInvoice_commissionMsat(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "taxFiat": + out.Values[i] = ec._SessionInvoice_taxFiat(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "taxMsat": + out.Values[i] = ec._SessionInvoice_taxMsat(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "paymentRequest": + out.Values[i] = ec._SessionInvoice_paymentRequest(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "isSettled": + out.Values[i] = ec._SessionInvoice_isSettled(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "isExpired": + out.Values[i] = ec._SessionInvoice_isExpired(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + case "lastUpdated": field := field out.Concurrently(i, func() (res graphql.Marshaler) { defer func() { @@ -12044,49 +14161,12 @@ func (ec *executionContext) _RegularHour(ctx context.Context, sel ast.SelectionS ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._RegularHour_weekday(ctx, field, obj) + res = ec._SessionInvoice_lastUpdated(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&invalids, 1) } return res }) - case "periodBegin": - out.Values[i] = ec._RegularHour_periodBegin(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - case "periodEnd": - out.Values[i] = ec._RegularHour_periodEnd(ctx, field, obj) - if out.Values[i] == graphql.Null { - atomic.AddUint32(&invalids, 1) - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - -var resultImplementors = []string{"Result"} - -func (ec *executionContext) _Result(ctx context.Context, sel ast.SelectionSet, obj *Result) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, resultImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Result") - case "id": - out.Values[i] = ec._Result_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -12251,6 +14331,11 @@ func (ec *executionContext) _Tariff(ctx context.Context, sel ast.SelectionSet, o switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Tariff") + case "id": + out.Values[i] = ec._Tariff_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + atomic.AddUint32(&invalids, 1) + } case "uid": out.Values[i] = ec._Tariff_uid(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -12804,6 +14889,16 @@ func (ec *executionContext) marshalNConnector2ᚕgithubᚗcomᚋsatimotoᚋgoᚑ return ret } +func (ec *executionContext) marshalNConnector2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐConnector(ctx context.Context, sel ast.SelectionSet, v *db.Connector) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Connector(ctx, sel, v) +} + func (ec *executionContext) marshalNCreateAuthentication2githubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐCreateAuthentication(ctx context.Context, sel ast.SelectionSet, v CreateAuthentication) graphql.Marshaler { return ec._CreateAuthentication(ctx, sel, &v) } @@ -13063,6 +15158,16 @@ func (ec *executionContext) marshalNEvse2ᚕgithubᚗcomᚋsatimotoᚋgoᚑdatas return ret } +func (ec *executionContext) marshalNEvse2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐEvse(ctx context.Context, sel ast.SelectionSet, v *db.Evse) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Evse(ctx, sel, v) +} + func (ec *executionContext) marshalNExceptionalPeriod2githubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐExceptionalPeriod(ctx context.Context, sel ast.SelectionSet, v db.ExceptionalPeriod) graphql.Marshaler { return ec._ExceptionalPeriod(ctx, sel, &v) } @@ -13155,6 +15260,21 @@ func (ec *executionContext) marshalNGeometry2githubᚗcomᚋsatimotoᚋgoᚑdata return res } +func (ec *executionContext) unmarshalNGetLocationInput2githubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐGetLocationInput(ctx context.Context, v interface{}) (GetLocationInput, error) { + res, err := ec.unmarshalInputGetLocationInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNGetSessionInput2githubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐGetSessionInput(ctx context.Context, v interface{}) (GetSessionInput, error) { + res, err := ec.unmarshalInputGetSessionInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) unmarshalNGetTariffInput2githubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐGetTariffInput(ctx context.Context, v interface{}) (GetTariffInput, error) { + res, err := ec.unmarshalInputGetTariffInput(ctx, v) + return res, graphql.ErrorOnPath(ctx, err) +} + func (ec *executionContext) unmarshalNID2int64(ctx context.Context, v interface{}) (int64, error) { res, err := graphql.UnmarshalInt64(v) return res, graphql.ErrorOnPath(ctx, err) @@ -13248,6 +15368,21 @@ func (ec *executionContext) marshalNInt2int32(ctx context.Context, sel ast.Selec return res } +func (ec *executionContext) unmarshalNInt2int64(ctx context.Context, v interface{}) (int64, error) { + res, err := graphql.UnmarshalInt64(v) + return res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalNInt2int64(ctx context.Context, sel ast.SelectionSet, v int64) graphql.Marshaler { + res := graphql.MarshalInt64(v) + if res == graphql.Null { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + } + return res +} + func (ec *executionContext) marshalNListLocation2githubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐListLocation(ctx context.Context, sel ast.SelectionSet, v ListLocation) graphql.Marshaler { return ec._ListLocation(ctx, sel, &v) } @@ -13301,6 +15436,20 @@ func (ec *executionContext) unmarshalNListLocationsInput2githubᚗcomᚋsatimoto return res, graphql.ErrorOnPath(ctx, err) } +func (ec *executionContext) marshalNLocation2githubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐLocation(ctx context.Context, sel ast.SelectionSet, v db.Location) graphql.Marshaler { + return ec._Location(ctx, sel, &v) +} + +func (ec *executionContext) marshalNLocation2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐLocation(ctx context.Context, sel ast.SelectionSet, v *db.Location) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Location(ctx, sel, v) +} + func (ec *executionContext) marshalNNode2githubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐNode(ctx context.Context, sel ast.SelectionSet, v db.Node) graphql.Marshaler { return ec._Node(ctx, sel, &v) } @@ -13386,6 +15535,68 @@ func (ec *executionContext) marshalNResult2ᚖgithubᚗcomᚋsatimotoᚋgoᚑapi return ec._Result(ctx, sel, v) } +func (ec *executionContext) marshalNSession2githubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐSession(ctx context.Context, sel ast.SelectionSet, v db.Session) graphql.Marshaler { + return ec._Session(ctx, sel, &v) +} + +func (ec *executionContext) marshalNSession2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐSession(ctx context.Context, sel ast.SelectionSet, v *db.Session) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Session(ctx, sel, v) +} + +func (ec *executionContext) marshalNSessionInvoice2githubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐSessionInvoice(ctx context.Context, sel ast.SelectionSet, v db.SessionInvoice) graphql.Marshaler { + return ec._SessionInvoice(ctx, sel, &v) +} + +func (ec *executionContext) marshalNSessionInvoice2ᚕgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐSessionInvoiceᚄ(ctx context.Context, sel ast.SelectionSet, v []db.SessionInvoice) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNSessionInvoice2githubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐSessionInvoice(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + + for _, e := range ret { + if e == graphql.Null { + return graphql.Null + } + } + + return ret +} + func (ec *executionContext) marshalNStartSession2githubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐStartSession(ctx context.Context, sel ast.SelectionSet, v StartSession) graphql.Marshaler { return ec._StartSession(ctx, sel, &v) } @@ -13487,6 +15698,20 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S return res } +func (ec *executionContext) marshalNTariff2githubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐTariff(ctx context.Context, sel ast.SelectionSet, v db.Tariff) graphql.Marshaler { + return ec._Tariff(ctx, sel, &v) +} + +func (ec *executionContext) marshalNTariff2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐTariff(ctx context.Context, sel ast.SelectionSet, v *db.Tariff) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Tariff(ctx, sel, v) +} + func (ec *executionContext) marshalNTariffElement2githubᚗcomᚋsatimotoᚋgoᚑapiᚋgraphᚐTariffElement(ctx context.Context, sel ast.SelectionSet, v TariffElement) graphql.Marshaler { return ec._TariffElement(ctx, sel, &v) } @@ -13973,6 +16198,21 @@ func (ec *executionContext) marshalOGeometry2ᚖgithubᚗcomᚋsatimotoᚋgoᚑd return geom.MarshalGeometry4326(*v) } +func (ec *executionContext) unmarshalOID2ᚖint64(ctx context.Context, v interface{}) (*int64, error) { + if v == nil { + return nil, nil + } + res, err := graphql.UnmarshalInt64(v) + return &res, graphql.ErrorOnPath(ctx, err) +} + +func (ec *executionContext) marshalOID2ᚖint64(ctx context.Context, sel ast.SelectionSet, v *int64) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return graphql.MarshalInt64(*v) +} + func (ec *executionContext) marshalOImage2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐImage(ctx context.Context, sel ast.SelectionSet, v *db.Image) graphql.Marshaler { if v == nil { return graphql.Null @@ -13995,13 +16235,6 @@ func (ec *executionContext) marshalOInt2ᚖint(ctx context.Context, sel ast.Sele return graphql.MarshalInt(*v) } -func (ec *executionContext) marshalOLocation2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐLocation(ctx context.Context, sel ast.SelectionSet, v *db.Location) graphql.Marshaler { - if v == nil { - return graphql.Null - } - return ec._Location(ctx, sel, v) -} - func (ec *executionContext) marshalOOpeningTime2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐOpeningTime(ctx context.Context, sel ast.SelectionSet, v *db.OpeningTime) graphql.Marshaler { if v == nil { return graphql.Null @@ -14063,6 +16296,13 @@ func (ec *executionContext) marshalORate2ᚖgithubᚗcomᚋsatimotoᚋgoᚑapi return ec._Rate(ctx, sel, v) } +func (ec *executionContext) marshalOSessionInvoice2ᚖgithubᚗcomᚋsatimotoᚋgoᚑdatastoreᚋpkgᚋdbᚐSessionInvoice(ctx context.Context, sel ast.SelectionSet, v *db.SessionInvoice) graphql.Marshaler { + if v == nil { + return graphql.Null + } + return ec._SessionInvoice(ctx, sel, v) +} + func (ec *executionContext) unmarshalOString2ᚕstringᚄ(ctx context.Context, v interface{}) ([]string, error) { if v == nil { return nil, nil diff --git a/graph/model.go b/graph/model.go index b03172c..b21c16a 100644 --- a/graph/model.go +++ b/graph/model.go @@ -75,6 +75,22 @@ type Geolocation struct { Name *string `json:"name"` } +type GetLocationInput struct { + ID *int64 `json:"id"` + UID *string `json:"uid"` +} + +type GetSessionInput struct { + ID *int64 `json:"id"` + UID *string `json:"uid"` + AuthorizationID *string `json:"authorizationId"` +} + +type GetTariffInput struct { + ID *int64 `json:"id"` + UID *string `json:"uid"` +} + type ListLocation struct { UID string `json:"uid"` Name string `json:"name"` diff --git a/graph/resolver/connector.go b/graph/resolver/connector.go index b08978b..72e19b0 100644 --- a/graph/resolver/connector.go +++ b/graph/resolver/connector.go @@ -12,6 +12,10 @@ import ( "github.com/satimoto/go-datastore/pkg/db" ) +func (r *connectorResolver) Identifier(ctx context.Context, obj *db.Connector) (*string, error) { + return util.NullString(obj.Identifier) +} + func (r *connectorResolver) Standard(ctx context.Context, obj *db.Connector) (string, error) { return string(obj.Standard), nil } diff --git a/graph/resolver/evse.go b/graph/resolver/evse.go index 7fe2b2c..360b369 100644 --- a/graph/resolver/evse.go +++ b/graph/resolver/evse.go @@ -13,8 +13,8 @@ import ( "github.com/satimoto/go-datastore/pkg/geom" ) -func (r *evseResolver) EvseID(ctx context.Context, obj *db.Evse) (*string, error) { - return util.NullString(obj.EvseID) +func (r *evseResolver) Identifier(ctx context.Context, obj *db.Evse) (*string, error) { + return util.NullString(obj.Identifier) } func (r *evseResolver) Status(ctx context.Context, obj *db.Evse) (string, error) { diff --git a/graph/resolver/location.go b/graph/resolver/location.go index c9e8868..4a089d8 100644 --- a/graph/resolver/location.go +++ b/graph/resolver/location.go @@ -15,11 +15,18 @@ import ( "github.com/vektah/gqlparser/v2/gqlerror" ) -func (r *queryResolver) GetLocation(ctx context.Context, uid string) (*db.Location, error) { +func (r *queryResolver) GetLocation(ctx context.Context, input graph.GetLocationInput) (*db.Location, error) { if userId := authentication.GetUserId(ctx); userId != nil { - if l, err := r.LocationRepository.GetLocationByUid(ctx, uid); err == nil { - return &l, nil + if input.ID != nil { + if l, err := r.LocationRepository.GetLocation(ctx, *input.ID); err == nil { + return &l, nil + } + } else if input.UID != nil { + if l, err := r.LocationRepository.GetLocationByUid(ctx, *input.UID); err == nil { + return &l, nil + } } + return nil, gqlerror.Errorf("Location not found") } diff --git a/graph/resolver/resolve.go b/graph/resolver/resolve.go index de7308c..9e6d751 100644 --- a/graph/resolver/resolve.go +++ b/graph/resolver/resolve.go @@ -18,6 +18,7 @@ import ( "github.com/satimoto/go-datastore/pkg/location" "github.com/satimoto/go-datastore/pkg/node" "github.com/satimoto/go-datastore/pkg/openingtime" + "github.com/satimoto/go-datastore/pkg/session" "github.com/satimoto/go-datastore/pkg/tariff" "github.com/satimoto/go-datastore/pkg/user" "github.com/satimoto/go-ocpi/pkg/ocpi" @@ -45,6 +46,7 @@ type Resolver struct { LocationRepository location.LocationRepository NodeRepository node.NodeRepository OpeningTimeRepository openingtime.OpeningTimeRepository + SessionRepository session.SessionRepository TariffRepository tariff.TariffRepository TokenResolver *token.TokenResolver UserRepository user.UserRepository @@ -77,6 +79,7 @@ func NewResolverWithServices(repositoryService *db.RepositoryService, ferpServic LocationRepository: location.NewRepository(repositoryService), NodeRepository: node.NewRepository(repositoryService), OpeningTimeRepository: openingtime.NewRepository(repositoryService), + SessionRepository: session.NewRepository(repositoryService), TariffRepository: tariff.NewRepository(repositoryService), TokenResolver: token.NewResolver(repositoryService), UserRepository: user.NewRepository(repositoryService), diff --git a/graph/resolver/session.go b/graph/resolver/session.go new file mode 100644 index 0000000..60be411 --- /dev/null +++ b/graph/resolver/session.go @@ -0,0 +1,98 @@ +package resolver + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. + +import ( + "context" + "time" + + "github.com/satimoto/go-api/graph" + "github.com/satimoto/go-api/internal/authentication" + "github.com/satimoto/go-api/internal/util" + "github.com/satimoto/go-datastore/pkg/db" + "github.com/vektah/gqlparser/v2/gqlerror" +) + +func (r *queryResolver) GetSession(ctx context.Context, input graph.GetSessionInput) (*db.Session, error) { + if userId := authentication.GetUserId(ctx); userId != nil { + if input.ID != nil { + if s, err := r.SessionRepository.GetSession(ctx, *input.ID); err == nil && userId == &s.UserID { + return &s, nil + } + } else if input.UID != nil { + if s, err := r.SessionRepository.GetSessionByUid(ctx, *input.UID); err == nil && userId == &s.UserID { + return &s, nil + } + } else if input.AuthorizationID != nil { + if s, err := r.SessionRepository.GetSessionByAuthorizationID(ctx, *input.AuthorizationID); err == nil && userId == &s.UserID { + return &s, nil + } + } + + return nil, gqlerror.Errorf("Session not found") + } + + return nil, gqlerror.Errorf("Not authenticated") +} + +func (r *sessionResolver) AuthorizationID(ctx context.Context, obj *db.Session) (*string, error) { + return util.NullString(obj.AuthorizationID) +} + +func (r *sessionResolver) AuthMethod(ctx context.Context, obj *db.Session) (string, error) { + return string(obj.AuthMethod), nil +} + +func (r *sessionResolver) StartDatetime(ctx context.Context, obj *db.Session) (string, error) { + return obj.StartDatetime.Format(time.RFC3339), nil +} + +func (r *sessionResolver) EndDatetime(ctx context.Context, obj *db.Session) (*string, error) { + return util.NullTime(obj.EndDatetime, time.RFC3339) +} + +func (r *sessionResolver) Location(ctx context.Context, obj *db.Session) (*db.Location, error) { + if location, err := r.LocationRepository.GetLocation(ctx, obj.LocationID); err == nil { + return &location, nil + } + + return nil, gqlerror.Errorf("Location not found") +} + +func (r *sessionResolver) Evse(ctx context.Context, obj *db.Session) (*db.Evse, error) { + if evse, err := r.LocationRepository.GetEvse(ctx, obj.EvseID); err == nil { + return &evse, nil + } + + return nil, gqlerror.Errorf("Evse not found") +} + +func (r *sessionResolver) Connector(ctx context.Context, obj *db.Session) (*db.Connector, error) { + if connector, err := r.LocationRepository.GetConnector(ctx, obj.ConnectorID); err == nil { + return &connector, nil + } + + return nil, gqlerror.Errorf("Connector not found") +} + +func (r *sessionResolver) MeterID(ctx context.Context, obj *db.Session) (*string, error) { + return util.NullString(obj.MeterID) +} + +func (r *sessionResolver) SessionInvoices(ctx context.Context, obj *db.Session) ([]db.SessionInvoice, error) { + return r.SessionRepository.ListSessionInvoices(ctx, obj.ID) +} + +func (r *sessionResolver) Status(ctx context.Context, obj *db.Session) (string, error) { + return string(obj.Status), nil +} + +func (r *sessionResolver) LastUpdated(ctx context.Context, obj *db.Session) (string, error) { + return obj.LastUpdated.Format(time.RFC3339), nil +} + +// Session returns graph.SessionResolver implementation. +func (r *Resolver) Session() graph.SessionResolver { return &sessionResolver{r} } + +type sessionResolver struct{ *Resolver } diff --git a/graph/resolver/sessioninvoice.go b/graph/resolver/sessioninvoice.go new file mode 100644 index 0000000..3704db2 --- /dev/null +++ b/graph/resolver/sessioninvoice.go @@ -0,0 +1,35 @@ +package resolver + +// This file will be automatically regenerated based on the schema, any resolver implementations +// will be copied through when generating and any unknown code will be moved to the end. + +import ( + "context" + "time" + + "github.com/satimoto/go-api/graph" + "github.com/satimoto/go-api/internal/authentication" + "github.com/satimoto/go-datastore/pkg/db" + "github.com/vektah/gqlparser/v2/gqlerror" +) + +func (r *queryResolver) GetSessionInvoice(ctx context.Context, id int64) (*db.SessionInvoice, error) { + if userId := authentication.GetUserId(ctx); userId != nil { + if s, err := r.SessionRepository.GetSessionInvoice(ctx, id); err == nil && userId == &s.UserID { + return &s, nil + } + + return nil, gqlerror.Errorf("Session invoice not found") + } + + return nil, gqlerror.Errorf("Not authenticated") +} + +func (r *sessionInvoiceResolver) LastUpdated(ctx context.Context, obj *db.SessionInvoice) (string, error) { + return obj.LastUpdated.Format(time.RFC3339), nil +} + +// Session returns graph.SessioInvoicenResolver implementation. +func (r *Resolver) SessionInvoice() graph.SessionInvoiceResolver { return &sessionInvoiceResolver{r} } + +type sessionInvoiceResolver struct{ *Resolver } diff --git a/graph/resolver/tariff.go b/graph/resolver/tariff.go index f8af326..756d480 100644 --- a/graph/resolver/tariff.go +++ b/graph/resolver/tariff.go @@ -12,11 +12,18 @@ import ( "github.com/vektah/gqlparser/v2/gqlerror" ) -func (r *queryResolver) GetTariff(ctx context.Context, uid string) (*db.Tariff, error) { +func (r *queryResolver) GetTariff(ctx context.Context, input graph.GetTariffInput) (*db.Tariff, error) { if userId := authentication.GetUserId(ctx); userId != nil { - if t, err := r.TariffRepository.GetTariffByUid(ctx, uid); err == nil { - return &t, nil + if input.ID != nil { + if t, err := r.TariffRepository.GetTariff(ctx, *input.ID); err == nil { + return &t, nil + } + } else if input.UID != nil { + if t, err := r.TariffRepository.GetTariffByUid(ctx, *input.UID); err == nil { + return &t, nil + } } + return nil, gqlerror.Errorf("Tariff not found") } diff --git a/graph/schema/connector.graphqls b/graph/schema/connector.graphqls index 1710ea8..665b61e 100644 --- a/graph/schema/connector.graphqls +++ b/graph/schema/connector.graphqls @@ -1,5 +1,7 @@ type Connector { + id: ID! uid: String! + identifier: String standard: String! format: String! powerType: String! diff --git a/graph/schema/evse.graphqls b/graph/schema/evse.graphqls index 937a5e2..72fbfdc 100644 --- a/graph/schema/evse.graphqls +++ b/graph/schema/evse.graphqls @@ -1,6 +1,7 @@ type Evse { + id: ID! uid: String! - evseId: String + identifier: String status: String! statusSchedule: [StatusSchedule!]! capabilities: [TextDescription!]! diff --git a/graph/schema/location.graphqls b/graph/schema/location.graphqls index f17f3b9..5c85af0 100644 --- a/graph/schema/location.graphqls +++ b/graph/schema/location.graphqls @@ -9,6 +9,7 @@ type ListLocation { } type Location { + id: ID! uid: String! type: String! name: String @@ -36,6 +37,11 @@ type Location { lastUpdated: String! } +input GetLocationInput { + id: ID + uid: String +} + input ListLocationsInput { xMin: Float! yMin: Float! @@ -45,7 +51,7 @@ input ListLocationsInput { } extend type Query { - getLocation(uid: String!): Location + getLocation(input: GetLocationInput!): Location! listLocations(input: ListLocationsInput!): [ListLocation!]! } diff --git a/graph/schema/session.graphqls b/graph/schema/session.graphqls new file mode 100644 index 0000000..97bebe2 --- /dev/null +++ b/graph/schema/session.graphqls @@ -0,0 +1,26 @@ +type Session { + id: ID! + uid: String! + authorizationId: String + startDatetime: String! + endDatetime: String + kwh: Float! + authMethod: String! + location: Location! + evse: Evse! + connector: Connector! + meterId: String + sessionInvoices: [SessionInvoice!]! + status: String! + lastUpdated: String! +} + +input GetSessionInput { + id: ID + uid: String + authorizationId: String +} + +extend type Query { + getSession(input: GetSessionInput!): Session! +} \ No newline at end of file diff --git a/graph/schema/sessioninvoice.graphqls b/graph/schema/sessioninvoice.graphqls new file mode 100644 index 0000000..3baa84d --- /dev/null +++ b/graph/schema/sessioninvoice.graphqls @@ -0,0 +1,20 @@ +type SessionInvoice { + id: ID! + currency: String! + currencyRate: Int! + currencyRateMsat: Int! + amountFiat: Float! + amountMsat: Int! + commissionFiat: Float! + commissionMsat: Int! + taxFiat: Float! + taxMsat: Int! + paymentRequest: String! + isSettled: Boolean! + isExpired: Boolean! + lastUpdated: String! +} + +extend type Query { + getSessionInvoice(id: ID!): SessionInvoice +} \ No newline at end of file diff --git a/graph/schema/tariff.graphqls b/graph/schema/tariff.graphqls index cf9c1d9..69ff6ab 100644 --- a/graph/schema/tariff.graphqls +++ b/graph/schema/tariff.graphqls @@ -1,10 +1,16 @@ type Tariff { + id: ID! uid: String! currency: String! elements: [TariffElement!]! energyMix: EnergyMix } +input GetTariffInput { + id: ID + uid: String +} + extend type Query { - getTariff(uid: String!): Tariff + getTariff(input: GetTariffInput!): Tariff! } \ No newline at end of file diff --git a/scripts/build/push-mainnet.sh b/scripts/build/push-mainnet.sh new file mode 100755 index 0000000..1fc7027 --- /dev/null +++ b/scripts/build/push-mainnet.sh @@ -0,0 +1,2 @@ +aws ecr get-login-password --region eu-central-1 --profile satimoto-mainnet | docker login --username AWS --password-stdin https://490833747373.dkr.ecr.eu-central-1.amazonaws.com +./scripts/docker/tag.sh -b -t -m -c \ No newline at end of file diff --git a/scripts/build/push-testnet.sh b/scripts/build/push-testnet.sh new file mode 100755 index 0000000..4ecd5a4 --- /dev/null +++ b/scripts/build/push-testnet.sh @@ -0,0 +1,2 @@ +aws ecr get-login-password --region eu-central-1 --profile satimoto-testnet | docker login --username AWS --password-stdin https://909899099608.dkr.ecr.eu-central-1.amazonaws.com +./scripts/docker/tag.sh -b -t -c \ No newline at end of file diff --git a/terraform/resources/task-container-definitions.json b/terraform/resources/task-container-definitions.json index 5878b21..b58ad4a 100644 --- a/terraform/resources/task-container-definitions.json +++ b/terraform/resources/task-container-definitions.json @@ -17,6 +17,10 @@ "containerPort": ${service_container_port} } ], + "dockerLabels": { + "PROMETHEUS_EXPORTER_PORT": "${env_rest_port}", + "PROMETHEUS_EXPORTER_JOB_NAME": "${service_name}" + }, "environment": [ { "name": "API_DOMAIN",