From d5a8a1c421e75a483e62c8c24e941505201235ed Mon Sep 17 00:00:00 2001 From: Ragot Geoffrey Date: Fri, 18 Nov 2022 17:13:26 +0100 Subject: [PATCH 1/5] feat(telemetry): add telemetry on http/sql calls --- Dockerfile | 1 + cmd/root.go | 4 ++-- cmd/serve.go | 23 ++++++++++++++++++-- config.yaml | 1 + docker-compose.yml | 1 + go.mod | 19 ++++++++++------ go.sum | 35 +++++++++++++++++++----------- pkg/api/clients.go | 2 +- pkg/api/health.go | 2 +- pkg/api/module.go | 17 +++++++-------- pkg/api/util.go | 4 ++-- pkg/api/util_test.go | 2 +- pkg/delegatedauth/module.go | 7 ++++-- pkg/oidc/authorize_callback.go | 5 ++--- pkg/oidc/keyset.go | 6 ++--- pkg/oidc/module.go | 5 +++-- pkg/oidc/router.go | 19 +++++++++++++++- pkg/storage/sqlstorage/database.go | 10 +++++++-- pkg/storage/sqlstorage/module.go | 2 +- pkg/storage/sqlstorage/storage.go | 2 +- 20 files changed, 114 insertions(+), 53 deletions(-) diff --git a/Dockerfile b/Dockerfile index 32a0d8d..2671a6d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,5 +30,6 @@ FROM ubuntu:jammy RUN apt update && apt install -y ca-certificates curl && rm -rf /var/lib/apt/lists/* COPY --from=builder /src/main /main EXPOSE 3068 +ENV OTEL_SERVICE_NAME auth ENTRYPOINT ["/main"] CMD ["--help"] diff --git a/cmd/root.go b/cmd/root.go index 955c2ac..ab7298f 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - "github.com/numary/go-libs/sharedlogging" - "github.com/numary/go-libs/sharedlogging/sharedlogginglogrus" + "github.com/formancehq/go-libs/sharedlogging" + "github.com/formancehq/go-libs/sharedlogging/sharedlogginglogrus" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/spf13/viper" diff --git a/cmd/serve.go b/cmd/serve.go index fbd69d7..6ba4906 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -5,6 +5,7 @@ import ( "crypto/x509" "encoding/pem" "fmt" + "net/http" auth "github.com/formancehq/auth/pkg" "github.com/formancehq/auth/pkg/api" @@ -12,11 +13,12 @@ import ( "github.com/formancehq/auth/pkg/delegatedauth" "github.com/formancehq/auth/pkg/oidc" "github.com/formancehq/auth/pkg/storage/sqlstorage" - "github.com/numary/go-libs/sharedlogging" - "github.com/numary/go-libs/sharedotlp/pkg/sharedotlptraces" + "github.com/formancehq/go-libs/sharedlogging" + "github.com/formancehq/go-libs/sharedotlp/pkg/sharedotlptraces" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/viper" + "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" "go.uber.org/fx" ) @@ -61,6 +63,22 @@ EL/wy5C80pa3jahniqVgO5L6zz0ZLtRIRE7aCtCIu826gctJ1+ShIso= ` ) +func otlpHttpClientModule() fx.Option { + return fx.Provide(func() *http.Client { + otelhttp.WithSpanOptions() + return &http.Client{ + Transport: otelhttp.NewTransport(http.DefaultTransport, otelhttp.WithSpanNameFormatter(func(operation string, r *http.Request) string { + str := fmt.Sprintf("%s %s", r.Method, r.URL.Path) + if len(r.URL.Query()) == 0 { + return str + } + + return fmt.Sprintf("%s?%s", str, r.URL.Query().Encode()) + })), + } + }) +} + var serveCmd = &cobra.Command{ Use: "serve", PreRunE: func(cmd *cobra.Command, args []string) error { @@ -117,6 +135,7 @@ var serveCmd = &cobra.Command{ } options := []fx.Option{ + otlpHttpClientModule(), fx.Supply(fx.Annotate(cmd.Context(), fx.As(new(context.Context)))), fx.Supply(delegatedauth.Config{ Issuer: delegatedIssuer, diff --git a/config.yaml b/config.yaml index 1563089..3380d09 100644 --- a/config.yaml +++ b/config.yaml @@ -3,6 +3,7 @@ clients: public: true redirectUris: - http://localhost:3000/auth-callback + - https://oauth.pstmn.io/v1/callback name: demo postLogoutRedirectUris: - http://localhost:3000/ diff --git a/docker-compose.yml b/docker-compose.yml index 2a8aa82..6ed70f7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -64,6 +64,7 @@ services: DELEGATED_CLIENT_SECRET: ZXhhbXBsZS1hcHAtc2VjcmV0 DELEGATED_ISSUER: http://localhost:5556 BASE_URL: http://localhost:8080 + OTEL_SERVICE_NAME: auth depends_on: - postgres - jaeger diff --git a/go.mod b/go.mod index 543ddca..93bf45c 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,12 @@ module github.com/formancehq/auth go 1.18 require ( - github.com/davecgh/go-spew v1.1.1 + github.com/formancehq/go-libs v1.1.0 + github.com/formancehq/go-libs/sharedhealth v0.0.0-20221118095941-c137790c3362 + github.com/formancehq/go-libs/sharedotlp v0.0.0-20221118095941-c137790c3362 github.com/golang-jwt/jwt v3.2.2+incompatible github.com/google/uuid v1.3.0 github.com/gorilla/mux v1.8.0 - github.com/numary/go-libs v1.0.1 - github.com/numary/go-libs/sharedhealth v0.0.0-20220905094731-f6d6d1cf83f3 - github.com/numary/go-libs/sharedotlp v0.0.0-20220905094731-f6d6d1cf83f3 github.com/oauth2-proxy/mockoidc v0.0.0-20220308204021-b9169deeb282 github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.9.0 @@ -18,17 +17,22 @@ require ( github.com/stretchr/testify v1.8.0 github.com/zitadel/oidc v1.8.0 go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.35.0 - go.opentelemetry.io/otel/trace v1.10.0 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 + go.opentelemetry.io/otel v1.11.1 + go.opentelemetry.io/otel/trace v1.11.1 go.uber.org/fx v1.18.1 + golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 golang.org/x/text v0.3.7 gopkg.in/square/go-jose.v2 v2.6.0 gorm.io/driver/postgres v1.3.10 gorm.io/driver/sqlite v1.3.6 gorm.io/gorm v1.23.9 + gorm.io/plugin/opentelemetry v0.1.0 ) require ( github.com/cenkalti/backoff/v4 v4.1.3 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.3 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect github.com/go-logr/logr v1.2.3 // indirect @@ -63,13 +67,14 @@ require ( github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.4.1 // indirect github.com/zitadel/logging v0.3.4 // indirect - go.opentelemetry.io/otel v1.10.0 // indirect + go.opentelemetry.io/contrib/propagators/b3 v1.11.1 // indirect go.opentelemetry.io/otel/exporters/jaeger v1.10.0 // indirect go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.10.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.10.0 // indirect + go.opentelemetry.io/otel/metric v0.33.0 // indirect go.opentelemetry.io/otel/sdk v1.10.0 // indirect go.opentelemetry.io/proto/otlp v0.19.0 // indirect go.uber.org/atomic v1.10.0 // indirect @@ -78,12 +83,12 @@ require ( go.uber.org/zap v1.23.0 // indirect golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect - golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa // indirect google.golang.org/grpc v1.49.0 // indirect google.golang.org/protobuf v1.28.1 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 94494f0..da3f869 100644 --- a/go.sum +++ b/go.sum @@ -80,6 +80,12 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/formancehq/go-libs v1.1.0 h1:sIb07+OyJvOKO2F6anEQ/CRczPXh0KS8+bcFhWYUwUw= +github.com/formancehq/go-libs v1.1.0/go.mod h1:9pIcaXQR4O1biXDfhFurYJZw1piU6sJk+0Vqvu+92ng= +github.com/formancehq/go-libs/sharedhealth v0.0.0-20221118095941-c137790c3362 h1:VQc17mL5YYKZktXtsPt9LDLLpAQ0/X0Uio7tXHdtob0= +github.com/formancehq/go-libs/sharedhealth v0.0.0-20221118095941-c137790c3362/go.mod h1:4TBSSGGBeY6xCaqI4gw74ouwgirdZjvKlv001kQ8xp0= +github.com/formancehq/go-libs/sharedotlp v0.0.0-20221118095941-c137790c3362 h1:gGuvT1f/Ef4p5i/pYbIo9UTaADFGIWIHPooJICnq018= +github.com/formancehq/go-libs/sharedotlp v0.0.0-20221118095941-c137790c3362/go.mod h1:2yT660i6Ay5d5EtMpJgUl6J+wMS1mUBO1SIoCJO2Shc= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= @@ -144,7 +150,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-github/v31 v31.0.0/go.mod h1:NQPZol8/1sMoWYGN2yaALIBytu17gAWfhbweiEed3pM= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -247,6 +253,7 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= @@ -269,14 +276,7 @@ github.com/mattn/go-sqlite3 v1.14.12 h1:TJ1bhYJPV44phC+IMu1u2K/i5RriLTPe+yc68XDJ github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/numary/go-libs v1.0.1 h1:Q41dz+u+inimZMVgSneCzbtoLiPMTjr1gT3D2UeC7IA= -github.com/numary/go-libs v1.0.1/go.mod h1:u9XNKBrHJSCwu13s85GkEg4TWfRm2CF3fknav4TTLn4= -github.com/numary/go-libs/sharedhealth v0.0.0-20220905094731-f6d6d1cf83f3 h1:ufyCkiNTq5rOeM1ximL4plP9OwCpuXGprSoaXsoGAn0= -github.com/numary/go-libs/sharedhealth v0.0.0-20220905094731-f6d6d1cf83f3/go.mod h1:DzBUp4HCdWscgXmt8/5F/KlCSktv0OwgOwDfRdz5Hzo= -github.com/numary/go-libs/sharedotlp v0.0.0-20220905094731-f6d6d1cf83f3 h1:J87uGw67KBoGGX7uzpCksEXYqX5bTy/atdHa15kRI6E= -github.com/numary/go-libs/sharedotlp v0.0.0-20220905094731-f6d6d1cf83f3/go.mod h1:4QEZTmjeQbNMjWd/pKADguTjxTvAuWgh+ZBWzJ7xDiI= github.com/oauth2-proxy/mockoidc v0.0.0-20220308204021-b9169deeb282 h1:TQMyrpijtkFyXpNI3rY5hsZQZw+paiH+BfAlsb81HBY= github.com/oauth2-proxy/mockoidc v0.0.0-20220308204021-b9169deeb282/go.mod h1:rW25Kyd08Wdn3UVn0YBsDTSvReu0jqpmJKzxITPSjks= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= @@ -352,8 +352,12 @@ 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.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.35.0 h1:iwuqpKwor0rXX9kR8Nw64YVBfZ9HhHcDZPUqv5KWWao= go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.35.0/go.mod h1:snA/2VK6VMPcJTjCwqVxnnYam1zZ/aZeRjUyJIyj6ek= -go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4= -go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 h1:aUEBEdCa6iamGzg6fuYxDA8ThxvOG240mAvWDU+XLio= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4/go.mod h1:l2MdsbKTocpPS5nQZscqTR9jd8u96VYZdcpF8Sye7mA= +go.opentelemetry.io/contrib/propagators/b3 v1.11.1 h1:icQ6ttRV+r/2fnU46BIo/g/mPu6Rs5Ug8Rtohe3KqzI= +go.opentelemetry.io/contrib/propagators/b3 v1.11.1/go.mod h1:ECIveyMXgnl4gorxFcA7RYjJY/Ql9n20ubhbfDc3QfA= +go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4= +go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= go.opentelemetry.io/otel/exporters/jaeger v1.10.0 h1:7W3aVVjEYayu/GOqOVF4mbTvnCuxF1wWu3eRxFGQXvw= go.opentelemetry.io/otel/exporters/jaeger v1.10.0/go.mod h1:n9IGyx0fgyXXZ/i0foLHNxtET9CzXHzZeKCucvRBFgA= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y= @@ -366,10 +370,12 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.10.0 h1:S8Ded go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.10.0/go.mod h1:5WV40MLWwvWlGP7Xm8g3pMcg0pKOUY609qxJn8y7LmM= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.10.0 h1:c9UtMu/qnbLlVwTwt+ABrURrioEruapIslTDYZHJe2w= go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.10.0/go.mod h1:h3Lrh9t3Dnqp3NPwAZx7i37UFX7xrfnO1D+fuClREOA= +go.opentelemetry.io/otel/metric v0.33.0 h1:xQAyl7uGEYvrLAiV/09iTJlp1pZnQ9Wl793qbVvED1E= +go.opentelemetry.io/otel/metric v0.33.0/go.mod h1:QlTYc+EnYNq/M2mNk1qDDMRLpqCOj2f/r5c7Fd5FYaI= go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY= go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE= -go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E= -go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM= +go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ= +go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= @@ -736,8 +742,9 @@ google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175 google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/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/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= @@ -761,6 +768,8 @@ gorm.io/gorm v1.23.4/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.7/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk= gorm.io/gorm v1.23.9 h1:NSHG021i+MCznokeXR3udGaNyFyBQJW8MbjrJMVCfGw= gorm.io/gorm v1.23.9/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= +gorm.io/plugin/opentelemetry v0.1.0 h1:92rFfYzQ1uw56xQBLroz5LptKznjzhNnaBMQesRiiWM= +gorm.io/plugin/opentelemetry v0.1.0/go.mod h1:GtjuDxlX1O/vcLs/8J8q9QEIY/jfT2iEmqgyBGVDZRc= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/pkg/api/clients.go b/pkg/api/clients.go index 0adbf09..870b3bc 100644 --- a/pkg/api/clients.go +++ b/pkg/api/clients.go @@ -4,8 +4,8 @@ import ( "net/http" auth "github.com/formancehq/auth/pkg" + _ "github.com/formancehq/go-libs/sharedapi" "github.com/gorilla/mux" - _ "github.com/numary/go-libs/sharedapi" "gorm.io/gorm" ) diff --git a/pkg/api/health.go b/pkg/api/health.go index a0fa389..42947a3 100644 --- a/pkg/api/health.go +++ b/pkg/api/health.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - sharedhealth "github.com/numary/go-libs/sharedhealth/pkg" + sharedhealth "github.com/formancehq/go-libs/sharedhealth/pkg" "github.com/zitadel/oidc/pkg/client" "github.com/zitadel/oidc/pkg/client/rp" ) diff --git a/pkg/api/module.go b/pkg/api/module.go index 295c34b..0e69f7c 100644 --- a/pkg/api/module.go +++ b/pkg/api/module.go @@ -4,13 +4,13 @@ import ( "context" "net/http" + sharedhealth "github.com/formancehq/go-libs/sharedhealth/pkg" "github.com/gorilla/mux" - sharedhealth "github.com/numary/go-libs/sharedhealth/pkg" "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux" "go.uber.org/fx" ) -func CreateRootRouter(healthController *sharedhealth.HealthController) *mux.Router { +func CreateRootRouter() *mux.Router { rootRouter := mux.NewRouter() rootRouter.Use(otelmux.Middleware("auth")) rootRouter.Use(func(handler http.Handler) http.Handler { @@ -19,8 +19,6 @@ func CreateRootRouter(healthController *sharedhealth.HealthController) *mux.Rout handler.ServeHTTP(w, r) }) }) - rootRouter.Path("/_healthcheck").HandlerFunc(healthController.Check) - return rootRouter } @@ -28,13 +26,14 @@ func Module(addr string) fx.Option { return fx.Options( sharedhealth.ProvideHealthCheck(delegatedOIDCServerAvailability), sharedhealth.Module(), - fx.Provide(func(healthController *sharedhealth.HealthController) *mux.Router { - return CreateRootRouter(healthController) - }), - fx.Invoke(func(lc fx.Lifecycle, router *mux.Router, healthController *sharedhealth.HealthController) { + fx.Provide(CreateRootRouter), + fx.Invoke(func(lc fx.Lifecycle, r *mux.Router, healthController *sharedhealth.HealthController) { + finalRouter := mux.NewRouter() + finalRouter.Path("/_healthcheck").HandlerFunc(healthController.Check) + finalRouter.PathPrefix("/").Handler(r) lc.Append(fx.Hook{ OnStart: func(ctx context.Context) error { - return StartServer(ctx, addr, router) + return StartServer(ctx, addr, finalRouter) }, }) }), diff --git a/pkg/api/util.go b/pkg/api/util.go index 6a62926..47e1931 100644 --- a/pkg/api/util.go +++ b/pkg/api/util.go @@ -4,9 +4,9 @@ import ( "encoding/json" "net/http" + "github.com/formancehq/go-libs/sharedapi" + "github.com/formancehq/go-libs/sharedlogging" "github.com/gorilla/mux" - "github.com/numary/go-libs/sharedapi" - "github.com/numary/go-libs/sharedlogging" "go.opentelemetry.io/otel/trace" "gorm.io/gorm" ) diff --git a/pkg/api/util_test.go b/pkg/api/util_test.go index af2fa97..9554e8b 100644 --- a/pkg/api/util_test.go +++ b/pkg/api/util_test.go @@ -7,7 +7,7 @@ import ( "net/http/httptest" "testing" - "github.com/numary/go-libs/sharedapi" + "github.com/formancehq/go-libs/sharedapi" "github.com/stretchr/testify/require" ) diff --git a/pkg/delegatedauth/module.go b/pkg/delegatedauth/module.go index ca56997..e2b72d6 100644 --- a/pkg/delegatedauth/module.go +++ b/pkg/delegatedauth/module.go @@ -1,14 +1,17 @@ package delegatedauth import ( + "net/http" + "github.com/zitadel/oidc/pkg/client/rp" "go.uber.org/fx" ) func Module() fx.Option { return fx.Options( - fx.Provide(func(cfg Config) (rp.RelyingParty, error) { - return rp.NewRelyingPartyOIDC(cfg.Issuer, cfg.ClientID, cfg.ClientSecret, cfg.RedirectURL, []string{"openid email"}) + fx.Provide(func(cfg Config, httpClient *http.Client) (rp.RelyingParty, error) { + return rp.NewRelyingPartyOIDC(cfg.Issuer, cfg.ClientID, cfg.ClientSecret, cfg.RedirectURL, []string{"openid email"}, + rp.WithHTTPClient(httpClient)) }), ) } diff --git a/pkg/oidc/authorize_callback.go b/pkg/oidc/authorize_callback.go index e4b3991..df1381d 100644 --- a/pkg/oidc/authorize_callback.go +++ b/pkg/oidc/authorize_callback.go @@ -1,7 +1,6 @@ package oidc import ( - "context" "embed" "html/template" "net/http" @@ -42,12 +41,12 @@ func authorizeCallbackHandler( panic(err) } - authRequest, err := storage.FindAuthRequest(context.Background(), state.AuthRequestID) + authRequest, err := storage.FindAuthRequest(r.Context(), state.AuthRequestID) if err != nil { panic(err) } - tokens, err := rp.CodeExchange(context.Background(), r.URL.Query().Get("code"), relyingParty) + tokens, err := rp.CodeExchange(r.Context(), r.URL.Query().Get("code"), relyingParty) if err != nil { panic(err) } diff --git a/pkg/oidc/keyset.go b/pkg/oidc/keyset.go index ec0e0f1..43d0eb7 100644 --- a/pkg/oidc/keyset.go +++ b/pkg/oidc/keyset.go @@ -10,9 +10,9 @@ import ( "gopkg.in/square/go-jose.v2" ) -func ReadKeySet(ctx context.Context, configuration delegatedauth.Config) (*jose.JSONWebKeySet, error) { +func ReadKeySet(httpClient *http.Client, ctx context.Context, configuration delegatedauth.Config) (*jose.JSONWebKeySet, error) { // TODO: Inefficient, should keep public keys locally and use them instead of calling the network - discoveryConfiguration, err := client.Discover(configuration.Issuer, http.DefaultClient) + discoveryConfiguration, err := client.Discover(configuration.Issuer, httpClient) if err != nil { return nil, err } @@ -22,7 +22,7 @@ func ReadKeySet(ctx context.Context, configuration delegatedauth.Config) (*jose. return nil, err } - rsp, err := http.DefaultClient.Do(req) + rsp, err := httpClient.Do(req) if err != nil { return nil, err } diff --git a/pkg/oidc/module.go b/pkg/oidc/module.go index 1278783..86b551b 100644 --- a/pkg/oidc/module.go +++ b/pkg/oidc/module.go @@ -3,6 +3,7 @@ package oidc import ( "context" "crypto/rsa" + "net/http" auth "github.com/formancehq/auth/pkg" "github.com/formancehq/auth/pkg/delegatedauth" @@ -20,8 +21,8 @@ func Module(privateKey *rsa.PrivateKey, issuer string, staticClients ...auth.Sta fx.Provide(fx.Annotate(func(storage Storage, relyingParty rp.RelyingParty) *storageFacade { return NewStorageFacade(storage, relyingParty, privateKey, staticClients...) }, fx.As(new(op.Storage)))), - fx.Provide(func(storage op.Storage, configuration delegatedauth.Config) (op.OpenIDProvider, error) { - keySet, err := ReadKeySet(context.TODO(), configuration) + fx.Provide(func(httpClient *http.Client, storage op.Storage, configuration delegatedauth.Config) (op.OpenIDProvider, error) { + keySet, err := ReadKeySet(httpClient, context.TODO(), configuration) if err != nil { return nil, err } diff --git a/pkg/oidc/router.go b/pkg/oidc/router.go index 018701f..73a68ec 100644 --- a/pkg/oidc/router.go +++ b/pkg/oidc/router.go @@ -1,9 +1,13 @@ package oidc import ( + "net/http" + "github.com/gorilla/mux" "github.com/zitadel/oidc/pkg/client/rp" "github.com/zitadel/oidc/pkg/op" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/trace" ) func AddRoutes(router *mux.Router, provider op.OpenIDProvider, storage Storage, relyingParty rp.RelyingParty) { @@ -11,5 +15,18 @@ func AddRoutes(router *mux.Router, provider op.OpenIDProvider, storage Storage, Handler(authorizeCallbackHandler(provider, storage, relyingParty)) router.NewRoute().Path("/authorize/callback").Queries("error", "{error}"). Handler(authorizeErrorHandler()) - router.PathPrefix("/").Handler(provider.HttpHandler()) + oidcLibRouter := router.PathPrefix("/").Subrouter() + oidcLibRouter.Use(func(handler http.Handler) http.Handler { + // The otelmux middleware does not see matching route as it is matched in a subrouter + // So the span name terminated with just "/" + // This middleware make the hack + // We can do this because url does not contain any dynamic variables. + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + currentSpan := trace.SpanFromContext(r.Context()) + currentSpan.SetName(r.URL.Path) + currentSpan.SetAttributes(attribute.String("http.route", r.URL.Path)) + handler.ServeHTTP(w, r) + }) + }) + oidcLibRouter.PathPrefix("/").Handler(provider.HttpHandler()) } diff --git a/pkg/storage/sqlstorage/database.go b/pkg/storage/sqlstorage/database.go index 20a514b..4f33cec 100644 --- a/pkg/storage/sqlstorage/database.go +++ b/pkg/storage/sqlstorage/database.go @@ -8,11 +8,12 @@ import ( "time" auth "github.com/formancehq/auth/pkg" - "github.com/numary/go-libs/sharedlogging" + "github.com/formancehq/go-libs/sharedlogging" "go.uber.org/fx" "gorm.io/driver/postgres" "gorm.io/gorm" "gorm.io/gorm/logger" + "gorm.io/plugin/opentelemetry/tracing" ) const ( @@ -41,9 +42,14 @@ func OpenPostgresDatabase(uri string) gorm.Dialector { } func LoadGorm(d gorm.Dialector, debug bool) (*gorm.DB, error) { - return gorm.Open(d, &gorm.Config{ + db, err := gorm.Open(d, &gorm.Config{ Logger: newLogger(debug), }) + if err != nil { + return nil, err + } + db.Use(tracing.NewPlugin()) + return db, nil } func MigrateTables(ctx context.Context, db *gorm.DB) error { diff --git a/pkg/storage/sqlstorage/module.go b/pkg/storage/sqlstorage/module.go index f84ef2a..2d6c5ea 100644 --- a/pkg/storage/sqlstorage/module.go +++ b/pkg/storage/sqlstorage/module.go @@ -5,7 +5,7 @@ import ( auth "github.com/formancehq/auth/pkg" "github.com/formancehq/auth/pkg/oidc" - sharedhealth "github.com/numary/go-libs/sharedhealth/pkg" + sharedhealth "github.com/formancehq/go-libs/sharedhealth/pkg" "github.com/zitadel/oidc/pkg/op" "go.uber.org/fx" ) diff --git a/pkg/storage/sqlstorage/storage.go b/pkg/storage/sqlstorage/storage.go index 49da9ba..54bd881 100644 --- a/pkg/storage/sqlstorage/storage.go +++ b/pkg/storage/sqlstorage/storage.go @@ -50,7 +50,7 @@ func (s *Storage) FindTransientScopes(ctx context.Context, id string) ([]auth.Sc } func (s *Storage) CreateUser(ctx context.Context, user *auth.User) error { - return s.db.Where(ctx).Create(user).Error + return s.db.WithContext(ctx).Create(user).Error } func (s *Storage) FindUserByEmail(ctx context.Context, email string) (*auth.User, error) { From e639418d1dc296b65230ba984f4265233de4bfd8 Mon Sep 17 00:00:00 2001 From: Ragot Geoffrey Date: Sat, 19 Nov 2022 14:06:17 +0100 Subject: [PATCH 2/5] feat: add telemetry --- .pre-commit-config.yaml | 22 ++++++++++++++++++++++ cmd/serve.go | 1 - commitlint.config.js | 5 +++++ pkg/oidc/router.go | 7 +++++-- pkg/storage/sqlstorage/database.go | 4 +++- 5 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100644 commitlint.config.js diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..2a67f20 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,22 @@ +exclude: (client|internal/grpc) +fail_fast: true +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.3.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + exclude: .cloud + - id: check-added-large-files +- repo: https://github.com/formancehq/pre-commit-hooks + rev: dd079f7c30ad72446d615f55a000d4f875e79633 + hooks: + - id: gogenerate + files: swagger.yaml + - id: gomodtidy + - id: goimports + - id: gofmt + - id: golangci-lint + - id: gotests + - id: commitlint diff --git a/cmd/serve.go b/cmd/serve.go index 6ba4906..661fdda 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -65,7 +65,6 @@ EL/wy5C80pa3jahniqVgO5L6zz0ZLtRIRE7aCtCIu826gctJ1+ShIso= func otlpHttpClientModule() fx.Option { return fx.Provide(func() *http.Client { - otelhttp.WithSpanOptions() return &http.Client{ Transport: otelhttp.NewTransport(http.DefaultTransport, otelhttp.WithSpanNameFormatter(func(operation string, r *http.Request) string { str := fmt.Sprintf("%s %s", r.Method, r.URL.Path) diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..3580f60 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,5 @@ +module.exports = { + extends: [ + '@commitlint/config-conventional' + ] +} diff --git a/pkg/oidc/router.go b/pkg/oidc/router.go index 73a68ec..33eb26d 100644 --- a/pkg/oidc/router.go +++ b/pkg/oidc/router.go @@ -10,11 +10,14 @@ import ( "go.opentelemetry.io/otel/trace" ) +const AuthorizeCallbackPath = "/authorize/callback" + func AddRoutes(router *mux.Router, provider op.OpenIDProvider, storage Storage, relyingParty rp.RelyingParty) { - router.NewRoute().Path("/authorize/callback").Queries("code", "{code}"). + router.NewRoute().Path(AuthorizeCallbackPath).Queries("code", "{code}"). Handler(authorizeCallbackHandler(provider, storage, relyingParty)) - router.NewRoute().Path("/authorize/callback").Queries("error", "{error}"). + router.NewRoute().Path(AuthorizeCallbackPath).Queries("error", "{error}"). Handler(authorizeErrorHandler()) + oidcLibRouter := router.PathPrefix("/").Subrouter() oidcLibRouter.Use(func(handler http.Handler) http.Handler { // The otelmux middleware does not see matching route as it is matched in a subrouter diff --git a/pkg/storage/sqlstorage/database.go b/pkg/storage/sqlstorage/database.go index 4f33cec..b7bc026 100644 --- a/pkg/storage/sqlstorage/database.go +++ b/pkg/storage/sqlstorage/database.go @@ -48,7 +48,9 @@ func LoadGorm(d gorm.Dialector, debug bool) (*gorm.DB, error) { if err != nil { return nil, err } - db.Use(tracing.NewPlugin()) + if err := db.Use(tracing.NewPlugin()); err != nil { + return nil, err + } return db, nil } From e6022b8adfe605d15da84eb6e5775d260667f7d2 Mon Sep 17 00:00:00 2001 From: Ragot Geoffrey Date: Sat, 19 Nov 2022 14:09:36 +0100 Subject: [PATCH 3/5] feat: add telemetry --- .github/dependabot.yml | 2 +- README.md | 2 +- Taskfile.yaml | 22 +- authclient/.openapi-generator/FILES | 23 +- authclient/.openapi-generator/VERSION | 2 +- authclient/README.md | 44 +- authclient/api/openapi.yaml | 335 ++-- authclient/api_clients.go | 917 ++++++++++ authclient/api_default.go | 1823 -------------------- authclient/api_scopes.go | 728 ++++++++ authclient/api_users.go | 226 +++ authclient/client.go | 34 +- authclient/configuration.go | 14 +- authclient/docs/Client.md | 280 --- authclient/docs/ClientAllOf.md | 103 -- authclient/docs/ClientOptions.md | 128 +- authclient/docs/ClientSecret.md | 74 +- authclient/docs/ClientsApi.md | 621 +++++++ authclient/docs/CreateClientResponse.md | 18 +- authclient/docs/CreateScopeResponse.md | 18 +- authclient/docs/CreateSecretResponse.md | 18 +- authclient/docs/DefaultApi.md | 1240 ------------- authclient/docs/ListClientsResponse.md | 18 +- authclient/docs/ListScopesResponse.md | 18 +- authclient/docs/ListUsersResponse.md | 18 +- authclient/docs/ReadClientResponse.md | 18 +- authclient/docs/Scope.md | 124 -- authclient/docs/ScopeAllOf.md | 77 - authclient/docs/ScopeOptions.md | 38 +- authclient/docs/ScopesApi.md | 494 ++++++ authclient/docs/Secret.md | 140 -- authclient/docs/SecretAllOf.md | 93 - authclient/docs/SecretOptions.md | 38 +- authclient/docs/User.md | 54 +- authclient/docs/UsersApi.md | 141 ++ authclient/model_client.go | 425 ----- authclient/model_client_all_of.go | 180 -- authclient/model_client_options.go | 174 +- authclient/model_client_secret.go | 83 +- authclient/model_create_client_response.go | 27 +- authclient/model_create_scope_response.go | 27 +- authclient/model_create_secret_response.go | 27 +- authclient/model_list_clients_response.go | 23 +- authclient/model_list_scopes_response.go | 23 +- authclient/model_list_users_response.go | 23 +- authclient/model_read_client_response.go | 27 +- authclient/model_read_user_response.go | 8 +- authclient/model_scope.go | 209 --- authclient/model_scope_all_of.go | 144 -- authclient/model_scope_options.go | 47 +- authclient/model_secret.go | 231 --- authclient/model_secret_all_of.go | 166 -- authclient/model_secret_options.go | 47 +- authclient/model_user.go | 81 +- authclient/test/api_clients_test.go | 150 ++ authclient/test/api_scopes_test.go | 121 ++ authclient/test/api_users_test.go | 51 + authclient/utils.go | 15 + demo/src/logo.svg | 2 +- dex.Dockerfile | 2 +- pkg/web/static/img/gitlab-icon.svg | 2 +- pkg/web/static/img/google-icon.svg | 2 +- pkg/web/static/img/linkedin-icon.svg | 2 +- pkg/web/static/img/microsoft-icon.svg | 2 +- pkg/web/static/main.css | 2 - pkg/web/templates/footer.html | 2 +- swagger.yaml | 5 +- 67 files changed, 4380 insertions(+), 5893 deletions(-) create mode 100644 authclient/api_clients.go delete mode 100644 authclient/api_default.go create mode 100644 authclient/api_scopes.go create mode 100644 authclient/api_users.go delete mode 100644 authclient/docs/Client.md delete mode 100644 authclient/docs/ClientAllOf.md create mode 100644 authclient/docs/ClientsApi.md delete mode 100644 authclient/docs/DefaultApi.md delete mode 100644 authclient/docs/Scope.md delete mode 100644 authclient/docs/ScopeAllOf.md create mode 100644 authclient/docs/ScopesApi.md delete mode 100644 authclient/docs/Secret.md delete mode 100644 authclient/docs/SecretAllOf.md create mode 100644 authclient/docs/UsersApi.md delete mode 100644 authclient/model_client.go delete mode 100644 authclient/model_client_all_of.go delete mode 100644 authclient/model_scope.go delete mode 100644 authclient/model_scope_all_of.go delete mode 100644 authclient/model_secret.go delete mode 100644 authclient/model_secret_all_of.go create mode 100644 authclient/test/api_clients_test.go create mode 100644 authclient/test/api_scopes_test.go create mode 100644 authclient/test/api_users_test.go diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 59770b5..438cb6f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,4 +4,4 @@ updates: directory: "/" schedule: # Check for updates to GitHub Actions every weekday - interval: "daily" \ No newline at end of file + interval: "daily" diff --git a/README.md b/README.md index fb84e44..ced55ed 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ task lint ## Run the demo -Execute command : +Execute command : ```bash docker compose up ``` diff --git a/Taskfile.yaml b/Taskfile.yaml index 578fad5..8bcabd2 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -62,17 +62,17 @@ tasks: cmds: - rm -rf ./authclient - > - docker run --rm - -w /local - -v ${PWD}:/local - openapitools/openapi-generator-cli:latest generate - -i swagger.yaml - -g go - -o ./authclient - --git-user-id=formancehq - --git-repo-id=auth - -p packageVersion=latest - -p isGoSubmodule=true + docker run --rm + -w /local + -v ${PWD}:/local + openapitools/openapi-generator-cli:latest generate + -i swagger.yaml + -g go + -o ./authclient + --git-user-id=formancehq + --git-repo-id=auth + -p packageVersion=latest + -p isGoSubmodule=true -p packageName=authclient install-deps-demo-client: diff --git a/authclient/.openapi-generator/FILES b/authclient/.openapi-generator/FILES index 918fe17..80327d8 100644 --- a/authclient/.openapi-generator/FILES +++ b/authclient/.openapi-generator/FILES @@ -3,34 +3,30 @@ .travis.yml README.md api/openapi.yaml -api_default.go +api_clients.go +api_scopes.go +api_users.go client.go configuration.go -docs/Client.md -docs/ClientAllOf.md docs/ClientOptions.md docs/ClientSecret.md +docs/ClientsApi.md docs/CreateClientResponse.md docs/CreateScopeResponse.md docs/CreateSecretResponse.md -docs/DefaultApi.md docs/ListClientsResponse.md docs/ListScopesResponse.md docs/ListUsersResponse.md docs/ReadClientResponse.md docs/ReadUserResponse.md -docs/Scope.md -docs/ScopeAllOf.md docs/ScopeOptions.md -docs/Secret.md -docs/SecretAllOf.md +docs/ScopesApi.md docs/SecretOptions.md docs/User.md +docs/UsersApi.md git_push.sh go.mod go.sum -model_client.go -model_client_all_of.go model_client_options.go model_client_secret.go model_create_client_response.go @@ -41,12 +37,11 @@ model_list_scopes_response.go model_list_users_response.go model_read_client_response.go model_read_user_response.go -model_scope.go -model_scope_all_of.go model_scope_options.go -model_secret.go -model_secret_all_of.go model_secret_options.go model_user.go response.go +test/api_clients_test.go +test/api_scopes_test.go +test/api_users_test.go utils.go diff --git a/authclient/.openapi-generator/VERSION b/authclient/.openapi-generator/VERSION index 7b7e20b..d6b4ec4 100644 --- a/authclient/.openapi-generator/VERSION +++ b/authclient/.openapi-generator/VERSION @@ -1 +1 @@ -6.1.1-SNAPSHOT \ No newline at end of file +6.3.0-SNAPSHOT \ No newline at end of file diff --git a/authclient/README.md b/authclient/README.md index 466d541..cde9ccf 100644 --- a/authclient/README.md +++ b/authclient/README.md @@ -74,34 +74,32 @@ ctx = context.WithValue(context.Background(), authclient.ContextOperationServerV ## Documentation for API Endpoints -All URIs are relative to *https://.o.formance.cloud/auth* +All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*DefaultApi* | [**AddScopeToClient**](docs/DefaultApi.md#addscopetoclient) | **Put** /clients/{clientId}/scopes/{scopeId} | Add scope to client -*DefaultApi* | [**AddTransientScope**](docs/DefaultApi.md#addtransientscope) | **Put** /scopes/{scopeId}/transient/{transientScopeId} | Add a transient scope to a scope -*DefaultApi* | [**CreateClient**](docs/DefaultApi.md#createclient) | **Post** /clients | Create client -*DefaultApi* | [**CreateScope**](docs/DefaultApi.md#createscope) | **Post** /scopes | Create scope -*DefaultApi* | [**CreateSecret**](docs/DefaultApi.md#createsecret) | **Post** /clients/{clientId}/secrets | Add a secret to a client -*DefaultApi* | [**DeleteClient**](docs/DefaultApi.md#deleteclient) | **Delete** /clients/{clientId} | Delete client -*DefaultApi* | [**DeleteScope**](docs/DefaultApi.md#deletescope) | **Delete** /scopes/{scopeId} | Delete scope -*DefaultApi* | [**DeleteScopeFromClient**](docs/DefaultApi.md#deletescopefromclient) | **Delete** /clients/{clientId}/scopes/{scopeId} | Delete scope from client -*DefaultApi* | [**DeleteSecret**](docs/DefaultApi.md#deletesecret) | **Delete** /clients/{clientId}/secrets/{secretId} | Delete a secret from a client -*DefaultApi* | [**DeleteTransientScope**](docs/DefaultApi.md#deletetransientscope) | **Delete** /scopes/{scopeId}/transient/{transientScopeId} | Delete a transient scope from a scope -*DefaultApi* | [**ListClients**](docs/DefaultApi.md#listclients) | **Get** /clients | List clients -*DefaultApi* | [**ListScopes**](docs/DefaultApi.md#listscopes) | **Get** /scopes | List scopes -*DefaultApi* | [**ListUsers**](docs/DefaultApi.md#listusers) | **Get** /users | List users -*DefaultApi* | [**ReadClient**](docs/DefaultApi.md#readclient) | **Get** /clients/{clientId} | Read client -*DefaultApi* | [**ReadScope**](docs/DefaultApi.md#readscope) | **Get** /scopes/{scopeId} | Read scope -*DefaultApi* | [**ReadUser**](docs/DefaultApi.md#readuser) | **Get** /users/{userId} | Read user -*DefaultApi* | [**UpdateClient**](docs/DefaultApi.md#updateclient) | **Put** /clients/{clientId} | Update client -*DefaultApi* | [**UpdateScope**](docs/DefaultApi.md#updatescope) | **Put** /scopes/{scopeId} | Update scope +*ClientsApi* | [**AddScopeToClient**](docs/ClientsApi.md#addscopetoclient) | **Put** /clients/{clientId}/scopes/{scopeId} | Add scope to client +*ClientsApi* | [**CreateClient**](docs/ClientsApi.md#createclient) | **Post** /clients | Create client +*ClientsApi* | [**CreateSecret**](docs/ClientsApi.md#createsecret) | **Post** /clients/{clientId}/secrets | Add a secret to a client +*ClientsApi* | [**DeleteClient**](docs/ClientsApi.md#deleteclient) | **Delete** /clients/{clientId} | Delete client +*ClientsApi* | [**DeleteScopeFromClient**](docs/ClientsApi.md#deletescopefromclient) | **Delete** /clients/{clientId}/scopes/{scopeId} | Delete scope from client +*ClientsApi* | [**DeleteSecret**](docs/ClientsApi.md#deletesecret) | **Delete** /clients/{clientId}/secrets/{secretId} | Delete a secret from a client +*ClientsApi* | [**ListClients**](docs/ClientsApi.md#listclients) | **Get** /clients | List clients +*ClientsApi* | [**ReadClient**](docs/ClientsApi.md#readclient) | **Get** /clients/{clientId} | Read client +*ClientsApi* | [**UpdateClient**](docs/ClientsApi.md#updateclient) | **Put** /clients/{clientId} | Update client +*ScopesApi* | [**AddTransientScope**](docs/ScopesApi.md#addtransientscope) | **Put** /scopes/{scopeId}/transient/{transientScopeId} | Add a transient scope to a scope +*ScopesApi* | [**CreateScope**](docs/ScopesApi.md#createscope) | **Post** /scopes | Create scope +*ScopesApi* | [**DeleteScope**](docs/ScopesApi.md#deletescope) | **Delete** /scopes/{scopeId} | Delete scope +*ScopesApi* | [**DeleteTransientScope**](docs/ScopesApi.md#deletetransientscope) | **Delete** /scopes/{scopeId}/transient/{transientScopeId} | Delete a transient scope from a scope +*ScopesApi* | [**ListScopes**](docs/ScopesApi.md#listscopes) | **Get** /scopes | List scopes +*ScopesApi* | [**ReadScope**](docs/ScopesApi.md#readscope) | **Get** /scopes/{scopeId} | Read scope +*ScopesApi* | [**UpdateScope**](docs/ScopesApi.md#updatescope) | **Put** /scopes/{scopeId} | Update scope +*UsersApi* | [**ListUsers**](docs/UsersApi.md#listusers) | **Get** /users | List users +*UsersApi* | [**ReadUser**](docs/UsersApi.md#readuser) | **Get** /users/{userId} | Read user ## Documentation For Models - - [Client](docs/Client.md) - - [ClientAllOf](docs/ClientAllOf.md) - [ClientOptions](docs/ClientOptions.md) - [ClientSecret](docs/ClientSecret.md) - [CreateClientResponse](docs/CreateClientResponse.md) @@ -112,11 +110,7 @@ Class | Method | HTTP request | Description - [ListUsersResponse](docs/ListUsersResponse.md) - [ReadClientResponse](docs/ReadClientResponse.md) - [ReadUserResponse](docs/ReadUserResponse.md) - - [Scope](docs/Scope.md) - - [ScopeAllOf](docs/ScopeAllOf.md) - [ScopeOptions](docs/ScopeOptions.md) - - [Secret](docs/Secret.md) - - [SecretAllOf](docs/SecretAllOf.md) - [SecretOptions](docs/SecretOptions.md) - [User](docs/User.md) diff --git a/authclient/api/openapi.yaml b/authclient/api/openapi.yaml index 49fafb6..64e5531 100644 --- a/authclient/api/openapi.yaml +++ b/authclient/api/openapi.yaml @@ -1,15 +1,10 @@ -openapi: 3.0.3 +openapi: 3.1.0 info: contact: {} title: Auth API version: AUTH_VERSION servers: -- description: Production server - url: "https://{organization}.o.formance.cloud/auth" - variables: - organization: - default: "" - description: The organization on which the auth server is located +- url: / paths: /clients: get: @@ -22,6 +17,8 @@ paths: $ref: '#/components/schemas/ListClientsResponse' description: List of clients summary: List clients + tags: + - Clients post: operationId: createClient requestBody: @@ -37,6 +34,8 @@ paths: $ref: '#/components/schemas/CreateClientResponse' description: Client created summary: Create client + tags: + - Clients /clients/{clientId}: delete: operationId: deleteClient @@ -46,13 +45,14 @@ paths: in: path name: clientId required: true - schema: - type: string + schema: {} style: simple responses: "204": description: Client deleted summary: Delete client + tags: + - Clients get: operationId: readClient parameters: @@ -61,8 +61,7 @@ paths: in: path name: clientId required: true - schema: - type: string + schema: {} style: simple responses: "200": @@ -72,6 +71,8 @@ paths: $ref: '#/components/schemas/ReadClientResponse' description: Retrieved client summary: Read client + tags: + - Clients put: operationId: updateClient parameters: @@ -80,8 +81,7 @@ paths: in: path name: clientId required: true - schema: - type: string + schema: {} style: simple requestBody: content: @@ -96,6 +96,8 @@ paths: $ref: '#/components/schemas/UpdateClientResponse' description: Updated client summary: Update client + tags: + - Clients /clients/{clientId}/secrets: post: operationId: createSecret @@ -105,8 +107,7 @@ paths: in: path name: clientId required: true - schema: - type: string + schema: {} style: simple requestBody: content: @@ -121,6 +122,8 @@ paths: $ref: '#/components/schemas/CreateSecretResponse' description: Created secret summary: Add a secret to a client + tags: + - Clients /clients/{clientId}/secrets/{secretId}: delete: operationId: deleteSecret @@ -130,21 +133,21 @@ paths: in: path name: clientId required: true - schema: - type: string + schema: {} style: simple - description: Secret ID explode: false in: path name: secretId required: true - schema: - type: string + schema: {} style: simple responses: "204": description: Secret deleted summary: Delete a secret from a client + tags: + - Clients /clients/{clientId}/scopes/{scopeId}: delete: operationId: deleteScopeFromClient @@ -154,21 +157,21 @@ paths: in: path name: clientId required: true - schema: - type: string + schema: {} style: simple - description: Scope ID explode: false in: path name: scopeId required: true - schema: - type: string + schema: {} style: simple responses: "204": description: Scope deleted from client summary: Delete scope from client + tags: + - Clients put: operationId: addScopeToClient parameters: @@ -177,21 +180,21 @@ paths: in: path name: clientId required: true - schema: - type: string + schema: {} style: simple - description: Scope ID explode: false in: path name: scopeId required: true - schema: - type: string + schema: {} style: simple responses: "204": description: Scope added to client summary: Add scope to client + tags: + - Clients /scopes: get: description: List Scopes @@ -204,6 +207,8 @@ paths: $ref: '#/components/schemas/ListScopesResponse' description: List of scopes summary: List scopes + tags: + - Scopes post: description: Create scope operationId: createScope @@ -220,6 +225,8 @@ paths: $ref: '#/components/schemas/CreateScopeResponse' description: Created scope summary: Create scope + tags: + - Scopes /scopes/{scopeId}: delete: description: Delete scope @@ -230,13 +237,14 @@ paths: in: path name: scopeId required: true - schema: - type: string + schema: {} style: simple responses: "204": description: Scope deleted summary: Delete scope + tags: + - Scopes get: description: Read scope operationId: readScope @@ -246,8 +254,7 @@ paths: in: path name: scopeId required: true - schema: - type: string + schema: {} style: simple responses: "200": @@ -257,6 +264,8 @@ paths: $ref: '#/components/schemas/ReadScopeResponse' description: Retrieved scope summary: Read scope + tags: + - Scopes put: description: Update scope operationId: updateScope @@ -266,8 +275,7 @@ paths: in: path name: scopeId required: true - schema: - type: string + schema: {} style: simple requestBody: content: @@ -282,6 +290,8 @@ paths: $ref: '#/components/schemas/UpdateScopeResponse' description: Updated scope summary: Update scope + tags: + - Scopes /scopes/{scopeId}/transient/{transientScopeId}: delete: description: Delete a transient scope from a scope @@ -292,21 +302,21 @@ paths: in: path name: scopeId required: true - schema: - type: string + schema: {} style: simple - description: Transient scope ID explode: false in: path name: transientScopeId required: true - schema: - type: string + schema: {} style: simple responses: "204": description: Transient scope deleted summary: Delete a transient scope from a scope + tags: + - Scopes put: description: Add a transient scope to a scope operationId: addTransientScope @@ -316,21 +326,21 @@ paths: in: path name: scopeId required: true - schema: - type: string + schema: {} style: simple - description: Transient scope ID explode: false in: path name: transientScopeId required: true - schema: - type: string + schema: {} style: simple responses: "204": description: Scope added summary: Add a transient scope to a scope + tags: + - Scopes /users: get: description: List users @@ -343,6 +353,8 @@ paths: $ref: '#/components/schemas/ListUsersResponse' description: List of users summary: List users + tags: + - Users /users/{userId}: get: description: Read user @@ -353,8 +365,7 @@ paths: in: path name: userId required: true - schema: - type: string + schema: {} style: simple responses: "200": @@ -364,109 +375,100 @@ paths: $ref: '#/components/schemas/ReadUserResponse' description: Retrieved user summary: Read user + tags: + - Users components: schemas: Metadata: - additionalProperties: - type: string - type: object + additionalProperties: {} ClientOptions: example: metadata: - key: metadata - public: true - trusted: true - postLogoutRedirectUris: - - postLogoutRedirectUris - - postLogoutRedirectUris - name: name - description: description - redirectUris: - - redirectUris - - redirectUris + key: "" + public: "" + trusted: "" + postLogoutRedirectUris: "" + name: "" + description: "" + redirectUris: "" properties: - public: - type: boolean + public: {} redirectUris: - items: - type: string - type: array - description: - type: string - name: - type: string - trusted: - type: boolean + items: {} + description: {} + name: {} + trusted: {} postLogoutRedirectUris: - items: - type: string - type: array + items: {} metadata: - additionalProperties: - type: string - type: object + additionalProperties: {} required: - name - type: object ClientSecret: properties: - lastDigits: - type: string - name: - type: string - id: - type: string + lastDigits: {} + name: {} + id: {} metadata: - additionalProperties: - type: string - type: object + additionalProperties: {} required: - id - lastDigits - name - type: object Client: allOf: - $ref: '#/components/schemas/ClientOptions' - - $ref: '#/components/schemas/Client_allOf' + - properties: + id: {} + scopes: + items: {} + secrets: + items: + $ref: '#/components/schemas/ClientSecret' + required: + - id ScopeOptions: example: metadata: - key: metadata - label: label + key: "" + label: "" properties: - label: - type: string + label: {} metadata: - additionalProperties: - type: string - type: object + additionalProperties: {} required: - label - type: object Scope: allOf: - $ref: '#/components/schemas/ScopeOptions' - - $ref: '#/components/schemas/Scope_allOf' + - properties: + id: {} + transient: + items: {} + required: + - id SecretOptions: example: metadata: - key: metadata - name: name + key: "" + name: "" properties: - name: - type: string + name: {} metadata: - additionalProperties: - type: string - type: object + additionalProperties: {} required: - name - type: object Secret: allOf: - $ref: '#/components/schemas/SecretOptions' - - $ref: '#/components/schemas/Secret_allOf' + - properties: + id: {} + lastDigits: {} + clear: {} + required: + - clear + - id + - lastDigits User: example: subject: Jane Doe @@ -475,65 +477,77 @@ components: properties: id: example: 3bb03708-312f-48a0-821a-e765837dc2c4 - type: string subject: example: Jane Doe - type: string email: example: user1@orga1.com - type: string - type: object CreateClientRequest: $ref: '#/components/schemas/ClientOptions' CreateClientResponse: example: - data: null + data: "" properties: data: - $ref: '#/components/schemas/Client' - type: object + allOf: + - $ref: '#/components/schemas/ClientOptions' + - properties: + id: {} + scopes: + items: {} + secrets: + items: + $ref: '#/components/schemas/ClientSecret' + required: + - id ListClientsResponse: example: - data: - - null - - null + data: "" properties: data: items: $ref: '#/components/schemas/Client' - type: array - type: object UpdateClientRequest: $ref: '#/components/schemas/ClientOptions' UpdateClientResponse: $ref: '#/components/schemas/CreateClientResponse' ReadClientResponse: example: - data: null + data: "" properties: data: - $ref: '#/components/schemas/Client' - type: object + allOf: + - $ref: '#/components/schemas/ClientOptions' + - properties: + id: {} + scopes: + items: {} + secrets: + items: + $ref: '#/components/schemas/ClientSecret' + required: + - id ListScopesResponse: example: - data: - - null - - null + data: "" properties: data: items: $ref: '#/components/schemas/Scope' - type: array - type: object CreateScopeRequest: $ref: '#/components/schemas/ScopeOptions' CreateScopeResponse: example: - data: null + data: "" properties: data: - $ref: '#/components/schemas/Scope' - type: object + allOf: + - $ref: '#/components/schemas/ScopeOptions' + - properties: + id: {} + transient: + items: {} + required: + - id ReadScopeResponse: $ref: '#/components/schemas/CreateScopeResponse' UpdateScopeRequest: @@ -544,11 +558,19 @@ components: $ref: '#/components/schemas/SecretOptions' CreateSecretResponse: example: - data: null + data: "" properties: data: - $ref: '#/components/schemas/Secret' - type: object + allOf: + - $ref: '#/components/schemas/SecretOptions' + - properties: + id: {} + lastDigits: {} + clear: {} + required: + - clear + - id + - lastDigits ReadUserResponse: example: data: @@ -558,61 +580,10 @@ components: properties: data: $ref: '#/components/schemas/User' - type: object ListUsersResponse: example: - data: - - subject: Jane Doe - id: 3bb03708-312f-48a0-821a-e765837dc2c4 - email: user1@orga1.com - - subject: Jane Doe - id: 3bb03708-312f-48a0-821a-e765837dc2c4 - email: user1@orga1.com + data: "" properties: data: items: $ref: '#/components/schemas/User' - type: array - type: object - Client_allOf: - properties: - id: - type: string - scopes: - items: - type: string - type: array - secrets: - items: - $ref: '#/components/schemas/ClientSecret' - type: array - required: - - id - type: object - example: null - Scope_allOf: - properties: - id: - type: string - transient: - items: - type: string - type: array - required: - - id - type: object - example: null - Secret_allOf: - properties: - id: - type: string - lastDigits: - type: string - clear: - type: string - required: - - clear - - id - - lastDigits - type: object - example: null diff --git a/authclient/api_clients.go b/authclient/api_clients.go new file mode 100644 index 0000000..19981a7 --- /dev/null +++ b/authclient/api_clients.go @@ -0,0 +1,917 @@ +/* +Auth API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: AUTH_VERSION +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authclient + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// ClientsApiService ClientsApi service +type ClientsApiService service + +type ApiAddScopeToClientRequest struct { + ctx context.Context + ApiService *ClientsApiService + clientId interface{} + scopeId interface{} +} + +func (r ApiAddScopeToClientRequest) Execute() (*http.Response, error) { + return r.ApiService.AddScopeToClientExecute(r) +} + +/* +AddScopeToClient Add scope to client + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId Client ID + @param scopeId Scope ID + @return ApiAddScopeToClientRequest +*/ +func (a *ClientsApiService) AddScopeToClient(ctx context.Context, clientId interface{}, scopeId interface{}) ApiAddScopeToClientRequest { + return ApiAddScopeToClientRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + scopeId: scopeId, + } +} + +// Execute executes the request +func (a *ClientsApiService) AddScopeToClientExecute(r ApiAddScopeToClientRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClientsApiService.AddScopeToClient") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clients/{clientId}/scopes/{scopeId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) + + 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + 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, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCreateClientRequest struct { + ctx context.Context + ApiService *ClientsApiService + body *ClientOptions +} + +func (r ApiCreateClientRequest) Body(body ClientOptions) ApiCreateClientRequest { + r.body = &body + return r +} + +func (r ApiCreateClientRequest) Execute() (*CreateClientResponse, *http.Response, error) { + return r.ApiService.CreateClientExecute(r) +} + +/* +CreateClient Create client + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateClientRequest +*/ +func (a *ClientsApiService) CreateClient(ctx context.Context) ApiCreateClientRequest { + return ApiCreateClientRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return CreateClientResponse +func (a *ClientsApiService) CreateClientExecute(r ApiCreateClientRequest) (*CreateClientResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateClientResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClientsApiService.CreateClient") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clients" + + 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + 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 ApiCreateSecretRequest struct { + ctx context.Context + ApiService *ClientsApiService + clientId interface{} + body *SecretOptions +} + +func (r ApiCreateSecretRequest) Body(body SecretOptions) ApiCreateSecretRequest { + r.body = &body + return r +} + +func (r ApiCreateSecretRequest) Execute() (*CreateSecretResponse, *http.Response, error) { + return r.ApiService.CreateSecretExecute(r) +} + +/* +CreateSecret Add a secret to a client + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId Client ID + @return ApiCreateSecretRequest +*/ +func (a *ClientsApiService) CreateSecret(ctx context.Context, clientId interface{}) ApiCreateSecretRequest { + return ApiCreateSecretRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + } +} + +// Execute executes the request +// @return CreateSecretResponse +func (a *ClientsApiService) CreateSecretExecute(r ApiCreateSecretRequest) (*CreateSecretResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateSecretResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClientsApiService.CreateSecret") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clients/{clientId}/secrets" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) + + 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + 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 ApiDeleteClientRequest struct { + ctx context.Context + ApiService *ClientsApiService + clientId interface{} +} + +func (r ApiDeleteClientRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteClientExecute(r) +} + +/* +DeleteClient Delete client + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId Client ID + @return ApiDeleteClientRequest +*/ +func (a *ClientsApiService) DeleteClient(ctx context.Context, clientId interface{}) ApiDeleteClientRequest { + return ApiDeleteClientRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + } +} + +// Execute executes the request +func (a *ClientsApiService) DeleteClientExecute(r ApiDeleteClientRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClientsApiService.DeleteClient") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clients/{clientId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) + + 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + 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, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteScopeFromClientRequest struct { + ctx context.Context + ApiService *ClientsApiService + clientId interface{} + scopeId interface{} +} + +func (r ApiDeleteScopeFromClientRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteScopeFromClientExecute(r) +} + +/* +DeleteScopeFromClient Delete scope from client + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId Client ID + @param scopeId Scope ID + @return ApiDeleteScopeFromClientRequest +*/ +func (a *ClientsApiService) DeleteScopeFromClient(ctx context.Context, clientId interface{}, scopeId interface{}) ApiDeleteScopeFromClientRequest { + return ApiDeleteScopeFromClientRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + scopeId: scopeId, + } +} + +// Execute executes the request +func (a *ClientsApiService) DeleteScopeFromClientExecute(r ApiDeleteScopeFromClientRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClientsApiService.DeleteScopeFromClient") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clients/{clientId}/scopes/{scopeId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) + + 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + 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, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteSecretRequest struct { + ctx context.Context + ApiService *ClientsApiService + clientId interface{} + secretId interface{} +} + +func (r ApiDeleteSecretRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteSecretExecute(r) +} + +/* +DeleteSecret Delete a secret from a client + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId Client ID + @param secretId Secret ID + @return ApiDeleteSecretRequest +*/ +func (a *ClientsApiService) DeleteSecret(ctx context.Context, clientId interface{}, secretId interface{}) ApiDeleteSecretRequest { + return ApiDeleteSecretRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + secretId: secretId, + } +} + +// Execute executes the request +func (a *ClientsApiService) DeleteSecretExecute(r ApiDeleteSecretRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClientsApiService.DeleteSecret") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clients/{clientId}/secrets/{secretId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"secretId"+"}", url.PathEscape(parameterToString(r.secretId, "")), -1) + + 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + 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, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiListClientsRequest struct { + ctx context.Context + ApiService *ClientsApiService +} + +func (r ApiListClientsRequest) Execute() (*ListClientsResponse, *http.Response, error) { + return r.ApiService.ListClientsExecute(r) +} + +/* +ListClients List clients + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListClientsRequest +*/ +func (a *ClientsApiService) ListClients(ctx context.Context) ApiListClientsRequest { + return ApiListClientsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListClientsResponse +func (a *ClientsApiService) ListClientsExecute(r ApiListClientsRequest) (*ListClientsResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListClientsResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClientsApiService.ListClients") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clients" + + 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, formFiles) + 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 ApiReadClientRequest struct { + ctx context.Context + ApiService *ClientsApiService + clientId interface{} +} + +func (r ApiReadClientRequest) Execute() (*ReadClientResponse, *http.Response, error) { + return r.ApiService.ReadClientExecute(r) +} + +/* +ReadClient Read client + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId Client ID + @return ApiReadClientRequest +*/ +func (a *ClientsApiService) ReadClient(ctx context.Context, clientId interface{}) ApiReadClientRequest { + return ApiReadClientRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + } +} + +// Execute executes the request +// @return ReadClientResponse +func (a *ClientsApiService) ReadClientExecute(r ApiReadClientRequest) (*ReadClientResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ReadClientResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClientsApiService.ReadClient") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clients/{clientId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) + + 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, formFiles) + 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 ApiUpdateClientRequest struct { + ctx context.Context + ApiService *ClientsApiService + clientId interface{} + body *ClientOptions +} + +func (r ApiUpdateClientRequest) Body(body ClientOptions) ApiUpdateClientRequest { + r.body = &body + return r +} + +func (r ApiUpdateClientRequest) Execute() (*CreateClientResponse, *http.Response, error) { + return r.ApiService.UpdateClientExecute(r) +} + +/* +UpdateClient Update client + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param clientId Client ID + @return ApiUpdateClientRequest +*/ +func (a *ClientsApiService) UpdateClient(ctx context.Context, clientId interface{}) ApiUpdateClientRequest { + return ApiUpdateClientRequest{ + ApiService: a, + ctx: ctx, + clientId: clientId, + } +} + +// Execute executes the request +// @return CreateClientResponse +func (a *ClientsApiService) UpdateClientExecute(r ApiUpdateClientRequest) (*CreateClientResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateClientResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ClientsApiService.UpdateClient") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/clients/{clientId}" + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) + + 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + 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 +} diff --git a/authclient/api_default.go b/authclient/api_default.go deleted file mode 100644 index fb85166..0000000 --- a/authclient/api_default.go +++ /dev/null @@ -1,1823 +0,0 @@ -/* -Auth API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -API version: AUTH_VERSION -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package authclient - -import ( - "bytes" - "context" - "io/ioutil" - "net/http" - "net/url" - "strings" -) - - -// DefaultApiService DefaultApi service -type DefaultApiService service - -type ApiAddScopeToClientRequest struct { - ctx context.Context - ApiService *DefaultApiService - clientId string - scopeId string -} - -func (r ApiAddScopeToClientRequest) Execute() (*http.Response, error) { - return r.ApiService.AddScopeToClientExecute(r) -} - -/* -AddScopeToClient Add scope to client - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param clientId Client ID - @param scopeId Scope ID - @return ApiAddScopeToClientRequest -*/ -func (a *DefaultApiService) AddScopeToClient(ctx context.Context, clientId string, scopeId string) ApiAddScopeToClientRequest { - return ApiAddScopeToClientRequest{ - ApiService: a, - ctx: ctx, - clientId: clientId, - scopeId: scopeId, - } -} - -// Execute executes the request -func (a *DefaultApiService) AddScopeToClientExecute(r ApiAddScopeToClientRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.AddScopeToClient") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/clients/{clientId}/scopes/{scopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) - - 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - 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, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiAddTransientScopeRequest struct { - ctx context.Context - ApiService *DefaultApiService - scopeId string - transientScopeId string -} - -func (r ApiAddTransientScopeRequest) Execute() (*http.Response, error) { - return r.ApiService.AddTransientScopeExecute(r) -} - -/* -AddTransientScope Add a transient scope to a scope - -Add a transient scope to a scope - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param scopeId Scope ID - @param transientScopeId Transient scope ID - @return ApiAddTransientScopeRequest -*/ -func (a *DefaultApiService) AddTransientScope(ctx context.Context, scopeId string, transientScopeId string) ApiAddTransientScopeRequest { - return ApiAddTransientScopeRequest{ - ApiService: a, - ctx: ctx, - scopeId: scopeId, - transientScopeId: transientScopeId, - } -} - -// Execute executes the request -func (a *DefaultApiService) AddTransientScopeExecute(r ApiAddTransientScopeRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.AddTransientScope") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/scopes/{scopeId}/transient/{transientScopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"transientScopeId"+"}", url.PathEscape(parameterToString(r.transientScopeId, "")), -1) - - 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - 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, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiCreateClientRequest struct { - ctx context.Context - ApiService *DefaultApiService - body *ClientOptions -} - -func (r ApiCreateClientRequest) Body(body ClientOptions) ApiCreateClientRequest { - r.body = &body - return r -} - -func (r ApiCreateClientRequest) Execute() (*CreateClientResponse, *http.Response, error) { - return r.ApiService.CreateClientExecute(r) -} - -/* -CreateClient Create client - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateClientRequest -*/ -func (a *DefaultApiService) CreateClient(ctx context.Context) ApiCreateClientRequest { - return ApiCreateClientRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return CreateClientResponse -func (a *DefaultApiService) CreateClientExecute(r ApiCreateClientRequest) (*CreateClientResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *CreateClientResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateClient") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/clients" - - 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.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - 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 ApiCreateScopeRequest struct { - ctx context.Context - ApiService *DefaultApiService - body *ScopeOptions -} - -func (r ApiCreateScopeRequest) Body(body ScopeOptions) ApiCreateScopeRequest { - r.body = &body - return r -} - -func (r ApiCreateScopeRequest) Execute() (*CreateScopeResponse, *http.Response, error) { - return r.ApiService.CreateScopeExecute(r) -} - -/* -CreateScope Create scope - -Create scope - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiCreateScopeRequest -*/ -func (a *DefaultApiService) CreateScope(ctx context.Context) ApiCreateScopeRequest { - return ApiCreateScopeRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return CreateScopeResponse -func (a *DefaultApiService) CreateScopeExecute(r ApiCreateScopeRequest) (*CreateScopeResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *CreateScopeResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateScope") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/scopes" - - 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.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - 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 ApiCreateSecretRequest struct { - ctx context.Context - ApiService *DefaultApiService - clientId string - body *SecretOptions -} - -func (r ApiCreateSecretRequest) Body(body SecretOptions) ApiCreateSecretRequest { - r.body = &body - return r -} - -func (r ApiCreateSecretRequest) Execute() (*CreateSecretResponse, *http.Response, error) { - return r.ApiService.CreateSecretExecute(r) -} - -/* -CreateSecret Add a secret to a client - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param clientId Client ID - @return ApiCreateSecretRequest -*/ -func (a *DefaultApiService) CreateSecret(ctx context.Context, clientId string) ApiCreateSecretRequest { - return ApiCreateSecretRequest{ - ApiService: a, - ctx: ctx, - clientId: clientId, - } -} - -// Execute executes the request -// @return CreateSecretResponse -func (a *DefaultApiService) CreateSecretExecute(r ApiCreateSecretRequest) (*CreateSecretResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *CreateSecretResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateSecret") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/clients/{clientId}/secrets" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) - - 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.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - 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 ApiDeleteClientRequest struct { - ctx context.Context - ApiService *DefaultApiService - clientId string -} - -func (r ApiDeleteClientRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteClientExecute(r) -} - -/* -DeleteClient Delete client - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param clientId Client ID - @return ApiDeleteClientRequest -*/ -func (a *DefaultApiService) DeleteClient(ctx context.Context, clientId string) ApiDeleteClientRequest { - return ApiDeleteClientRequest{ - ApiService: a, - ctx: ctx, - clientId: clientId, - } -} - -// Execute executes the request -func (a *DefaultApiService) DeleteClientExecute(r ApiDeleteClientRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteClient") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/clients/{clientId}" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) - - 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - 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, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiDeleteScopeRequest struct { - ctx context.Context - ApiService *DefaultApiService - scopeId string -} - -func (r ApiDeleteScopeRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteScopeExecute(r) -} - -/* -DeleteScope Delete scope - -Delete scope - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param scopeId Scope ID - @return ApiDeleteScopeRequest -*/ -func (a *DefaultApiService) DeleteScope(ctx context.Context, scopeId string) ApiDeleteScopeRequest { - return ApiDeleteScopeRequest{ - ApiService: a, - ctx: ctx, - scopeId: scopeId, - } -} - -// Execute executes the request -func (a *DefaultApiService) DeleteScopeExecute(r ApiDeleteScopeRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteScope") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/scopes/{scopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) - - 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - 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, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiDeleteScopeFromClientRequest struct { - ctx context.Context - ApiService *DefaultApiService - clientId string - scopeId string -} - -func (r ApiDeleteScopeFromClientRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteScopeFromClientExecute(r) -} - -/* -DeleteScopeFromClient Delete scope from client - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param clientId Client ID - @param scopeId Scope ID - @return ApiDeleteScopeFromClientRequest -*/ -func (a *DefaultApiService) DeleteScopeFromClient(ctx context.Context, clientId string, scopeId string) ApiDeleteScopeFromClientRequest { - return ApiDeleteScopeFromClientRequest{ - ApiService: a, - ctx: ctx, - clientId: clientId, - scopeId: scopeId, - } -} - -// Execute executes the request -func (a *DefaultApiService) DeleteScopeFromClientExecute(r ApiDeleteScopeFromClientRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteScopeFromClient") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/clients/{clientId}/scopes/{scopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) - - 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - 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, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiDeleteSecretRequest struct { - ctx context.Context - ApiService *DefaultApiService - clientId string - secretId string -} - -func (r ApiDeleteSecretRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteSecretExecute(r) -} - -/* -DeleteSecret Delete a secret from a client - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param clientId Client ID - @param secretId Secret ID - @return ApiDeleteSecretRequest -*/ -func (a *DefaultApiService) DeleteSecret(ctx context.Context, clientId string, secretId string) ApiDeleteSecretRequest { - return ApiDeleteSecretRequest{ - ApiService: a, - ctx: ctx, - clientId: clientId, - secretId: secretId, - } -} - -// Execute executes the request -func (a *DefaultApiService) DeleteSecretExecute(r ApiDeleteSecretRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteSecret") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/clients/{clientId}/secrets/{secretId}" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"secretId"+"}", url.PathEscape(parameterToString(r.secretId, "")), -1) - - 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - 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, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiDeleteTransientScopeRequest struct { - ctx context.Context - ApiService *DefaultApiService - scopeId string - transientScopeId string -} - -func (r ApiDeleteTransientScopeRequest) Execute() (*http.Response, error) { - return r.ApiService.DeleteTransientScopeExecute(r) -} - -/* -DeleteTransientScope Delete a transient scope from a scope - -Delete a transient scope from a scope - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param scopeId Scope ID - @param transientScopeId Transient scope ID - @return ApiDeleteTransientScopeRequest -*/ -func (a *DefaultApiService) DeleteTransientScope(ctx context.Context, scopeId string, transientScopeId string) ApiDeleteTransientScopeRequest { - return ApiDeleteTransientScopeRequest{ - ApiService: a, - ctx: ctx, - scopeId: scopeId, - transientScopeId: transientScopeId, - } -} - -// Execute executes the request -func (a *DefaultApiService) DeleteTransientScopeExecute(r ApiDeleteTransientScopeRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteTransientScope") - if err != nil { - return nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/scopes/{scopeId}/transient/{transientScopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"transientScopeId"+"}", url.PathEscape(parameterToString(r.transientScopeId, "")), -1) - - 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{} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - 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, - } - return localVarHTTPResponse, newErr - } - - return localVarHTTPResponse, nil -} - -type ApiListClientsRequest struct { - ctx context.Context - ApiService *DefaultApiService -} - -func (r ApiListClientsRequest) Execute() (*ListClientsResponse, *http.Response, error) { - return r.ApiService.ListClientsExecute(r) -} - -/* -ListClients List clients - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListClientsRequest -*/ -func (a *DefaultApiService) ListClients(ctx context.Context) ApiListClientsRequest { - return ApiListClientsRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListClientsResponse -func (a *DefaultApiService) ListClientsExecute(r ApiListClientsRequest) (*ListClientsResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListClientsResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListClients") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/clients" - - 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, formFiles) - 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 ApiListScopesRequest struct { - ctx context.Context - ApiService *DefaultApiService -} - -func (r ApiListScopesRequest) Execute() (*ListScopesResponse, *http.Response, error) { - return r.ApiService.ListScopesExecute(r) -} - -/* -ListScopes List scopes - -List Scopes - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListScopesRequest -*/ -func (a *DefaultApiService) ListScopes(ctx context.Context) ApiListScopesRequest { - return ApiListScopesRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListScopesResponse -func (a *DefaultApiService) ListScopesExecute(r ApiListScopesRequest) (*ListScopesResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListScopesResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListScopes") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/scopes" - - 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, formFiles) - 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 ApiListUsersRequest struct { - ctx context.Context - ApiService *DefaultApiService -} - -func (r ApiListUsersRequest) Execute() (*ListUsersResponse, *http.Response, error) { - return r.ApiService.ListUsersExecute(r) -} - -/* -ListUsers List users - -List users - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListUsersRequest -*/ -func (a *DefaultApiService) ListUsers(ctx context.Context) ApiListUsersRequest { - return ApiListUsersRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ListUsersResponse -func (a *DefaultApiService) ListUsersExecute(r ApiListUsersRequest) (*ListUsersResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ListUsersResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListUsers") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/users" - - 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, formFiles) - 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 ApiReadClientRequest struct { - ctx context.Context - ApiService *DefaultApiService - clientId string -} - -func (r ApiReadClientRequest) Execute() (*ReadClientResponse, *http.Response, error) { - return r.ApiService.ReadClientExecute(r) -} - -/* -ReadClient Read client - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param clientId Client ID - @return ApiReadClientRequest -*/ -func (a *DefaultApiService) ReadClient(ctx context.Context, clientId string) ApiReadClientRequest { - return ApiReadClientRequest{ - ApiService: a, - ctx: ctx, - clientId: clientId, - } -} - -// Execute executes the request -// @return ReadClientResponse -func (a *DefaultApiService) ReadClientExecute(r ApiReadClientRequest) (*ReadClientResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ReadClientResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ReadClient") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/clients/{clientId}" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) - - 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, formFiles) - 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 ApiReadScopeRequest struct { - ctx context.Context - ApiService *DefaultApiService - scopeId string -} - -func (r ApiReadScopeRequest) Execute() (*CreateScopeResponse, *http.Response, error) { - return r.ApiService.ReadScopeExecute(r) -} - -/* -ReadScope Read scope - -Read scope - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param scopeId Scope ID - @return ApiReadScopeRequest -*/ -func (a *DefaultApiService) ReadScope(ctx context.Context, scopeId string) ApiReadScopeRequest { - return ApiReadScopeRequest{ - ApiService: a, - ctx: ctx, - scopeId: scopeId, - } -} - -// Execute executes the request -// @return CreateScopeResponse -func (a *DefaultApiService) ReadScopeExecute(r ApiReadScopeRequest) (*CreateScopeResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *CreateScopeResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ReadScope") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/scopes/{scopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) - - 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, formFiles) - 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 ApiReadUserRequest struct { - ctx context.Context - ApiService *DefaultApiService - userId string -} - -func (r ApiReadUserRequest) Execute() (*ReadUserResponse, *http.Response, error) { - return r.ApiService.ReadUserExecute(r) -} - -/* -ReadUser Read user - -Read user - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param userId User ID - @return ApiReadUserRequest -*/ -func (a *DefaultApiService) ReadUser(ctx context.Context, userId string) ApiReadUserRequest { - return ApiReadUserRequest{ - ApiService: a, - ctx: ctx, - userId: userId, - } -} - -// Execute executes the request -// @return ReadUserResponse -func (a *DefaultApiService) ReadUserExecute(r ApiReadUserRequest) (*ReadUserResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *ReadUserResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ReadUser") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/users/{userId}" - localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterToString(r.userId, "")), -1) - - 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, formFiles) - 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 ApiUpdateClientRequest struct { - ctx context.Context - ApiService *DefaultApiService - clientId string - body *ClientOptions -} - -func (r ApiUpdateClientRequest) Body(body ClientOptions) ApiUpdateClientRequest { - r.body = &body - return r -} - -func (r ApiUpdateClientRequest) Execute() (*CreateClientResponse, *http.Response, error) { - return r.ApiService.UpdateClientExecute(r) -} - -/* -UpdateClient Update client - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param clientId Client ID - @return ApiUpdateClientRequest -*/ -func (a *DefaultApiService) UpdateClient(ctx context.Context, clientId string) ApiUpdateClientRequest { - return ApiUpdateClientRequest{ - ApiService: a, - ctx: ctx, - clientId: clientId, - } -} - -// Execute executes the request -// @return CreateClientResponse -func (a *DefaultApiService) UpdateClientExecute(r ApiUpdateClientRequest) (*CreateClientResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *CreateClientResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateClient") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/clients/{clientId}" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) - - 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.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - 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 ApiUpdateScopeRequest struct { - ctx context.Context - ApiService *DefaultApiService - scopeId string - body *ScopeOptions -} - -func (r ApiUpdateScopeRequest) Body(body ScopeOptions) ApiUpdateScopeRequest { - r.body = &body - return r -} - -func (r ApiUpdateScopeRequest) Execute() (*CreateScopeResponse, *http.Response, error) { - return r.ApiService.UpdateScopeExecute(r) -} - -/* -UpdateScope Update scope - -Update scope - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param scopeId Scope ID - @return ApiUpdateScopeRequest -*/ -func (a *DefaultApiService) UpdateScope(ctx context.Context, scopeId string) ApiUpdateScopeRequest { - return ApiUpdateScopeRequest{ - ApiService: a, - ctx: ctx, - scopeId: scopeId, - } -} - -// Execute executes the request -// @return CreateScopeResponse -func (a *DefaultApiService) UpdateScopeExecute(r ApiUpdateScopeRequest) (*CreateScopeResponse, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *CreateScopeResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateScope") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/scopes/{scopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) - - 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.body - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - 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 -} diff --git a/authclient/api_scopes.go b/authclient/api_scopes.go new file mode 100644 index 0000000..9af5173 --- /dev/null +++ b/authclient/api_scopes.go @@ -0,0 +1,728 @@ +/* +Auth API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: AUTH_VERSION +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authclient + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// ScopesApiService ScopesApi service +type ScopesApiService service + +type ApiAddTransientScopeRequest struct { + ctx context.Context + ApiService *ScopesApiService + scopeId interface{} + transientScopeId interface{} +} + +func (r ApiAddTransientScopeRequest) Execute() (*http.Response, error) { + return r.ApiService.AddTransientScopeExecute(r) +} + +/* +AddTransientScope Add a transient scope to a scope + +Add a transient scope to a scope + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param scopeId Scope ID + @param transientScopeId Transient scope ID + @return ApiAddTransientScopeRequest +*/ +func (a *ScopesApiService) AddTransientScope(ctx context.Context, scopeId interface{}, transientScopeId interface{}) ApiAddTransientScopeRequest { + return ApiAddTransientScopeRequest{ + ApiService: a, + ctx: ctx, + scopeId: scopeId, + transientScopeId: transientScopeId, + } +} + +// Execute executes the request +func (a *ScopesApiService) AddTransientScopeExecute(r ApiAddTransientScopeRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScopesApiService.AddTransientScope") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/scopes/{scopeId}/transient/{transientScopeId}" + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"transientScopeId"+"}", url.PathEscape(parameterToString(r.transientScopeId, "")), -1) + + 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + 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, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiCreateScopeRequest struct { + ctx context.Context + ApiService *ScopesApiService + body *ScopeOptions +} + +func (r ApiCreateScopeRequest) Body(body ScopeOptions) ApiCreateScopeRequest { + r.body = &body + return r +} + +func (r ApiCreateScopeRequest) Execute() (*CreateScopeResponse, *http.Response, error) { + return r.ApiService.CreateScopeExecute(r) +} + +/* +CreateScope Create scope + +Create scope + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateScopeRequest +*/ +func (a *ScopesApiService) CreateScope(ctx context.Context) ApiCreateScopeRequest { + return ApiCreateScopeRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return CreateScopeResponse +func (a *ScopesApiService) CreateScopeExecute(r ApiCreateScopeRequest) (*CreateScopeResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateScopeResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScopesApiService.CreateScope") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/scopes" + + 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + 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 ApiDeleteScopeRequest struct { + ctx context.Context + ApiService *ScopesApiService + scopeId interface{} +} + +func (r ApiDeleteScopeRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteScopeExecute(r) +} + +/* +DeleteScope Delete scope + +Delete scope + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param scopeId Scope ID + @return ApiDeleteScopeRequest +*/ +func (a *ScopesApiService) DeleteScope(ctx context.Context, scopeId interface{}) ApiDeleteScopeRequest { + return ApiDeleteScopeRequest{ + ApiService: a, + ctx: ctx, + scopeId: scopeId, + } +} + +// Execute executes the request +func (a *ScopesApiService) DeleteScopeExecute(r ApiDeleteScopeRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScopesApiService.DeleteScope") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/scopes/{scopeId}" + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) + + 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + 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, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiDeleteTransientScopeRequest struct { + ctx context.Context + ApiService *ScopesApiService + scopeId interface{} + transientScopeId interface{} +} + +func (r ApiDeleteTransientScopeRequest) Execute() (*http.Response, error) { + return r.ApiService.DeleteTransientScopeExecute(r) +} + +/* +DeleteTransientScope Delete a transient scope from a scope + +Delete a transient scope from a scope + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param scopeId Scope ID + @param transientScopeId Transient scope ID + @return ApiDeleteTransientScopeRequest +*/ +func (a *ScopesApiService) DeleteTransientScope(ctx context.Context, scopeId interface{}, transientScopeId interface{}) ApiDeleteTransientScopeRequest { + return ApiDeleteTransientScopeRequest{ + ApiService: a, + ctx: ctx, + scopeId: scopeId, + transientScopeId: transientScopeId, + } +} + +// Execute executes the request +func (a *ScopesApiService) DeleteTransientScopeExecute(r ApiDeleteTransientScopeRequest) (*http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScopesApiService.DeleteTransientScope") + if err != nil { + return nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/scopes/{scopeId}/transient/{transientScopeId}" + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"transientScopeId"+"}", url.PathEscape(parameterToString(r.transientScopeId, "")), -1) + + 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{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + 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, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +type ApiListScopesRequest struct { + ctx context.Context + ApiService *ScopesApiService +} + +func (r ApiListScopesRequest) Execute() (*ListScopesResponse, *http.Response, error) { + return r.ApiService.ListScopesExecute(r) +} + +/* +ListScopes List scopes + +List Scopes + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListScopesRequest +*/ +func (a *ScopesApiService) ListScopes(ctx context.Context) ApiListScopesRequest { + return ApiListScopesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListScopesResponse +func (a *ScopesApiService) ListScopesExecute(r ApiListScopesRequest) (*ListScopesResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListScopesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScopesApiService.ListScopes") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/scopes" + + 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, formFiles) + 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 ApiReadScopeRequest struct { + ctx context.Context + ApiService *ScopesApiService + scopeId interface{} +} + +func (r ApiReadScopeRequest) Execute() (*CreateScopeResponse, *http.Response, error) { + return r.ApiService.ReadScopeExecute(r) +} + +/* +ReadScope Read scope + +Read scope + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param scopeId Scope ID + @return ApiReadScopeRequest +*/ +func (a *ScopesApiService) ReadScope(ctx context.Context, scopeId interface{}) ApiReadScopeRequest { + return ApiReadScopeRequest{ + ApiService: a, + ctx: ctx, + scopeId: scopeId, + } +} + +// Execute executes the request +// @return CreateScopeResponse +func (a *ScopesApiService) ReadScopeExecute(r ApiReadScopeRequest) (*CreateScopeResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateScopeResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScopesApiService.ReadScope") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/scopes/{scopeId}" + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) + + 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, formFiles) + 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 ApiUpdateScopeRequest struct { + ctx context.Context + ApiService *ScopesApiService + scopeId interface{} + body *ScopeOptions +} + +func (r ApiUpdateScopeRequest) Body(body ScopeOptions) ApiUpdateScopeRequest { + r.body = &body + return r +} + +func (r ApiUpdateScopeRequest) Execute() (*CreateScopeResponse, *http.Response, error) { + return r.ApiService.UpdateScopeExecute(r) +} + +/* +UpdateScope Update scope + +Update scope + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param scopeId Scope ID + @return ApiUpdateScopeRequest +*/ +func (a *ScopesApiService) UpdateScope(ctx context.Context, scopeId interface{}) ApiUpdateScopeRequest { + return ApiUpdateScopeRequest{ + ApiService: a, + ctx: ctx, + scopeId: scopeId, + } +} + +// Execute executes the request +// @return CreateScopeResponse +func (a *ScopesApiService) UpdateScopeExecute(r ApiUpdateScopeRequest) (*CreateScopeResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateScopeResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ScopesApiService.UpdateScope") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/scopes/{scopeId}" + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) + + 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.body + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + 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 +} diff --git a/authclient/api_users.go b/authclient/api_users.go new file mode 100644 index 0000000..f523171 --- /dev/null +++ b/authclient/api_users.go @@ -0,0 +1,226 @@ +/* +Auth API + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +API version: AUTH_VERSION +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package authclient + +import ( + "bytes" + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + + +// UsersApiService UsersApi service +type UsersApiService service + +type ApiListUsersRequest struct { + ctx context.Context + ApiService *UsersApiService +} + +func (r ApiListUsersRequest) Execute() (*ListUsersResponse, *http.Response, error) { + return r.ApiService.ListUsersExecute(r) +} + +/* +ListUsers List users + +List users + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListUsersRequest +*/ +func (a *UsersApiService) ListUsers(ctx context.Context) ApiListUsersRequest { + return ApiListUsersRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// @return ListUsersResponse +func (a *UsersApiService) ListUsersExecute(r ApiListUsersRequest) (*ListUsersResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListUsersResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.ListUsers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users" + + 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, formFiles) + 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 ApiReadUserRequest struct { + ctx context.Context + ApiService *UsersApiService + userId interface{} +} + +func (r ApiReadUserRequest) Execute() (*ReadUserResponse, *http.Response, error) { + return r.ApiService.ReadUserExecute(r) +} + +/* +ReadUser Read user + +Read user + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param userId User ID + @return ApiReadUserRequest +*/ +func (a *UsersApiService) ReadUser(ctx context.Context, userId interface{}) ApiReadUserRequest { + return ApiReadUserRequest{ + ApiService: a, + ctx: ctx, + userId: userId, + } +} + +// Execute executes the request +// @return ReadUserResponse +func (a *UsersApiService) ReadUserExecute(r ApiReadUserRequest) (*ReadUserResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ReadUserResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "UsersApiService.ReadUser") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/users/{userId}" + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterToString(r.userId, "")), -1) + + 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, formFiles) + 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 +} diff --git a/authclient/client.go b/authclient/client.go index 19ad4f4..95d321c 100644 --- a/authclient/client.go +++ b/authclient/client.go @@ -49,7 +49,11 @@ type APIClient struct { // API Services - DefaultApi *DefaultApiService + ClientsApi *ClientsApiService + + ScopesApi *ScopesApiService + + UsersApi *UsersApiService } type service struct { @@ -68,7 +72,9 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.common.client = c // API Services - c.DefaultApi = (*DefaultApiService)(&c.common) + c.ClientsApi = (*ClientsApiService)(&c.common) + c.ScopesApi = (*ScopesApiService)(&c.common) + c.UsersApi = (*UsersApiService)(&c.common) return c } @@ -120,7 +126,7 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { // 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 fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) } return nil } @@ -459,7 +465,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e } if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) + err = fmt.Errorf("invalid body type %s\n", contentType) return nil, err } return bodyBuf, nil @@ -561,3 +567,23 @@ func (e GenericOpenAPIError) Body() []byte { func (e GenericOpenAPIError) Model() interface{} { return e.model } + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + + str := "" + metaValue := reflect.ValueOf(v).Elem() + + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + + // status title (detail) + return fmt.Sprintf("%s %s", status, str) +} diff --git a/authclient/configuration.go b/authclient/configuration.go index dc7766d..963c5ab 100644 --- a/authclient/configuration.go +++ b/authclient/configuration.go @@ -105,14 +105,8 @@ func NewConfiguration() *Configuration { Debug: false, Servers: ServerConfigurations{ { - URL: "https://{organization}.o.formance.cloud/auth", - Description: "Production server", - Variables: map[string]ServerVariable{ - "organization": ServerVariable{ - Description: "The organization on which the auth server is located", - DefaultValue: "", - }, - }, + URL: "", + Description: "No description provided", }, }, OperationServers: map[string]ServerConfigurations{ @@ -129,7 +123,7 @@ func (c *Configuration) AddDefaultHeader(key string, value string) { // 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) + return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1) } server := sc[index] url := server.URL @@ -144,7 +138,7 @@ func (sc ServerConfigurations) URL(index int, variables map[string]string) (stri } } if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) + 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 { diff --git a/authclient/docs/Client.md b/authclient/docs/Client.md deleted file mode 100644 index b1d551a..0000000 --- a/authclient/docs/Client.md +++ /dev/null @@ -1,280 +0,0 @@ -# Client - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Public** | Pointer to **bool** | | [optional] -**RedirectUris** | Pointer to **[]string** | | [optional] -**Description** | Pointer to **string** | | [optional] -**Name** | **string** | | -**Trusted** | Pointer to **bool** | | [optional] -**PostLogoutRedirectUris** | Pointer to **[]string** | | [optional] -**Metadata** | Pointer to **map[string]string** | | [optional] -**Id** | **string** | | -**Scopes** | Pointer to **[]string** | | [optional] -**Secrets** | Pointer to [**[]ClientSecret**](ClientSecret.md) | | [optional] - -## Methods - -### NewClient - -`func NewClient(name string, id string, ) *Client` - -NewClient instantiates a new Client 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 - -### NewClientWithDefaults - -`func NewClientWithDefaults() *Client` - -NewClientWithDefaults instantiates a new Client 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 - -### GetPublic - -`func (o *Client) GetPublic() bool` - -GetPublic returns the Public field if non-nil, zero value otherwise. - -### GetPublicOk - -`func (o *Client) GetPublicOk() (*bool, bool)` - -GetPublicOk returns a tuple with the Public field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPublic - -`func (o *Client) SetPublic(v bool)` - -SetPublic sets Public field to given value. - -### HasPublic - -`func (o *Client) HasPublic() bool` - -HasPublic returns a boolean if a field has been set. - -### GetRedirectUris - -`func (o *Client) GetRedirectUris() []string` - -GetRedirectUris returns the RedirectUris field if non-nil, zero value otherwise. - -### GetRedirectUrisOk - -`func (o *Client) GetRedirectUrisOk() (*[]string, bool)` - -GetRedirectUrisOk returns a tuple with the RedirectUris field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetRedirectUris - -`func (o *Client) SetRedirectUris(v []string)` - -SetRedirectUris sets RedirectUris field to given value. - -### HasRedirectUris - -`func (o *Client) HasRedirectUris() bool` - -HasRedirectUris returns a boolean if a field has been set. - -### GetDescription - -`func (o *Client) GetDescription() string` - -GetDescription returns the Description field if non-nil, zero value otherwise. - -### GetDescriptionOk - -`func (o *Client) GetDescriptionOk() (*string, bool)` - -GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetDescription - -`func (o *Client) SetDescription(v string)` - -SetDescription sets Description field to given value. - -### HasDescription - -`func (o *Client) HasDescription() bool` - -HasDescription returns a boolean if a field has been set. - -### GetName - -`func (o *Client) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Client) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Client) SetName(v string)` - -SetName sets Name field to given value. - - -### GetTrusted - -`func (o *Client) GetTrusted() bool` - -GetTrusted returns the Trusted field if non-nil, zero value otherwise. - -### GetTrustedOk - -`func (o *Client) GetTrustedOk() (*bool, bool)` - -GetTrustedOk returns a tuple with the Trusted field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTrusted - -`func (o *Client) SetTrusted(v bool)` - -SetTrusted sets Trusted field to given value. - -### HasTrusted - -`func (o *Client) HasTrusted() bool` - -HasTrusted returns a boolean if a field has been set. - -### GetPostLogoutRedirectUris - -`func (o *Client) GetPostLogoutRedirectUris() []string` - -GetPostLogoutRedirectUris returns the PostLogoutRedirectUris field if non-nil, zero value otherwise. - -### GetPostLogoutRedirectUrisOk - -`func (o *Client) GetPostLogoutRedirectUrisOk() (*[]string, bool)` - -GetPostLogoutRedirectUrisOk returns a tuple with the PostLogoutRedirectUris field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetPostLogoutRedirectUris - -`func (o *Client) SetPostLogoutRedirectUris(v []string)` - -SetPostLogoutRedirectUris sets PostLogoutRedirectUris field to given value. - -### HasPostLogoutRedirectUris - -`func (o *Client) HasPostLogoutRedirectUris() bool` - -HasPostLogoutRedirectUris returns a boolean if a field has been set. - -### GetMetadata - -`func (o *Client) GetMetadata() map[string]string` - -GetMetadata returns the Metadata field if non-nil, zero value otherwise. - -### GetMetadataOk - -`func (o *Client) GetMetadataOk() (*map[string]string, bool)` - -GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMetadata - -`func (o *Client) SetMetadata(v map[string]string)` - -SetMetadata sets Metadata field to given value. - -### HasMetadata - -`func (o *Client) HasMetadata() bool` - -HasMetadata returns a boolean if a field has been set. - -### GetId - -`func (o *Client) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Client) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Client) SetId(v string)` - -SetId sets Id field to given value. - - -### GetScopes - -`func (o *Client) GetScopes() []string` - -GetScopes returns the Scopes field if non-nil, zero value otherwise. - -### GetScopesOk - -`func (o *Client) GetScopesOk() (*[]string, bool)` - -GetScopesOk returns a tuple with the Scopes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetScopes - -`func (o *Client) SetScopes(v []string)` - -SetScopes sets Scopes field to given value. - -### HasScopes - -`func (o *Client) HasScopes() bool` - -HasScopes returns a boolean if a field has been set. - -### GetSecrets - -`func (o *Client) GetSecrets() []ClientSecret` - -GetSecrets returns the Secrets field if non-nil, zero value otherwise. - -### GetSecretsOk - -`func (o *Client) GetSecretsOk() (*[]ClientSecret, bool)` - -GetSecretsOk returns a tuple with the Secrets field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSecrets - -`func (o *Client) SetSecrets(v []ClientSecret)` - -SetSecrets sets Secrets field to given value. - -### HasSecrets - -`func (o *Client) HasSecrets() bool` - -HasSecrets 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/authclient/docs/ClientAllOf.md b/authclient/docs/ClientAllOf.md deleted file mode 100644 index b038fac..0000000 --- a/authclient/docs/ClientAllOf.md +++ /dev/null @@ -1,103 +0,0 @@ -# ClientAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Scopes** | Pointer to **[]string** | | [optional] -**Secrets** | Pointer to [**[]ClientSecret**](ClientSecret.md) | | [optional] - -## Methods - -### NewClientAllOf - -`func NewClientAllOf(id string, ) *ClientAllOf` - -NewClientAllOf instantiates a new ClientAllOf 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 - -### NewClientAllOfWithDefaults - -`func NewClientAllOfWithDefaults() *ClientAllOf` - -NewClientAllOfWithDefaults instantiates a new ClientAllOf 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 - -### GetId - -`func (o *ClientAllOf) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ClientAllOf) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ClientAllOf) SetId(v string)` - -SetId sets Id field to given value. - - -### GetScopes - -`func (o *ClientAllOf) GetScopes() []string` - -GetScopes returns the Scopes field if non-nil, zero value otherwise. - -### GetScopesOk - -`func (o *ClientAllOf) GetScopesOk() (*[]string, bool)` - -GetScopesOk returns a tuple with the Scopes field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetScopes - -`func (o *ClientAllOf) SetScopes(v []string)` - -SetScopes sets Scopes field to given value. - -### HasScopes - -`func (o *ClientAllOf) HasScopes() bool` - -HasScopes returns a boolean if a field has been set. - -### GetSecrets - -`func (o *ClientAllOf) GetSecrets() []ClientSecret` - -GetSecrets returns the Secrets field if non-nil, zero value otherwise. - -### GetSecretsOk - -`func (o *ClientAllOf) GetSecretsOk() (*[]ClientSecret, bool)` - -GetSecretsOk returns a tuple with the Secrets field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetSecrets - -`func (o *ClientAllOf) SetSecrets(v []ClientSecret)` - -SetSecrets sets Secrets field to given value. - -### HasSecrets - -`func (o *ClientAllOf) HasSecrets() bool` - -HasSecrets 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/authclient/docs/ClientOptions.md b/authclient/docs/ClientOptions.md index 8c9bd83..2fe9c1b 100644 --- a/authclient/docs/ClientOptions.md +++ b/authclient/docs/ClientOptions.md @@ -4,19 +4,19 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Public** | Pointer to **bool** | | [optional] -**RedirectUris** | Pointer to **[]string** | | [optional] -**Description** | Pointer to **string** | | [optional] -**Name** | **string** | | -**Trusted** | Pointer to **bool** | | [optional] -**PostLogoutRedirectUris** | Pointer to **[]string** | | [optional] -**Metadata** | Pointer to **map[string]string** | | [optional] +**Public** | Pointer to **interface{}** | | [optional] +**RedirectUris** | Pointer to **interface{}** | | [optional] +**Description** | Pointer to **interface{}** | | [optional] +**Name** | **interface{}** | | +**Trusted** | Pointer to **interface{}** | | [optional] +**PostLogoutRedirectUris** | Pointer to **interface{}** | | [optional] +**Metadata** | Pointer to | | [optional] ## Methods ### NewClientOptions -`func NewClientOptions(name string, ) *ClientOptions` +`func NewClientOptions(name interface{}, ) *ClientOptions` NewClientOptions instantiates a new ClientOptions object This constructor will assign default values to properties that have it defined, @@ -33,20 +33,20 @@ but it doesn't guarantee that properties required by API are set ### GetPublic -`func (o *ClientOptions) GetPublic() bool` +`func (o *ClientOptions) GetPublic() interface{}` GetPublic returns the Public field if non-nil, zero value otherwise. ### GetPublicOk -`func (o *ClientOptions) GetPublicOk() (*bool, bool)` +`func (o *ClientOptions) GetPublicOk() (*interface{}, bool)` GetPublicOk returns a tuple with the Public field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPublic -`func (o *ClientOptions) SetPublic(v bool)` +`func (o *ClientOptions) SetPublic(v interface{})` SetPublic sets Public field to given value. @@ -56,22 +56,32 @@ SetPublic sets Public field to given value. HasPublic returns a boolean if a field has been set. +### SetPublicNil + +`func (o *ClientOptions) SetPublicNil(b bool)` + + SetPublicNil sets the value for Public to be an explicit nil + +### UnsetPublic +`func (o *ClientOptions) UnsetPublic()` + +UnsetPublic ensures that no value is present for Public, not even an explicit nil ### GetRedirectUris -`func (o *ClientOptions) GetRedirectUris() []string` +`func (o *ClientOptions) GetRedirectUris() interface{}` GetRedirectUris returns the RedirectUris field if non-nil, zero value otherwise. ### GetRedirectUrisOk -`func (o *ClientOptions) GetRedirectUrisOk() (*[]string, bool)` +`func (o *ClientOptions) GetRedirectUrisOk() (*interface{}, bool)` GetRedirectUrisOk returns a tuple with the RedirectUris field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetRedirectUris -`func (o *ClientOptions) SetRedirectUris(v []string)` +`func (o *ClientOptions) SetRedirectUris(v interface{})` SetRedirectUris sets RedirectUris field to given value. @@ -81,22 +91,32 @@ SetRedirectUris sets RedirectUris field to given value. HasRedirectUris returns a boolean if a field has been set. +### SetRedirectUrisNil + +`func (o *ClientOptions) SetRedirectUrisNil(b bool)` + + SetRedirectUrisNil sets the value for RedirectUris to be an explicit nil + +### UnsetRedirectUris +`func (o *ClientOptions) UnsetRedirectUris()` + +UnsetRedirectUris ensures that no value is present for RedirectUris, not even an explicit nil ### GetDescription -`func (o *ClientOptions) GetDescription() string` +`func (o *ClientOptions) GetDescription() interface{}` GetDescription returns the Description field if non-nil, zero value otherwise. ### GetDescriptionOk -`func (o *ClientOptions) GetDescriptionOk() (*string, bool)` +`func (o *ClientOptions) GetDescriptionOk() (*interface{}, bool)` GetDescriptionOk returns a tuple with the Description field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetDescription -`func (o *ClientOptions) SetDescription(v string)` +`func (o *ClientOptions) SetDescription(v interface{})` SetDescription sets Description field to given value. @@ -106,42 +126,62 @@ SetDescription sets Description field to given value. HasDescription returns a boolean if a field has been set. +### SetDescriptionNil + +`func (o *ClientOptions) SetDescriptionNil(b bool)` + + SetDescriptionNil sets the value for Description to be an explicit nil + +### UnsetDescription +`func (o *ClientOptions) UnsetDescription()` + +UnsetDescription ensures that no value is present for Description, not even an explicit nil ### GetName -`func (o *ClientOptions) GetName() string` +`func (o *ClientOptions) GetName() interface{}` GetName returns the Name field if non-nil, zero value otherwise. ### GetNameOk -`func (o *ClientOptions) GetNameOk() (*string, bool)` +`func (o *ClientOptions) GetNameOk() (*interface{}, bool)` GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetName -`func (o *ClientOptions) SetName(v string)` +`func (o *ClientOptions) SetName(v interface{})` SetName sets Name field to given value. +### SetNameNil + +`func (o *ClientOptions) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *ClientOptions) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil ### GetTrusted -`func (o *ClientOptions) GetTrusted() bool` +`func (o *ClientOptions) GetTrusted() interface{}` GetTrusted returns the Trusted field if non-nil, zero value otherwise. ### GetTrustedOk -`func (o *ClientOptions) GetTrustedOk() (*bool, bool)` +`func (o *ClientOptions) GetTrustedOk() (*interface{}, bool)` GetTrustedOk returns a tuple with the Trusted field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetTrusted -`func (o *ClientOptions) SetTrusted(v bool)` +`func (o *ClientOptions) SetTrusted(v interface{})` SetTrusted sets Trusted field to given value. @@ -151,22 +191,32 @@ SetTrusted sets Trusted field to given value. HasTrusted returns a boolean if a field has been set. +### SetTrustedNil + +`func (o *ClientOptions) SetTrustedNil(b bool)` + + SetTrustedNil sets the value for Trusted to be an explicit nil + +### UnsetTrusted +`func (o *ClientOptions) UnsetTrusted()` + +UnsetTrusted ensures that no value is present for Trusted, not even an explicit nil ### GetPostLogoutRedirectUris -`func (o *ClientOptions) GetPostLogoutRedirectUris() []string` +`func (o *ClientOptions) GetPostLogoutRedirectUris() interface{}` GetPostLogoutRedirectUris returns the PostLogoutRedirectUris field if non-nil, zero value otherwise. ### GetPostLogoutRedirectUrisOk -`func (o *ClientOptions) GetPostLogoutRedirectUrisOk() (*[]string, bool)` +`func (o *ClientOptions) GetPostLogoutRedirectUrisOk() (*interface{}, bool)` GetPostLogoutRedirectUrisOk returns a tuple with the PostLogoutRedirectUris field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetPostLogoutRedirectUris -`func (o *ClientOptions) SetPostLogoutRedirectUris(v []string)` +`func (o *ClientOptions) SetPostLogoutRedirectUris(v interface{})` SetPostLogoutRedirectUris sets PostLogoutRedirectUris field to given value. @@ -176,22 +226,32 @@ SetPostLogoutRedirectUris sets PostLogoutRedirectUris field to given value. HasPostLogoutRedirectUris returns a boolean if a field has been set. +### SetPostLogoutRedirectUrisNil + +`func (o *ClientOptions) SetPostLogoutRedirectUrisNil(b bool)` + + SetPostLogoutRedirectUrisNil sets the value for PostLogoutRedirectUris to be an explicit nil + +### UnsetPostLogoutRedirectUris +`func (o *ClientOptions) UnsetPostLogoutRedirectUris()` + +UnsetPostLogoutRedirectUris ensures that no value is present for PostLogoutRedirectUris, not even an explicit nil ### GetMetadata -`func (o *ClientOptions) GetMetadata() map[string]string` +`func (o *ClientOptions) GetMetadata() map[string]interface{}` GetMetadata returns the Metadata field if non-nil, zero value otherwise. ### GetMetadataOk -`func (o *ClientOptions) GetMetadataOk() (*map[string]string, bool)` +`func (o *ClientOptions) GetMetadataOk() (*map[string]interface{}, bool)` GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMetadata -`func (o *ClientOptions) SetMetadata(v map[string]string)` +`func (o *ClientOptions) SetMetadata(v map[string]interface{})` SetMetadata sets Metadata field to given value. @@ -201,6 +261,16 @@ SetMetadata sets Metadata field to given value. HasMetadata returns a boolean if a field has been set. +### SetMetadataNil + +`func (o *ClientOptions) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *ClientOptions) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil [[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/authclient/docs/ClientSecret.md b/authclient/docs/ClientSecret.md index cbf7480..f10c2e0 100644 --- a/authclient/docs/ClientSecret.md +++ b/authclient/docs/ClientSecret.md @@ -4,16 +4,16 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**LastDigits** | **string** | | -**Name** | **string** | | -**Id** | **string** | | -**Metadata** | Pointer to **map[string]string** | | [optional] +**LastDigits** | **interface{}** | | +**Name** | **interface{}** | | +**Id** | **interface{}** | | +**Metadata** | Pointer to | | [optional] ## Methods ### NewClientSecret -`func NewClientSecret(lastDigits string, name string, id string, ) *ClientSecret` +`func NewClientSecret(lastDigits interface{}, name interface{}, id interface{}, ) *ClientSecret` NewClientSecret instantiates a new ClientSecret object This constructor will assign default values to properties that have it defined, @@ -30,80 +30,110 @@ but it doesn't guarantee that properties required by API are set ### GetLastDigits -`func (o *ClientSecret) GetLastDigits() string` +`func (o *ClientSecret) GetLastDigits() interface{}` GetLastDigits returns the LastDigits field if non-nil, zero value otherwise. ### GetLastDigitsOk -`func (o *ClientSecret) GetLastDigitsOk() (*string, bool)` +`func (o *ClientSecret) GetLastDigitsOk() (*interface{}, bool)` GetLastDigitsOk returns a tuple with the LastDigits field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetLastDigits -`func (o *ClientSecret) SetLastDigits(v string)` +`func (o *ClientSecret) SetLastDigits(v interface{})` SetLastDigits sets LastDigits field to given value. +### SetLastDigitsNil + +`func (o *ClientSecret) SetLastDigitsNil(b bool)` + + SetLastDigitsNil sets the value for LastDigits to be an explicit nil + +### UnsetLastDigits +`func (o *ClientSecret) UnsetLastDigits()` + +UnsetLastDigits ensures that no value is present for LastDigits, not even an explicit nil ### GetName -`func (o *ClientSecret) GetName() string` +`func (o *ClientSecret) GetName() interface{}` GetName returns the Name field if non-nil, zero value otherwise. ### GetNameOk -`func (o *ClientSecret) GetNameOk() (*string, bool)` +`func (o *ClientSecret) GetNameOk() (*interface{}, bool)` GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetName -`func (o *ClientSecret) SetName(v string)` +`func (o *ClientSecret) SetName(v interface{})` SetName sets Name field to given value. +### SetNameNil + +`func (o *ClientSecret) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *ClientSecret) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil ### GetId -`func (o *ClientSecret) GetId() string` +`func (o *ClientSecret) GetId() interface{}` GetId returns the Id field if non-nil, zero value otherwise. ### GetIdOk -`func (o *ClientSecret) GetIdOk() (*string, bool)` +`func (o *ClientSecret) GetIdOk() (*interface{}, bool)` GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetId -`func (o *ClientSecret) SetId(v string)` +`func (o *ClientSecret) SetId(v interface{})` SetId sets Id field to given value. +### SetIdNil + +`func (o *ClientSecret) SetIdNil(b bool)` + + SetIdNil sets the value for Id to be an explicit nil + +### UnsetId +`func (o *ClientSecret) UnsetId()` + +UnsetId ensures that no value is present for Id, not even an explicit nil ### GetMetadata -`func (o *ClientSecret) GetMetadata() map[string]string` +`func (o *ClientSecret) GetMetadata() map[string]interface{}` GetMetadata returns the Metadata field if non-nil, zero value otherwise. ### GetMetadataOk -`func (o *ClientSecret) GetMetadataOk() (*map[string]string, bool)` +`func (o *ClientSecret) GetMetadataOk() (*map[string]interface{}, bool)` GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMetadata -`func (o *ClientSecret) SetMetadata(v map[string]string)` +`func (o *ClientSecret) SetMetadata(v map[string]interface{})` SetMetadata sets Metadata field to given value. @@ -113,6 +143,16 @@ SetMetadata sets Metadata field to given value. HasMetadata returns a boolean if a field has been set. +### SetMetadataNil + +`func (o *ClientSecret) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *ClientSecret) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil [[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/authclient/docs/ClientsApi.md b/authclient/docs/ClientsApi.md new file mode 100644 index 0000000..8c8caff --- /dev/null +++ b/authclient/docs/ClientsApi.md @@ -0,0 +1,621 @@ +# \ClientsApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddScopeToClient**](ClientsApi.md#AddScopeToClient) | **Put** /clients/{clientId}/scopes/{scopeId} | Add scope to client +[**CreateClient**](ClientsApi.md#CreateClient) | **Post** /clients | Create client +[**CreateSecret**](ClientsApi.md#CreateSecret) | **Post** /clients/{clientId}/secrets | Add a secret to a client +[**DeleteClient**](ClientsApi.md#DeleteClient) | **Delete** /clients/{clientId} | Delete client +[**DeleteScopeFromClient**](ClientsApi.md#DeleteScopeFromClient) | **Delete** /clients/{clientId}/scopes/{scopeId} | Delete scope from client +[**DeleteSecret**](ClientsApi.md#DeleteSecret) | **Delete** /clients/{clientId}/secrets/{secretId} | Delete a secret from a client +[**ListClients**](ClientsApi.md#ListClients) | **Get** /clients | List clients +[**ReadClient**](ClientsApi.md#ReadClient) | **Get** /clients/{clientId} | Read client +[**UpdateClient**](ClientsApi.md#UpdateClient) | **Put** /clients/{clientId} | Update client + + + +## AddScopeToClient + +> AddScopeToClient(ctx, clientId, scopeId).Execute() + +Add scope to client + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + clientId := TODO // interface{} | Client ID + scopeId := TODO // interface{} | Scope ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ClientsApi.AddScopeToClient(context.Background(), clientId, scopeId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ClientsApi.AddScopeToClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | [**interface{}**](.md) | Client ID | +**scopeId** | [**interface{}**](.md) | Scope ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAddScopeToClientRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## CreateClient + +> CreateClientResponse CreateClient(ctx).Body(body).Execute() + +Create client + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := ClientOptions(987) // ClientOptions | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ClientsApi.CreateClient(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ClientsApi.CreateClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateClient`: CreateClientResponse + fmt.Fprintf(os.Stdout, "Response from `ClientsApi.CreateClient`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateClientRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **ClientOptions** | | + +### Return type + +[**CreateClientResponse**](CreateClientResponse.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) + + +## CreateSecret + +> CreateSecretResponse CreateSecret(ctx, clientId).Body(body).Execute() + +Add a secret to a client + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + clientId := TODO // interface{} | Client ID + body := SecretOptions(987) // SecretOptions | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ClientsApi.CreateSecret(context.Background(), clientId).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ClientsApi.CreateSecret``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateSecret`: CreateSecretResponse + fmt.Fprintf(os.Stdout, "Response from `ClientsApi.CreateSecret`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | [**interface{}**](.md) | Client ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateSecretRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **SecretOptions** | | + +### Return type + +[**CreateSecretResponse**](CreateSecretResponse.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) + + +## DeleteClient + +> DeleteClient(ctx, clientId).Execute() + +Delete client + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + clientId := TODO // interface{} | Client ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ClientsApi.DeleteClient(context.Background(), clientId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ClientsApi.DeleteClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | [**interface{}**](.md) | Client ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteClientRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## DeleteScopeFromClient + +> DeleteScopeFromClient(ctx, clientId, scopeId).Execute() + +Delete scope from client + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + clientId := TODO // interface{} | Client ID + scopeId := TODO // interface{} | Scope ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ClientsApi.DeleteScopeFromClient(context.Background(), clientId, scopeId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ClientsApi.DeleteScopeFromClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | [**interface{}**](.md) | Client ID | +**scopeId** | [**interface{}**](.md) | Scope ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteScopeFromClientRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## DeleteSecret + +> DeleteSecret(ctx, clientId, secretId).Execute() + +Delete a secret from a client + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + clientId := TODO // interface{} | Client ID + secretId := TODO // interface{} | Secret ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ClientsApi.DeleteSecret(context.Background(), clientId, secretId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ClientsApi.DeleteSecret``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | [**interface{}**](.md) | Client ID | +**secretId** | [**interface{}**](.md) | Secret ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteSecretRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## ListClients + +> ListClientsResponse ListClients(ctx).Execute() + +List clients + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ClientsApi.ListClients(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ClientsApi.ListClients``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListClients`: ListClientsResponse + fmt.Fprintf(os.Stdout, "Response from `ClientsApi.ListClients`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiListClientsRequest struct via the builder pattern + + +### Return type + +[**ListClientsResponse**](ListClientsResponse.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) + + +## ReadClient + +> ReadClientResponse ReadClient(ctx, clientId).Execute() + +Read client + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + clientId := TODO // interface{} | Client ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ClientsApi.ReadClient(context.Background(), clientId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ClientsApi.ReadClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ReadClient`: ReadClientResponse + fmt.Fprintf(os.Stdout, "Response from `ClientsApi.ReadClient`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | [**interface{}**](.md) | Client ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiReadClientRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ReadClientResponse**](ReadClientResponse.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) + + +## UpdateClient + +> CreateClientResponse UpdateClient(ctx, clientId).Body(body).Execute() + +Update client + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + clientId := TODO // interface{} | Client ID + body := ClientOptions(987) // ClientOptions | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ClientsApi.UpdateClient(context.Background(), clientId).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ClientsApi.UpdateClient``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateClient`: CreateClientResponse + fmt.Fprintf(os.Stdout, "Response from `ClientsApi.UpdateClient`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**clientId** | [**interface{}**](.md) | Client ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateClientRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **ClientOptions** | | + +### Return type + +[**CreateClientResponse**](CreateClientResponse.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/authclient/docs/CreateClientResponse.md b/authclient/docs/CreateClientResponse.md index 5a4a8f8..8c31ab5 100644 --- a/authclient/docs/CreateClientResponse.md +++ b/authclient/docs/CreateClientResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Data** | Pointer to [**Client**](Client.md) | | [optional] +**Data** | Pointer to **interface{}** | | [optional] ## Methods @@ -27,20 +27,20 @@ but it doesn't guarantee that properties required by API are set ### GetData -`func (o *CreateClientResponse) GetData() Client` +`func (o *CreateClientResponse) GetData() interface{}` GetData returns the Data field if non-nil, zero value otherwise. ### GetDataOk -`func (o *CreateClientResponse) GetDataOk() (*Client, bool)` +`func (o *CreateClientResponse) GetDataOk() (*interface{}, bool)` GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetData -`func (o *CreateClientResponse) SetData(v Client)` +`func (o *CreateClientResponse) SetData(v interface{})` SetData sets Data field to given value. @@ -50,6 +50,16 @@ SetData sets Data field to given value. HasData returns a boolean if a field has been set. +### SetDataNil + +`func (o *CreateClientResponse) SetDataNil(b bool)` + + SetDataNil sets the value for Data to be an explicit nil + +### UnsetData +`func (o *CreateClientResponse) UnsetData()` + +UnsetData ensures that no value is present for Data, not even an explicit nil [[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/authclient/docs/CreateScopeResponse.md b/authclient/docs/CreateScopeResponse.md index fb6ad23..c254d86 100644 --- a/authclient/docs/CreateScopeResponse.md +++ b/authclient/docs/CreateScopeResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Data** | Pointer to [**Scope**](Scope.md) | | [optional] +**Data** | Pointer to **interface{}** | | [optional] ## Methods @@ -27,20 +27,20 @@ but it doesn't guarantee that properties required by API are set ### GetData -`func (o *CreateScopeResponse) GetData() Scope` +`func (o *CreateScopeResponse) GetData() interface{}` GetData returns the Data field if non-nil, zero value otherwise. ### GetDataOk -`func (o *CreateScopeResponse) GetDataOk() (*Scope, bool)` +`func (o *CreateScopeResponse) GetDataOk() (*interface{}, bool)` GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetData -`func (o *CreateScopeResponse) SetData(v Scope)` +`func (o *CreateScopeResponse) SetData(v interface{})` SetData sets Data field to given value. @@ -50,6 +50,16 @@ SetData sets Data field to given value. HasData returns a boolean if a field has been set. +### SetDataNil + +`func (o *CreateScopeResponse) SetDataNil(b bool)` + + SetDataNil sets the value for Data to be an explicit nil + +### UnsetData +`func (o *CreateScopeResponse) UnsetData()` + +UnsetData ensures that no value is present for Data, not even an explicit nil [[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/authclient/docs/CreateSecretResponse.md b/authclient/docs/CreateSecretResponse.md index 4141639..fc0ffd7 100644 --- a/authclient/docs/CreateSecretResponse.md +++ b/authclient/docs/CreateSecretResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Data** | Pointer to [**Secret**](Secret.md) | | [optional] +**Data** | Pointer to **interface{}** | | [optional] ## Methods @@ -27,20 +27,20 @@ but it doesn't guarantee that properties required by API are set ### GetData -`func (o *CreateSecretResponse) GetData() Secret` +`func (o *CreateSecretResponse) GetData() interface{}` GetData returns the Data field if non-nil, zero value otherwise. ### GetDataOk -`func (o *CreateSecretResponse) GetDataOk() (*Secret, bool)` +`func (o *CreateSecretResponse) GetDataOk() (*interface{}, bool)` GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetData -`func (o *CreateSecretResponse) SetData(v Secret)` +`func (o *CreateSecretResponse) SetData(v interface{})` SetData sets Data field to given value. @@ -50,6 +50,16 @@ SetData sets Data field to given value. HasData returns a boolean if a field has been set. +### SetDataNil + +`func (o *CreateSecretResponse) SetDataNil(b bool)` + + SetDataNil sets the value for Data to be an explicit nil + +### UnsetData +`func (o *CreateSecretResponse) UnsetData()` + +UnsetData ensures that no value is present for Data, not even an explicit nil [[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/authclient/docs/DefaultApi.md b/authclient/docs/DefaultApi.md deleted file mode 100644 index fdd1170..0000000 --- a/authclient/docs/DefaultApi.md +++ /dev/null @@ -1,1240 +0,0 @@ -# \DefaultApi - -All URIs are relative to *https://.o.formance.cloud/auth* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**AddScopeToClient**](DefaultApi.md#AddScopeToClient) | **Put** /clients/{clientId}/scopes/{scopeId} | Add scope to client -[**AddTransientScope**](DefaultApi.md#AddTransientScope) | **Put** /scopes/{scopeId}/transient/{transientScopeId} | Add a transient scope to a scope -[**CreateClient**](DefaultApi.md#CreateClient) | **Post** /clients | Create client -[**CreateScope**](DefaultApi.md#CreateScope) | **Post** /scopes | Create scope -[**CreateSecret**](DefaultApi.md#CreateSecret) | **Post** /clients/{clientId}/secrets | Add a secret to a client -[**DeleteClient**](DefaultApi.md#DeleteClient) | **Delete** /clients/{clientId} | Delete client -[**DeleteScope**](DefaultApi.md#DeleteScope) | **Delete** /scopes/{scopeId} | Delete scope -[**DeleteScopeFromClient**](DefaultApi.md#DeleteScopeFromClient) | **Delete** /clients/{clientId}/scopes/{scopeId} | Delete scope from client -[**DeleteSecret**](DefaultApi.md#DeleteSecret) | **Delete** /clients/{clientId}/secrets/{secretId} | Delete a secret from a client -[**DeleteTransientScope**](DefaultApi.md#DeleteTransientScope) | **Delete** /scopes/{scopeId}/transient/{transientScopeId} | Delete a transient scope from a scope -[**ListClients**](DefaultApi.md#ListClients) | **Get** /clients | List clients -[**ListScopes**](DefaultApi.md#ListScopes) | **Get** /scopes | List scopes -[**ListUsers**](DefaultApi.md#ListUsers) | **Get** /users | List users -[**ReadClient**](DefaultApi.md#ReadClient) | **Get** /clients/{clientId} | Read client -[**ReadScope**](DefaultApi.md#ReadScope) | **Get** /scopes/{scopeId} | Read scope -[**ReadUser**](DefaultApi.md#ReadUser) | **Get** /users/{userId} | Read user -[**UpdateClient**](DefaultApi.md#UpdateClient) | **Put** /clients/{clientId} | Update client -[**UpdateScope**](DefaultApi.md#UpdateScope) | **Put** /scopes/{scopeId} | Update scope - - - -## AddScopeToClient - -> AddScopeToClient(ctx, clientId, scopeId).Execute() - -Add scope to client - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - clientId := "clientId_example" // string | Client ID - scopeId := "scopeId_example" // string | Scope ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.AddScopeToClient(context.Background(), clientId, scopeId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.AddScopeToClient``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**clientId** | **string** | Client ID | -**scopeId** | **string** | Scope ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAddScopeToClientRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## AddTransientScope - -> AddTransientScope(ctx, scopeId, transientScopeId).Execute() - -Add a transient scope to a scope - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - scopeId := "scopeId_example" // string | Scope ID - transientScopeId := "transientScopeId_example" // string | Transient scope ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.AddTransientScope(context.Background(), scopeId, transientScopeId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.AddTransientScope``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**scopeId** | **string** | Scope ID | -**transientScopeId** | **string** | Transient scope ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiAddTransientScopeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## CreateClient - -> CreateClientResponse CreateClient(ctx).Body(body).Execute() - -Create client - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := ClientOptions(987) // ClientOptions | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.CreateClient(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateClient``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `CreateClient`: CreateClientResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateClient`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateClientRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **ClientOptions** | | - -### Return type - -[**CreateClientResponse**](CreateClientResponse.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) - - -## CreateScope - -> CreateScopeResponse CreateScope(ctx).Body(body).Execute() - -Create scope - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - body := ScopeOptions(987) // ScopeOptions | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.CreateScope(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateScope``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `CreateScope`: CreateScopeResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateScope`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateScopeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **ScopeOptions** | | - -### Return type - -[**CreateScopeResponse**](CreateScopeResponse.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) - - -## CreateSecret - -> CreateSecretResponse CreateSecret(ctx, clientId).Body(body).Execute() - -Add a secret to a client - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - clientId := "clientId_example" // string | Client ID - body := SecretOptions(987) // SecretOptions | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.CreateSecret(context.Background(), clientId).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.CreateSecret``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `CreateSecret`: CreateSecretResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.CreateSecret`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**clientId** | **string** | Client ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiCreateSecretRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **body** | **SecretOptions** | | - -### Return type - -[**CreateSecretResponse**](CreateSecretResponse.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) - - -## DeleteClient - -> DeleteClient(ctx, clientId).Execute() - -Delete client - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - clientId := "clientId_example" // string | Client ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.DeleteClient(context.Background(), clientId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteClient``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**clientId** | **string** | Client ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDeleteClientRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## DeleteScope - -> DeleteScope(ctx, scopeId).Execute() - -Delete scope - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - scopeId := "scopeId_example" // string | Scope ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.DeleteScope(context.Background(), scopeId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteScope``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**scopeId** | **string** | Scope ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDeleteScopeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## DeleteScopeFromClient - -> DeleteScopeFromClient(ctx, clientId, scopeId).Execute() - -Delete scope from client - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - clientId := "clientId_example" // string | Client ID - scopeId := "scopeId_example" // string | Scope ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.DeleteScopeFromClient(context.Background(), clientId, scopeId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteScopeFromClient``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**clientId** | **string** | Client ID | -**scopeId** | **string** | Scope ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDeleteScopeFromClientRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## DeleteSecret - -> DeleteSecret(ctx, clientId, secretId).Execute() - -Delete a secret from a client - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - clientId := "clientId_example" // string | Client ID - secretId := "secretId_example" // string | Secret ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.DeleteSecret(context.Background(), clientId, secretId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteSecret``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**clientId** | **string** | Client ID | -**secretId** | **string** | Secret ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDeleteSecretRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## DeleteTransientScope - -> DeleteTransientScope(ctx, scopeId, transientScopeId).Execute() - -Delete a transient scope from a scope - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - scopeId := "scopeId_example" // string | Scope ID - transientScopeId := "transientScopeId_example" // string | Transient scope ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.DeleteTransientScope(context.Background(), scopeId, transientScopeId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.DeleteTransientScope``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**scopeId** | **string** | Scope ID | -**transientScopeId** | **string** | Transient scope ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiDeleteTransientScopeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - -[[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) - - -## ListClients - -> ListClientsResponse ListClients(ctx).Execute() - -List clients - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.ListClients(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ListClients``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ListClients`: ListClientsResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ListClients`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiListClientsRequest struct via the builder pattern - - -### Return type - -[**ListClientsResponse**](ListClientsResponse.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) - - -## ListScopes - -> ListScopesResponse ListScopes(ctx).Execute() - -List scopes - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.ListScopes(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ListScopes``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ListScopes`: ListScopesResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ListScopes`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiListScopesRequest struct via the builder pattern - - -### Return type - -[**ListScopesResponse**](ListScopesResponse.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) - - -## ListUsers - -> ListUsersResponse ListUsers(ctx).Execute() - -List users - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.ListUsers(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ListUsers``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ListUsers`: ListUsersResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ListUsers`: %v\n", resp) -} -``` - -### Path Parameters - -This endpoint does not need any parameter. - -### Other Parameters - -Other parameters are passed through a pointer to a apiListUsersRequest struct via the builder pattern - - -### Return type - -[**ListUsersResponse**](ListUsersResponse.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) - - -## ReadClient - -> ReadClientResponse ReadClient(ctx, clientId).Execute() - -Read client - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - clientId := "clientId_example" // string | Client ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.ReadClient(context.Background(), clientId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ReadClient``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ReadClient`: ReadClientResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ReadClient`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**clientId** | **string** | Client ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiReadClientRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**ReadClientResponse**](ReadClientResponse.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) - - -## ReadScope - -> CreateScopeResponse ReadScope(ctx, scopeId).Execute() - -Read scope - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - scopeId := "scopeId_example" // string | Scope ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.ReadScope(context.Background(), scopeId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ReadScope``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ReadScope`: CreateScopeResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ReadScope`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**scopeId** | **string** | Scope ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiReadScopeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**CreateScopeResponse**](CreateScopeResponse.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) - - -## ReadUser - -> ReadUserResponse ReadUser(ctx, userId).Execute() - -Read user - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - userId := "userId_example" // string | User ID - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.ReadUser(context.Background(), userId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.ReadUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `ReadUser`: ReadUserResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.ReadUser`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**userId** | **string** | User ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiReadUserRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - -### Return type - -[**ReadUserResponse**](ReadUserResponse.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) - - -## UpdateClient - -> CreateClientResponse UpdateClient(ctx, clientId).Body(body).Execute() - -Update client - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - clientId := "clientId_example" // string | Client ID - body := ClientOptions(987) // ClientOptions | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.UpdateClient(context.Background(), clientId).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UpdateClient``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UpdateClient`: CreateClientResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.UpdateClient`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**clientId** | **string** | Client ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiUpdateClientRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **body** | **ClientOptions** | | - -### Return type - -[**CreateClientResponse**](CreateClientResponse.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) - - -## UpdateScope - -> CreateScopeResponse UpdateScope(ctx, scopeId).Body(body).Execute() - -Update scope - - - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - scopeId := "scopeId_example" // string | Scope ID - body := ScopeOptions(987) // ScopeOptions | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultApi.UpdateScope(context.Background(), scopeId).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UpdateScope``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UpdateScope`: CreateScopeResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.UpdateScope`: %v\n", resp) -} -``` - -### Path Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- -**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. -**scopeId** | **string** | Scope ID | - -### Other Parameters - -Other parameters are passed through a pointer to a apiUpdateScopeRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - - **body** | **ScopeOptions** | | - -### Return type - -[**CreateScopeResponse**](CreateScopeResponse.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/authclient/docs/ListClientsResponse.md b/authclient/docs/ListClientsResponse.md index 251b5a8..caa1ca6 100644 --- a/authclient/docs/ListClientsResponse.md +++ b/authclient/docs/ListClientsResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Data** | Pointer to [**[]Client**](Client.md) | | [optional] +**Data** | Pointer to **interface{}** | | [optional] ## Methods @@ -27,20 +27,20 @@ but it doesn't guarantee that properties required by API are set ### GetData -`func (o *ListClientsResponse) GetData() []Client` +`func (o *ListClientsResponse) GetData() interface{}` GetData returns the Data field if non-nil, zero value otherwise. ### GetDataOk -`func (o *ListClientsResponse) GetDataOk() (*[]Client, bool)` +`func (o *ListClientsResponse) GetDataOk() (*interface{}, bool)` GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetData -`func (o *ListClientsResponse) SetData(v []Client)` +`func (o *ListClientsResponse) SetData(v interface{})` SetData sets Data field to given value. @@ -50,6 +50,16 @@ SetData sets Data field to given value. HasData returns a boolean if a field has been set. +### SetDataNil + +`func (o *ListClientsResponse) SetDataNil(b bool)` + + SetDataNil sets the value for Data to be an explicit nil + +### UnsetData +`func (o *ListClientsResponse) UnsetData()` + +UnsetData ensures that no value is present for Data, not even an explicit nil [[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/authclient/docs/ListScopesResponse.md b/authclient/docs/ListScopesResponse.md index fd152d2..c0a48e7 100644 --- a/authclient/docs/ListScopesResponse.md +++ b/authclient/docs/ListScopesResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Data** | Pointer to [**[]Scope**](Scope.md) | | [optional] +**Data** | Pointer to **interface{}** | | [optional] ## Methods @@ -27,20 +27,20 @@ but it doesn't guarantee that properties required by API are set ### GetData -`func (o *ListScopesResponse) GetData() []Scope` +`func (o *ListScopesResponse) GetData() interface{}` GetData returns the Data field if non-nil, zero value otherwise. ### GetDataOk -`func (o *ListScopesResponse) GetDataOk() (*[]Scope, bool)` +`func (o *ListScopesResponse) GetDataOk() (*interface{}, bool)` GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetData -`func (o *ListScopesResponse) SetData(v []Scope)` +`func (o *ListScopesResponse) SetData(v interface{})` SetData sets Data field to given value. @@ -50,6 +50,16 @@ SetData sets Data field to given value. HasData returns a boolean if a field has been set. +### SetDataNil + +`func (o *ListScopesResponse) SetDataNil(b bool)` + + SetDataNil sets the value for Data to be an explicit nil + +### UnsetData +`func (o *ListScopesResponse) UnsetData()` + +UnsetData ensures that no value is present for Data, not even an explicit nil [[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/authclient/docs/ListUsersResponse.md b/authclient/docs/ListUsersResponse.md index be7f16c..abe4c2b 100644 --- a/authclient/docs/ListUsersResponse.md +++ b/authclient/docs/ListUsersResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Data** | Pointer to [**[]User**](User.md) | | [optional] +**Data** | Pointer to **interface{}** | | [optional] ## Methods @@ -27,20 +27,20 @@ but it doesn't guarantee that properties required by API are set ### GetData -`func (o *ListUsersResponse) GetData() []User` +`func (o *ListUsersResponse) GetData() interface{}` GetData returns the Data field if non-nil, zero value otherwise. ### GetDataOk -`func (o *ListUsersResponse) GetDataOk() (*[]User, bool)` +`func (o *ListUsersResponse) GetDataOk() (*interface{}, bool)` GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetData -`func (o *ListUsersResponse) SetData(v []User)` +`func (o *ListUsersResponse) SetData(v interface{})` SetData sets Data field to given value. @@ -50,6 +50,16 @@ SetData sets Data field to given value. HasData returns a boolean if a field has been set. +### SetDataNil + +`func (o *ListUsersResponse) SetDataNil(b bool)` + + SetDataNil sets the value for Data to be an explicit nil + +### UnsetData +`func (o *ListUsersResponse) UnsetData()` + +UnsetData ensures that no value is present for Data, not even an explicit nil [[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/authclient/docs/ReadClientResponse.md b/authclient/docs/ReadClientResponse.md index ae5af99..7886d30 100644 --- a/authclient/docs/ReadClientResponse.md +++ b/authclient/docs/ReadClientResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Data** | Pointer to [**Client**](Client.md) | | [optional] +**Data** | Pointer to **interface{}** | | [optional] ## Methods @@ -27,20 +27,20 @@ but it doesn't guarantee that properties required by API are set ### GetData -`func (o *ReadClientResponse) GetData() Client` +`func (o *ReadClientResponse) GetData() interface{}` GetData returns the Data field if non-nil, zero value otherwise. ### GetDataOk -`func (o *ReadClientResponse) GetDataOk() (*Client, bool)` +`func (o *ReadClientResponse) GetDataOk() (*interface{}, bool)` GetDataOk returns a tuple with the Data field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetData -`func (o *ReadClientResponse) SetData(v Client)` +`func (o *ReadClientResponse) SetData(v interface{})` SetData sets Data field to given value. @@ -50,6 +50,16 @@ SetData sets Data field to given value. HasData returns a boolean if a field has been set. +### SetDataNil + +`func (o *ReadClientResponse) SetDataNil(b bool)` + + SetDataNil sets the value for Data to be an explicit nil + +### UnsetData +`func (o *ReadClientResponse) UnsetData()` + +UnsetData ensures that no value is present for Data, not even an explicit nil [[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/authclient/docs/Scope.md b/authclient/docs/Scope.md deleted file mode 100644 index 009d51f..0000000 --- a/authclient/docs/Scope.md +++ /dev/null @@ -1,124 +0,0 @@ -# Scope - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Label** | **string** | | -**Metadata** | Pointer to **map[string]string** | | [optional] -**Id** | **string** | | -**Transient** | Pointer to **[]string** | | [optional] - -## Methods - -### NewScope - -`func NewScope(label string, id string, ) *Scope` - -NewScope instantiates a new Scope 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 - -### NewScopeWithDefaults - -`func NewScopeWithDefaults() *Scope` - -NewScopeWithDefaults instantiates a new Scope 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 - -### GetLabel - -`func (o *Scope) GetLabel() string` - -GetLabel returns the Label field if non-nil, zero value otherwise. - -### GetLabelOk - -`func (o *Scope) GetLabelOk() (*string, bool)` - -GetLabelOk returns a tuple with the Label field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLabel - -`func (o *Scope) SetLabel(v string)` - -SetLabel sets Label field to given value. - - -### GetMetadata - -`func (o *Scope) GetMetadata() map[string]string` - -GetMetadata returns the Metadata field if non-nil, zero value otherwise. - -### GetMetadataOk - -`func (o *Scope) GetMetadataOk() (*map[string]string, bool)` - -GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMetadata - -`func (o *Scope) SetMetadata(v map[string]string)` - -SetMetadata sets Metadata field to given value. - -### HasMetadata - -`func (o *Scope) HasMetadata() bool` - -HasMetadata returns a boolean if a field has been set. - -### GetId - -`func (o *Scope) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Scope) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Scope) SetId(v string)` - -SetId sets Id field to given value. - - -### GetTransient - -`func (o *Scope) GetTransient() []string` - -GetTransient returns the Transient field if non-nil, zero value otherwise. - -### GetTransientOk - -`func (o *Scope) GetTransientOk() (*[]string, bool)` - -GetTransientOk returns a tuple with the Transient field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTransient - -`func (o *Scope) SetTransient(v []string)` - -SetTransient sets Transient field to given value. - -### HasTransient - -`func (o *Scope) HasTransient() bool` - -HasTransient 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/authclient/docs/ScopeAllOf.md b/authclient/docs/ScopeAllOf.md deleted file mode 100644 index f3ebb73..0000000 --- a/authclient/docs/ScopeAllOf.md +++ /dev/null @@ -1,77 +0,0 @@ -# ScopeAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**Transient** | Pointer to **[]string** | | [optional] - -## Methods - -### NewScopeAllOf - -`func NewScopeAllOf(id string, ) *ScopeAllOf` - -NewScopeAllOf instantiates a new ScopeAllOf 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 - -### NewScopeAllOfWithDefaults - -`func NewScopeAllOfWithDefaults() *ScopeAllOf` - -NewScopeAllOfWithDefaults instantiates a new ScopeAllOf 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 - -### GetId - -`func (o *ScopeAllOf) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *ScopeAllOf) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *ScopeAllOf) SetId(v string)` - -SetId sets Id field to given value. - - -### GetTransient - -`func (o *ScopeAllOf) GetTransient() []string` - -GetTransient returns the Transient field if non-nil, zero value otherwise. - -### GetTransientOk - -`func (o *ScopeAllOf) GetTransientOk() (*[]string, bool)` - -GetTransientOk returns a tuple with the Transient field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetTransient - -`func (o *ScopeAllOf) SetTransient(v []string)` - -SetTransient sets Transient field to given value. - -### HasTransient - -`func (o *ScopeAllOf) HasTransient() bool` - -HasTransient 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/authclient/docs/ScopeOptions.md b/authclient/docs/ScopeOptions.md index 341d40d..f48abda 100644 --- a/authclient/docs/ScopeOptions.md +++ b/authclient/docs/ScopeOptions.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Label** | **string** | | -**Metadata** | Pointer to **map[string]string** | | [optional] +**Label** | **interface{}** | | +**Metadata** | Pointer to | | [optional] ## Methods ### NewScopeOptions -`func NewScopeOptions(label string, ) *ScopeOptions` +`func NewScopeOptions(label interface{}, ) *ScopeOptions` NewScopeOptions instantiates a new ScopeOptions object This constructor will assign default values to properties that have it defined, @@ -28,40 +28,50 @@ but it doesn't guarantee that properties required by API are set ### GetLabel -`func (o *ScopeOptions) GetLabel() string` +`func (o *ScopeOptions) GetLabel() interface{}` GetLabel returns the Label field if non-nil, zero value otherwise. ### GetLabelOk -`func (o *ScopeOptions) GetLabelOk() (*string, bool)` +`func (o *ScopeOptions) GetLabelOk() (*interface{}, bool)` GetLabelOk returns a tuple with the Label field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetLabel -`func (o *ScopeOptions) SetLabel(v string)` +`func (o *ScopeOptions) SetLabel(v interface{})` SetLabel sets Label field to given value. +### SetLabelNil + +`func (o *ScopeOptions) SetLabelNil(b bool)` + + SetLabelNil sets the value for Label to be an explicit nil + +### UnsetLabel +`func (o *ScopeOptions) UnsetLabel()` + +UnsetLabel ensures that no value is present for Label, not even an explicit nil ### GetMetadata -`func (o *ScopeOptions) GetMetadata() map[string]string` +`func (o *ScopeOptions) GetMetadata() map[string]interface{}` GetMetadata returns the Metadata field if non-nil, zero value otherwise. ### GetMetadataOk -`func (o *ScopeOptions) GetMetadataOk() (*map[string]string, bool)` +`func (o *ScopeOptions) GetMetadataOk() (*map[string]interface{}, bool)` GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMetadata -`func (o *ScopeOptions) SetMetadata(v map[string]string)` +`func (o *ScopeOptions) SetMetadata(v map[string]interface{})` SetMetadata sets Metadata field to given value. @@ -71,6 +81,16 @@ SetMetadata sets Metadata field to given value. HasMetadata returns a boolean if a field has been set. +### SetMetadataNil + +`func (o *ScopeOptions) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *ScopeOptions) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil [[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/authclient/docs/ScopesApi.md b/authclient/docs/ScopesApi.md new file mode 100644 index 0000000..c8a5aed --- /dev/null +++ b/authclient/docs/ScopesApi.md @@ -0,0 +1,494 @@ +# \ScopesApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddTransientScope**](ScopesApi.md#AddTransientScope) | **Put** /scopes/{scopeId}/transient/{transientScopeId} | Add a transient scope to a scope +[**CreateScope**](ScopesApi.md#CreateScope) | **Post** /scopes | Create scope +[**DeleteScope**](ScopesApi.md#DeleteScope) | **Delete** /scopes/{scopeId} | Delete scope +[**DeleteTransientScope**](ScopesApi.md#DeleteTransientScope) | **Delete** /scopes/{scopeId}/transient/{transientScopeId} | Delete a transient scope from a scope +[**ListScopes**](ScopesApi.md#ListScopes) | **Get** /scopes | List scopes +[**ReadScope**](ScopesApi.md#ReadScope) | **Get** /scopes/{scopeId} | Read scope +[**UpdateScope**](ScopesApi.md#UpdateScope) | **Put** /scopes/{scopeId} | Update scope + + + +## AddTransientScope + +> AddTransientScope(ctx, scopeId, transientScopeId).Execute() + +Add a transient scope to a scope + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + scopeId := TODO // interface{} | Scope ID + transientScopeId := TODO // interface{} | Transient scope ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ScopesApi.AddTransientScope(context.Background(), scopeId, transientScopeId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ScopesApi.AddTransientScope``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**scopeId** | [**interface{}**](.md) | Scope ID | +**transientScopeId** | [**interface{}**](.md) | Transient scope ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAddTransientScopeRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## CreateScope + +> CreateScopeResponse CreateScope(ctx).Body(body).Execute() + +Create scope + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + body := ScopeOptions(987) // ScopeOptions | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ScopesApi.CreateScope(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ScopesApi.CreateScope``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateScope`: CreateScopeResponse + fmt.Fprintf(os.Stdout, "Response from `ScopesApi.CreateScope`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateScopeRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **ScopeOptions** | | + +### Return type + +[**CreateScopeResponse**](CreateScopeResponse.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) + + +## DeleteScope + +> DeleteScope(ctx, scopeId).Execute() + +Delete scope + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + scopeId := TODO // interface{} | Scope ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ScopesApi.DeleteScope(context.Background(), scopeId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ScopesApi.DeleteScope``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**scopeId** | [**interface{}**](.md) | Scope ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteScopeRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## DeleteTransientScope + +> DeleteTransientScope(ctx, scopeId, transientScopeId).Execute() + +Delete a transient scope from a scope + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + scopeId := TODO // interface{} | Scope ID + transientScopeId := TODO // interface{} | Transient scope ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ScopesApi.DeleteTransientScope(context.Background(), scopeId, transientScopeId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ScopesApi.DeleteTransientScope``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**scopeId** | [**interface{}**](.md) | Scope ID | +**transientScopeId** | [**interface{}**](.md) | Transient scope ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteTransientScopeRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[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) + + +## ListScopes + +> ListScopesResponse ListScopes(ctx).Execute() + +List scopes + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ScopesApi.ListScopes(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ScopesApi.ListScopes``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListScopes`: ListScopesResponse + fmt.Fprintf(os.Stdout, "Response from `ScopesApi.ListScopes`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiListScopesRequest struct via the builder pattern + + +### Return type + +[**ListScopesResponse**](ListScopesResponse.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) + + +## ReadScope + +> CreateScopeResponse ReadScope(ctx, scopeId).Execute() + +Read scope + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + scopeId := TODO // interface{} | Scope ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ScopesApi.ReadScope(context.Background(), scopeId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ScopesApi.ReadScope``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ReadScope`: CreateScopeResponse + fmt.Fprintf(os.Stdout, "Response from `ScopesApi.ReadScope`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**scopeId** | [**interface{}**](.md) | Scope ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiReadScopeRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**CreateScopeResponse**](CreateScopeResponse.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) + + +## UpdateScope + +> CreateScopeResponse UpdateScope(ctx, scopeId).Body(body).Execute() + +Update scope + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + scopeId := TODO // interface{} | Scope ID + body := ScopeOptions(987) // ScopeOptions | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.ScopesApi.UpdateScope(context.Background(), scopeId).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `ScopesApi.UpdateScope``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateScope`: CreateScopeResponse + fmt.Fprintf(os.Stdout, "Response from `ScopesApi.UpdateScope`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**scopeId** | [**interface{}**](.md) | Scope ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateScopeRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | **ScopeOptions** | | + +### Return type + +[**CreateScopeResponse**](CreateScopeResponse.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/authclient/docs/Secret.md b/authclient/docs/Secret.md deleted file mode 100644 index c0fbc86..0000000 --- a/authclient/docs/Secret.md +++ /dev/null @@ -1,140 +0,0 @@ -# Secret - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | -**Metadata** | Pointer to **map[string]string** | | [optional] -**Id** | **string** | | -**LastDigits** | **string** | | -**Clear** | **string** | | - -## Methods - -### NewSecret - -`func NewSecret(name string, id string, lastDigits string, clear string, ) *Secret` - -NewSecret instantiates a new Secret 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 - -### NewSecretWithDefaults - -`func NewSecretWithDefaults() *Secret` - -NewSecretWithDefaults instantiates a new Secret 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 - -### GetName - -`func (o *Secret) GetName() string` - -GetName returns the Name field if non-nil, zero value otherwise. - -### GetNameOk - -`func (o *Secret) GetNameOk() (*string, bool)` - -GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetName - -`func (o *Secret) SetName(v string)` - -SetName sets Name field to given value. - - -### GetMetadata - -`func (o *Secret) GetMetadata() map[string]string` - -GetMetadata returns the Metadata field if non-nil, zero value otherwise. - -### GetMetadataOk - -`func (o *Secret) GetMetadataOk() (*map[string]string, bool)` - -GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMetadata - -`func (o *Secret) SetMetadata(v map[string]string)` - -SetMetadata sets Metadata field to given value. - -### HasMetadata - -`func (o *Secret) HasMetadata() bool` - -HasMetadata returns a boolean if a field has been set. - -### GetId - -`func (o *Secret) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *Secret) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *Secret) SetId(v string)` - -SetId sets Id field to given value. - - -### GetLastDigits - -`func (o *Secret) GetLastDigits() string` - -GetLastDigits returns the LastDigits field if non-nil, zero value otherwise. - -### GetLastDigitsOk - -`func (o *Secret) GetLastDigitsOk() (*string, bool)` - -GetLastDigitsOk returns a tuple with the LastDigits field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLastDigits - -`func (o *Secret) SetLastDigits(v string)` - -SetLastDigits sets LastDigits field to given value. - - -### GetClear - -`func (o *Secret) GetClear() string` - -GetClear returns the Clear field if non-nil, zero value otherwise. - -### GetClearOk - -`func (o *Secret) GetClearOk() (*string, bool)` - -GetClearOk returns a tuple with the Clear field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClear - -`func (o *Secret) SetClear(v string)` - -SetClear sets Clear 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/authclient/docs/SecretAllOf.md b/authclient/docs/SecretAllOf.md deleted file mode 100644 index 88ff178..0000000 --- a/authclient/docs/SecretAllOf.md +++ /dev/null @@ -1,93 +0,0 @@ -# SecretAllOf - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | -**LastDigits** | **string** | | -**Clear** | **string** | | - -## Methods - -### NewSecretAllOf - -`func NewSecretAllOf(id string, lastDigits string, clear string, ) *SecretAllOf` - -NewSecretAllOf instantiates a new SecretAllOf 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 - -### NewSecretAllOfWithDefaults - -`func NewSecretAllOfWithDefaults() *SecretAllOf` - -NewSecretAllOfWithDefaults instantiates a new SecretAllOf 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 - -### GetId - -`func (o *SecretAllOf) GetId() string` - -GetId returns the Id field if non-nil, zero value otherwise. - -### GetIdOk - -`func (o *SecretAllOf) GetIdOk() (*string, bool)` - -GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetId - -`func (o *SecretAllOf) SetId(v string)` - -SetId sets Id field to given value. - - -### GetLastDigits - -`func (o *SecretAllOf) GetLastDigits() string` - -GetLastDigits returns the LastDigits field if non-nil, zero value otherwise. - -### GetLastDigitsOk - -`func (o *SecretAllOf) GetLastDigitsOk() (*string, bool)` - -GetLastDigitsOk returns a tuple with the LastDigits field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetLastDigits - -`func (o *SecretAllOf) SetLastDigits(v string)` - -SetLastDigits sets LastDigits field to given value. - - -### GetClear - -`func (o *SecretAllOf) GetClear() string` - -GetClear returns the Clear field if non-nil, zero value otherwise. - -### GetClearOk - -`func (o *SecretAllOf) GetClearOk() (*string, bool)` - -GetClearOk returns a tuple with the Clear field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetClear - -`func (o *SecretAllOf) SetClear(v string)` - -SetClear sets Clear 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/authclient/docs/SecretOptions.md b/authclient/docs/SecretOptions.md index 4f2d9fa..ac63d39 100644 --- a/authclient/docs/SecretOptions.md +++ b/authclient/docs/SecretOptions.md @@ -4,14 +4,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | | -**Metadata** | Pointer to **map[string]string** | | [optional] +**Name** | **interface{}** | | +**Metadata** | Pointer to | | [optional] ## Methods ### NewSecretOptions -`func NewSecretOptions(name string, ) *SecretOptions` +`func NewSecretOptions(name interface{}, ) *SecretOptions` NewSecretOptions instantiates a new SecretOptions object This constructor will assign default values to properties that have it defined, @@ -28,40 +28,50 @@ but it doesn't guarantee that properties required by API are set ### GetName -`func (o *SecretOptions) GetName() string` +`func (o *SecretOptions) GetName() interface{}` GetName returns the Name field if non-nil, zero value otherwise. ### GetNameOk -`func (o *SecretOptions) GetNameOk() (*string, bool)` +`func (o *SecretOptions) GetNameOk() (*interface{}, bool)` GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetName -`func (o *SecretOptions) SetName(v string)` +`func (o *SecretOptions) SetName(v interface{})` SetName sets Name field to given value. +### SetNameNil + +`func (o *SecretOptions) SetNameNil(b bool)` + + SetNameNil sets the value for Name to be an explicit nil + +### UnsetName +`func (o *SecretOptions) UnsetName()` + +UnsetName ensures that no value is present for Name, not even an explicit nil ### GetMetadata -`func (o *SecretOptions) GetMetadata() map[string]string` +`func (o *SecretOptions) GetMetadata() map[string]interface{}` GetMetadata returns the Metadata field if non-nil, zero value otherwise. ### GetMetadataOk -`func (o *SecretOptions) GetMetadataOk() (*map[string]string, bool)` +`func (o *SecretOptions) GetMetadataOk() (*map[string]interface{}, bool)` GetMetadataOk returns a tuple with the Metadata field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetMetadata -`func (o *SecretOptions) SetMetadata(v map[string]string)` +`func (o *SecretOptions) SetMetadata(v map[string]interface{})` SetMetadata sets Metadata field to given value. @@ -71,6 +81,16 @@ SetMetadata sets Metadata field to given value. HasMetadata returns a boolean if a field has been set. +### SetMetadataNil + +`func (o *SecretOptions) SetMetadataNil(b bool)` + + SetMetadataNil sets the value for Metadata to be an explicit nil + +### UnsetMetadata +`func (o *SecretOptions) UnsetMetadata()` + +UnsetMetadata ensures that no value is present for Metadata, not even an explicit nil [[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/authclient/docs/User.md b/authclient/docs/User.md index a8a875d..0d84f5f 100644 --- a/authclient/docs/User.md +++ b/authclient/docs/User.md @@ -4,9 +4,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Id** | Pointer to **string** | | [optional] -**Subject** | Pointer to **string** | | [optional] -**Email** | Pointer to **string** | | [optional] +**Id** | Pointer to **interface{}** | | [optional] +**Subject** | Pointer to **interface{}** | | [optional] +**Email** | Pointer to **interface{}** | | [optional] ## Methods @@ -29,20 +29,20 @@ but it doesn't guarantee that properties required by API are set ### GetId -`func (o *User) GetId() string` +`func (o *User) GetId() interface{}` GetId returns the Id field if non-nil, zero value otherwise. ### GetIdOk -`func (o *User) GetIdOk() (*string, bool)` +`func (o *User) GetIdOk() (*interface{}, bool)` GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetId -`func (o *User) SetId(v string)` +`func (o *User) SetId(v interface{})` SetId sets Id field to given value. @@ -52,22 +52,32 @@ SetId sets Id field to given value. HasId returns a boolean if a field has been set. +### SetIdNil + +`func (o *User) SetIdNil(b bool)` + + SetIdNil sets the value for Id to be an explicit nil + +### UnsetId +`func (o *User) UnsetId()` + +UnsetId ensures that no value is present for Id, not even an explicit nil ### GetSubject -`func (o *User) GetSubject() string` +`func (o *User) GetSubject() interface{}` GetSubject returns the Subject field if non-nil, zero value otherwise. ### GetSubjectOk -`func (o *User) GetSubjectOk() (*string, bool)` +`func (o *User) GetSubjectOk() (*interface{}, bool)` GetSubjectOk returns a tuple with the Subject field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetSubject -`func (o *User) SetSubject(v string)` +`func (o *User) SetSubject(v interface{})` SetSubject sets Subject field to given value. @@ -77,22 +87,32 @@ SetSubject sets Subject field to given value. HasSubject returns a boolean if a field has been set. +### SetSubjectNil + +`func (o *User) SetSubjectNil(b bool)` + + SetSubjectNil sets the value for Subject to be an explicit nil + +### UnsetSubject +`func (o *User) UnsetSubject()` + +UnsetSubject ensures that no value is present for Subject, not even an explicit nil ### GetEmail -`func (o *User) GetEmail() string` +`func (o *User) GetEmail() interface{}` GetEmail returns the Email field if non-nil, zero value otherwise. ### GetEmailOk -`func (o *User) GetEmailOk() (*string, bool)` +`func (o *User) GetEmailOk() (*interface{}, bool)` GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### SetEmail -`func (o *User) SetEmail(v string)` +`func (o *User) SetEmail(v interface{})` SetEmail sets Email field to given value. @@ -102,6 +122,16 @@ SetEmail sets Email field to given value. HasEmail returns a boolean if a field has been set. +### SetEmailNil + +`func (o *User) SetEmailNil(b bool)` + + SetEmailNil sets the value for Email to be an explicit nil + +### UnsetEmail +`func (o *User) UnsetEmail()` + +UnsetEmail ensures that no value is present for Email, not even an explicit nil [[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/authclient/docs/UsersApi.md b/authclient/docs/UsersApi.md new file mode 100644 index 0000000..1247edd --- /dev/null +++ b/authclient/docs/UsersApi.md @@ -0,0 +1,141 @@ +# \UsersApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ListUsers**](UsersApi.md#ListUsers) | **Get** /users | List users +[**ReadUser**](UsersApi.md#ReadUser) | **Get** /users/{userId} | Read user + + + +## ListUsers + +> ListUsersResponse ListUsers(ctx).Execute() + +List users + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.ListUsers(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.ListUsers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListUsers`: ListUsersResponse + fmt.Fprintf(os.Stdout, "Response from `UsersApi.ListUsers`: %v\n", resp) +} +``` + +### Path Parameters + +This endpoint does not need any parameter. + +### Other Parameters + +Other parameters are passed through a pointer to a apiListUsersRequest struct via the builder pattern + + +### Return type + +[**ListUsersResponse**](ListUsersResponse.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) + + +## ReadUser + +> ReadUserResponse ReadUser(ctx, userId).Execute() + +Read user + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "./openapi" +) + +func main() { + userId := TODO // interface{} | User ID + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsersApi.ReadUser(context.Background(), userId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.ReadUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ReadUser`: ReadUserResponse + fmt.Fprintf(os.Stdout, "Response from `UsersApi.ReadUser`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**userId** | [**interface{}**](.md) | User ID | + +### Other Parameters + +Other parameters are passed through a pointer to a apiReadUserRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + +### Return type + +[**ReadUserResponse**](ReadUserResponse.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/authclient/model_client.go b/authclient/model_client.go deleted file mode 100644 index 4e8676b..0000000 --- a/authclient/model_client.go +++ /dev/null @@ -1,425 +0,0 @@ -/* -Auth API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -API version: AUTH_VERSION -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package authclient - -import ( - "encoding/json" -) - -// Client struct for Client -type Client struct { - Public *bool `json:"public,omitempty"` - RedirectUris []string `json:"redirectUris,omitempty"` - Description *string `json:"description,omitempty"` - Name string `json:"name"` - Trusted *bool `json:"trusted,omitempty"` - PostLogoutRedirectUris []string `json:"postLogoutRedirectUris,omitempty"` - Metadata *map[string]string `json:"metadata,omitempty"` - Id string `json:"id"` - Scopes []string `json:"scopes,omitempty"` - Secrets []ClientSecret `json:"secrets,omitempty"` -} - -// NewClient instantiates a new Client 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 NewClient(name string, id string) *Client { - this := Client{} - this.Name = name - this.Id = id - return &this -} - -// NewClientWithDefaults instantiates a new Client 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 NewClientWithDefaults() *Client { - this := Client{} - return &this -} - -// GetPublic returns the Public field value if set, zero value otherwise. -func (o *Client) GetPublic() bool { - if o == nil || o.Public == nil { - var ret bool - return ret - } - return *o.Public -} - -// GetPublicOk returns a tuple with the Public field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Client) GetPublicOk() (*bool, bool) { - if o == nil || o.Public == nil { - return nil, false - } - return o.Public, true -} - -// HasPublic returns a boolean if a field has been set. -func (o *Client) HasPublic() bool { - if o != nil && o.Public != nil { - return true - } - - return false -} - -// SetPublic gets a reference to the given bool and assigns it to the Public field. -func (o *Client) SetPublic(v bool) { - o.Public = &v -} - -// GetRedirectUris returns the RedirectUris field value if set, zero value otherwise. -func (o *Client) GetRedirectUris() []string { - if o == nil || o.RedirectUris == nil { - var ret []string - return ret - } - return o.RedirectUris -} - -// GetRedirectUrisOk returns a tuple with the RedirectUris field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Client) GetRedirectUrisOk() ([]string, bool) { - if o == nil || o.RedirectUris == nil { - return nil, false - } - return o.RedirectUris, true -} - -// HasRedirectUris returns a boolean if a field has been set. -func (o *Client) HasRedirectUris() bool { - if o != nil && o.RedirectUris != nil { - return true - } - - return false -} - -// SetRedirectUris gets a reference to the given []string and assigns it to the RedirectUris field. -func (o *Client) SetRedirectUris(v []string) { - o.RedirectUris = v -} - -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *Client) GetDescription() string { - if o == nil || o.Description == nil { - var ret string - return ret - } - return *o.Description -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Client) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { - return nil, false - } - return o.Description, true -} - -// HasDescription returns a boolean if a field has been set. -func (o *Client) HasDescription() bool { - if o != nil && o.Description != nil { - return true - } - - return false -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *Client) SetDescription(v string) { - o.Description = &v -} - -// GetName returns the Name field value -func (o *Client) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Client) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Client) SetName(v string) { - o.Name = v -} - -// GetTrusted returns the Trusted field value if set, zero value otherwise. -func (o *Client) GetTrusted() bool { - if o == nil || o.Trusted == nil { - var ret bool - return ret - } - return *o.Trusted -} - -// GetTrustedOk returns a tuple with the Trusted field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Client) GetTrustedOk() (*bool, bool) { - if o == nil || o.Trusted == nil { - return nil, false - } - return o.Trusted, true -} - -// HasTrusted returns a boolean if a field has been set. -func (o *Client) HasTrusted() bool { - if o != nil && o.Trusted != nil { - return true - } - - return false -} - -// SetTrusted gets a reference to the given bool and assigns it to the Trusted field. -func (o *Client) SetTrusted(v bool) { - o.Trusted = &v -} - -// GetPostLogoutRedirectUris returns the PostLogoutRedirectUris field value if set, zero value otherwise. -func (o *Client) GetPostLogoutRedirectUris() []string { - if o == nil || o.PostLogoutRedirectUris == nil { - var ret []string - return ret - } - return o.PostLogoutRedirectUris -} - -// GetPostLogoutRedirectUrisOk returns a tuple with the PostLogoutRedirectUris field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Client) GetPostLogoutRedirectUrisOk() ([]string, bool) { - if o == nil || o.PostLogoutRedirectUris == nil { - return nil, false - } - return o.PostLogoutRedirectUris, true -} - -// HasPostLogoutRedirectUris returns a boolean if a field has been set. -func (o *Client) HasPostLogoutRedirectUris() bool { - if o != nil && o.PostLogoutRedirectUris != nil { - return true - } - - return false -} - -// SetPostLogoutRedirectUris gets a reference to the given []string and assigns it to the PostLogoutRedirectUris field. -func (o *Client) SetPostLogoutRedirectUris(v []string) { - o.PostLogoutRedirectUris = v -} - -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *Client) GetMetadata() map[string]string { - if o == nil || o.Metadata == nil { - var ret map[string]string - return ret - } - return *o.Metadata -} - -// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Client) GetMetadataOk() (*map[string]string, bool) { - if o == nil || o.Metadata == nil { - return nil, false - } - return o.Metadata, true -} - -// HasMetadata returns a boolean if a field has been set. -func (o *Client) HasMetadata() bool { - if o != nil && o.Metadata != nil { - return true - } - - return false -} - -// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. -func (o *Client) SetMetadata(v map[string]string) { - o.Metadata = &v -} - -// GetId returns the Id field value -func (o *Client) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *Client) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Client) SetId(v string) { - o.Id = v -} - -// GetScopes returns the Scopes field value if set, zero value otherwise. -func (o *Client) GetScopes() []string { - if o == nil || o.Scopes == nil { - var ret []string - return ret - } - return o.Scopes -} - -// GetScopesOk returns a tuple with the Scopes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Client) GetScopesOk() ([]string, bool) { - if o == nil || o.Scopes == nil { - return nil, false - } - return o.Scopes, true -} - -// HasScopes returns a boolean if a field has been set. -func (o *Client) HasScopes() bool { - if o != nil && o.Scopes != nil { - return true - } - - return false -} - -// SetScopes gets a reference to the given []string and assigns it to the Scopes field. -func (o *Client) SetScopes(v []string) { - o.Scopes = v -} - -// GetSecrets returns the Secrets field value if set, zero value otherwise. -func (o *Client) GetSecrets() []ClientSecret { - if o == nil || o.Secrets == nil { - var ret []ClientSecret - return ret - } - return o.Secrets -} - -// GetSecretsOk returns a tuple with the Secrets field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Client) GetSecretsOk() ([]ClientSecret, bool) { - if o == nil || o.Secrets == nil { - return nil, false - } - return o.Secrets, true -} - -// HasSecrets returns a boolean if a field has been set. -func (o *Client) HasSecrets() bool { - if o != nil && o.Secrets != nil { - return true - } - - return false -} - -// SetSecrets gets a reference to the given []ClientSecret and assigns it to the Secrets field. -func (o *Client) SetSecrets(v []ClientSecret) { - o.Secrets = v -} - -func (o Client) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Public != nil { - toSerialize["public"] = o.Public - } - if o.RedirectUris != nil { - toSerialize["redirectUris"] = o.RedirectUris - } - if o.Description != nil { - toSerialize["description"] = o.Description - } - if true { - toSerialize["name"] = o.Name - } - if o.Trusted != nil { - toSerialize["trusted"] = o.Trusted - } - if o.PostLogoutRedirectUris != nil { - toSerialize["postLogoutRedirectUris"] = o.PostLogoutRedirectUris - } - if o.Metadata != nil { - toSerialize["metadata"] = o.Metadata - } - if true { - toSerialize["id"] = o.Id - } - if o.Scopes != nil { - toSerialize["scopes"] = o.Scopes - } - if o.Secrets != nil { - toSerialize["secrets"] = o.Secrets - } - return json.Marshal(toSerialize) -} - -type NullableClient struct { - value *Client - isSet bool -} - -func (v NullableClient) Get() *Client { - return v.value -} - -func (v *NullableClient) Set(val *Client) { - v.value = val - v.isSet = true -} - -func (v NullableClient) IsSet() bool { - return v.isSet -} - -func (v *NullableClient) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableClient(val *Client) *NullableClient { - return &NullableClient{value: val, isSet: true} -} - -func (v NullableClient) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableClient) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/authclient/model_client_all_of.go b/authclient/model_client_all_of.go deleted file mode 100644 index 249d384..0000000 --- a/authclient/model_client_all_of.go +++ /dev/null @@ -1,180 +0,0 @@ -/* -Auth API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -API version: AUTH_VERSION -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package authclient - -import ( - "encoding/json" -) - -// ClientAllOf struct for ClientAllOf -type ClientAllOf struct { - Id string `json:"id"` - Scopes []string `json:"scopes,omitempty"` - Secrets []ClientSecret `json:"secrets,omitempty"` -} - -// NewClientAllOf instantiates a new ClientAllOf 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 NewClientAllOf(id string) *ClientAllOf { - this := ClientAllOf{} - this.Id = id - return &this -} - -// NewClientAllOfWithDefaults instantiates a new ClientAllOf 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 NewClientAllOfWithDefaults() *ClientAllOf { - this := ClientAllOf{} - return &this -} - -// GetId returns the Id field value -func (o *ClientAllOf) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *ClientAllOf) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *ClientAllOf) SetId(v string) { - o.Id = v -} - -// GetScopes returns the Scopes field value if set, zero value otherwise. -func (o *ClientAllOf) GetScopes() []string { - if o == nil || o.Scopes == nil { - var ret []string - return ret - } - return o.Scopes -} - -// GetScopesOk returns a tuple with the Scopes field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ClientAllOf) GetScopesOk() ([]string, bool) { - if o == nil || o.Scopes == nil { - return nil, false - } - return o.Scopes, true -} - -// HasScopes returns a boolean if a field has been set. -func (o *ClientAllOf) HasScopes() bool { - if o != nil && o.Scopes != nil { - return true - } - - return false -} - -// SetScopes gets a reference to the given []string and assigns it to the Scopes field. -func (o *ClientAllOf) SetScopes(v []string) { - o.Scopes = v -} - -// GetSecrets returns the Secrets field value if set, zero value otherwise. -func (o *ClientAllOf) GetSecrets() []ClientSecret { - if o == nil || o.Secrets == nil { - var ret []ClientSecret - return ret - } - return o.Secrets -} - -// GetSecretsOk returns a tuple with the Secrets field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ClientAllOf) GetSecretsOk() ([]ClientSecret, bool) { - if o == nil || o.Secrets == nil { - return nil, false - } - return o.Secrets, true -} - -// HasSecrets returns a boolean if a field has been set. -func (o *ClientAllOf) HasSecrets() bool { - if o != nil && o.Secrets != nil { - return true - } - - return false -} - -// SetSecrets gets a reference to the given []ClientSecret and assigns it to the Secrets field. -func (o *ClientAllOf) SetSecrets(v []ClientSecret) { - o.Secrets = v -} - -func (o ClientAllOf) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["id"] = o.Id - } - if o.Scopes != nil { - toSerialize["scopes"] = o.Scopes - } - if o.Secrets != nil { - toSerialize["secrets"] = o.Secrets - } - return json.Marshal(toSerialize) -} - -type NullableClientAllOf struct { - value *ClientAllOf - isSet bool -} - -func (v NullableClientAllOf) Get() *ClientAllOf { - return v.value -} - -func (v *NullableClientAllOf) Set(val *ClientAllOf) { - v.value = val - v.isSet = true -} - -func (v NullableClientAllOf) IsSet() bool { - return v.isSet -} - -func (v *NullableClientAllOf) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableClientAllOf(val *ClientAllOf) *NullableClientAllOf { - return &NullableClientAllOf{value: val, isSet: true} -} - -func (v NullableClientAllOf) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableClientAllOf) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/authclient/model_client_options.go b/authclient/model_client_options.go index 4478cc4..488c4d7 100644 --- a/authclient/model_client_options.go +++ b/authclient/model_client_options.go @@ -16,20 +16,20 @@ import ( // ClientOptions struct for ClientOptions type ClientOptions struct { - Public *bool `json:"public,omitempty"` - RedirectUris []string `json:"redirectUris,omitempty"` - Description *string `json:"description,omitempty"` - Name string `json:"name"` - Trusted *bool `json:"trusted,omitempty"` - PostLogoutRedirectUris []string `json:"postLogoutRedirectUris,omitempty"` - Metadata *map[string]string `json:"metadata,omitempty"` + Public interface{} `json:"public,omitempty"` + RedirectUris interface{} `json:"redirectUris,omitempty"` + Description interface{} `json:"description,omitempty"` + Name interface{} `json:"name"` + Trusted interface{} `json:"trusted,omitempty"` + PostLogoutRedirectUris interface{} `json:"postLogoutRedirectUris,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` } // NewClientOptions instantiates a new ClientOptions 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 NewClientOptions(name string) *ClientOptions { +func NewClientOptions(name interface{}) *ClientOptions { this := ClientOptions{} this.Name = name return &this @@ -43,42 +43,43 @@ func NewClientOptionsWithDefaults() *ClientOptions { return &this } -// GetPublic returns the Public field value if set, zero value otherwise. -func (o *ClientOptions) GetPublic() bool { - if o == nil || o.Public == nil { - var ret bool +// GetPublic returns the Public field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClientOptions) GetPublic() interface{} { + if o == nil { + var ret interface{} return ret } - return *o.Public + return o.Public } // GetPublicOk returns a tuple with the Public field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClientOptions) GetPublicOk() (*bool, bool) { - if o == nil || o.Public == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientOptions) GetPublicOk() (*interface{}, bool) { + if o == nil || isNil(o.Public) { return nil, false } - return o.Public, true + return &o.Public, true } // HasPublic returns a boolean if a field has been set. func (o *ClientOptions) HasPublic() bool { - if o != nil && o.Public != nil { + if o != nil && isNil(o.Public) { return true } return false } -// SetPublic gets a reference to the given bool and assigns it to the Public field. -func (o *ClientOptions) SetPublic(v bool) { - o.Public = &v +// SetPublic gets a reference to the given interface{} and assigns it to the Public field. +func (o *ClientOptions) SetPublic(v interface{}) { + o.Public = v } -// GetRedirectUris returns the RedirectUris field value if set, zero value otherwise. -func (o *ClientOptions) GetRedirectUris() []string { - if o == nil || o.RedirectUris == nil { - var ret []string +// GetRedirectUris returns the RedirectUris field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClientOptions) GetRedirectUris() interface{} { + if o == nil { + var ret interface{} return ret } return o.RedirectUris @@ -86,63 +87,66 @@ func (o *ClientOptions) GetRedirectUris() []string { // GetRedirectUrisOk returns a tuple with the RedirectUris field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClientOptions) GetRedirectUrisOk() ([]string, bool) { - if o == nil || o.RedirectUris == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientOptions) GetRedirectUrisOk() (*interface{}, bool) { + if o == nil || isNil(o.RedirectUris) { return nil, false } - return o.RedirectUris, true + return &o.RedirectUris, true } // HasRedirectUris returns a boolean if a field has been set. func (o *ClientOptions) HasRedirectUris() bool { - if o != nil && o.RedirectUris != nil { + if o != nil && isNil(o.RedirectUris) { return true } return false } -// SetRedirectUris gets a reference to the given []string and assigns it to the RedirectUris field. -func (o *ClientOptions) SetRedirectUris(v []string) { +// SetRedirectUris gets a reference to the given interface{} and assigns it to the RedirectUris field. +func (o *ClientOptions) SetRedirectUris(v interface{}) { o.RedirectUris = v } -// GetDescription returns the Description field value if set, zero value otherwise. -func (o *ClientOptions) GetDescription() string { - if o == nil || o.Description == nil { - var ret string +// GetDescription returns the Description field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClientOptions) GetDescription() interface{} { + if o == nil { + var ret interface{} return ret } - return *o.Description + return o.Description } // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClientOptions) GetDescriptionOk() (*string, bool) { - if o == nil || o.Description == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientOptions) GetDescriptionOk() (*interface{}, bool) { + if o == nil || isNil(o.Description) { return nil, false } - return o.Description, true + return &o.Description, true } // HasDescription returns a boolean if a field has been set. func (o *ClientOptions) HasDescription() bool { - if o != nil && o.Description != nil { + if o != nil && isNil(o.Description) { return true } return false } -// SetDescription gets a reference to the given string and assigns it to the Description field. -func (o *ClientOptions) SetDescription(v string) { - o.Description = &v +// SetDescription gets a reference to the given interface{} and assigns it to the Description field. +func (o *ClientOptions) SetDescription(v interface{}) { + o.Description = v } // GetName returns the Name field value -func (o *ClientOptions) GetName() string { +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ClientOptions) GetName() interface{} { if o == nil { - var ret string + var ret interface{} return ret } @@ -151,54 +155,56 @@ func (o *ClientOptions) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. -func (o *ClientOptions) GetNameOk() (*string, bool) { - if o == nil { - return nil, false +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientOptions) GetNameOk() (*interface{}, bool) { + if o == nil || isNil(o.Name) { + return nil, false } return &o.Name, true } // SetName sets field value -func (o *ClientOptions) SetName(v string) { +func (o *ClientOptions) SetName(v interface{}) { o.Name = v } -// GetTrusted returns the Trusted field value if set, zero value otherwise. -func (o *ClientOptions) GetTrusted() bool { - if o == nil || o.Trusted == nil { - var ret bool +// GetTrusted returns the Trusted field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClientOptions) GetTrusted() interface{} { + if o == nil { + var ret interface{} return ret } - return *o.Trusted + return o.Trusted } // GetTrustedOk returns a tuple with the Trusted field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClientOptions) GetTrustedOk() (*bool, bool) { - if o == nil || o.Trusted == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientOptions) GetTrustedOk() (*interface{}, bool) { + if o == nil || isNil(o.Trusted) { return nil, false } - return o.Trusted, true + return &o.Trusted, true } // HasTrusted returns a boolean if a field has been set. func (o *ClientOptions) HasTrusted() bool { - if o != nil && o.Trusted != nil { + if o != nil && isNil(o.Trusted) { return true } return false } -// SetTrusted gets a reference to the given bool and assigns it to the Trusted field. -func (o *ClientOptions) SetTrusted(v bool) { - o.Trusted = &v +// SetTrusted gets a reference to the given interface{} and assigns it to the Trusted field. +func (o *ClientOptions) SetTrusted(v interface{}) { + o.Trusted = v } -// GetPostLogoutRedirectUris returns the PostLogoutRedirectUris field value if set, zero value otherwise. -func (o *ClientOptions) GetPostLogoutRedirectUris() []string { - if o == nil || o.PostLogoutRedirectUris == nil { - var ret []string +// GetPostLogoutRedirectUris returns the PostLogoutRedirectUris field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClientOptions) GetPostLogoutRedirectUris() interface{} { + if o == nil { + var ret interface{} return ret } return o.PostLogoutRedirectUris @@ -206,57 +212,59 @@ func (o *ClientOptions) GetPostLogoutRedirectUris() []string { // GetPostLogoutRedirectUrisOk returns a tuple with the PostLogoutRedirectUris field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClientOptions) GetPostLogoutRedirectUrisOk() ([]string, bool) { - if o == nil || o.PostLogoutRedirectUris == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientOptions) GetPostLogoutRedirectUrisOk() (*interface{}, bool) { + if o == nil || isNil(o.PostLogoutRedirectUris) { return nil, false } - return o.PostLogoutRedirectUris, true + return &o.PostLogoutRedirectUris, true } // HasPostLogoutRedirectUris returns a boolean if a field has been set. func (o *ClientOptions) HasPostLogoutRedirectUris() bool { - if o != nil && o.PostLogoutRedirectUris != nil { + if o != nil && isNil(o.PostLogoutRedirectUris) { return true } return false } -// SetPostLogoutRedirectUris gets a reference to the given []string and assigns it to the PostLogoutRedirectUris field. -func (o *ClientOptions) SetPostLogoutRedirectUris(v []string) { +// SetPostLogoutRedirectUris gets a reference to the given interface{} and assigns it to the PostLogoutRedirectUris field. +func (o *ClientOptions) SetPostLogoutRedirectUris(v interface{}) { o.PostLogoutRedirectUris = v } -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *ClientOptions) GetMetadata() map[string]string { - if o == nil || o.Metadata == nil { - var ret map[string]string +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClientOptions) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} return ret } - return *o.Metadata + return o.Metadata } // GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClientOptions) GetMetadataOk() (*map[string]string, bool) { - if o == nil || o.Metadata == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientOptions) GetMetadataOk() (*map[string]interface{}, bool) { + if o == nil || isNil(o.Metadata) { return nil, false } - return o.Metadata, true + return &o.Metadata, true } // HasMetadata returns a boolean if a field has been set. func (o *ClientOptions) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && isNil(o.Metadata) { return true } return false } -// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. -func (o *ClientOptions) SetMetadata(v map[string]string) { - o.Metadata = &v +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *ClientOptions) SetMetadata(v map[string]interface{}) { + o.Metadata = v } func (o ClientOptions) MarshalJSON() ([]byte, error) { @@ -270,7 +278,7 @@ func (o ClientOptions) MarshalJSON() ([]byte, error) { if o.Description != nil { toSerialize["description"] = o.Description } - if true { + if o.Name != nil { toSerialize["name"] = o.Name } if o.Trusted != nil { diff --git a/authclient/model_client_secret.go b/authclient/model_client_secret.go index 0f2c6f1..9983e8f 100644 --- a/authclient/model_client_secret.go +++ b/authclient/model_client_secret.go @@ -16,17 +16,17 @@ import ( // ClientSecret struct for ClientSecret type ClientSecret struct { - LastDigits string `json:"lastDigits"` - Name string `json:"name"` - Id string `json:"id"` - Metadata *map[string]string `json:"metadata,omitempty"` + LastDigits interface{} `json:"lastDigits"` + Name interface{} `json:"name"` + Id interface{} `json:"id"` + Metadata map[string]interface{} `json:"metadata,omitempty"` } // NewClientSecret instantiates a new ClientSecret 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 NewClientSecret(lastDigits string, name string, id string) *ClientSecret { +func NewClientSecret(lastDigits interface{}, name interface{}, id interface{}) *ClientSecret { this := ClientSecret{} this.LastDigits = lastDigits this.Name = name @@ -43,9 +43,10 @@ func NewClientSecretWithDefaults() *ClientSecret { } // GetLastDigits returns the LastDigits field value -func (o *ClientSecret) GetLastDigits() string { +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ClientSecret) GetLastDigits() interface{} { if o == nil { - var ret string + var ret interface{} return ret } @@ -54,22 +55,24 @@ func (o *ClientSecret) GetLastDigits() string { // GetLastDigitsOk returns a tuple with the LastDigits field value // and a boolean to check if the value has been set. -func (o *ClientSecret) GetLastDigitsOk() (*string, bool) { - if o == nil { - return nil, false +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientSecret) GetLastDigitsOk() (*interface{}, bool) { + if o == nil || isNil(o.LastDigits) { + return nil, false } return &o.LastDigits, true } // SetLastDigits sets field value -func (o *ClientSecret) SetLastDigits(v string) { +func (o *ClientSecret) SetLastDigits(v interface{}) { o.LastDigits = v } // GetName returns the Name field value -func (o *ClientSecret) GetName() string { +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ClientSecret) GetName() interface{} { if o == nil { - var ret string + var ret interface{} return ret } @@ -78,22 +81,24 @@ func (o *ClientSecret) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. -func (o *ClientSecret) GetNameOk() (*string, bool) { - if o == nil { - return nil, false +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientSecret) GetNameOk() (*interface{}, bool) { + if o == nil || isNil(o.Name) { + return nil, false } return &o.Name, true } // SetName sets field value -func (o *ClientSecret) SetName(v string) { +func (o *ClientSecret) SetName(v interface{}) { o.Name = v } // GetId returns the Id field value -func (o *ClientSecret) GetId() string { +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ClientSecret) GetId() interface{} { if o == nil { - var ret string + var ret interface{} return ret } @@ -102,59 +107,61 @@ func (o *ClientSecret) GetId() string { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. -func (o *ClientSecret) GetIdOk() (*string, bool) { - if o == nil { - return nil, false +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientSecret) GetIdOk() (*interface{}, bool) { + if o == nil || isNil(o.Id) { + return nil, false } return &o.Id, true } // SetId sets field value -func (o *ClientSecret) SetId(v string) { +func (o *ClientSecret) SetId(v interface{}) { o.Id = v } -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *ClientSecret) GetMetadata() map[string]string { - if o == nil || o.Metadata == nil { - var ret map[string]string +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ClientSecret) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} return ret } - return *o.Metadata + return o.Metadata } // GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ClientSecret) GetMetadataOk() (*map[string]string, bool) { - if o == nil || o.Metadata == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ClientSecret) GetMetadataOk() (*map[string]interface{}, bool) { + if o == nil || isNil(o.Metadata) { return nil, false } - return o.Metadata, true + return &o.Metadata, true } // HasMetadata returns a boolean if a field has been set. func (o *ClientSecret) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && isNil(o.Metadata) { return true } return false } -// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. -func (o *ClientSecret) SetMetadata(v map[string]string) { - o.Metadata = &v +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *ClientSecret) SetMetadata(v map[string]interface{}) { + o.Metadata = v } func (o ClientSecret) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if true { + if o.LastDigits != nil { toSerialize["lastDigits"] = o.LastDigits } - if true { + if o.Name != nil { toSerialize["name"] = o.Name } - if true { + if o.Id != nil { toSerialize["id"] = o.Id } if o.Metadata != nil { diff --git a/authclient/model_create_client_response.go b/authclient/model_create_client_response.go index 3ff32b2..09e77a7 100644 --- a/authclient/model_create_client_response.go +++ b/authclient/model_create_client_response.go @@ -16,7 +16,7 @@ import ( // CreateClientResponse struct for CreateClientResponse type CreateClientResponse struct { - Data *Client `json:"data,omitempty"` + Data interface{} `json:"data,omitempty"` } // NewCreateClientResponse instantiates a new CreateClientResponse object @@ -36,36 +36,37 @@ func NewCreateClientResponseWithDefaults() *CreateClientResponse { return &this } -// GetData returns the Data field value if set, zero value otherwise. -func (o *CreateClientResponse) GetData() Client { - if o == nil || o.Data == nil { - var ret Client +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateClientResponse) GetData() interface{} { + if o == nil { + var ret interface{} return ret } - return *o.Data + return o.Data } // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateClientResponse) GetDataOk() (*Client, bool) { - if o == nil || o.Data == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateClientResponse) GetDataOk() (*interface{}, bool) { + if o == nil || isNil(o.Data) { return nil, false } - return o.Data, true + return &o.Data, true } // HasData returns a boolean if a field has been set. func (o *CreateClientResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && isNil(o.Data) { return true } return false } -// SetData gets a reference to the given Client and assigns it to the Data field. -func (o *CreateClientResponse) SetData(v Client) { - o.Data = &v +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *CreateClientResponse) SetData(v interface{}) { + o.Data = v } func (o CreateClientResponse) MarshalJSON() ([]byte, error) { diff --git a/authclient/model_create_scope_response.go b/authclient/model_create_scope_response.go index 123d33e..494c76f 100644 --- a/authclient/model_create_scope_response.go +++ b/authclient/model_create_scope_response.go @@ -16,7 +16,7 @@ import ( // CreateScopeResponse struct for CreateScopeResponse type CreateScopeResponse struct { - Data *Scope `json:"data,omitempty"` + Data interface{} `json:"data,omitempty"` } // NewCreateScopeResponse instantiates a new CreateScopeResponse object @@ -36,36 +36,37 @@ func NewCreateScopeResponseWithDefaults() *CreateScopeResponse { return &this } -// GetData returns the Data field value if set, zero value otherwise. -func (o *CreateScopeResponse) GetData() Scope { - if o == nil || o.Data == nil { - var ret Scope +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateScopeResponse) GetData() interface{} { + if o == nil { + var ret interface{} return ret } - return *o.Data + return o.Data } // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateScopeResponse) GetDataOk() (*Scope, bool) { - if o == nil || o.Data == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateScopeResponse) GetDataOk() (*interface{}, bool) { + if o == nil || isNil(o.Data) { return nil, false } - return o.Data, true + return &o.Data, true } // HasData returns a boolean if a field has been set. func (o *CreateScopeResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && isNil(o.Data) { return true } return false } -// SetData gets a reference to the given Scope and assigns it to the Data field. -func (o *CreateScopeResponse) SetData(v Scope) { - o.Data = &v +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *CreateScopeResponse) SetData(v interface{}) { + o.Data = v } func (o CreateScopeResponse) MarshalJSON() ([]byte, error) { diff --git a/authclient/model_create_secret_response.go b/authclient/model_create_secret_response.go index e0ec586..9478def 100644 --- a/authclient/model_create_secret_response.go +++ b/authclient/model_create_secret_response.go @@ -16,7 +16,7 @@ import ( // CreateSecretResponse struct for CreateSecretResponse type CreateSecretResponse struct { - Data *Secret `json:"data,omitempty"` + Data interface{} `json:"data,omitempty"` } // NewCreateSecretResponse instantiates a new CreateSecretResponse object @@ -36,36 +36,37 @@ func NewCreateSecretResponseWithDefaults() *CreateSecretResponse { return &this } -// GetData returns the Data field value if set, zero value otherwise. -func (o *CreateSecretResponse) GetData() Secret { - if o == nil || o.Data == nil { - var ret Secret +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateSecretResponse) GetData() interface{} { + if o == nil { + var ret interface{} return ret } - return *o.Data + return o.Data } // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *CreateSecretResponse) GetDataOk() (*Secret, bool) { - if o == nil || o.Data == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateSecretResponse) GetDataOk() (*interface{}, bool) { + if o == nil || isNil(o.Data) { return nil, false } - return o.Data, true + return &o.Data, true } // HasData returns a boolean if a field has been set. func (o *CreateSecretResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && isNil(o.Data) { return true } return false } -// SetData gets a reference to the given Secret and assigns it to the Data field. -func (o *CreateSecretResponse) SetData(v Secret) { - o.Data = &v +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *CreateSecretResponse) SetData(v interface{}) { + o.Data = v } func (o CreateSecretResponse) MarshalJSON() ([]byte, error) { diff --git a/authclient/model_list_clients_response.go b/authclient/model_list_clients_response.go index a19932e..4484647 100644 --- a/authclient/model_list_clients_response.go +++ b/authclient/model_list_clients_response.go @@ -16,7 +16,7 @@ import ( // ListClientsResponse struct for ListClientsResponse type ListClientsResponse struct { - Data []Client `json:"data,omitempty"` + Data interface{} `json:"data,omitempty"` } // NewListClientsResponse instantiates a new ListClientsResponse object @@ -36,10 +36,10 @@ func NewListClientsResponseWithDefaults() *ListClientsResponse { return &this } -// GetData returns the Data field value if set, zero value otherwise. -func (o *ListClientsResponse) GetData() []Client { - if o == nil || o.Data == nil { - var ret []Client +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListClientsResponse) GetData() interface{} { + if o == nil { + var ret interface{} return ret } return o.Data @@ -47,24 +47,25 @@ func (o *ListClientsResponse) GetData() []Client { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListClientsResponse) GetDataOk() ([]Client, bool) { - if o == nil || o.Data == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ListClientsResponse) GetDataOk() (*interface{}, bool) { + if o == nil || isNil(o.Data) { return nil, false } - return o.Data, true + return &o.Data, true } // HasData returns a boolean if a field has been set. func (o *ListClientsResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && isNil(o.Data) { return true } return false } -// SetData gets a reference to the given []Client and assigns it to the Data field. -func (o *ListClientsResponse) SetData(v []Client) { +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *ListClientsResponse) SetData(v interface{}) { o.Data = v } diff --git a/authclient/model_list_scopes_response.go b/authclient/model_list_scopes_response.go index 14f718c..e4169fb 100644 --- a/authclient/model_list_scopes_response.go +++ b/authclient/model_list_scopes_response.go @@ -16,7 +16,7 @@ import ( // ListScopesResponse struct for ListScopesResponse type ListScopesResponse struct { - Data []Scope `json:"data,omitempty"` + Data interface{} `json:"data,omitempty"` } // NewListScopesResponse instantiates a new ListScopesResponse object @@ -36,10 +36,10 @@ func NewListScopesResponseWithDefaults() *ListScopesResponse { return &this } -// GetData returns the Data field value if set, zero value otherwise. -func (o *ListScopesResponse) GetData() []Scope { - if o == nil || o.Data == nil { - var ret []Scope +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListScopesResponse) GetData() interface{} { + if o == nil { + var ret interface{} return ret } return o.Data @@ -47,24 +47,25 @@ func (o *ListScopesResponse) GetData() []Scope { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListScopesResponse) GetDataOk() ([]Scope, bool) { - if o == nil || o.Data == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ListScopesResponse) GetDataOk() (*interface{}, bool) { + if o == nil || isNil(o.Data) { return nil, false } - return o.Data, true + return &o.Data, true } // HasData returns a boolean if a field has been set. func (o *ListScopesResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && isNil(o.Data) { return true } return false } -// SetData gets a reference to the given []Scope and assigns it to the Data field. -func (o *ListScopesResponse) SetData(v []Scope) { +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *ListScopesResponse) SetData(v interface{}) { o.Data = v } diff --git a/authclient/model_list_users_response.go b/authclient/model_list_users_response.go index 24a9ad0..99a945b 100644 --- a/authclient/model_list_users_response.go +++ b/authclient/model_list_users_response.go @@ -16,7 +16,7 @@ import ( // ListUsersResponse struct for ListUsersResponse type ListUsersResponse struct { - Data []User `json:"data,omitempty"` + Data interface{} `json:"data,omitempty"` } // NewListUsersResponse instantiates a new ListUsersResponse object @@ -36,10 +36,10 @@ func NewListUsersResponseWithDefaults() *ListUsersResponse { return &this } -// GetData returns the Data field value if set, zero value otherwise. -func (o *ListUsersResponse) GetData() []User { - if o == nil || o.Data == nil { - var ret []User +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ListUsersResponse) GetData() interface{} { + if o == nil { + var ret interface{} return ret } return o.Data @@ -47,24 +47,25 @@ func (o *ListUsersResponse) GetData() []User { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ListUsersResponse) GetDataOk() ([]User, bool) { - if o == nil || o.Data == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ListUsersResponse) GetDataOk() (*interface{}, bool) { + if o == nil || isNil(o.Data) { return nil, false } - return o.Data, true + return &o.Data, true } // HasData returns a boolean if a field has been set. func (o *ListUsersResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && isNil(o.Data) { return true } return false } -// SetData gets a reference to the given []User and assigns it to the Data field. -func (o *ListUsersResponse) SetData(v []User) { +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *ListUsersResponse) SetData(v interface{}) { o.Data = v } diff --git a/authclient/model_read_client_response.go b/authclient/model_read_client_response.go index efcd512..2a30af1 100644 --- a/authclient/model_read_client_response.go +++ b/authclient/model_read_client_response.go @@ -16,7 +16,7 @@ import ( // ReadClientResponse struct for ReadClientResponse type ReadClientResponse struct { - Data *Client `json:"data,omitempty"` + Data interface{} `json:"data,omitempty"` } // NewReadClientResponse instantiates a new ReadClientResponse object @@ -36,36 +36,37 @@ func NewReadClientResponseWithDefaults() *ReadClientResponse { return &this } -// GetData returns the Data field value if set, zero value otherwise. -func (o *ReadClientResponse) GetData() Client { - if o == nil || o.Data == nil { - var ret Client +// GetData returns the Data field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ReadClientResponse) GetData() interface{} { + if o == nil { + var ret interface{} return ret } - return *o.Data + return o.Data } // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ReadClientResponse) GetDataOk() (*Client, bool) { - if o == nil || o.Data == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ReadClientResponse) GetDataOk() (*interface{}, bool) { + if o == nil || isNil(o.Data) { return nil, false } - return o.Data, true + return &o.Data, true } // HasData returns a boolean if a field has been set. func (o *ReadClientResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && isNil(o.Data) { return true } return false } -// SetData gets a reference to the given Client and assigns it to the Data field. -func (o *ReadClientResponse) SetData(v Client) { - o.Data = &v +// SetData gets a reference to the given interface{} and assigns it to the Data field. +func (o *ReadClientResponse) SetData(v interface{}) { + o.Data = v } func (o ReadClientResponse) MarshalJSON() ([]byte, error) { diff --git a/authclient/model_read_user_response.go b/authclient/model_read_user_response.go index 1d40e78..ab0b5f9 100644 --- a/authclient/model_read_user_response.go +++ b/authclient/model_read_user_response.go @@ -38,7 +38,7 @@ func NewReadUserResponseWithDefaults() *ReadUserResponse { // GetData returns the Data field value if set, zero value otherwise. func (o *ReadUserResponse) GetData() User { - if o == nil || o.Data == nil { + if o == nil || isNil(o.Data) { var ret User return ret } @@ -48,7 +48,7 @@ func (o *ReadUserResponse) GetData() User { // GetDataOk returns a tuple with the Data field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *ReadUserResponse) GetDataOk() (*User, bool) { - if o == nil || o.Data == nil { + if o == nil || isNil(o.Data) { return nil, false } return o.Data, true @@ -56,7 +56,7 @@ func (o *ReadUserResponse) GetDataOk() (*User, bool) { // HasData returns a boolean if a field has been set. func (o *ReadUserResponse) HasData() bool { - if o != nil && o.Data != nil { + if o != nil && !isNil(o.Data) { return true } @@ -70,7 +70,7 @@ func (o *ReadUserResponse) SetData(v User) { func (o ReadUserResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if o.Data != nil { + if !isNil(o.Data) { toSerialize["data"] = o.Data } return json.Marshal(toSerialize) diff --git a/authclient/model_scope.go b/authclient/model_scope.go deleted file mode 100644 index 49832fc..0000000 --- a/authclient/model_scope.go +++ /dev/null @@ -1,209 +0,0 @@ -/* -Auth API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -API version: AUTH_VERSION -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package authclient - -import ( - "encoding/json" -) - -// Scope struct for Scope -type Scope struct { - Label string `json:"label"` - Metadata *map[string]string `json:"metadata,omitempty"` - Id string `json:"id"` - Transient []string `json:"transient,omitempty"` -} - -// NewScope instantiates a new Scope 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 NewScope(label string, id string) *Scope { - this := Scope{} - this.Label = label - this.Id = id - return &this -} - -// NewScopeWithDefaults instantiates a new Scope 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 NewScopeWithDefaults() *Scope { - this := Scope{} - return &this -} - -// GetLabel returns the Label field value -func (o *Scope) GetLabel() string { - if o == nil { - var ret string - return ret - } - - return o.Label -} - -// GetLabelOk returns a tuple with the Label field value -// and a boolean to check if the value has been set. -func (o *Scope) GetLabelOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Label, true -} - -// SetLabel sets field value -func (o *Scope) SetLabel(v string) { - o.Label = v -} - -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *Scope) GetMetadata() map[string]string { - if o == nil || o.Metadata == nil { - var ret map[string]string - return ret - } - return *o.Metadata -} - -// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Scope) GetMetadataOk() (*map[string]string, bool) { - if o == nil || o.Metadata == nil { - return nil, false - } - return o.Metadata, true -} - -// HasMetadata returns a boolean if a field has been set. -func (o *Scope) HasMetadata() bool { - if o != nil && o.Metadata != nil { - return true - } - - return false -} - -// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. -func (o *Scope) SetMetadata(v map[string]string) { - o.Metadata = &v -} - -// GetId returns the Id field value -func (o *Scope) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *Scope) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Scope) SetId(v string) { - o.Id = v -} - -// GetTransient returns the Transient field value if set, zero value otherwise. -func (o *Scope) GetTransient() []string { - if o == nil || o.Transient == nil { - var ret []string - return ret - } - return o.Transient -} - -// GetTransientOk returns a tuple with the Transient field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Scope) GetTransientOk() ([]string, bool) { - if o == nil || o.Transient == nil { - return nil, false - } - return o.Transient, true -} - -// HasTransient returns a boolean if a field has been set. -func (o *Scope) HasTransient() bool { - if o != nil && o.Transient != nil { - return true - } - - return false -} - -// SetTransient gets a reference to the given []string and assigns it to the Transient field. -func (o *Scope) SetTransient(v []string) { - o.Transient = v -} - -func (o Scope) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["label"] = o.Label - } - if o.Metadata != nil { - toSerialize["metadata"] = o.Metadata - } - if true { - toSerialize["id"] = o.Id - } - if o.Transient != nil { - toSerialize["transient"] = o.Transient - } - return json.Marshal(toSerialize) -} - -type NullableScope struct { - value *Scope - isSet bool -} - -func (v NullableScope) Get() *Scope { - return v.value -} - -func (v *NullableScope) Set(val *Scope) { - v.value = val - v.isSet = true -} - -func (v NullableScope) IsSet() bool { - return v.isSet -} - -func (v *NullableScope) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScope(val *Scope) *NullableScope { - return &NullableScope{value: val, isSet: true} -} - -func (v NullableScope) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScope) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/authclient/model_scope_all_of.go b/authclient/model_scope_all_of.go deleted file mode 100644 index bc801cb..0000000 --- a/authclient/model_scope_all_of.go +++ /dev/null @@ -1,144 +0,0 @@ -/* -Auth API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -API version: AUTH_VERSION -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package authclient - -import ( - "encoding/json" -) - -// ScopeAllOf struct for ScopeAllOf -type ScopeAllOf struct { - Id string `json:"id"` - Transient []string `json:"transient,omitempty"` -} - -// NewScopeAllOf instantiates a new ScopeAllOf 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 NewScopeAllOf(id string) *ScopeAllOf { - this := ScopeAllOf{} - this.Id = id - return &this -} - -// NewScopeAllOfWithDefaults instantiates a new ScopeAllOf 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 NewScopeAllOfWithDefaults() *ScopeAllOf { - this := ScopeAllOf{} - return &this -} - -// GetId returns the Id field value -func (o *ScopeAllOf) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *ScopeAllOf) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *ScopeAllOf) SetId(v string) { - o.Id = v -} - -// GetTransient returns the Transient field value if set, zero value otherwise. -func (o *ScopeAllOf) GetTransient() []string { - if o == nil || o.Transient == nil { - var ret []string - return ret - } - return o.Transient -} - -// GetTransientOk returns a tuple with the Transient field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ScopeAllOf) GetTransientOk() ([]string, bool) { - if o == nil || o.Transient == nil { - return nil, false - } - return o.Transient, true -} - -// HasTransient returns a boolean if a field has been set. -func (o *ScopeAllOf) HasTransient() bool { - if o != nil && o.Transient != nil { - return true - } - - return false -} - -// SetTransient gets a reference to the given []string and assigns it to the Transient field. -func (o *ScopeAllOf) SetTransient(v []string) { - o.Transient = v -} - -func (o ScopeAllOf) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["id"] = o.Id - } - if o.Transient != nil { - toSerialize["transient"] = o.Transient - } - return json.Marshal(toSerialize) -} - -type NullableScopeAllOf struct { - value *ScopeAllOf - isSet bool -} - -func (v NullableScopeAllOf) Get() *ScopeAllOf { - return v.value -} - -func (v *NullableScopeAllOf) Set(val *ScopeAllOf) { - v.value = val - v.isSet = true -} - -func (v NullableScopeAllOf) IsSet() bool { - return v.isSet -} - -func (v *NullableScopeAllOf) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableScopeAllOf(val *ScopeAllOf) *NullableScopeAllOf { - return &NullableScopeAllOf{value: val, isSet: true} -} - -func (v NullableScopeAllOf) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableScopeAllOf) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/authclient/model_scope_options.go b/authclient/model_scope_options.go index 6cab717..fa4ca3e 100644 --- a/authclient/model_scope_options.go +++ b/authclient/model_scope_options.go @@ -16,15 +16,15 @@ import ( // ScopeOptions struct for ScopeOptions type ScopeOptions struct { - Label string `json:"label"` - Metadata *map[string]string `json:"metadata,omitempty"` + Label interface{} `json:"label"` + Metadata map[string]interface{} `json:"metadata,omitempty"` } // NewScopeOptions instantiates a new ScopeOptions 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 NewScopeOptions(label string) *ScopeOptions { +func NewScopeOptions(label interface{}) *ScopeOptions { this := ScopeOptions{} this.Label = label return &this @@ -39,9 +39,10 @@ func NewScopeOptionsWithDefaults() *ScopeOptions { } // GetLabel returns the Label field value -func (o *ScopeOptions) GetLabel() string { +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *ScopeOptions) GetLabel() interface{} { if o == nil { - var ret string + var ret interface{} return ret } @@ -50,53 +51,55 @@ func (o *ScopeOptions) GetLabel() string { // GetLabelOk returns a tuple with the Label field value // and a boolean to check if the value has been set. -func (o *ScopeOptions) GetLabelOk() (*string, bool) { - if o == nil { - return nil, false +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScopeOptions) GetLabelOk() (*interface{}, bool) { + if o == nil || isNil(o.Label) { + return nil, false } return &o.Label, true } // SetLabel sets field value -func (o *ScopeOptions) SetLabel(v string) { +func (o *ScopeOptions) SetLabel(v interface{}) { o.Label = v } -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *ScopeOptions) GetMetadata() map[string]string { - if o == nil || o.Metadata == nil { - var ret map[string]string +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ScopeOptions) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} return ret } - return *o.Metadata + return o.Metadata } // GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *ScopeOptions) GetMetadataOk() (*map[string]string, bool) { - if o == nil || o.Metadata == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ScopeOptions) GetMetadataOk() (*map[string]interface{}, bool) { + if o == nil || isNil(o.Metadata) { return nil, false } - return o.Metadata, true + return &o.Metadata, true } // HasMetadata returns a boolean if a field has been set. func (o *ScopeOptions) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && isNil(o.Metadata) { return true } return false } -// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. -func (o *ScopeOptions) SetMetadata(v map[string]string) { - o.Metadata = &v +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *ScopeOptions) SetMetadata(v map[string]interface{}) { + o.Metadata = v } func (o ScopeOptions) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if true { + if o.Label != nil { toSerialize["label"] = o.Label } if o.Metadata != nil { diff --git a/authclient/model_secret.go b/authclient/model_secret.go deleted file mode 100644 index dba5c3c..0000000 --- a/authclient/model_secret.go +++ /dev/null @@ -1,231 +0,0 @@ -/* -Auth API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -API version: AUTH_VERSION -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package authclient - -import ( - "encoding/json" -) - -// Secret struct for Secret -type Secret struct { - Name string `json:"name"` - Metadata *map[string]string `json:"metadata,omitempty"` - Id string `json:"id"` - LastDigits string `json:"lastDigits"` - Clear string `json:"clear"` -} - -// NewSecret instantiates a new Secret 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 NewSecret(name string, id string, lastDigits string, clear string) *Secret { - this := Secret{} - this.Name = name - this.Id = id - this.LastDigits = lastDigits - this.Clear = clear - return &this -} - -// NewSecretWithDefaults instantiates a new Secret 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 NewSecretWithDefaults() *Secret { - this := Secret{} - return &this -} - -// GetName returns the Name field value -func (o *Secret) GetName() string { - if o == nil { - var ret string - return ret - } - - return o.Name -} - -// GetNameOk returns a tuple with the Name field value -// and a boolean to check if the value has been set. -func (o *Secret) GetNameOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Name, true -} - -// SetName sets field value -func (o *Secret) SetName(v string) { - o.Name = v -} - -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *Secret) GetMetadata() map[string]string { - if o == nil || o.Metadata == nil { - var ret map[string]string - return ret - } - return *o.Metadata -} - -// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *Secret) GetMetadataOk() (*map[string]string, bool) { - if o == nil || o.Metadata == nil { - return nil, false - } - return o.Metadata, true -} - -// HasMetadata returns a boolean if a field has been set. -func (o *Secret) HasMetadata() bool { - if o != nil && o.Metadata != nil { - return true - } - - return false -} - -// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. -func (o *Secret) SetMetadata(v map[string]string) { - o.Metadata = &v -} - -// GetId returns the Id field value -func (o *Secret) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *Secret) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *Secret) SetId(v string) { - o.Id = v -} - -// GetLastDigits returns the LastDigits field value -func (o *Secret) GetLastDigits() string { - if o == nil { - var ret string - return ret - } - - return o.LastDigits -} - -// GetLastDigitsOk returns a tuple with the LastDigits field value -// and a boolean to check if the value has been set. -func (o *Secret) GetLastDigitsOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.LastDigits, true -} - -// SetLastDigits sets field value -func (o *Secret) SetLastDigits(v string) { - o.LastDigits = v -} - -// GetClear returns the Clear field value -func (o *Secret) GetClear() string { - if o == nil { - var ret string - return ret - } - - return o.Clear -} - -// GetClearOk returns a tuple with the Clear field value -// and a boolean to check if the value has been set. -func (o *Secret) GetClearOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Clear, true -} - -// SetClear sets field value -func (o *Secret) SetClear(v string) { - o.Clear = v -} - -func (o Secret) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["name"] = o.Name - } - if o.Metadata != nil { - toSerialize["metadata"] = o.Metadata - } - if true { - toSerialize["id"] = o.Id - } - if true { - toSerialize["lastDigits"] = o.LastDigits - } - if true { - toSerialize["clear"] = o.Clear - } - return json.Marshal(toSerialize) -} - -type NullableSecret struct { - value *Secret - isSet bool -} - -func (v NullableSecret) Get() *Secret { - return v.value -} - -func (v *NullableSecret) Set(val *Secret) { - v.value = val - v.isSet = true -} - -func (v NullableSecret) IsSet() bool { - return v.isSet -} - -func (v *NullableSecret) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSecret(val *Secret) *NullableSecret { - return &NullableSecret{value: val, isSet: true} -} - -func (v NullableSecret) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSecret) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/authclient/model_secret_all_of.go b/authclient/model_secret_all_of.go deleted file mode 100644 index dada21d..0000000 --- a/authclient/model_secret_all_of.go +++ /dev/null @@ -1,166 +0,0 @@ -/* -Auth API - -No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -API version: AUTH_VERSION -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package authclient - -import ( - "encoding/json" -) - -// SecretAllOf struct for SecretAllOf -type SecretAllOf struct { - Id string `json:"id"` - LastDigits string `json:"lastDigits"` - Clear string `json:"clear"` -} - -// NewSecretAllOf instantiates a new SecretAllOf 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 NewSecretAllOf(id string, lastDigits string, clear string) *SecretAllOf { - this := SecretAllOf{} - this.Id = id - this.LastDigits = lastDigits - this.Clear = clear - return &this -} - -// NewSecretAllOfWithDefaults instantiates a new SecretAllOf 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 NewSecretAllOfWithDefaults() *SecretAllOf { - this := SecretAllOf{} - return &this -} - -// GetId returns the Id field value -func (o *SecretAllOf) GetId() string { - if o == nil { - var ret string - return ret - } - - return o.Id -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -func (o *SecretAllOf) GetIdOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Id, true -} - -// SetId sets field value -func (o *SecretAllOf) SetId(v string) { - o.Id = v -} - -// GetLastDigits returns the LastDigits field value -func (o *SecretAllOf) GetLastDigits() string { - if o == nil { - var ret string - return ret - } - - return o.LastDigits -} - -// GetLastDigitsOk returns a tuple with the LastDigits field value -// and a boolean to check if the value has been set. -func (o *SecretAllOf) GetLastDigitsOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.LastDigits, true -} - -// SetLastDigits sets field value -func (o *SecretAllOf) SetLastDigits(v string) { - o.LastDigits = v -} - -// GetClear returns the Clear field value -func (o *SecretAllOf) GetClear() string { - if o == nil { - var ret string - return ret - } - - return o.Clear -} - -// GetClearOk returns a tuple with the Clear field value -// and a boolean to check if the value has been set. -func (o *SecretAllOf) GetClearOk() (*string, bool) { - if o == nil { - return nil, false - } - return &o.Clear, true -} - -// SetClear sets field value -func (o *SecretAllOf) SetClear(v string) { - o.Clear = v -} - -func (o SecretAllOf) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["id"] = o.Id - } - if true { - toSerialize["lastDigits"] = o.LastDigits - } - if true { - toSerialize["clear"] = o.Clear - } - return json.Marshal(toSerialize) -} - -type NullableSecretAllOf struct { - value *SecretAllOf - isSet bool -} - -func (v NullableSecretAllOf) Get() *SecretAllOf { - return v.value -} - -func (v *NullableSecretAllOf) Set(val *SecretAllOf) { - v.value = val - v.isSet = true -} - -func (v NullableSecretAllOf) IsSet() bool { - return v.isSet -} - -func (v *NullableSecretAllOf) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSecretAllOf(val *SecretAllOf) *NullableSecretAllOf { - return &NullableSecretAllOf{value: val, isSet: true} -} - -func (v NullableSecretAllOf) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSecretAllOf) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/authclient/model_secret_options.go b/authclient/model_secret_options.go index 6ffb6f7..1941298 100644 --- a/authclient/model_secret_options.go +++ b/authclient/model_secret_options.go @@ -16,15 +16,15 @@ import ( // SecretOptions struct for SecretOptions type SecretOptions struct { - Name string `json:"name"` - Metadata *map[string]string `json:"metadata,omitempty"` + Name interface{} `json:"name"` + Metadata map[string]interface{} `json:"metadata,omitempty"` } // NewSecretOptions instantiates a new SecretOptions 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 NewSecretOptions(name string) *SecretOptions { +func NewSecretOptions(name interface{}) *SecretOptions { this := SecretOptions{} this.Name = name return &this @@ -39,9 +39,10 @@ func NewSecretOptionsWithDefaults() *SecretOptions { } // GetName returns the Name field value -func (o *SecretOptions) GetName() string { +// If the value is explicit nil, the zero value for interface{} will be returned +func (o *SecretOptions) GetName() interface{} { if o == nil { - var ret string + var ret interface{} return ret } @@ -50,53 +51,55 @@ func (o *SecretOptions) GetName() string { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. -func (o *SecretOptions) GetNameOk() (*string, bool) { - if o == nil { - return nil, false +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SecretOptions) GetNameOk() (*interface{}, bool) { + if o == nil || isNil(o.Name) { + return nil, false } return &o.Name, true } // SetName sets field value -func (o *SecretOptions) SetName(v string) { +func (o *SecretOptions) SetName(v interface{}) { o.Name = v } -// GetMetadata returns the Metadata field value if set, zero value otherwise. -func (o *SecretOptions) GetMetadata() map[string]string { - if o == nil || o.Metadata == nil { - var ret map[string]string +// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *SecretOptions) GetMetadata() map[string]interface{} { + if o == nil { + var ret map[string]interface{} return ret } - return *o.Metadata + return o.Metadata } // GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SecretOptions) GetMetadataOk() (*map[string]string, bool) { - if o == nil || o.Metadata == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *SecretOptions) GetMetadataOk() (*map[string]interface{}, bool) { + if o == nil || isNil(o.Metadata) { return nil, false } - return o.Metadata, true + return &o.Metadata, true } // HasMetadata returns a boolean if a field has been set. func (o *SecretOptions) HasMetadata() bool { - if o != nil && o.Metadata != nil { + if o != nil && isNil(o.Metadata) { return true } return false } -// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. -func (o *SecretOptions) SetMetadata(v map[string]string) { - o.Metadata = &v +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *SecretOptions) SetMetadata(v map[string]interface{}) { + o.Metadata = v } func (o SecretOptions) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} - if true { + if o.Name != nil { toSerialize["name"] = o.Name } if o.Metadata != nil { diff --git a/authclient/model_user.go b/authclient/model_user.go index bd0b283..ed0e391 100644 --- a/authclient/model_user.go +++ b/authclient/model_user.go @@ -16,9 +16,9 @@ import ( // User struct for User type User struct { - Id *string `json:"id,omitempty"` - Subject *string `json:"subject,omitempty"` - Email *string `json:"email,omitempty"` + Id interface{} `json:"id,omitempty"` + Subject interface{} `json:"subject,omitempty"` + Email interface{} `json:"email,omitempty"` } // NewUser instantiates a new User object @@ -38,100 +38,103 @@ func NewUserWithDefaults() *User { return &this } -// GetId returns the Id field value if set, zero value otherwise. -func (o *User) GetId() string { - if o == nil || o.Id == nil { - var ret string +// GetId returns the Id field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetId() interface{} { + if o == nil { + var ret interface{} return ret } - return *o.Id + return o.Id } // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetIdOk() (*string, bool) { - if o == nil || o.Id == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetIdOk() (*interface{}, bool) { + if o == nil || isNil(o.Id) { return nil, false } - return o.Id, true + return &o.Id, true } // HasId returns a boolean if a field has been set. func (o *User) HasId() bool { - if o != nil && o.Id != nil { + if o != nil && isNil(o.Id) { return true } return false } -// SetId gets a reference to the given string and assigns it to the Id field. -func (o *User) SetId(v string) { - o.Id = &v +// SetId gets a reference to the given interface{} and assigns it to the Id field. +func (o *User) SetId(v interface{}) { + o.Id = v } -// GetSubject returns the Subject field value if set, zero value otherwise. -func (o *User) GetSubject() string { - if o == nil || o.Subject == nil { - var ret string +// GetSubject returns the Subject field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetSubject() interface{} { + if o == nil { + var ret interface{} return ret } - return *o.Subject + return o.Subject } // GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetSubjectOk() (*string, bool) { - if o == nil || o.Subject == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetSubjectOk() (*interface{}, bool) { + if o == nil || isNil(o.Subject) { return nil, false } - return o.Subject, true + return &o.Subject, true } // HasSubject returns a boolean if a field has been set. func (o *User) HasSubject() bool { - if o != nil && o.Subject != nil { + if o != nil && isNil(o.Subject) { return true } return false } -// SetSubject gets a reference to the given string and assigns it to the Subject field. -func (o *User) SetSubject(v string) { - o.Subject = &v +// SetSubject gets a reference to the given interface{} and assigns it to the Subject field. +func (o *User) SetSubject(v interface{}) { + o.Subject = v } -// GetEmail returns the Email field value if set, zero value otherwise. -func (o *User) GetEmail() string { - if o == nil || o.Email == nil { - var ret string +// GetEmail returns the Email field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *User) GetEmail() interface{} { + if o == nil { + var ret interface{} return ret } - return *o.Email + return o.Email } // GetEmailOk returns a tuple with the Email field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *User) GetEmailOk() (*string, bool) { - if o == nil || o.Email == nil { +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *User) GetEmailOk() (*interface{}, bool) { + if o == nil || isNil(o.Email) { return nil, false } - return o.Email, true + return &o.Email, true } // HasEmail returns a boolean if a field has been set. func (o *User) HasEmail() bool { - if o != nil && o.Email != nil { + if o != nil && isNil(o.Email) { return true } return false } -// SetEmail gets a reference to the given string and assigns it to the Email field. -func (o *User) SetEmail(v string) { - o.Email = &v +// SetEmail gets a reference to the given interface{} and assigns it to the Email field. +func (o *User) SetEmail(v interface{}) { + o.Email = v } func (o User) MarshalJSON() ([]byte, error) { diff --git a/authclient/test/api_clients_test.go b/authclient/test/api_clients_test.go new file mode 100644 index 0000000..1dda61b --- /dev/null +++ b/authclient/test/api_clients_test.go @@ -0,0 +1,150 @@ +/* +Auth API + +Testing ClientsApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/formancehq/auth/authclient" +) + +func Test_authclient_ClientsApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ClientsApiService AddScopeToClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var clientId interface{} + var scopeId interface{} + + resp, httpRes, err := apiClient.ClientsApi.AddScopeToClient(context.Background(), clientId, scopeId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ClientsApiService CreateClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ClientsApi.CreateClient(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ClientsApiService CreateSecret", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var clientId interface{} + + resp, httpRes, err := apiClient.ClientsApi.CreateSecret(context.Background(), clientId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ClientsApiService DeleteClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var clientId interface{} + + resp, httpRes, err := apiClient.ClientsApi.DeleteClient(context.Background(), clientId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ClientsApiService DeleteScopeFromClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var clientId interface{} + var scopeId interface{} + + resp, httpRes, err := apiClient.ClientsApi.DeleteScopeFromClient(context.Background(), clientId, scopeId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ClientsApiService DeleteSecret", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var clientId interface{} + var secretId interface{} + + resp, httpRes, err := apiClient.ClientsApi.DeleteSecret(context.Background(), clientId, secretId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ClientsApiService ListClients", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ClientsApi.ListClients(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ClientsApiService ReadClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var clientId interface{} + + resp, httpRes, err := apiClient.ClientsApi.ReadClient(context.Background(), clientId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ClientsApiService UpdateClient", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var clientId interface{} + + resp, httpRes, err := apiClient.ClientsApi.UpdateClient(context.Background(), clientId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/authclient/test/api_scopes_test.go b/authclient/test/api_scopes_test.go new file mode 100644 index 0000000..8bf3b93 --- /dev/null +++ b/authclient/test/api_scopes_test.go @@ -0,0 +1,121 @@ +/* +Auth API + +Testing ScopesApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/formancehq/auth/authclient" +) + +func Test_authclient_ScopesApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test ScopesApiService AddTransientScope", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var scopeId interface{} + var transientScopeId interface{} + + resp, httpRes, err := apiClient.ScopesApi.AddTransientScope(context.Background(), scopeId, transientScopeId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ScopesApiService CreateScope", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ScopesApi.CreateScope(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ScopesApiService DeleteScope", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var scopeId interface{} + + resp, httpRes, err := apiClient.ScopesApi.DeleteScope(context.Background(), scopeId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ScopesApiService DeleteTransientScope", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var scopeId interface{} + var transientScopeId interface{} + + resp, httpRes, err := apiClient.ScopesApi.DeleteTransientScope(context.Background(), scopeId, transientScopeId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ScopesApiService ListScopes", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.ScopesApi.ListScopes(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ScopesApiService ReadScope", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var scopeId interface{} + + resp, httpRes, err := apiClient.ScopesApi.ReadScope(context.Background(), scopeId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test ScopesApiService UpdateScope", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var scopeId interface{} + + resp, httpRes, err := apiClient.ScopesApi.UpdateScope(context.Background(), scopeId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/authclient/test/api_users_test.go b/authclient/test/api_users_test.go new file mode 100644 index 0000000..b4d6f23 --- /dev/null +++ b/authclient/test/api_users_test.go @@ -0,0 +1,51 @@ +/* +Auth API + +Testing UsersApiService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package authclient + +import ( + "context" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "testing" + openapiclient "github.com/formancehq/auth/authclient" +) + +func Test_authclient_UsersApiService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test UsersApiService ListUsers", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.UsersApi.ListUsers(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test UsersApiService ReadUser", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var userId interface{} + + resp, httpRes, err := apiClient.UsersApi.ReadUser(context.Background(), userId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/authclient/utils.go b/authclient/utils.go index 7daa2c5..4527645 100644 --- a/authclient/utils.go +++ b/authclient/utils.go @@ -12,6 +12,7 @@ package authclient import ( "encoding/json" + "reflect" "time" ) @@ -326,3 +327,17 @@ func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } + +// isNil checks if an input is nil +func isNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} \ No newline at end of file diff --git a/demo/src/logo.svg b/demo/src/logo.svg index 9dfc1c0..7169476 100644 --- a/demo/src/logo.svg +++ b/demo/src/logo.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/dex.Dockerfile b/dex.Dockerfile index 87b2f55..08b0903 100644 --- a/dex.Dockerfile +++ b/dex.Dockerfile @@ -1,3 +1,3 @@ FROM ghcr.io/dexidp/dex:v2.35.0 ENV DEX_FRONTEND_DIR=/app/web -COPY --chown=root:root pkg/web /app/web \ No newline at end of file +COPY --chown=root:root pkg/web /app/web diff --git a/pkg/web/static/img/gitlab-icon.svg b/pkg/web/static/img/gitlab-icon.svg index e8d408f..5461840 100644 --- a/pkg/web/static/img/gitlab-icon.svg +++ b/pkg/web/static/img/gitlab-icon.svg @@ -50,4 +50,4 @@ - \ No newline at end of file + diff --git a/pkg/web/static/img/google-icon.svg b/pkg/web/static/img/google-icon.svg index d667afd..f1c9f96 100644 --- a/pkg/web/static/img/google-icon.svg +++ b/pkg/web/static/img/google-icon.svg @@ -13,4 +13,4 @@ - \ No newline at end of file + diff --git a/pkg/web/static/img/linkedin-icon.svg b/pkg/web/static/img/linkedin-icon.svg index 409bad5..49bec0a 100644 --- a/pkg/web/static/img/linkedin-icon.svg +++ b/pkg/web/static/img/linkedin-icon.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/pkg/web/static/img/microsoft-icon.svg b/pkg/web/static/img/microsoft-icon.svg index 739c395..309f2c2 100644 --- a/pkg/web/static/img/microsoft-icon.svg +++ b/pkg/web/static/img/microsoft-icon.svg @@ -6,4 +6,4 @@ - \ No newline at end of file + diff --git a/pkg/web/static/main.css b/pkg/web/static/main.css index 287eb47..bff6bd6 100644 --- a/pkg/web/static/main.css +++ b/pkg/web/static/main.css @@ -162,5 +162,3 @@ input { text-align: center; display: block; } - - diff --git a/pkg/web/templates/footer.html b/pkg/web/templates/footer.html index 0f7d808..64584ee 100644 --- a/pkg/web/templates/footer.html +++ b/pkg/web/templates/footer.html @@ -1,3 +1,3 @@ - \ No newline at end of file + diff --git a/swagger.yaml b/swagger.yaml index 7a40ebd..254340a 100644 --- a/swagger.yaml +++ b/swagger.yaml @@ -362,8 +362,7 @@ components: schemas: Metadata: type: object - additionalProperties: - type: string + additionalProperties: {} ClientOptions: type: object properties: @@ -538,4 +537,4 @@ components: data: type: array items: - $ref: '#/components/schemas/User' \ No newline at end of file + $ref: '#/components/schemas/User' From ac7c83c8f9265d8c439d7f4d9e3253c494ad991f Mon Sep 17 00:00:00 2001 From: Ragot Geoffrey Date: Wed, 23 Nov 2022 12:57:44 +0100 Subject: [PATCH 4/5] chore: lint issues and tests --- authclient/api_clients.go | 20 +-- authclient/api_scopes.go | 14 +- authclient/api_users.go | 2 +- authclient/client.go | 144 ++++++++++++++----- authclient/model_client_options.go | 15 +- authclient/model_client_secret.go | 19 ++- authclient/model_create_client_response.go | 13 +- authclient/model_create_scope_response.go | 13 +- authclient/model_create_secret_response.go | 13 +- authclient/model_list_clients_response.go | 13 +- authclient/model_list_scopes_response.go | 13 +- authclient/model_list_users_response.go | 13 +- authclient/model_read_client_response.go | 13 +- authclient/model_read_user_response.go | 13 +- authclient/model_scope_options.go | 15 +- authclient/model_secret_options.go | 15 +- authclient/model_user.go | 13 +- authclient/test/api_clients_test.go | 160 ++++++++++----------- authclient/test/api_scopes_test.go | 126 ++++++++-------- authclient/test/api_users_test.go | 44 +++--- authclient/utils.go | 28 ++-- cmd/serve.go | 4 +- pkg/api/authorization/accesstoken_test.go | 2 +- pkg/oidc/oidc_test.go | 2 +- 24 files changed, 475 insertions(+), 252 deletions(-) diff --git a/authclient/api_clients.go b/authclient/api_clients.go index 19981a7..66a5733 100644 --- a/authclient/api_clients.go +++ b/authclient/api_clients.go @@ -65,8 +65,8 @@ func (a *ClientsApiService) AddScopeToClientExecute(r ApiAddScopeToClientRequest } localVarPath := localBasePath + "/clients/{clientId}/scopes/{scopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterValueToString(r.clientId, "clientId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterValueToString(r.scopeId, "scopeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -269,7 +269,7 @@ func (a *ClientsApiService) CreateSecretExecute(r ApiCreateSecretRequest) (*Crea } localVarPath := localBasePath + "/clients/{clientId}/secrets" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterValueToString(r.clientId, "clientId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -370,7 +370,7 @@ func (a *ClientsApiService) DeleteClientExecute(r ApiDeleteClientRequest) (*http } localVarPath := localBasePath + "/clients/{clientId}" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterValueToString(r.clientId, "clientId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -463,8 +463,8 @@ func (a *ClientsApiService) DeleteScopeFromClientExecute(r ApiDeleteScopeFromCli } localVarPath := localBasePath + "/clients/{clientId}/scopes/{scopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterValueToString(r.clientId, "clientId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterValueToString(r.scopeId, "scopeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -557,8 +557,8 @@ func (a *ClientsApiService) DeleteSecretExecute(r ApiDeleteSecretRequest) (*http } localVarPath := localBasePath + "/clients/{clientId}/secrets/{secretId}" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"secretId"+"}", url.PathEscape(parameterToString(r.secretId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterValueToString(r.clientId, "clientId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"secretId"+"}", url.PathEscape(parameterValueToString(r.secretId, "secretId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -747,7 +747,7 @@ func (a *ClientsApiService) ReadClientExecute(r ApiReadClientRequest) (*ReadClie } localVarPath := localBasePath + "/clients/{clientId}" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterValueToString(r.clientId, "clientId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -854,7 +854,7 @@ func (a *ClientsApiService) UpdateClientExecute(r ApiUpdateClientRequest) (*Crea } localVarPath := localBasePath + "/clients/{clientId}" - localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterToString(r.clientId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"clientId"+"}", url.PathEscape(parameterValueToString(r.clientId, "clientId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/authclient/api_scopes.go b/authclient/api_scopes.go index 9af5173..1e6ef9f 100644 --- a/authclient/api_scopes.go +++ b/authclient/api_scopes.go @@ -67,8 +67,8 @@ func (a *ScopesApiService) AddTransientScopeExecute(r ApiAddTransientScopeReques } localVarPath := localBasePath + "/scopes/{scopeId}/transient/{transientScopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"transientScopeId"+"}", url.PathEscape(parameterToString(r.transientScopeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterValueToString(r.scopeId, "scopeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"transientScopeId"+"}", url.PathEscape(parameterValueToString(r.transientScopeId, "transientScopeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -267,7 +267,7 @@ func (a *ScopesApiService) DeleteScopeExecute(r ApiDeleteScopeRequest) (*http.Re } localVarPath := localBasePath + "/scopes/{scopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterValueToString(r.scopeId, "scopeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -362,8 +362,8 @@ func (a *ScopesApiService) DeleteTransientScopeExecute(r ApiDeleteTransientScope } localVarPath := localBasePath + "/scopes/{scopeId}/transient/{transientScopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"transientScopeId"+"}", url.PathEscape(parameterToString(r.transientScopeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterValueToString(r.scopeId, "scopeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"transientScopeId"+"}", url.PathEscape(parameterValueToString(r.transientScopeId, "transientScopeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -556,7 +556,7 @@ func (a *ScopesApiService) ReadScopeExecute(r ApiReadScopeRequest) (*CreateScope } localVarPath := localBasePath + "/scopes/{scopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterValueToString(r.scopeId, "scopeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -665,7 +665,7 @@ func (a *ScopesApiService) UpdateScopeExecute(r ApiUpdateScopeRequest) (*CreateS } localVarPath := localBasePath + "/scopes/{scopeId}" - localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterToString(r.scopeId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"scopeId"+"}", url.PathEscape(parameterValueToString(r.scopeId, "scopeId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/authclient/api_users.go b/authclient/api_users.go index f523171..9486255 100644 --- a/authclient/api_users.go +++ b/authclient/api_users.go @@ -165,7 +165,7 @@ func (a *UsersApiService) ReadUserExecute(r ApiReadUserRequest) (*ReadUserRespon } localVarPath := localBasePath + "/users/{userId}" - localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterToString(r.userId, "")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"userId"+"}", url.PathEscape(parameterValueToString(r.userId, "userId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} diff --git a/authclient/client.go b/authclient/client.go index 95d321c..f206b2b 100644 --- a/authclient/client.go +++ b/authclient/client.go @@ -39,6 +39,8 @@ import ( var ( jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" ) ) // APIClient manages communication with the Auth API API vAUTH_VERSION @@ -131,28 +133,101 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { 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 +func parameterValueToString( obj interface{}, key string ) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + return fmt.Sprintf("%v", obj) + } + var param,ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap,err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} - switch collectionFormat { - case "pipes": - delimiter = "|" - case "ssv": - delimiter = " " - case "tsv": - delimiter = "\t" - case "csv": - delimiter = "," - } +// parameterAddToQuery adds the provided object to the url query supporting deep object syntax +func parameterAddToQuery(queryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t,ok := obj.(MappedNullable); ok { + dataMap,err := t.ToMap() + if err != nil { + return + } + parameterAddToQuery(queryParams, keyPrefix, dataMap, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToQuery(queryParams, keyPrefix, t.Format(time.RFC3339), collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i:=0;i Date: Thu, 24 Nov 2022 09:28:43 +0100 Subject: [PATCH 5/5] feat(opentelemetry): update libs to catch error logs --- go.mod | 38 ++++++++++++++-------------- go.sum | 79 ++++++++++++++++++++++++++++++---------------------------- 2 files changed, 60 insertions(+), 57 deletions(-) diff --git a/go.mod b/go.mod index 93bf45c..d0a4c2a 100644 --- a/go.mod +++ b/go.mod @@ -3,9 +3,9 @@ module github.com/formancehq/auth go 1.18 require ( - github.com/formancehq/go-libs v1.1.0 - github.com/formancehq/go-libs/sharedhealth v0.0.0-20221118095941-c137790c3362 - github.com/formancehq/go-libs/sharedotlp v0.0.0-20221118095941-c137790c3362 + github.com/formancehq/go-libs v1.2.1-0.20221124082706-09db8cefd5b4 + github.com/formancehq/go-libs/sharedhealth v0.0.0-20221124082706-09db8cefd5b4 + github.com/formancehq/go-libs/sharedotlp v0.0.0-20221124082706-09db8cefd5b4 github.com/golang-jwt/jwt v3.2.2+incompatible github.com/google/uuid v1.3.0 github.com/gorilla/mux v1.8.0 @@ -14,15 +14,15 @@ require ( github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.5.0 github.com/spf13/viper v1.13.0 - github.com/stretchr/testify v1.8.0 + github.com/stretchr/testify v1.8.1 github.com/zitadel/oidc v1.8.0 go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.35.0 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.36.4 go.opentelemetry.io/otel v1.11.1 go.opentelemetry.io/otel/trace v1.11.1 go.uber.org/fx v1.18.1 - golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 - golang.org/x/text v0.3.7 + golang.org/x/oauth2 v0.2.0 + golang.org/x/text v0.4.0 gopkg.in/square/go-jose.v2 v2.6.0 gorm.io/driver/postgres v1.3.10 gorm.io/driver/sqlite v1.3.6 @@ -31,7 +31,7 @@ require ( ) require ( - github.com/cenkalti/backoff/v4 v4.1.3 // indirect + github.com/cenkalti/backoff/v4 v4.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/felixge/httpsnoop v1.0.3 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect @@ -41,7 +41,7 @@ require ( github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/schema v1.2.0 // indirect github.com/gorilla/securecookie v1.1.1 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jackc/chunkreader/v2 v2.0.1 // indirect @@ -68,25 +68,25 @@ require ( github.com/subosito/gotenv v1.4.1 // indirect github.com/zitadel/logging v0.3.4 // indirect go.opentelemetry.io/contrib/propagators/b3 v1.11.1 // indirect - go.opentelemetry.io/otel/exporters/jaeger v1.10.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.10.0 // indirect - go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.10.0 // indirect + go.opentelemetry.io/otel/exporters/jaeger v1.11.1 // indirect + go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.1 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.1 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.1 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.11.1 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.1 // indirect go.opentelemetry.io/otel/metric v0.33.0 // indirect - go.opentelemetry.io/otel/sdk v1.10.0 // indirect + go.opentelemetry.io/otel/sdk v1.11.1 // indirect go.opentelemetry.io/proto/otlp v0.19.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/dig v1.15.0 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.23.0 // indirect golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect - golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect - golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect + golang.org/x/net v0.2.0 // indirect + golang.org/x/sys v0.2.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa // indirect - google.golang.org/grpc v1.49.0 // indirect + google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 // indirect + google.golang.org/grpc v1.51.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index da3f869..52a9f4a 100644 --- a/go.sum +++ b/go.sum @@ -43,8 +43,8 @@ github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0 github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= -github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= -github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= +github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -80,12 +80,12 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.3 h1:s/nj+GCswXYzN5v2DpNMuMQYe+0DDwt5WVCU6CWBdXk= github.com/felixge/httpsnoop v1.0.3/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/formancehq/go-libs v1.1.0 h1:sIb07+OyJvOKO2F6anEQ/CRczPXh0KS8+bcFhWYUwUw= -github.com/formancehq/go-libs v1.1.0/go.mod h1:9pIcaXQR4O1biXDfhFurYJZw1piU6sJk+0Vqvu+92ng= -github.com/formancehq/go-libs/sharedhealth v0.0.0-20221118095941-c137790c3362 h1:VQc17mL5YYKZktXtsPt9LDLLpAQ0/X0Uio7tXHdtob0= -github.com/formancehq/go-libs/sharedhealth v0.0.0-20221118095941-c137790c3362/go.mod h1:4TBSSGGBeY6xCaqI4gw74ouwgirdZjvKlv001kQ8xp0= -github.com/formancehq/go-libs/sharedotlp v0.0.0-20221118095941-c137790c3362 h1:gGuvT1f/Ef4p5i/pYbIo9UTaADFGIWIHPooJICnq018= -github.com/formancehq/go-libs/sharedotlp v0.0.0-20221118095941-c137790c3362/go.mod h1:2yT660i6Ay5d5EtMpJgUl6J+wMS1mUBO1SIoCJO2Shc= +github.com/formancehq/go-libs v1.2.1-0.20221124082706-09db8cefd5b4 h1:dyyLZWtcnyZvygR7/4VIdha+s8Qb7ZCuxgAj/FVzdKo= +github.com/formancehq/go-libs v1.2.1-0.20221124082706-09db8cefd5b4/go.mod h1:9pIcaXQR4O1biXDfhFurYJZw1piU6sJk+0Vqvu+92ng= +github.com/formancehq/go-libs/sharedhealth v0.0.0-20221124082706-09db8cefd5b4 h1:Q6sfMjue0xoqRKU/s4TqC0pUid1rh5/bbDV5GbmJ7/U= +github.com/formancehq/go-libs/sharedhealth v0.0.0-20221124082706-09db8cefd5b4/go.mod h1:4TBSSGGBeY6xCaqI4gw74ouwgirdZjvKlv001kQ8xp0= +github.com/formancehq/go-libs/sharedotlp v0.0.0-20221124082706-09db8cefd5b4 h1:cUfocGRkHYKOXkVZwhmbC0Q70aVo/ezhSSNbo2IVZ58= +github.com/formancehq/go-libs/sharedotlp v0.0.0-20221124082706-09db8cefd5b4/go.mod h1:sY3SY+G3EDNd9sELK6UbDYx3Ah+hJJsEnBU9Dq28ZSw= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= @@ -183,8 +183,8 @@ github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyC github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 h1:lLT7ZLSzGLI08vc9cpd+tYmNWjdKDqyr/2L+f6U12Fk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0 h1:t7uX3JBHdVwAi3G7sSSdbsk8NfgA+LnUS88V/2EKaA0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.14.0/go.mod h1:4OGVnY4qf2+gw+ssiHbW+pq4mo2yko94YxxMmXZ7jCA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -322,16 +322,18 @@ github.com/spf13/viper v1.13.0/go.mod h1:Icm2xNL3/8uyh/wFuB1jI7TiTNKp8632Nwegu+z 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= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -358,22 +360,22 @@ go.opentelemetry.io/contrib/propagators/b3 v1.11.1 h1:icQ6ttRV+r/2fnU46BIo/g/mPu go.opentelemetry.io/contrib/propagators/b3 v1.11.1/go.mod h1:ECIveyMXgnl4gorxFcA7RYjJY/Ql9n20ubhbfDc3QfA= go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4= go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE= -go.opentelemetry.io/otel/exporters/jaeger v1.10.0 h1:7W3aVVjEYayu/GOqOVF4mbTvnCuxF1wWu3eRxFGQXvw= -go.opentelemetry.io/otel/exporters/jaeger v1.10.0/go.mod h1:n9IGyx0fgyXXZ/i0foLHNxtET9CzXHzZeKCucvRBFgA= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y= -go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0 h1:pDDYmo0QadUPal5fwXoY1pmMpFcdyhXOmL5drCrI3vU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.10.0/go.mod h1:Krqnjl22jUJ0HgMzw5eveuCvFDXY4nSYb4F8t5gdrag= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0 h1:KtiUEhQmj/Pa874bVYKGNVdq8NPKiacPbaRRtgXi+t4= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.10.0/go.mod h1:OfUCyyIiDvNXHWpcWgbF+MWvqPZiNa3YDEnivcnYsV0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.10.0 h1:S8DedULB3gp93Rh+9Z+7NTEv+6Id/KYS7LDyipZ9iCE= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.10.0/go.mod h1:5WV40MLWwvWlGP7Xm8g3pMcg0pKOUY609qxJn8y7LmM= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.10.0 h1:c9UtMu/qnbLlVwTwt+ABrURrioEruapIslTDYZHJe2w= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.10.0/go.mod h1:h3Lrh9t3Dnqp3NPwAZx7i37UFX7xrfnO1D+fuClREOA= +go.opentelemetry.io/otel/exporters/jaeger v1.11.1 h1:F9Io8lqWdGyIbY3/SOGki34LX/l+7OL0gXNxjqwcbuQ= +go.opentelemetry.io/otel/exporters/jaeger v1.11.1/go.mod h1:lRa2w3bQ4R4QN6zYsDgy7tEezgoKEu7Ow2g35Y75+KI= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.1 h1:X2GndnMCsUPh6CiY2a+frAbNsXaPLbB0soHRYhAZ5Ig= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.11.1/go.mod h1:i8vjiSzbiUC7wOQplijSXMYUpNM93DtlS5CbUT+C6oQ= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.1 h1:MEQNafcNCB0uQIti/oHgU7CZpUMYQ7qigBwMVKycHvc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.11.1/go.mod h1:19O5I2U5iys38SsmT2uDJja/300woyzE1KPIQxEUBUc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.1 h1:LYyG/f1W/jzAix16jbksJfMQFpOH/Ma6T639pVPMgfI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.11.1/go.mod h1:QrRRQiY3kzAoYPNLP0W/Ikg0gR6V3LMc+ODSxr7yyvg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.11.1 h1:tFl63cpAAcD9TOU6U8kZU7KyXuSRYAZlbx1C61aaB74= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.11.1/go.mod h1:X620Jww3RajCJXw/unA+8IRTgxkdS7pi+ZwK9b7KUJk= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.1 h1:3Yvzs7lgOw8MmbxmLRsQGwYdCubFmUHSooKaEhQunFQ= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.11.1/go.mod h1:pyHDt0YlyuENkD2VwHsiRDf+5DfI3EH7pfhUYW6sQUE= go.opentelemetry.io/otel/metric v0.33.0 h1:xQAyl7uGEYvrLAiV/09iTJlp1pZnQ9Wl793qbVvED1E= go.opentelemetry.io/otel/metric v0.33.0/go.mod h1:QlTYc+EnYNq/M2mNk1qDDMRLpqCOj2f/r5c7Fd5FYaI= -go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY= -go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE= +go.opentelemetry.io/otel/sdk v1.11.1 h1:F7KmQgoHljhUuJyA+9BiU+EkJfyX5nVVF4wyzWZpKxs= +go.opentelemetry.io/otel/sdk v1.11.1/go.mod h1:/l3FE4SupHJ12TduVjUkZtlfFqDCQJlOlithYrdktys= go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ= go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= @@ -390,7 +392,7 @@ go.uber.org/dig v1.15.0 h1:vq3YWr8zRj1eFGC7Gvf907hE0eRjPTZ1d3xHadD6liE= go.uber.org/dig v1.15.0/go.mod h1:pKHs0wMynzL6brANhB2hLMro+zalv1osARTviTcqHLM= go.uber.org/fx v1.18.1 h1:I7VWkdv4iKcbpH7KVSi9Fe1LGmpJv+pbBIb9NidPb+E= go.uber.org/fx v1.18.1/go.mod h1:g0V1KMQ66zIRk8bLu3Ea5Jt2w/cHlOIp4wdRsgh0JaY= -go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk= 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= @@ -488,8 +490,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI= -golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -500,8 +502,8 @@ golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= -golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= +golang.org/x/oauth2 v0.2.0 h1:GtQkldQ9m7yvzCL1V+LrYow3Khe0eJH0w7RbX/VbaIU= +golang.org/x/oauth2 v0.2.0/go.mod h1:Cwn6afJ8jrQwYMxQDTpISoXmXW9I6qF6vDeuuoX3Ibs= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -560,8 +562,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220207234003-57398862261d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc= -golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A= +golang.org/x/sys v0.2.0/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/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -572,8 +574,9 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 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/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= 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= @@ -701,8 +704,8 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa h1:VWkrxnAx2C2hirAP+W5ADU7e/+93Yhk//ioKd2XFyDI= -google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6 h1:a2S6M0+660BgMNl++4JPlcAO/CjkqYItDEZwkoDQK7c= +google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -723,8 +726,8 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw= -google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.51.0 h1:E1eGv1FTqoLIdnBCZufiSHgKjlqG6fKFf6pPWtMTh8U= +google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsAIPww= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=