From 94efd4ee11d1bd3bce939fe40e56a4466e4f1662 Mon Sep 17 00:00:00 2001 From: Patrik Date: Fri, 11 Mar 2022 14:34:11 +0100 Subject: [PATCH 1/6] feat: add check endpoints that do not mirror status code --- internal/check/handler.go | 72 +++++++++++++++------------ internal/check/handler_test.go | 2 +- internal/relationtuple/definitions.go | 2 +- internal/x/max_depth.go | 5 +- 4 files changed, 45 insertions(+), 36 deletions(-) diff --git a/internal/check/handler.go b/internal/check/handler.go index 66d509cd1..54e7b5326 100644 --- a/internal/check/handler.go +++ b/internal/check/handler.go @@ -3,9 +3,10 @@ package check import ( "context" "encoding/json" + "io" "net/http" + "net/url" - "github.com/ory/herodot" "github.com/pkg/errors" rts "github.com/ory/keto/proto/ory/keto/relation_tuples/v1alpha2" @@ -39,8 +40,10 @@ func NewHandler(d handlerDependencies) *Handler { const RouteBase = "/relation-tuples/check" func (h *Handler) RegisterReadRoutes(r *x.ReadRouter) { - r.GET(RouteBase, h.getCheck) - r.POST(RouteBase, h.postCheck) + r.GET(RouteBase, h.getCheckMirrorStatus) + r.GET(RouteBase+"-sdk", h.getCheckNoStatus) + r.POST(RouteBase, h.postCheckMirrorStatus) + r.POST(RouteBase+"-sdk", h.postCheckNoStatus) } func (h *Handler) RegisterWriteRoutes(_ *x.WriteRouter) {} @@ -51,7 +54,7 @@ func (h *Handler) RegisterReadGRPC(s *grpc.Server) { func (h *Handler) RegisterWriteGRPC(_ *grpc.Server) {} -// RESTResponse is the response for a check request. +// RESTResponse represents the response for a check request. // // The content of the allowed field is mirrored in the HTTP status code. // @@ -70,7 +73,7 @@ type getCheckRequest struct { MaxDepth int `json:"max-depth"` } -// swagger:route GET /relation-tuples/check read getCheck +// swagger:route GET /relation-tuples/check read getCheckInlineResponse2001 // // Check a relation tuple // @@ -89,34 +92,28 @@ type getCheckRequest struct { // 400: genericError // 403: getCheckResponse // 500: genericError -func (h *Handler) getCheck(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { - maxDepth, err := x.GetMaxDepthFromQuery(r.URL.Query()) +func (h *Handler) getCheckNoStatus(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { + allowed, err := h.getCheck(r.Context(), r.URL.Query()) if err != nil { - h.d.Writer().WriteError(w, r, herodot.ErrBadRequest.WithError(err.Error())) - return - } - - tuple, err := (&relationtuple.InternalRelationTuple{}).FromURLQuery(r.URL.Query()) - if errors.Is(err, relationtuple.ErrNilSubject) { - h.d.Writer().WriteError(w, r, herodot.ErrBadRequest.WithReason("Subject has to be specified.")) - return - } else if err != nil { - h.d.Writer().WriteError(w, r, herodot.ErrBadRequest.WithError(err.Error())) + h.d.Writer().WriteError(w, r, err) return } + h.d.Writer().Write(w, r, &RESTResponse{Allowed: allowed}) +} - allowed, err := h.d.PermissionEngine().SubjectIsAllowed(r.Context(), tuple, maxDepth) +func (h *Handler) getCheckMirrorStatus(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { + allowed, err := h.getCheck(r.Context(), r.URL.Query()) if err != nil { h.d.Writer().WriteError(w, r, err) return } if allowed { - h.d.Writer().WriteCode(w, r, http.StatusOK, &RESTResponse{Allowed: true}) + h.d.Writer().Write(w, r, &RESTResponse{Allowed: allowed}) return } - h.d.Writer().WriteCode(w, r, http.StatusForbidden, &RESTResponse{Allowed: false}) + h.d.Writer().WriteCode(w, r, http.StatusForbidden, &RESTResponse{Allowed: allowed}) } // swagger:route POST /relation-tuples/check read postCheck @@ -138,31 +135,42 @@ func (h *Handler) getCheck(w http.ResponseWriter, r *http.Request, _ httprouter. // 400: genericError // 403: getCheckResponse // 500: genericError -func (h *Handler) postCheck(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { - maxDepth, err := x.GetMaxDepthFromQuery(r.URL.Query()) +func (h *Handler) postCheckNoStatus(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { + allowed, err := h.postCheck(r.Context(), r.Body, r.URL.Query()) if err != nil { - h.d.Writer().WriteError(w, r, herodot.ErrBadRequest.WithError(err.Error())) - return - } - - var tuple relationtuple.InternalRelationTuple - if err := json.NewDecoder(r.Body).Decode(&tuple); err != nil { - h.d.Writer().WriteError(w, r, errors.WithStack(herodot.ErrBadRequest.WithReasonf("Unable to decode JSON payload: %s", err))) + h.d.Writer().WriteError(w, r, err) return } + h.d.Writer().Write(w, r, &RESTResponse{Allowed: allowed}) +} - allowed, err := h.d.PermissionEngine().SubjectIsAllowed(r.Context(), &tuple, maxDepth) +func (h *Handler) postCheckMirrorStatus(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { + allowed, err := h.postCheck(r.Context(), r.Body, r.URL.Query()) if err != nil { h.d.Writer().WriteError(w, r, err) return } if allowed { - h.d.Writer().WriteCode(w, r, http.StatusOK, &RESTResponse{Allowed: true}) + h.d.Writer().Write(w, r, &RESTResponse{Allowed: allowed}) return } - h.d.Writer().WriteCode(w, r, http.StatusForbidden, &RESTResponse{Allowed: false}) + h.d.Writer().WriteCode(w, r, http.StatusForbidden, &RESTResponse{Allowed: allowed}) +} + +func (h *Handler) postCheck(ctx context.Context, body io.Reader, query url.Values) (bool, error) { + maxDepth, err := x.GetMaxDepthFromQuery(query) + if err != nil { + return false, err + } + + var tuple relationtuple.InternalRelationTuple + if err := json.NewDecoder(body).Decode(&tuple); err != nil { + return false, errors.WithStack(err) + } + + return h.d.PermissionEngine().SubjectIsAllowed(ctx, &tuple, maxDepth) } func (h *Handler) Check(ctx context.Context, req *rts.CheckRequest) (*rts.CheckResponse, error) { diff --git a/internal/check/handler_test.go b/internal/check/handler_test.go index 5f81bad24..759180ba4 100644 --- a/internal/check/handler_test.go +++ b/internal/check/handler_test.go @@ -77,7 +77,7 @@ func TestRESTHandler(t *testing.T) { assert.Equal(t, http.StatusBadRequest, resp.StatusCode) body, err := io.ReadAll(resp.Body) require.NoError(t, err) - assert.Contains(t, string(body), "Subject has to be specified") + assert.Contains(t, string(body), "Please provide a subject") }) t.Run("case=returns denied on unknown namespace", func(t *testing.T) { diff --git a/internal/relationtuple/definitions.go b/internal/relationtuple/definitions.go index 9fc1c63c9..65b8c7af5 100644 --- a/internal/relationtuple/definitions.go +++ b/internal/relationtuple/definitions.go @@ -120,7 +120,7 @@ var ( _, _ Subject = &SubjectID{}, &SubjectSet{} ErrMalformedInput = herodot.ErrBadRequest.WithError("malformed string input") - ErrNilSubject = herodot.ErrBadRequest.WithError("subject is not allowed to be nil") + ErrNilSubject = herodot.ErrBadRequest.WithError("subject is not allowed to be nil").WithDebug("Please provide a subject.") ErrDuplicateSubject = herodot.ErrBadRequest.WithError("exactly one of subject_set or subject_id has to be provided") ErrDroppedSubjectKey = herodot.ErrBadRequest.WithDebug(`provide "subject_id" or "subject_set.*"; support for "subject" was dropped`) ErrIncompleteSubject = herodot.ErrBadRequest.WithError(`incomplete subject, provide "subject_id" or a complete "subject_set.*"`) diff --git a/internal/x/max_depth.go b/internal/x/max_depth.go index 15f5b57bb..2b12df8d5 100644 --- a/internal/x/max_depth.go +++ b/internal/x/max_depth.go @@ -1,9 +1,10 @@ package x import ( - "fmt" "net/url" "strconv" + + "github.com/ory/herodot" ) func GetMaxDepthFromQuery(q url.Values) (int, error) { @@ -13,7 +14,7 @@ func GetMaxDepthFromQuery(q url.Values) (int, error) { maxDepth, err := strconv.ParseInt(q.Get("max-depth"), 0, 0) if err != nil { - return 0, fmt.Errorf("unable to parse 'max-depth' query parameter to int: %s", err) + return 0, herodot.ErrBadRequest.WithErrorf("unable to parse 'max-depth' query parameter to int: %s", err) } return int(maxDepth), err From 8412af2c49014a02c9fd3b22cc4c68fa4b62ca5e Mon Sep 17 00:00:00 2001 From: Patrik Date: Fri, 11 Mar 2022 15:48:32 +0100 Subject: [PATCH 2/6] chore: bump vulnerable dependencies --- go.mod | 31 ++++---- go.sum | 224 +++++++++++++++++++-------------------------------------- 2 files changed, 89 insertions(+), 166 deletions(-) diff --git a/go.mod b/go.mod index 67ccd523f..aca35f157 100644 --- a/go.mod +++ b/go.mod @@ -1,22 +1,21 @@ module github.com/ory/keto -replace google.golang.org/protobuf v1.25.1-0.20201020201750-d3470999428b => google.golang.org/protobuf v1.25.0 - -replace github.com/soheilhy/cmux => github.com/soheilhy/cmux v0.1.5-0.20210114230657-cdd3331e3e7c - -replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 - -replace github.com/oleiade/reflections => github.com/oleiade/reflections v1.0.1 - -replace github.com/gobuffalo/packr => github.com/gobuffalo/packr v1.30.1 - -replace github.com/ory/keto/proto => ./proto - -replace github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.0.0 - -replace github.com/containerd/containerd => github.com/containerd/containerd v1.6.1 +replace ( + //github.com/gobuffalo/packr => github.com/gobuffalo/packr v1.30.1 + github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 + github.com/oleiade/reflections => github.com/oleiade/reflections v1.0.1 + github.com/ory/keto/proto => ./proto + github.com/soheilhy/cmux => github.com/soheilhy/cmux v0.1.5-0.20210114230657-cdd3331e3e7c +//google.golang.org/protobuf v1.25.1-0.20201020201750-d3470999428b => google.golang.org/protobuf v1.25.0 +) -replace github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.3 +// vulnerable dependencies +replace ( + github.com/containerd/containerd => github.com/containerd/containerd v1.5.10 + github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.0.0 + github.com/docker/distribution v2.7.1+incompatible => github.com/distribution/distribution v2.8.1+incompatible + github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.3 +) require ( github.com/cenkalti/backoff/v3 v3.0.0 diff --git a/go.sum b/go.sum index 3cf80459c..6c1e596c3 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,4 @@ bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -bazil.org/fuse v0.0.0-20200407214033-5883e5a4b512/go.mod h1:FbcW6z/2VytnFDhZfumh8Ss8zxHE6qpMP5sHTRe0EaM= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= @@ -52,23 +51,23 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8= -github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-ansiterm v0.0.0-20210608223527-2377c96fe795/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= +github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M= +github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= +github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.4.0/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= +github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= @@ -84,17 +83,18 @@ github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXY github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= +github.com/Microsoft/go-winio v0.4.17-0.20210211115548-6eac466e5fa3/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= +github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= -github.com/Microsoft/hcsshim v0.8.20/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= +github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= +github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= github.com/Microsoft/hcsshim v0.8.23/go.mod h1:4zegtUJth7lAvFyc6cH2gGQ5B3OFQim01nnU2M8jKDg= -github.com/Microsoft/hcsshim v0.9.2/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -122,7 +122,7 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= +github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -163,7 +163,6 @@ github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAm github.com/aws/smithy-go v1.11.0/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnwub1bgM= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -182,7 +181,7 @@ github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= github.com/bradleyjkemp/cupaloy/v2 v2.6.0 h1:knToPYa2xtfg42U3I6punFEjaGFKWQRXJwj0JTv4mTs= github.com/bradleyjkemp/cupaloy/v2 v2.6.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= -github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= +github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/cenkalti/backoff/v3 v3.0.0 h1:ske+9nBpD9qZsTBoF41nW5L+AIuFBKMeze18XQ3eG1c= github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -191,8 +190,6 @@ github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8 github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= -github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -202,6 +199,7 @@ github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d8 github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= @@ -221,49 +219,48 @@ github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/cockroach-go/v2 v2.2.10 h1:O7Hl8m0rs/oJNBmRr14ED3Q3+AmugMK9DtJwRDHZ2DA= github.com/cockroachdb/cockroach-go/v2 v2.2.10/go.mod h1:xZ2VHjUEb/cySv0scXBx7YsBnHtLHkR1+w/w73b5i3M= -github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= -github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= +github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/confluentinc/confluent-kafka-go v1.4.0/go.mod h1:u2zNLny2xq+5rWeTQjFHbDzzNuba4P1vo31r9r4uAdg= github.com/containerd/aufs v1.0.0/go.mod h1:kL5kd6KM5TzQjR79jljyi4olc1Vrx6XBlcyj3gNv2PU= github.com/containerd/btrfs v1.0.0/go.mod h1:zMcX3qkXTAi9GI50+0HOeuV8LU2ryCE/V2vG/ZBiTss= +github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= -github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/containerd v1.6.1 h1:oa2uY0/0G+JX4X7hpGCYvkp9FjUancz56kSNnb1sG3o= -github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE= +github.com/containerd/containerd v1.5.10 h1:3cQ2uRVCkJVcx5VombsE7105Gl9Wrl7ORAO3+4+ogf4= +github.com/containerd/containerd v1.5.10/go.mod h1:fvQqCfadDGga5HZyn3j4+dx56qj2I9YwBrlSdalvJYQ= github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= -github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/containerd/fifo v1.0.0/go.mod h1:ocF/ME1SX5b1AOlWi9r677YJmCPSwwWnQ9O123vzpE4= -github.com/containerd/go-cni v1.1.0/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= -github.com/containerd/go-cni v1.1.3/go.mod h1:Rflh2EJ/++BA2/vY5ao3K6WJRR/bZKsX123aPk+kUtA= +github.com/containerd/go-cni v1.0.2/go.mod h1:nrNABBHzu0ZwCug9Ije8hL2xBCYh/pjfMb1aZGrrohk= +github.com/containerd/go-runc v0.0.0-20201020171139-16b287bc67d0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= github.com/containerd/go-runc v1.0.0/go.mod h1:cNU0ZbCgCQVZK4lgG3P+9tn9/PaJNmoDXPpoJhDR+Ok= -github.com/containerd/imgcrypt v1.1.3/go.mod h1:/TPA1GIDXMzbj01yd8pIbQiLdQxed5ue1wb8bP7PQu4= +github.com/containerd/imgcrypt v1.1.1/go.mod h1:xpLnwiQmEUJPvQoAapeb2SNCxz7Xr6PJrXQb0Dpc4ms= github.com/containerd/nri v0.1.0/go.mod h1:lmxnXF6oMkbqs39FiCt1s0R2HSMhcLel9vNL3m4AaeY= -github.com/containerd/stargz-snapshotter/estargz v0.4.1/go.mod h1:x7Q9dg9QYb4+ELgxmo4gBUeJB0tl5dqH1Sdz0nJU1QM= github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= +github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containernetworking/cni v1.0.1/go.mod h1:AKuhXbN5EzmD4yTNtfSsX3tPcmtrBI6QcRV0NiNt15Y= -github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNBDZcxSOplJT5ico8/FLE= -github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= +github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= +github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRDjeJr6FLK6vuiUwoH7P8= +github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-iptables v0.6.0/go.mod h1:Qe8Bv2Xik5FyTXwgIbLAnv2sWSBmvWdFETJConOQ//Q= +github.com/coreos/go-iptables v0.5.0/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= @@ -276,6 +273,7 @@ github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2 github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= +github.com/d2g/hardwareaddr v0.0.0-20190221164911-e7d9fbe030e4/go.mod h1:bMl4RjIciD2oAxI7DmWRx6gbeqrkoLqv3MV0vzNad+I= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -291,17 +289,13 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczC github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v20.10.14+incompatible h1:dSBKJOVesDgHo7rbxlYjYsXe7gPzrTT+/cKQgpDAazg= github.com/docker/cli v20.10.14+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker v20.10.9+incompatible h1:JlsVnETOjM2RLQa0Cc1XCIspUdXW3Zenq9P54uXBm6k= github.com/docker/docker v20.10.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= @@ -311,6 +305,7 @@ github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= +github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= @@ -342,6 +337,7 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -351,13 +347,11 @@ github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/frankban/quicktest v1.13.0/go.mod h1:qLE0fzW0VuyUAJgPU19zByoIr0HtCHN/r/VLSOOIySU= @@ -366,7 +360,6 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/garyburd/redigo v1.6.3/go.mod h1:rTb6epsqigu3kYKBnaF028A7Tf/Aw5s0cqA47doKKqw= -github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -399,13 +392,9 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.1/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.0/go.mod h1:YkVgnZu1ZjjL7xTxrfm/LLZBfkhTqSR1ydtm6jTKKwI= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= @@ -599,6 +588,7 @@ github.com/gobuffalo/validate/v3 v3.3.1/go.mod h1:Ehu8ieNJQuUM4peDDr/0VapzdGA7Rg github.com/goccy/go-yaml v1.9.5 h1:Eh/+3uk9kLxG4koCX6lRMAPS1OaMSAi+FJcya0INdB0= github.com/goccy/go-yaml v1.9.5/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= github.com/gocql/gocql v0.0.0-20220224095938-0eacd3183625/go.mod h1:3gM2c4D3AnkISwBxGnMMsS8Oy4y2lhbPRsH4xnJrHG8= +github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofiber/fiber/v2 v2.11.0/go.mod h1:oZTLWqYnqpMMuF922SjGbsYZsdpE1MCfh416HNdweIM= @@ -660,7 +650,6 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/gomodule/redigo v1.7.0/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -675,7 +664,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= github.com/google/go-jsonnet v0.17.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -715,8 +703,6 @@ github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pf github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= -github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= -github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= @@ -730,16 +716,19 @@ github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7 github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.1.3/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w= github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= +github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= @@ -826,8 +815,7 @@ github.com/inhies/go-bytesize v0.0.0-20210819104631-275770b98743/go.mod h1:KrtyD github.com/instana/go-sensor v1.41.1/go.mod h1:E42MelHWFz11qqaLwvgt0j98v2s2O/bq22UDkGaG0Gg= github.com/instana/testify v1.6.2-0.20200721153833-94b1851f4d65 h1:T25FL3WEzgmKB0m6XCJNZ65nw09/QIp3T1yXr487D+A= github.com/instana/testify v1.6.2-0.20200721153833-94b1851f4d65/go.mod h1:nYhEREG/B7HUY7P+LKOrqy53TpIqmJ9JyUShcaEKtGw= -github.com/intel/goresctrl v0.2.0/go.mod h1:+CZdzouYFn5EsxgqAQTEzMfwKwuc0fVdMrT9FCCAVRQ= -github.com/j-keck/arping v1.0.2/go.mod h1:aJbELhR92bSk7tp79AWM/ftfc90EfEi2bQJrbBFOsPw= +github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= @@ -929,13 +917,11 @@ github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhB github.com/jmoiron/sqlx v1.3.4/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g= github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ= -github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/joho/godotenv v1.4.0 h1:3l4+N6zfMWnkbPEXKng2o2/MR5mSwTrBih4ZEkkz1lg= github.com/joho/godotenv v1.4.0/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -1003,7 +989,6 @@ github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs= github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= github.com/looplab/fsm v0.1.0/go.mod h1:m2VaOfDHxqXBBMgc26m6yUOwkFn8H2AlJDE+jd/uafI= github.com/luna-duclos/instrumentedsql v1.1.3 h1:t7mvC0z1jUt5A0UQ6I/0H31ryymuQRnJcWCiqV3lSAA= github.com/luna-duclos/instrumentedsql v1.1.3/go.mod h1:9J1njvFds+zN7y85EDhN9XNQLANWwZt2ULeIC8yMNYs= @@ -1044,6 +1029,7 @@ github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= @@ -1053,11 +1039,10 @@ github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOA github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-shellwords v1.0.6/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y= +github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U= @@ -1065,7 +1050,6 @@ github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/microcosm-cc/bluemonday v1.0.16 h1:kHmAq2t7WPWLjiGvzKa5o3HzSfahUKiOq7fAPUiMNIc= github.com/microcosm-cc/bluemonday v1.0.16/go.mod h1:Z0r70sCuXHig8YpBzCc5eGHAap2K7e/u082ZUpDRRqM= @@ -1102,13 +1086,10 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/sys/signal v0.6.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg= -github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs= +github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= +github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= -github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1137,32 +1118,29 @@ github.com/nyaruka/phonenumbers v1.0.73/go.mod h1:3aiS+PS3DuYwkbK3xdcmRwMiPNECZ0 github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= +github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= +github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v1.0.3 h1:1hbqejyQWCJBvtKAfdO0b1FmaEf2z/bxnjqbARass5k= @@ -1171,7 +1149,6 @@ github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/ github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= -github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= @@ -1260,7 +1237,6 @@ github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -1272,6 +1248,7 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= @@ -1300,12 +1277,10 @@ github.com/ruudk/golang-pdf417 v0.0.0-20201230142125-a7e3863a1245/go.mod h1:pQAZ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= +github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= github.com/santhosh-tekuri/jsonschema v1.2.4/go.mod h1:TEAUOeZSmIxTTuHatJzrvARHiuO9LYd+cIxzgEHCQI4= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= -github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/seatgeek/logrus-gelf-formatter v0.0.0-20210414080842-5b05eb8ff761 h1:0b8DF5kR0PhRoRXDiEEdzrgBc8UqVY4JWLkQJCRsLME= github.com/seatgeek/logrus-gelf-formatter v0.0.0-20210414080842-5b05eb8ff761/go.mod h1:/THDZYi7F/BsVEcYzYPqdcWFQ+1C2InkawTKfLOAnzg= @@ -1328,6 +1303,7 @@ github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= @@ -1370,6 +1346,7 @@ github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmq github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -1379,7 +1356,6 @@ github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= github.com/square/go-jose/v3 v3.0.0-20200630053402-0a67ce9b0693/go.mod h1:6hSY48PjDm4UObWmGLyJE9DxYVKTgR9kbCspXXJEhcU= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= -github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -1425,17 +1401,17 @@ github.com/timtadh/data-structures v0.5.3/go.mod h1:9R4XODhJ8JdWFEI8P/HJKqxuJctf github.com/timtadh/lexmachine v0.2.2 h1:g55RnjdYazm5wnKv59pwFcBJHOyvTPfDEoz21s4PHmY= github.com/timtadh/lexmachine v0.2.2/go.mod h1:GBJvD5OAfRn/gnp92zb9KTgHLB7akKyxmVivoYCcjQI= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= +github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c/go.mod h1:hzIxponao9Kjc7aWznkXaL4U4TWaDSs8zcsY4Ka08nM= github.com/twitchtv/twirp v8.1.1+incompatible/go.mod h1:RRJoFSAmTEh2weEqWtpPE3vFK5YBhA6bqp2l1kfCC5A= github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk= github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= @@ -1450,10 +1426,8 @@ github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7Fw github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netlink v1.1.1-0.20201029203352-d40f9887b852/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= -github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ= github.com/vmihailenco/msgpack/v4 v4.3.11/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= github.com/vmihailenco/msgpack/v5 v5.0.0-beta.1/go.mod h1:xlngVLeyQ/Qi05oQxhQ+oTuqa03RjMwMfk/7/TCs+QI= @@ -1492,17 +1466,15 @@ go.elastic.co/apm/module/apmhttp v1.15.0/go.mod h1:NruY6Jq8ALLzWUVUQ7t4wIzn+onKo go.elastic.co/apm/module/apmot v1.15.0/go.mod h1:BjFz2KOlnjXdnSo0p6nhDDaIEYYX8c6uVHwvkZiLqtQ= go.elastic.co/fastjson v1.1.0/go.mod h1:boNGISWMjQsUPy/t6yqt2/1Wx4YNPSe+mZjlyw9vKKI= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= +go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= -go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= -go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= @@ -1521,15 +1493,10 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/contrib v0.20.0 h1:ubFQUn0VCZ0gPwIoJfBJVpeBlyRMxu8Mm/huKWYd9p0= -go.opentelemetry.io/contrib v0.20.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.20.0/go.mod h1:oVGt1LRbBOBq1A5BQLlUg9UaU/54aiHw8cgjV3aWZ/E= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.28.0/go.mod h1:vEhqr0m4eTc+DWxfsXoXue2GBgV2uUwVznkGIHW/e5w= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.30.0 h1:3rCOYB0P/u0/MXyLGuRuc/VdBsQuxKgj/dvIpVI0lS4= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.30.0/go.mod h1:L02XUVEqBFpJPJmaKLi5sXFiMwzd152PNMsCThH7dHc= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.25.0 h1:H6bZI2q89Q1RR/mQgrWIVtOTh711dJd0oA7Kxk4ujy8= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.25.0/go.mod h1:0MPbX5HgESa5d3UZXbz8pmKoWVrCZwt1N6JmmY206IQ= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.20.0/go.mod h1:2AboqHi0CiIZU0qwhtUfCYD1GeUzvvIXWNkhDt7ZMG4= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0 h1:SLme4Porm+UwX0DdHMxlwRt7FzPSE0sys81bet2o0pU= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0/go.mod h1:tLYsuf2v8fZreBVwp9gVMhefZlLFZaUiNVSq8QxXRII= go.opentelemetry.io/contrib/propagators/b3 v1.4.0 h1:wDb2ct7xMzossYpx44w81skxkEyeT2IRnBgYKqyEork= @@ -1539,9 +1506,7 @@ go.opentelemetry.io/contrib/propagators/jaeger v1.4.0/go.mod h1:C6Tffii02q1NrEzJ go.opentelemetry.io/contrib/samplers/jaegerremote v0.0.0-20220314184135-32895002a444 h1:bpPIQ4lcXFubX82lvMN/3hvu/mI/qCrQMEhQiW1glu4= go.opentelemetry.io/contrib/samplers/jaegerremote v0.0.0-20220314184135-32895002a444/go.mod h1:e0xV/IXUqN67FXhxQ/IEaZ1nRIxU4pML/ptX4DTqfkM= go.opentelemetry.io/otel v0.11.0/go.mod h1:G8UCk+KooF2HLkgo8RHX9epABH/aRGYET7gQOqBVdB0= -go.opentelemetry.io/otel v0.20.0/go.mod h1:Y3ugLH2oa81t5QO+Lty+zXf8zC9L26ax4Nzoxm/dooo= go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M0SNFU= -go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk= go.opentelemetry.io/otel v1.4.1/go.mod h1:StM6F/0fSwpd8dKWDCdRr7uRvEPYdW0hBSlbdTiUde4= go.opentelemetry.io/otel v1.5.0/go.mod h1:Jm/m+rNp/z0eqJc74H7LPwQ3G87qkU/AnnAydAjSAHk= @@ -1551,38 +1516,24 @@ go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+n go.opentelemetry.io/otel/bridge/opentracing v1.6.3/go.mod h1:3SVwOElsIpFiclDeQ4aB7EO/Y1Lm0IXUsLh5TYjHTxo= go.opentelemetry.io/otel/exporters/jaeger v1.5.0 h1:ZR7nhLSfLufS5AHk/iN11Q+W9XYwsJrVZ1Frb833d+Y= go.opentelemetry.io/otel/exporters/jaeger v1.5.0/go.mod h1:rSeUArMBRe1eQLo1T0WxOazohN1M2mYThWJQmn1BjRQ= -go.opentelemetry.io/otel/exporters/otlp v0.20.0 h1:PTNgq9MRmQqqJY0REVbZFvwkYOA85vbdQU/nVfxDyqg= -go.opentelemetry.io/otel/exporters/otlp v0.20.0/go.mod h1:YIieizyaN77rtLJra0buKiNBOm9XQfkPEKBeuhoMwAM= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.3.0/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.6.3 h1:nAmg1WgsUXoXf46dJG9eS/AzOcvkCTK4xJSUYpWyHYg= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.6.3/go.mod h1:NEu79Xo32iVb+0gVNV8PMd7GoWqnyDXRlj04yFjqz40= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.3.0/go.mod h1:hO1KLR7jcKaDDKDkvI9dP/FIhpmna5lkqPUQdEjFAM8= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.6.3 h1:4/UjHWMVVc5VwX/KAtqJOHErKigMCH8NexChMuanb/o= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.6.3/go.mod h1:UJmXdiVVBaZ63umRUTwJuCMAV//GCMvDiQwn703/GoY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.3.0/go.mod h1:keUU7UfnwWTWpJ+FWnyqmogPa82nuU5VUANFq49hlMY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.3.0/go.mod h1:QNX1aly8ehqqX1LEa6YniTU7VY9I6R3X/oPxhGdTceE= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.6.3 h1:ufVuVt/g16GZ/yDOyp+AcCGebGX8u4z7kDRuwEX0DkA= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.6.3/go.mod h1:S18p8VK4KRHHyAg5rH3iUnJUcRvIUg9xwIWtq1MWibM= go.opentelemetry.io/otel/exporters/zipkin v1.7.0 h1:X0FZj+kaIdLi29UiyrEGDhRTYsEXj9GdEW5Y39UQFEE= go.opentelemetry.io/otel/exporters/zipkin v1.7.0/go.mod h1:9YBXeOMFLQGwNEjsxMRiWPGoJX83usGMhbCmxUbNe5I= go.opentelemetry.io/otel/internal/metric v0.27.0 h1:9dAVGAfFiiEq5NVB9FUJ5et+btbDQAUIJehJ+ikyryk= go.opentelemetry.io/otel/internal/metric v0.27.0/go.mod h1:n1CVxRqKqYZtqyTh9U/onvKapPGv7y/rpyOTI+LFNzw= -go.opentelemetry.io/otel/metric v0.20.0/go.mod h1:598I5tYlH1vzBjn+BTuhzTCSb/9debfNp6R3s7Pr1eU= go.opentelemetry.io/otel/metric v0.27.0 h1:HhJPsGhJoKRSegPQILFbODU56NS/L1UE4fS1sC5kIwQ= go.opentelemetry.io/otel/metric v0.27.0/go.mod h1:raXDJ7uP2/Jc0nVZWQjJtzoyssOYWu/+pjZqRzfvZ7g= -go.opentelemetry.io/otel/oteltest v0.20.0/go.mod h1:L7bgKf9ZB7qCwT9Up7i9/pn0PWIa9FqQ2IQ8LoxiGnw= -go.opentelemetry.io/otel/sdk v0.20.0/go.mod h1:g/IcepuwNsoiX5Byy2nNV0ySUF1em498m7hBWC279Yc= -go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= go.opentelemetry.io/otel/sdk v1.4.1/go.mod h1:NBwHDgDIBYjwK2WNu1OPgsIc2IJzmBXNnvIJxJc8BpE= go.opentelemetry.io/otel/sdk v1.5.0/go.mod h1:CU4J1v+7iEljnm1G14QjdFWOXUyYLHVh0Lh+/BTYyFg= go.opentelemetry.io/otel/sdk v1.6.3/go.mod h1:A4iWF7HTXa+GWL/AaqESz28VuSBIcZ+0CV+IzJ5NMiQ= go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0= go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= -go.opentelemetry.io/otel/sdk/export/metric v0.20.0/go.mod h1:h7RBNMsDJ5pmI1zExLi+bJK+Dr8NQCh0qGhm1KDnNlE= -go.opentelemetry.io/otel/sdk/metric v0.20.0/go.mod h1:knxiS8Xd4E/N+ZqKmUPf3gTTZ4/0TjTXukfxjzSTpHE= -go.opentelemetry.io/otel/trace v0.20.0/go.mod h1:6GjCW8zgDjwGHGa6GkyeB8+/5vjT16gUEi0Nf1iBdgw= go.opentelemetry.io/otel/trace v1.0.1/go.mod h1:5g4i4fKLaX2BQpSBsxw8YYcgKpMMSW3x7ZTuYBr3sUk= -go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE= go.opentelemetry.io/otel/trace v1.4.1/go.mod h1:iYEVbroFCNut9QkwEczV9vMRPHNKSSwYZjulEtsmhFc= go.opentelemetry.io/otel/trace v1.5.0/go.mod h1:sq55kfhjXYr1zVSyexg0w1mpa03AYXR5eyTkB9NPPdE= @@ -1590,7 +1541,6 @@ go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5f go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= -go.opentelemetry.io/proto/otlp v0.11.0/go.mod h1:QpEjXPrNQzrFDZgoTo49dgHR9RYRSrg3NAKnUGl9YpQ= go.opentelemetry.io/proto/otlp v0.15.0 h1:h0bKrvdrT/9sBwEJ6iWUqT/N/xPcS66bL4u3isneJ6w= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= @@ -1598,8 +1548,6 @@ go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= -go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= @@ -1638,7 +1586,6 @@ golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= @@ -1745,6 +1692,7 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= @@ -1759,17 +1707,14 @@ golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1829,7 +1774,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1846,7 +1790,6 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1876,8 +1819,10 @@ golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201117170446-d9b008d0a637/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1908,16 +1853,12 @@ golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220405210540-1e041c57c461/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1925,8 +1866,6 @@ golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a h1:N2T1jUrTQE9Re6TFF5PhvEHXH golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1940,13 +1879,13 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M= golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -1975,7 +1914,6 @@ golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1984,7 +1922,6 @@ golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -2006,19 +1943,16 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200527183253-8e7acdbce89d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200616133436-c1934b75d054/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= @@ -2118,7 +2052,6 @@ google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200527145253-8367513e4ece/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200528110217-3d3490e7e671/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= google.golang.org/genproto v0.0.0-20200726014623-da3ae01ef02d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -2127,8 +2060,8 @@ google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -2197,7 +2130,6 @@ google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9K google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.45.0 h1:NEpgUqV3Z+ZjkqMsxMg11IaDrXY4RY6CQukSGK0uI1M= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= @@ -2219,6 +2151,7 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/DataDog/dd-trace-go.v1 v1.38.0/go.mod h1:GBhK4yaMJ1h329ivtKAqRNe1EZ944UnZwtz5lh7CnJc= +gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -2227,8 +2160,10 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/mold.v2 v2.2.0/go.mod h1:XMyyRsGtakkDPbxXbrA5VODo6bUXyvoDjLd5l3T0XoA= gopkg.in/go-playground/validator.v9 v9.29.1/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= @@ -2292,44 +2227,33 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= howett.net/plist v0.0.0-20181124034731-591f970eefbb/go.mod h1:vMygbs4qMhSZSc4lCUl2OEE+rDiIIJAIdR4m7MiMcm0= k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= -k8s.io/api v0.22.5/go.mod h1:mEhXyLaSD1qTOf40rRiKXkc+2iCem09rWLlFwhCEiAs= +k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= -k8s.io/apimachinery v0.22.1/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= -k8s.io/apimachinery v0.22.5/go.mod h1:xziclGKwuuJ2RM5/rSFQSYAj0zdbci3DH8kj+WvyN0U= -k8s.io/apiserver v0.22.5/go.mod h1:s2WbtgZAkTKt679sYtSudEQrTGWUSQAPe6MupLnlmaQ= +k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= +k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= k8s.io/client-go v0.17.0/go.mod h1:TYgR6EUHs6k45hb6KWjVD6jFZvJV4gHDikv/It0xz+k= -k8s.io/client-go v0.22.5/go.mod h1:cs6yf/61q2T1SdQL5Rdcjg9J1ElXSwbjSrW2vFImM4Y= -k8s.io/code-generator v0.19.7/go.mod h1:lwEq3YnLYb/7uVXLorOJfxg+cUu2oihFhHZ0n9NIla0= -k8s.io/component-base v0.22.5/go.mod h1:VK3I+TjuF9eaa+Ln67dKxhGar5ynVbwnGrUiNF4MqCI= -k8s.io/cri-api v0.23.1/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= +k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= +k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= +k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20200428234225-8167cfdcfc14/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20201113003025-83324d819ded/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kube-openapi v0.0.0-20211109043538-20434351676c/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= +k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= mellium.im/sasl v0.2.1/go.mod h1:ROaEDLQNuf9vjKqE1SrAfnsobm2YKXT1gnN1uDp1PjQ= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= +sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= From 914f4c71ffb9eb4b526daaf1e6b725553822a59d Mon Sep 17 00:00:00 2001 From: Patrik Date: Sat, 12 Mar 2022 12:27:46 +0100 Subject: [PATCH 3/6] chore: go mod tidy and ory/x cleanup --- go.mod | 3 --- 1 file changed, 3 deletions(-) diff --git a/go.mod b/go.mod index aca35f157..410d24d81 100644 --- a/go.mod +++ b/go.mod @@ -1,19 +1,16 @@ module github.com/ory/keto replace ( - //github.com/gobuffalo/packr => github.com/gobuffalo/packr v1.30.1 github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 github.com/oleiade/reflections => github.com/oleiade/reflections v1.0.1 github.com/ory/keto/proto => ./proto github.com/soheilhy/cmux => github.com/soheilhy/cmux v0.1.5-0.20210114230657-cdd3331e3e7c -//google.golang.org/protobuf v1.25.1-0.20201020201750-d3470999428b => google.golang.org/protobuf v1.25.0 ) // vulnerable dependencies replace ( github.com/containerd/containerd => github.com/containerd/containerd v1.5.10 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.0.0 - github.com/docker/distribution v2.7.1+incompatible => github.com/distribution/distribution v2.8.1+incompatible github.com/opencontainers/runc => github.com/opencontainers/runc v1.0.3 ) From d0bdba6229dd1a1887a5a6a636fe0a988204e3ec Mon Sep 17 00:00:00 2001 From: hperl <34397+hperl@users.noreply.github.com> Date: Mon, 13 Jun 2022 15:20:36 +0200 Subject: [PATCH 4/6] test: add tests for the openapi check route --- internal/check/handler.go | 27 ++++-- internal/check/handler_test.go | 157 +++++++++++++++++++-------------- main.go | 2 +- spec/api.json | 4 +- spec/swagger.json | 4 +- 5 files changed, 118 insertions(+), 76 deletions(-) diff --git a/internal/check/handler.go b/internal/check/handler.go index 54e7b5326..93f24b562 100644 --- a/internal/check/handler.go +++ b/internal/check/handler.go @@ -37,13 +37,16 @@ func NewHandler(d handlerDependencies) *Handler { return &Handler{d: d} } -const RouteBase = "/relation-tuples/check" +const ( + RouteBase = "/relation-tuples/check" + OpenAPIRouteBase = "/relation-tuples/check/openapi" +) func (h *Handler) RegisterReadRoutes(r *x.ReadRouter) { r.GET(RouteBase, h.getCheckMirrorStatus) - r.GET(RouteBase+"-sdk", h.getCheckNoStatus) + r.GET(OpenAPIRouteBase, h.getCheckNoStatus) r.POST(RouteBase, h.postCheckMirrorStatus) - r.POST(RouteBase+"-sdk", h.postCheckNoStatus) + r.POST(OpenAPIRouteBase, h.postCheckNoStatus) } func (h *Handler) RegisterWriteRoutes(_ *x.WriteRouter) {} @@ -73,7 +76,7 @@ type getCheckRequest struct { MaxDepth int `json:"max-depth"` } -// swagger:route GET /relation-tuples/check read getCheckInlineResponse2001 +// swagger:route GET /relation-tuples/check/openapi read getCheck // // Check a relation tuple // @@ -116,7 +119,21 @@ func (h *Handler) getCheckMirrorStatus(w http.ResponseWriter, r *http.Request, _ h.d.Writer().WriteCode(w, r, http.StatusForbidden, &RESTResponse{Allowed: allowed}) } -// swagger:route POST /relation-tuples/check read postCheck +func (h *Handler) getCheck(ctx context.Context, q url.Values) (bool, error) { + maxDepth, err := x.GetMaxDepthFromQuery(q) + if err != nil { + return false, err + } + + tuple, err := (&relationtuple.InternalRelationTuple{}).FromURLQuery(q) + if err != nil { + return false, err + } + + return h.d.PermissionEngine().SubjectIsAllowed(ctx, tuple, maxDepth) +} + +// swagger:route POST /relation-tuples/check/openapi read postCheck // // Check a relation tuple // diff --git a/internal/check/handler_test.go b/internal/check/handler_test.go index 759180ba4..bada52cae 100644 --- a/internal/check/handler_test.go +++ b/internal/check/handler_test.go @@ -30,7 +30,9 @@ func assertAllowed(t *testing.T, resp *http.Response) { assert.True(t, gjson.GetBytes(body, "allowed").Bool()) } -func assertDenied(t *testing.T, resp *http.Response) { +type responseAssertion func(t *testing.T, resp *http.Response) + +func baseAssertDenied(t *testing.T, resp *http.Response) { body, err := io.ReadAll(resp.Body) require.NoError(t, err) @@ -38,6 +40,16 @@ func assertDenied(t *testing.T, resp *http.Response) { assert.False(t, gjson.GetBytes(body, "allowed").Bool()) } +// For OpenAPI clients, we want to always regurn a 200 status code even if the +// check returned "denied". +func openAPIAssertDenied(t *testing.T, resp *http.Response) { + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + + assert.Equal(t, http.StatusOK, resp.StatusCode, "%s", body) + assert.False(t, gjson.GetBytes(body, "allowed").Bool()) +} + func TestRESTHandler(t *testing.T) { nspaces := []*namespace.Namespace{{ Name: "check handler", @@ -51,69 +63,82 @@ func TestRESTHandler(t *testing.T) { ts := httptest.NewServer(r) defer ts.Close() - t.Run("case=returns bad request on malformed int", func(t *testing.T) { - resp, err := ts.Client().Get(ts.URL + check.RouteBase + "?max-depth=foo") - require.NoError(t, err) - - assert.Equal(t, http.StatusBadRequest, resp.StatusCode) - body, err := io.ReadAll(resp.Body) - require.NoError(t, err) - assert.Contains(t, string(body), "invalid syntax") - }) - - t.Run("case=returns bad request on malformed input", func(t *testing.T) { - resp, err := ts.Client().Get(ts.URL + check.RouteBase + "?" + url.Values{ - "subject": {"not#a valid userset rewrite"}, - }.Encode()) - require.NoError(t, err) - - assert.Equal(t, http.StatusBadRequest, resp.StatusCode) - }) - - t.Run("case=returns bad request on missing subject", func(t *testing.T) { - resp, err := ts.Client().Get(ts.URL + check.RouteBase) - require.NoError(t, err) - - assert.Equal(t, http.StatusBadRequest, resp.StatusCode) - body, err := io.ReadAll(resp.Body) - require.NoError(t, err) - assert.Contains(t, string(body), "Please provide a subject") - }) - - t.Run("case=returns denied on unknown namespace", func(t *testing.T) { - resp, err := ts.Client().Get(ts.URL + check.RouteBase + "?" + url.Values{ - "namespace": {"not " + nspaces[0].Name}, - "subject_id": {"foo"}, - }.Encode()) - require.NoError(t, err) - - assertDenied(t, resp) - }) - - t.Run("case=returns allowed", func(t *testing.T) { - rt := &relationtuple.InternalRelationTuple{ - Namespace: nspaces[0].Name, - Object: "o", - Relation: "r", - Subject: &relationtuple.SubjectID{ID: "s"}, - } - require.NoError(t, reg.RelationTupleManager().WriteRelationTuples(context.Background(), rt)) - - q, err := rt.ToURLQuery() - require.NoError(t, err) - resp, err := ts.Client().Get(ts.URL + check.RouteBase + "?" + q.Encode()) - require.NoError(t, err) - - assertAllowed(t, resp) - }) - - t.Run("case=returns denied", func(t *testing.T) { - resp, err := ts.Client().Get(ts.URL + check.RouteBase + "?" + url.Values{ - "namespace": {nspaces[0].Name}, - "subject_id": {"foo"}, - }.Encode()) - require.NoError(t, err) - - assertDenied(t, resp) - }) + for _, suite := range []struct { + name string + base string + assertDenied responseAssertion + }{ + {name: "base", base: check.RouteBase, assertDenied: baseAssertDenied}, + {name: "openapi", base: check.OpenAPIRouteBase, assertDenied: openAPIAssertDenied}, + } { + t.Run("suite="+suite.name, func(t *testing.T) { + assertDenied := suite.assertDenied + + t.Run("case=returns bad request on malformed int", func(t *testing.T) { + resp, err := ts.Client().Get(ts.URL + suite.base + "?max-depth=foo") + require.NoError(t, err) + + assert.Equal(t, http.StatusBadRequest, resp.StatusCode) + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + assert.Contains(t, string(body), "invalid syntax") + }) + + t.Run("case=returns bad request on malformed input", func(t *testing.T) { + resp, err := ts.Client().Get(ts.URL + suite.base + "?" + url.Values{ + "subject": {"not#a valid userset rewrite"}, + }.Encode()) + require.NoError(t, err) + + assert.Equal(t, http.StatusBadRequest, resp.StatusCode) + }) + + t.Run("case=returns bad request on missing subject", func(t *testing.T) { + resp, err := ts.Client().Get(ts.URL + suite.base) + require.NoError(t, err) + + assert.Equal(t, http.StatusBadRequest, resp.StatusCode) + body, err := io.ReadAll(resp.Body) + require.NoError(t, err) + assert.Contains(t, string(body), "Please provide a subject") + }) + + t.Run("case=returns denied on unknown namespace", func(t *testing.T) { + resp, err := ts.Client().Get(ts.URL + suite.base + "?" + url.Values{ + "namespace": {"not " + nspaces[0].Name}, + "subject_id": {"foo"}, + }.Encode()) + require.NoError(t, err) + + assertDenied(t, resp) + }) + + t.Run("case=returns allowed", func(t *testing.T) { + rt := &relationtuple.InternalRelationTuple{ + Namespace: nspaces[0].Name, + Object: "o", + Relation: "r", + Subject: &relationtuple.SubjectID{ID: "s"}, + } + require.NoError(t, reg.RelationTupleManager().WriteRelationTuples(context.Background(), rt)) + + q, err := rt.ToURLQuery() + require.NoError(t, err) + resp, err := ts.Client().Get(ts.URL + suite.base + "?" + q.Encode()) + require.NoError(t, err) + + assertAllowed(t, resp) + }) + + t.Run("case=returns denied", func(t *testing.T) { + resp, err := ts.Client().Get(ts.URL + suite.base + "?" + url.Values{ + "namespace": {nspaces[0].Name}, + "subject_id": {"foo"}, + }.Encode()) + require.NoError(t, err) + + assertDenied(t, resp) + }) + }) + } } diff --git a/main.go b/main.go index ef467b1b7..4eb698313 100644 --- a/main.go +++ b/main.go @@ -1,4 +1,4 @@ -//go:generate swagger generate spec +//go:generate .bin/swagger generate spec // Copyright © 2017 Aeneas Rekkas // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/spec/api.json b/spec/api.json index 1414fe435..96a8e0787 100755 --- a/spec/api.json +++ b/spec/api.json @@ -149,7 +149,7 @@ } }, "required": ["allowed"], - "title": "RESTResponse is the response for a check request.", + "title": "RESTResponse represents the response for a check request.", "type": "object" }, "getRelationTuplesResponse": { @@ -605,7 +605,7 @@ "tags": ["read"] } }, - "/relation-tuples/check": { + "/relation-tuples/check/openapi": { "get": { "description": "To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).", "operationId": "getCheck", diff --git a/spec/swagger.json b/spec/swagger.json index c9543f9e6..f484d1f8f 100755 --- a/spec/swagger.json +++ b/spec/swagger.json @@ -305,7 +305,7 @@ } } }, - "/relation-tuples/check": { + "/relation-tuples/check/openapi": { "get": { "description": "To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).", "consumes": ["application/x-www-form-urlencoded"], @@ -660,7 +660,7 @@ "getCheckResponse": { "description": "The content of the allowed field is mirrored in the HTTP status code.", "type": "object", - "title": "RESTResponse is the response for a check request.", + "title": "RESTResponse represents the response for a check request.", "required": ["allowed"], "properties": { "allowed": { From 4651425a24c087c567f31204d5853bb5c12b0f72 Mon Sep 17 00:00:00 2001 From: hperl <34397+hperl@users.noreply.github.com> Date: Mon, 13 Jun 2022 15:54:00 +0200 Subject: [PATCH 5/6] chore: update sdk --- README.md | 69 +- internal/httpclient-next/.gitignore | 24 - .../httpclient-next/.openapi-generator-ignore | 23 - .../httpclient-next/.openapi-generator/FILES | 46 - .../.openapi-generator/VERSION | 1 - internal/httpclient-next/.travis.yml | 7 - internal/httpclient-next/README.md | 136 --- internal/httpclient-next/api/openapi.yaml | 806 ------------------ internal/httpclient-next/api_metadata.go | 434 ---------- internal/httpclient-next/api_read.go | 787 ----------------- internal/httpclient-next/api_write.go | 492 ----------- internal/httpclient-next/client.go | 547 ------------ internal/httpclient-next/configuration.go | 230 ----- internal/httpclient-next/docs/ExpandTree.md | 129 --- internal/httpclient-next/docs/GenericError.md | 186 ---- .../httpclient-next/docs/GetCheckResponse.md | 51 -- .../docs/GetRelationTuplesResponse.md | 82 -- .../docs/HealthNotReadyStatus.md | 56 -- internal/httpclient-next/docs/HealthStatus.md | 56 -- .../httpclient-next/docs/InlineResponse200.md | 51 -- .../docs/InlineResponse2001.md | 51 -- .../httpclient-next/docs/InlineResponse503.md | 51 -- .../docs/InternalRelationTuple.md | 145 ---- internal/httpclient-next/docs/MetadataApi.md | 194 ----- internal/httpclient-next/docs/PatchDelta.md | 82 -- internal/httpclient-next/docs/ReadApi.md | 314 ------- .../httpclient-next/docs/RelationQuery.md | 160 ---- internal/httpclient-next/docs/SubjectSet.md | 93 -- internal/httpclient-next/docs/Version.md | 56 -- internal/httpclient-next/docs/WriteApi.md | 217 ----- internal/httpclient-next/git_push.sh | 58 -- internal/httpclient-next/go.mod | 7 - internal/httpclient-next/go.sum | 13 - internal/httpclient-next/model_expand_tree.go | 215 ----- .../httpclient-next/model_generic_error.go | 294 ------- .../model_get_check_response.go | 108 --- .../model_get_relation_tuples_response.go | 151 ---- .../model_health_not_ready_status.go | 115 --- .../httpclient-next/model_health_status.go | 115 --- .../model_inline_response_200.go | 108 --- .../model_inline_response_200_1.go | 108 --- .../model_inline_response_503.go | 108 --- .../model_internal_relation_tuple.go | 241 ------ internal/httpclient-next/model_patch_delta.go | 150 ---- .../httpclient-next/model_relation_query.go | 262 ------ internal/httpclient-next/model_subject_set.go | 168 ---- internal/httpclient-next/model_version.go | 115 --- internal/httpclient-next/response.go | 48 -- internal/httpclient-next/utils.go | 329 ------- .../client/read/get_check_responses.go | 8 +- .../client/read/post_check_responses.go | 8 +- .../httpclient/client/read/read_client.go | 4 +- .../httpclient/models/get_check_response.go | 2 +- 53 files changed, 53 insertions(+), 8258 deletions(-) delete mode 100644 internal/httpclient-next/.gitignore delete mode 100644 internal/httpclient-next/.openapi-generator-ignore delete mode 100644 internal/httpclient-next/.openapi-generator/FILES delete mode 100644 internal/httpclient-next/.openapi-generator/VERSION delete mode 100644 internal/httpclient-next/.travis.yml delete mode 100644 internal/httpclient-next/README.md delete mode 100644 internal/httpclient-next/api/openapi.yaml delete mode 100644 internal/httpclient-next/api_metadata.go delete mode 100644 internal/httpclient-next/api_read.go delete mode 100644 internal/httpclient-next/api_write.go delete mode 100644 internal/httpclient-next/client.go delete mode 100644 internal/httpclient-next/configuration.go delete mode 100644 internal/httpclient-next/docs/ExpandTree.md delete mode 100644 internal/httpclient-next/docs/GenericError.md delete mode 100644 internal/httpclient-next/docs/GetCheckResponse.md delete mode 100644 internal/httpclient-next/docs/GetRelationTuplesResponse.md delete mode 100644 internal/httpclient-next/docs/HealthNotReadyStatus.md delete mode 100644 internal/httpclient-next/docs/HealthStatus.md delete mode 100644 internal/httpclient-next/docs/InlineResponse200.md delete mode 100644 internal/httpclient-next/docs/InlineResponse2001.md delete mode 100644 internal/httpclient-next/docs/InlineResponse503.md delete mode 100644 internal/httpclient-next/docs/InternalRelationTuple.md delete mode 100644 internal/httpclient-next/docs/MetadataApi.md delete mode 100644 internal/httpclient-next/docs/PatchDelta.md delete mode 100644 internal/httpclient-next/docs/ReadApi.md delete mode 100644 internal/httpclient-next/docs/RelationQuery.md delete mode 100644 internal/httpclient-next/docs/SubjectSet.md delete mode 100644 internal/httpclient-next/docs/Version.md delete mode 100644 internal/httpclient-next/docs/WriteApi.md delete mode 100644 internal/httpclient-next/git_push.sh delete mode 100644 internal/httpclient-next/go.mod delete mode 100644 internal/httpclient-next/go.sum delete mode 100644 internal/httpclient-next/model_expand_tree.go delete mode 100644 internal/httpclient-next/model_generic_error.go delete mode 100644 internal/httpclient-next/model_get_check_response.go delete mode 100644 internal/httpclient-next/model_get_relation_tuples_response.go delete mode 100644 internal/httpclient-next/model_health_not_ready_status.go delete mode 100644 internal/httpclient-next/model_health_status.go delete mode 100644 internal/httpclient-next/model_inline_response_200.go delete mode 100644 internal/httpclient-next/model_inline_response_200_1.go delete mode 100644 internal/httpclient-next/model_inline_response_503.go delete mode 100644 internal/httpclient-next/model_internal_relation_tuple.go delete mode 100644 internal/httpclient-next/model_patch_delta.go delete mode 100644 internal/httpclient-next/model_relation_query.go delete mode 100644 internal/httpclient-next/model_subject_set.go delete mode 100644 internal/httpclient-next/model_version.go delete mode 100644 internal/httpclient-next/response.go delete mode 100644 internal/httpclient-next/utils.go diff --git a/README.md b/README.md index b4859afe6..ec05fa08b 100644 --- a/README.md +++ b/README.md @@ -96,17 +96,21 @@ An overview of what is implemented and upcoming can be found at -The Ory community stands on the shoulders of individuals, companies, and maintainers. We thank everyone involved - from submitting -bug reports and feature requests, to contributing patches, to sponsoring our work. Our community is 1000+ strong and growing -rapidly. The Ory stack protects 16.000.000.000+ API requests every month with over 250.000+ active service nodes. We would have +The Ory community stands on the shoulders of individuals, companies, and +maintainers. We thank everyone involved - from submitting bug reports and +feature requests, to contributing patches, to sponsoring our work. Our community +is 1000+ strong and growing rapidly. The Ory stack protects 16.000.000.000+ API +requests every month with over 250.000+ active service nodes. We would have never been able to achieve this without each and everyone of you! -The following list represents companies that have accompanied us along the way and that have made outstanding contributions to our -ecosystem. _If you think that your company deserves a spot here, reach out to +The following list represents companies that have accompanied us along the way +and that have made outstanding contributions to our ecosystem. _If you think +that your company deserves a spot here, reach out to office-muc@ory.sh now_! -**Please consider giving back by becoming a sponsor of our open source work on Patreon -or Open Collective.** +**Please consider giving back by becoming a sponsor of our open source work on +Patreon or +Open Collective.** @@ -273,8 +277,10 @@ as well as all of our backers -and past & current supporters (in alphabetical order) on [Patreon](https://www.patreon.com/_ory): Alexander Alimovs, Billy, Chancy -Kennedy, Drozzy, Edwin Trejos, Howard Edidin, Ken Adler Oz Haven, Stefan Hans, TheCrealm. +and past & current supporters (in alphabetical order) on +[Patreon](https://www.patreon.com/_ory): Alexander Alimovs, Billy, Chancy +Kennedy, Drozzy, Edwin Trejos, Howard Edidin, Ken Adler Oz Haven, Stefan Hans, +TheCrealm. \* Uses one of Ory's major projects in production. @@ -288,42 +294,51 @@ Head over to the documentation to learn about ways of [installing ORY Keto](http -We build Ory on several guiding principles when it comes to our architecture design: +We build Ory on several guiding principles when it comes to our architecture +design: - Minimal dependencies - Runs everywhere - Scales without effort - Minimize room for human and network errors -Ory's architecture is designed to run best on a Container Orchestration system such as Kubernetes, CloudFoundry, OpenShift, and -similar projects. Binaries are small (5-15MB) and available for all popular processor types (ARM, AMD64, i386) and operating -systems (FreeBSD, Linux, macOS, Windows) without system dependencies (Java, Node, Ruby, libxml, ...). +Ory's architecture is designed to run best on a Container Orchestration system +such as Kubernetes, CloudFoundry, OpenShift, and similar projects. Binaries are +small (5-15MB) and available for all popular processor types (ARM, AMD64, i386) +and operating systems (FreeBSD, Linux, macOS, Windows) without system +dependencies (Java, Node, Ruby, libxml, ...). ### Ory Kratos: Identity and User Infrastructure and Management -[Ory Kratos](https://github.com/ory/kratos) is an API-first Identity and User Management system that is built according to -[cloud architecture best practices](https://www.ory.sh/docs/next/ecosystem/software-architecture-philosophy). It implements core -use cases that almost every software application needs to deal with: Self-service Login and Registration, Multi-Factor -Authentication (MFA/2FA), Account Recovery and Verification, Profile, and Account Management. +[Ory Kratos](https://github.com/ory/kratos) is an API-first Identity and User +Management system that is built according to +[cloud architecture best practices](https://www.ory.sh/docs/next/ecosystem/software-architecture-philosophy). +It implements core use cases that almost every software application needs to +deal with: Self-service Login and Registration, Multi-Factor Authentication +(MFA/2FA), Account Recovery and Verification, Profile, and Account Management. ### Ory Hydra: OAuth2 & OpenID Connect Server -[Ory Hydra](https://github.com/ory/hydra) is an OpenID Certified™ OAuth2 and OpenID Connect Provider which easily connects to any -existing identity system by writing a tiny "bridge" application. Gives absolute control over user interface and user experience -flows. +[Ory Hydra](https://github.com/ory/hydra) is an OpenID Certified™ OAuth2 and +OpenID Connect Provider which easily connects to any existing identity system by +writing a tiny "bridge" application. Gives absolute control over user interface +and user experience flows. ### Ory Oathkeeper: Identity & Access Proxy -[Ory Oathkeeper](https://github.com/ory/oathkeeper) is a BeyondCorp/Zero Trust Identity & Access Proxy (IAP) with configurable -authentication, authorization, and request mutation rules for your web services: Authenticate JWT, Access Tokens, API Keys, mTLS; -Check if the contained subject is allowed to perform the request; Encode resulting content into custom headers (`X-User-ID`), JSON -Web Tokens and more! +[Ory Oathkeeper](https://github.com/ory/oathkeeper) is a BeyondCorp/Zero Trust +Identity & Access Proxy (IAP) with configurable authentication, authorization, +and request mutation rules for your web services: Authenticate JWT, Access +Tokens, API Keys, mTLS; Check if the contained subject is allowed to perform the +request; Encode resulting content into custom headers (`X-User-ID`), JSON Web +Tokens and more! ### Ory Keto: Access Control Policies as a Server -[Ory Keto](https://github.com/ory/keto) is a policy decision point. It uses a set of access control policies, similar to AWS IAM -Policies, in order to determine whether a subject (user, application, service, car, ...) is authorized to perform a certain action -on a resource. +[Ory Keto](https://github.com/ory/keto) is a policy decision point. It uses a +set of access control policies, similar to AWS IAM Policies, in order to +determine whether a subject (user, application, service, car, ...) is authorized +to perform a certain action on a resource. diff --git a/internal/httpclient-next/.gitignore b/internal/httpclient-next/.gitignore deleted file mode 100644 index daf913b1b..000000000 --- a/internal/httpclient-next/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/internal/httpclient-next/.openapi-generator-ignore b/internal/httpclient-next/.openapi-generator-ignore deleted file mode 100644 index 7484ee590..000000000 --- a/internal/httpclient-next/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/internal/httpclient-next/.openapi-generator/FILES b/internal/httpclient-next/.openapi-generator/FILES deleted file mode 100644 index 185d02428..000000000 --- a/internal/httpclient-next/.openapi-generator/FILES +++ /dev/null @@ -1,46 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -README.md -api/openapi.yaml -api_metadata.go -api_read.go -api_write.go -client.go -configuration.go -docs/ExpandTree.md -docs/GenericError.md -docs/GetCheckResponse.md -docs/GetRelationTuplesResponse.md -docs/HealthNotReadyStatus.md -docs/HealthStatus.md -docs/InlineResponse200.md -docs/InlineResponse2001.md -docs/InlineResponse503.md -docs/InternalRelationTuple.md -docs/MetadataApi.md -docs/PatchDelta.md -docs/ReadApi.md -docs/RelationQuery.md -docs/SubjectSet.md -docs/Version.md -docs/WriteApi.md -git_push.sh -go.mod -go.sum -model_expand_tree.go -model_generic_error.go -model_get_check_response.go -model_get_relation_tuples_response.go -model_health_not_ready_status.go -model_health_status.go -model_inline_response_200.go -model_inline_response_200_1.go -model_inline_response_503.go -model_internal_relation_tuple.go -model_patch_delta.go -model_relation_query.go -model_subject_set.go -model_version.go -response.go -utils.go diff --git a/internal/httpclient-next/.openapi-generator/VERSION b/internal/httpclient-next/.openapi-generator/VERSION deleted file mode 100644 index 804440660..000000000 --- a/internal/httpclient-next/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.2.1 \ No newline at end of file diff --git a/internal/httpclient-next/.travis.yml b/internal/httpclient-next/.travis.yml deleted file mode 100644 index 755978dca..000000000 --- a/internal/httpclient-next/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: go - -install: - - go get -d -v . - -script: - - go build -v ./ diff --git a/internal/httpclient-next/README.md b/internal/httpclient-next/README.md deleted file mode 100644 index 59bc74698..000000000 --- a/internal/httpclient-next/README.md +++ /dev/null @@ -1,136 +0,0 @@ -# Go API client for client - -Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.GoClientCodegen - -## Installation - -Install the following dependencies: - -```shell -go get github.com/stretchr/testify/assert -go get golang.org/x/oauth2 -go get golang.org/x/net/context -``` - -Put the package under your project folder and add the following in import: - -```golang -import client "github.com/ory/keto-client-go" -``` - -To use a proxy, set the environment variable `HTTP_PROXY`: - -```golang -os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") -``` - -## Configuration of Server URL - -Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. - -### Select Server Configuration - -For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. - -```golang -ctx := context.WithValue(context.Background(), client.ContextServerIndex, 1) -``` - -### Templated Server URL - -Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. - -```golang -ctx := context.WithValue(context.Background(), client.ContextServerVariables, map[string]string{ - "basePath": "v2", -}) -``` - -Note, enum values are always validated and all unused variables are silently ignored. - -### URLs Configuration per Operation - -Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. -An operation is uniquely identifield by `"{classname}Service.{nickname}"` string. -Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. - -``` -ctx := context.WithValue(context.Background(), client.ContextOperationServerIndices, map[string]int{ - "{classname}Service.{nickname}": 2, -}) -ctx = context.WithValue(context.Background(), client.ContextOperationServerVariables, map[string]map[string]string{ - "{classname}Service.{nickname}": { - "port": "8443", - }, -}) -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://localhost* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*MetadataApi* | [**GetVersion**](docs/MetadataApi.md#getversion) | **Get** /version | Return Running Software Version. -*MetadataApi* | [**IsAlive**](docs/MetadataApi.md#isalive) | **Get** /health/alive | Check HTTP Server Status -*MetadataApi* | [**IsReady**](docs/MetadataApi.md#isready) | **Get** /health/ready | Check HTTP Server and Database Status -*ReadApi* | [**GetCheck**](docs/ReadApi.md#getcheck) | **Get** /relation-tuples/check | Check a relation tuple -*ReadApi* | [**GetExpand**](docs/ReadApi.md#getexpand) | **Get** /relation-tuples/expand | Expand a Relation Tuple -*ReadApi* | [**GetRelationTuples**](docs/ReadApi.md#getrelationtuples) | **Get** /relation-tuples | Query relation tuples -*ReadApi* | [**PostCheck**](docs/ReadApi.md#postcheck) | **Post** /relation-tuples/check | Check a relation tuple -*WriteApi* | [**CreateRelationTuple**](docs/WriteApi.md#createrelationtuple) | **Put** /admin/relation-tuples | Create a Relation Tuple -*WriteApi* | [**DeleteRelationTuples**](docs/WriteApi.md#deleterelationtuples) | **Delete** /admin/relation-tuples | Delete Relation Tuples -*WriteApi* | [**PatchRelationTuples**](docs/WriteApi.md#patchrelationtuples) | **Patch** /admin/relation-tuples | Patch Multiple Relation Tuples - - -## Documentation For Models - - - [ExpandTree](docs/ExpandTree.md) - - [GenericError](docs/GenericError.md) - - [GetCheckResponse](docs/GetCheckResponse.md) - - [GetRelationTuplesResponse](docs/GetRelationTuplesResponse.md) - - [HealthNotReadyStatus](docs/HealthNotReadyStatus.md) - - [HealthStatus](docs/HealthStatus.md) - - [InlineResponse200](docs/InlineResponse200.md) - - [InlineResponse2001](docs/InlineResponse2001.md) - - [InlineResponse503](docs/InlineResponse503.md) - - [InternalRelationTuple](docs/InternalRelationTuple.md) - - [PatchDelta](docs/PatchDelta.md) - - [RelationQuery](docs/RelationQuery.md) - - [SubjectSet](docs/SubjectSet.md) - - [Version](docs/Version.md) - - -## Documentation For Authorization - - Endpoints do not require authorization. - - -## Documentation for Utility Methods - -Due to the fact that model structure members are all pointers, this package contains -a number of utility functions to easily obtain pointers to values of basic types. -Each of these functions takes a value of the given basic type and returns a pointer to it: - -* `PtrBool` -* `PtrInt` -* `PtrInt32` -* `PtrInt64` -* `PtrFloat` -* `PtrFloat32` -* `PtrFloat64` -* `PtrString` -* `PtrTime` - -## Author - -hi@ory.sh - diff --git a/internal/httpclient-next/api/openapi.yaml b/internal/httpclient-next/api/openapi.yaml deleted file mode 100644 index a57e95b40..000000000 --- a/internal/httpclient-next/api/openapi.yaml +++ /dev/null @@ -1,806 +0,0 @@ -openapi: 3.0.3 -info: - contact: - email: hi@ory.sh - description: | - Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - license: - name: Apache 2.0 - title: Ory Keto API -servers: -- url: / -paths: - /admin/relation-tuples: - delete: - description: Use this endpoint to delete relation tuples - operationId: deleteRelationTuples - parameters: - - description: Namespace of the Relation Tuple - explode: true - in: query - name: namespace - required: false - schema: - type: string - style: form - - description: Object of the Relation Tuple - explode: true - in: query - name: object - required: false - schema: - type: string - style: form - - description: Relation of the Relation Tuple - explode: true - in: query - name: relation - required: false - schema: - type: string - style: form - - description: SubjectID of the Relation Tuple - explode: true - in: query - name: subject_id - required: false - schema: - type: string - style: form - - description: Namespace of the Subject Set - explode: true - in: query - name: subject_set.namespace - required: false - schema: - type: string - style: form - - description: Object of the Subject Set - explode: true - in: query - name: subject_set.object - required: false - schema: - type: string - style: form - - description: Relation of the Subject Set - explode: true - in: query - name: subject_set.relation - required: false - schema: - type: string - style: form - responses: - "204": - description: Empty responses are sent when, for example, resources are deleted. - The HTTP status code for empty responses is typically 201. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - summary: Delete Relation Tuples - tags: - - write - patch: - description: Use this endpoint to patch one or more relation tuples. - operationId: patchRelationTuples - requestBody: - content: - application/json: - schema: - items: - $ref: '#/components/schemas/PatchDelta' - type: array - x-originalParamName: Payload - responses: - "204": - description: Empty responses are sent when, for example, resources are deleted. - The HTTP status code for empty responses is typically 201. - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - summary: Patch Multiple Relation Tuples - tags: - - write - put: - description: Use this endpoint to create a relation tuple. - operationId: createRelationTuple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RelationQuery' - x-originalParamName: Payload - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/RelationQuery' - description: RelationQuery - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - summary: Create a Relation Tuple - tags: - - write - /health/alive: - get: - description: |- - This endpoint returns a HTTP 200 status code when Ory Keto is accepting incoming - HTTP requests. This status does currently not include checks whether the database connection is working. - - If the service supports TLS Edge Termination, this endpoint does not require the - `X-Forwarded-Proto` header to be set. - - Be aware that if you are running multiple nodes of this service, the health status will never - refer to the cluster state, only to a single instance. - operationId: isAlive - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/inline_response_200' - description: Ory Keto is ready to accept connections. - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - summary: Check HTTP Server Status - tags: - - metadata - /health/ready: - get: - description: |- - This endpoint returns a HTTP 200 status code when Ory Keto is up running and the environment dependencies (e.g. - the database) are responsive as well. - - If the service supports TLS Edge Termination, this endpoint does not require the - `X-Forwarded-Proto` header to be set. - - Be aware that if you are running multiple nodes of Ory Keto, the health status will never - refer to the cluster state, only to a single instance. - operationId: isReady - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/inline_response_200' - description: Ory Keto is ready to accept requests. - "503": - content: - application/json: - schema: - $ref: '#/components/schemas/inline_response_503' - description: Ory Kratos is not yet ready to accept requests. - summary: Check HTTP Server and Database Status - tags: - - metadata - /relation-tuples: - get: - description: Get all relation tuples that match the query. Only the namespace - field is required. - operationId: getRelationTuples - parameters: - - explode: true - in: query - name: page_token - required: false - schema: - type: string - style: form - - explode: true - in: query - name: page_size - required: false - schema: - format: int64 - type: integer - style: form - - description: Namespace of the Relation Tuple - explode: true - in: query - name: namespace - required: false - schema: - type: string - style: form - - description: Object of the Relation Tuple - explode: true - in: query - name: object - required: false - schema: - type: string - style: form - - description: Relation of the Relation Tuple - explode: true - in: query - name: relation - required: false - schema: - type: string - style: form - - description: SubjectID of the Relation Tuple - explode: true - in: query - name: subject_id - required: false - schema: - type: string - style: form - - description: Namespace of the Subject Set - explode: true - in: query - name: subject_set.namespace - required: false - schema: - type: string - style: form - - description: Object of the Subject Set - explode: true - in: query - name: subject_set.object - required: false - schema: - type: string - style: form - - description: Relation of the Subject Set - explode: true - in: query - name: subject_set.relation - required: false - schema: - type: string - style: form - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/getRelationTuplesResponse' - description: getRelationTuplesResponse - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - summary: Query relation tuples - tags: - - read - /relation-tuples/check: - get: - description: To learn how relation tuples and the check works, head over to - [the documentation](../concepts/relation-tuples.mdx). - operationId: getCheck - parameters: - - description: Namespace of the Relation Tuple - explode: true - in: query - name: namespace - required: false - schema: - type: string - style: form - - description: Object of the Relation Tuple - explode: true - in: query - name: object - required: false - schema: - type: string - style: form - - description: Relation of the Relation Tuple - explode: true - in: query - name: relation - required: false - schema: - type: string - style: form - - description: SubjectID of the Relation Tuple - explode: true - in: query - name: subject_id - required: false - schema: - type: string - style: form - - description: Namespace of the Subject Set - explode: true - in: query - name: subject_set.namespace - required: false - schema: - type: string - style: form - - description: Object of the Subject Set - explode: true - in: query - name: subject_set.object - required: false - schema: - type: string - style: form - - description: Relation of the Subject Set - explode: true - in: query - name: subject_set.relation - required: false - schema: - type: string - style: form - - explode: true - in: query - name: max-depth - required: false - schema: - format: int64 - type: integer - style: form - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/getCheckResponse' - description: getCheckResponse - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/getCheckResponse' - description: getCheckResponse - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - summary: Check a relation tuple - tags: - - read - post: - description: To learn how relation tuples and the check works, head over to - [the documentation](../concepts/relation-tuples.mdx). - operationId: postCheck - parameters: - - explode: true - in: query - name: max-depth - required: false - schema: - format: int64 - type: integer - style: form - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RelationQuery' - x-originalParamName: Payload - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/getCheckResponse' - description: getCheckResponse - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - "403": - content: - application/json: - schema: - $ref: '#/components/schemas/getCheckResponse' - description: getCheckResponse - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - summary: Check a relation tuple - tags: - - read - /relation-tuples/expand: - get: - description: Use this endpoint to expand a relation tuple. - operationId: getExpand - parameters: - - description: Namespace of the Subject Set - explode: true - in: query - name: namespace - required: true - schema: - type: string - style: form - - description: Object of the Subject Set - explode: true - in: query - name: object - required: true - schema: - type: string - style: form - - description: Relation of the Subject Set - explode: true - in: query - name: relation - required: true - schema: - type: string - style: form - - explode: true - in: query - name: max-depth - required: false - schema: - format: int64 - type: integer - style: form - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/expandTree' - description: expandTree - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - "404": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/genericError' - description: genericError - summary: Expand a Relation Tuple - tags: - - read - /version: - get: - description: |- - This endpoint returns the version of Ory Keto. - - If the service supports TLS Edge Termination, this endpoint does not require the - `X-Forwarded-Proto` header to be set. - - Be aware that if you are running multiple nodes of this service, the version will never - refer to the cluster state, only to a single instance. - operationId: getVersion - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/inline_response_200_1' - description: Returns the Ory Keto version. - summary: Return Running Software Version. - tags: - - metadata -components: - responses: - emptyResponse: - description: Empty responses are sent when, for example, resources are deleted. - The HTTP status code for empty responses is typically 201. - schemas: - InternalRelationTuple: - example: - subject_id: subject_id - namespace: namespace - object: object - relation: relation - subject_set: - namespace: namespace - object: object - relation: relation - properties: - namespace: - description: Namespace of the Relation Tuple - type: string - object: - description: Object of the Relation Tuple - type: string - relation: - description: Relation of the Relation Tuple - type: string - subject_id: - description: |- - SubjectID of the Relation Tuple - - Either SubjectSet or SubjectID are required. - type: string - subject_set: - $ref: '#/components/schemas/SubjectSet' - required: - - namespace - - object - - relation - type: object - PatchDelta: - example: - relation_tuple: - subject_id: subject_id - namespace: namespace - object: object - relation: relation - subject_set: - namespace: namespace - object: object - relation: relation - action: insert - properties: - action: - enum: - - insert - - delete - type: string - relation_tuple: - $ref: '#/components/schemas/InternalRelationTuple' - type: object - RelationQuery: - example: - subject_id: subject_id - namespace: namespace - object: object - relation: relation - subject_set: - namespace: namespace - object: object - relation: relation - properties: - namespace: - description: Namespace of the Relation Tuple - type: string - object: - description: Object of the Relation Tuple - type: string - relation: - description: Relation of the Relation Tuple - type: string - subject_id: - description: |- - SubjectID of the Relation Tuple - - Either SubjectSet or SubjectID can be provided. - type: string - subject_set: - $ref: '#/components/schemas/SubjectSet' - type: object - SubjectSet: - example: - namespace: namespace - object: object - relation: relation - properties: - namespace: - description: Namespace of the Subject Set - type: string - object: - description: Object of the Subject Set - type: string - relation: - description: Relation of the Subject Set - type: string - required: - - namespace - - object - - relation - type: object - UUID: - format: uuid4 - type: string - expandTree: - example: - subject_id: subject_id - children: - - null - - null - type: union - subject_set: - namespace: namespace - object: object - relation: relation - properties: - children: - items: - $ref: '#/components/schemas/expandTree' - type: array - subject_id: - type: string - subject_set: - $ref: '#/components/schemas/SubjectSet' - type: - enum: - - union - - exclusion - - intersection - - leaf - type: string - required: - - type - type: object - genericError: - description: The standard error format - properties: - code: - format: int64 - type: integer - details: - items: - additionalProperties: true - type: object - type: array - message: - type: string - reason: - type: string - request: - type: string - status: - type: string - type: object - getCheckResponse: - description: The content of the allowed field is mirrored in the HTTP status - code. - example: - allowed: true - properties: - allowed: - description: whether the relation tuple is allowed - type: boolean - required: - - allowed - title: RESTResponse is the response for a check request. - type: object - getRelationTuplesResponse: - example: - next_page_token: next_page_token - relation_tuples: - - subject_id: subject_id - namespace: namespace - object: object - relation: relation - subject_set: - namespace: namespace - object: object - relation: relation - - subject_id: subject_id - namespace: namespace - object: object - relation: relation - subject_set: - namespace: namespace - object: object - relation: relation - properties: - next_page_token: - description: |- - The opaque token to provide in a subsequent request - to get the next page. It is the empty string iff this is - the last page. - type: string - relation_tuples: - items: - $ref: '#/components/schemas/InternalRelationTuple' - type: array - type: object - healthNotReadyStatus: - properties: - errors: - additionalProperties: - type: string - description: Errors contains a list of errors that caused the not ready - status. - type: object - type: object - healthStatus: - properties: - status: - description: Status always contains "ok". - type: string - type: object - subject: - type: object - version: - properties: - version: - description: Version is the service's version. - type: string - type: object - inline_response_200: - example: - status: status - properties: - status: - description: Always "ok". - type: string - required: - - status - type: object - inline_response_503: - properties: - errors: - additionalProperties: - type: string - description: Errors contains a list of errors that caused the not ready - status. - type: object - required: - - errors - type: object - inline_response_200_1: - example: - version: version - properties: - version: - description: The version of Ory Keto. - type: string - required: - - version - type: object diff --git a/internal/httpclient-next/api_metadata.go b/internal/httpclient-next/api_metadata.go deleted file mode 100644 index 1f3d0022b..000000000 --- a/internal/httpclient-next/api_metadata.go +++ /dev/null @@ -1,434 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "bytes" - "context" - "io/ioutil" - "net/http" - "net/url" -) - -// Linger please -var ( - _ context.Context -) - -type MetadataApi interface { - - /* - * GetVersion Return Running Software Version. - * This endpoint returns the version of Ory Keto. - - If the service supports TLS Edge Termination, this endpoint does not require the - `X-Forwarded-Proto` header to be set. - - Be aware that if you are running multiple nodes of this service, the version will never - refer to the cluster state, only to a single instance. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return MetadataApiApiGetVersionRequest - */ - GetVersion(ctx context.Context) MetadataApiApiGetVersionRequest - - /* - * GetVersionExecute executes the request - * @return InlineResponse2001 - */ - GetVersionExecute(r MetadataApiApiGetVersionRequest) (*InlineResponse2001, *http.Response, error) - - /* - * IsAlive Check HTTP Server Status - * This endpoint returns a HTTP 200 status code when Ory Keto is accepting incoming - HTTP requests. This status does currently not include checks whether the database connection is working. - - If the service supports TLS Edge Termination, this endpoint does not require the - `X-Forwarded-Proto` header to be set. - - Be aware that if you are running multiple nodes of this service, the health status will never - refer to the cluster state, only to a single instance. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return MetadataApiApiIsAliveRequest - */ - IsAlive(ctx context.Context) MetadataApiApiIsAliveRequest - - /* - * IsAliveExecute executes the request - * @return InlineResponse200 - */ - IsAliveExecute(r MetadataApiApiIsAliveRequest) (*InlineResponse200, *http.Response, error) - - /* - * IsReady Check HTTP Server and Database Status - * This endpoint returns a HTTP 200 status code when Ory Keto is up running and the environment dependencies (e.g. - the database) are responsive as well. - - If the service supports TLS Edge Termination, this endpoint does not require the - `X-Forwarded-Proto` header to be set. - - Be aware that if you are running multiple nodes of Ory Keto, the health status will never - refer to the cluster state, only to a single instance. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return MetadataApiApiIsReadyRequest - */ - IsReady(ctx context.Context) MetadataApiApiIsReadyRequest - - /* - * IsReadyExecute executes the request - * @return InlineResponse200 - */ - IsReadyExecute(r MetadataApiApiIsReadyRequest) (*InlineResponse200, *http.Response, error) -} - -// MetadataApiService MetadataApi service -type MetadataApiService service - -type MetadataApiApiGetVersionRequest struct { - ctx context.Context - ApiService MetadataApi -} - -func (r MetadataApiApiGetVersionRequest) Execute() (*InlineResponse2001, *http.Response, error) { - return r.ApiService.GetVersionExecute(r) -} - -/* - * GetVersion Return Running Software Version. - * This endpoint returns the version of Ory Keto. - -If the service supports TLS Edge Termination, this endpoint does not require the -`X-Forwarded-Proto` header to be set. - -Be aware that if you are running multiple nodes of this service, the version will never -refer to the cluster state, only to a single instance. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return MetadataApiApiGetVersionRequest -*/ -func (a *MetadataApiService) GetVersion(ctx context.Context) MetadataApiApiGetVersionRequest { - return MetadataApiApiGetVersionRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return InlineResponse2001 - */ -func (a *MetadataApiService) GetVersionExecute(r MetadataApiApiGetVersionRequest) (*InlineResponse2001, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue *InlineResponse2001 - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataApiService.GetVersion") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/version" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type MetadataApiApiIsAliveRequest struct { - ctx context.Context - ApiService MetadataApi -} - -func (r MetadataApiApiIsAliveRequest) Execute() (*InlineResponse200, *http.Response, error) { - return r.ApiService.IsAliveExecute(r) -} - -/* - * IsAlive Check HTTP Server Status - * This endpoint returns a HTTP 200 status code when Ory Keto is accepting incoming -HTTP requests. This status does currently not include checks whether the database connection is working. - -If the service supports TLS Edge Termination, this endpoint does not require the -`X-Forwarded-Proto` header to be set. - -Be aware that if you are running multiple nodes of this service, the health status will never -refer to the cluster state, only to a single instance. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return MetadataApiApiIsAliveRequest -*/ -func (a *MetadataApiService) IsAlive(ctx context.Context) MetadataApiApiIsAliveRequest { - return MetadataApiApiIsAliveRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return InlineResponse200 - */ -func (a *MetadataApiService) IsAliveExecute(r MetadataApiApiIsAliveRequest) (*InlineResponse200, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue *InlineResponse200 - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataApiService.IsAlive") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/health/alive" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type MetadataApiApiIsReadyRequest struct { - ctx context.Context - ApiService MetadataApi -} - -func (r MetadataApiApiIsReadyRequest) Execute() (*InlineResponse200, *http.Response, error) { - return r.ApiService.IsReadyExecute(r) -} - -/* - * IsReady Check HTTP Server and Database Status - * This endpoint returns a HTTP 200 status code when Ory Keto is up running and the environment dependencies (e.g. -the database) are responsive as well. - -If the service supports TLS Edge Termination, this endpoint does not require the -`X-Forwarded-Proto` header to be set. - -Be aware that if you are running multiple nodes of Ory Keto, the health status will never -refer to the cluster state, only to a single instance. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return MetadataApiApiIsReadyRequest -*/ -func (a *MetadataApiService) IsReady(ctx context.Context) MetadataApiApiIsReadyRequest { - return MetadataApiApiIsReadyRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return InlineResponse200 - */ -func (a *MetadataApiService) IsReadyExecute(r MetadataApiApiIsReadyRequest) (*InlineResponse200, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue *InlineResponse200 - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataApiService.IsReady") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/health/ready" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 503 { - var v InlineResponse503 - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/internal/httpclient-next/api_read.go b/internal/httpclient-next/api_read.go deleted file mode 100644 index 9529fc041..000000000 --- a/internal/httpclient-next/api_read.go +++ /dev/null @@ -1,787 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "bytes" - "context" - "io/ioutil" - "net/http" - "net/url" -) - -// Linger please -var ( - _ context.Context -) - -type ReadApi interface { - - /* - * GetCheck Check a relation tuple - * To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ReadApiApiGetCheckRequest - */ - GetCheck(ctx context.Context) ReadApiApiGetCheckRequest - - /* - * GetCheckExecute executes the request - * @return GetCheckResponse - */ - GetCheckExecute(r ReadApiApiGetCheckRequest) (*GetCheckResponse, *http.Response, error) - - /* - * GetExpand Expand a Relation Tuple - * Use this endpoint to expand a relation tuple. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ReadApiApiGetExpandRequest - */ - GetExpand(ctx context.Context) ReadApiApiGetExpandRequest - - /* - * GetExpandExecute executes the request - * @return ExpandTree - */ - GetExpandExecute(r ReadApiApiGetExpandRequest) (*ExpandTree, *http.Response, error) - - /* - * GetRelationTuples Query relation tuples - * Get all relation tuples that match the query. Only the namespace field is required. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ReadApiApiGetRelationTuplesRequest - */ - GetRelationTuples(ctx context.Context) ReadApiApiGetRelationTuplesRequest - - /* - * GetRelationTuplesExecute executes the request - * @return GetRelationTuplesResponse - */ - GetRelationTuplesExecute(r ReadApiApiGetRelationTuplesRequest) (*GetRelationTuplesResponse, *http.Response, error) - - /* - * PostCheck Check a relation tuple - * To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ReadApiApiPostCheckRequest - */ - PostCheck(ctx context.Context) ReadApiApiPostCheckRequest - - /* - * PostCheckExecute executes the request - * @return GetCheckResponse - */ - PostCheckExecute(r ReadApiApiPostCheckRequest) (*GetCheckResponse, *http.Response, error) -} - -// ReadApiService ReadApi service -type ReadApiService service - -type ReadApiApiGetCheckRequest struct { - ctx context.Context - ApiService ReadApi - namespace *string - object *string - relation *string - subjectId *string - subjectSetNamespace *string - subjectSetObject *string - subjectSetRelation *string - maxDepth *int64 -} - -func (r ReadApiApiGetCheckRequest) Namespace(namespace string) ReadApiApiGetCheckRequest { - r.namespace = &namespace - return r -} -func (r ReadApiApiGetCheckRequest) Object(object string) ReadApiApiGetCheckRequest { - r.object = &object - return r -} -func (r ReadApiApiGetCheckRequest) Relation(relation string) ReadApiApiGetCheckRequest { - r.relation = &relation - return r -} -func (r ReadApiApiGetCheckRequest) SubjectId(subjectId string) ReadApiApiGetCheckRequest { - r.subjectId = &subjectId - return r -} -func (r ReadApiApiGetCheckRequest) SubjectSetNamespace(subjectSetNamespace string) ReadApiApiGetCheckRequest { - r.subjectSetNamespace = &subjectSetNamespace - return r -} -func (r ReadApiApiGetCheckRequest) SubjectSetObject(subjectSetObject string) ReadApiApiGetCheckRequest { - r.subjectSetObject = &subjectSetObject - return r -} -func (r ReadApiApiGetCheckRequest) SubjectSetRelation(subjectSetRelation string) ReadApiApiGetCheckRequest { - r.subjectSetRelation = &subjectSetRelation - return r -} -func (r ReadApiApiGetCheckRequest) MaxDepth(maxDepth int64) ReadApiApiGetCheckRequest { - r.maxDepth = &maxDepth - return r -} - -func (r ReadApiApiGetCheckRequest) Execute() (*GetCheckResponse, *http.Response, error) { - return r.ApiService.GetCheckExecute(r) -} - -/* - * GetCheck Check a relation tuple - * To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ReadApiApiGetCheckRequest - */ -func (a *ReadApiService) GetCheck(ctx context.Context) ReadApiApiGetCheckRequest { - return ReadApiApiGetCheckRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return GetCheckResponse - */ -func (a *ReadApiService) GetCheckExecute(r ReadApiApiGetCheckRequest) (*GetCheckResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue *GetCheckResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ReadApiService.GetCheck") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/relation-tuples/check" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.namespace != nil { - localVarQueryParams.Add("namespace", parameterToString(*r.namespace, "")) - } - if r.object != nil { - localVarQueryParams.Add("object", parameterToString(*r.object, "")) - } - if r.relation != nil { - localVarQueryParams.Add("relation", parameterToString(*r.relation, "")) - } - if r.subjectId != nil { - localVarQueryParams.Add("subject_id", parameterToString(*r.subjectId, "")) - } - if r.subjectSetNamespace != nil { - localVarQueryParams.Add("subject_set.namespace", parameterToString(*r.subjectSetNamespace, "")) - } - if r.subjectSetObject != nil { - localVarQueryParams.Add("subject_set.object", parameterToString(*r.subjectSetObject, "")) - } - if r.subjectSetRelation != nil { - localVarQueryParams.Add("subject_set.relation", parameterToString(*r.subjectSetRelation, "")) - } - if r.maxDepth != nil { - localVarQueryParams.Add("max-depth", parameterToString(*r.maxDepth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v GetCheckResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ReadApiApiGetExpandRequest struct { - ctx context.Context - ApiService ReadApi - namespace *string - object *string - relation *string - maxDepth *int64 -} - -func (r ReadApiApiGetExpandRequest) Namespace(namespace string) ReadApiApiGetExpandRequest { - r.namespace = &namespace - return r -} -func (r ReadApiApiGetExpandRequest) Object(object string) ReadApiApiGetExpandRequest { - r.object = &object - return r -} -func (r ReadApiApiGetExpandRequest) Relation(relation string) ReadApiApiGetExpandRequest { - r.relation = &relation - return r -} -func (r ReadApiApiGetExpandRequest) MaxDepth(maxDepth int64) ReadApiApiGetExpandRequest { - r.maxDepth = &maxDepth - return r -} - -func (r ReadApiApiGetExpandRequest) Execute() (*ExpandTree, *http.Response, error) { - return r.ApiService.GetExpandExecute(r) -} - -/* - * GetExpand Expand a Relation Tuple - * Use this endpoint to expand a relation tuple. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ReadApiApiGetExpandRequest - */ -func (a *ReadApiService) GetExpand(ctx context.Context) ReadApiApiGetExpandRequest { - return ReadApiApiGetExpandRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return ExpandTree - */ -func (a *ReadApiService) GetExpandExecute(r ReadApiApiGetExpandRequest) (*ExpandTree, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue *ExpandTree - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ReadApiService.GetExpand") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/relation-tuples/expand" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.namespace == nil { - return localVarReturnValue, nil, reportError("namespace is required and must be specified") - } - if r.object == nil { - return localVarReturnValue, nil, reportError("object is required and must be specified") - } - if r.relation == nil { - return localVarReturnValue, nil, reportError("relation is required and must be specified") - } - - localVarQueryParams.Add("namespace", parameterToString(*r.namespace, "")) - localVarQueryParams.Add("object", parameterToString(*r.object, "")) - localVarQueryParams.Add("relation", parameterToString(*r.relation, "")) - if r.maxDepth != nil { - localVarQueryParams.Add("max-depth", parameterToString(*r.maxDepth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ReadApiApiGetRelationTuplesRequest struct { - ctx context.Context - ApiService ReadApi - pageToken *string - pageSize *int64 - namespace *string - object *string - relation *string - subjectId *string - subjectSetNamespace *string - subjectSetObject *string - subjectSetRelation *string -} - -func (r ReadApiApiGetRelationTuplesRequest) PageToken(pageToken string) ReadApiApiGetRelationTuplesRequest { - r.pageToken = &pageToken - return r -} -func (r ReadApiApiGetRelationTuplesRequest) PageSize(pageSize int64) ReadApiApiGetRelationTuplesRequest { - r.pageSize = &pageSize - return r -} -func (r ReadApiApiGetRelationTuplesRequest) Namespace(namespace string) ReadApiApiGetRelationTuplesRequest { - r.namespace = &namespace - return r -} -func (r ReadApiApiGetRelationTuplesRequest) Object(object string) ReadApiApiGetRelationTuplesRequest { - r.object = &object - return r -} -func (r ReadApiApiGetRelationTuplesRequest) Relation(relation string) ReadApiApiGetRelationTuplesRequest { - r.relation = &relation - return r -} -func (r ReadApiApiGetRelationTuplesRequest) SubjectId(subjectId string) ReadApiApiGetRelationTuplesRequest { - r.subjectId = &subjectId - return r -} -func (r ReadApiApiGetRelationTuplesRequest) SubjectSetNamespace(subjectSetNamespace string) ReadApiApiGetRelationTuplesRequest { - r.subjectSetNamespace = &subjectSetNamespace - return r -} -func (r ReadApiApiGetRelationTuplesRequest) SubjectSetObject(subjectSetObject string) ReadApiApiGetRelationTuplesRequest { - r.subjectSetObject = &subjectSetObject - return r -} -func (r ReadApiApiGetRelationTuplesRequest) SubjectSetRelation(subjectSetRelation string) ReadApiApiGetRelationTuplesRequest { - r.subjectSetRelation = &subjectSetRelation - return r -} - -func (r ReadApiApiGetRelationTuplesRequest) Execute() (*GetRelationTuplesResponse, *http.Response, error) { - return r.ApiService.GetRelationTuplesExecute(r) -} - -/* - * GetRelationTuples Query relation tuples - * Get all relation tuples that match the query. Only the namespace field is required. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ReadApiApiGetRelationTuplesRequest - */ -func (a *ReadApiService) GetRelationTuples(ctx context.Context) ReadApiApiGetRelationTuplesRequest { - return ReadApiApiGetRelationTuplesRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return GetRelationTuplesResponse - */ -func (a *ReadApiService) GetRelationTuplesExecute(r ReadApiApiGetRelationTuplesRequest) (*GetRelationTuplesResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue *GetRelationTuplesResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ReadApiService.GetRelationTuples") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/relation-tuples" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.pageToken != nil { - localVarQueryParams.Add("page_token", parameterToString(*r.pageToken, "")) - } - if r.pageSize != nil { - localVarQueryParams.Add("page_size", parameterToString(*r.pageSize, "")) - } - if r.namespace != nil { - localVarQueryParams.Add("namespace", parameterToString(*r.namespace, "")) - } - if r.object != nil { - localVarQueryParams.Add("object", parameterToString(*r.object, "")) - } - if r.relation != nil { - localVarQueryParams.Add("relation", parameterToString(*r.relation, "")) - } - if r.subjectId != nil { - localVarQueryParams.Add("subject_id", parameterToString(*r.subjectId, "")) - } - if r.subjectSetNamespace != nil { - localVarQueryParams.Add("subject_set.namespace", parameterToString(*r.subjectSetNamespace, "")) - } - if r.subjectSetObject != nil { - localVarQueryParams.Add("subject_set.object", parameterToString(*r.subjectSetObject, "")) - } - if r.subjectSetRelation != nil { - localVarQueryParams.Add("subject_set.relation", parameterToString(*r.subjectSetRelation, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 404 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type ReadApiApiPostCheckRequest struct { - ctx context.Context - ApiService ReadApi - maxDepth *int64 - relationQuery *RelationQuery -} - -func (r ReadApiApiPostCheckRequest) MaxDepth(maxDepth int64) ReadApiApiPostCheckRequest { - r.maxDepth = &maxDepth - return r -} -func (r ReadApiApiPostCheckRequest) RelationQuery(relationQuery RelationQuery) ReadApiApiPostCheckRequest { - r.relationQuery = &relationQuery - return r -} - -func (r ReadApiApiPostCheckRequest) Execute() (*GetCheckResponse, *http.Response, error) { - return r.ApiService.PostCheckExecute(r) -} - -/* - * PostCheck Check a relation tuple - * To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return ReadApiApiPostCheckRequest - */ -func (a *ReadApiService) PostCheck(ctx context.Context) ReadApiApiPostCheckRequest { - return ReadApiApiPostCheckRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return GetCheckResponse - */ -func (a *ReadApiService) PostCheckExecute(r ReadApiApiPostCheckRequest) (*GetCheckResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue *GetCheckResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ReadApiService.PostCheck") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/relation-tuples/check" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.maxDepth != nil { - localVarQueryParams.Add("max-depth", parameterToString(*r.maxDepth, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.relationQuery - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v GetCheckResponse - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/internal/httpclient-next/api_write.go b/internal/httpclient-next/api_write.go deleted file mode 100644 index 3e6183f50..000000000 --- a/internal/httpclient-next/api_write.go +++ /dev/null @@ -1,492 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "bytes" - "context" - "io/ioutil" - "net/http" - "net/url" -) - -// Linger please -var ( - _ context.Context -) - -type WriteApi interface { - - /* - * CreateRelationTuple Create a Relation Tuple - * Use this endpoint to create a relation tuple. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return WriteApiApiCreateRelationTupleRequest - */ - CreateRelationTuple(ctx context.Context) WriteApiApiCreateRelationTupleRequest - - /* - * CreateRelationTupleExecute executes the request - * @return RelationQuery - */ - CreateRelationTupleExecute(r WriteApiApiCreateRelationTupleRequest) (*RelationQuery, *http.Response, error) - - /* - * DeleteRelationTuples Delete Relation Tuples - * Use this endpoint to delete relation tuples - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return WriteApiApiDeleteRelationTuplesRequest - */ - DeleteRelationTuples(ctx context.Context) WriteApiApiDeleteRelationTuplesRequest - - /* - * DeleteRelationTuplesExecute executes the request - */ - DeleteRelationTuplesExecute(r WriteApiApiDeleteRelationTuplesRequest) (*http.Response, error) - - /* - * PatchRelationTuples Patch Multiple Relation Tuples - * Use this endpoint to patch one or more relation tuples. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return WriteApiApiPatchRelationTuplesRequest - */ - PatchRelationTuples(ctx context.Context) WriteApiApiPatchRelationTuplesRequest - - /* - * PatchRelationTuplesExecute executes the request - */ - PatchRelationTuplesExecute(r WriteApiApiPatchRelationTuplesRequest) (*http.Response, error) -} - -// WriteApiService WriteApi service -type WriteApiService service - -type WriteApiApiCreateRelationTupleRequest struct { - ctx context.Context - ApiService WriteApi - relationQuery *RelationQuery -} - -func (r WriteApiApiCreateRelationTupleRequest) RelationQuery(relationQuery RelationQuery) WriteApiApiCreateRelationTupleRequest { - r.relationQuery = &relationQuery - return r -} - -func (r WriteApiApiCreateRelationTupleRequest) Execute() (*RelationQuery, *http.Response, error) { - return r.ApiService.CreateRelationTupleExecute(r) -} - -/* - * CreateRelationTuple Create a Relation Tuple - * Use this endpoint to create a relation tuple. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return WriteApiApiCreateRelationTupleRequest - */ -func (a *WriteApiService) CreateRelationTuple(ctx context.Context) WriteApiApiCreateRelationTupleRequest { - return WriteApiApiCreateRelationTupleRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - * @return RelationQuery - */ -func (a *WriteApiService) CreateRelationTupleExecute(r WriteApiApiCreateRelationTupleRequest) (*RelationQuery, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - localVarReturnValue *RelationQuery - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WriteApiService.CreateRelationTuple") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/admin/relation-tuples" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.relationQuery - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} - -type WriteApiApiDeleteRelationTuplesRequest struct { - ctx context.Context - ApiService WriteApi - namespace *string - object *string - relation *string - subjectId *string - subjectSetNamespace *string - subjectSetObject *string - subjectSetRelation *string -} - -func (r WriteApiApiDeleteRelationTuplesRequest) Namespace(namespace string) WriteApiApiDeleteRelationTuplesRequest { - r.namespace = &namespace - return r -} -func (r WriteApiApiDeleteRelationTuplesRequest) Object(object string) WriteApiApiDeleteRelationTuplesRequest { - r.object = &object - return r -} -func (r WriteApiApiDeleteRelationTuplesRequest) Relation(relation string) WriteApiApiDeleteRelationTuplesRequest { - r.relation = &relation - return r -} -func (r WriteApiApiDeleteRelationTuplesRequest) SubjectId(subjectId string) WriteApiApiDeleteRelationTuplesRequest { - r.subjectId = &subjectId - return r -} -func (r WriteApiApiDeleteRelationTuplesRequest) SubjectSetNamespace(subjectSetNamespace string) WriteApiApiDeleteRelationTuplesRequest { - r.subjectSetNamespace = &subjectSetNamespace - return r -} -func (r WriteApiApiDeleteRelationTuplesRequest) SubjectSetObject(subjectSetObject string) WriteApiApiDeleteRelationTuplesRequest { - r.subjectSetObject = &subjectSetObject - return r -} -func (r WriteApiApiDeleteRelationTuplesRequest) SubjectSetRelation(subjectSetRelation string) WriteApiApiDeleteRelationTuplesRequest { - r.subjectSetRelation = &subjectSetRelation - return r -} - -func (r WriteApiApiDeleteRelationTuplesRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteRelationTuplesExecute(r) -} - -/* - * DeleteRelationTuples Delete Relation Tuples - * Use this endpoint to delete relation tuples - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return WriteApiApiDeleteRelationTuplesRequest - */ -func (a *WriteApiService) DeleteRelationTuples(ctx context.Context) WriteApiApiDeleteRelationTuplesRequest { - return WriteApiApiDeleteRelationTuplesRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *WriteApiService) DeleteRelationTuplesExecute(r WriteApiApiDeleteRelationTuplesRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WriteApiService.DeleteRelationTuples") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/admin/relation-tuples" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if r.namespace != nil { - localVarQueryParams.Add("namespace", parameterToString(*r.namespace, "")) - } - if r.object != nil { - localVarQueryParams.Add("object", parameterToString(*r.object, "")) - } - if r.relation != nil { - localVarQueryParams.Add("relation", parameterToString(*r.relation, "")) - } - if r.subjectId != nil { - localVarQueryParams.Add("subject_id", parameterToString(*r.subjectId, "")) - } - if r.subjectSetNamespace != nil { - localVarQueryParams.Add("subject_set.namespace", parameterToString(*r.subjectSetNamespace, "")) - } - if r.subjectSetObject != nil { - localVarQueryParams.Add("subject_set.object", parameterToString(*r.subjectSetObject, "")) - } - if r.subjectSetRelation != nil { - localVarQueryParams.Add("subject_set.relation", parameterToString(*r.subjectSetRelation, "")) - } - // to determine the Content-Type header - localVarHTTPContentTypes := []string{} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type WriteApiApiPatchRelationTuplesRequest struct { - ctx context.Context - ApiService WriteApi - patchDelta *[]PatchDelta -} - -func (r WriteApiApiPatchRelationTuplesRequest) PatchDelta(patchDelta []PatchDelta) WriteApiApiPatchRelationTuplesRequest { - r.patchDelta = &patchDelta - return r -} - -func (r WriteApiApiPatchRelationTuplesRequest) Execute() (*http.Response, error) { - return r.ApiService.PatchRelationTuplesExecute(r) -} - -/* - * PatchRelationTuples Patch Multiple Relation Tuples - * Use this endpoint to patch one or more relation tuples. - * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @return WriteApiApiPatchRelationTuplesRequest - */ -func (a *WriteApiService) PatchRelationTuples(ctx context.Context) WriteApiApiPatchRelationTuplesRequest { - return WriteApiApiPatchRelationTuplesRequest{ - ApiService: a, - ctx: ctx, - } -} - -/* - * Execute executes the request - */ -func (a *WriteApiService) PatchRelationTuplesExecute(r WriteApiApiPatchRelationTuplesRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPatch - localVarPostBody interface{} - localVarFormFileName string - localVarFileName string - localVarFileBytes []byte - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WriteApiService.PatchRelationTuples") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/admin/relation-tuples" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.patchDelta - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarHTTPResponse, err - } - - localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 404 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.model = v - return localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 500 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarHTTPResponse, newErr - } - newErr.model = v - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} diff --git a/internal/httpclient-next/client.go b/internal/httpclient-next/client.go deleted file mode 100644 index 6c08d9c81..000000000 --- a/internal/httpclient-next/client.go +++ /dev/null @@ -1,547 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "bytes" - "context" - "encoding/json" - "encoding/xml" - "errors" - "fmt" - "io" - "log" - "mime/multipart" - "net/http" - "net/http/httputil" - "net/url" - "os" - "path/filepath" - "reflect" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" - - "golang.org/x/oauth2" -) - -var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) - xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) -) - -// APIClient manages communication with the Ory Keto API API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - - MetadataApi MetadataApi - - ReadApi ReadApi - - WriteApi WriteApi -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.HTTPClient == nil { - cfg.HTTPClient = http.DefaultClient - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.MetadataApi = (*MetadataApiService)(&c.common) - c.ReadApi = (*ReadApiService)(&c.common) - c.WriteApi = (*WriteApiService)(&c.common) - - return c -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' -} - -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } - - if contains(accepts, "application/json") { - return "application/json" - } - - return strings.Join(accepts, ",") -} - -// contains is a case insenstive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.ToLower(a) == strings.ToLower(needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. -func parameterToString(obj interface{}, collectionFormat string) string { - var delimiter string - - switch collectionFormat { - case "pipes": - delimiter = "|" - case "ssv": - delimiter = " " - case "tsv": - delimiter = "\t" - case "csv": - delimiter = "," - } - - if reflect.TypeOf(obj).Kind() == reflect.Slice { - return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") - } else if t, ok := obj.(time.Time); ok { - return t.Format(time.RFC3339) - } - - return fmt.Sprintf("%v", obj) -} - -// helper for converting interface{} parameters to json strings -func parameterToJson(obj interface{}) (string, error) { - jsonBuf, err := json.Marshal(obj) - if err != nil { - return "", err - } - return string(jsonBuf), err -} - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) - if err != nil { - return nil, err - } - log.Printf("\n%s\n", string(dump)) - } - - resp, err := c.cfg.HTTPClient.Do(request) - if err != nil { - return resp, err - } - - if c.cfg.Debug { - dump, err := httputil.DumpResponse(resp, true) - if err != nil { - return resp, err - } - log.Printf("\n%s\n", string(dump)) - } - return resp, err -} - -// Allow modification of underlying config for alternate implementations and testing -// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior -func (c *APIClient) GetConfig() *Configuration { - return c.cfg -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - formFileName string, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { - - var body *bytes.Buffer - - // Detect postBody type and post. - if postBody != nil { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } - - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } - - // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { - if body != nil { - return nil, errors.New("Cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err - } - } - - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } - - if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { - if body != nil { - return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") - } - body = &bytes.Buffer{} - body.WriteString(formParams.Encode()) - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Override request host, if applicable - if c.cfg.Host != "" { - url.Host = c.cfg.Host - } - - // Override request scheme, if applicable - if c.cfg.Scheme != "" { - url.Scheme = c.cfg.Scheme - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = query.Encode() - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers.Set(h, v) - } - localVarRequest.Header = headers - } - - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) - - // Walk through any authentication. - - // OAuth2 authentication - if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { - // We were able to grab an oauth2 token from the context - var latestToken *oauth2.Token - if latestToken, err = tok.Token(); err != nil { - return nil, err - } - - latestToken.SetAuthHeader(localVarRequest) - } - - // Basic HTTP Authentication - if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { - localVarRequest.SetBasicAuth(auth.UserName, auth.Password) - } - - // AccessToken Authentication - if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer "+auth) - } - - } - - for header, value := range c.cfg.DefaultHeader { - localVarRequest.Header.Add(header, value) - } - return localVarRequest, nil -} - -func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { - if len(b) == 0 { - return nil - } - if s, ok := v.(*string); ok { - *s = string(b) - return nil - } - if xmlCheck.MatchString(contentType) { - if err = xml.Unmarshal(b, v); err != nil { - return err - } - return nil - } - if jsonCheck.MatchString(contentType) { - if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas - if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined - if err = unmarshalObj.UnmarshalJSON(b); err != nil { - return err - } - } else { - return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") - } - } else if err = json.Unmarshal(b, v); err != nil { // simple model - return err - } - return nil - } - return errors.New("undefined response type") -} - -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(path) - if err != nil { - return err - } - defer file.Close() - - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) - - return err -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) error { - return fmt.Errorf(format, a...) -} - -// Prevent trying to import "bytes" -func newStrictDecoder(data []byte) *json.Decoder { - dec := json.NewDecoder(bytes.NewBuffer(data)) - dec.DisallowUnknownFields() - return dec -} - -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } - - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if s, ok := body.(*string); ok { - _, err = bodyBuf.WriteString(*s) - } else if jsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if xmlCheck.MatchString(contentType) { - err = xml.NewEncoder(bodyBuf).Encode(body) - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } - - return contentType -} - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) time.Time { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } else { - expires = now.Add(lifetime) - } - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires -} - -func strlen(s string) int { - return utf8.RuneCountInString(s) -} - -// GenericOpenAPIError Provides access to the body, error and model on returned errors. -type GenericOpenAPIError struct { - body []byte - error string - model interface{} -} - -// Error returns non-empty string if there was an error. -func (e GenericOpenAPIError) Error() string { - return e.error -} - -// Body returns the raw bytes of the response -func (e GenericOpenAPIError) Body() []byte { - return e.body -} - -// Model returns the unpacked model of the error -func (e GenericOpenAPIError) Model() interface{} { - return e.model -} diff --git a/internal/httpclient-next/configuration.go b/internal/httpclient-next/configuration.go deleted file mode 100644 index 2a8e424f0..000000000 --- a/internal/httpclient-next/configuration.go +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "context" - "fmt" - "net/http" - "strings" -) - -// contextKeys are used to identify the type of value in the context. -// Since these are string, it is possible to get a short description of the -// context key for logging and debugging using key.String(). - -type contextKey string - -func (c contextKey) String() string { - return "auth " + string(c) -} - -var ( - // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") - - // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") - - // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") - - // ContextAPIKeys takes a string apikey as authentication for the request - ContextAPIKeys = contextKey("apiKeys") - - // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. - ContextHttpSignatureAuth = contextKey("httpsignature") - - // ContextServerIndex uses a server configuration from the index. - ContextServerIndex = contextKey("serverIndex") - - // ContextOperationServerIndices uses a server configuration from the index mapping. - ContextOperationServerIndices = contextKey("serverOperationIndices") - - // ContextServerVariables overrides a server configuration variables. - ContextServerVariables = contextKey("serverVariables") - - // ContextOperationServerVariables overrides a server configuration variables using operation specific values. - ContextOperationServerVariables = contextKey("serverOperationVariables") -) - -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth -type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` -} - -// APIKey provides API key based authentication to a request passed via context using ContextAPIKey -type APIKey struct { - Key string - Prefix string -} - -// ServerVariable stores the information about a server variable -type ServerVariable struct { - Description string - DefaultValue string - EnumValues []string -} - -// ServerConfiguration stores the information about a server -type ServerConfiguration struct { - URL string - Description string - Variables map[string]ServerVariable -} - -// ServerConfigurations stores multiple ServerConfiguration items -type ServerConfigurations []ServerConfiguration - -// Configuration stores the configuration of the API client -type Configuration struct { - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Servers ServerConfigurations - OperationServers map[string]ServerConfigurations - HTTPClient *http.Client -} - -// NewConfiguration returns a new Configuration object -func NewConfiguration() *Configuration { - cfg := &Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Servers: ServerConfigurations{ - { - URL: "", - Description: "No description provided", - }, - }, - OperationServers: map[string]ServerConfigurations{}, - } - return cfg -} - -// AddDefaultHeader adds a new HTTP header to the default header in the request -func (c *Configuration) AddDefaultHeader(key string, value string) { - c.DefaultHeader[key] = value -} - -// URL formats template on a index using given variables -func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { - if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) - } - server := sc[index] - url := server.URL - - // go through variables and replace placeholders - for name, variable := range server.Variables { - if value, ok := variables[name]; ok { - found := bool(len(variable.EnumValues) == 0) - for _, enumValue := range variable.EnumValues { - if value == enumValue { - found = true - } - } - if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) - } - url = strings.Replace(url, "{"+name+"}", value, -1) - } else { - url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) - } - } - return url, nil -} - -// ServerURL returns URL based on server settings -func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { - return c.Servers.URL(index, variables) -} - -func getServerIndex(ctx context.Context) (int, error) { - si := ctx.Value(ContextServerIndex) - if si != nil { - if index, ok := si.(int); ok { - return index, nil - } - return 0, reportError("Invalid type %T should be int", si) - } - return 0, nil -} - -func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { - osi := ctx.Value(ContextOperationServerIndices) - if osi != nil { - if operationIndices, ok := osi.(map[string]int); !ok { - return 0, reportError("Invalid type %T should be map[string]int", osi) - } else { - index, ok := operationIndices[endpoint] - if ok { - return index, nil - } - } - } - return getServerIndex(ctx) -} - -func getServerVariables(ctx context.Context) (map[string]string, error) { - sv := ctx.Value(ContextServerVariables) - if sv != nil { - if variables, ok := sv.(map[string]string); ok { - return variables, nil - } - return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) - } - return nil, nil -} - -func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { - osv := ctx.Value(ContextOperationServerVariables) - if osv != nil { - if operationVariables, ok := osv.(map[string]map[string]string); !ok { - return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) - } else { - variables, ok := operationVariables[endpoint] - if ok { - return variables, nil - } - } - } - return getServerVariables(ctx) -} - -// ServerURLWithContext returns a new server URL given an endpoint -func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { - sc, ok := c.OperationServers[endpoint] - if !ok { - sc = c.Servers - } - - if ctx == nil { - return sc.URL(0, nil) - } - - index, err := getServerOperationIndex(ctx, endpoint) - if err != nil { - return "", err - } - - variables, err := getServerOperationVariables(ctx, endpoint) - if err != nil { - return "", err - } - - return sc.URL(index, variables) -} diff --git a/internal/httpclient-next/docs/ExpandTree.md b/internal/httpclient-next/docs/ExpandTree.md deleted file mode 100644 index f1525d7f9..000000000 --- a/internal/httpclient-next/docs/ExpandTree.md +++ /dev/null @@ -1,129 +0,0 @@ -# ExpandTree - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Children** | Pointer to [**[]ExpandTree**](ExpandTree.md) | | [optional] -**SubjectId** | Pointer to **string** | | [optional] -**SubjectSet** | Pointer to [**SubjectSet**](SubjectSet.md) | | [optional] -**Type** | **string** | | - -## Methods - -### NewExpandTree - -`func NewExpandTree(type_ string, ) *ExpandTree` - -NewExpandTree instantiates a new ExpandTree object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewExpandTreeWithDefaults - -`func NewExpandTreeWithDefaults() *ExpandTree` - -NewExpandTreeWithDefaults instantiates a new ExpandTree object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetChildren - -`func (o *ExpandTree) GetChildren() []ExpandTree` - -GetChildren returns the Children field if non-nil, zero value otherwise. - -### GetChildrenOk - -`func (o *ExpandTree) GetChildrenOk() (*[]ExpandTree, bool)` - -GetChildrenOk returns a tuple with the Children field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetChildren - -`func (o *ExpandTree) SetChildren(v []ExpandTree)` - -SetChildren sets Children field to given value. - -### HasChildren - -`func (o *ExpandTree) HasChildren() bool` - -HasChildren returns a boolean if a field has been set. - -### GetSubjectId - -`func (o *ExpandTree) GetSubjectId() string` - -GetSubjectId returns the SubjectId field if non-nil, zero value otherwise. - -### GetSubjectIdOk - -`func (o *ExpandTree) GetSubjectIdOk() (*string, bool)` - -GetSubjectIdOk returns a tuple with the SubjectId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSubjectId - -`func (o *ExpandTree) SetSubjectId(v string)` - -SetSubjectId sets SubjectId field to given value. - -### HasSubjectId - -`func (o *ExpandTree) HasSubjectId() bool` - -HasSubjectId returns a boolean if a field has been set. - -### GetSubjectSet - -`func (o *ExpandTree) GetSubjectSet() SubjectSet` - -GetSubjectSet returns the SubjectSet field if non-nil, zero value otherwise. - -### GetSubjectSetOk - -`func (o *ExpandTree) GetSubjectSetOk() (*SubjectSet, bool)` - -GetSubjectSetOk returns a tuple with the SubjectSet field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSubjectSet - -`func (o *ExpandTree) SetSubjectSet(v SubjectSet)` - -SetSubjectSet sets SubjectSet field to given value. - -### HasSubjectSet - -`func (o *ExpandTree) HasSubjectSet() bool` - -HasSubjectSet returns a boolean if a field has been set. - -### GetType - -`func (o *ExpandTree) GetType() string` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ExpandTree) GetTypeOk() (*string, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ExpandTree) SetType(v string)` - -SetType sets Type field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/GenericError.md b/internal/httpclient-next/docs/GenericError.md deleted file mode 100644 index 3601c0b8d..000000000 --- a/internal/httpclient-next/docs/GenericError.md +++ /dev/null @@ -1,186 +0,0 @@ -# GenericError - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Code** | Pointer to **int64** | | [optional] -**Details** | Pointer to **[]map[string]map[string]interface{}** | | [optional] -**Message** | Pointer to **string** | | [optional] -**Reason** | Pointer to **string** | | [optional] -**Request** | Pointer to **string** | | [optional] -**Status** | Pointer to **string** | | [optional] - -## Methods - -### NewGenericError - -`func NewGenericError() *GenericError` - -NewGenericError instantiates a new GenericError object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewGenericErrorWithDefaults - -`func NewGenericErrorWithDefaults() *GenericError` - -NewGenericErrorWithDefaults instantiates a new GenericError object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetCode - -`func (o *GenericError) GetCode() int64` - -GetCode returns the Code field if non-nil, zero value otherwise. - -### GetCodeOk - -`func (o *GenericError) GetCodeOk() (*int64, bool)` - -GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCode - -`func (o *GenericError) SetCode(v int64)` - -SetCode sets Code field to given value. - -### HasCode - -`func (o *GenericError) HasCode() bool` - -HasCode returns a boolean if a field has been set. - -### GetDetails - -`func (o *GenericError) GetDetails() []map[string]map[string]interface{}` - -GetDetails returns the Details field if non-nil, zero value otherwise. - -### GetDetailsOk - -`func (o *GenericError) GetDetailsOk() (*[]map[string]map[string]interface{}, bool)` - -GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDetails - -`func (o *GenericError) SetDetails(v []map[string]map[string]interface{})` - -SetDetails sets Details field to given value. - -### HasDetails - -`func (o *GenericError) HasDetails() bool` - -HasDetails returns a boolean if a field has been set. - -### GetMessage - -`func (o *GenericError) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *GenericError) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMessage - -`func (o *GenericError) SetMessage(v string)` - -SetMessage sets Message field to given value. - -### HasMessage - -`func (o *GenericError) HasMessage() bool` - -HasMessage returns a boolean if a field has been set. - -### GetReason - -`func (o *GenericError) GetReason() string` - -GetReason returns the Reason field if non-nil, zero value otherwise. - -### GetReasonOk - -`func (o *GenericError) GetReasonOk() (*string, bool)` - -GetReasonOk returns a tuple with the Reason field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetReason - -`func (o *GenericError) SetReason(v string)` - -SetReason sets Reason field to given value. - -### HasReason - -`func (o *GenericError) HasReason() bool` - -HasReason returns a boolean if a field has been set. - -### GetRequest - -`func (o *GenericError) GetRequest() string` - -GetRequest returns the Request field if non-nil, zero value otherwise. - -### GetRequestOk - -`func (o *GenericError) GetRequestOk() (*string, bool)` - -GetRequestOk returns a tuple with the Request field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRequest - -`func (o *GenericError) SetRequest(v string)` - -SetRequest sets Request field to given value. - -### HasRequest - -`func (o *GenericError) HasRequest() bool` - -HasRequest returns a boolean if a field has been set. - -### GetStatus - -`func (o *GenericError) GetStatus() string` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *GenericError) GetStatusOk() (*string, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *GenericError) SetStatus(v string)` - -SetStatus sets Status field to given value. - -### HasStatus - -`func (o *GenericError) HasStatus() bool` - -HasStatus returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/GetCheckResponse.md b/internal/httpclient-next/docs/GetCheckResponse.md deleted file mode 100644 index d3d3b84b9..000000000 --- a/internal/httpclient-next/docs/GetCheckResponse.md +++ /dev/null @@ -1,51 +0,0 @@ -# GetCheckResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Allowed** | **bool** | whether the relation tuple is allowed | - -## Methods - -### NewGetCheckResponse - -`func NewGetCheckResponse(allowed bool, ) *GetCheckResponse` - -NewGetCheckResponse instantiates a new GetCheckResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewGetCheckResponseWithDefaults - -`func NewGetCheckResponseWithDefaults() *GetCheckResponse` - -NewGetCheckResponseWithDefaults instantiates a new GetCheckResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetAllowed - -`func (o *GetCheckResponse) GetAllowed() bool` - -GetAllowed returns the Allowed field if non-nil, zero value otherwise. - -### GetAllowedOk - -`func (o *GetCheckResponse) GetAllowedOk() (*bool, bool)` - -GetAllowedOk returns a tuple with the Allowed field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAllowed - -`func (o *GetCheckResponse) SetAllowed(v bool)` - -SetAllowed sets Allowed field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/GetRelationTuplesResponse.md b/internal/httpclient-next/docs/GetRelationTuplesResponse.md deleted file mode 100644 index 742ca6ccd..000000000 --- a/internal/httpclient-next/docs/GetRelationTuplesResponse.md +++ /dev/null @@ -1,82 +0,0 @@ -# GetRelationTuplesResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**NextPageToken** | Pointer to **string** | The opaque token to provide in a subsequent request to get the next page. It is the empty string iff this is the last page. | [optional] -**RelationTuples** | Pointer to [**[]InternalRelationTuple**](InternalRelationTuple.md) | | [optional] - -## Methods - -### NewGetRelationTuplesResponse - -`func NewGetRelationTuplesResponse() *GetRelationTuplesResponse` - -NewGetRelationTuplesResponse instantiates a new GetRelationTuplesResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewGetRelationTuplesResponseWithDefaults - -`func NewGetRelationTuplesResponseWithDefaults() *GetRelationTuplesResponse` - -NewGetRelationTuplesResponseWithDefaults instantiates a new GetRelationTuplesResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetNextPageToken - -`func (o *GetRelationTuplesResponse) GetNextPageToken() string` - -GetNextPageToken returns the NextPageToken field if non-nil, zero value otherwise. - -### GetNextPageTokenOk - -`func (o *GetRelationTuplesResponse) GetNextPageTokenOk() (*string, bool)` - -GetNextPageTokenOk returns a tuple with the NextPageToken field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNextPageToken - -`func (o *GetRelationTuplesResponse) SetNextPageToken(v string)` - -SetNextPageToken sets NextPageToken field to given value. - -### HasNextPageToken - -`func (o *GetRelationTuplesResponse) HasNextPageToken() bool` - -HasNextPageToken returns a boolean if a field has been set. - -### GetRelationTuples - -`func (o *GetRelationTuplesResponse) GetRelationTuples() []InternalRelationTuple` - -GetRelationTuples returns the RelationTuples field if non-nil, zero value otherwise. - -### GetRelationTuplesOk - -`func (o *GetRelationTuplesResponse) GetRelationTuplesOk() (*[]InternalRelationTuple, bool)` - -GetRelationTuplesOk returns a tuple with the RelationTuples field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRelationTuples - -`func (o *GetRelationTuplesResponse) SetRelationTuples(v []InternalRelationTuple)` - -SetRelationTuples sets RelationTuples field to given value. - -### HasRelationTuples - -`func (o *GetRelationTuplesResponse) HasRelationTuples() bool` - -HasRelationTuples returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/HealthNotReadyStatus.md b/internal/httpclient-next/docs/HealthNotReadyStatus.md deleted file mode 100644 index 9c40dcf5f..000000000 --- a/internal/httpclient-next/docs/HealthNotReadyStatus.md +++ /dev/null @@ -1,56 +0,0 @@ -# HealthNotReadyStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Errors** | Pointer to **map[string]string** | Errors contains a list of errors that caused the not ready status. | [optional] - -## Methods - -### NewHealthNotReadyStatus - -`func NewHealthNotReadyStatus() *HealthNotReadyStatus` - -NewHealthNotReadyStatus instantiates a new HealthNotReadyStatus object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewHealthNotReadyStatusWithDefaults - -`func NewHealthNotReadyStatusWithDefaults() *HealthNotReadyStatus` - -NewHealthNotReadyStatusWithDefaults instantiates a new HealthNotReadyStatus object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetErrors - -`func (o *HealthNotReadyStatus) GetErrors() map[string]string` - -GetErrors returns the Errors field if non-nil, zero value otherwise. - -### GetErrorsOk - -`func (o *HealthNotReadyStatus) GetErrorsOk() (*map[string]string, bool)` - -GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetErrors - -`func (o *HealthNotReadyStatus) SetErrors(v map[string]string)` - -SetErrors sets Errors field to given value. - -### HasErrors - -`func (o *HealthNotReadyStatus) HasErrors() bool` - -HasErrors returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/HealthStatus.md b/internal/httpclient-next/docs/HealthStatus.md deleted file mode 100644 index 0173b4251..000000000 --- a/internal/httpclient-next/docs/HealthStatus.md +++ /dev/null @@ -1,56 +0,0 @@ -# HealthStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Status** | Pointer to **string** | Status always contains \"ok\". | [optional] - -## Methods - -### NewHealthStatus - -`func NewHealthStatus() *HealthStatus` - -NewHealthStatus instantiates a new HealthStatus object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewHealthStatusWithDefaults - -`func NewHealthStatusWithDefaults() *HealthStatus` - -NewHealthStatusWithDefaults instantiates a new HealthStatus object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetStatus - -`func (o *HealthStatus) GetStatus() string` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *HealthStatus) GetStatusOk() (*string, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *HealthStatus) SetStatus(v string)` - -SetStatus sets Status field to given value. - -### HasStatus - -`func (o *HealthStatus) HasStatus() bool` - -HasStatus returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/InlineResponse200.md b/internal/httpclient-next/docs/InlineResponse200.md deleted file mode 100644 index 430ba9b99..000000000 --- a/internal/httpclient-next/docs/InlineResponse200.md +++ /dev/null @@ -1,51 +0,0 @@ -# InlineResponse200 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Status** | **string** | Always \"ok\". | - -## Methods - -### NewInlineResponse200 - -`func NewInlineResponse200(status string, ) *InlineResponse200` - -NewInlineResponse200 instantiates a new InlineResponse200 object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewInlineResponse200WithDefaults - -`func NewInlineResponse200WithDefaults() *InlineResponse200` - -NewInlineResponse200WithDefaults instantiates a new InlineResponse200 object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetStatus - -`func (o *InlineResponse200) GetStatus() string` - -GetStatus returns the Status field if non-nil, zero value otherwise. - -### GetStatusOk - -`func (o *InlineResponse200) GetStatusOk() (*string, bool)` - -GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetStatus - -`func (o *InlineResponse200) SetStatus(v string)` - -SetStatus sets Status field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/InlineResponse2001.md b/internal/httpclient-next/docs/InlineResponse2001.md deleted file mode 100644 index 4102597f2..000000000 --- a/internal/httpclient-next/docs/InlineResponse2001.md +++ /dev/null @@ -1,51 +0,0 @@ -# InlineResponse2001 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Version** | **string** | The version of Ory Keto. | - -## Methods - -### NewInlineResponse2001 - -`func NewInlineResponse2001(version string, ) *InlineResponse2001` - -NewInlineResponse2001 instantiates a new InlineResponse2001 object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewInlineResponse2001WithDefaults - -`func NewInlineResponse2001WithDefaults() *InlineResponse2001` - -NewInlineResponse2001WithDefaults instantiates a new InlineResponse2001 object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetVersion - -`func (o *InlineResponse2001) GetVersion() string` - -GetVersion returns the Version field if non-nil, zero value otherwise. - -### GetVersionOk - -`func (o *InlineResponse2001) GetVersionOk() (*string, bool)` - -GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVersion - -`func (o *InlineResponse2001) SetVersion(v string)` - -SetVersion sets Version field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/InlineResponse503.md b/internal/httpclient-next/docs/InlineResponse503.md deleted file mode 100644 index 3a79177f1..000000000 --- a/internal/httpclient-next/docs/InlineResponse503.md +++ /dev/null @@ -1,51 +0,0 @@ -# InlineResponse503 - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Errors** | **map[string]string** | Errors contains a list of errors that caused the not ready status. | - -## Methods - -### NewInlineResponse503 - -`func NewInlineResponse503(errors map[string]string, ) *InlineResponse503` - -NewInlineResponse503 instantiates a new InlineResponse503 object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewInlineResponse503WithDefaults - -`func NewInlineResponse503WithDefaults() *InlineResponse503` - -NewInlineResponse503WithDefaults instantiates a new InlineResponse503 object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetErrors - -`func (o *InlineResponse503) GetErrors() map[string]string` - -GetErrors returns the Errors field if non-nil, zero value otherwise. - -### GetErrorsOk - -`func (o *InlineResponse503) GetErrorsOk() (*map[string]string, bool)` - -GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetErrors - -`func (o *InlineResponse503) SetErrors(v map[string]string)` - -SetErrors sets Errors field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/InternalRelationTuple.md b/internal/httpclient-next/docs/InternalRelationTuple.md deleted file mode 100644 index 888a4ec9e..000000000 --- a/internal/httpclient-next/docs/InternalRelationTuple.md +++ /dev/null @@ -1,145 +0,0 @@ -# InternalRelationTuple - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Namespace** | **string** | Namespace of the Relation Tuple | -**Object** | **string** | Object of the Relation Tuple | -**Relation** | **string** | Relation of the Relation Tuple | -**SubjectId** | Pointer to **string** | SubjectID of the Relation Tuple Either SubjectSet or SubjectID are required. | [optional] -**SubjectSet** | Pointer to [**SubjectSet**](SubjectSet.md) | | [optional] - -## Methods - -### NewInternalRelationTuple - -`func NewInternalRelationTuple(namespace string, object string, relation string, ) *InternalRelationTuple` - -NewInternalRelationTuple instantiates a new InternalRelationTuple object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewInternalRelationTupleWithDefaults - -`func NewInternalRelationTupleWithDefaults() *InternalRelationTuple` - -NewInternalRelationTupleWithDefaults instantiates a new InternalRelationTuple object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetNamespace - -`func (o *InternalRelationTuple) GetNamespace() string` - -GetNamespace returns the Namespace field if non-nil, zero value otherwise. - -### GetNamespaceOk - -`func (o *InternalRelationTuple) GetNamespaceOk() (*string, bool)` - -GetNamespaceOk returns a tuple with the Namespace field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNamespace - -`func (o *InternalRelationTuple) SetNamespace(v string)` - -SetNamespace sets Namespace field to given value. - - -### GetObject - -`func (o *InternalRelationTuple) GetObject() string` - -GetObject returns the Object field if non-nil, zero value otherwise. - -### GetObjectOk - -`func (o *InternalRelationTuple) GetObjectOk() (*string, bool)` - -GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetObject - -`func (o *InternalRelationTuple) SetObject(v string)` - -SetObject sets Object field to given value. - - -### GetRelation - -`func (o *InternalRelationTuple) GetRelation() string` - -GetRelation returns the Relation field if non-nil, zero value otherwise. - -### GetRelationOk - -`func (o *InternalRelationTuple) GetRelationOk() (*string, bool)` - -GetRelationOk returns a tuple with the Relation field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRelation - -`func (o *InternalRelationTuple) SetRelation(v string)` - -SetRelation sets Relation field to given value. - - -### GetSubjectId - -`func (o *InternalRelationTuple) GetSubjectId() string` - -GetSubjectId returns the SubjectId field if non-nil, zero value otherwise. - -### GetSubjectIdOk - -`func (o *InternalRelationTuple) GetSubjectIdOk() (*string, bool)` - -GetSubjectIdOk returns a tuple with the SubjectId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSubjectId - -`func (o *InternalRelationTuple) SetSubjectId(v string)` - -SetSubjectId sets SubjectId field to given value. - -### HasSubjectId - -`func (o *InternalRelationTuple) HasSubjectId() bool` - -HasSubjectId returns a boolean if a field has been set. - -### GetSubjectSet - -`func (o *InternalRelationTuple) GetSubjectSet() SubjectSet` - -GetSubjectSet returns the SubjectSet field if non-nil, zero value otherwise. - -### GetSubjectSetOk - -`func (o *InternalRelationTuple) GetSubjectSetOk() (*SubjectSet, bool)` - -GetSubjectSetOk returns a tuple with the SubjectSet field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSubjectSet - -`func (o *InternalRelationTuple) SetSubjectSet(v SubjectSet)` - -SetSubjectSet sets SubjectSet field to given value. - -### HasSubjectSet - -`func (o *InternalRelationTuple) HasSubjectSet() bool` - -HasSubjectSet returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/MetadataApi.md b/internal/httpclient-next/docs/MetadataApi.md deleted file mode 100644 index ff2c9bb07..000000000 --- a/internal/httpclient-next/docs/MetadataApi.md +++ /dev/null @@ -1,194 +0,0 @@ -# \MetadataApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GetVersion**](MetadataApi.md#GetVersion) | **Get** /version | Return Running Software Version. -[**IsAlive**](MetadataApi.md#IsAlive) | **Get** /health/alive | Check HTTP Server Status -[**IsReady**](MetadataApi.md#IsReady) | **Get** /health/ready | Check HTTP Server and Database Status - - - -## GetVersion - -> InlineResponse2001 GetVersion(ctx).Execute() - -Return Running Software Version. - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.MetadataApi.GetVersion(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.GetVersion``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetVersion`: InlineResponse2001 - fmt.Fprintf(os.Stdout, "Response from `MetadataApi.GetVersion`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetVersionRequest struct via the builder pattern - - -### Return type - -[**InlineResponse2001**](InlineResponse2001.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## IsAlive - -> InlineResponse200 IsAlive(ctx).Execute() - -Check HTTP Server Status - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.MetadataApi.IsAlive(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.IsAlive``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `IsAlive`: InlineResponse200 - fmt.Fprintf(os.Stdout, "Response from `MetadataApi.IsAlive`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiIsAliveRequest struct via the builder pattern - - -### Return type - -[**InlineResponse200**](InlineResponse200.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## IsReady - -> InlineResponse200 IsReady(ctx).Execute() - -Check HTTP Server and Database Status - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.MetadataApi.IsReady(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.IsReady``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `IsReady`: InlineResponse200 - fmt.Fprintf(os.Stdout, "Response from `MetadataApi.IsReady`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiIsReadyRequest struct via the builder pattern - - -### Return type - -[**InlineResponse200**](InlineResponse200.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/internal/httpclient-next/docs/PatchDelta.md b/internal/httpclient-next/docs/PatchDelta.md deleted file mode 100644 index 858b94d99..000000000 --- a/internal/httpclient-next/docs/PatchDelta.md +++ /dev/null @@ -1,82 +0,0 @@ -# PatchDelta - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Action** | Pointer to **string** | | [optional] -**RelationTuple** | Pointer to [**InternalRelationTuple**](InternalRelationTuple.md) | | [optional] - -## Methods - -### NewPatchDelta - -`func NewPatchDelta() *PatchDelta` - -NewPatchDelta instantiates a new PatchDelta object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewPatchDeltaWithDefaults - -`func NewPatchDeltaWithDefaults() *PatchDelta` - -NewPatchDeltaWithDefaults instantiates a new PatchDelta object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetAction - -`func (o *PatchDelta) GetAction() string` - -GetAction returns the Action field if non-nil, zero value otherwise. - -### GetActionOk - -`func (o *PatchDelta) GetActionOk() (*string, bool)` - -GetActionOk returns a tuple with the Action field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetAction - -`func (o *PatchDelta) SetAction(v string)` - -SetAction sets Action field to given value. - -### HasAction - -`func (o *PatchDelta) HasAction() bool` - -HasAction returns a boolean if a field has been set. - -### GetRelationTuple - -`func (o *PatchDelta) GetRelationTuple() InternalRelationTuple` - -GetRelationTuple returns the RelationTuple field if non-nil, zero value otherwise. - -### GetRelationTupleOk - -`func (o *PatchDelta) GetRelationTupleOk() (*InternalRelationTuple, bool)` - -GetRelationTupleOk returns a tuple with the RelationTuple field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRelationTuple - -`func (o *PatchDelta) SetRelationTuple(v InternalRelationTuple)` - -SetRelationTuple sets RelationTuple field to given value. - -### HasRelationTuple - -`func (o *PatchDelta) HasRelationTuple() bool` - -HasRelationTuple returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/ReadApi.md b/internal/httpclient-next/docs/ReadApi.md deleted file mode 100644 index bb57fa395..000000000 --- a/internal/httpclient-next/docs/ReadApi.md +++ /dev/null @@ -1,314 +0,0 @@ -# \ReadApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GetCheck**](ReadApi.md#GetCheck) | **Get** /relation-tuples/check | Check a relation tuple -[**GetExpand**](ReadApi.md#GetExpand) | **Get** /relation-tuples/expand | Expand a Relation Tuple -[**GetRelationTuples**](ReadApi.md#GetRelationTuples) | **Get** /relation-tuples | Query relation tuples -[**PostCheck**](ReadApi.md#PostCheck) | **Post** /relation-tuples/check | Check a relation tuple - - - -## GetCheck - -> GetCheckResponse GetCheck(ctx).Namespace(namespace).Object(object).Relation(relation).SubjectId(subjectId).SubjectSetNamespace(subjectSetNamespace).SubjectSetObject(subjectSetObject).SubjectSetRelation(subjectSetRelation).MaxDepth(maxDepth).Execute() - -Check a relation tuple - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - namespace := "namespace_example" // string | Namespace of the Relation Tuple (optional) - object := "object_example" // string | Object of the Relation Tuple (optional) - relation := "relation_example" // string | Relation of the Relation Tuple (optional) - subjectId := "subjectId_example" // string | SubjectID of the Relation Tuple (optional) - subjectSetNamespace := "subjectSetNamespace_example" // string | Namespace of the Subject Set (optional) - subjectSetObject := "subjectSetObject_example" // string | Object of the Subject Set (optional) - subjectSetRelation := "subjectSetRelation_example" // string | Relation of the Subject Set (optional) - maxDepth := int64(789) // int64 | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ReadApi.GetCheck(context.Background()).Namespace(namespace).Object(object).Relation(relation).SubjectId(subjectId).SubjectSetNamespace(subjectSetNamespace).SubjectSetObject(subjectSetObject).SubjectSetRelation(subjectSetRelation).MaxDepth(maxDepth).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ReadApi.GetCheck``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetCheck`: GetCheckResponse - fmt.Fprintf(os.Stdout, "Response from `ReadApi.GetCheck`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetCheckRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **namespace** | **string** | Namespace of the Relation Tuple | - **object** | **string** | Object of the Relation Tuple | - **relation** | **string** | Relation of the Relation Tuple | - **subjectId** | **string** | SubjectID of the Relation Tuple | - **subjectSetNamespace** | **string** | Namespace of the Subject Set | - **subjectSetObject** | **string** | Object of the Subject Set | - **subjectSetRelation** | **string** | Relation of the Subject Set | - **maxDepth** | **int64** | | - -### Return type - -[**GetCheckResponse**](GetCheckResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetExpand - -> ExpandTree GetExpand(ctx).Namespace(namespace).Object(object).Relation(relation).MaxDepth(maxDepth).Execute() - -Expand a Relation Tuple - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - namespace := "namespace_example" // string | Namespace of the Subject Set - object := "object_example" // string | Object of the Subject Set - relation := "relation_example" // string | Relation of the Subject Set - maxDepth := int64(789) // int64 | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ReadApi.GetExpand(context.Background()).Namespace(namespace).Object(object).Relation(relation).MaxDepth(maxDepth).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ReadApi.GetExpand``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetExpand`: ExpandTree - fmt.Fprintf(os.Stdout, "Response from `ReadApi.GetExpand`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetExpandRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **namespace** | **string** | Namespace of the Subject Set | - **object** | **string** | Object of the Subject Set | - **relation** | **string** | Relation of the Subject Set | - **maxDepth** | **int64** | | - -### Return type - -[**ExpandTree**](ExpandTree.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## GetRelationTuples - -> GetRelationTuplesResponse GetRelationTuples(ctx).PageToken(pageToken).PageSize(pageSize).Namespace(namespace).Object(object).Relation(relation).SubjectId(subjectId).SubjectSetNamespace(subjectSetNamespace).SubjectSetObject(subjectSetObject).SubjectSetRelation(subjectSetRelation).Execute() - -Query relation tuples - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - pageToken := "pageToken_example" // string | (optional) - pageSize := int64(789) // int64 | (optional) - namespace := "namespace_example" // string | Namespace of the Relation Tuple (optional) - object := "object_example" // string | Object of the Relation Tuple (optional) - relation := "relation_example" // string | Relation of the Relation Tuple (optional) - subjectId := "subjectId_example" // string | SubjectID of the Relation Tuple (optional) - subjectSetNamespace := "subjectSetNamespace_example" // string | Namespace of the Subject Set (optional) - subjectSetObject := "subjectSetObject_example" // string | Object of the Subject Set (optional) - subjectSetRelation := "subjectSetRelation_example" // string | Relation of the Subject Set (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ReadApi.GetRelationTuples(context.Background()).PageToken(pageToken).PageSize(pageSize).Namespace(namespace).Object(object).Relation(relation).SubjectId(subjectId).SubjectSetNamespace(subjectSetNamespace).SubjectSetObject(subjectSetObject).SubjectSetRelation(subjectSetRelation).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ReadApi.GetRelationTuples``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetRelationTuples`: GetRelationTuplesResponse - fmt.Fprintf(os.Stdout, "Response from `ReadApi.GetRelationTuples`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiGetRelationTuplesRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pageToken** | **string** | | - **pageSize** | **int64** | | - **namespace** | **string** | Namespace of the Relation Tuple | - **object** | **string** | Object of the Relation Tuple | - **relation** | **string** | Relation of the Relation Tuple | - **subjectId** | **string** | SubjectID of the Relation Tuple | - **subjectSetNamespace** | **string** | Namespace of the Subject Set | - **subjectSetObject** | **string** | Object of the Subject Set | - **subjectSetRelation** | **string** | Relation of the Subject Set | - -### Return type - -[**GetRelationTuplesResponse**](GetRelationTuplesResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## PostCheck - -> GetCheckResponse PostCheck(ctx).MaxDepth(maxDepth).RelationQuery(relationQuery).Execute() - -Check a relation tuple - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - maxDepth := int64(789) // int64 | (optional) - relationQuery := *openapiclient.NewRelationQuery() // RelationQuery | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.ReadApi.PostCheck(context.Background()).MaxDepth(maxDepth).RelationQuery(relationQuery).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `ReadApi.PostCheck``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PostCheck`: GetCheckResponse - fmt.Fprintf(os.Stdout, "Response from `ReadApi.PostCheck`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiPostCheckRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **maxDepth** | **int64** | | - **relationQuery** | [**RelationQuery**](RelationQuery.md) | | - -### Return type - -[**GetCheckResponse**](GetCheckResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/internal/httpclient-next/docs/RelationQuery.md b/internal/httpclient-next/docs/RelationQuery.md deleted file mode 100644 index c76234e2a..000000000 --- a/internal/httpclient-next/docs/RelationQuery.md +++ /dev/null @@ -1,160 +0,0 @@ -# RelationQuery - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Namespace** | Pointer to **string** | Namespace of the Relation Tuple | [optional] -**Object** | Pointer to **string** | Object of the Relation Tuple | [optional] -**Relation** | Pointer to **string** | Relation of the Relation Tuple | [optional] -**SubjectId** | Pointer to **string** | SubjectID of the Relation Tuple Either SubjectSet or SubjectID can be provided. | [optional] -**SubjectSet** | Pointer to [**SubjectSet**](SubjectSet.md) | | [optional] - -## Methods - -### NewRelationQuery - -`func NewRelationQuery() *RelationQuery` - -NewRelationQuery instantiates a new RelationQuery object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewRelationQueryWithDefaults - -`func NewRelationQueryWithDefaults() *RelationQuery` - -NewRelationQueryWithDefaults instantiates a new RelationQuery object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetNamespace - -`func (o *RelationQuery) GetNamespace() string` - -GetNamespace returns the Namespace field if non-nil, zero value otherwise. - -### GetNamespaceOk - -`func (o *RelationQuery) GetNamespaceOk() (*string, bool)` - -GetNamespaceOk returns a tuple with the Namespace field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNamespace - -`func (o *RelationQuery) SetNamespace(v string)` - -SetNamespace sets Namespace field to given value. - -### HasNamespace - -`func (o *RelationQuery) HasNamespace() bool` - -HasNamespace returns a boolean if a field has been set. - -### GetObject - -`func (o *RelationQuery) GetObject() string` - -GetObject returns the Object field if non-nil, zero value otherwise. - -### GetObjectOk - -`func (o *RelationQuery) GetObjectOk() (*string, bool)` - -GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetObject - -`func (o *RelationQuery) SetObject(v string)` - -SetObject sets Object field to given value. - -### HasObject - -`func (o *RelationQuery) HasObject() bool` - -HasObject returns a boolean if a field has been set. - -### GetRelation - -`func (o *RelationQuery) GetRelation() string` - -GetRelation returns the Relation field if non-nil, zero value otherwise. - -### GetRelationOk - -`func (o *RelationQuery) GetRelationOk() (*string, bool)` - -GetRelationOk returns a tuple with the Relation field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRelation - -`func (o *RelationQuery) SetRelation(v string)` - -SetRelation sets Relation field to given value. - -### HasRelation - -`func (o *RelationQuery) HasRelation() bool` - -HasRelation returns a boolean if a field has been set. - -### GetSubjectId - -`func (o *RelationQuery) GetSubjectId() string` - -GetSubjectId returns the SubjectId field if non-nil, zero value otherwise. - -### GetSubjectIdOk - -`func (o *RelationQuery) GetSubjectIdOk() (*string, bool)` - -GetSubjectIdOk returns a tuple with the SubjectId field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSubjectId - -`func (o *RelationQuery) SetSubjectId(v string)` - -SetSubjectId sets SubjectId field to given value. - -### HasSubjectId - -`func (o *RelationQuery) HasSubjectId() bool` - -HasSubjectId returns a boolean if a field has been set. - -### GetSubjectSet - -`func (o *RelationQuery) GetSubjectSet() SubjectSet` - -GetSubjectSet returns the SubjectSet field if non-nil, zero value otherwise. - -### GetSubjectSetOk - -`func (o *RelationQuery) GetSubjectSetOk() (*SubjectSet, bool)` - -GetSubjectSetOk returns a tuple with the SubjectSet field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSubjectSet - -`func (o *RelationQuery) SetSubjectSet(v SubjectSet)` - -SetSubjectSet sets SubjectSet field to given value. - -### HasSubjectSet - -`func (o *RelationQuery) HasSubjectSet() bool` - -HasSubjectSet returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/SubjectSet.md b/internal/httpclient-next/docs/SubjectSet.md deleted file mode 100644 index 194228eda..000000000 --- a/internal/httpclient-next/docs/SubjectSet.md +++ /dev/null @@ -1,93 +0,0 @@ -# SubjectSet - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Namespace** | **string** | Namespace of the Subject Set | -**Object** | **string** | Object of the Subject Set | -**Relation** | **string** | Relation of the Subject Set | - -## Methods - -### NewSubjectSet - -`func NewSubjectSet(namespace string, object string, relation string, ) *SubjectSet` - -NewSubjectSet instantiates a new SubjectSet object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewSubjectSetWithDefaults - -`func NewSubjectSetWithDefaults() *SubjectSet` - -NewSubjectSetWithDefaults instantiates a new SubjectSet object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetNamespace - -`func (o *SubjectSet) GetNamespace() string` - -GetNamespace returns the Namespace field if non-nil, zero value otherwise. - -### GetNamespaceOk - -`func (o *SubjectSet) GetNamespaceOk() (*string, bool)` - -GetNamespaceOk returns a tuple with the Namespace field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetNamespace - -`func (o *SubjectSet) SetNamespace(v string)` - -SetNamespace sets Namespace field to given value. - - -### GetObject - -`func (o *SubjectSet) GetObject() string` - -GetObject returns the Object field if non-nil, zero value otherwise. - -### GetObjectOk - -`func (o *SubjectSet) GetObjectOk() (*string, bool)` - -GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetObject - -`func (o *SubjectSet) SetObject(v string)` - -SetObject sets Object field to given value. - - -### GetRelation - -`func (o *SubjectSet) GetRelation() string` - -GetRelation returns the Relation field if non-nil, zero value otherwise. - -### GetRelationOk - -`func (o *SubjectSet) GetRelationOk() (*string, bool)` - -GetRelationOk returns a tuple with the Relation field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRelation - -`func (o *SubjectSet) SetRelation(v string)` - -SetRelation sets Relation field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/Version.md b/internal/httpclient-next/docs/Version.md deleted file mode 100644 index c186956b8..000000000 --- a/internal/httpclient-next/docs/Version.md +++ /dev/null @@ -1,56 +0,0 @@ -# Version - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Version** | Pointer to **string** | Version is the service's version. | [optional] - -## Methods - -### NewVersion - -`func NewVersion() *Version` - -NewVersion instantiates a new Version object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewVersionWithDefaults - -`func NewVersionWithDefaults() *Version` - -NewVersionWithDefaults instantiates a new Version object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetVersion - -`func (o *Version) GetVersion() string` - -GetVersion returns the Version field if non-nil, zero value otherwise. - -### GetVersionOk - -`func (o *Version) GetVersionOk() (*string, bool)` - -GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetVersion - -`func (o *Version) SetVersion(v string)` - -SetVersion sets Version field to given value. - -### HasVersion - -`func (o *Version) HasVersion() bool` - -HasVersion returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/internal/httpclient-next/docs/WriteApi.md b/internal/httpclient-next/docs/WriteApi.md deleted file mode 100644 index 1115b05a8..000000000 --- a/internal/httpclient-next/docs/WriteApi.md +++ /dev/null @@ -1,217 +0,0 @@ -# \WriteApi - -All URIs are relative to *http://localhost* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CreateRelationTuple**](WriteApi.md#CreateRelationTuple) | **Put** /admin/relation-tuples | Create a Relation Tuple -[**DeleteRelationTuples**](WriteApi.md#DeleteRelationTuples) | **Delete** /admin/relation-tuples | Delete Relation Tuples -[**PatchRelationTuples**](WriteApi.md#PatchRelationTuples) | **Patch** /admin/relation-tuples | Patch Multiple Relation Tuples - - - -## CreateRelationTuple - -> RelationQuery CreateRelationTuple(ctx).RelationQuery(relationQuery).Execute() - -Create a Relation Tuple - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - relationQuery := *openapiclient.NewRelationQuery() // RelationQuery | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.WriteApi.CreateRelationTuple(context.Background()).RelationQuery(relationQuery).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `WriteApi.CreateRelationTuple``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `CreateRelationTuple`: RelationQuery - fmt.Fprintf(os.Stdout, "Response from `WriteApi.CreateRelationTuple`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateRelationTupleRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **relationQuery** | [**RelationQuery**](RelationQuery.md) | | - -### Return type - -[**RelationQuery**](RelationQuery.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## DeleteRelationTuples - -> DeleteRelationTuples(ctx).Namespace(namespace).Object(object).Relation(relation).SubjectId(subjectId).SubjectSetNamespace(subjectSetNamespace).SubjectSetObject(subjectSetObject).SubjectSetRelation(subjectSetRelation).Execute() - -Delete Relation Tuples - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - namespace := "namespace_example" // string | Namespace of the Relation Tuple (optional) - object := "object_example" // string | Object of the Relation Tuple (optional) - relation := "relation_example" // string | Relation of the Relation Tuple (optional) - subjectId := "subjectId_example" // string | SubjectID of the Relation Tuple (optional) - subjectSetNamespace := "subjectSetNamespace_example" // string | Namespace of the Subject Set (optional) - subjectSetObject := "subjectSetObject_example" // string | Object of the Subject Set (optional) - subjectSetRelation := "subjectSetRelation_example" // string | Relation of the Subject Set (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.WriteApi.DeleteRelationTuples(context.Background()).Namespace(namespace).Object(object).Relation(relation).SubjectId(subjectId).SubjectSetNamespace(subjectSetNamespace).SubjectSetObject(subjectSetObject).SubjectSetRelation(subjectSetRelation).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `WriteApi.DeleteRelationTuples``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiDeleteRelationTuplesRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **namespace** | **string** | Namespace of the Relation Tuple | - **object** | **string** | Object of the Relation Tuple | - **relation** | **string** | Relation of the Relation Tuple | - **subjectId** | **string** | SubjectID of the Relation Tuple | - **subjectSetNamespace** | **string** | Namespace of the Subject Set | - **subjectSetObject** | **string** | Object of the Subject Set | - **subjectSetRelation** | **string** | Relation of the Subject Set | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - - -## PatchRelationTuples - -> PatchRelationTuples(ctx).PatchDelta(patchDelta).Execute() - -Patch Multiple Relation Tuples - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - patchDelta := []openapiclient.PatchDelta{*openapiclient.NewPatchDelta()} // []PatchDelta | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.WriteApi.PatchRelationTuples(context.Background()).PatchDelta(patchDelta).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `WriteApi.PatchRelationTuples``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiPatchRelationTuplesRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **patchDelta** | [**[]PatchDelta**](PatchDelta.md) | | - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/internal/httpclient-next/git_push.sh b/internal/httpclient-next/git_push.sh deleted file mode 100644 index 18f76bfd9..000000000 --- a/internal/httpclient-next/git_push.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="ory" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="keto-client-go" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/internal/httpclient-next/go.mod b/internal/httpclient-next/go.mod deleted file mode 100644 index 518da9f48..000000000 --- a/internal/httpclient-next/go.mod +++ /dev/null @@ -1,7 +0,0 @@ -module github.com/ory/keto-client-go - -go 1.13 - -require ( - golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 -) diff --git a/internal/httpclient-next/go.sum b/internal/httpclient-next/go.sum deleted file mode 100644 index 734252e68..000000000 --- a/internal/httpclient-next/go.sum +++ /dev/null @@ -1,13 +0,0 @@ -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/internal/httpclient-next/model_expand_tree.go b/internal/httpclient-next/model_expand_tree.go deleted file mode 100644 index ca0843968..000000000 --- a/internal/httpclient-next/model_expand_tree.go +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// ExpandTree struct for ExpandTree -type ExpandTree struct { - Children []ExpandTree `json:"children,omitempty"` - SubjectId *string `json:"subject_id,omitempty"` - SubjectSet *SubjectSet `json:"subject_set,omitempty"` - Type string `json:"type"` -} - -// NewExpandTree instantiates a new ExpandTree object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewExpandTree(type_ string) *ExpandTree { - this := ExpandTree{} - this.Type = type_ - return &this -} - -// NewExpandTreeWithDefaults instantiates a new ExpandTree object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewExpandTreeWithDefaults() *ExpandTree { - this := ExpandTree{} - return &this -} - -// GetChildren returns the Children field value if set, zero value otherwise. -func (o *ExpandTree) GetChildren() []ExpandTree { - if o == nil || o.Children == nil { - var ret []ExpandTree - return ret - } - return o.Children -} - -// GetChildrenOk returns a tuple with the Children field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ExpandTree) GetChildrenOk() ([]ExpandTree, bool) { - if o == nil || o.Children == nil { - return nil, false - } - return o.Children, true -} - -// HasChildren returns a boolean if a field has been set. -func (o *ExpandTree) HasChildren() bool { - if o != nil && o.Children != nil { - return true - } - - return false -} - -// SetChildren gets a reference to the given []ExpandTree and assigns it to the Children field. -func (o *ExpandTree) SetChildren(v []ExpandTree) { - o.Children = v -} - -// GetSubjectId returns the SubjectId field value if set, zero value otherwise. -func (o *ExpandTree) GetSubjectId() string { - if o == nil || o.SubjectId == nil { - var ret string - return ret - } - return *o.SubjectId -} - -// GetSubjectIdOk returns a tuple with the SubjectId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ExpandTree) GetSubjectIdOk() (*string, bool) { - if o == nil || o.SubjectId == nil { - return nil, false - } - return o.SubjectId, true -} - -// HasSubjectId returns a boolean if a field has been set. -func (o *ExpandTree) HasSubjectId() bool { - if o != nil && o.SubjectId != nil { - return true - } - - return false -} - -// SetSubjectId gets a reference to the given string and assigns it to the SubjectId field. -func (o *ExpandTree) SetSubjectId(v string) { - o.SubjectId = &v -} - -// GetSubjectSet returns the SubjectSet field value if set, zero value otherwise. -func (o *ExpandTree) GetSubjectSet() SubjectSet { - if o == nil || o.SubjectSet == nil { - var ret SubjectSet - return ret - } - return *o.SubjectSet -} - -// GetSubjectSetOk returns a tuple with the SubjectSet field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ExpandTree) GetSubjectSetOk() (*SubjectSet, bool) { - if o == nil || o.SubjectSet == nil { - return nil, false - } - return o.SubjectSet, true -} - -// HasSubjectSet returns a boolean if a field has been set. -func (o *ExpandTree) HasSubjectSet() bool { - if o != nil && o.SubjectSet != nil { - return true - } - - return false -} - -// SetSubjectSet gets a reference to the given SubjectSet and assigns it to the SubjectSet field. -func (o *ExpandTree) SetSubjectSet(v SubjectSet) { - o.SubjectSet = &v -} - -// GetType returns the Type field value -func (o *ExpandTree) GetType() string { - if o == nil { - var ret string - return ret - } - - return o.Type -} - -// GetTypeOk returns a tuple with the Type field value -// and a boolean to check if the value has been set. -func (o *ExpandTree) GetTypeOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Type, true -} - -// SetType sets field value -func (o *ExpandTree) SetType(v string) { - o.Type = v -} - -func (o ExpandTree) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Children != nil { - toSerialize["children"] = o.Children - } - if o.SubjectId != nil { - toSerialize["subject_id"] = o.SubjectId - } - if o.SubjectSet != nil { - toSerialize["subject_set"] = o.SubjectSet - } - if true { - toSerialize["type"] = o.Type - } - return json.Marshal(toSerialize) -} - -type NullableExpandTree struct { - value *ExpandTree - isSet bool -} - -func (v NullableExpandTree) Get() *ExpandTree { - return v.value -} - -func (v *NullableExpandTree) Set(val *ExpandTree) { - v.value = val - v.isSet = true -} - -func (v NullableExpandTree) IsSet() bool { - return v.isSet -} - -func (v *NullableExpandTree) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableExpandTree(val *ExpandTree) *NullableExpandTree { - return &NullableExpandTree{value: val, isSet: true} -} - -func (v NullableExpandTree) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableExpandTree) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/model_generic_error.go b/internal/httpclient-next/model_generic_error.go deleted file mode 100644 index 434f770de..000000000 --- a/internal/httpclient-next/model_generic_error.go +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// GenericError The standard error format -type GenericError struct { - Code *int64 `json:"code,omitempty"` - Details []map[string]map[string]interface{} `json:"details,omitempty"` - Message *string `json:"message,omitempty"` - Reason *string `json:"reason,omitempty"` - Request *string `json:"request,omitempty"` - Status *string `json:"status,omitempty"` -} - -// NewGenericError instantiates a new GenericError object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewGenericError() *GenericError { - this := GenericError{} - return &this -} - -// NewGenericErrorWithDefaults instantiates a new GenericError object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewGenericErrorWithDefaults() *GenericError { - this := GenericError{} - return &this -} - -// GetCode returns the Code field value if set, zero value otherwise. -func (o *GenericError) GetCode() int64 { - if o == nil || o.Code == nil { - var ret int64 - return ret - } - return *o.Code -} - -// GetCodeOk returns a tuple with the Code field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GenericError) GetCodeOk() (*int64, bool) { - if o == nil || o.Code == nil { - return nil, false - } - return o.Code, true -} - -// HasCode returns a boolean if a field has been set. -func (o *GenericError) HasCode() bool { - if o != nil && o.Code != nil { - return true - } - - return false -} - -// SetCode gets a reference to the given int64 and assigns it to the Code field. -func (o *GenericError) SetCode(v int64) { - o.Code = &v -} - -// GetDetails returns the Details field value if set, zero value otherwise. -func (o *GenericError) GetDetails() []map[string]map[string]interface{} { - if o == nil || o.Details == nil { - var ret []map[string]map[string]interface{} - return ret - } - return o.Details -} - -// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GenericError) GetDetailsOk() ([]map[string]map[string]interface{}, bool) { - if o == nil || o.Details == nil { - return nil, false - } - return o.Details, true -} - -// HasDetails returns a boolean if a field has been set. -func (o *GenericError) HasDetails() bool { - if o != nil && o.Details != nil { - return true - } - - return false -} - -// SetDetails gets a reference to the given []map[string]map[string]interface{} and assigns it to the Details field. -func (o *GenericError) SetDetails(v []map[string]map[string]interface{}) { - o.Details = v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *GenericError) GetMessage() string { - if o == nil || o.Message == nil { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GenericError) GetMessageOk() (*string, bool) { - if o == nil || o.Message == nil { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *GenericError) HasMessage() bool { - if o != nil && o.Message != nil { - return true - } - - return false -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *GenericError) SetMessage(v string) { - o.Message = &v -} - -// GetReason returns the Reason field value if set, zero value otherwise. -func (o *GenericError) GetReason() string { - if o == nil || o.Reason == nil { - var ret string - return ret - } - return *o.Reason -} - -// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GenericError) GetReasonOk() (*string, bool) { - if o == nil || o.Reason == nil { - return nil, false - } - return o.Reason, true -} - -// HasReason returns a boolean if a field has been set. -func (o *GenericError) HasReason() bool { - if o != nil && o.Reason != nil { - return true - } - - return false -} - -// SetReason gets a reference to the given string and assigns it to the Reason field. -func (o *GenericError) SetReason(v string) { - o.Reason = &v -} - -// GetRequest returns the Request field value if set, zero value otherwise. -func (o *GenericError) GetRequest() string { - if o == nil || o.Request == nil { - var ret string - return ret - } - return *o.Request -} - -// GetRequestOk returns a tuple with the Request field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GenericError) GetRequestOk() (*string, bool) { - if o == nil || o.Request == nil { - return nil, false - } - return o.Request, true -} - -// HasRequest returns a boolean if a field has been set. -func (o *GenericError) HasRequest() bool { - if o != nil && o.Request != nil { - return true - } - - return false -} - -// SetRequest gets a reference to the given string and assigns it to the Request field. -func (o *GenericError) SetRequest(v string) { - o.Request = &v -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *GenericError) GetStatus() string { - if o == nil || o.Status == nil { - var ret string - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GenericError) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *GenericError) HasStatus() bool { - if o != nil && o.Status != nil { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *GenericError) SetStatus(v string) { - o.Status = &v -} - -func (o GenericError) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Code != nil { - toSerialize["code"] = o.Code - } - if o.Details != nil { - toSerialize["details"] = o.Details - } - if o.Message != nil { - toSerialize["message"] = o.Message - } - if o.Reason != nil { - toSerialize["reason"] = o.Reason - } - if o.Request != nil { - toSerialize["request"] = o.Request - } - if o.Status != nil { - toSerialize["status"] = o.Status - } - return json.Marshal(toSerialize) -} - -type NullableGenericError struct { - value *GenericError - isSet bool -} - -func (v NullableGenericError) Get() *GenericError { - return v.value -} - -func (v *NullableGenericError) Set(val *GenericError) { - v.value = val - v.isSet = true -} - -func (v NullableGenericError) IsSet() bool { - return v.isSet -} - -func (v *NullableGenericError) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGenericError(val *GenericError) *NullableGenericError { - return &NullableGenericError{value: val, isSet: true} -} - -func (v NullableGenericError) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGenericError) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/model_get_check_response.go b/internal/httpclient-next/model_get_check_response.go deleted file mode 100644 index e7cf58f88..000000000 --- a/internal/httpclient-next/model_get_check_response.go +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// GetCheckResponse The content of the allowed field is mirrored in the HTTP status code. -type GetCheckResponse struct { - // whether the relation tuple is allowed - Allowed bool `json:"allowed"` -} - -// NewGetCheckResponse instantiates a new GetCheckResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewGetCheckResponse(allowed bool) *GetCheckResponse { - this := GetCheckResponse{} - this.Allowed = allowed - return &this -} - -// NewGetCheckResponseWithDefaults instantiates a new GetCheckResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewGetCheckResponseWithDefaults() *GetCheckResponse { - this := GetCheckResponse{} - return &this -} - -// GetAllowed returns the Allowed field value -func (o *GetCheckResponse) GetAllowed() bool { - if o == nil { - var ret bool - return ret - } - - return o.Allowed -} - -// GetAllowedOk returns a tuple with the Allowed field value -// and a boolean to check if the value has been set. -func (o *GetCheckResponse) GetAllowedOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Allowed, true -} - -// SetAllowed sets field value -func (o *GetCheckResponse) SetAllowed(v bool) { - o.Allowed = v -} - -func (o GetCheckResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["allowed"] = o.Allowed - } - return json.Marshal(toSerialize) -} - -type NullableGetCheckResponse struct { - value *GetCheckResponse - isSet bool -} - -func (v NullableGetCheckResponse) Get() *GetCheckResponse { - return v.value -} - -func (v *NullableGetCheckResponse) Set(val *GetCheckResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetCheckResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetCheckResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetCheckResponse(val *GetCheckResponse) *NullableGetCheckResponse { - return &NullableGetCheckResponse{value: val, isSet: true} -} - -func (v NullableGetCheckResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetCheckResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/model_get_relation_tuples_response.go b/internal/httpclient-next/model_get_relation_tuples_response.go deleted file mode 100644 index 61bf89cbb..000000000 --- a/internal/httpclient-next/model_get_relation_tuples_response.go +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// GetRelationTuplesResponse struct for GetRelationTuplesResponse -type GetRelationTuplesResponse struct { - // The opaque token to provide in a subsequent request to get the next page. It is the empty string iff this is the last page. - NextPageToken *string `json:"next_page_token,omitempty"` - RelationTuples []InternalRelationTuple `json:"relation_tuples,omitempty"` -} - -// NewGetRelationTuplesResponse instantiates a new GetRelationTuplesResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewGetRelationTuplesResponse() *GetRelationTuplesResponse { - this := GetRelationTuplesResponse{} - return &this -} - -// NewGetRelationTuplesResponseWithDefaults instantiates a new GetRelationTuplesResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewGetRelationTuplesResponseWithDefaults() *GetRelationTuplesResponse { - this := GetRelationTuplesResponse{} - return &this -} - -// GetNextPageToken returns the NextPageToken field value if set, zero value otherwise. -func (o *GetRelationTuplesResponse) GetNextPageToken() string { - if o == nil || o.NextPageToken == nil { - var ret string - return ret - } - return *o.NextPageToken -} - -// GetNextPageTokenOk returns a tuple with the NextPageToken field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetRelationTuplesResponse) GetNextPageTokenOk() (*string, bool) { - if o == nil || o.NextPageToken == nil { - return nil, false - } - return o.NextPageToken, true -} - -// HasNextPageToken returns a boolean if a field has been set. -func (o *GetRelationTuplesResponse) HasNextPageToken() bool { - if o != nil && o.NextPageToken != nil { - return true - } - - return false -} - -// SetNextPageToken gets a reference to the given string and assigns it to the NextPageToken field. -func (o *GetRelationTuplesResponse) SetNextPageToken(v string) { - o.NextPageToken = &v -} - -// GetRelationTuples returns the RelationTuples field value if set, zero value otherwise. -func (o *GetRelationTuplesResponse) GetRelationTuples() []InternalRelationTuple { - if o == nil || o.RelationTuples == nil { - var ret []InternalRelationTuple - return ret - } - return o.RelationTuples -} - -// GetRelationTuplesOk returns a tuple with the RelationTuples field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *GetRelationTuplesResponse) GetRelationTuplesOk() ([]InternalRelationTuple, bool) { - if o == nil || o.RelationTuples == nil { - return nil, false - } - return o.RelationTuples, true -} - -// HasRelationTuples returns a boolean if a field has been set. -func (o *GetRelationTuplesResponse) HasRelationTuples() bool { - if o != nil && o.RelationTuples != nil { - return true - } - - return false -} - -// SetRelationTuples gets a reference to the given []InternalRelationTuple and assigns it to the RelationTuples field. -func (o *GetRelationTuplesResponse) SetRelationTuples(v []InternalRelationTuple) { - o.RelationTuples = v -} - -func (o GetRelationTuplesResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.NextPageToken != nil { - toSerialize["next_page_token"] = o.NextPageToken - } - if o.RelationTuples != nil { - toSerialize["relation_tuples"] = o.RelationTuples - } - return json.Marshal(toSerialize) -} - -type NullableGetRelationTuplesResponse struct { - value *GetRelationTuplesResponse - isSet bool -} - -func (v NullableGetRelationTuplesResponse) Get() *GetRelationTuplesResponse { - return v.value -} - -func (v *NullableGetRelationTuplesResponse) Set(val *GetRelationTuplesResponse) { - v.value = val - v.isSet = true -} - -func (v NullableGetRelationTuplesResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableGetRelationTuplesResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableGetRelationTuplesResponse(val *GetRelationTuplesResponse) *NullableGetRelationTuplesResponse { - return &NullableGetRelationTuplesResponse{value: val, isSet: true} -} - -func (v NullableGetRelationTuplesResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableGetRelationTuplesResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/model_health_not_ready_status.go b/internal/httpclient-next/model_health_not_ready_status.go deleted file mode 100644 index 0ecefbd16..000000000 --- a/internal/httpclient-next/model_health_not_ready_status.go +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// HealthNotReadyStatus struct for HealthNotReadyStatus -type HealthNotReadyStatus struct { - // Errors contains a list of errors that caused the not ready status. - Errors *map[string]string `json:"errors,omitempty"` -} - -// NewHealthNotReadyStatus instantiates a new HealthNotReadyStatus object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewHealthNotReadyStatus() *HealthNotReadyStatus { - this := HealthNotReadyStatus{} - return &this -} - -// NewHealthNotReadyStatusWithDefaults instantiates a new HealthNotReadyStatus object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewHealthNotReadyStatusWithDefaults() *HealthNotReadyStatus { - this := HealthNotReadyStatus{} - return &this -} - -// GetErrors returns the Errors field value if set, zero value otherwise. -func (o *HealthNotReadyStatus) GetErrors() map[string]string { - if o == nil || o.Errors == nil { - var ret map[string]string - return ret - } - return *o.Errors -} - -// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HealthNotReadyStatus) GetErrorsOk() (*map[string]string, bool) { - if o == nil || o.Errors == nil { - return nil, false - } - return o.Errors, true -} - -// HasErrors returns a boolean if a field has been set. -func (o *HealthNotReadyStatus) HasErrors() bool { - if o != nil && o.Errors != nil { - return true - } - - return false -} - -// SetErrors gets a reference to the given map[string]string and assigns it to the Errors field. -func (o *HealthNotReadyStatus) SetErrors(v map[string]string) { - o.Errors = &v -} - -func (o HealthNotReadyStatus) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Errors != nil { - toSerialize["errors"] = o.Errors - } - return json.Marshal(toSerialize) -} - -type NullableHealthNotReadyStatus struct { - value *HealthNotReadyStatus - isSet bool -} - -func (v NullableHealthNotReadyStatus) Get() *HealthNotReadyStatus { - return v.value -} - -func (v *NullableHealthNotReadyStatus) Set(val *HealthNotReadyStatus) { - v.value = val - v.isSet = true -} - -func (v NullableHealthNotReadyStatus) IsSet() bool { - return v.isSet -} - -func (v *NullableHealthNotReadyStatus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHealthNotReadyStatus(val *HealthNotReadyStatus) *NullableHealthNotReadyStatus { - return &NullableHealthNotReadyStatus{value: val, isSet: true} -} - -func (v NullableHealthNotReadyStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHealthNotReadyStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/model_health_status.go b/internal/httpclient-next/model_health_status.go deleted file mode 100644 index 0418134de..000000000 --- a/internal/httpclient-next/model_health_status.go +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// HealthStatus struct for HealthStatus -type HealthStatus struct { - // Status always contains \"ok\". - Status *string `json:"status,omitempty"` -} - -// NewHealthStatus instantiates a new HealthStatus object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewHealthStatus() *HealthStatus { - this := HealthStatus{} - return &this -} - -// NewHealthStatusWithDefaults instantiates a new HealthStatus object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewHealthStatusWithDefaults() *HealthStatus { - this := HealthStatus{} - return &this -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *HealthStatus) GetStatus() string { - if o == nil || o.Status == nil { - var ret string - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *HealthStatus) GetStatusOk() (*string, bool) { - if o == nil || o.Status == nil { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *HealthStatus) HasStatus() bool { - if o != nil && o.Status != nil { - return true - } - - return false -} - -// SetStatus gets a reference to the given string and assigns it to the Status field. -func (o *HealthStatus) SetStatus(v string) { - o.Status = &v -} - -func (o HealthStatus) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Status != nil { - toSerialize["status"] = o.Status - } - return json.Marshal(toSerialize) -} - -type NullableHealthStatus struct { - value *HealthStatus - isSet bool -} - -func (v NullableHealthStatus) Get() *HealthStatus { - return v.value -} - -func (v *NullableHealthStatus) Set(val *HealthStatus) { - v.value = val - v.isSet = true -} - -func (v NullableHealthStatus) IsSet() bool { - return v.isSet -} - -func (v *NullableHealthStatus) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableHealthStatus(val *HealthStatus) *NullableHealthStatus { - return &NullableHealthStatus{value: val, isSet: true} -} - -func (v NullableHealthStatus) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableHealthStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/model_inline_response_200.go b/internal/httpclient-next/model_inline_response_200.go deleted file mode 100644 index 9b003e2dd..000000000 --- a/internal/httpclient-next/model_inline_response_200.go +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// InlineResponse200 struct for InlineResponse200 -type InlineResponse200 struct { - // Always \"ok\". - Status string `json:"status"` -} - -// NewInlineResponse200 instantiates a new InlineResponse200 object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewInlineResponse200(status string) *InlineResponse200 { - this := InlineResponse200{} - this.Status = status - return &this -} - -// NewInlineResponse200WithDefaults instantiates a new InlineResponse200 object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewInlineResponse200WithDefaults() *InlineResponse200 { - this := InlineResponse200{} - return &this -} - -// GetStatus returns the Status field value -func (o *InlineResponse200) GetStatus() string { - if o == nil { - var ret string - return ret - } - - return o.Status -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -func (o *InlineResponse200) GetStatusOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Status, true -} - -// SetStatus sets field value -func (o *InlineResponse200) SetStatus(v string) { - o.Status = v -} - -func (o InlineResponse200) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["status"] = o.Status - } - return json.Marshal(toSerialize) -} - -type NullableInlineResponse200 struct { - value *InlineResponse200 - isSet bool -} - -func (v NullableInlineResponse200) Get() *InlineResponse200 { - return v.value -} - -func (v *NullableInlineResponse200) Set(val *InlineResponse200) { - v.value = val - v.isSet = true -} - -func (v NullableInlineResponse200) IsSet() bool { - return v.isSet -} - -func (v *NullableInlineResponse200) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInlineResponse200(val *InlineResponse200) *NullableInlineResponse200 { - return &NullableInlineResponse200{value: val, isSet: true} -} - -func (v NullableInlineResponse200) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInlineResponse200) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/model_inline_response_200_1.go b/internal/httpclient-next/model_inline_response_200_1.go deleted file mode 100644 index b49e8e744..000000000 --- a/internal/httpclient-next/model_inline_response_200_1.go +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// InlineResponse2001 struct for InlineResponse2001 -type InlineResponse2001 struct { - // The version of Ory Keto. - Version string `json:"version"` -} - -// NewInlineResponse2001 instantiates a new InlineResponse2001 object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewInlineResponse2001(version string) *InlineResponse2001 { - this := InlineResponse2001{} - this.Version = version - return &this -} - -// NewInlineResponse2001WithDefaults instantiates a new InlineResponse2001 object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewInlineResponse2001WithDefaults() *InlineResponse2001 { - this := InlineResponse2001{} - return &this -} - -// GetVersion returns the Version field value -func (o *InlineResponse2001) GetVersion() string { - if o == nil { - var ret string - return ret - } - - return o.Version -} - -// GetVersionOk returns a tuple with the Version field value -// and a boolean to check if the value has been set. -func (o *InlineResponse2001) GetVersionOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Version, true -} - -// SetVersion sets field value -func (o *InlineResponse2001) SetVersion(v string) { - o.Version = v -} - -func (o InlineResponse2001) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["version"] = o.Version - } - return json.Marshal(toSerialize) -} - -type NullableInlineResponse2001 struct { - value *InlineResponse2001 - isSet bool -} - -func (v NullableInlineResponse2001) Get() *InlineResponse2001 { - return v.value -} - -func (v *NullableInlineResponse2001) Set(val *InlineResponse2001) { - v.value = val - v.isSet = true -} - -func (v NullableInlineResponse2001) IsSet() bool { - return v.isSet -} - -func (v *NullableInlineResponse2001) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInlineResponse2001(val *InlineResponse2001) *NullableInlineResponse2001 { - return &NullableInlineResponse2001{value: val, isSet: true} -} - -func (v NullableInlineResponse2001) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInlineResponse2001) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/model_inline_response_503.go b/internal/httpclient-next/model_inline_response_503.go deleted file mode 100644 index 83e9d30d2..000000000 --- a/internal/httpclient-next/model_inline_response_503.go +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// InlineResponse503 struct for InlineResponse503 -type InlineResponse503 struct { - // Errors contains a list of errors that caused the not ready status. - Errors map[string]string `json:"errors"` -} - -// NewInlineResponse503 instantiates a new InlineResponse503 object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewInlineResponse503(errors map[string]string) *InlineResponse503 { - this := InlineResponse503{} - this.Errors = errors - return &this -} - -// NewInlineResponse503WithDefaults instantiates a new InlineResponse503 object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewInlineResponse503WithDefaults() *InlineResponse503 { - this := InlineResponse503{} - return &this -} - -// GetErrors returns the Errors field value -func (o *InlineResponse503) GetErrors() map[string]string { - if o == nil { - var ret map[string]string - return ret - } - - return o.Errors -} - -// GetErrorsOk returns a tuple with the Errors field value -// and a boolean to check if the value has been set. -func (o *InlineResponse503) GetErrorsOk() (*map[string]string, bool) { - if o == nil { - return nil, false - } - return &o.Errors, true -} - -// SetErrors sets field value -func (o *InlineResponse503) SetErrors(v map[string]string) { - o.Errors = v -} - -func (o InlineResponse503) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["errors"] = o.Errors - } - return json.Marshal(toSerialize) -} - -type NullableInlineResponse503 struct { - value *InlineResponse503 - isSet bool -} - -func (v NullableInlineResponse503) Get() *InlineResponse503 { - return v.value -} - -func (v *NullableInlineResponse503) Set(val *InlineResponse503) { - v.value = val - v.isSet = true -} - -func (v NullableInlineResponse503) IsSet() bool { - return v.isSet -} - -func (v *NullableInlineResponse503) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInlineResponse503(val *InlineResponse503) *NullableInlineResponse503 { - return &NullableInlineResponse503{value: val, isSet: true} -} - -func (v NullableInlineResponse503) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInlineResponse503) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/model_internal_relation_tuple.go b/internal/httpclient-next/model_internal_relation_tuple.go deleted file mode 100644 index 2bab98f39..000000000 --- a/internal/httpclient-next/model_internal_relation_tuple.go +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// InternalRelationTuple struct for InternalRelationTuple -type InternalRelationTuple struct { - // Namespace of the Relation Tuple - Namespace string `json:"namespace"` - // Object of the Relation Tuple - Object string `json:"object"` - // Relation of the Relation Tuple - Relation string `json:"relation"` - // SubjectID of the Relation Tuple Either SubjectSet or SubjectID are required. - SubjectId *string `json:"subject_id,omitempty"` - SubjectSet *SubjectSet `json:"subject_set,omitempty"` -} - -// NewInternalRelationTuple instantiates a new InternalRelationTuple object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewInternalRelationTuple(namespace string, object string, relation string) *InternalRelationTuple { - this := InternalRelationTuple{} - this.Namespace = namespace - this.Object = object - this.Relation = relation - return &this -} - -// NewInternalRelationTupleWithDefaults instantiates a new InternalRelationTuple object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewInternalRelationTupleWithDefaults() *InternalRelationTuple { - this := InternalRelationTuple{} - return &this -} - -// GetNamespace returns the Namespace field value -func (o *InternalRelationTuple) GetNamespace() string { - if o == nil { - var ret string - return ret - } - - return o.Namespace -} - -// GetNamespaceOk returns a tuple with the Namespace field value -// and a boolean to check if the value has been set. -func (o *InternalRelationTuple) GetNamespaceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Namespace, true -} - -// SetNamespace sets field value -func (o *InternalRelationTuple) SetNamespace(v string) { - o.Namespace = v -} - -// GetObject returns the Object field value -func (o *InternalRelationTuple) GetObject() string { - if o == nil { - var ret string - return ret - } - - return o.Object -} - -// GetObjectOk returns a tuple with the Object field value -// and a boolean to check if the value has been set. -func (o *InternalRelationTuple) GetObjectOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Object, true -} - -// SetObject sets field value -func (o *InternalRelationTuple) SetObject(v string) { - o.Object = v -} - -// GetRelation returns the Relation field value -func (o *InternalRelationTuple) GetRelation() string { - if o == nil { - var ret string - return ret - } - - return o.Relation -} - -// GetRelationOk returns a tuple with the Relation field value -// and a boolean to check if the value has been set. -func (o *InternalRelationTuple) GetRelationOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Relation, true -} - -// SetRelation sets field value -func (o *InternalRelationTuple) SetRelation(v string) { - o.Relation = v -} - -// GetSubjectId returns the SubjectId field value if set, zero value otherwise. -func (o *InternalRelationTuple) GetSubjectId() string { - if o == nil || o.SubjectId == nil { - var ret string - return ret - } - return *o.SubjectId -} - -// GetSubjectIdOk returns a tuple with the SubjectId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InternalRelationTuple) GetSubjectIdOk() (*string, bool) { - if o == nil || o.SubjectId == nil { - return nil, false - } - return o.SubjectId, true -} - -// HasSubjectId returns a boolean if a field has been set. -func (o *InternalRelationTuple) HasSubjectId() bool { - if o != nil && o.SubjectId != nil { - return true - } - - return false -} - -// SetSubjectId gets a reference to the given string and assigns it to the SubjectId field. -func (o *InternalRelationTuple) SetSubjectId(v string) { - o.SubjectId = &v -} - -// GetSubjectSet returns the SubjectSet field value if set, zero value otherwise. -func (o *InternalRelationTuple) GetSubjectSet() SubjectSet { - if o == nil || o.SubjectSet == nil { - var ret SubjectSet - return ret - } - return *o.SubjectSet -} - -// GetSubjectSetOk returns a tuple with the SubjectSet field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *InternalRelationTuple) GetSubjectSetOk() (*SubjectSet, bool) { - if o == nil || o.SubjectSet == nil { - return nil, false - } - return o.SubjectSet, true -} - -// HasSubjectSet returns a boolean if a field has been set. -func (o *InternalRelationTuple) HasSubjectSet() bool { - if o != nil && o.SubjectSet != nil { - return true - } - - return false -} - -// SetSubjectSet gets a reference to the given SubjectSet and assigns it to the SubjectSet field. -func (o *InternalRelationTuple) SetSubjectSet(v SubjectSet) { - o.SubjectSet = &v -} - -func (o InternalRelationTuple) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["namespace"] = o.Namespace - } - if true { - toSerialize["object"] = o.Object - } - if true { - toSerialize["relation"] = o.Relation - } - if o.SubjectId != nil { - toSerialize["subject_id"] = o.SubjectId - } - if o.SubjectSet != nil { - toSerialize["subject_set"] = o.SubjectSet - } - return json.Marshal(toSerialize) -} - -type NullableInternalRelationTuple struct { - value *InternalRelationTuple - isSet bool -} - -func (v NullableInternalRelationTuple) Get() *InternalRelationTuple { - return v.value -} - -func (v *NullableInternalRelationTuple) Set(val *InternalRelationTuple) { - v.value = val - v.isSet = true -} - -func (v NullableInternalRelationTuple) IsSet() bool { - return v.isSet -} - -func (v *NullableInternalRelationTuple) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInternalRelationTuple(val *InternalRelationTuple) *NullableInternalRelationTuple { - return &NullableInternalRelationTuple{value: val, isSet: true} -} - -func (v NullableInternalRelationTuple) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInternalRelationTuple) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/model_patch_delta.go b/internal/httpclient-next/model_patch_delta.go deleted file mode 100644 index 90976e2ed..000000000 --- a/internal/httpclient-next/model_patch_delta.go +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// PatchDelta struct for PatchDelta -type PatchDelta struct { - Action *string `json:"action,omitempty"` - RelationTuple *InternalRelationTuple `json:"relation_tuple,omitempty"` -} - -// NewPatchDelta instantiates a new PatchDelta object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewPatchDelta() *PatchDelta { - this := PatchDelta{} - return &this -} - -// NewPatchDeltaWithDefaults instantiates a new PatchDelta object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewPatchDeltaWithDefaults() *PatchDelta { - this := PatchDelta{} - return &this -} - -// GetAction returns the Action field value if set, zero value otherwise. -func (o *PatchDelta) GetAction() string { - if o == nil || o.Action == nil { - var ret string - return ret - } - return *o.Action -} - -// GetActionOk returns a tuple with the Action field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PatchDelta) GetActionOk() (*string, bool) { - if o == nil || o.Action == nil { - return nil, false - } - return o.Action, true -} - -// HasAction returns a boolean if a field has been set. -func (o *PatchDelta) HasAction() bool { - if o != nil && o.Action != nil { - return true - } - - return false -} - -// SetAction gets a reference to the given string and assigns it to the Action field. -func (o *PatchDelta) SetAction(v string) { - o.Action = &v -} - -// GetRelationTuple returns the RelationTuple field value if set, zero value otherwise. -func (o *PatchDelta) GetRelationTuple() InternalRelationTuple { - if o == nil || o.RelationTuple == nil { - var ret InternalRelationTuple - return ret - } - return *o.RelationTuple -} - -// GetRelationTupleOk returns a tuple with the RelationTuple field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PatchDelta) GetRelationTupleOk() (*InternalRelationTuple, bool) { - if o == nil || o.RelationTuple == nil { - return nil, false - } - return o.RelationTuple, true -} - -// HasRelationTuple returns a boolean if a field has been set. -func (o *PatchDelta) HasRelationTuple() bool { - if o != nil && o.RelationTuple != nil { - return true - } - - return false -} - -// SetRelationTuple gets a reference to the given InternalRelationTuple and assigns it to the RelationTuple field. -func (o *PatchDelta) SetRelationTuple(v InternalRelationTuple) { - o.RelationTuple = &v -} - -func (o PatchDelta) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Action != nil { - toSerialize["action"] = o.Action - } - if o.RelationTuple != nil { - toSerialize["relation_tuple"] = o.RelationTuple - } - return json.Marshal(toSerialize) -} - -type NullablePatchDelta struct { - value *PatchDelta - isSet bool -} - -func (v NullablePatchDelta) Get() *PatchDelta { - return v.value -} - -func (v *NullablePatchDelta) Set(val *PatchDelta) { - v.value = val - v.isSet = true -} - -func (v NullablePatchDelta) IsSet() bool { - return v.isSet -} - -func (v *NullablePatchDelta) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullablePatchDelta(val *PatchDelta) *NullablePatchDelta { - return &NullablePatchDelta{value: val, isSet: true} -} - -func (v NullablePatchDelta) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullablePatchDelta) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/model_relation_query.go b/internal/httpclient-next/model_relation_query.go deleted file mode 100644 index b17597f60..000000000 --- a/internal/httpclient-next/model_relation_query.go +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// RelationQuery struct for RelationQuery -type RelationQuery struct { - // Namespace of the Relation Tuple - Namespace *string `json:"namespace,omitempty"` - // Object of the Relation Tuple - Object *string `json:"object,omitempty"` - // Relation of the Relation Tuple - Relation *string `json:"relation,omitempty"` - // SubjectID of the Relation Tuple Either SubjectSet or SubjectID can be provided. - SubjectId *string `json:"subject_id,omitempty"` - SubjectSet *SubjectSet `json:"subject_set,omitempty"` -} - -// NewRelationQuery instantiates a new RelationQuery object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRelationQuery() *RelationQuery { - this := RelationQuery{} - return &this -} - -// NewRelationQueryWithDefaults instantiates a new RelationQuery object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRelationQueryWithDefaults() *RelationQuery { - this := RelationQuery{} - return &this -} - -// GetNamespace returns the Namespace field value if set, zero value otherwise. -func (o *RelationQuery) GetNamespace() string { - if o == nil || o.Namespace == nil { - var ret string - return ret - } - return *o.Namespace -} - -// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RelationQuery) GetNamespaceOk() (*string, bool) { - if o == nil || o.Namespace == nil { - return nil, false - } - return o.Namespace, true -} - -// HasNamespace returns a boolean if a field has been set. -func (o *RelationQuery) HasNamespace() bool { - if o != nil && o.Namespace != nil { - return true - } - - return false -} - -// SetNamespace gets a reference to the given string and assigns it to the Namespace field. -func (o *RelationQuery) SetNamespace(v string) { - o.Namespace = &v -} - -// GetObject returns the Object field value if set, zero value otherwise. -func (o *RelationQuery) GetObject() string { - if o == nil || o.Object == nil { - var ret string - return ret - } - return *o.Object -} - -// GetObjectOk returns a tuple with the Object field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RelationQuery) GetObjectOk() (*string, bool) { - if o == nil || o.Object == nil { - return nil, false - } - return o.Object, true -} - -// HasObject returns a boolean if a field has been set. -func (o *RelationQuery) HasObject() bool { - if o != nil && o.Object != nil { - return true - } - - return false -} - -// SetObject gets a reference to the given string and assigns it to the Object field. -func (o *RelationQuery) SetObject(v string) { - o.Object = &v -} - -// GetRelation returns the Relation field value if set, zero value otherwise. -func (o *RelationQuery) GetRelation() string { - if o == nil || o.Relation == nil { - var ret string - return ret - } - return *o.Relation -} - -// GetRelationOk returns a tuple with the Relation field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RelationQuery) GetRelationOk() (*string, bool) { - if o == nil || o.Relation == nil { - return nil, false - } - return o.Relation, true -} - -// HasRelation returns a boolean if a field has been set. -func (o *RelationQuery) HasRelation() bool { - if o != nil && o.Relation != nil { - return true - } - - return false -} - -// SetRelation gets a reference to the given string and assigns it to the Relation field. -func (o *RelationQuery) SetRelation(v string) { - o.Relation = &v -} - -// GetSubjectId returns the SubjectId field value if set, zero value otherwise. -func (o *RelationQuery) GetSubjectId() string { - if o == nil || o.SubjectId == nil { - var ret string - return ret - } - return *o.SubjectId -} - -// GetSubjectIdOk returns a tuple with the SubjectId field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RelationQuery) GetSubjectIdOk() (*string, bool) { - if o == nil || o.SubjectId == nil { - return nil, false - } - return o.SubjectId, true -} - -// HasSubjectId returns a boolean if a field has been set. -func (o *RelationQuery) HasSubjectId() bool { - if o != nil && o.SubjectId != nil { - return true - } - - return false -} - -// SetSubjectId gets a reference to the given string and assigns it to the SubjectId field. -func (o *RelationQuery) SetSubjectId(v string) { - o.SubjectId = &v -} - -// GetSubjectSet returns the SubjectSet field value if set, zero value otherwise. -func (o *RelationQuery) GetSubjectSet() SubjectSet { - if o == nil || o.SubjectSet == nil { - var ret SubjectSet - return ret - } - return *o.SubjectSet -} - -// GetSubjectSetOk returns a tuple with the SubjectSet field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RelationQuery) GetSubjectSetOk() (*SubjectSet, bool) { - if o == nil || o.SubjectSet == nil { - return nil, false - } - return o.SubjectSet, true -} - -// HasSubjectSet returns a boolean if a field has been set. -func (o *RelationQuery) HasSubjectSet() bool { - if o != nil && o.SubjectSet != nil { - return true - } - - return false -} - -// SetSubjectSet gets a reference to the given SubjectSet and assigns it to the SubjectSet field. -func (o *RelationQuery) SetSubjectSet(v SubjectSet) { - o.SubjectSet = &v -} - -func (o RelationQuery) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Namespace != nil { - toSerialize["namespace"] = o.Namespace - } - if o.Object != nil { - toSerialize["object"] = o.Object - } - if o.Relation != nil { - toSerialize["relation"] = o.Relation - } - if o.SubjectId != nil { - toSerialize["subject_id"] = o.SubjectId - } - if o.SubjectSet != nil { - toSerialize["subject_set"] = o.SubjectSet - } - return json.Marshal(toSerialize) -} - -type NullableRelationQuery struct { - value *RelationQuery - isSet bool -} - -func (v NullableRelationQuery) Get() *RelationQuery { - return v.value -} - -func (v *NullableRelationQuery) Set(val *RelationQuery) { - v.value = val - v.isSet = true -} - -func (v NullableRelationQuery) IsSet() bool { - return v.isSet -} - -func (v *NullableRelationQuery) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRelationQuery(val *RelationQuery) *NullableRelationQuery { - return &NullableRelationQuery{value: val, isSet: true} -} - -func (v NullableRelationQuery) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRelationQuery) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/model_subject_set.go b/internal/httpclient-next/model_subject_set.go deleted file mode 100644 index 734d8740a..000000000 --- a/internal/httpclient-next/model_subject_set.go +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// SubjectSet struct for SubjectSet -type SubjectSet struct { - // Namespace of the Subject Set - Namespace string `json:"namespace"` - // Object of the Subject Set - Object string `json:"object"` - // Relation of the Subject Set - Relation string `json:"relation"` -} - -// NewSubjectSet instantiates a new SubjectSet object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewSubjectSet(namespace string, object string, relation string) *SubjectSet { - this := SubjectSet{} - this.Namespace = namespace - this.Object = object - this.Relation = relation - return &this -} - -// NewSubjectSetWithDefaults instantiates a new SubjectSet object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewSubjectSetWithDefaults() *SubjectSet { - this := SubjectSet{} - return &this -} - -// GetNamespace returns the Namespace field value -func (o *SubjectSet) GetNamespace() string { - if o == nil { - var ret string - return ret - } - - return o.Namespace -} - -// GetNamespaceOk returns a tuple with the Namespace field value -// and a boolean to check if the value has been set. -func (o *SubjectSet) GetNamespaceOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Namespace, true -} - -// SetNamespace sets field value -func (o *SubjectSet) SetNamespace(v string) { - o.Namespace = v -} - -// GetObject returns the Object field value -func (o *SubjectSet) GetObject() string { - if o == nil { - var ret string - return ret - } - - return o.Object -} - -// GetObjectOk returns a tuple with the Object field value -// and a boolean to check if the value has been set. -func (o *SubjectSet) GetObjectOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Object, true -} - -// SetObject sets field value -func (o *SubjectSet) SetObject(v string) { - o.Object = v -} - -// GetRelation returns the Relation field value -func (o *SubjectSet) GetRelation() string { - if o == nil { - var ret string - return ret - } - - return o.Relation -} - -// GetRelationOk returns a tuple with the Relation field value -// and a boolean to check if the value has been set. -func (o *SubjectSet) GetRelationOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Relation, true -} - -// SetRelation sets field value -func (o *SubjectSet) SetRelation(v string) { - o.Relation = v -} - -func (o SubjectSet) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["namespace"] = o.Namespace - } - if true { - toSerialize["object"] = o.Object - } - if true { - toSerialize["relation"] = o.Relation - } - return json.Marshal(toSerialize) -} - -type NullableSubjectSet struct { - value *SubjectSet - isSet bool -} - -func (v NullableSubjectSet) Get() *SubjectSet { - return v.value -} - -func (v *NullableSubjectSet) Set(val *SubjectSet) { - v.value = val - v.isSet = true -} - -func (v NullableSubjectSet) IsSet() bool { - return v.isSet -} - -func (v *NullableSubjectSet) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSubjectSet(val *SubjectSet) *NullableSubjectSet { - return &NullableSubjectSet{value: val, isSet: true} -} - -func (v NullableSubjectSet) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSubjectSet) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/model_version.go b/internal/httpclient-next/model_version.go deleted file mode 100644 index d26c45cc9..000000000 --- a/internal/httpclient-next/model_version.go +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" -) - -// Version struct for Version -type Version struct { - // Version is the service's version. - Version *string `json:"version,omitempty"` -} - -// NewVersion instantiates a new Version object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewVersion() *Version { - this := Version{} - return &this -} - -// NewVersionWithDefaults instantiates a new Version object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewVersionWithDefaults() *Version { - this := Version{} - return &this -} - -// GetVersion returns the Version field value if set, zero value otherwise. -func (o *Version) GetVersion() string { - if o == nil || o.Version == nil { - var ret string - return ret - } - return *o.Version -} - -// GetVersionOk returns a tuple with the Version field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Version) GetVersionOk() (*string, bool) { - if o == nil || o.Version == nil { - return nil, false - } - return o.Version, true -} - -// HasVersion returns a boolean if a field has been set. -func (o *Version) HasVersion() bool { - if o != nil && o.Version != nil { - return true - } - - return false -} - -// SetVersion gets a reference to the given string and assigns it to the Version field. -func (o *Version) SetVersion(v string) { - o.Version = &v -} - -func (o Version) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Version != nil { - toSerialize["version"] = o.Version - } - return json.Marshal(toSerialize) -} - -type NullableVersion struct { - value *Version - isSet bool -} - -func (v NullableVersion) Get() *Version { - return v.value -} - -func (v *NullableVersion) Set(val *Version) { - v.value = val - v.isSet = true -} - -func (v NullableVersion) IsSet() bool { - return v.isSet -} - -func (v *NullableVersion) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableVersion(val *Version) *NullableVersion { - return &NullableVersion{value: val, isSet: true} -} - -func (v NullableVersion) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableVersion) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient-next/response.go b/internal/httpclient-next/response.go deleted file mode 100644 index 819fae029..000000000 --- a/internal/httpclient-next/response.go +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "net/http" -) - -// APIResponse stores the API response returned by the server. -type APIResponse struct { - *http.Response `json:"-"` - Message string `json:"message,omitempty"` - // Operation is the name of the OpenAPI operation. - Operation string `json:"operation,omitempty"` - // RequestURL is the request URL. This value is always available, even if the - // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` - // Method is the HTTP method used for the request. This value is always - // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` - // Payload holds the contents of the response body (which may be nil or empty). - // This is provided here as the raw response.Body() reader will have already - // been drained. - Payload []byte `json:"-"` -} - -// NewAPIResponse returns a new APIResonse object. -func NewAPIResponse(r *http.Response) *APIResponse { - - response := &APIResponse{Response: r} - return response -} - -// NewAPIResponseWithError returns a new APIResponse object with the provided error message. -func NewAPIResponseWithError(errorMessage string) *APIResponse { - - response := &APIResponse{Message: errorMessage} - return response -} diff --git a/internal/httpclient-next/utils.go b/internal/httpclient-next/utils.go deleted file mode 100644 index 39e2e31cd..000000000 --- a/internal/httpclient-next/utils.go +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Ory Keto API - * - * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. - * - * API version: 1.0.0 - * Contact: hi@ory.sh - */ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package client - -import ( - "encoding/json" - "time" -) - -// PtrBool is a helper routine that returns a pointer to given boolean value. -func PtrBool(v bool) *bool { return &v } - -// PtrInt is a helper routine that returns a pointer to given integer value. -func PtrInt(v int) *int { return &v } - -// PtrInt32 is a helper routine that returns a pointer to given integer value. -func PtrInt32(v int32) *int32 { return &v } - -// PtrInt64 is a helper routine that returns a pointer to given integer value. -func PtrInt64(v int64) *int64 { return &v } - -// PtrFloat32 is a helper routine that returns a pointer to given float value. -func PtrFloat32(v float32) *float32 { return &v } - -// PtrFloat64 is a helper routine that returns a pointer to given float value. -func PtrFloat64(v float64) *float64 { return &v } - -// PtrString is a helper routine that returns a pointer to given string value. -func PtrString(v string) *string { return &v } - -// PtrTime is helper routine that returns a pointer to given Time value. -func PtrTime(v time.Time) *time.Time { return &v } - -type NullableBool struct { - value *bool - isSet bool -} - -func (v NullableBool) Get() *bool { - return v.value -} - -func (v *NullableBool) Set(val *bool) { - v.value = val - v.isSet = true -} - -func (v NullableBool) IsSet() bool { - return v.isSet -} - -func (v *NullableBool) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBool(val *bool) *NullableBool { - return &NullableBool{value: val, isSet: true} -} - -func (v NullableBool) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBool) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt struct { - value *int - isSet bool -} - -func (v NullableInt) Get() *int { - return v.value -} - -func (v *NullableInt) Set(val *int) { - v.value = val - v.isSet = true -} - -func (v NullableInt) IsSet() bool { - return v.isSet -} - -func (v *NullableInt) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt(val *int) *NullableInt { - return &NullableInt{value: val, isSet: true} -} - -func (v NullableInt) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt32 struct { - value *int32 - isSet bool -} - -func (v NullableInt32) Get() *int32 { - return v.value -} - -func (v *NullableInt32) Set(val *int32) { - v.value = val - v.isSet = true -} - -func (v NullableInt32) IsSet() bool { - return v.isSet -} - -func (v *NullableInt32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt32(val *int32) *NullableInt32 { - return &NullableInt32{value: val, isSet: true} -} - -func (v NullableInt32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt64 struct { - value *int64 - isSet bool -} - -func (v NullableInt64) Get() *int64 { - return v.value -} - -func (v *NullableInt64) Set(val *int64) { - v.value = val - v.isSet = true -} - -func (v NullableInt64) IsSet() bool { - return v.isSet -} - -func (v *NullableInt64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt64(val *int64) *NullableInt64 { - return &NullableInt64{value: val, isSet: true} -} - -func (v NullableInt64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat32 struct { - value *float32 - isSet bool -} - -func (v NullableFloat32) Get() *float32 { - return v.value -} - -func (v *NullableFloat32) Set(val *float32) { - v.value = val - v.isSet = true -} - -func (v NullableFloat32) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat32(val *float32) *NullableFloat32 { - return &NullableFloat32{value: val, isSet: true} -} - -func (v NullableFloat32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat64 struct { - value *float64 - isSet bool -} - -func (v NullableFloat64) Get() *float64 { - return v.value -} - -func (v *NullableFloat64) Set(val *float64) { - v.value = val - v.isSet = true -} - -func (v NullableFloat64) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat64(val *float64) *NullableFloat64 { - return &NullableFloat64{value: val, isSet: true} -} - -func (v NullableFloat64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableString struct { - value *string - isSet bool -} - -func (v NullableString) Get() *string { - return v.value -} - -func (v *NullableString) Set(val *string) { - v.value = val - v.isSet = true -} - -func (v NullableString) IsSet() bool { - return v.isSet -} - -func (v *NullableString) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableString(val *string) *NullableString { - return &NullableString{value: val, isSet: true} -} - -func (v NullableString) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableString) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableTime struct { - value *time.Time - isSet bool -} - -func (v NullableTime) Get() *time.Time { - return v.value -} - -func (v *NullableTime) Set(val *time.Time) { - v.value = val - v.isSet = true -} - -func (v NullableTime) IsSet() bool { - return v.isSet -} - -func (v *NullableTime) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTime(val *time.Time) *NullableTime { - return &NullableTime{value: val, isSet: true} -} - -func (v NullableTime) MarshalJSON() ([]byte, error) { - return v.value.MarshalJSON() -} - -func (v *NullableTime) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/internal/httpclient/client/read/get_check_responses.go b/internal/httpclient/client/read/get_check_responses.go index 17d8aae46..bfaa42ec1 100644 --- a/internal/httpclient/client/read/get_check_responses.go +++ b/internal/httpclient/client/read/get_check_responses.go @@ -66,7 +66,7 @@ type GetCheckOK struct { } func (o *GetCheckOK) Error() string { - return fmt.Sprintf("[GET /relation-tuples/check][%d] getCheckOK %+v", 200, o.Payload) + return fmt.Sprintf("[GET /relation-tuples/check/openapi][%d] getCheckOK %+v", 200, o.Payload) } func (o *GetCheckOK) GetPayload() *models.GetCheckResponse { return o.Payload @@ -98,7 +98,7 @@ type GetCheckBadRequest struct { } func (o *GetCheckBadRequest) Error() string { - return fmt.Sprintf("[GET /relation-tuples/check][%d] getCheckBadRequest %+v", 400, o.Payload) + return fmt.Sprintf("[GET /relation-tuples/check/openapi][%d] getCheckBadRequest %+v", 400, o.Payload) } func (o *GetCheckBadRequest) GetPayload() *models.GenericError { return o.Payload @@ -130,7 +130,7 @@ type GetCheckForbidden struct { } func (o *GetCheckForbidden) Error() string { - return fmt.Sprintf("[GET /relation-tuples/check][%d] getCheckForbidden %+v", 403, o.Payload) + return fmt.Sprintf("[GET /relation-tuples/check/openapi][%d] getCheckForbidden %+v", 403, o.Payload) } func (o *GetCheckForbidden) GetPayload() *models.GetCheckResponse { return o.Payload @@ -162,7 +162,7 @@ type GetCheckInternalServerError struct { } func (o *GetCheckInternalServerError) Error() string { - return fmt.Sprintf("[GET /relation-tuples/check][%d] getCheckInternalServerError %+v", 500, o.Payload) + return fmt.Sprintf("[GET /relation-tuples/check/openapi][%d] getCheckInternalServerError %+v", 500, o.Payload) } func (o *GetCheckInternalServerError) GetPayload() *models.GenericError { return o.Payload diff --git a/internal/httpclient/client/read/post_check_responses.go b/internal/httpclient/client/read/post_check_responses.go index 4839b24d9..851f4b9c6 100644 --- a/internal/httpclient/client/read/post_check_responses.go +++ b/internal/httpclient/client/read/post_check_responses.go @@ -66,7 +66,7 @@ type PostCheckOK struct { } func (o *PostCheckOK) Error() string { - return fmt.Sprintf("[POST /relation-tuples/check][%d] postCheckOK %+v", 200, o.Payload) + return fmt.Sprintf("[POST /relation-tuples/check/openapi][%d] postCheckOK %+v", 200, o.Payload) } func (o *PostCheckOK) GetPayload() *models.GetCheckResponse { return o.Payload @@ -98,7 +98,7 @@ type PostCheckBadRequest struct { } func (o *PostCheckBadRequest) Error() string { - return fmt.Sprintf("[POST /relation-tuples/check][%d] postCheckBadRequest %+v", 400, o.Payload) + return fmt.Sprintf("[POST /relation-tuples/check/openapi][%d] postCheckBadRequest %+v", 400, o.Payload) } func (o *PostCheckBadRequest) GetPayload() *models.GenericError { return o.Payload @@ -130,7 +130,7 @@ type PostCheckForbidden struct { } func (o *PostCheckForbidden) Error() string { - return fmt.Sprintf("[POST /relation-tuples/check][%d] postCheckForbidden %+v", 403, o.Payload) + return fmt.Sprintf("[POST /relation-tuples/check/openapi][%d] postCheckForbidden %+v", 403, o.Payload) } func (o *PostCheckForbidden) GetPayload() *models.GetCheckResponse { return o.Payload @@ -162,7 +162,7 @@ type PostCheckInternalServerError struct { } func (o *PostCheckInternalServerError) Error() string { - return fmt.Sprintf("[POST /relation-tuples/check][%d] postCheckInternalServerError %+v", 500, o.Payload) + return fmt.Sprintf("[POST /relation-tuples/check/openapi][%d] postCheckInternalServerError %+v", 500, o.Payload) } func (o *PostCheckInternalServerError) GetPayload() *models.GenericError { return o.Payload diff --git a/internal/httpclient/client/read/read_client.go b/internal/httpclient/client/read/read_client.go index fe408bfd2..87bcf7802 100644 --- a/internal/httpclient/client/read/read_client.go +++ b/internal/httpclient/client/read/read_client.go @@ -54,7 +54,7 @@ func (a *Client) GetCheck(params *GetCheckParams, opts ...ClientOption) (*GetChe op := &runtime.ClientOperation{ ID: "getCheck", Method: "GET", - PathPattern: "/relation-tuples/check", + PathPattern: "/relation-tuples/check/openapi", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, Schemes: []string{"http", "https"}, @@ -174,7 +174,7 @@ func (a *Client) PostCheck(params *PostCheckParams, opts ...ClientOption) (*Post op := &runtime.ClientOperation{ ID: "postCheck", Method: "POST", - PathPattern: "/relation-tuples/check", + PathPattern: "/relation-tuples/check/openapi", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http", "https"}, diff --git a/internal/httpclient/models/get_check_response.go b/internal/httpclient/models/get_check_response.go index 5c167f084..0a2270222 100644 --- a/internal/httpclient/models/get_check_response.go +++ b/internal/httpclient/models/get_check_response.go @@ -14,7 +14,7 @@ import ( "github.com/go-openapi/validate" ) -// GetCheckResponse RESTResponse is the response for a check request. +// GetCheckResponse RESTResponse represents the response for a check request. // // The content of the allowed field is mirrored in the HTTP status code. // From 9b89f2063a81e1f894637e64f7e42c72d89cea37 Mon Sep 17 00:00:00 2001 From: Patrik Date: Wed, 15 Jun 2022 16:43:42 +0200 Subject: [PATCH 6/6] docs: add swagger annotations for check with mirrored status codes --- README.md | 69 +- internal/check/handler.go | 42 +- internal/httpclient-next/.gitignore | 24 + .../httpclient-next/.openapi-generator-ignore | 23 + .../httpclient-next/.openapi-generator/FILES | 46 + .../.openapi-generator/VERSION | 1 + internal/httpclient-next/.travis.yml | 7 + internal/httpclient-next/README.md | 138 +++ internal/httpclient-next/api/openapi.yaml | 859 ++++++++++++++ internal/httpclient-next/api_metadata.go | 434 +++++++ internal/httpclient-next/api_read.go | 1055 +++++++++++++++++ internal/httpclient-next/api_write.go | 492 ++++++++ internal/httpclient-next/client.go | 547 +++++++++ internal/httpclient-next/configuration.go | 230 ++++ internal/httpclient-next/docs/ExpandTree.md | 129 ++ internal/httpclient-next/docs/GenericError.md | 186 +++ .../httpclient-next/docs/GetCheckResponse.md | 51 + .../docs/GetRelationTuplesResponse.md | 82 ++ .../docs/HealthNotReadyStatus.md | 56 + internal/httpclient-next/docs/HealthStatus.md | 56 + .../httpclient-next/docs/InlineResponse200.md | 51 + .../docs/InlineResponse2001.md | 51 + .../httpclient-next/docs/InlineResponse503.md | 51 + .../docs/InternalRelationTuple.md | 145 +++ internal/httpclient-next/docs/MetadataApi.md | 194 +++ internal/httpclient-next/docs/PatchDelta.md | 82 ++ internal/httpclient-next/docs/ReadApi.md | 438 +++++++ .../httpclient-next/docs/RelationQuery.md | 160 +++ internal/httpclient-next/docs/SubjectSet.md | 93 ++ internal/httpclient-next/docs/Version.md | 56 + internal/httpclient-next/docs/WriteApi.md | 217 ++++ internal/httpclient-next/git_push.sh | 58 + internal/httpclient-next/go.mod | 7 + internal/httpclient-next/go.sum | 13 + internal/httpclient-next/model_expand_tree.go | 215 ++++ .../httpclient-next/model_generic_error.go | 294 +++++ .../model_get_check_response.go | 108 ++ .../model_get_relation_tuples_response.go | 151 +++ .../model_health_not_ready_status.go | 115 ++ .../httpclient-next/model_health_status.go | 115 ++ .../model_inline_response_200.go | 108 ++ .../model_inline_response_200_1.go | 108 ++ .../model_inline_response_503.go | 108 ++ .../model_internal_relation_tuple.go | 241 ++++ internal/httpclient-next/model_patch_delta.go | 150 +++ .../httpclient-next/model_relation_query.go | 262 ++++ internal/httpclient-next/model_subject_set.go | 168 +++ internal/httpclient-next/model_version.go | 115 ++ internal/httpclient-next/response.go | 48 + internal/httpclient-next/utils.go | 329 +++++ .../get_check_mirror_status_parameters.go | 126 ++ .../read/get_check_mirror_status_responses.go | 181 +++ .../client/read/get_check_responses.go | 38 - .../post_check_mirror_status_parameters.go | 126 ++ .../post_check_mirror_status_responses.go | 181 +++ .../client/read/post_check_responses.go | 38 - .../httpclient/client/read/read_client.go | 84 ++ spec/api.json | 118 +- spec/swagger.json | 84 +- 59 files changed, 9601 insertions(+), 153 deletions(-) create mode 100644 internal/httpclient-next/.gitignore create mode 100644 internal/httpclient-next/.openapi-generator-ignore create mode 100644 internal/httpclient-next/.openapi-generator/FILES create mode 100644 internal/httpclient-next/.openapi-generator/VERSION create mode 100644 internal/httpclient-next/.travis.yml create mode 100644 internal/httpclient-next/README.md create mode 100644 internal/httpclient-next/api/openapi.yaml create mode 100644 internal/httpclient-next/api_metadata.go create mode 100644 internal/httpclient-next/api_read.go create mode 100644 internal/httpclient-next/api_write.go create mode 100644 internal/httpclient-next/client.go create mode 100644 internal/httpclient-next/configuration.go create mode 100644 internal/httpclient-next/docs/ExpandTree.md create mode 100644 internal/httpclient-next/docs/GenericError.md create mode 100644 internal/httpclient-next/docs/GetCheckResponse.md create mode 100644 internal/httpclient-next/docs/GetRelationTuplesResponse.md create mode 100644 internal/httpclient-next/docs/HealthNotReadyStatus.md create mode 100644 internal/httpclient-next/docs/HealthStatus.md create mode 100644 internal/httpclient-next/docs/InlineResponse200.md create mode 100644 internal/httpclient-next/docs/InlineResponse2001.md create mode 100644 internal/httpclient-next/docs/InlineResponse503.md create mode 100644 internal/httpclient-next/docs/InternalRelationTuple.md create mode 100644 internal/httpclient-next/docs/MetadataApi.md create mode 100644 internal/httpclient-next/docs/PatchDelta.md create mode 100644 internal/httpclient-next/docs/ReadApi.md create mode 100644 internal/httpclient-next/docs/RelationQuery.md create mode 100644 internal/httpclient-next/docs/SubjectSet.md create mode 100644 internal/httpclient-next/docs/Version.md create mode 100644 internal/httpclient-next/docs/WriteApi.md create mode 100644 internal/httpclient-next/git_push.sh create mode 100644 internal/httpclient-next/go.mod create mode 100644 internal/httpclient-next/go.sum create mode 100644 internal/httpclient-next/model_expand_tree.go create mode 100644 internal/httpclient-next/model_generic_error.go create mode 100644 internal/httpclient-next/model_get_check_response.go create mode 100644 internal/httpclient-next/model_get_relation_tuples_response.go create mode 100644 internal/httpclient-next/model_health_not_ready_status.go create mode 100644 internal/httpclient-next/model_health_status.go create mode 100644 internal/httpclient-next/model_inline_response_200.go create mode 100644 internal/httpclient-next/model_inline_response_200_1.go create mode 100644 internal/httpclient-next/model_inline_response_503.go create mode 100644 internal/httpclient-next/model_internal_relation_tuple.go create mode 100644 internal/httpclient-next/model_patch_delta.go create mode 100644 internal/httpclient-next/model_relation_query.go create mode 100644 internal/httpclient-next/model_subject_set.go create mode 100644 internal/httpclient-next/model_version.go create mode 100644 internal/httpclient-next/response.go create mode 100644 internal/httpclient-next/utils.go create mode 100644 internal/httpclient/client/read/get_check_mirror_status_parameters.go create mode 100644 internal/httpclient/client/read/get_check_mirror_status_responses.go create mode 100644 internal/httpclient/client/read/post_check_mirror_status_parameters.go create mode 100644 internal/httpclient/client/read/post_check_mirror_status_responses.go diff --git a/README.md b/README.md index ec05fa08b..b4859afe6 100644 --- a/README.md +++ b/README.md @@ -96,21 +96,17 @@ An overview of what is implemented and upcoming can be found at -The Ory community stands on the shoulders of individuals, companies, and -maintainers. We thank everyone involved - from submitting bug reports and -feature requests, to contributing patches, to sponsoring our work. Our community -is 1000+ strong and growing rapidly. The Ory stack protects 16.000.000.000+ API -requests every month with over 250.000+ active service nodes. We would have +The Ory community stands on the shoulders of individuals, companies, and maintainers. We thank everyone involved - from submitting +bug reports and feature requests, to contributing patches, to sponsoring our work. Our community is 1000+ strong and growing +rapidly. The Ory stack protects 16.000.000.000+ API requests every month with over 250.000+ active service nodes. We would have never been able to achieve this without each and everyone of you! -The following list represents companies that have accompanied us along the way -and that have made outstanding contributions to our ecosystem. _If you think -that your company deserves a spot here, reach out to +The following list represents companies that have accompanied us along the way and that have made outstanding contributions to our +ecosystem. _If you think that your company deserves a spot here, reach out to office-muc@ory.sh now_! -**Please consider giving back by becoming a sponsor of our open source work on -Patreon or -Open Collective.** +**Please consider giving back by becoming a sponsor of our open source work on Patreon +or Open Collective.**
@@ -277,10 +273,8 @@ as well as all of our backers -and past & current supporters (in alphabetical order) on -[Patreon](https://www.patreon.com/_ory): Alexander Alimovs, Billy, Chancy -Kennedy, Drozzy, Edwin Trejos, Howard Edidin, Ken Adler Oz Haven, Stefan Hans, -TheCrealm. +and past & current supporters (in alphabetical order) on [Patreon](https://www.patreon.com/_ory): Alexander Alimovs, Billy, Chancy +Kennedy, Drozzy, Edwin Trejos, Howard Edidin, Ken Adler Oz Haven, Stefan Hans, TheCrealm. \* Uses one of Ory's major projects in production. @@ -294,51 +288,42 @@ Head over to the documentation to learn about ways of [installing ORY Keto](http -We build Ory on several guiding principles when it comes to our architecture -design: +We build Ory on several guiding principles when it comes to our architecture design: - Minimal dependencies - Runs everywhere - Scales without effort - Minimize room for human and network errors -Ory's architecture is designed to run best on a Container Orchestration system -such as Kubernetes, CloudFoundry, OpenShift, and similar projects. Binaries are -small (5-15MB) and available for all popular processor types (ARM, AMD64, i386) -and operating systems (FreeBSD, Linux, macOS, Windows) without system -dependencies (Java, Node, Ruby, libxml, ...). +Ory's architecture is designed to run best on a Container Orchestration system such as Kubernetes, CloudFoundry, OpenShift, and +similar projects. Binaries are small (5-15MB) and available for all popular processor types (ARM, AMD64, i386) and operating +systems (FreeBSD, Linux, macOS, Windows) without system dependencies (Java, Node, Ruby, libxml, ...). ### Ory Kratos: Identity and User Infrastructure and Management -[Ory Kratos](https://github.com/ory/kratos) is an API-first Identity and User -Management system that is built according to -[cloud architecture best practices](https://www.ory.sh/docs/next/ecosystem/software-architecture-philosophy). -It implements core use cases that almost every software application needs to -deal with: Self-service Login and Registration, Multi-Factor Authentication -(MFA/2FA), Account Recovery and Verification, Profile, and Account Management. +[Ory Kratos](https://github.com/ory/kratos) is an API-first Identity and User Management system that is built according to +[cloud architecture best practices](https://www.ory.sh/docs/next/ecosystem/software-architecture-philosophy). It implements core +use cases that almost every software application needs to deal with: Self-service Login and Registration, Multi-Factor +Authentication (MFA/2FA), Account Recovery and Verification, Profile, and Account Management. ### Ory Hydra: OAuth2 & OpenID Connect Server -[Ory Hydra](https://github.com/ory/hydra) is an OpenID Certifiedâ„¢ OAuth2 and -OpenID Connect Provider which easily connects to any existing identity system by -writing a tiny "bridge" application. Gives absolute control over user interface -and user experience flows. +[Ory Hydra](https://github.com/ory/hydra) is an OpenID Certifiedâ„¢ OAuth2 and OpenID Connect Provider which easily connects to any +existing identity system by writing a tiny "bridge" application. Gives absolute control over user interface and user experience +flows. ### Ory Oathkeeper: Identity & Access Proxy -[Ory Oathkeeper](https://github.com/ory/oathkeeper) is a BeyondCorp/Zero Trust -Identity & Access Proxy (IAP) with configurable authentication, authorization, -and request mutation rules for your web services: Authenticate JWT, Access -Tokens, API Keys, mTLS; Check if the contained subject is allowed to perform the -request; Encode resulting content into custom headers (`X-User-ID`), JSON Web -Tokens and more! +[Ory Oathkeeper](https://github.com/ory/oathkeeper) is a BeyondCorp/Zero Trust Identity & Access Proxy (IAP) with configurable +authentication, authorization, and request mutation rules for your web services: Authenticate JWT, Access Tokens, API Keys, mTLS; +Check if the contained subject is allowed to perform the request; Encode resulting content into custom headers (`X-User-ID`), JSON +Web Tokens and more! ### Ory Keto: Access Control Policies as a Server -[Ory Keto](https://github.com/ory/keto) is a policy decision point. It uses a -set of access control policies, similar to AWS IAM Policies, in order to -determine whether a subject (user, application, service, car, ...) is authorized -to perform a certain action on a resource. +[Ory Keto](https://github.com/ory/keto) is a policy decision point. It uses a set of access control policies, similar to AWS IAM +Policies, in order to determine whether a subject (user, application, service, car, ...) is authorized to perform a certain action +on a resource. diff --git a/internal/check/handler.go b/internal/check/handler.go index 93f24b562..9ff9f85ea 100644 --- a/internal/check/handler.go +++ b/internal/check/handler.go @@ -39,7 +39,7 @@ func NewHandler(d handlerDependencies) *Handler { const ( RouteBase = "/relation-tuples/check" - OpenAPIRouteBase = "/relation-tuples/check/openapi" + OpenAPIRouteBase = RouteBase + "/openapi" ) func (h *Handler) RegisterReadRoutes(r *x.ReadRouter) { @@ -93,7 +93,6 @@ type getCheckRequest struct { // Responses: // 200: getCheckResponse // 400: genericError -// 403: getCheckResponse // 500: genericError func (h *Handler) getCheckNoStatus(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { allowed, err := h.getCheck(r.Context(), r.URL.Query()) @@ -104,6 +103,25 @@ func (h *Handler) getCheckNoStatus(w http.ResponseWriter, r *http.Request, _ htt h.d.Writer().Write(w, r, &RESTResponse{Allowed: allowed}) } +// swagger:route GET /relation-tuples/check read getCheckMirrorStatus +// +// Check a relation tuple +// +// To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). +// +// Consumes: +// - application/x-www-form-urlencoded +// +// Produces: +// - application/json +// +// Schemes: http, https +// +// Responses: +// 200: getCheckResponse +// 400: genericError +// 403: getCheckResponse +// 500: genericError func (h *Handler) getCheckMirrorStatus(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { allowed, err := h.getCheck(r.Context(), r.URL.Query()) if err != nil { @@ -150,7 +168,6 @@ func (h *Handler) getCheck(ctx context.Context, q url.Values) (bool, error) { // Responses: // 200: getCheckResponse // 400: genericError -// 403: getCheckResponse // 500: genericError func (h *Handler) postCheckNoStatus(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { allowed, err := h.postCheck(r.Context(), r.Body, r.URL.Query()) @@ -161,6 +178,25 @@ func (h *Handler) postCheckNoStatus(w http.ResponseWriter, r *http.Request, _ ht h.d.Writer().Write(w, r, &RESTResponse{Allowed: allowed}) } +// swagger:route POST /relation-tuples/check read postCheckMirrorStatus +// +// Check a relation tuple +// +// To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). +// +// Consumes: +// - application/json +// +// Produces: +// - application/json +// +// Schemes: http, https +// +// Responses: +// 200: getCheckResponse +// 400: genericError +// 403: getCheckResponse +// 500: genericError func (h *Handler) postCheckMirrorStatus(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { allowed, err := h.postCheck(r.Context(), r.Body, r.URL.Query()) if err != nil { diff --git a/internal/httpclient-next/.gitignore b/internal/httpclient-next/.gitignore new file mode 100644 index 000000000..daf913b1b --- /dev/null +++ b/internal/httpclient-next/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/internal/httpclient-next/.openapi-generator-ignore b/internal/httpclient-next/.openapi-generator-ignore new file mode 100644 index 000000000..7484ee590 --- /dev/null +++ b/internal/httpclient-next/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/internal/httpclient-next/.openapi-generator/FILES b/internal/httpclient-next/.openapi-generator/FILES new file mode 100644 index 000000000..185d02428 --- /dev/null +++ b/internal/httpclient-next/.openapi-generator/FILES @@ -0,0 +1,46 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +README.md +api/openapi.yaml +api_metadata.go +api_read.go +api_write.go +client.go +configuration.go +docs/ExpandTree.md +docs/GenericError.md +docs/GetCheckResponse.md +docs/GetRelationTuplesResponse.md +docs/HealthNotReadyStatus.md +docs/HealthStatus.md +docs/InlineResponse200.md +docs/InlineResponse2001.md +docs/InlineResponse503.md +docs/InternalRelationTuple.md +docs/MetadataApi.md +docs/PatchDelta.md +docs/ReadApi.md +docs/RelationQuery.md +docs/SubjectSet.md +docs/Version.md +docs/WriteApi.md +git_push.sh +go.mod +go.sum +model_expand_tree.go +model_generic_error.go +model_get_check_response.go +model_get_relation_tuples_response.go +model_health_not_ready_status.go +model_health_status.go +model_inline_response_200.go +model_inline_response_200_1.go +model_inline_response_503.go +model_internal_relation_tuple.go +model_patch_delta.go +model_relation_query.go +model_subject_set.go +model_version.go +response.go +utils.go diff --git a/internal/httpclient-next/.openapi-generator/VERSION b/internal/httpclient-next/.openapi-generator/VERSION new file mode 100644 index 000000000..804440660 --- /dev/null +++ b/internal/httpclient-next/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.2.1 \ No newline at end of file diff --git a/internal/httpclient-next/.travis.yml b/internal/httpclient-next/.travis.yml new file mode 100644 index 000000000..755978dca --- /dev/null +++ b/internal/httpclient-next/.travis.yml @@ -0,0 +1,7 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ diff --git a/internal/httpclient-next/README.md b/internal/httpclient-next/README.md new file mode 100644 index 000000000..d7adb9edd --- /dev/null +++ b/internal/httpclient-next/README.md @@ -0,0 +1,138 @@ +# Go API client for client + +Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/oauth2 +go get golang.org/x/net/context +``` + +Put the package under your project folder and add the following in import: + +```golang +import client "github.com/ory/keto-client-go" +``` + +To use a proxy, set the environment variable `HTTP_PROXY`: + +```golang +os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") +``` + +## Configuration of Server URL + +Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. + +### Select Server Configuration + +For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. + +```golang +ctx := context.WithValue(context.Background(), client.ContextServerIndex, 1) +``` + +### Templated Server URL + +Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. + +```golang +ctx := context.WithValue(context.Background(), client.ContextServerVariables, map[string]string{ + "basePath": "v2", +}) +``` + +Note, enum values are always validated and all unused variables are silently ignored. + +### URLs Configuration per Operation + +Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. +An operation is uniquely identifield by `"{classname}Service.{nickname}"` string. +Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. + +``` +ctx := context.WithValue(context.Background(), client.ContextOperationServerIndices, map[string]int{ + "{classname}Service.{nickname}": 2, +}) +ctx = context.WithValue(context.Background(), client.ContextOperationServerVariables, map[string]map[string]string{ + "{classname}Service.{nickname}": { + "port": "8443", + }, +}) +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*MetadataApi* | [**GetVersion**](docs/MetadataApi.md#getversion) | **Get** /version | Return Running Software Version. +*MetadataApi* | [**IsAlive**](docs/MetadataApi.md#isalive) | **Get** /health/alive | Check HTTP Server Status +*MetadataApi* | [**IsReady**](docs/MetadataApi.md#isready) | **Get** /health/ready | Check HTTP Server and Database Status +*ReadApi* | [**GetCheck**](docs/ReadApi.md#getcheck) | **Get** /relation-tuples/check/openapi | Check a relation tuple +*ReadApi* | [**GetCheckMirrorStatus**](docs/ReadApi.md#getcheckmirrorstatus) | **Get** /relation-tuples/check | Check a relation tuple +*ReadApi* | [**GetExpand**](docs/ReadApi.md#getexpand) | **Get** /relation-tuples/expand | Expand a Relation Tuple +*ReadApi* | [**GetRelationTuples**](docs/ReadApi.md#getrelationtuples) | **Get** /relation-tuples | Query relation tuples +*ReadApi* | [**PostCheck**](docs/ReadApi.md#postcheck) | **Post** /relation-tuples/check/openapi | Check a relation tuple +*ReadApi* | [**PostCheckMirrorStatus**](docs/ReadApi.md#postcheckmirrorstatus) | **Post** /relation-tuples/check | Check a relation tuple +*WriteApi* | [**CreateRelationTuple**](docs/WriteApi.md#createrelationtuple) | **Put** /admin/relation-tuples | Create a Relation Tuple +*WriteApi* | [**DeleteRelationTuples**](docs/WriteApi.md#deleterelationtuples) | **Delete** /admin/relation-tuples | Delete Relation Tuples +*WriteApi* | [**PatchRelationTuples**](docs/WriteApi.md#patchrelationtuples) | **Patch** /admin/relation-tuples | Patch Multiple Relation Tuples + + +## Documentation For Models + + - [ExpandTree](docs/ExpandTree.md) + - [GenericError](docs/GenericError.md) + - [GetCheckResponse](docs/GetCheckResponse.md) + - [GetRelationTuplesResponse](docs/GetRelationTuplesResponse.md) + - [HealthNotReadyStatus](docs/HealthNotReadyStatus.md) + - [HealthStatus](docs/HealthStatus.md) + - [InlineResponse200](docs/InlineResponse200.md) + - [InlineResponse2001](docs/InlineResponse2001.md) + - [InlineResponse503](docs/InlineResponse503.md) + - [InternalRelationTuple](docs/InternalRelationTuple.md) + - [PatchDelta](docs/PatchDelta.md) + - [RelationQuery](docs/RelationQuery.md) + - [SubjectSet](docs/SubjectSet.md) + - [Version](docs/Version.md) + + +## Documentation For Authorization + + Endpoints do not require authorization. + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + +hi@ory.sh + diff --git a/internal/httpclient-next/api/openapi.yaml b/internal/httpclient-next/api/openapi.yaml new file mode 100644 index 000000000..248f0ad85 --- /dev/null +++ b/internal/httpclient-next/api/openapi.yaml @@ -0,0 +1,859 @@ +openapi: 3.0.3 +info: + contact: + email: hi@ory.sh + description: | + Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + license: + name: Apache 2.0 + title: Ory Keto API +servers: +- url: / +paths: + /admin/relation-tuples: + delete: + description: Use this endpoint to delete relation tuples + operationId: deleteRelationTuples + parameters: + - description: Namespace of the Relation Tuple + explode: true + in: query + name: namespace + required: false + schema: + type: string + style: form + - description: Object of the Relation Tuple + explode: true + in: query + name: object + required: false + schema: + type: string + style: form + - description: Relation of the Relation Tuple + explode: true + in: query + name: relation + required: false + schema: + type: string + style: form + - description: SubjectID of the Relation Tuple + explode: true + in: query + name: subject_id + required: false + schema: + type: string + style: form + - description: Namespace of the Subject Set + explode: true + in: query + name: subject_set.namespace + required: false + schema: + type: string + style: form + - description: Object of the Subject Set + explode: true + in: query + name: subject_set.object + required: false + schema: + type: string + style: form + - description: Relation of the Subject Set + explode: true + in: query + name: subject_set.relation + required: false + schema: + type: string + style: form + responses: + "204": + description: Empty responses are sent when, for example, resources are deleted. + The HTTP status code for empty responses is typically 201. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + summary: Delete Relation Tuples + tags: + - write + patch: + description: Use this endpoint to patch one or more relation tuples. + operationId: patchRelationTuples + requestBody: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/PatchDelta' + type: array + x-originalParamName: Payload + responses: + "204": + description: Empty responses are sent when, for example, resources are deleted. + The HTTP status code for empty responses is typically 201. + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + summary: Patch Multiple Relation Tuples + tags: + - write + put: + description: Use this endpoint to create a relation tuple. + operationId: createRelationTuple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationQuery' + x-originalParamName: Payload + responses: + "201": + content: + application/json: + schema: + $ref: '#/components/schemas/RelationQuery' + description: RelationQuery + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + summary: Create a Relation Tuple + tags: + - write + /health/alive: + get: + description: |- + This endpoint returns a HTTP 200 status code when Ory Keto is accepting incoming + HTTP requests. This status does currently not include checks whether the database connection is working. + + If the service supports TLS Edge Termination, this endpoint does not require the + `X-Forwarded-Proto` header to be set. + + Be aware that if you are running multiple nodes of this service, the health status will never + refer to the cluster state, only to a single instance. + operationId: isAlive + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200' + description: Ory Keto is ready to accept connections. + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + summary: Check HTTP Server Status + tags: + - metadata + /health/ready: + get: + description: |- + This endpoint returns a HTTP 200 status code when Ory Keto is up running and the environment dependencies (e.g. + the database) are responsive as well. + + If the service supports TLS Edge Termination, this endpoint does not require the + `X-Forwarded-Proto` header to be set. + + Be aware that if you are running multiple nodes of Ory Keto, the health status will never + refer to the cluster state, only to a single instance. + operationId: isReady + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200' + description: Ory Keto is ready to accept requests. + "503": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_503' + description: Ory Kratos is not yet ready to accept requests. + summary: Check HTTP Server and Database Status + tags: + - metadata + /relation-tuples: + get: + description: Get all relation tuples that match the query. Only the namespace + field is required. + operationId: getRelationTuples + parameters: + - explode: true + in: query + name: page_token + required: false + schema: + type: string + style: form + - explode: true + in: query + name: page_size + required: false + schema: + format: int64 + type: integer + style: form + - description: Namespace of the Relation Tuple + explode: true + in: query + name: namespace + required: false + schema: + type: string + style: form + - description: Object of the Relation Tuple + explode: true + in: query + name: object + required: false + schema: + type: string + style: form + - description: Relation of the Relation Tuple + explode: true + in: query + name: relation + required: false + schema: + type: string + style: form + - description: SubjectID of the Relation Tuple + explode: true + in: query + name: subject_id + required: false + schema: + type: string + style: form + - description: Namespace of the Subject Set + explode: true + in: query + name: subject_set.namespace + required: false + schema: + type: string + style: form + - description: Object of the Subject Set + explode: true + in: query + name: subject_set.object + required: false + schema: + type: string + style: form + - description: Relation of the Subject Set + explode: true + in: query + name: subject_set.relation + required: false + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/getRelationTuplesResponse' + description: getRelationTuplesResponse + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + summary: Query relation tuples + tags: + - read + /relation-tuples/check: + get: + description: To learn how relation tuples and the check works, head over to + [the documentation](../concepts/relation-tuples.mdx). + operationId: getCheckMirrorStatus + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/getCheckResponse' + description: getCheckResponse + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/getCheckResponse' + description: getCheckResponse + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + summary: Check a relation tuple + tags: + - read + post: + description: To learn how relation tuples and the check works, head over to + [the documentation](../concepts/relation-tuples.mdx). + operationId: postCheckMirrorStatus + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/getCheckResponse' + description: getCheckResponse + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/getCheckResponse' + description: getCheckResponse + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + summary: Check a relation tuple + tags: + - read + /relation-tuples/check/openapi: + get: + description: To learn how relation tuples and the check works, head over to + [the documentation](../concepts/relation-tuples.mdx). + operationId: getCheck + parameters: + - description: Namespace of the Relation Tuple + explode: true + in: query + name: namespace + required: false + schema: + type: string + style: form + - description: Object of the Relation Tuple + explode: true + in: query + name: object + required: false + schema: + type: string + style: form + - description: Relation of the Relation Tuple + explode: true + in: query + name: relation + required: false + schema: + type: string + style: form + - description: SubjectID of the Relation Tuple + explode: true + in: query + name: subject_id + required: false + schema: + type: string + style: form + - description: Namespace of the Subject Set + explode: true + in: query + name: subject_set.namespace + required: false + schema: + type: string + style: form + - description: Object of the Subject Set + explode: true + in: query + name: subject_set.object + required: false + schema: + type: string + style: form + - description: Relation of the Subject Set + explode: true + in: query + name: subject_set.relation + required: false + schema: + type: string + style: form + - explode: true + in: query + name: max-depth + required: false + schema: + format: int64 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/getCheckResponse' + description: getCheckResponse + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + summary: Check a relation tuple + tags: + - read + post: + description: To learn how relation tuples and the check works, head over to + [the documentation](../concepts/relation-tuples.mdx). + operationId: postCheck + parameters: + - explode: true + in: query + name: max-depth + required: false + schema: + format: int64 + type: integer + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationQuery' + x-originalParamName: Payload + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/getCheckResponse' + description: getCheckResponse + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + summary: Check a relation tuple + tags: + - read + /relation-tuples/expand: + get: + description: Use this endpoint to expand a relation tuple. + operationId: getExpand + parameters: + - description: Namespace of the Subject Set + explode: true + in: query + name: namespace + required: true + schema: + type: string + style: form + - description: Object of the Subject Set + explode: true + in: query + name: object + required: true + schema: + type: string + style: form + - description: Relation of the Subject Set + explode: true + in: query + name: relation + required: true + schema: + type: string + style: form + - explode: true + in: query + name: max-depth + required: false + schema: + format: int64 + type: integer + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/expandTree' + description: expandTree + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/genericError' + description: genericError + summary: Expand a Relation Tuple + tags: + - read + /version: + get: + description: |- + This endpoint returns the version of Ory Keto. + + If the service supports TLS Edge Termination, this endpoint does not require the + `X-Forwarded-Proto` header to be set. + + Be aware that if you are running multiple nodes of this service, the version will never + refer to the cluster state, only to a single instance. + operationId: getVersion + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_1' + description: Returns the Ory Keto version. + summary: Return Running Software Version. + tags: + - metadata +components: + responses: + emptyResponse: + description: Empty responses are sent when, for example, resources are deleted. + The HTTP status code for empty responses is typically 201. + schemas: + InternalRelationTuple: + example: + subject_id: subject_id + namespace: namespace + object: object + relation: relation + subject_set: + namespace: namespace + object: object + relation: relation + properties: + namespace: + description: Namespace of the Relation Tuple + type: string + object: + description: Object of the Relation Tuple + type: string + relation: + description: Relation of the Relation Tuple + type: string + subject_id: + description: |- + SubjectID of the Relation Tuple + + Either SubjectSet or SubjectID are required. + type: string + subject_set: + $ref: '#/components/schemas/SubjectSet' + required: + - namespace + - object + - relation + type: object + PatchDelta: + example: + relation_tuple: + subject_id: subject_id + namespace: namespace + object: object + relation: relation + subject_set: + namespace: namespace + object: object + relation: relation + action: insert + properties: + action: + enum: + - insert + - delete + type: string + relation_tuple: + $ref: '#/components/schemas/InternalRelationTuple' + type: object + RelationQuery: + example: + subject_id: subject_id + namespace: namespace + object: object + relation: relation + subject_set: + namespace: namespace + object: object + relation: relation + properties: + namespace: + description: Namespace of the Relation Tuple + type: string + object: + description: Object of the Relation Tuple + type: string + relation: + description: Relation of the Relation Tuple + type: string + subject_id: + description: |- + SubjectID of the Relation Tuple + + Either SubjectSet or SubjectID can be provided. + type: string + subject_set: + $ref: '#/components/schemas/SubjectSet' + type: object + SubjectSet: + example: + namespace: namespace + object: object + relation: relation + properties: + namespace: + description: Namespace of the Subject Set + type: string + object: + description: Object of the Subject Set + type: string + relation: + description: Relation of the Subject Set + type: string + required: + - namespace + - object + - relation + type: object + UUID: + format: uuid4 + type: string + expandTree: + example: + subject_id: subject_id + children: + - null + - null + type: union + subject_set: + namespace: namespace + object: object + relation: relation + properties: + children: + items: + $ref: '#/components/schemas/expandTree' + type: array + subject_id: + type: string + subject_set: + $ref: '#/components/schemas/SubjectSet' + type: + enum: + - union + - exclusion + - intersection + - leaf + type: string + required: + - type + type: object + genericError: + description: The standard error format + properties: + code: + format: int64 + type: integer + details: + items: + additionalProperties: true + type: object + type: array + message: + type: string + reason: + type: string + request: + type: string + status: + type: string + type: object + getCheckResponse: + description: The content of the allowed field is mirrored in the HTTP status + code. + example: + allowed: true + properties: + allowed: + description: whether the relation tuple is allowed + type: boolean + required: + - allowed + title: RESTResponse represents the response for a check request. + type: object + getRelationTuplesResponse: + example: + next_page_token: next_page_token + relation_tuples: + - subject_id: subject_id + namespace: namespace + object: object + relation: relation + subject_set: + namespace: namespace + object: object + relation: relation + - subject_id: subject_id + namespace: namespace + object: object + relation: relation + subject_set: + namespace: namespace + object: object + relation: relation + properties: + next_page_token: + description: |- + The opaque token to provide in a subsequent request + to get the next page. It is the empty string iff this is + the last page. + type: string + relation_tuples: + items: + $ref: '#/components/schemas/InternalRelationTuple' + type: array + type: object + healthNotReadyStatus: + properties: + errors: + additionalProperties: + type: string + description: Errors contains a list of errors that caused the not ready + status. + type: object + type: object + healthStatus: + properties: + status: + description: Status always contains "ok". + type: string + type: object + subject: + type: object + version: + properties: + version: + description: Version is the service's version. + type: string + type: object + inline_response_200: + example: + status: status + properties: + status: + description: Always "ok". + type: string + required: + - status + type: object + inline_response_503: + properties: + errors: + additionalProperties: + type: string + description: Errors contains a list of errors that caused the not ready + status. + type: object + required: + - errors + type: object + inline_response_200_1: + example: + version: version + properties: + version: + description: The version of Ory Keto. + type: string + required: + - version + type: object diff --git a/internal/httpclient-next/api_metadata.go b/internal/httpclient-next/api_metadata.go new file mode 100644 index 000000000..1f3d0022b --- /dev/null +++ b/internal/httpclient-next/api_metadata.go @@ -0,0 +1,434 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" +) + +// Linger please +var ( + _ context.Context +) + +type MetadataApi interface { + + /* + * GetVersion Return Running Software Version. + * This endpoint returns the version of Ory Keto. + + If the service supports TLS Edge Termination, this endpoint does not require the + `X-Forwarded-Proto` header to be set. + + Be aware that if you are running multiple nodes of this service, the version will never + refer to the cluster state, only to a single instance. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return MetadataApiApiGetVersionRequest + */ + GetVersion(ctx context.Context) MetadataApiApiGetVersionRequest + + /* + * GetVersionExecute executes the request + * @return InlineResponse2001 + */ + GetVersionExecute(r MetadataApiApiGetVersionRequest) (*InlineResponse2001, *http.Response, error) + + /* + * IsAlive Check HTTP Server Status + * This endpoint returns a HTTP 200 status code when Ory Keto is accepting incoming + HTTP requests. This status does currently not include checks whether the database connection is working. + + If the service supports TLS Edge Termination, this endpoint does not require the + `X-Forwarded-Proto` header to be set. + + Be aware that if you are running multiple nodes of this service, the health status will never + refer to the cluster state, only to a single instance. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return MetadataApiApiIsAliveRequest + */ + IsAlive(ctx context.Context) MetadataApiApiIsAliveRequest + + /* + * IsAliveExecute executes the request + * @return InlineResponse200 + */ + IsAliveExecute(r MetadataApiApiIsAliveRequest) (*InlineResponse200, *http.Response, error) + + /* + * IsReady Check HTTP Server and Database Status + * This endpoint returns a HTTP 200 status code when Ory Keto is up running and the environment dependencies (e.g. + the database) are responsive as well. + + If the service supports TLS Edge Termination, this endpoint does not require the + `X-Forwarded-Proto` header to be set. + + Be aware that if you are running multiple nodes of Ory Keto, the health status will never + refer to the cluster state, only to a single instance. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return MetadataApiApiIsReadyRequest + */ + IsReady(ctx context.Context) MetadataApiApiIsReadyRequest + + /* + * IsReadyExecute executes the request + * @return InlineResponse200 + */ + IsReadyExecute(r MetadataApiApiIsReadyRequest) (*InlineResponse200, *http.Response, error) +} + +// MetadataApiService MetadataApi service +type MetadataApiService service + +type MetadataApiApiGetVersionRequest struct { + ctx context.Context + ApiService MetadataApi +} + +func (r MetadataApiApiGetVersionRequest) Execute() (*InlineResponse2001, *http.Response, error) { + return r.ApiService.GetVersionExecute(r) +} + +/* + * GetVersion Return Running Software Version. + * This endpoint returns the version of Ory Keto. + +If the service supports TLS Edge Termination, this endpoint does not require the +`X-Forwarded-Proto` header to be set. + +Be aware that if you are running multiple nodes of this service, the version will never +refer to the cluster state, only to a single instance. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return MetadataApiApiGetVersionRequest +*/ +func (a *MetadataApiService) GetVersion(ctx context.Context) MetadataApiApiGetVersionRequest { + return MetadataApiApiGetVersionRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return InlineResponse2001 + */ +func (a *MetadataApiService) GetVersionExecute(r MetadataApiApiGetVersionRequest) (*InlineResponse2001, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *InlineResponse2001 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataApiService.GetVersion") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/version" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type MetadataApiApiIsAliveRequest struct { + ctx context.Context + ApiService MetadataApi +} + +func (r MetadataApiApiIsAliveRequest) Execute() (*InlineResponse200, *http.Response, error) { + return r.ApiService.IsAliveExecute(r) +} + +/* + * IsAlive Check HTTP Server Status + * This endpoint returns a HTTP 200 status code when Ory Keto is accepting incoming +HTTP requests. This status does currently not include checks whether the database connection is working. + +If the service supports TLS Edge Termination, this endpoint does not require the +`X-Forwarded-Proto` header to be set. + +Be aware that if you are running multiple nodes of this service, the health status will never +refer to the cluster state, only to a single instance. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return MetadataApiApiIsAliveRequest +*/ +func (a *MetadataApiService) IsAlive(ctx context.Context) MetadataApiApiIsAliveRequest { + return MetadataApiApiIsAliveRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return InlineResponse200 + */ +func (a *MetadataApiService) IsAliveExecute(r MetadataApiApiIsAliveRequest) (*InlineResponse200, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *InlineResponse200 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataApiService.IsAlive") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/health/alive" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type MetadataApiApiIsReadyRequest struct { + ctx context.Context + ApiService MetadataApi +} + +func (r MetadataApiApiIsReadyRequest) Execute() (*InlineResponse200, *http.Response, error) { + return r.ApiService.IsReadyExecute(r) +} + +/* + * IsReady Check HTTP Server and Database Status + * This endpoint returns a HTTP 200 status code when Ory Keto is up running and the environment dependencies (e.g. +the database) are responsive as well. + +If the service supports TLS Edge Termination, this endpoint does not require the +`X-Forwarded-Proto` header to be set. + +Be aware that if you are running multiple nodes of Ory Keto, the health status will never +refer to the cluster state, only to a single instance. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return MetadataApiApiIsReadyRequest +*/ +func (a *MetadataApiService) IsReady(ctx context.Context) MetadataApiApiIsReadyRequest { + return MetadataApiApiIsReadyRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return InlineResponse200 + */ +func (a *MetadataApiService) IsReadyExecute(r MetadataApiApiIsReadyRequest) (*InlineResponse200, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *InlineResponse200 + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MetadataApiService.IsReady") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/health/ready" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 503 { + var v InlineResponse503 + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/internal/httpclient-next/api_read.go b/internal/httpclient-next/api_read.go new file mode 100644 index 000000000..3fd00fe18 --- /dev/null +++ b/internal/httpclient-next/api_read.go @@ -0,0 +1,1055 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" +) + +// Linger please +var ( + _ context.Context +) + +type ReadApi interface { + + /* + * GetCheck Check a relation tuple + * To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ReadApiApiGetCheckRequest + */ + GetCheck(ctx context.Context) ReadApiApiGetCheckRequest + + /* + * GetCheckExecute executes the request + * @return GetCheckResponse + */ + GetCheckExecute(r ReadApiApiGetCheckRequest) (*GetCheckResponse, *http.Response, error) + + /* + * GetCheckMirrorStatus Check a relation tuple + * To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ReadApiApiGetCheckMirrorStatusRequest + */ + GetCheckMirrorStatus(ctx context.Context) ReadApiApiGetCheckMirrorStatusRequest + + /* + * GetCheckMirrorStatusExecute executes the request + * @return GetCheckResponse + */ + GetCheckMirrorStatusExecute(r ReadApiApiGetCheckMirrorStatusRequest) (*GetCheckResponse, *http.Response, error) + + /* + * GetExpand Expand a Relation Tuple + * Use this endpoint to expand a relation tuple. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ReadApiApiGetExpandRequest + */ + GetExpand(ctx context.Context) ReadApiApiGetExpandRequest + + /* + * GetExpandExecute executes the request + * @return ExpandTree + */ + GetExpandExecute(r ReadApiApiGetExpandRequest) (*ExpandTree, *http.Response, error) + + /* + * GetRelationTuples Query relation tuples + * Get all relation tuples that match the query. Only the namespace field is required. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ReadApiApiGetRelationTuplesRequest + */ + GetRelationTuples(ctx context.Context) ReadApiApiGetRelationTuplesRequest + + /* + * GetRelationTuplesExecute executes the request + * @return GetRelationTuplesResponse + */ + GetRelationTuplesExecute(r ReadApiApiGetRelationTuplesRequest) (*GetRelationTuplesResponse, *http.Response, error) + + /* + * PostCheck Check a relation tuple + * To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ReadApiApiPostCheckRequest + */ + PostCheck(ctx context.Context) ReadApiApiPostCheckRequest + + /* + * PostCheckExecute executes the request + * @return GetCheckResponse + */ + PostCheckExecute(r ReadApiApiPostCheckRequest) (*GetCheckResponse, *http.Response, error) + + /* + * PostCheckMirrorStatus Check a relation tuple + * To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ReadApiApiPostCheckMirrorStatusRequest + */ + PostCheckMirrorStatus(ctx context.Context) ReadApiApiPostCheckMirrorStatusRequest + + /* + * PostCheckMirrorStatusExecute executes the request + * @return GetCheckResponse + */ + PostCheckMirrorStatusExecute(r ReadApiApiPostCheckMirrorStatusRequest) (*GetCheckResponse, *http.Response, error) +} + +// ReadApiService ReadApi service +type ReadApiService service + +type ReadApiApiGetCheckRequest struct { + ctx context.Context + ApiService ReadApi + namespace *string + object *string + relation *string + subjectId *string + subjectSetNamespace *string + subjectSetObject *string + subjectSetRelation *string + maxDepth *int64 +} + +func (r ReadApiApiGetCheckRequest) Namespace(namespace string) ReadApiApiGetCheckRequest { + r.namespace = &namespace + return r +} +func (r ReadApiApiGetCheckRequest) Object(object string) ReadApiApiGetCheckRequest { + r.object = &object + return r +} +func (r ReadApiApiGetCheckRequest) Relation(relation string) ReadApiApiGetCheckRequest { + r.relation = &relation + return r +} +func (r ReadApiApiGetCheckRequest) SubjectId(subjectId string) ReadApiApiGetCheckRequest { + r.subjectId = &subjectId + return r +} +func (r ReadApiApiGetCheckRequest) SubjectSetNamespace(subjectSetNamespace string) ReadApiApiGetCheckRequest { + r.subjectSetNamespace = &subjectSetNamespace + return r +} +func (r ReadApiApiGetCheckRequest) SubjectSetObject(subjectSetObject string) ReadApiApiGetCheckRequest { + r.subjectSetObject = &subjectSetObject + return r +} +func (r ReadApiApiGetCheckRequest) SubjectSetRelation(subjectSetRelation string) ReadApiApiGetCheckRequest { + r.subjectSetRelation = &subjectSetRelation + return r +} +func (r ReadApiApiGetCheckRequest) MaxDepth(maxDepth int64) ReadApiApiGetCheckRequest { + r.maxDepth = &maxDepth + return r +} + +func (r ReadApiApiGetCheckRequest) Execute() (*GetCheckResponse, *http.Response, error) { + return r.ApiService.GetCheckExecute(r) +} + +/* + * GetCheck Check a relation tuple + * To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ReadApiApiGetCheckRequest + */ +func (a *ReadApiService) GetCheck(ctx context.Context) ReadApiApiGetCheckRequest { + return ReadApiApiGetCheckRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return GetCheckResponse + */ +func (a *ReadApiService) GetCheckExecute(r ReadApiApiGetCheckRequest) (*GetCheckResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *GetCheckResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ReadApiService.GetCheck") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/relation-tuples/check/openapi" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.namespace != nil { + localVarQueryParams.Add("namespace", parameterToString(*r.namespace, "")) + } + if r.object != nil { + localVarQueryParams.Add("object", parameterToString(*r.object, "")) + } + if r.relation != nil { + localVarQueryParams.Add("relation", parameterToString(*r.relation, "")) + } + if r.subjectId != nil { + localVarQueryParams.Add("subject_id", parameterToString(*r.subjectId, "")) + } + if r.subjectSetNamespace != nil { + localVarQueryParams.Add("subject_set.namespace", parameterToString(*r.subjectSetNamespace, "")) + } + if r.subjectSetObject != nil { + localVarQueryParams.Add("subject_set.object", parameterToString(*r.subjectSetObject, "")) + } + if r.subjectSetRelation != nil { + localVarQueryParams.Add("subject_set.relation", parameterToString(*r.subjectSetRelation, "")) + } + if r.maxDepth != nil { + localVarQueryParams.Add("max-depth", parameterToString(*r.maxDepth, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ReadApiApiGetCheckMirrorStatusRequest struct { + ctx context.Context + ApiService ReadApi +} + +func (r ReadApiApiGetCheckMirrorStatusRequest) Execute() (*GetCheckResponse, *http.Response, error) { + return r.ApiService.GetCheckMirrorStatusExecute(r) +} + +/* + * GetCheckMirrorStatus Check a relation tuple + * To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ReadApiApiGetCheckMirrorStatusRequest + */ +func (a *ReadApiService) GetCheckMirrorStatus(ctx context.Context) ReadApiApiGetCheckMirrorStatusRequest { + return ReadApiApiGetCheckMirrorStatusRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return GetCheckResponse + */ +func (a *ReadApiService) GetCheckMirrorStatusExecute(r ReadApiApiGetCheckMirrorStatusRequest) (*GetCheckResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *GetCheckResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ReadApiService.GetCheckMirrorStatus") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/relation-tuples/check" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GetCheckResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ReadApiApiGetExpandRequest struct { + ctx context.Context + ApiService ReadApi + namespace *string + object *string + relation *string + maxDepth *int64 +} + +func (r ReadApiApiGetExpandRequest) Namespace(namespace string) ReadApiApiGetExpandRequest { + r.namespace = &namespace + return r +} +func (r ReadApiApiGetExpandRequest) Object(object string) ReadApiApiGetExpandRequest { + r.object = &object + return r +} +func (r ReadApiApiGetExpandRequest) Relation(relation string) ReadApiApiGetExpandRequest { + r.relation = &relation + return r +} +func (r ReadApiApiGetExpandRequest) MaxDepth(maxDepth int64) ReadApiApiGetExpandRequest { + r.maxDepth = &maxDepth + return r +} + +func (r ReadApiApiGetExpandRequest) Execute() (*ExpandTree, *http.Response, error) { + return r.ApiService.GetExpandExecute(r) +} + +/* + * GetExpand Expand a Relation Tuple + * Use this endpoint to expand a relation tuple. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ReadApiApiGetExpandRequest + */ +func (a *ReadApiService) GetExpand(ctx context.Context) ReadApiApiGetExpandRequest { + return ReadApiApiGetExpandRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return ExpandTree + */ +func (a *ReadApiService) GetExpandExecute(r ReadApiApiGetExpandRequest) (*ExpandTree, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *ExpandTree + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ReadApiService.GetExpand") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/relation-tuples/expand" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.namespace == nil { + return localVarReturnValue, nil, reportError("namespace is required and must be specified") + } + if r.object == nil { + return localVarReturnValue, nil, reportError("object is required and must be specified") + } + if r.relation == nil { + return localVarReturnValue, nil, reportError("relation is required and must be specified") + } + + localVarQueryParams.Add("namespace", parameterToString(*r.namespace, "")) + localVarQueryParams.Add("object", parameterToString(*r.object, "")) + localVarQueryParams.Add("relation", parameterToString(*r.relation, "")) + if r.maxDepth != nil { + localVarQueryParams.Add("max-depth", parameterToString(*r.maxDepth, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ReadApiApiGetRelationTuplesRequest struct { + ctx context.Context + ApiService ReadApi + pageToken *string + pageSize *int64 + namespace *string + object *string + relation *string + subjectId *string + subjectSetNamespace *string + subjectSetObject *string + subjectSetRelation *string +} + +func (r ReadApiApiGetRelationTuplesRequest) PageToken(pageToken string) ReadApiApiGetRelationTuplesRequest { + r.pageToken = &pageToken + return r +} +func (r ReadApiApiGetRelationTuplesRequest) PageSize(pageSize int64) ReadApiApiGetRelationTuplesRequest { + r.pageSize = &pageSize + return r +} +func (r ReadApiApiGetRelationTuplesRequest) Namespace(namespace string) ReadApiApiGetRelationTuplesRequest { + r.namespace = &namespace + return r +} +func (r ReadApiApiGetRelationTuplesRequest) Object(object string) ReadApiApiGetRelationTuplesRequest { + r.object = &object + return r +} +func (r ReadApiApiGetRelationTuplesRequest) Relation(relation string) ReadApiApiGetRelationTuplesRequest { + r.relation = &relation + return r +} +func (r ReadApiApiGetRelationTuplesRequest) SubjectId(subjectId string) ReadApiApiGetRelationTuplesRequest { + r.subjectId = &subjectId + return r +} +func (r ReadApiApiGetRelationTuplesRequest) SubjectSetNamespace(subjectSetNamespace string) ReadApiApiGetRelationTuplesRequest { + r.subjectSetNamespace = &subjectSetNamespace + return r +} +func (r ReadApiApiGetRelationTuplesRequest) SubjectSetObject(subjectSetObject string) ReadApiApiGetRelationTuplesRequest { + r.subjectSetObject = &subjectSetObject + return r +} +func (r ReadApiApiGetRelationTuplesRequest) SubjectSetRelation(subjectSetRelation string) ReadApiApiGetRelationTuplesRequest { + r.subjectSetRelation = &subjectSetRelation + return r +} + +func (r ReadApiApiGetRelationTuplesRequest) Execute() (*GetRelationTuplesResponse, *http.Response, error) { + return r.ApiService.GetRelationTuplesExecute(r) +} + +/* + * GetRelationTuples Query relation tuples + * Get all relation tuples that match the query. Only the namespace field is required. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ReadApiApiGetRelationTuplesRequest + */ +func (a *ReadApiService) GetRelationTuples(ctx context.Context) ReadApiApiGetRelationTuplesRequest { + return ReadApiApiGetRelationTuplesRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return GetRelationTuplesResponse + */ +func (a *ReadApiService) GetRelationTuplesExecute(r ReadApiApiGetRelationTuplesRequest) (*GetRelationTuplesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *GetRelationTuplesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ReadApiService.GetRelationTuples") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/relation-tuples" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.pageToken != nil { + localVarQueryParams.Add("page_token", parameterToString(*r.pageToken, "")) + } + if r.pageSize != nil { + localVarQueryParams.Add("page_size", parameterToString(*r.pageSize, "")) + } + if r.namespace != nil { + localVarQueryParams.Add("namespace", parameterToString(*r.namespace, "")) + } + if r.object != nil { + localVarQueryParams.Add("object", parameterToString(*r.object, "")) + } + if r.relation != nil { + localVarQueryParams.Add("relation", parameterToString(*r.relation, "")) + } + if r.subjectId != nil { + localVarQueryParams.Add("subject_id", parameterToString(*r.subjectId, "")) + } + if r.subjectSetNamespace != nil { + localVarQueryParams.Add("subject_set.namespace", parameterToString(*r.subjectSetNamespace, "")) + } + if r.subjectSetObject != nil { + localVarQueryParams.Add("subject_set.object", parameterToString(*r.subjectSetObject, "")) + } + if r.subjectSetRelation != nil { + localVarQueryParams.Add("subject_set.relation", parameterToString(*r.subjectSetRelation, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ReadApiApiPostCheckRequest struct { + ctx context.Context + ApiService ReadApi + maxDepth *int64 + relationQuery *RelationQuery +} + +func (r ReadApiApiPostCheckRequest) MaxDepth(maxDepth int64) ReadApiApiPostCheckRequest { + r.maxDepth = &maxDepth + return r +} +func (r ReadApiApiPostCheckRequest) RelationQuery(relationQuery RelationQuery) ReadApiApiPostCheckRequest { + r.relationQuery = &relationQuery + return r +} + +func (r ReadApiApiPostCheckRequest) Execute() (*GetCheckResponse, *http.Response, error) { + return r.ApiService.PostCheckExecute(r) +} + +/* + * PostCheck Check a relation tuple + * To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ReadApiApiPostCheckRequest + */ +func (a *ReadApiService) PostCheck(ctx context.Context) ReadApiApiPostCheckRequest { + return ReadApiApiPostCheckRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return GetCheckResponse + */ +func (a *ReadApiService) PostCheckExecute(r ReadApiApiPostCheckRequest) (*GetCheckResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *GetCheckResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ReadApiService.PostCheck") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/relation-tuples/check/openapi" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.maxDepth != nil { + localVarQueryParams.Add("max-depth", parameterToString(*r.maxDepth, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.relationQuery + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ReadApiApiPostCheckMirrorStatusRequest struct { + ctx context.Context + ApiService ReadApi +} + +func (r ReadApiApiPostCheckMirrorStatusRequest) Execute() (*GetCheckResponse, *http.Response, error) { + return r.ApiService.PostCheckMirrorStatusExecute(r) +} + +/* + * PostCheckMirrorStatus Check a relation tuple + * To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return ReadApiApiPostCheckMirrorStatusRequest + */ +func (a *ReadApiService) PostCheckMirrorStatus(ctx context.Context) ReadApiApiPostCheckMirrorStatusRequest { + return ReadApiApiPostCheckMirrorStatusRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return GetCheckResponse + */ +func (a *ReadApiService) PostCheckMirrorStatusExecute(r ReadApiApiPostCheckMirrorStatusRequest) (*GetCheckResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *GetCheckResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ReadApiService.PostCheckMirrorStatus") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/relation-tuples/check" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v GetCheckResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/internal/httpclient-next/api_write.go b/internal/httpclient-next/api_write.go new file mode 100644 index 000000000..3e6183f50 --- /dev/null +++ b/internal/httpclient-next/api_write.go @@ -0,0 +1,492 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" +) + +// Linger please +var ( + _ context.Context +) + +type WriteApi interface { + + /* + * CreateRelationTuple Create a Relation Tuple + * Use this endpoint to create a relation tuple. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return WriteApiApiCreateRelationTupleRequest + */ + CreateRelationTuple(ctx context.Context) WriteApiApiCreateRelationTupleRequest + + /* + * CreateRelationTupleExecute executes the request + * @return RelationQuery + */ + CreateRelationTupleExecute(r WriteApiApiCreateRelationTupleRequest) (*RelationQuery, *http.Response, error) + + /* + * DeleteRelationTuples Delete Relation Tuples + * Use this endpoint to delete relation tuples + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return WriteApiApiDeleteRelationTuplesRequest + */ + DeleteRelationTuples(ctx context.Context) WriteApiApiDeleteRelationTuplesRequest + + /* + * DeleteRelationTuplesExecute executes the request + */ + DeleteRelationTuplesExecute(r WriteApiApiDeleteRelationTuplesRequest) (*http.Response, error) + + /* + * PatchRelationTuples Patch Multiple Relation Tuples + * Use this endpoint to patch one or more relation tuples. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return WriteApiApiPatchRelationTuplesRequest + */ + PatchRelationTuples(ctx context.Context) WriteApiApiPatchRelationTuplesRequest + + /* + * PatchRelationTuplesExecute executes the request + */ + PatchRelationTuplesExecute(r WriteApiApiPatchRelationTuplesRequest) (*http.Response, error) +} + +// WriteApiService WriteApi service +type WriteApiService service + +type WriteApiApiCreateRelationTupleRequest struct { + ctx context.Context + ApiService WriteApi + relationQuery *RelationQuery +} + +func (r WriteApiApiCreateRelationTupleRequest) RelationQuery(relationQuery RelationQuery) WriteApiApiCreateRelationTupleRequest { + r.relationQuery = &relationQuery + return r +} + +func (r WriteApiApiCreateRelationTupleRequest) Execute() (*RelationQuery, *http.Response, error) { + return r.ApiService.CreateRelationTupleExecute(r) +} + +/* + * CreateRelationTuple Create a Relation Tuple + * Use this endpoint to create a relation tuple. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return WriteApiApiCreateRelationTupleRequest + */ +func (a *WriteApiService) CreateRelationTuple(ctx context.Context) WriteApiApiCreateRelationTupleRequest { + return WriteApiApiCreateRelationTupleRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + * @return RelationQuery + */ +func (a *WriteApiService) CreateRelationTupleExecute(r WriteApiApiCreateRelationTupleRequest) (*RelationQuery, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *RelationQuery + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WriteApiService.CreateRelationTuple") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/relation-tuples" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.relationQuery + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type WriteApiApiDeleteRelationTuplesRequest struct { + ctx context.Context + ApiService WriteApi + namespace *string + object *string + relation *string + subjectId *string + subjectSetNamespace *string + subjectSetObject *string + subjectSetRelation *string +} + +func (r WriteApiApiDeleteRelationTuplesRequest) Namespace(namespace string) WriteApiApiDeleteRelationTuplesRequest { + r.namespace = &namespace + return r +} +func (r WriteApiApiDeleteRelationTuplesRequest) Object(object string) WriteApiApiDeleteRelationTuplesRequest { + r.object = &object + return r +} +func (r WriteApiApiDeleteRelationTuplesRequest) Relation(relation string) WriteApiApiDeleteRelationTuplesRequest { + r.relation = &relation + return r +} +func (r WriteApiApiDeleteRelationTuplesRequest) SubjectId(subjectId string) WriteApiApiDeleteRelationTuplesRequest { + r.subjectId = &subjectId + return r +} +func (r WriteApiApiDeleteRelationTuplesRequest) SubjectSetNamespace(subjectSetNamespace string) WriteApiApiDeleteRelationTuplesRequest { + r.subjectSetNamespace = &subjectSetNamespace + return r +} +func (r WriteApiApiDeleteRelationTuplesRequest) SubjectSetObject(subjectSetObject string) WriteApiApiDeleteRelationTuplesRequest { + r.subjectSetObject = &subjectSetObject + return r +} +func (r WriteApiApiDeleteRelationTuplesRequest) SubjectSetRelation(subjectSetRelation string) WriteApiApiDeleteRelationTuplesRequest { + r.subjectSetRelation = &subjectSetRelation + return r +} + +func (r WriteApiApiDeleteRelationTuplesRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteRelationTuplesExecute(r) +} + +/* + * DeleteRelationTuples Delete Relation Tuples + * Use this endpoint to delete relation tuples + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return WriteApiApiDeleteRelationTuplesRequest + */ +func (a *WriteApiService) DeleteRelationTuples(ctx context.Context) WriteApiApiDeleteRelationTuplesRequest { + return WriteApiApiDeleteRelationTuplesRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *WriteApiService) DeleteRelationTuplesExecute(r WriteApiApiDeleteRelationTuplesRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WriteApiService.DeleteRelationTuples") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/relation-tuples" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.namespace != nil { + localVarQueryParams.Add("namespace", parameterToString(*r.namespace, "")) + } + if r.object != nil { + localVarQueryParams.Add("object", parameterToString(*r.object, "")) + } + if r.relation != nil { + localVarQueryParams.Add("relation", parameterToString(*r.relation, "")) + } + if r.subjectId != nil { + localVarQueryParams.Add("subject_id", parameterToString(*r.subjectId, "")) + } + if r.subjectSetNamespace != nil { + localVarQueryParams.Add("subject_set.namespace", parameterToString(*r.subjectSetNamespace, "")) + } + if r.subjectSetObject != nil { + localVarQueryParams.Add("subject_set.object", parameterToString(*r.subjectSetObject, "")) + } + if r.subjectSetRelation != nil { + localVarQueryParams.Add("subject_set.relation", parameterToString(*r.subjectSetRelation, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type WriteApiApiPatchRelationTuplesRequest struct { + ctx context.Context + ApiService WriteApi + patchDelta *[]PatchDelta +} + +func (r WriteApiApiPatchRelationTuplesRequest) PatchDelta(patchDelta []PatchDelta) WriteApiApiPatchRelationTuplesRequest { + r.patchDelta = &patchDelta + return r +} + +func (r WriteApiApiPatchRelationTuplesRequest) Execute() (*http.Response, error) { + return r.ApiService.PatchRelationTuplesExecute(r) +} + +/* + * PatchRelationTuples Patch Multiple Relation Tuples + * Use this endpoint to patch one or more relation tuples. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @return WriteApiApiPatchRelationTuplesRequest + */ +func (a *WriteApiService) PatchRelationTuples(ctx context.Context) WriteApiApiPatchRelationTuplesRequest { + return WriteApiApiPatchRelationTuplesRequest{ + ApiService: a, + ctx: ctx, + } +} + +/* + * Execute executes the request + */ +func (a *WriteApiService) PatchRelationTuplesExecute(r WriteApiApiPatchRelationTuplesRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "WriteApiService.PatchRelationTuples") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/admin/relation-tuples" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchDelta + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/internal/httpclient-next/client.go b/internal/httpclient-next/client.go new file mode 100644 index 000000000..6c08d9c81 --- /dev/null +++ b/internal/httpclient-next/client.go @@ -0,0 +1,547 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) +) + +// APIClient manages communication with the Ory Keto API API v1.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + MetadataApi MetadataApi + + ReadApi ReadApi + + WriteApi WriteApi +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.MetadataApi = (*MetadataApiService)(&c.common) + c.ReadApi = (*ReadApiService)(&c.common) + c.WriteApi = (*WriteApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } else if t, ok := obj.(time.Time); ok { + return t.Format(time.RFC3339) + } + + return fmt.Sprintf("%v", obj) +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *Configuration { + return c.cfg +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFileName string, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Prevent trying to import "bytes" +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} diff --git a/internal/httpclient-next/configuration.go b/internal/httpclient-next/configuration.go new file mode 100644 index 000000000..2a8e424f0 --- /dev/null +++ b/internal/httpclient-next/configuration.go @@ -0,0 +1,230 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") + + // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. + ContextHttpSignatureAuth = contextKey("httpsignature") + + // ContextServerIndex uses a server configuration from the index. + ContextServerIndex = contextKey("serverIndex") + + // ContextOperationServerIndices uses a server configuration from the index mapping. + ContextOperationServerIndices = contextKey("serverOperationIndices") + + // ContextServerVariables overrides a server configuration variables. + ContextServerVariables = contextKey("serverVariables") + + // ContextOperationServerVariables overrides a server configuration variables using operation specific values. + ContextOperationServerVariables = contextKey("serverOperationVariables") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// ServerVariable stores the information about a server variable +type ServerVariable struct { + Description string + DefaultValue string + EnumValues []string +} + +// ServerConfiguration stores the information about a server +type ServerConfiguration struct { + URL string + Description string + Variables map[string]ServerVariable +} + +// ServerConfigurations stores multiple ServerConfiguration items +type ServerConfigurations []ServerConfiguration + +// Configuration stores the configuration of the API client +type Configuration struct { + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + Debug bool `json:"debug,omitempty"` + Servers ServerConfigurations + OperationServers map[string]ServerConfigurations + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + Debug: false, + Servers: ServerConfigurations{ + { + URL: "", + Description: "No description provided", + }, + }, + OperationServers: map[string]ServerConfigurations{}, + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} + +// URL formats template on a index using given variables +func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { + if index < 0 || len(sc) <= index { + return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) + } + server := sc[index] + url := server.URL + + // go through variables and replace placeholders + for name, variable := range server.Variables { + if value, ok := variables[name]; ok { + found := bool(len(variable.EnumValues) == 0) + for _, enumValue := range variable.EnumValues { + if value == enumValue { + found = true + } + } + if !found { + return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + } + url = strings.Replace(url, "{"+name+"}", value, -1) + } else { + url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) + } + } + return url, nil +} + +// ServerURL returns URL based on server settings +func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { + return c.Servers.URL(index, variables) +} + +func getServerIndex(ctx context.Context) (int, error) { + si := ctx.Value(ContextServerIndex) + if si != nil { + if index, ok := si.(int); ok { + return index, nil + } + return 0, reportError("Invalid type %T should be int", si) + } + return 0, nil +} + +func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { + osi := ctx.Value(ContextOperationServerIndices) + if osi != nil { + if operationIndices, ok := osi.(map[string]int); !ok { + return 0, reportError("Invalid type %T should be map[string]int", osi) + } else { + index, ok := operationIndices[endpoint] + if ok { + return index, nil + } + } + } + return getServerIndex(ctx) +} + +func getServerVariables(ctx context.Context) (map[string]string, error) { + sv := ctx.Value(ContextServerVariables) + if sv != nil { + if variables, ok := sv.(map[string]string); ok { + return variables, nil + } + return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) + } + return nil, nil +} + +func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { + osv := ctx.Value(ContextOperationServerVariables) + if osv != nil { + if operationVariables, ok := osv.(map[string]map[string]string); !ok { + return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) + } else { + variables, ok := operationVariables[endpoint] + if ok { + return variables, nil + } + } + } + return getServerVariables(ctx) +} + +// ServerURLWithContext returns a new server URL given an endpoint +func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { + sc, ok := c.OperationServers[endpoint] + if !ok { + sc = c.Servers + } + + if ctx == nil { + return sc.URL(0, nil) + } + + index, err := getServerOperationIndex(ctx, endpoint) + if err != nil { + return "", err + } + + variables, err := getServerOperationVariables(ctx, endpoint) + if err != nil { + return "", err + } + + return sc.URL(index, variables) +} diff --git a/internal/httpclient-next/docs/ExpandTree.md b/internal/httpclient-next/docs/ExpandTree.md new file mode 100644 index 000000000..f1525d7f9 --- /dev/null +++ b/internal/httpclient-next/docs/ExpandTree.md @@ -0,0 +1,129 @@ +# ExpandTree + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Children** | Pointer to [**[]ExpandTree**](ExpandTree.md) | | [optional] +**SubjectId** | Pointer to **string** | | [optional] +**SubjectSet** | Pointer to [**SubjectSet**](SubjectSet.md) | | [optional] +**Type** | **string** | | + +## Methods + +### NewExpandTree + +`func NewExpandTree(type_ string, ) *ExpandTree` + +NewExpandTree instantiates a new ExpandTree object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewExpandTreeWithDefaults + +`func NewExpandTreeWithDefaults() *ExpandTree` + +NewExpandTreeWithDefaults instantiates a new ExpandTree object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetChildren + +`func (o *ExpandTree) GetChildren() []ExpandTree` + +GetChildren returns the Children field if non-nil, zero value otherwise. + +### GetChildrenOk + +`func (o *ExpandTree) GetChildrenOk() (*[]ExpandTree, bool)` + +GetChildrenOk returns a tuple with the Children field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetChildren + +`func (o *ExpandTree) SetChildren(v []ExpandTree)` + +SetChildren sets Children field to given value. + +### HasChildren + +`func (o *ExpandTree) HasChildren() bool` + +HasChildren returns a boolean if a field has been set. + +### GetSubjectId + +`func (o *ExpandTree) GetSubjectId() string` + +GetSubjectId returns the SubjectId field if non-nil, zero value otherwise. + +### GetSubjectIdOk + +`func (o *ExpandTree) GetSubjectIdOk() (*string, bool)` + +GetSubjectIdOk returns a tuple with the SubjectId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubjectId + +`func (o *ExpandTree) SetSubjectId(v string)` + +SetSubjectId sets SubjectId field to given value. + +### HasSubjectId + +`func (o *ExpandTree) HasSubjectId() bool` + +HasSubjectId returns a boolean if a field has been set. + +### GetSubjectSet + +`func (o *ExpandTree) GetSubjectSet() SubjectSet` + +GetSubjectSet returns the SubjectSet field if non-nil, zero value otherwise. + +### GetSubjectSetOk + +`func (o *ExpandTree) GetSubjectSetOk() (*SubjectSet, bool)` + +GetSubjectSetOk returns a tuple with the SubjectSet field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubjectSet + +`func (o *ExpandTree) SetSubjectSet(v SubjectSet)` + +SetSubjectSet sets SubjectSet field to given value. + +### HasSubjectSet + +`func (o *ExpandTree) HasSubjectSet() bool` + +HasSubjectSet returns a boolean if a field has been set. + +### GetType + +`func (o *ExpandTree) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ExpandTree) GetTypeOk() (*string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetType + +`func (o *ExpandTree) SetType(v string)` + +SetType sets Type field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/GenericError.md b/internal/httpclient-next/docs/GenericError.md new file mode 100644 index 000000000..3601c0b8d --- /dev/null +++ b/internal/httpclient-next/docs/GenericError.md @@ -0,0 +1,186 @@ +# GenericError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **int64** | | [optional] +**Details** | Pointer to **[]map[string]map[string]interface{}** | | [optional] +**Message** | Pointer to **string** | | [optional] +**Reason** | Pointer to **string** | | [optional] +**Request** | Pointer to **string** | | [optional] +**Status** | Pointer to **string** | | [optional] + +## Methods + +### NewGenericError + +`func NewGenericError() *GenericError` + +NewGenericError instantiates a new GenericError object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGenericErrorWithDefaults + +`func NewGenericErrorWithDefaults() *GenericError` + +NewGenericErrorWithDefaults instantiates a new GenericError object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetCode + +`func (o *GenericError) GetCode() int64` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *GenericError) GetCodeOk() (*int64, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCode + +`func (o *GenericError) SetCode(v int64)` + +SetCode sets Code field to given value. + +### HasCode + +`func (o *GenericError) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### GetDetails + +`func (o *GenericError) GetDetails() []map[string]map[string]interface{}` + +GetDetails returns the Details field if non-nil, zero value otherwise. + +### GetDetailsOk + +`func (o *GenericError) GetDetailsOk() (*[]map[string]map[string]interface{}, bool)` + +GetDetailsOk returns a tuple with the Details field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetDetails + +`func (o *GenericError) SetDetails(v []map[string]map[string]interface{})` + +SetDetails sets Details field to given value. + +### HasDetails + +`func (o *GenericError) HasDetails() bool` + +HasDetails returns a boolean if a field has been set. + +### GetMessage + +`func (o *GenericError) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *GenericError) GetMessageOk() (*string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetMessage + +`func (o *GenericError) SetMessage(v string)` + +SetMessage sets Message field to given value. + +### HasMessage + +`func (o *GenericError) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### GetReason + +`func (o *GenericError) GetReason() string` + +GetReason returns the Reason field if non-nil, zero value otherwise. + +### GetReasonOk + +`func (o *GenericError) GetReasonOk() (*string, bool)` + +GetReasonOk returns a tuple with the Reason field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetReason + +`func (o *GenericError) SetReason(v string)` + +SetReason sets Reason field to given value. + +### HasReason + +`func (o *GenericError) HasReason() bool` + +HasReason returns a boolean if a field has been set. + +### GetRequest + +`func (o *GenericError) GetRequest() string` + +GetRequest returns the Request field if non-nil, zero value otherwise. + +### GetRequestOk + +`func (o *GenericError) GetRequestOk() (*string, bool)` + +GetRequestOk returns a tuple with the Request field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRequest + +`func (o *GenericError) SetRequest(v string)` + +SetRequest sets Request field to given value. + +### HasRequest + +`func (o *GenericError) HasRequest() bool` + +HasRequest returns a boolean if a field has been set. + +### GetStatus + +`func (o *GenericError) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *GenericError) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *GenericError) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *GenericError) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/GetCheckResponse.md b/internal/httpclient-next/docs/GetCheckResponse.md new file mode 100644 index 000000000..d3d3b84b9 --- /dev/null +++ b/internal/httpclient-next/docs/GetCheckResponse.md @@ -0,0 +1,51 @@ +# GetCheckResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Allowed** | **bool** | whether the relation tuple is allowed | + +## Methods + +### NewGetCheckResponse + +`func NewGetCheckResponse(allowed bool, ) *GetCheckResponse` + +NewGetCheckResponse instantiates a new GetCheckResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetCheckResponseWithDefaults + +`func NewGetCheckResponseWithDefaults() *GetCheckResponse` + +NewGetCheckResponseWithDefaults instantiates a new GetCheckResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAllowed + +`func (o *GetCheckResponse) GetAllowed() bool` + +GetAllowed returns the Allowed field if non-nil, zero value otherwise. + +### GetAllowedOk + +`func (o *GetCheckResponse) GetAllowedOk() (*bool, bool)` + +GetAllowedOk returns a tuple with the Allowed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAllowed + +`func (o *GetCheckResponse) SetAllowed(v bool)` + +SetAllowed sets Allowed field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/GetRelationTuplesResponse.md b/internal/httpclient-next/docs/GetRelationTuplesResponse.md new file mode 100644 index 000000000..742ca6ccd --- /dev/null +++ b/internal/httpclient-next/docs/GetRelationTuplesResponse.md @@ -0,0 +1,82 @@ +# GetRelationTuplesResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NextPageToken** | Pointer to **string** | The opaque token to provide in a subsequent request to get the next page. It is the empty string iff this is the last page. | [optional] +**RelationTuples** | Pointer to [**[]InternalRelationTuple**](InternalRelationTuple.md) | | [optional] + +## Methods + +### NewGetRelationTuplesResponse + +`func NewGetRelationTuplesResponse() *GetRelationTuplesResponse` + +NewGetRelationTuplesResponse instantiates a new GetRelationTuplesResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewGetRelationTuplesResponseWithDefaults + +`func NewGetRelationTuplesResponseWithDefaults() *GetRelationTuplesResponse` + +NewGetRelationTuplesResponseWithDefaults instantiates a new GetRelationTuplesResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNextPageToken + +`func (o *GetRelationTuplesResponse) GetNextPageToken() string` + +GetNextPageToken returns the NextPageToken field if non-nil, zero value otherwise. + +### GetNextPageTokenOk + +`func (o *GetRelationTuplesResponse) GetNextPageTokenOk() (*string, bool)` + +GetNextPageTokenOk returns a tuple with the NextPageToken field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNextPageToken + +`func (o *GetRelationTuplesResponse) SetNextPageToken(v string)` + +SetNextPageToken sets NextPageToken field to given value. + +### HasNextPageToken + +`func (o *GetRelationTuplesResponse) HasNextPageToken() bool` + +HasNextPageToken returns a boolean if a field has been set. + +### GetRelationTuples + +`func (o *GetRelationTuplesResponse) GetRelationTuples() []InternalRelationTuple` + +GetRelationTuples returns the RelationTuples field if non-nil, zero value otherwise. + +### GetRelationTuplesOk + +`func (o *GetRelationTuplesResponse) GetRelationTuplesOk() (*[]InternalRelationTuple, bool)` + +GetRelationTuplesOk returns a tuple with the RelationTuples field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRelationTuples + +`func (o *GetRelationTuplesResponse) SetRelationTuples(v []InternalRelationTuple)` + +SetRelationTuples sets RelationTuples field to given value. + +### HasRelationTuples + +`func (o *GetRelationTuplesResponse) HasRelationTuples() bool` + +HasRelationTuples returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/HealthNotReadyStatus.md b/internal/httpclient-next/docs/HealthNotReadyStatus.md new file mode 100644 index 000000000..9c40dcf5f --- /dev/null +++ b/internal/httpclient-next/docs/HealthNotReadyStatus.md @@ -0,0 +1,56 @@ +# HealthNotReadyStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | Pointer to **map[string]string** | Errors contains a list of errors that caused the not ready status. | [optional] + +## Methods + +### NewHealthNotReadyStatus + +`func NewHealthNotReadyStatus() *HealthNotReadyStatus` + +NewHealthNotReadyStatus instantiates a new HealthNotReadyStatus object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHealthNotReadyStatusWithDefaults + +`func NewHealthNotReadyStatusWithDefaults() *HealthNotReadyStatus` + +NewHealthNotReadyStatusWithDefaults instantiates a new HealthNotReadyStatus object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrors + +`func (o *HealthNotReadyStatus) GetErrors() map[string]string` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *HealthNotReadyStatus) GetErrorsOk() (*map[string]string, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *HealthNotReadyStatus) SetErrors(v map[string]string)` + +SetErrors sets Errors field to given value. + +### HasErrors + +`func (o *HealthNotReadyStatus) HasErrors() bool` + +HasErrors returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/HealthStatus.md b/internal/httpclient-next/docs/HealthStatus.md new file mode 100644 index 000000000..0173b4251 --- /dev/null +++ b/internal/httpclient-next/docs/HealthStatus.md @@ -0,0 +1,56 @@ +# HealthStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | Pointer to **string** | Status always contains \"ok\". | [optional] + +## Methods + +### NewHealthStatus + +`func NewHealthStatus() *HealthStatus` + +NewHealthStatus instantiates a new HealthStatus object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewHealthStatusWithDefaults + +`func NewHealthStatusWithDefaults() *HealthStatus` + +NewHealthStatusWithDefaults instantiates a new HealthStatus object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStatus + +`func (o *HealthStatus) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *HealthStatus) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *HealthStatus) SetStatus(v string)` + +SetStatus sets Status field to given value. + +### HasStatus + +`func (o *HealthStatus) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/InlineResponse200.md b/internal/httpclient-next/docs/InlineResponse200.md new file mode 100644 index 000000000..430ba9b99 --- /dev/null +++ b/internal/httpclient-next/docs/InlineResponse200.md @@ -0,0 +1,51 @@ +# InlineResponse200 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Status** | **string** | Always \"ok\". | + +## Methods + +### NewInlineResponse200 + +`func NewInlineResponse200(status string, ) *InlineResponse200` + +NewInlineResponse200 instantiates a new InlineResponse200 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineResponse200WithDefaults + +`func NewInlineResponse200WithDefaults() *InlineResponse200` + +NewInlineResponse200WithDefaults instantiates a new InlineResponse200 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetStatus + +`func (o *InlineResponse200) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InlineResponse200) GetStatusOk() (*string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStatus + +`func (o *InlineResponse200) SetStatus(v string)` + +SetStatus sets Status field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/InlineResponse2001.md b/internal/httpclient-next/docs/InlineResponse2001.md new file mode 100644 index 000000000..4102597f2 --- /dev/null +++ b/internal/httpclient-next/docs/InlineResponse2001.md @@ -0,0 +1,51 @@ +# InlineResponse2001 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Version** | **string** | The version of Ory Keto. | + +## Methods + +### NewInlineResponse2001 + +`func NewInlineResponse2001(version string, ) *InlineResponse2001` + +NewInlineResponse2001 instantiates a new InlineResponse2001 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineResponse2001WithDefaults + +`func NewInlineResponse2001WithDefaults() *InlineResponse2001` + +NewInlineResponse2001WithDefaults instantiates a new InlineResponse2001 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVersion + +`func (o *InlineResponse2001) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *InlineResponse2001) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *InlineResponse2001) SetVersion(v string)` + +SetVersion sets Version field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/InlineResponse503.md b/internal/httpclient-next/docs/InlineResponse503.md new file mode 100644 index 000000000..3a79177f1 --- /dev/null +++ b/internal/httpclient-next/docs/InlineResponse503.md @@ -0,0 +1,51 @@ +# InlineResponse503 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Errors** | **map[string]string** | Errors contains a list of errors that caused the not ready status. | + +## Methods + +### NewInlineResponse503 + +`func NewInlineResponse503(errors map[string]string, ) *InlineResponse503` + +NewInlineResponse503 instantiates a new InlineResponse503 object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInlineResponse503WithDefaults + +`func NewInlineResponse503WithDefaults() *InlineResponse503` + +NewInlineResponse503WithDefaults instantiates a new InlineResponse503 object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetErrors + +`func (o *InlineResponse503) GetErrors() map[string]string` + +GetErrors returns the Errors field if non-nil, zero value otherwise. + +### GetErrorsOk + +`func (o *InlineResponse503) GetErrorsOk() (*map[string]string, bool)` + +GetErrorsOk returns a tuple with the Errors field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetErrors + +`func (o *InlineResponse503) SetErrors(v map[string]string)` + +SetErrors sets Errors field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/InternalRelationTuple.md b/internal/httpclient-next/docs/InternalRelationTuple.md new file mode 100644 index 000000000..888a4ec9e --- /dev/null +++ b/internal/httpclient-next/docs/InternalRelationTuple.md @@ -0,0 +1,145 @@ +# InternalRelationTuple + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Namespace** | **string** | Namespace of the Relation Tuple | +**Object** | **string** | Object of the Relation Tuple | +**Relation** | **string** | Relation of the Relation Tuple | +**SubjectId** | Pointer to **string** | SubjectID of the Relation Tuple Either SubjectSet or SubjectID are required. | [optional] +**SubjectSet** | Pointer to [**SubjectSet**](SubjectSet.md) | | [optional] + +## Methods + +### NewInternalRelationTuple + +`func NewInternalRelationTuple(namespace string, object string, relation string, ) *InternalRelationTuple` + +NewInternalRelationTuple instantiates a new InternalRelationTuple object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewInternalRelationTupleWithDefaults + +`func NewInternalRelationTupleWithDefaults() *InternalRelationTuple` + +NewInternalRelationTupleWithDefaults instantiates a new InternalRelationTuple object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNamespace + +`func (o *InternalRelationTuple) GetNamespace() string` + +GetNamespace returns the Namespace field if non-nil, zero value otherwise. + +### GetNamespaceOk + +`func (o *InternalRelationTuple) GetNamespaceOk() (*string, bool)` + +GetNamespaceOk returns a tuple with the Namespace field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNamespace + +`func (o *InternalRelationTuple) SetNamespace(v string)` + +SetNamespace sets Namespace field to given value. + + +### GetObject + +`func (o *InternalRelationTuple) GetObject() string` + +GetObject returns the Object field if non-nil, zero value otherwise. + +### GetObjectOk + +`func (o *InternalRelationTuple) GetObjectOk() (*string, bool)` + +GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObject + +`func (o *InternalRelationTuple) SetObject(v string)` + +SetObject sets Object field to given value. + + +### GetRelation + +`func (o *InternalRelationTuple) GetRelation() string` + +GetRelation returns the Relation field if non-nil, zero value otherwise. + +### GetRelationOk + +`func (o *InternalRelationTuple) GetRelationOk() (*string, bool)` + +GetRelationOk returns a tuple with the Relation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRelation + +`func (o *InternalRelationTuple) SetRelation(v string)` + +SetRelation sets Relation field to given value. + + +### GetSubjectId + +`func (o *InternalRelationTuple) GetSubjectId() string` + +GetSubjectId returns the SubjectId field if non-nil, zero value otherwise. + +### GetSubjectIdOk + +`func (o *InternalRelationTuple) GetSubjectIdOk() (*string, bool)` + +GetSubjectIdOk returns a tuple with the SubjectId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubjectId + +`func (o *InternalRelationTuple) SetSubjectId(v string)` + +SetSubjectId sets SubjectId field to given value. + +### HasSubjectId + +`func (o *InternalRelationTuple) HasSubjectId() bool` + +HasSubjectId returns a boolean if a field has been set. + +### GetSubjectSet + +`func (o *InternalRelationTuple) GetSubjectSet() SubjectSet` + +GetSubjectSet returns the SubjectSet field if non-nil, zero value otherwise. + +### GetSubjectSetOk + +`func (o *InternalRelationTuple) GetSubjectSetOk() (*SubjectSet, bool)` + +GetSubjectSetOk returns a tuple with the SubjectSet field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubjectSet + +`func (o *InternalRelationTuple) SetSubjectSet(v SubjectSet)` + +SetSubjectSet sets SubjectSet field to given value. + +### HasSubjectSet + +`func (o *InternalRelationTuple) HasSubjectSet() bool` + +HasSubjectSet returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/MetadataApi.md b/internal/httpclient-next/docs/MetadataApi.md new file mode 100644 index 000000000..ff2c9bb07 --- /dev/null +++ b/internal/httpclient-next/docs/MetadataApi.md @@ -0,0 +1,194 @@ +# \MetadataApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetVersion**](MetadataApi.md#GetVersion) | **Get** /version | Return Running Software Version. +[**IsAlive**](MetadataApi.md#IsAlive) | **Get** /health/alive | Check HTTP Server Status +[**IsReady**](MetadataApi.md#IsReady) | **Get** /health/ready | Check HTTP Server and Database Status + + + +## GetVersion + +> InlineResponse2001 GetVersion(ctx).Execute() + +Return Running Software Version. + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetadataApi.GetVersion(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.GetVersion``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetVersion`: InlineResponse2001 + fmt.Fprintf(os.Stdout, "Response from `MetadataApi.GetVersion`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetVersionRequest struct via the builder pattern + + +### Return type + +[**InlineResponse2001**](InlineResponse2001.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## IsAlive + +> InlineResponse200 IsAlive(ctx).Execute() + +Check HTTP Server Status + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetadataApi.IsAlive(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.IsAlive``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `IsAlive`: InlineResponse200 + fmt.Fprintf(os.Stdout, "Response from `MetadataApi.IsAlive`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiIsAliveRequest struct via the builder pattern + + +### Return type + +[**InlineResponse200**](InlineResponse200.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## IsReady + +> InlineResponse200 IsReady(ctx).Execute() + +Check HTTP Server and Database Status + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.MetadataApi.IsReady(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `MetadataApi.IsReady``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `IsReady`: InlineResponse200 + fmt.Fprintf(os.Stdout, "Response from `MetadataApi.IsReady`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiIsReadyRequest struct via the builder pattern + + +### Return type + +[**InlineResponse200**](InlineResponse200.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/internal/httpclient-next/docs/PatchDelta.md b/internal/httpclient-next/docs/PatchDelta.md new file mode 100644 index 000000000..858b94d99 --- /dev/null +++ b/internal/httpclient-next/docs/PatchDelta.md @@ -0,0 +1,82 @@ +# PatchDelta + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Action** | Pointer to **string** | | [optional] +**RelationTuple** | Pointer to [**InternalRelationTuple**](InternalRelationTuple.md) | | [optional] + +## Methods + +### NewPatchDelta + +`func NewPatchDelta() *PatchDelta` + +NewPatchDelta instantiates a new PatchDelta object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewPatchDeltaWithDefaults + +`func NewPatchDeltaWithDefaults() *PatchDelta` + +NewPatchDeltaWithDefaults instantiates a new PatchDelta object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAction + +`func (o *PatchDelta) GetAction() string` + +GetAction returns the Action field if non-nil, zero value otherwise. + +### GetActionOk + +`func (o *PatchDelta) GetActionOk() (*string, bool)` + +GetActionOk returns a tuple with the Action field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAction + +`func (o *PatchDelta) SetAction(v string)` + +SetAction sets Action field to given value. + +### HasAction + +`func (o *PatchDelta) HasAction() bool` + +HasAction returns a boolean if a field has been set. + +### GetRelationTuple + +`func (o *PatchDelta) GetRelationTuple() InternalRelationTuple` + +GetRelationTuple returns the RelationTuple field if non-nil, zero value otherwise. + +### GetRelationTupleOk + +`func (o *PatchDelta) GetRelationTupleOk() (*InternalRelationTuple, bool)` + +GetRelationTupleOk returns a tuple with the RelationTuple field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRelationTuple + +`func (o *PatchDelta) SetRelationTuple(v InternalRelationTuple)` + +SetRelationTuple sets RelationTuple field to given value. + +### HasRelationTuple + +`func (o *PatchDelta) HasRelationTuple() bool` + +HasRelationTuple returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/ReadApi.md b/internal/httpclient-next/docs/ReadApi.md new file mode 100644 index 000000000..f789381a7 --- /dev/null +++ b/internal/httpclient-next/docs/ReadApi.md @@ -0,0 +1,438 @@ +# \ReadApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GetCheck**](ReadApi.md#GetCheck) | **Get** /relation-tuples/check/openapi | Check a relation tuple +[**GetCheckMirrorStatus**](ReadApi.md#GetCheckMirrorStatus) | **Get** /relation-tuples/check | Check a relation tuple +[**GetExpand**](ReadApi.md#GetExpand) | **Get** /relation-tuples/expand | Expand a Relation Tuple +[**GetRelationTuples**](ReadApi.md#GetRelationTuples) | **Get** /relation-tuples | Query relation tuples +[**PostCheck**](ReadApi.md#PostCheck) | **Post** /relation-tuples/check/openapi | Check a relation tuple +[**PostCheckMirrorStatus**](ReadApi.md#PostCheckMirrorStatus) | **Post** /relation-tuples/check | Check a relation tuple + + + +## GetCheck + +> GetCheckResponse GetCheck(ctx).Namespace(namespace).Object(object).Relation(relation).SubjectId(subjectId).SubjectSetNamespace(subjectSetNamespace).SubjectSetObject(subjectSetObject).SubjectSetRelation(subjectSetRelation).MaxDepth(maxDepth).Execute() + +Check a relation tuple + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + namespace := "namespace_example" // string | Namespace of the Relation Tuple (optional) + object := "object_example" // string | Object of the Relation Tuple (optional) + relation := "relation_example" // string | Relation of the Relation Tuple (optional) + subjectId := "subjectId_example" // string | SubjectID of the Relation Tuple (optional) + subjectSetNamespace := "subjectSetNamespace_example" // string | Namespace of the Subject Set (optional) + subjectSetObject := "subjectSetObject_example" // string | Object of the Subject Set (optional) + subjectSetRelation := "subjectSetRelation_example" // string | Relation of the Subject Set (optional) + maxDepth := int64(789) // int64 | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ReadApi.GetCheck(context.Background()).Namespace(namespace).Object(object).Relation(relation).SubjectId(subjectId).SubjectSetNamespace(subjectSetNamespace).SubjectSetObject(subjectSetObject).SubjectSetRelation(subjectSetRelation).MaxDepth(maxDepth).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ReadApi.GetCheck``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetCheck`: GetCheckResponse + fmt.Fprintf(os.Stdout, "Response from `ReadApi.GetCheck`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetCheckRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **namespace** | **string** | Namespace of the Relation Tuple | + **object** | **string** | Object of the Relation Tuple | + **relation** | **string** | Relation of the Relation Tuple | + **subjectId** | **string** | SubjectID of the Relation Tuple | + **subjectSetNamespace** | **string** | Namespace of the Subject Set | + **subjectSetObject** | **string** | Object of the Subject Set | + **subjectSetRelation** | **string** | Relation of the Subject Set | + **maxDepth** | **int64** | | + +### Return type + +[**GetCheckResponse**](GetCheckResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetCheckMirrorStatus + +> GetCheckResponse GetCheckMirrorStatus(ctx).Execute() + +Check a relation tuple + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ReadApi.GetCheckMirrorStatus(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ReadApi.GetCheckMirrorStatus``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetCheckMirrorStatus`: GetCheckResponse + fmt.Fprintf(os.Stdout, "Response from `ReadApi.GetCheckMirrorStatus`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetCheckMirrorStatusRequest struct via the builder pattern + + +### Return type + +[**GetCheckResponse**](GetCheckResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetExpand + +> ExpandTree GetExpand(ctx).Namespace(namespace).Object(object).Relation(relation).MaxDepth(maxDepth).Execute() + +Expand a Relation Tuple + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + namespace := "namespace_example" // string | Namespace of the Subject Set + object := "object_example" // string | Object of the Subject Set + relation := "relation_example" // string | Relation of the Subject Set + maxDepth := int64(789) // int64 | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ReadApi.GetExpand(context.Background()).Namespace(namespace).Object(object).Relation(relation).MaxDepth(maxDepth).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ReadApi.GetExpand``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetExpand`: ExpandTree + fmt.Fprintf(os.Stdout, "Response from `ReadApi.GetExpand`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetExpandRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **namespace** | **string** | Namespace of the Subject Set | + **object** | **string** | Object of the Subject Set | + **relation** | **string** | Relation of the Subject Set | + **maxDepth** | **int64** | | + +### Return type + +[**ExpandTree**](ExpandTree.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetRelationTuples + +> GetRelationTuplesResponse GetRelationTuples(ctx).PageToken(pageToken).PageSize(pageSize).Namespace(namespace).Object(object).Relation(relation).SubjectId(subjectId).SubjectSetNamespace(subjectSetNamespace).SubjectSetObject(subjectSetObject).SubjectSetRelation(subjectSetRelation).Execute() + +Query relation tuples + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + pageToken := "pageToken_example" // string | (optional) + pageSize := int64(789) // int64 | (optional) + namespace := "namespace_example" // string | Namespace of the Relation Tuple (optional) + object := "object_example" // string | Object of the Relation Tuple (optional) + relation := "relation_example" // string | Relation of the Relation Tuple (optional) + subjectId := "subjectId_example" // string | SubjectID of the Relation Tuple (optional) + subjectSetNamespace := "subjectSetNamespace_example" // string | Namespace of the Subject Set (optional) + subjectSetObject := "subjectSetObject_example" // string | Object of the Subject Set (optional) + subjectSetRelation := "subjectSetRelation_example" // string | Relation of the Subject Set (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ReadApi.GetRelationTuples(context.Background()).PageToken(pageToken).PageSize(pageSize).Namespace(namespace).Object(object).Relation(relation).SubjectId(subjectId).SubjectSetNamespace(subjectSetNamespace).SubjectSetObject(subjectSetObject).SubjectSetRelation(subjectSetRelation).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ReadApi.GetRelationTuples``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetRelationTuples`: GetRelationTuplesResponse + fmt.Fprintf(os.Stdout, "Response from `ReadApi.GetRelationTuples`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetRelationTuplesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pageToken** | **string** | | + **pageSize** | **int64** | | + **namespace** | **string** | Namespace of the Relation Tuple | + **object** | **string** | Object of the Relation Tuple | + **relation** | **string** | Relation of the Relation Tuple | + **subjectId** | **string** | SubjectID of the Relation Tuple | + **subjectSetNamespace** | **string** | Namespace of the Subject Set | + **subjectSetObject** | **string** | Object of the Subject Set | + **subjectSetRelation** | **string** | Relation of the Subject Set | + +### Return type + +[**GetRelationTuplesResponse**](GetRelationTuplesResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PostCheck + +> GetCheckResponse PostCheck(ctx).MaxDepth(maxDepth).RelationQuery(relationQuery).Execute() + +Check a relation tuple + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + maxDepth := int64(789) // int64 | (optional) + relationQuery := *openapiclient.NewRelationQuery() // RelationQuery | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ReadApi.PostCheck(context.Background()).MaxDepth(maxDepth).RelationQuery(relationQuery).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ReadApi.PostCheck``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostCheck`: GetCheckResponse + fmt.Fprintf(os.Stdout, "Response from `ReadApi.PostCheck`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiPostCheckRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **maxDepth** | **int64** | | + **relationQuery** | [**RelationQuery**](RelationQuery.md) | | + +### Return type + +[**GetCheckResponse**](GetCheckResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PostCheckMirrorStatus + +> GetCheckResponse PostCheckMirrorStatus(ctx).Execute() + +Check a relation tuple + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ReadApi.PostCheckMirrorStatus(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ReadApi.PostCheckMirrorStatus``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PostCheckMirrorStatus`: GetCheckResponse + fmt.Fprintf(os.Stdout, "Response from `ReadApi.PostCheckMirrorStatus`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiPostCheckMirrorStatusRequest struct via the builder pattern + + +### Return type + +[**GetCheckResponse**](GetCheckResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/internal/httpclient-next/docs/RelationQuery.md b/internal/httpclient-next/docs/RelationQuery.md new file mode 100644 index 000000000..c76234e2a --- /dev/null +++ b/internal/httpclient-next/docs/RelationQuery.md @@ -0,0 +1,160 @@ +# RelationQuery + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Namespace** | Pointer to **string** | Namespace of the Relation Tuple | [optional] +**Object** | Pointer to **string** | Object of the Relation Tuple | [optional] +**Relation** | Pointer to **string** | Relation of the Relation Tuple | [optional] +**SubjectId** | Pointer to **string** | SubjectID of the Relation Tuple Either SubjectSet or SubjectID can be provided. | [optional] +**SubjectSet** | Pointer to [**SubjectSet**](SubjectSet.md) | | [optional] + +## Methods + +### NewRelationQuery + +`func NewRelationQuery() *RelationQuery` + +NewRelationQuery instantiates a new RelationQuery object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewRelationQueryWithDefaults + +`func NewRelationQueryWithDefaults() *RelationQuery` + +NewRelationQueryWithDefaults instantiates a new RelationQuery object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNamespace + +`func (o *RelationQuery) GetNamespace() string` + +GetNamespace returns the Namespace field if non-nil, zero value otherwise. + +### GetNamespaceOk + +`func (o *RelationQuery) GetNamespaceOk() (*string, bool)` + +GetNamespaceOk returns a tuple with the Namespace field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNamespace + +`func (o *RelationQuery) SetNamespace(v string)` + +SetNamespace sets Namespace field to given value. + +### HasNamespace + +`func (o *RelationQuery) HasNamespace() bool` + +HasNamespace returns a boolean if a field has been set. + +### GetObject + +`func (o *RelationQuery) GetObject() string` + +GetObject returns the Object field if non-nil, zero value otherwise. + +### GetObjectOk + +`func (o *RelationQuery) GetObjectOk() (*string, bool)` + +GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObject + +`func (o *RelationQuery) SetObject(v string)` + +SetObject sets Object field to given value. + +### HasObject + +`func (o *RelationQuery) HasObject() bool` + +HasObject returns a boolean if a field has been set. + +### GetRelation + +`func (o *RelationQuery) GetRelation() string` + +GetRelation returns the Relation field if non-nil, zero value otherwise. + +### GetRelationOk + +`func (o *RelationQuery) GetRelationOk() (*string, bool)` + +GetRelationOk returns a tuple with the Relation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRelation + +`func (o *RelationQuery) SetRelation(v string)` + +SetRelation sets Relation field to given value. + +### HasRelation + +`func (o *RelationQuery) HasRelation() bool` + +HasRelation returns a boolean if a field has been set. + +### GetSubjectId + +`func (o *RelationQuery) GetSubjectId() string` + +GetSubjectId returns the SubjectId field if non-nil, zero value otherwise. + +### GetSubjectIdOk + +`func (o *RelationQuery) GetSubjectIdOk() (*string, bool)` + +GetSubjectIdOk returns a tuple with the SubjectId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubjectId + +`func (o *RelationQuery) SetSubjectId(v string)` + +SetSubjectId sets SubjectId field to given value. + +### HasSubjectId + +`func (o *RelationQuery) HasSubjectId() bool` + +HasSubjectId returns a boolean if a field has been set. + +### GetSubjectSet + +`func (o *RelationQuery) GetSubjectSet() SubjectSet` + +GetSubjectSet returns the SubjectSet field if non-nil, zero value otherwise. + +### GetSubjectSetOk + +`func (o *RelationQuery) GetSubjectSetOk() (*SubjectSet, bool)` + +GetSubjectSetOk returns a tuple with the SubjectSet field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSubjectSet + +`func (o *RelationQuery) SetSubjectSet(v SubjectSet)` + +SetSubjectSet sets SubjectSet field to given value. + +### HasSubjectSet + +`func (o *RelationQuery) HasSubjectSet() bool` + +HasSubjectSet returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/SubjectSet.md b/internal/httpclient-next/docs/SubjectSet.md new file mode 100644 index 000000000..194228eda --- /dev/null +++ b/internal/httpclient-next/docs/SubjectSet.md @@ -0,0 +1,93 @@ +# SubjectSet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Namespace** | **string** | Namespace of the Subject Set | +**Object** | **string** | Object of the Subject Set | +**Relation** | **string** | Relation of the Subject Set | + +## Methods + +### NewSubjectSet + +`func NewSubjectSet(namespace string, object string, relation string, ) *SubjectSet` + +NewSubjectSet instantiates a new SubjectSet object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewSubjectSetWithDefaults + +`func NewSubjectSetWithDefaults() *SubjectSet` + +NewSubjectSetWithDefaults instantiates a new SubjectSet object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetNamespace + +`func (o *SubjectSet) GetNamespace() string` + +GetNamespace returns the Namespace field if non-nil, zero value otherwise. + +### GetNamespaceOk + +`func (o *SubjectSet) GetNamespaceOk() (*string, bool)` + +GetNamespaceOk returns a tuple with the Namespace field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNamespace + +`func (o *SubjectSet) SetNamespace(v string)` + +SetNamespace sets Namespace field to given value. + + +### GetObject + +`func (o *SubjectSet) GetObject() string` + +GetObject returns the Object field if non-nil, zero value otherwise. + +### GetObjectOk + +`func (o *SubjectSet) GetObjectOk() (*string, bool)` + +GetObjectOk returns a tuple with the Object field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetObject + +`func (o *SubjectSet) SetObject(v string)` + +SetObject sets Object field to given value. + + +### GetRelation + +`func (o *SubjectSet) GetRelation() string` + +GetRelation returns the Relation field if non-nil, zero value otherwise. + +### GetRelationOk + +`func (o *SubjectSet) GetRelationOk() (*string, bool)` + +GetRelationOk returns a tuple with the Relation field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRelation + +`func (o *SubjectSet) SetRelation(v string)` + +SetRelation sets Relation field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/Version.md b/internal/httpclient-next/docs/Version.md new file mode 100644 index 000000000..c186956b8 --- /dev/null +++ b/internal/httpclient-next/docs/Version.md @@ -0,0 +1,56 @@ +# Version + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Version** | Pointer to **string** | Version is the service's version. | [optional] + +## Methods + +### NewVersion + +`func NewVersion() *Version` + +NewVersion instantiates a new Version object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewVersionWithDefaults + +`func NewVersionWithDefaults() *Version` + +NewVersionWithDefaults instantiates a new Version object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetVersion + +`func (o *Version) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *Version) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *Version) SetVersion(v string)` + +SetVersion sets Version field to given value. + +### HasVersion + +`func (o *Version) HasVersion() bool` + +HasVersion returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/internal/httpclient-next/docs/WriteApi.md b/internal/httpclient-next/docs/WriteApi.md new file mode 100644 index 000000000..1115b05a8 --- /dev/null +++ b/internal/httpclient-next/docs/WriteApi.md @@ -0,0 +1,217 @@ +# \WriteApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateRelationTuple**](WriteApi.md#CreateRelationTuple) | **Put** /admin/relation-tuples | Create a Relation Tuple +[**DeleteRelationTuples**](WriteApi.md#DeleteRelationTuples) | **Delete** /admin/relation-tuples | Delete Relation Tuples +[**PatchRelationTuples**](WriteApi.md#PatchRelationTuples) | **Patch** /admin/relation-tuples | Patch Multiple Relation Tuples + + + +## CreateRelationTuple + +> RelationQuery CreateRelationTuple(ctx).RelationQuery(relationQuery).Execute() + +Create a Relation Tuple + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + relationQuery := *openapiclient.NewRelationQuery() // RelationQuery | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.WriteApi.CreateRelationTuple(context.Background()).RelationQuery(relationQuery).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `WriteApi.CreateRelationTuple``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateRelationTuple`: RelationQuery + fmt.Fprintf(os.Stdout, "Response from `WriteApi.CreateRelationTuple`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateRelationTupleRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **relationQuery** | [**RelationQuery**](RelationQuery.md) | | + +### Return type + +[**RelationQuery**](RelationQuery.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteRelationTuples + +> DeleteRelationTuples(ctx).Namespace(namespace).Object(object).Relation(relation).SubjectId(subjectId).SubjectSetNamespace(subjectSetNamespace).SubjectSetObject(subjectSetObject).SubjectSetRelation(subjectSetRelation).Execute() + +Delete Relation Tuples + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + namespace := "namespace_example" // string | Namespace of the Relation Tuple (optional) + object := "object_example" // string | Object of the Relation Tuple (optional) + relation := "relation_example" // string | Relation of the Relation Tuple (optional) + subjectId := "subjectId_example" // string | SubjectID of the Relation Tuple (optional) + subjectSetNamespace := "subjectSetNamespace_example" // string | Namespace of the Subject Set (optional) + subjectSetObject := "subjectSetObject_example" // string | Object of the Subject Set (optional) + subjectSetRelation := "subjectSetRelation_example" // string | Relation of the Subject Set (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.WriteApi.DeleteRelationTuples(context.Background()).Namespace(namespace).Object(object).Relation(relation).SubjectId(subjectId).SubjectSetNamespace(subjectSetNamespace).SubjectSetObject(subjectSetObject).SubjectSetRelation(subjectSetRelation).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `WriteApi.DeleteRelationTuples``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteRelationTuplesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **namespace** | **string** | Namespace of the Relation Tuple | + **object** | **string** | Object of the Relation Tuple | + **relation** | **string** | Relation of the Relation Tuple | + **subjectId** | **string** | SubjectID of the Relation Tuple | + **subjectSetNamespace** | **string** | Namespace of the Subject Set | + **subjectSetObject** | **string** | Object of the Subject Set | + **subjectSetRelation** | **string** | Relation of the Subject Set | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## PatchRelationTuples + +> PatchRelationTuples(ctx).PatchDelta(patchDelta).Execute() + +Patch Multiple Relation Tuples + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + patchDelta := []openapiclient.PatchDelta{*openapiclient.NewPatchDelta()} // []PatchDelta | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.WriteApi.PatchRelationTuples(context.Background()).PatchDelta(patchDelta).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `WriteApi.PatchRelationTuples``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiPatchRelationTuplesRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **patchDelta** | [**[]PatchDelta**](PatchDelta.md) | | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/internal/httpclient-next/git_push.sh b/internal/httpclient-next/git_push.sh new file mode 100644 index 000000000..18f76bfd9 --- /dev/null +++ b/internal/httpclient-next/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="ory" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="keto-client-go" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/internal/httpclient-next/go.mod b/internal/httpclient-next/go.mod new file mode 100644 index 000000000..518da9f48 --- /dev/null +++ b/internal/httpclient-next/go.mod @@ -0,0 +1,7 @@ +module github.com/ory/keto-client-go + +go 1.13 + +require ( + golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 +) diff --git a/internal/httpclient-next/go.sum b/internal/httpclient-next/go.sum new file mode 100644 index 000000000..734252e68 --- /dev/null +++ b/internal/httpclient-next/go.sum @@ -0,0 +1,13 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/internal/httpclient-next/model_expand_tree.go b/internal/httpclient-next/model_expand_tree.go new file mode 100644 index 000000000..ca0843968 --- /dev/null +++ b/internal/httpclient-next/model_expand_tree.go @@ -0,0 +1,215 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// ExpandTree struct for ExpandTree +type ExpandTree struct { + Children []ExpandTree `json:"children,omitempty"` + SubjectId *string `json:"subject_id,omitempty"` + SubjectSet *SubjectSet `json:"subject_set,omitempty"` + Type string `json:"type"` +} + +// NewExpandTree instantiates a new ExpandTree object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewExpandTree(type_ string) *ExpandTree { + this := ExpandTree{} + this.Type = type_ + return &this +} + +// NewExpandTreeWithDefaults instantiates a new ExpandTree object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewExpandTreeWithDefaults() *ExpandTree { + this := ExpandTree{} + return &this +} + +// GetChildren returns the Children field value if set, zero value otherwise. +func (o *ExpandTree) GetChildren() []ExpandTree { + if o == nil || o.Children == nil { + var ret []ExpandTree + return ret + } + return o.Children +} + +// GetChildrenOk returns a tuple with the Children field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExpandTree) GetChildrenOk() ([]ExpandTree, bool) { + if o == nil || o.Children == nil { + return nil, false + } + return o.Children, true +} + +// HasChildren returns a boolean if a field has been set. +func (o *ExpandTree) HasChildren() bool { + if o != nil && o.Children != nil { + return true + } + + return false +} + +// SetChildren gets a reference to the given []ExpandTree and assigns it to the Children field. +func (o *ExpandTree) SetChildren(v []ExpandTree) { + o.Children = v +} + +// GetSubjectId returns the SubjectId field value if set, zero value otherwise. +func (o *ExpandTree) GetSubjectId() string { + if o == nil || o.SubjectId == nil { + var ret string + return ret + } + return *o.SubjectId +} + +// GetSubjectIdOk returns a tuple with the SubjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExpandTree) GetSubjectIdOk() (*string, bool) { + if o == nil || o.SubjectId == nil { + return nil, false + } + return o.SubjectId, true +} + +// HasSubjectId returns a boolean if a field has been set. +func (o *ExpandTree) HasSubjectId() bool { + if o != nil && o.SubjectId != nil { + return true + } + + return false +} + +// SetSubjectId gets a reference to the given string and assigns it to the SubjectId field. +func (o *ExpandTree) SetSubjectId(v string) { + o.SubjectId = &v +} + +// GetSubjectSet returns the SubjectSet field value if set, zero value otherwise. +func (o *ExpandTree) GetSubjectSet() SubjectSet { + if o == nil || o.SubjectSet == nil { + var ret SubjectSet + return ret + } + return *o.SubjectSet +} + +// GetSubjectSetOk returns a tuple with the SubjectSet field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ExpandTree) GetSubjectSetOk() (*SubjectSet, bool) { + if o == nil || o.SubjectSet == nil { + return nil, false + } + return o.SubjectSet, true +} + +// HasSubjectSet returns a boolean if a field has been set. +func (o *ExpandTree) HasSubjectSet() bool { + if o != nil && o.SubjectSet != nil { + return true + } + + return false +} + +// SetSubjectSet gets a reference to the given SubjectSet and assigns it to the SubjectSet field. +func (o *ExpandTree) SetSubjectSet(v SubjectSet) { + o.SubjectSet = &v +} + +// GetType returns the Type field value +func (o *ExpandTree) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ExpandTree) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ExpandTree) SetType(v string) { + o.Type = v +} + +func (o ExpandTree) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Children != nil { + toSerialize["children"] = o.Children + } + if o.SubjectId != nil { + toSerialize["subject_id"] = o.SubjectId + } + if o.SubjectSet != nil { + toSerialize["subject_set"] = o.SubjectSet + } + if true { + toSerialize["type"] = o.Type + } + return json.Marshal(toSerialize) +} + +type NullableExpandTree struct { + value *ExpandTree + isSet bool +} + +func (v NullableExpandTree) Get() *ExpandTree { + return v.value +} + +func (v *NullableExpandTree) Set(val *ExpandTree) { + v.value = val + v.isSet = true +} + +func (v NullableExpandTree) IsSet() bool { + return v.isSet +} + +func (v *NullableExpandTree) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableExpandTree(val *ExpandTree) *NullableExpandTree { + return &NullableExpandTree{value: val, isSet: true} +} + +func (v NullableExpandTree) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableExpandTree) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/model_generic_error.go b/internal/httpclient-next/model_generic_error.go new file mode 100644 index 000000000..434f770de --- /dev/null +++ b/internal/httpclient-next/model_generic_error.go @@ -0,0 +1,294 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// GenericError The standard error format +type GenericError struct { + Code *int64 `json:"code,omitempty"` + Details []map[string]map[string]interface{} `json:"details,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Request *string `json:"request,omitempty"` + Status *string `json:"status,omitempty"` +} + +// NewGenericError instantiates a new GenericError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGenericError() *GenericError { + this := GenericError{} + return &this +} + +// NewGenericErrorWithDefaults instantiates a new GenericError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGenericErrorWithDefaults() *GenericError { + this := GenericError{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *GenericError) GetCode() int64 { + if o == nil || o.Code == nil { + var ret int64 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericError) GetCodeOk() (*int64, bool) { + if o == nil || o.Code == nil { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *GenericError) HasCode() bool { + if o != nil && o.Code != nil { + return true + } + + return false +} + +// SetCode gets a reference to the given int64 and assigns it to the Code field. +func (o *GenericError) SetCode(v int64) { + o.Code = &v +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *GenericError) GetDetails() []map[string]map[string]interface{} { + if o == nil || o.Details == nil { + var ret []map[string]map[string]interface{} + return ret + } + return o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericError) GetDetailsOk() ([]map[string]map[string]interface{}, bool) { + if o == nil || o.Details == nil { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *GenericError) HasDetails() bool { + if o != nil && o.Details != nil { + return true + } + + return false +} + +// SetDetails gets a reference to the given []map[string]map[string]interface{} and assigns it to the Details field. +func (o *GenericError) SetDetails(v []map[string]map[string]interface{}) { + o.Details = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *GenericError) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericError) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *GenericError) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *GenericError) SetMessage(v string) { + o.Message = &v +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *GenericError) GetReason() string { + if o == nil || o.Reason == nil { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericError) GetReasonOk() (*string, bool) { + if o == nil || o.Reason == nil { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *GenericError) HasReason() bool { + if o != nil && o.Reason != nil { + return true + } + + return false +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *GenericError) SetReason(v string) { + o.Reason = &v +} + +// GetRequest returns the Request field value if set, zero value otherwise. +func (o *GenericError) GetRequest() string { + if o == nil || o.Request == nil { + var ret string + return ret + } + return *o.Request +} + +// GetRequestOk returns a tuple with the Request field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericError) GetRequestOk() (*string, bool) { + if o == nil || o.Request == nil { + return nil, false + } + return o.Request, true +} + +// HasRequest returns a boolean if a field has been set. +func (o *GenericError) HasRequest() bool { + if o != nil && o.Request != nil { + return true + } + + return false +} + +// SetRequest gets a reference to the given string and assigns it to the Request field. +func (o *GenericError) SetRequest(v string) { + o.Request = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *GenericError) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericError) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *GenericError) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *GenericError) SetStatus(v string) { + o.Status = &v +} + +func (o GenericError) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Code != nil { + toSerialize["code"] = o.Code + } + if o.Details != nil { + toSerialize["details"] = o.Details + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + if o.Reason != nil { + toSerialize["reason"] = o.Reason + } + if o.Request != nil { + toSerialize["request"] = o.Request + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + +type NullableGenericError struct { + value *GenericError + isSet bool +} + +func (v NullableGenericError) Get() *GenericError { + return v.value +} + +func (v *NullableGenericError) Set(val *GenericError) { + v.value = val + v.isSet = true +} + +func (v NullableGenericError) IsSet() bool { + return v.isSet +} + +func (v *NullableGenericError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenericError(val *GenericError) *NullableGenericError { + return &NullableGenericError{value: val, isSet: true} +} + +func (v NullableGenericError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenericError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/model_get_check_response.go b/internal/httpclient-next/model_get_check_response.go new file mode 100644 index 000000000..e7cf58f88 --- /dev/null +++ b/internal/httpclient-next/model_get_check_response.go @@ -0,0 +1,108 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// GetCheckResponse The content of the allowed field is mirrored in the HTTP status code. +type GetCheckResponse struct { + // whether the relation tuple is allowed + Allowed bool `json:"allowed"` +} + +// NewGetCheckResponse instantiates a new GetCheckResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetCheckResponse(allowed bool) *GetCheckResponse { + this := GetCheckResponse{} + this.Allowed = allowed + return &this +} + +// NewGetCheckResponseWithDefaults instantiates a new GetCheckResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetCheckResponseWithDefaults() *GetCheckResponse { + this := GetCheckResponse{} + return &this +} + +// GetAllowed returns the Allowed field value +func (o *GetCheckResponse) GetAllowed() bool { + if o == nil { + var ret bool + return ret + } + + return o.Allowed +} + +// GetAllowedOk returns a tuple with the Allowed field value +// and a boolean to check if the value has been set. +func (o *GetCheckResponse) GetAllowedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.Allowed, true +} + +// SetAllowed sets field value +func (o *GetCheckResponse) SetAllowed(v bool) { + o.Allowed = v +} + +func (o GetCheckResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["allowed"] = o.Allowed + } + return json.Marshal(toSerialize) +} + +type NullableGetCheckResponse struct { + value *GetCheckResponse + isSet bool +} + +func (v NullableGetCheckResponse) Get() *GetCheckResponse { + return v.value +} + +func (v *NullableGetCheckResponse) Set(val *GetCheckResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetCheckResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetCheckResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetCheckResponse(val *GetCheckResponse) *NullableGetCheckResponse { + return &NullableGetCheckResponse{value: val, isSet: true} +} + +func (v NullableGetCheckResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetCheckResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/model_get_relation_tuples_response.go b/internal/httpclient-next/model_get_relation_tuples_response.go new file mode 100644 index 000000000..61bf89cbb --- /dev/null +++ b/internal/httpclient-next/model_get_relation_tuples_response.go @@ -0,0 +1,151 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// GetRelationTuplesResponse struct for GetRelationTuplesResponse +type GetRelationTuplesResponse struct { + // The opaque token to provide in a subsequent request to get the next page. It is the empty string iff this is the last page. + NextPageToken *string `json:"next_page_token,omitempty"` + RelationTuples []InternalRelationTuple `json:"relation_tuples,omitempty"` +} + +// NewGetRelationTuplesResponse instantiates a new GetRelationTuplesResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetRelationTuplesResponse() *GetRelationTuplesResponse { + this := GetRelationTuplesResponse{} + return &this +} + +// NewGetRelationTuplesResponseWithDefaults instantiates a new GetRelationTuplesResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetRelationTuplesResponseWithDefaults() *GetRelationTuplesResponse { + this := GetRelationTuplesResponse{} + return &this +} + +// GetNextPageToken returns the NextPageToken field value if set, zero value otherwise. +func (o *GetRelationTuplesResponse) GetNextPageToken() string { + if o == nil || o.NextPageToken == nil { + var ret string + return ret + } + return *o.NextPageToken +} + +// GetNextPageTokenOk returns a tuple with the NextPageToken field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRelationTuplesResponse) GetNextPageTokenOk() (*string, bool) { + if o == nil || o.NextPageToken == nil { + return nil, false + } + return o.NextPageToken, true +} + +// HasNextPageToken returns a boolean if a field has been set. +func (o *GetRelationTuplesResponse) HasNextPageToken() bool { + if o != nil && o.NextPageToken != nil { + return true + } + + return false +} + +// SetNextPageToken gets a reference to the given string and assigns it to the NextPageToken field. +func (o *GetRelationTuplesResponse) SetNextPageToken(v string) { + o.NextPageToken = &v +} + +// GetRelationTuples returns the RelationTuples field value if set, zero value otherwise. +func (o *GetRelationTuplesResponse) GetRelationTuples() []InternalRelationTuple { + if o == nil || o.RelationTuples == nil { + var ret []InternalRelationTuple + return ret + } + return o.RelationTuples +} + +// GetRelationTuplesOk returns a tuple with the RelationTuples field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetRelationTuplesResponse) GetRelationTuplesOk() ([]InternalRelationTuple, bool) { + if o == nil || o.RelationTuples == nil { + return nil, false + } + return o.RelationTuples, true +} + +// HasRelationTuples returns a boolean if a field has been set. +func (o *GetRelationTuplesResponse) HasRelationTuples() bool { + if o != nil && o.RelationTuples != nil { + return true + } + + return false +} + +// SetRelationTuples gets a reference to the given []InternalRelationTuple and assigns it to the RelationTuples field. +func (o *GetRelationTuplesResponse) SetRelationTuples(v []InternalRelationTuple) { + o.RelationTuples = v +} + +func (o GetRelationTuplesResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.NextPageToken != nil { + toSerialize["next_page_token"] = o.NextPageToken + } + if o.RelationTuples != nil { + toSerialize["relation_tuples"] = o.RelationTuples + } + return json.Marshal(toSerialize) +} + +type NullableGetRelationTuplesResponse struct { + value *GetRelationTuplesResponse + isSet bool +} + +func (v NullableGetRelationTuplesResponse) Get() *GetRelationTuplesResponse { + return v.value +} + +func (v *NullableGetRelationTuplesResponse) Set(val *GetRelationTuplesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetRelationTuplesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetRelationTuplesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetRelationTuplesResponse(val *GetRelationTuplesResponse) *NullableGetRelationTuplesResponse { + return &NullableGetRelationTuplesResponse{value: val, isSet: true} +} + +func (v NullableGetRelationTuplesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetRelationTuplesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/model_health_not_ready_status.go b/internal/httpclient-next/model_health_not_ready_status.go new file mode 100644 index 000000000..0ecefbd16 --- /dev/null +++ b/internal/httpclient-next/model_health_not_ready_status.go @@ -0,0 +1,115 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// HealthNotReadyStatus struct for HealthNotReadyStatus +type HealthNotReadyStatus struct { + // Errors contains a list of errors that caused the not ready status. + Errors *map[string]string `json:"errors,omitempty"` +} + +// NewHealthNotReadyStatus instantiates a new HealthNotReadyStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHealthNotReadyStatus() *HealthNotReadyStatus { + this := HealthNotReadyStatus{} + return &this +} + +// NewHealthNotReadyStatusWithDefaults instantiates a new HealthNotReadyStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHealthNotReadyStatusWithDefaults() *HealthNotReadyStatus { + this := HealthNotReadyStatus{} + return &this +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *HealthNotReadyStatus) GetErrors() map[string]string { + if o == nil || o.Errors == nil { + var ret map[string]string + return ret + } + return *o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HealthNotReadyStatus) GetErrorsOk() (*map[string]string, bool) { + if o == nil || o.Errors == nil { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *HealthNotReadyStatus) HasErrors() bool { + if o != nil && o.Errors != nil { + return true + } + + return false +} + +// SetErrors gets a reference to the given map[string]string and assigns it to the Errors field. +func (o *HealthNotReadyStatus) SetErrors(v map[string]string) { + o.Errors = &v +} + +func (o HealthNotReadyStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Errors != nil { + toSerialize["errors"] = o.Errors + } + return json.Marshal(toSerialize) +} + +type NullableHealthNotReadyStatus struct { + value *HealthNotReadyStatus + isSet bool +} + +func (v NullableHealthNotReadyStatus) Get() *HealthNotReadyStatus { + return v.value +} + +func (v *NullableHealthNotReadyStatus) Set(val *HealthNotReadyStatus) { + v.value = val + v.isSet = true +} + +func (v NullableHealthNotReadyStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableHealthNotReadyStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHealthNotReadyStatus(val *HealthNotReadyStatus) *NullableHealthNotReadyStatus { + return &NullableHealthNotReadyStatus{value: val, isSet: true} +} + +func (v NullableHealthNotReadyStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHealthNotReadyStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/model_health_status.go b/internal/httpclient-next/model_health_status.go new file mode 100644 index 000000000..0418134de --- /dev/null +++ b/internal/httpclient-next/model_health_status.go @@ -0,0 +1,115 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// HealthStatus struct for HealthStatus +type HealthStatus struct { + // Status always contains \"ok\". + Status *string `json:"status,omitempty"` +} + +// NewHealthStatus instantiates a new HealthStatus object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewHealthStatus() *HealthStatus { + this := HealthStatus{} + return &this +} + +// NewHealthStatusWithDefaults instantiates a new HealthStatus object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewHealthStatusWithDefaults() *HealthStatus { + this := HealthStatus{} + return &this +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *HealthStatus) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *HealthStatus) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *HealthStatus) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *HealthStatus) SetStatus(v string) { + o.Status = &v +} + +func (o HealthStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + +type NullableHealthStatus struct { + value *HealthStatus + isSet bool +} + +func (v NullableHealthStatus) Get() *HealthStatus { + return v.value +} + +func (v *NullableHealthStatus) Set(val *HealthStatus) { + v.value = val + v.isSet = true +} + +func (v NullableHealthStatus) IsSet() bool { + return v.isSet +} + +func (v *NullableHealthStatus) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableHealthStatus(val *HealthStatus) *NullableHealthStatus { + return &NullableHealthStatus{value: val, isSet: true} +} + +func (v NullableHealthStatus) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableHealthStatus) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/model_inline_response_200.go b/internal/httpclient-next/model_inline_response_200.go new file mode 100644 index 000000000..9b003e2dd --- /dev/null +++ b/internal/httpclient-next/model_inline_response_200.go @@ -0,0 +1,108 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// InlineResponse200 struct for InlineResponse200 +type InlineResponse200 struct { + // Always \"ok\". + Status string `json:"status"` +} + +// NewInlineResponse200 instantiates a new InlineResponse200 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponse200(status string) *InlineResponse200 { + this := InlineResponse200{} + this.Status = status + return &this +} + +// NewInlineResponse200WithDefaults instantiates a new InlineResponse200 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponse200WithDefaults() *InlineResponse200 { + this := InlineResponse200{} + return &this +} + +// GetStatus returns the Status field value +func (o *InlineResponse200) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *InlineResponse200) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *InlineResponse200) SetStatus(v string) { + o.Status = v +} + +func (o InlineResponse200) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + +type NullableInlineResponse200 struct { + value *InlineResponse200 + isSet bool +} + +func (v NullableInlineResponse200) Get() *InlineResponse200 { + return v.value +} + +func (v *NullableInlineResponse200) Set(val *InlineResponse200) { + v.value = val + v.isSet = true +} + +func (v NullableInlineResponse200) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineResponse200) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineResponse200(val *InlineResponse200) *NullableInlineResponse200 { + return &NullableInlineResponse200{value: val, isSet: true} +} + +func (v NullableInlineResponse200) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineResponse200) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/model_inline_response_200_1.go b/internal/httpclient-next/model_inline_response_200_1.go new file mode 100644 index 000000000..b49e8e744 --- /dev/null +++ b/internal/httpclient-next/model_inline_response_200_1.go @@ -0,0 +1,108 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// InlineResponse2001 struct for InlineResponse2001 +type InlineResponse2001 struct { + // The version of Ory Keto. + Version string `json:"version"` +} + +// NewInlineResponse2001 instantiates a new InlineResponse2001 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponse2001(version string) *InlineResponse2001 { + this := InlineResponse2001{} + this.Version = version + return &this +} + +// NewInlineResponse2001WithDefaults instantiates a new InlineResponse2001 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponse2001WithDefaults() *InlineResponse2001 { + this := InlineResponse2001{} + return &this +} + +// GetVersion returns the Version field value +func (o *InlineResponse2001) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *InlineResponse2001) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *InlineResponse2001) SetVersion(v string) { + o.Version = v +} + +func (o InlineResponse2001) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["version"] = o.Version + } + return json.Marshal(toSerialize) +} + +type NullableInlineResponse2001 struct { + value *InlineResponse2001 + isSet bool +} + +func (v NullableInlineResponse2001) Get() *InlineResponse2001 { + return v.value +} + +func (v *NullableInlineResponse2001) Set(val *InlineResponse2001) { + v.value = val + v.isSet = true +} + +func (v NullableInlineResponse2001) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineResponse2001) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineResponse2001(val *InlineResponse2001) *NullableInlineResponse2001 { + return &NullableInlineResponse2001{value: val, isSet: true} +} + +func (v NullableInlineResponse2001) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineResponse2001) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/model_inline_response_503.go b/internal/httpclient-next/model_inline_response_503.go new file mode 100644 index 000000000..83e9d30d2 --- /dev/null +++ b/internal/httpclient-next/model_inline_response_503.go @@ -0,0 +1,108 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// InlineResponse503 struct for InlineResponse503 +type InlineResponse503 struct { + // Errors contains a list of errors that caused the not ready status. + Errors map[string]string `json:"errors"` +} + +// NewInlineResponse503 instantiates a new InlineResponse503 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInlineResponse503(errors map[string]string) *InlineResponse503 { + this := InlineResponse503{} + this.Errors = errors + return &this +} + +// NewInlineResponse503WithDefaults instantiates a new InlineResponse503 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInlineResponse503WithDefaults() *InlineResponse503 { + this := InlineResponse503{} + return &this +} + +// GetErrors returns the Errors field value +func (o *InlineResponse503) GetErrors() map[string]string { + if o == nil { + var ret map[string]string + return ret + } + + return o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value +// and a boolean to check if the value has been set. +func (o *InlineResponse503) GetErrorsOk() (*map[string]string, bool) { + if o == nil { + return nil, false + } + return &o.Errors, true +} + +// SetErrors sets field value +func (o *InlineResponse503) SetErrors(v map[string]string) { + o.Errors = v +} + +func (o InlineResponse503) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["errors"] = o.Errors + } + return json.Marshal(toSerialize) +} + +type NullableInlineResponse503 struct { + value *InlineResponse503 + isSet bool +} + +func (v NullableInlineResponse503) Get() *InlineResponse503 { + return v.value +} + +func (v *NullableInlineResponse503) Set(val *InlineResponse503) { + v.value = val + v.isSet = true +} + +func (v NullableInlineResponse503) IsSet() bool { + return v.isSet +} + +func (v *NullableInlineResponse503) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInlineResponse503(val *InlineResponse503) *NullableInlineResponse503 { + return &NullableInlineResponse503{value: val, isSet: true} +} + +func (v NullableInlineResponse503) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInlineResponse503) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/model_internal_relation_tuple.go b/internal/httpclient-next/model_internal_relation_tuple.go new file mode 100644 index 000000000..2bab98f39 --- /dev/null +++ b/internal/httpclient-next/model_internal_relation_tuple.go @@ -0,0 +1,241 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// InternalRelationTuple struct for InternalRelationTuple +type InternalRelationTuple struct { + // Namespace of the Relation Tuple + Namespace string `json:"namespace"` + // Object of the Relation Tuple + Object string `json:"object"` + // Relation of the Relation Tuple + Relation string `json:"relation"` + // SubjectID of the Relation Tuple Either SubjectSet or SubjectID are required. + SubjectId *string `json:"subject_id,omitempty"` + SubjectSet *SubjectSet `json:"subject_set,omitempty"` +} + +// NewInternalRelationTuple instantiates a new InternalRelationTuple object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalRelationTuple(namespace string, object string, relation string) *InternalRelationTuple { + this := InternalRelationTuple{} + this.Namespace = namespace + this.Object = object + this.Relation = relation + return &this +} + +// NewInternalRelationTupleWithDefaults instantiates a new InternalRelationTuple object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalRelationTupleWithDefaults() *InternalRelationTuple { + this := InternalRelationTuple{} + return &this +} + +// GetNamespace returns the Namespace field value +func (o *InternalRelationTuple) GetNamespace() string { + if o == nil { + var ret string + return ret + } + + return o.Namespace +} + +// GetNamespaceOk returns a tuple with the Namespace field value +// and a boolean to check if the value has been set. +func (o *InternalRelationTuple) GetNamespaceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Namespace, true +} + +// SetNamespace sets field value +func (o *InternalRelationTuple) SetNamespace(v string) { + o.Namespace = v +} + +// GetObject returns the Object field value +func (o *InternalRelationTuple) GetObject() string { + if o == nil { + var ret string + return ret + } + + return o.Object +} + +// GetObjectOk returns a tuple with the Object field value +// and a boolean to check if the value has been set. +func (o *InternalRelationTuple) GetObjectOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Object, true +} + +// SetObject sets field value +func (o *InternalRelationTuple) SetObject(v string) { + o.Object = v +} + +// GetRelation returns the Relation field value +func (o *InternalRelationTuple) GetRelation() string { + if o == nil { + var ret string + return ret + } + + return o.Relation +} + +// GetRelationOk returns a tuple with the Relation field value +// and a boolean to check if the value has been set. +func (o *InternalRelationTuple) GetRelationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Relation, true +} + +// SetRelation sets field value +func (o *InternalRelationTuple) SetRelation(v string) { + o.Relation = v +} + +// GetSubjectId returns the SubjectId field value if set, zero value otherwise. +func (o *InternalRelationTuple) GetSubjectId() string { + if o == nil || o.SubjectId == nil { + var ret string + return ret + } + return *o.SubjectId +} + +// GetSubjectIdOk returns a tuple with the SubjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalRelationTuple) GetSubjectIdOk() (*string, bool) { + if o == nil || o.SubjectId == nil { + return nil, false + } + return o.SubjectId, true +} + +// HasSubjectId returns a boolean if a field has been set. +func (o *InternalRelationTuple) HasSubjectId() bool { + if o != nil && o.SubjectId != nil { + return true + } + + return false +} + +// SetSubjectId gets a reference to the given string and assigns it to the SubjectId field. +func (o *InternalRelationTuple) SetSubjectId(v string) { + o.SubjectId = &v +} + +// GetSubjectSet returns the SubjectSet field value if set, zero value otherwise. +func (o *InternalRelationTuple) GetSubjectSet() SubjectSet { + if o == nil || o.SubjectSet == nil { + var ret SubjectSet + return ret + } + return *o.SubjectSet +} + +// GetSubjectSetOk returns a tuple with the SubjectSet field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalRelationTuple) GetSubjectSetOk() (*SubjectSet, bool) { + if o == nil || o.SubjectSet == nil { + return nil, false + } + return o.SubjectSet, true +} + +// HasSubjectSet returns a boolean if a field has been set. +func (o *InternalRelationTuple) HasSubjectSet() bool { + if o != nil && o.SubjectSet != nil { + return true + } + + return false +} + +// SetSubjectSet gets a reference to the given SubjectSet and assigns it to the SubjectSet field. +func (o *InternalRelationTuple) SetSubjectSet(v SubjectSet) { + o.SubjectSet = &v +} + +func (o InternalRelationTuple) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["namespace"] = o.Namespace + } + if true { + toSerialize["object"] = o.Object + } + if true { + toSerialize["relation"] = o.Relation + } + if o.SubjectId != nil { + toSerialize["subject_id"] = o.SubjectId + } + if o.SubjectSet != nil { + toSerialize["subject_set"] = o.SubjectSet + } + return json.Marshal(toSerialize) +} + +type NullableInternalRelationTuple struct { + value *InternalRelationTuple + isSet bool +} + +func (v NullableInternalRelationTuple) Get() *InternalRelationTuple { + return v.value +} + +func (v *NullableInternalRelationTuple) Set(val *InternalRelationTuple) { + v.value = val + v.isSet = true +} + +func (v NullableInternalRelationTuple) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalRelationTuple) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalRelationTuple(val *InternalRelationTuple) *NullableInternalRelationTuple { + return &NullableInternalRelationTuple{value: val, isSet: true} +} + +func (v NullableInternalRelationTuple) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalRelationTuple) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/model_patch_delta.go b/internal/httpclient-next/model_patch_delta.go new file mode 100644 index 000000000..90976e2ed --- /dev/null +++ b/internal/httpclient-next/model_patch_delta.go @@ -0,0 +1,150 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// PatchDelta struct for PatchDelta +type PatchDelta struct { + Action *string `json:"action,omitempty"` + RelationTuple *InternalRelationTuple `json:"relation_tuple,omitempty"` +} + +// NewPatchDelta instantiates a new PatchDelta object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchDelta() *PatchDelta { + this := PatchDelta{} + return &this +} + +// NewPatchDeltaWithDefaults instantiates a new PatchDelta object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchDeltaWithDefaults() *PatchDelta { + this := PatchDelta{} + return &this +} + +// GetAction returns the Action field value if set, zero value otherwise. +func (o *PatchDelta) GetAction() string { + if o == nil || o.Action == nil { + var ret string + return ret + } + return *o.Action +} + +// GetActionOk returns a tuple with the Action field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchDelta) GetActionOk() (*string, bool) { + if o == nil || o.Action == nil { + return nil, false + } + return o.Action, true +} + +// HasAction returns a boolean if a field has been set. +func (o *PatchDelta) HasAction() bool { + if o != nil && o.Action != nil { + return true + } + + return false +} + +// SetAction gets a reference to the given string and assigns it to the Action field. +func (o *PatchDelta) SetAction(v string) { + o.Action = &v +} + +// GetRelationTuple returns the RelationTuple field value if set, zero value otherwise. +func (o *PatchDelta) GetRelationTuple() InternalRelationTuple { + if o == nil || o.RelationTuple == nil { + var ret InternalRelationTuple + return ret + } + return *o.RelationTuple +} + +// GetRelationTupleOk returns a tuple with the RelationTuple field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchDelta) GetRelationTupleOk() (*InternalRelationTuple, bool) { + if o == nil || o.RelationTuple == nil { + return nil, false + } + return o.RelationTuple, true +} + +// HasRelationTuple returns a boolean if a field has been set. +func (o *PatchDelta) HasRelationTuple() bool { + if o != nil && o.RelationTuple != nil { + return true + } + + return false +} + +// SetRelationTuple gets a reference to the given InternalRelationTuple and assigns it to the RelationTuple field. +func (o *PatchDelta) SetRelationTuple(v InternalRelationTuple) { + o.RelationTuple = &v +} + +func (o PatchDelta) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Action != nil { + toSerialize["action"] = o.Action + } + if o.RelationTuple != nil { + toSerialize["relation_tuple"] = o.RelationTuple + } + return json.Marshal(toSerialize) +} + +type NullablePatchDelta struct { + value *PatchDelta + isSet bool +} + +func (v NullablePatchDelta) Get() *PatchDelta { + return v.value +} + +func (v *NullablePatchDelta) Set(val *PatchDelta) { + v.value = val + v.isSet = true +} + +func (v NullablePatchDelta) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchDelta) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchDelta(val *PatchDelta) *NullablePatchDelta { + return &NullablePatchDelta{value: val, isSet: true} +} + +func (v NullablePatchDelta) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchDelta) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/model_relation_query.go b/internal/httpclient-next/model_relation_query.go new file mode 100644 index 000000000..b17597f60 --- /dev/null +++ b/internal/httpclient-next/model_relation_query.go @@ -0,0 +1,262 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// RelationQuery struct for RelationQuery +type RelationQuery struct { + // Namespace of the Relation Tuple + Namespace *string `json:"namespace,omitempty"` + // Object of the Relation Tuple + Object *string `json:"object,omitempty"` + // Relation of the Relation Tuple + Relation *string `json:"relation,omitempty"` + // SubjectID of the Relation Tuple Either SubjectSet or SubjectID can be provided. + SubjectId *string `json:"subject_id,omitempty"` + SubjectSet *SubjectSet `json:"subject_set,omitempty"` +} + +// NewRelationQuery instantiates a new RelationQuery object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRelationQuery() *RelationQuery { + this := RelationQuery{} + return &this +} + +// NewRelationQueryWithDefaults instantiates a new RelationQuery object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRelationQueryWithDefaults() *RelationQuery { + this := RelationQuery{} + return &this +} + +// GetNamespace returns the Namespace field value if set, zero value otherwise. +func (o *RelationQuery) GetNamespace() string { + if o == nil || o.Namespace == nil { + var ret string + return ret + } + return *o.Namespace +} + +// GetNamespaceOk returns a tuple with the Namespace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RelationQuery) GetNamespaceOk() (*string, bool) { + if o == nil || o.Namespace == nil { + return nil, false + } + return o.Namespace, true +} + +// HasNamespace returns a boolean if a field has been set. +func (o *RelationQuery) HasNamespace() bool { + if o != nil && o.Namespace != nil { + return true + } + + return false +} + +// SetNamespace gets a reference to the given string and assigns it to the Namespace field. +func (o *RelationQuery) SetNamespace(v string) { + o.Namespace = &v +} + +// GetObject returns the Object field value if set, zero value otherwise. +func (o *RelationQuery) GetObject() string { + if o == nil || o.Object == nil { + var ret string + return ret + } + return *o.Object +} + +// GetObjectOk returns a tuple with the Object field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RelationQuery) GetObjectOk() (*string, bool) { + if o == nil || o.Object == nil { + return nil, false + } + return o.Object, true +} + +// HasObject returns a boolean if a field has been set. +func (o *RelationQuery) HasObject() bool { + if o != nil && o.Object != nil { + return true + } + + return false +} + +// SetObject gets a reference to the given string and assigns it to the Object field. +func (o *RelationQuery) SetObject(v string) { + o.Object = &v +} + +// GetRelation returns the Relation field value if set, zero value otherwise. +func (o *RelationQuery) GetRelation() string { + if o == nil || o.Relation == nil { + var ret string + return ret + } + return *o.Relation +} + +// GetRelationOk returns a tuple with the Relation field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RelationQuery) GetRelationOk() (*string, bool) { + if o == nil || o.Relation == nil { + return nil, false + } + return o.Relation, true +} + +// HasRelation returns a boolean if a field has been set. +func (o *RelationQuery) HasRelation() bool { + if o != nil && o.Relation != nil { + return true + } + + return false +} + +// SetRelation gets a reference to the given string and assigns it to the Relation field. +func (o *RelationQuery) SetRelation(v string) { + o.Relation = &v +} + +// GetSubjectId returns the SubjectId field value if set, zero value otherwise. +func (o *RelationQuery) GetSubjectId() string { + if o == nil || o.SubjectId == nil { + var ret string + return ret + } + return *o.SubjectId +} + +// GetSubjectIdOk returns a tuple with the SubjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RelationQuery) GetSubjectIdOk() (*string, bool) { + if o == nil || o.SubjectId == nil { + return nil, false + } + return o.SubjectId, true +} + +// HasSubjectId returns a boolean if a field has been set. +func (o *RelationQuery) HasSubjectId() bool { + if o != nil && o.SubjectId != nil { + return true + } + + return false +} + +// SetSubjectId gets a reference to the given string and assigns it to the SubjectId field. +func (o *RelationQuery) SetSubjectId(v string) { + o.SubjectId = &v +} + +// GetSubjectSet returns the SubjectSet field value if set, zero value otherwise. +func (o *RelationQuery) GetSubjectSet() SubjectSet { + if o == nil || o.SubjectSet == nil { + var ret SubjectSet + return ret + } + return *o.SubjectSet +} + +// GetSubjectSetOk returns a tuple with the SubjectSet field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RelationQuery) GetSubjectSetOk() (*SubjectSet, bool) { + if o == nil || o.SubjectSet == nil { + return nil, false + } + return o.SubjectSet, true +} + +// HasSubjectSet returns a boolean if a field has been set. +func (o *RelationQuery) HasSubjectSet() bool { + if o != nil && o.SubjectSet != nil { + return true + } + + return false +} + +// SetSubjectSet gets a reference to the given SubjectSet and assigns it to the SubjectSet field. +func (o *RelationQuery) SetSubjectSet(v SubjectSet) { + o.SubjectSet = &v +} + +func (o RelationQuery) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Namespace != nil { + toSerialize["namespace"] = o.Namespace + } + if o.Object != nil { + toSerialize["object"] = o.Object + } + if o.Relation != nil { + toSerialize["relation"] = o.Relation + } + if o.SubjectId != nil { + toSerialize["subject_id"] = o.SubjectId + } + if o.SubjectSet != nil { + toSerialize["subject_set"] = o.SubjectSet + } + return json.Marshal(toSerialize) +} + +type NullableRelationQuery struct { + value *RelationQuery + isSet bool +} + +func (v NullableRelationQuery) Get() *RelationQuery { + return v.value +} + +func (v *NullableRelationQuery) Set(val *RelationQuery) { + v.value = val + v.isSet = true +} + +func (v NullableRelationQuery) IsSet() bool { + return v.isSet +} + +func (v *NullableRelationQuery) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRelationQuery(val *RelationQuery) *NullableRelationQuery { + return &NullableRelationQuery{value: val, isSet: true} +} + +func (v NullableRelationQuery) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRelationQuery) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/model_subject_set.go b/internal/httpclient-next/model_subject_set.go new file mode 100644 index 000000000..734d8740a --- /dev/null +++ b/internal/httpclient-next/model_subject_set.go @@ -0,0 +1,168 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// SubjectSet struct for SubjectSet +type SubjectSet struct { + // Namespace of the Subject Set + Namespace string `json:"namespace"` + // Object of the Subject Set + Object string `json:"object"` + // Relation of the Subject Set + Relation string `json:"relation"` +} + +// NewSubjectSet instantiates a new SubjectSet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSubjectSet(namespace string, object string, relation string) *SubjectSet { + this := SubjectSet{} + this.Namespace = namespace + this.Object = object + this.Relation = relation + return &this +} + +// NewSubjectSetWithDefaults instantiates a new SubjectSet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSubjectSetWithDefaults() *SubjectSet { + this := SubjectSet{} + return &this +} + +// GetNamespace returns the Namespace field value +func (o *SubjectSet) GetNamespace() string { + if o == nil { + var ret string + return ret + } + + return o.Namespace +} + +// GetNamespaceOk returns a tuple with the Namespace field value +// and a boolean to check if the value has been set. +func (o *SubjectSet) GetNamespaceOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Namespace, true +} + +// SetNamespace sets field value +func (o *SubjectSet) SetNamespace(v string) { + o.Namespace = v +} + +// GetObject returns the Object field value +func (o *SubjectSet) GetObject() string { + if o == nil { + var ret string + return ret + } + + return o.Object +} + +// GetObjectOk returns a tuple with the Object field value +// and a boolean to check if the value has been set. +func (o *SubjectSet) GetObjectOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Object, true +} + +// SetObject sets field value +func (o *SubjectSet) SetObject(v string) { + o.Object = v +} + +// GetRelation returns the Relation field value +func (o *SubjectSet) GetRelation() string { + if o == nil { + var ret string + return ret + } + + return o.Relation +} + +// GetRelationOk returns a tuple with the Relation field value +// and a boolean to check if the value has been set. +func (o *SubjectSet) GetRelationOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Relation, true +} + +// SetRelation sets field value +func (o *SubjectSet) SetRelation(v string) { + o.Relation = v +} + +func (o SubjectSet) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if true { + toSerialize["namespace"] = o.Namespace + } + if true { + toSerialize["object"] = o.Object + } + if true { + toSerialize["relation"] = o.Relation + } + return json.Marshal(toSerialize) +} + +type NullableSubjectSet struct { + value *SubjectSet + isSet bool +} + +func (v NullableSubjectSet) Get() *SubjectSet { + return v.value +} + +func (v *NullableSubjectSet) Set(val *SubjectSet) { + v.value = val + v.isSet = true +} + +func (v NullableSubjectSet) IsSet() bool { + return v.isSet +} + +func (v *NullableSubjectSet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSubjectSet(val *SubjectSet) *NullableSubjectSet { + return &NullableSubjectSet{value: val, isSet: true} +} + +func (v NullableSubjectSet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSubjectSet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/model_version.go b/internal/httpclient-next/model_version.go new file mode 100644 index 000000000..d26c45cc9 --- /dev/null +++ b/internal/httpclient-next/model_version.go @@ -0,0 +1,115 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" +) + +// Version struct for Version +type Version struct { + // Version is the service's version. + Version *string `json:"version,omitempty"` +} + +// NewVersion instantiates a new Version object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVersion() *Version { + this := Version{} + return &this +} + +// NewVersionWithDefaults instantiates a new Version object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVersionWithDefaults() *Version { + this := Version{} + return &this +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *Version) GetVersion() string { + if o == nil || o.Version == nil { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Version) GetVersionOk() (*string, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *Version) HasVersion() bool { + if o != nil && o.Version != nil { + return true + } + + return false +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *Version) SetVersion(v string) { + o.Version = &v +} + +func (o Version) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Version != nil { + toSerialize["version"] = o.Version + } + return json.Marshal(toSerialize) +} + +type NullableVersion struct { + value *Version + isSet bool +} + +func (v NullableVersion) Get() *Version { + return v.value +} + +func (v *NullableVersion) Set(val *Version) { + v.value = val + v.isSet = true +} + +func (v NullableVersion) IsSet() bool { + return v.isSet +} + +func (v *NullableVersion) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVersion(val *Version) *NullableVersion { + return &NullableVersion{value: val, isSet: true} +} + +func (v NullableVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVersion) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient-next/response.go b/internal/httpclient-next/response.go new file mode 100644 index 000000000..819fae029 --- /dev/null +++ b/internal/httpclient-next/response.go @@ -0,0 +1,48 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResonse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/internal/httpclient-next/utils.go b/internal/httpclient-next/utils.go new file mode 100644 index 000000000..39e2e31cd --- /dev/null +++ b/internal/httpclient-next/utils.go @@ -0,0 +1,329 @@ +/* + * Ory Keto API + * + * Documentation for all of Ory Keto's REST APIs. gRPC is documented separately. + * + * API version: 1.0.0 + * Contact: hi@ory.sh + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package client + +import ( + "encoding/json" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return v.value.MarshalJSON() +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/internal/httpclient/client/read/get_check_mirror_status_parameters.go b/internal/httpclient/client/read/get_check_mirror_status_parameters.go new file mode 100644 index 000000000..76c9f21c0 --- /dev/null +++ b/internal/httpclient/client/read/get_check_mirror_status_parameters.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package read + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetCheckMirrorStatusParams creates a new GetCheckMirrorStatusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetCheckMirrorStatusParams() *GetCheckMirrorStatusParams { + return &GetCheckMirrorStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetCheckMirrorStatusParamsWithTimeout creates a new GetCheckMirrorStatusParams object +// with the ability to set a timeout on a request. +func NewGetCheckMirrorStatusParamsWithTimeout(timeout time.Duration) *GetCheckMirrorStatusParams { + return &GetCheckMirrorStatusParams{ + timeout: timeout, + } +} + +// NewGetCheckMirrorStatusParamsWithContext creates a new GetCheckMirrorStatusParams object +// with the ability to set a context for a request. +func NewGetCheckMirrorStatusParamsWithContext(ctx context.Context) *GetCheckMirrorStatusParams { + return &GetCheckMirrorStatusParams{ + Context: ctx, + } +} + +// NewGetCheckMirrorStatusParamsWithHTTPClient creates a new GetCheckMirrorStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetCheckMirrorStatusParamsWithHTTPClient(client *http.Client) *GetCheckMirrorStatusParams { + return &GetCheckMirrorStatusParams{ + HTTPClient: client, + } +} + +/* GetCheckMirrorStatusParams contains all the parameters to send to the API endpoint + for the get check mirror status operation. + + Typically these are written to a http.Request. +*/ +type GetCheckMirrorStatusParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get check mirror status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCheckMirrorStatusParams) WithDefaults() *GetCheckMirrorStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get check mirror status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetCheckMirrorStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get check mirror status params +func (o *GetCheckMirrorStatusParams) WithTimeout(timeout time.Duration) *GetCheckMirrorStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get check mirror status params +func (o *GetCheckMirrorStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get check mirror status params +func (o *GetCheckMirrorStatusParams) WithContext(ctx context.Context) *GetCheckMirrorStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get check mirror status params +func (o *GetCheckMirrorStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get check mirror status params +func (o *GetCheckMirrorStatusParams) WithHTTPClient(client *http.Client) *GetCheckMirrorStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get check mirror status params +func (o *GetCheckMirrorStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *GetCheckMirrorStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/read/get_check_mirror_status_responses.go b/internal/httpclient/client/read/get_check_mirror_status_responses.go new file mode 100644 index 000000000..4897a669a --- /dev/null +++ b/internal/httpclient/client/read/get_check_mirror_status_responses.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package read + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/keto/internal/httpclient/models" +) + +// GetCheckMirrorStatusReader is a Reader for the GetCheckMirrorStatus structure. +type GetCheckMirrorStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetCheckMirrorStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetCheckMirrorStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewGetCheckMirrorStatusBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetCheckMirrorStatusForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetCheckMirrorStatusInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewGetCheckMirrorStatusOK creates a GetCheckMirrorStatusOK with default headers values +func NewGetCheckMirrorStatusOK() *GetCheckMirrorStatusOK { + return &GetCheckMirrorStatusOK{} +} + +/* GetCheckMirrorStatusOK describes a response with status code 200, with default header values. + +getCheckResponse +*/ +type GetCheckMirrorStatusOK struct { + Payload *models.GetCheckResponse +} + +func (o *GetCheckMirrorStatusOK) Error() string { + return fmt.Sprintf("[GET /relation-tuples/check][%d] getCheckMirrorStatusOK %+v", 200, o.Payload) +} +func (o *GetCheckMirrorStatusOK) GetPayload() *models.GetCheckResponse { + return o.Payload +} + +func (o *GetCheckMirrorStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GetCheckResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCheckMirrorStatusBadRequest creates a GetCheckMirrorStatusBadRequest with default headers values +func NewGetCheckMirrorStatusBadRequest() *GetCheckMirrorStatusBadRequest { + return &GetCheckMirrorStatusBadRequest{} +} + +/* GetCheckMirrorStatusBadRequest describes a response with status code 400, with default header values. + +genericError +*/ +type GetCheckMirrorStatusBadRequest struct { + Payload *models.GenericError +} + +func (o *GetCheckMirrorStatusBadRequest) Error() string { + return fmt.Sprintf("[GET /relation-tuples/check][%d] getCheckMirrorStatusBadRequest %+v", 400, o.Payload) +} +func (o *GetCheckMirrorStatusBadRequest) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *GetCheckMirrorStatusBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCheckMirrorStatusForbidden creates a GetCheckMirrorStatusForbidden with default headers values +func NewGetCheckMirrorStatusForbidden() *GetCheckMirrorStatusForbidden { + return &GetCheckMirrorStatusForbidden{} +} + +/* GetCheckMirrorStatusForbidden describes a response with status code 403, with default header values. + +getCheckResponse +*/ +type GetCheckMirrorStatusForbidden struct { + Payload *models.GetCheckResponse +} + +func (o *GetCheckMirrorStatusForbidden) Error() string { + return fmt.Sprintf("[GET /relation-tuples/check][%d] getCheckMirrorStatusForbidden %+v", 403, o.Payload) +} +func (o *GetCheckMirrorStatusForbidden) GetPayload() *models.GetCheckResponse { + return o.Payload +} + +func (o *GetCheckMirrorStatusForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GetCheckResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetCheckMirrorStatusInternalServerError creates a GetCheckMirrorStatusInternalServerError with default headers values +func NewGetCheckMirrorStatusInternalServerError() *GetCheckMirrorStatusInternalServerError { + return &GetCheckMirrorStatusInternalServerError{} +} + +/* GetCheckMirrorStatusInternalServerError describes a response with status code 500, with default header values. + +genericError +*/ +type GetCheckMirrorStatusInternalServerError struct { + Payload *models.GenericError +} + +func (o *GetCheckMirrorStatusInternalServerError) Error() string { + return fmt.Sprintf("[GET /relation-tuples/check][%d] getCheckMirrorStatusInternalServerError %+v", 500, o.Payload) +} +func (o *GetCheckMirrorStatusInternalServerError) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *GetCheckMirrorStatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/read/get_check_responses.go b/internal/httpclient/client/read/get_check_responses.go index bfaa42ec1..7e779abfc 100644 --- a/internal/httpclient/client/read/get_check_responses.go +++ b/internal/httpclient/client/read/get_check_responses.go @@ -35,12 +35,6 @@ func (o *GetCheckReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result - case 403: - result := NewGetCheckForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result case 500: result := NewGetCheckInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,38 +110,6 @@ func (o *GetCheckBadRequest) readResponse(response runtime.ClientResponse, consu return nil } -// NewGetCheckForbidden creates a GetCheckForbidden with default headers values -func NewGetCheckForbidden() *GetCheckForbidden { - return &GetCheckForbidden{} -} - -/* GetCheckForbidden describes a response with status code 403, with default header values. - -getCheckResponse -*/ -type GetCheckForbidden struct { - Payload *models.GetCheckResponse -} - -func (o *GetCheckForbidden) Error() string { - return fmt.Sprintf("[GET /relation-tuples/check/openapi][%d] getCheckForbidden %+v", 403, o.Payload) -} -func (o *GetCheckForbidden) GetPayload() *models.GetCheckResponse { - return o.Payload -} - -func (o *GetCheckForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GetCheckResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - // NewGetCheckInternalServerError creates a GetCheckInternalServerError with default headers values func NewGetCheckInternalServerError() *GetCheckInternalServerError { return &GetCheckInternalServerError{} diff --git a/internal/httpclient/client/read/post_check_mirror_status_parameters.go b/internal/httpclient/client/read/post_check_mirror_status_parameters.go new file mode 100644 index 000000000..bd505abf8 --- /dev/null +++ b/internal/httpclient/client/read/post_check_mirror_status_parameters.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package read + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewPostCheckMirrorStatusParams creates a new PostCheckMirrorStatusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewPostCheckMirrorStatusParams() *PostCheckMirrorStatusParams { + return &PostCheckMirrorStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewPostCheckMirrorStatusParamsWithTimeout creates a new PostCheckMirrorStatusParams object +// with the ability to set a timeout on a request. +func NewPostCheckMirrorStatusParamsWithTimeout(timeout time.Duration) *PostCheckMirrorStatusParams { + return &PostCheckMirrorStatusParams{ + timeout: timeout, + } +} + +// NewPostCheckMirrorStatusParamsWithContext creates a new PostCheckMirrorStatusParams object +// with the ability to set a context for a request. +func NewPostCheckMirrorStatusParamsWithContext(ctx context.Context) *PostCheckMirrorStatusParams { + return &PostCheckMirrorStatusParams{ + Context: ctx, + } +} + +// NewPostCheckMirrorStatusParamsWithHTTPClient creates a new PostCheckMirrorStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewPostCheckMirrorStatusParamsWithHTTPClient(client *http.Client) *PostCheckMirrorStatusParams { + return &PostCheckMirrorStatusParams{ + HTTPClient: client, + } +} + +/* PostCheckMirrorStatusParams contains all the parameters to send to the API endpoint + for the post check mirror status operation. + + Typically these are written to a http.Request. +*/ +type PostCheckMirrorStatusParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the post check mirror status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostCheckMirrorStatusParams) WithDefaults() *PostCheckMirrorStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the post check mirror status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *PostCheckMirrorStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the post check mirror status params +func (o *PostCheckMirrorStatusParams) WithTimeout(timeout time.Duration) *PostCheckMirrorStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the post check mirror status params +func (o *PostCheckMirrorStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the post check mirror status params +func (o *PostCheckMirrorStatusParams) WithContext(ctx context.Context) *PostCheckMirrorStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the post check mirror status params +func (o *PostCheckMirrorStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the post check mirror status params +func (o *PostCheckMirrorStatusParams) WithHTTPClient(client *http.Client) *PostCheckMirrorStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the post check mirror status params +func (o *PostCheckMirrorStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *PostCheckMirrorStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/internal/httpclient/client/read/post_check_mirror_status_responses.go b/internal/httpclient/client/read/post_check_mirror_status_responses.go new file mode 100644 index 000000000..894bcdd00 --- /dev/null +++ b/internal/httpclient/client/read/post_check_mirror_status_responses.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package read + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + + "github.com/ory/keto/internal/httpclient/models" +) + +// PostCheckMirrorStatusReader is a Reader for the PostCheckMirrorStatus structure. +type PostCheckMirrorStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *PostCheckMirrorStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewPostCheckMirrorStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewPostCheckMirrorStatusBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewPostCheckMirrorStatusForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewPostCheckMirrorStatusInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) + } +} + +// NewPostCheckMirrorStatusOK creates a PostCheckMirrorStatusOK with default headers values +func NewPostCheckMirrorStatusOK() *PostCheckMirrorStatusOK { + return &PostCheckMirrorStatusOK{} +} + +/* PostCheckMirrorStatusOK describes a response with status code 200, with default header values. + +getCheckResponse +*/ +type PostCheckMirrorStatusOK struct { + Payload *models.GetCheckResponse +} + +func (o *PostCheckMirrorStatusOK) Error() string { + return fmt.Sprintf("[POST /relation-tuples/check][%d] postCheckMirrorStatusOK %+v", 200, o.Payload) +} +func (o *PostCheckMirrorStatusOK) GetPayload() *models.GetCheckResponse { + return o.Payload +} + +func (o *PostCheckMirrorStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GetCheckResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCheckMirrorStatusBadRequest creates a PostCheckMirrorStatusBadRequest with default headers values +func NewPostCheckMirrorStatusBadRequest() *PostCheckMirrorStatusBadRequest { + return &PostCheckMirrorStatusBadRequest{} +} + +/* PostCheckMirrorStatusBadRequest describes a response with status code 400, with default header values. + +genericError +*/ +type PostCheckMirrorStatusBadRequest struct { + Payload *models.GenericError +} + +func (o *PostCheckMirrorStatusBadRequest) Error() string { + return fmt.Sprintf("[POST /relation-tuples/check][%d] postCheckMirrorStatusBadRequest %+v", 400, o.Payload) +} +func (o *PostCheckMirrorStatusBadRequest) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *PostCheckMirrorStatusBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCheckMirrorStatusForbidden creates a PostCheckMirrorStatusForbidden with default headers values +func NewPostCheckMirrorStatusForbidden() *PostCheckMirrorStatusForbidden { + return &PostCheckMirrorStatusForbidden{} +} + +/* PostCheckMirrorStatusForbidden describes a response with status code 403, with default header values. + +getCheckResponse +*/ +type PostCheckMirrorStatusForbidden struct { + Payload *models.GetCheckResponse +} + +func (o *PostCheckMirrorStatusForbidden) Error() string { + return fmt.Sprintf("[POST /relation-tuples/check][%d] postCheckMirrorStatusForbidden %+v", 403, o.Payload) +} +func (o *PostCheckMirrorStatusForbidden) GetPayload() *models.GetCheckResponse { + return o.Payload +} + +func (o *PostCheckMirrorStatusForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GetCheckResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewPostCheckMirrorStatusInternalServerError creates a PostCheckMirrorStatusInternalServerError with default headers values +func NewPostCheckMirrorStatusInternalServerError() *PostCheckMirrorStatusInternalServerError { + return &PostCheckMirrorStatusInternalServerError{} +} + +/* PostCheckMirrorStatusInternalServerError describes a response with status code 500, with default header values. + +genericError +*/ +type PostCheckMirrorStatusInternalServerError struct { + Payload *models.GenericError +} + +func (o *PostCheckMirrorStatusInternalServerError) Error() string { + return fmt.Sprintf("[POST /relation-tuples/check][%d] postCheckMirrorStatusInternalServerError %+v", 500, o.Payload) +} +func (o *PostCheckMirrorStatusInternalServerError) GetPayload() *models.GenericError { + return o.Payload +} + +func (o *PostCheckMirrorStatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.GenericError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/internal/httpclient/client/read/post_check_responses.go b/internal/httpclient/client/read/post_check_responses.go index 851f4b9c6..20c5c45a2 100644 --- a/internal/httpclient/client/read/post_check_responses.go +++ b/internal/httpclient/client/read/post_check_responses.go @@ -35,12 +35,6 @@ func (o *PostCheckReader) ReadResponse(response runtime.ClientResponse, consumer return nil, err } return nil, result - case 403: - result := NewPostCheckForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result case 500: result := NewPostCheckInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { @@ -116,38 +110,6 @@ func (o *PostCheckBadRequest) readResponse(response runtime.ClientResponse, cons return nil } -// NewPostCheckForbidden creates a PostCheckForbidden with default headers values -func NewPostCheckForbidden() *PostCheckForbidden { - return &PostCheckForbidden{} -} - -/* PostCheckForbidden describes a response with status code 403, with default header values. - -getCheckResponse -*/ -type PostCheckForbidden struct { - Payload *models.GetCheckResponse -} - -func (o *PostCheckForbidden) Error() string { - return fmt.Sprintf("[POST /relation-tuples/check/openapi][%d] postCheckForbidden %+v", 403, o.Payload) -} -func (o *PostCheckForbidden) GetPayload() *models.GetCheckResponse { - return o.Payload -} - -func (o *PostCheckForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.GetCheckResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - // NewPostCheckInternalServerError creates a PostCheckInternalServerError with default headers values func NewPostCheckInternalServerError() *PostCheckInternalServerError { return &PostCheckInternalServerError{} diff --git a/internal/httpclient/client/read/read_client.go b/internal/httpclient/client/read/read_client.go index 87bcf7802..9f6034085 100644 --- a/internal/httpclient/client/read/read_client.go +++ b/internal/httpclient/client/read/read_client.go @@ -32,12 +32,16 @@ type ClientOption func(*runtime.ClientOperation) type ClientService interface { GetCheck(params *GetCheckParams, opts ...ClientOption) (*GetCheckOK, error) + GetCheckMirrorStatus(params *GetCheckMirrorStatusParams, opts ...ClientOption) (*GetCheckMirrorStatusOK, error) + GetExpand(params *GetExpandParams, opts ...ClientOption) (*GetExpandOK, error) GetRelationTuples(params *GetRelationTuplesParams, opts ...ClientOption) (*GetRelationTuplesOK, error) PostCheck(params *PostCheckParams, opts ...ClientOption) (*PostCheckOK, error) + PostCheckMirrorStatus(params *PostCheckMirrorStatusParams, opts ...ClientOption) (*PostCheckMirrorStatusOK, error) + SetTransport(transport runtime.ClientTransport) } @@ -81,6 +85,46 @@ func (a *Client) GetCheck(params *GetCheckParams, opts ...ClientOption) (*GetChe panic(msg) } +/* + GetCheckMirrorStatus checks a relation tuple + + To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). +*/ +func (a *Client) GetCheckMirrorStatus(params *GetCheckMirrorStatusParams, opts ...ClientOption) (*GetCheckMirrorStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetCheckMirrorStatusParams() + } + op := &runtime.ClientOperation{ + ID: "getCheckMirrorStatus", + Method: "GET", + PathPattern: "/relation-tuples/check", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/x-www-form-urlencoded"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &GetCheckMirrorStatusReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetCheckMirrorStatusOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getCheckMirrorStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + /* GetExpand expands a relation tuple @@ -201,6 +245,46 @@ func (a *Client) PostCheck(params *PostCheckParams, opts ...ClientOption) (*Post panic(msg) } +/* + PostCheckMirrorStatus checks a relation tuple + + To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx). +*/ +func (a *Client) PostCheckMirrorStatus(params *PostCheckMirrorStatusParams, opts ...ClientOption) (*PostCheckMirrorStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewPostCheckMirrorStatusParams() + } + op := &runtime.ClientOperation{ + ID: "postCheckMirrorStatus", + Method: "POST", + PathPattern: "/relation-tuples/check", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &PostCheckMirrorStatusReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*PostCheckMirrorStatusOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for postCheckMirrorStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/spec/api.json b/spec/api.json index 96a8e0787..f4c1f3b1f 100755 --- a/spec/api.json +++ b/spec/api.json @@ -605,6 +605,104 @@ "tags": ["read"] } }, + "/relation-tuples/check": { + "get": { + "description": "To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).", + "operationId": "getCheckMirrorStatus", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/getCheckResponse" + } + } + }, + "description": "getCheckResponse" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/genericError" + } + } + }, + "description": "genericError" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/getCheckResponse" + } + } + }, + "description": "getCheckResponse" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/genericError" + } + } + }, + "description": "genericError" + } + }, + "summary": "Check a relation tuple", + "tags": ["read"] + }, + "post": { + "description": "To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).", + "operationId": "postCheckMirrorStatus", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/getCheckResponse" + } + } + }, + "description": "getCheckResponse" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/genericError" + } + } + }, + "description": "genericError" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/getCheckResponse" + } + } + }, + "description": "getCheckResponse" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/genericError" + } + } + }, + "description": "genericError" + } + }, + "summary": "Check a relation tuple", + "tags": ["read"] + } + }, "/relation-tuples/check/openapi": { "get": { "description": "To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).", @@ -696,16 +794,6 @@ }, "description": "genericError" }, - "403": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/getCheckResponse" - } - } - }, - "description": "getCheckResponse" - }, "500": { "content": { "application/json": { @@ -764,16 +852,6 @@ }, "description": "genericError" }, - "403": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/getCheckResponse" - } - } - }, - "description": "getCheckResponse" - }, "500": { "content": { "application/json": { diff --git a/spec/swagger.json b/spec/swagger.json index f484d1f8f..a9a0eab96 100755 --- a/spec/swagger.json +++ b/spec/swagger.json @@ -305,6 +305,78 @@ } } }, + "/relation-tuples/check": { + "get": { + "description": "To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).", + "consumes": ["application/x-www-form-urlencoded"], + "produces": ["application/json"], + "schemes": ["http", "https"], + "tags": ["read"], + "summary": "Check a relation tuple", + "operationId": "getCheckMirrorStatus", + "responses": { + "200": { + "description": "getCheckResponse", + "schema": { + "$ref": "#/definitions/getCheckResponse" + } + }, + "400": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + }, + "403": { + "description": "getCheckResponse", + "schema": { + "$ref": "#/definitions/getCheckResponse" + } + }, + "500": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + } + } + }, + "post": { + "description": "To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).", + "consumes": ["application/json"], + "produces": ["application/json"], + "schemes": ["http", "https"], + "tags": ["read"], + "summary": "Check a relation tuple", + "operationId": "postCheckMirrorStatus", + "responses": { + "200": { + "description": "getCheckResponse", + "schema": { + "$ref": "#/definitions/getCheckResponse" + } + }, + "400": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + }, + "403": { + "description": "getCheckResponse", + "schema": { + "$ref": "#/definitions/getCheckResponse" + } + }, + "500": { + "description": "genericError", + "schema": { + "$ref": "#/definitions/genericError" + } + } + } + } + }, "/relation-tuples/check/openapi": { "get": { "description": "To learn how relation tuples and the check works, head over to [the documentation](../concepts/relation-tuples.mdx).", @@ -377,12 +449,6 @@ "$ref": "#/definitions/genericError" } }, - "403": { - "description": "getCheckResponse", - "schema": { - "$ref": "#/definitions/getCheckResponse" - } - }, "500": { "description": "genericError", "schema": { @@ -427,12 +493,6 @@ "$ref": "#/definitions/genericError" } }, - "403": { - "description": "getCheckResponse", - "schema": { - "$ref": "#/definitions/getCheckResponse" - } - }, "500": { "description": "genericError", "schema": {